From ee09b41ea277ee3916509e8c2ee3145b3b2e6518 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Sep 2006 18:51:00 +0400 Subject: [PATCH 001/789] BUG#20492: Subsequent calls to stored procedure yield incorrect result if join is used For procedures with selects that use complicated joins with ON expression re-execution could erroneously ignore this ON expression, giving incorrect result. The problem was that optimized ON expression wasn't saved for re-execution. The solution is to properly save it. mysql-test/r/sp.result: Add result for bug#20492: Subsequent calls to stored procedure yield incorrect result if join is used. mysql-test/t/sp.test: Add test case for bug#20492: Subsequent calls to stored procedure yield incorrect result if join is used. sql/sql_select.cc: Save modified ON expression for re-execution. --- mysql-test/r/sp.result | 26 ++++++++++++++++++++++++++ mysql-test/t/sp.test | 41 +++++++++++++++++++++++++++++++++++++++++ sql/sql_select.cc | 11 ++++++++--- 3 files changed, 75 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 854935b071b..9e4fdb6c6b8 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5394,4 +5394,30 @@ Procedure sql_mode Create Procedure bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`() show create procedure bug21416 drop procedure bug21416| +DROP PROCEDURE IF EXISTS p1| +DROP VIEW IF EXISTS v1, v2| +DROP TABLE IF EXISTS t3, t4| +CREATE TABLE t3 (t3_id INT)| +INSERT INTO t3 VALUES (0)| +INSERT INTO t3 VALUES (1)| +CREATE TABLE t4 (t4_id INT)| +INSERT INTO t4 VALUES (2)| +CREATE VIEW v1 AS +SELECT t3.t3_id, t4.t4_id +FROM t3 JOIN t4 ON t3.t3_id = 0| +CREATE VIEW v2 AS +SELECT t3.t3_id AS t3_id_1, v1.t3_id AS t3_id_2, v1.t4_id +FROM t3 LEFT JOIN v1 ON t3.t3_id = 0| +CREATE PROCEDURE p1() SELECT * FROM v2| +CALL p1()| +t3_id_1 t3_id_2 t4_id +0 0 2 +1 NULL NULL +CALL p1()| +t3_id_1 t3_id_2 t4_id +0 0 2 +1 NULL NULL +DROP PROCEDURE p1| +DROP VIEW v1, v2| +DROP TABLE t3, t4| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 4b0f463a9e3..b355829d7c7 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6322,6 +6322,47 @@ create procedure bug21416() show create procedure bug21416| call bug21416()| drop procedure bug21416| + +# +# BUG#20492: Subsequent calls to stored procedure yeild incorrect +# result if join is used +# +# Optimized ON expression in join wasn't properly saved for reuse. +# +--disable_warnings +DROP PROCEDURE IF EXISTS p1| +DROP VIEW IF EXISTS v1, v2| +DROP TABLE IF EXISTS t3, t4| +--enable_warnings + +CREATE TABLE t3 (t3_id INT)| + +INSERT INTO t3 VALUES (0)| +INSERT INTO t3 VALUES (1)| + +CREATE TABLE t4 (t4_id INT)| + +INSERT INTO t4 VALUES (2)| + +CREATE VIEW v1 AS +SELECT t3.t3_id, t4.t4_id +FROM t3 JOIN t4 ON t3.t3_id = 0| + +CREATE VIEW v2 AS +SELECT t3.t3_id AS t3_id_1, v1.t3_id AS t3_id_2, v1.t4_id +FROM t3 LEFT JOIN v1 ON t3.t3_id = 0| + +CREATE PROCEDURE p1() SELECT * FROM v2| + +# Results should not differ. +CALL p1()| +CALL p1()| + +DROP PROCEDURE p1| +DROP VIEW v1, v2| +DROP TABLE t3, t4| + + # # BUG#NNNN: New bug synopsis # diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2f16b350d04..f8779de6d58 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7427,9 +7427,14 @@ simplify_joins(JOIN *join, List *join_list, COND *conds, bool top) */ expr= simplify_joins(join, &nested_join->join_list, expr, FALSE); - table->on_expr= expr; - if (!table->prep_on_expr) + + if (!table->prep_on_expr || expr != table->on_expr) + { + DBUG_ASSERT(expr); + + table->on_expr= expr; table->prep_on_expr= expr->copy_andor_structure(join->thd); + } } nested_join->used_tables= (table_map) 0; nested_join->not_null_tables=(table_map) 0; @@ -7439,7 +7444,7 @@ simplify_joins(JOIN *join, List *join_list, COND *conds, bool top) } else { - if (!(table->prep_on_expr)) + if (!table->prep_on_expr) table->prep_on_expr= table->on_expr; used_tables= table->table->map; if (conds) From ad128072d6f7f9fd7c4f493ccd76827f655dace1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Oct 2006 13:48:04 +0000 Subject: [PATCH 002/789] BUG#21296 Add error messages when upgrading data node storage/ndb/src/kernel/error/ErrorReporter.cpp: Add error messages. --- storage/ndb/src/kernel/error/ErrorReporter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/error/ErrorReporter.cpp b/storage/ndb/src/kernel/error/ErrorReporter.cpp index 6c8bb1fe615..6e54c8a5f99 100644 --- a/storage/ndb/src/kernel/error/ErrorReporter.cpp +++ b/storage/ndb/src/kernel/error/ErrorReporter.cpp @@ -25,6 +25,7 @@ #include #include #include +#include "EventLogger.hpp" #include @@ -40,7 +41,7 @@ static void dumpJam(FILE* jamStream, Uint32 thrdTheEmulatedJamIndex, Uint8 thrdTheEmulatedJam[]); - +extern EventLogger g_eventLogger; const char* ErrorReporter::formatTimeStampString(){ TimeModule DateTime; /* To create "theDateTimeString" */ @@ -196,6 +197,9 @@ ErrorReporter::handleError(int messageID, WriteMessage(messageID, problemData, objRef, theEmulatedJamIndex, theEmulatedJam); + g_eventLogger.info(problemData); + g_eventLogger.info(objRef); + childReportError(messageID); if(messageID == NDBD_EXIT_ERROR_INSERT){ From c078453f929ddcddf67ea4338c286711eb3b31e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Nov 2006 15:35:37 +0100 Subject: [PATCH 003/789] BUG#23171 (Illegal slave restart group position): First patch preparing for restructuring the event execution and event skipping. This patch renames the existing (virtual) function exec_event() to be a primitive for implementing the real patch. Also, the virtual function advance_coord_impl() is added to advance the binary/relay log coordinates, and two non-virtual functions exec_event() [sic] and skip_event() is added that will contain the business logic for executing and skipping events respectively. sql/log.cc: Renaming exec_event() sql/log_event.cc: Renaming exec_event() sql/log_event.h: Renaming exec_event() to apply_event_impl() Addng new non-virtual exec_event() that will contain business logic for event execution. Adding new non-virtual skip_event() that will contain business logic for skipping an event. Adding new virtual advance_coord_impl() as primitive to advance binary/relay log coordinates according to the event's needs. --- sql/log.cc | 2 +- sql/log_event.cc | 278 ++++++++++++++++++++++++----------------------- sql/log_event.h | 213 +++++++++++++++++++++++++++++------- 3 files changed, 315 insertions(+), 178 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index a1ed9bd6df3..83530883fdc 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2411,7 +2411,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name, /* Set 'created' to 0, so that in next relay logs this event does not trigger cleaning actions on the slave in - Format_description_log_event::exec_event(). + Format_description_log_event::apply_event_impl(). */ description_event_for_queue->created= 0; /* Don't set log_pos in event header */ diff --git a/sql/log_event.cc b/sql/log_event.cc index 4a6346bf57c..93650561028 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -532,24 +532,22 @@ Log_event::Log_event(const char* buf, #ifdef HAVE_REPLICATION /* - Log_event::exec_event() + Log_event::apply_event_impl() */ -int Log_event::exec_event(struct st_relay_log_info* rli) +int Log_event::apply_event_impl(RELAY_LOG_INFO* rli) { - DBUG_ENTER("Log_event::exec_event"); + DBUG_ENTER("Log_event::apply_event_impl"); /* - rli is null when (as far as I (Guilhem) know) - the caller is - Load_log_event::exec_event *and* that one is called from - Execute_load_log_event::exec_event. - In this case, we don't do anything here ; - Execute_load_log_event::exec_event will call Log_event::exec_event - again later with the proper rli. - Strictly speaking, if we were sure that rli is null - only in the case discussed above, 'if (rli)' is useless here. - But as we are not 100% sure, keep it for now. + rli is null when (as far as I (Guilhem) know) the caller is + Load_log_event::apply_event_impl *and* that one is called from + Execute_load_log_event::apply_event_impl. In this case, we don't + do anything here ; Execute_load_log_event::apply_event_impl will + call Log_event::apply_event_impl again later with the proper rli. + Strictly speaking, if we were sure that rli is null only in the + case discussed above, 'if (rli)' is useless here. But as we are + not 100% sure, keep it for now. */ if (rli) { @@ -584,13 +582,13 @@ int Log_event::exec_event(struct st_relay_log_info* rli) { rli->inc_group_relay_log_pos(log_pos); flush_relay_log_info(rli); - /* - Note that Rotate_log_event::exec_event() does not call this - function, so there is no chance that a fake rotate event resets - last_master_timestamp. - Note that we update without mutex (probably ok - except in some very - rare cases, only consequence is that value may take some time to - display in Seconds_Behind_Master - not critical). + /* + Note that Rotate_log_event::apply_event_impl() does not call + this function, so there is no chance that a fake rotate event + resets last_master_timestamp. Note that we update without + mutex (probably ok - except in some very rare cases, only + consequence is that value may take some time to display in + Seconds_Behind_Master - not critical). */ rli->last_master_timestamp= when; } @@ -1821,27 +1819,28 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - Query_log_event::exec_event() + Query_log_event::apply_event_impl() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Query_log_event::exec_event(struct st_relay_log_info* rli) +int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { - return exec_event(rli, query, q_len); + return apply_event_impl(rli, query, q_len); } -int Query_log_event::exec_event(struct st_relay_log_info* rli, - const char *query_arg, uint32 q_len_arg) +int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli, + const char *query_arg, uint32 q_len_arg) { LEX_STRING new_db; int expected_error,actual_error= 0; /* - Colleagues: please never free(thd->catalog) in MySQL. This would lead to - bugs as here thd->catalog is a part of an alloced block, not an entire - alloced block (see Query_log_event::exec_event()). Same for thd->db. - Thank you. + Colleagues: please never free(thd->catalog) in MySQL. This would + lead to bugs as here thd->catalog is a part of an alloced block, + not an entire alloced block (see + Query_log_event::apply_event_impl()). Same for thd->db. Thank + you. */ thd->catalog= catalog_len ? (char *) catalog : (char *)""; new_db.length= db_len; @@ -1873,8 +1872,8 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli, its companion query. If the SET is ignored because of db_ok(), the companion query will also be ignored, and if the companion query is ignored in the db_ok() test of - ::exec_event(), then the companion SET also have so we - don't need to reset_one_shot_variables(). + ::apply_event_impl(), then the companion SET also have so + we don't need to reset_one_shot_variables(). */ if (rpl_filter->db_ok(thd->db)) { @@ -2089,7 +2088,7 @@ end: */ return (thd->query_error ? thd->query_error : (thd->one_shot_set ? (rli->inc_event_relay_log_pos(),0) : - Log_event::exec_event(rli))); + Log_event::apply_event_impl(rli))); } #endif @@ -2217,7 +2216,7 @@ bool Start_log_event_v3::write(IO_CACHE* file) /* - Start_log_event_v3::exec_event() + Start_log_event_v3::apply_event_impl() The master started @@ -2236,9 +2235,9 @@ bool Start_log_event_v3::write(IO_CACHE* file) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Start_log_event_v3::exec_event(struct st_relay_log_info* rli) +int Start_log_event_v3::apply_event_impl(RELAY_LOG_INFO* rli) { - DBUG_ENTER("Start_log_event_v3::exec_event"); + DBUG_ENTER("Start_log_event_v3::apply_event_impl"); switch (binlog_version) { case 3: @@ -2280,7 +2279,7 @@ int Start_log_event_v3::exec_event(struct st_relay_log_info* rli) /* this case is impossible */ DBUG_RETURN(1); } - DBUG_RETURN(Log_event::exec_event(rli)); + DBUG_RETURN(Log_event::apply_event_impl(rli)); } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -2469,18 +2468,18 @@ bool Format_description_log_event::write(IO_CACHE* file) /* SYNOPSIS - Format_description_log_event::exec_event() + Format_description_log_event::apply_event_impl() IMPLEMENTATION - Save the information which describes the binlog's format, to be able to - read all coming events. - Call Start_log_event_v3::exec_event(). + Save the information which describes the binlog's format, to be + able to read all coming events. Call + Start_log_event_v3::apply_event_impl(). */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Format_description_log_event::exec_event(struct st_relay_log_info* rli) +int Format_description_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { - DBUG_ENTER("Format_description_log_event::exec_event"); + DBUG_ENTER("Format_description_log_event::apply_event_impl"); /* save the information describing this binlog */ delete rli->relay_log.description_event_for_exec; @@ -2510,9 +2509,9 @@ int Format_description_log_event::exec_event(struct st_relay_log_info* rli) } #endif /* - If this event comes from ourselves, there is no cleaning task to perform, - we don't call Start_log_event_v3::exec_event() (this was just to update the - log's description event). + If this event comes from ourselves, there is no cleaning task to + perform, we don't call Start_log_event_v3::apply_event_impl() + (this was just to update the log's description event). */ if (server_id == (uint32) ::server_id) { @@ -2541,7 +2540,7 @@ int Format_description_log_event::exec_event(struct st_relay_log_info* rli) replication rli->group_master_log_pos will be 0, then 96, then jump to first really asked event (which is >96). So this is ok. */ - DBUG_RETURN(Start_log_event_v3::exec_event(rli)); + DBUG_RETURN(Start_log_event_v3::apply_event_impl(rli)); } #endif @@ -3024,29 +3023,31 @@ void Load_log_event::set_fields(const char* affected_db, Does the data loading job when executing a LOAD DATA on the slave SYNOPSIS - Load_log_event::exec_event - net - rli - use_rli_only_for_errors - if set to 1, rli is provided to - Load_log_event::exec_event only for this - function to have RPL_LOG_NAME and - rli->last_slave_error, both being used by - error reports. rli's position advancing - is skipped (done by the caller which is - Execute_load_log_event::exec_event). - - if set to 0, rli is provided for full use, - i.e. for error reports and position - advancing. + Load_log_event::apply_event_impl + net + rli + use_rli_only_for_errors - if set to 1, rli is provided to + Load_log_event::apply_event_impl + only for this function to have + RPL_LOG_NAME and + rli->last_slave_error, both being + used by error reports. rli's + position advancing is skipped (done + by the caller which is + Execute_load_log_event::apply_event_impl). + - if set to 0, rli is provided for + full use, i.e. for error reports and + position advancing. DESCRIPTION Does the data loading job when executing a LOAD DATA on the slave - + RETURN VALUE - 0 Success + 0 Success 1 Failure */ -int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, +int Load_log_event::apply_event_impl(NET* net, RELAY_LOG_INFO* rli, bool use_rli_only_for_errors) { LEX_STRING new_db; @@ -3058,7 +3059,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, thd->query_error= 0; clear_all_errors(thd, rli); - /* see Query_log_event::exec_event() and BUG#13360 */ + /* see Query_log_event::apply_event_impl() and BUG#13360 */ DBUG_ASSERT(!rli->m_table_map.count()); /* Usually mysql_init_query() is called by mysql_parse(), but we need it here @@ -3067,22 +3068,26 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, mysql_init_query(thd, 0, 0); if (!use_rli_only_for_errors) { - /* Saved for InnoDB, see comment in Query_log_event::exec_event() */ + /* + Saved for InnoDB, see comment in + Query_log_event::apply_event_impl() + */ rli->future_group_master_log_pos= log_pos; DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos)); } /* - 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 - big LOAD DATA INFILE on the master will still consume a lot of space on - the slave (space in the relay log + space of temp files: twice the space - of the file to load...) even if it will finally be ignored. - TODO: fix this; this can be done by testing rules in - Create_file_log_event::exec_event() and then discarding Append_block and - al. Another way is do the filtering in the I/O thread (more efficient: no - disk writes at all). + 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 big LOAD DATA INFILE on the master will + still consume a lot of space on the slave (space in the relay log + + space of temp files: twice the space of the file to load...) + even if it will finally be ignored. TODO: fix this; this can be + done by testing rules in Create_file_log_event::apply_event_impl() + and then discarding Append_block and al. Another way is do the + filtering in the I/O thread (more efficient: no disk writes at + all). Note: We do not need to execute reset_one_shot_variables() if this @@ -3091,8 +3096,8 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, its companion query. If the SET is ignored because of db_ok(), the companion query will also be ignored, and if the companion query is ignored in the db_ok() test of - ::exec_event(), then the companion SET also have so we - don't need to reset_one_shot_variables(). + ::apply_event_impl(), then the companion SET also have so + we don't need to reset_one_shot_variables(). */ if (rpl_filter->db_ok(thd->db)) { @@ -3288,7 +3293,7 @@ Fatal error running LOAD DATA INFILE on table '%s'. Default database: '%s'", return 1; } - return ( use_rli_only_for_errors ? 0 : Log_event::exec_event(rli) ); + return ( use_rli_only_for_errors ? 0 : Log_event::apply_event_impl(rli) ); } #endif @@ -3402,7 +3407,7 @@ bool Rotate_log_event::write(IO_CACHE* file) #endif /* - Rotate_log_event::exec_event() + Rotate_log_event::apply_event_impl() Got a rotate log event from the master @@ -3419,9 +3424,9 @@ bool Rotate_log_event::write(IO_CACHE* file) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Rotate_log_event::exec_event(struct st_relay_log_info* rli) +int Rotate_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { - DBUG_ENTER("Rotate_log_event::exec_event"); + DBUG_ENTER("Rotate_log_event::apply_event_impl"); pthread_mutex_lock(&rli->data_lock); rli->event_relay_log_pos= my_b_tell(rli->cur_log); @@ -3572,11 +3577,11 @@ void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - Intvar_log_event::exec_event() + Intvar_log_event::apply_event_impl() */ #if defined(HAVE_REPLICATION)&& !defined(MYSQL_CLIENT) -int Intvar_log_event::exec_event(struct st_relay_log_info* rli) +int Intvar_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { switch (type) { case LAST_INSERT_ID_EVENT: @@ -3651,7 +3656,7 @@ void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Rand_log_event::exec_event(struct st_relay_log_info* rli) +int Rand_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { thd->rand.seed1= (ulong) seed1; thd->rand.seed2= (ulong) seed2; @@ -3724,12 +3729,12 @@ void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Xid_log_event::exec_event(struct st_relay_log_info* rli) +int Xid_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { /* For a slave Xid_log_event is COMMIT */ general_log_print(thd, COM_QUERY, "COMMIT /* implicit, from Xid_log_event */"); - return end_trans(thd, COMMIT) || Log_event::exec_event(rli); + return end_trans(thd, COMMIT) || Log_event::apply_event_impl(rli); } #endif /* !MYSQL_CLIENT */ @@ -4005,11 +4010,11 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - User_var_log_event::exec_event() + User_var_log_event::apply_event_impl() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int User_var_log_event::exec_event(struct st_relay_log_info* rli) +int User_var_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { Item *it= 0; CHARSET_INFO *charset; @@ -4113,7 +4118,7 @@ void Slave_log_event::pack_info(Protocol *protocol) #ifndef MYSQL_CLIENT Slave_log_event::Slave_log_event(THD* thd_arg, - struct st_relay_log_info* rli) + RELAY_LOG_INFO* rli) :Log_event(thd_arg, 0, 0) , mem_pool(0), master_host(0) { DBUG_ENTER("Slave_log_event"); @@ -4223,11 +4228,11 @@ Slave_log_event::Slave_log_event(const char* buf, uint event_len) #ifndef MYSQL_CLIENT -int Slave_log_event::exec_event(struct st_relay_log_info* rli) +int Slave_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { if (mysql_bin_log.is_open()) mysql_bin_log.write(this); - return Log_event::exec_event(rli); + return Log_event::apply_event_impl(rli); } #endif /* !MYSQL_CLIENT */ @@ -4256,21 +4261,21 @@ void Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - Stop_log_event::exec_event() + Stop_log_event::apply_event_impl() - The master stopped. - We used to clean up all temporary tables but this is useless as, as the - master has shut down properly, it has written all DROP TEMPORARY TABLE - (prepared statements' deletion is TODO only when we binlog prep stmts). - We used to clean up slave_load_tmpdir, but this is useless as it has been - cleared at the end of LOAD DATA INFILE. - So we have nothing to do here. - The place were we must do this cleaning is in Start_log_event_v3::exec_event(), - not here. Because if we come here, the master was sane. + The master stopped. We used to clean up all temporary tables but + this is useless as, as the master has shut down properly, it has + written all DROP TEMPORARY TABLE (prepared statements' deletion is + TODO only when we binlog prep stmts). We used to clean up + slave_load_tmpdir, but this is useless as it has been cleared at the + end of LOAD DATA INFILE. So we have nothing to do here. The place + were we must do this cleaning is in + Start_log_event_v3::apply_event_impl(), not here. Because if we come + here, the master was sane. */ #ifndef MYSQL_CLIENT -int Stop_log_event::exec_event(struct st_relay_log_info* rli) +int Stop_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { /* We do not want to update master_log pos because we get a rotate event @@ -4478,11 +4483,11 @@ void Create_file_log_event::pack_info(Protocol *protocol) /* - Create_file_log_event::exec_event() + Create_file_log_event::apply_event_impl() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Create_file_log_event::exec_event(struct st_relay_log_info* rli) +int Create_file_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { char proc_info[17+FN_REFLEN+10], *fname_buf; char *ext; @@ -4544,7 +4549,7 @@ err: if (fd >= 0) my_close(fd, MYF(0)); thd->proc_info= 0; - return error ? 1 : Log_event::exec_event(rli); + return error ? 1 : Log_event::apply_event_impl(rli); } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -4652,15 +4657,15 @@ int Append_block_log_event::get_create_or_append() const } /* - Append_block_log_event::exec_event() + Append_block_log_event::apply_event_impl() */ -int Append_block_log_event::exec_event(struct st_relay_log_info* rli) +int Append_block_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { char proc_info[17+FN_REFLEN+10], *fname= proc_info+17; int fd; int error = 1; - DBUG_ENTER("Append_block_log_event::exec_event"); + DBUG_ENTER("Append_block_log_event::apply_event_impl"); fname= strmov(proc_info, "Making temp file "); slave_load_file_stem(fname, file_id, server_id, ".data"); @@ -4699,7 +4704,7 @@ err: if (fd >= 0) my_close(fd, MYF(0)); thd->proc_info= 0; - DBUG_RETURN(error ? error : Log_event::exec_event(rli)); + DBUG_RETURN(error ? error : Log_event::apply_event_impl(rli)); } #endif @@ -4783,18 +4788,18 @@ void Delete_file_log_event::pack_info(Protocol *protocol) #endif /* - Delete_file_log_event::exec_event() + Delete_file_log_event::apply_event_impl() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Delete_file_log_event::exec_event(struct st_relay_log_info* rli) +int Delete_file_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { char fname[FN_REFLEN+10]; char *ext= slave_load_file_stem(fname, file_id, server_id, ".data"); (void) my_delete(fname, MYF(MY_WME)); strmov(ext, ".info"); (void) my_delete(fname, MYF(MY_WME)); - return Log_event::exec_event(rli); + return Log_event::apply_event_impl(rli); } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -4880,10 +4885,10 @@ void Execute_load_log_event::pack_info(Protocol *protocol) /* - Execute_load_log_event::exec_event() + Execute_load_log_event::apply_event_impl() */ -int Execute_load_log_event::exec_event(struct st_relay_log_info* rli) +int Execute_load_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { char fname[FN_REFLEN+10]; char *ext; @@ -4914,14 +4919,15 @@ int Execute_load_log_event::exec_event(struct st_relay_log_info* rli) lev->thd = thd; /* - lev->exec_event should use rli only for errors - i.e. should not advance rli's position. - lev->exec_event is the place where the table is loaded (it calls - mysql_load()). + lev->apply_event_impl should use rli only for errors i.e. should + not advance rli's position. + + lev->apply_event_impl is the place where the table is loaded (it + calls mysql_load()). */ rli->future_group_master_log_pos= log_pos; - if (lev->exec_event(0,rli,1)) + if (lev->apply_event_impl(0,rli,1)) { /* We want to indicate the name of the file that could not be loaded @@ -4964,7 +4970,7 @@ err: my_close(fd, MYF(0)); end_io_cache(&file); } - return error ? error : Log_event::exec_event(rli); + return error ? error : Log_event::apply_event_impl(rli); } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -5132,7 +5138,7 @@ void Execute_load_query_log_event::pack_info(Protocol *protocol) int -Execute_load_query_log_event::exec_event(struct st_relay_log_info* rli) +Execute_load_query_log_event::apply_event_impl(RELAY_LOG_INFO* rli) { char *p; char *buf; @@ -5169,7 +5175,7 @@ Execute_load_query_log_event::exec_event(struct st_relay_log_info* rli) p= strmake(p, STRING_WITH_LEN(" INTO")); p= strmake(p, query+fn_pos_end, q_len-fn_pos_end); - error= Query_log_event::exec_event(rli, buf, p-buf); + error= Query_log_event::apply_event_impl(rli, buf, p-buf); /* Forging file name for deletion in same buffer */ *fname_end= 0; @@ -5584,9 +5590,9 @@ unpack_row(RELAY_LOG_INFO *rli, return error; } -int Rows_log_event::exec_event(st_relay_log_info *rli) +int Rows_log_event::apply_event_impl(st_relay_log_info *rli) { - DBUG_ENTER("Rows_log_event::exec_event(st_relay_log_info*)"); + DBUG_ENTER("Rows_log_event::apply_event_impl(st_relay_log_info*)"); int error= 0; char const *row_start= (char const *)m_rows_buf; @@ -5613,7 +5619,8 @@ int Rows_log_event::exec_event(st_relay_log_info *rli) /* 'thd' has been set by exec_relay_log_event(), just before calling - exec_event(). We still check here to prevent future coding errors. + apply_event_impl(). We still check here to prevent future coding + errors. */ DBUG_ASSERT(rli->sql_thd == thd); @@ -5629,8 +5636,9 @@ int Rows_log_event::exec_event(st_relay_log_info *rli) /* lock_tables() reads the contents of thd->lex, so they must be - initialized. Contrary to in Table_map_log_event::exec_event() we don't - call mysql_init_query() as that may reset the binlog format. + initialized. Contrary to in + Table_map_log_event::apply_event_impl() we don't call + mysql_init_query() as that may reset the binlog format. */ lex_start(thd, NULL, 0); @@ -5710,8 +5718,8 @@ int Rows_log_event::exec_event(st_relay_log_info *rli) { /* table == NULL means that this table should not be replicated - (this was set up by Table_map_log_event::exec_event() which - tested replicate-* rules). + (this was set up by Table_map_log_event::apply_event_impl() + which tested replicate-* rules). */ /* @@ -5863,7 +5871,7 @@ int Rows_log_event::exec_event(st_relay_log_info *rli) do not become visible. We still prefer to wipe them out. */ thd->clear_error(); - error= Log_event::exec_event(rli); + error= Log_event::apply_event_impl(rli); } else slave_print_msg(ERROR_LEVEL, rli, error, @@ -6127,9 +6135,9 @@ Table_map_log_event::~Table_map_log_event() */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) -int Table_map_log_event::exec_event(st_relay_log_info *rli) +int Table_map_log_event::apply_event_impl(st_relay_log_info *rli) { - DBUG_ENTER("Table_map_log_event::exec_event(st_relay_log_info*)"); + DBUG_ENTER("Table_map_log_event::apply_event_impl(st_relay_log_info*)"); DBUG_ASSERT(rli->sql_thd == thd); @@ -6240,10 +6248,10 @@ int Table_map_log_event::exec_event(st_relay_log_info *rli) } /* - We explicitly do not call Log_event::exec_event() here since we do not - want the relay log position to be flushed to disk. The flushing will be - done by the last Rows_log_event that either ends a statement (outside a - transaction) or a transaction. + We explicitly do not call Log_event::apply_event_impl() here since + we do not want the relay log position to be flushed to disk. The + flushing will be done by the last Rows_log_event that either ends + a statement (outside a transaction) or a transaction. A table map event can *never* end a transaction or a statement, so we just step the relay log position. diff --git a/sql/log_event.h b/sql/log_event.h index 81ce2f18b4d..794cf410841 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -477,6 +477,7 @@ class THD; class Format_description_log_event; struct st_relay_log_info; +typedef st_relay_log_info RELAY_LOG_INFO; #ifdef MYSQL_CLIENT /* @@ -631,16 +632,48 @@ public: static void init_show_field_list(List* field_list); #ifdef HAVE_REPLICATION int net_send(Protocol *protocol, const char* log_name, my_off_t pos); + + + /** + Execute the event to change the database and update the binary + log coordinates. + + @param rli Pointer to relay log information + + @retval 0 The event was successfully executed. + @retval errno Error code when the execution failed + */ + + int exec_event(RELAY_LOG_INFO *rli) + { + // !!! Just chaining the calls in this first patch + return apply_event_impl(rli); + } + + + /** + Skip the event by just updating the binary log coordinates. + + @param rli Pointer to relay log information + + @retval 0 The event was successfully executed. + @retval errno Error code when the execution failed + */ + + int skip_event(RELAY_LOG_INFO *rli) + { + // !!! Nothing yet. This is just the reorgainization patch. + return 0; + } + + /* pack_info() is used by SHOW BINLOG EVENTS; as print() it prepares and sends a string to display to the user, so it resembles print(). */ + virtual void pack_info(Protocol *protocol); - /* - The SQL slave thread calls exec_event() to execute the event; this is where - the slave's data is modified. - */ - virtual int exec_event(struct st_relay_log_info* rli); + #endif /* HAVE_REPLICATION */ virtual const char* get_db() { @@ -713,6 +746,38 @@ public: *description_event); /* returns the human readable name of the event's type */ const char* get_type_str(); + +protected: /* !!! Protected in this patch to allow old usage */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + /** + Primitive to apply an event to the database. + + This is where the change to the database is made. + + @param rli Pointer to relay log info structure + + @retval 0 Event applied successfully + @retval errno Error code if event application failed + */ + virtual int apply_event_impl(RELAY_LOG_INFO *rli); + + /** + Advance binary log coordinates. + + This function is called to advance the binary log or relay log + coordinates to just after the event. + + @param rli Pointer to relay log info structure + + @retval 0 Coordinates changed successfully + @retval errno Error code if advancing failed + */ + virtual int advance_coord_impl(RELAY_LOG_INFO *rli) + { + // !!! Dummy implementation for this patch only + return 0; + } +#endif }; /* @@ -753,10 +818,10 @@ public: uint16 error_code; ulong thread_id; /* - For events created by Query_log_event::exec_event (and - Load_log_event::exec_event()) we need the *original* thread id, to be able - to log the event with the original (=master's) thread id (fix for - BUG#1686). + For events created by Query_log_event::apply_event_impl (and + Load_log_event::apply_event_impl()) we need the *original* thread + id, to be able to log the event with the original (=master's) + thread id (fix for BUG#1686). */ ulong slave_proxy_id; @@ -817,9 +882,6 @@ public: const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); - int exec_event(struct st_relay_log_info* rli, const char *query_arg, - uint32 q_len_arg); #endif /* HAVE_REPLICATION */ #else void print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info); @@ -848,6 +910,14 @@ public: */ virtual ulong get_post_header_size_for_derived() { return 0; } /* Writes derived event-specific part of post header. */ + +public: /* !!! Public in this patch to allow old usage */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); + int apply_event_impl(RELAY_LOG_INFO* rli, + const char *query_arg, + uint32 q_len_arg); +#endif /* HAVE_REPLICATION */ }; @@ -894,9 +964,8 @@ public: uint16 master_port; #ifndef MYSQL_CLIENT - Slave_log_event(THD* thd_arg, struct st_relay_log_info* rli); + Slave_log_event(THD* thd_arg, RELAY_LOG_INFO* rli); void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); #endif @@ -909,6 +978,11 @@ public: #ifndef MYSQL_CLIENT bool write(IO_CACHE* file); #endif + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; #endif /* HAVE_REPLICATION */ @@ -978,12 +1052,6 @@ public: const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli) - { - return exec_event(thd->slave_net,rli,0); - } - int exec_event(NET* net, struct st_relay_log_info* rli, - bool use_rli_only_for_errors); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1015,6 +1083,17 @@ public: + LOAD_HEADER_LEN + sql_ex.data_size() + field_block_len + num_fields); } + +public: /* !!! Public in this patch to allow old usage */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli) + { + return apply_event_impl(thd->slave_net,rli,0); + } + + int apply_event_impl(NET* net, RELAY_LOG_INFO* rli, + bool use_rli_only_for_errors); +#endif }; extern char server_version[SERVER_VERSION_LENGTH]; @@ -1072,7 +1151,6 @@ public: Start_log_event_v3(); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else Start_log_event_v3() {} @@ -1092,6 +1170,11 @@ public: return START_V3_HEADER_LEN; //no variable-sized part } virtual bool is_artificial_event() { return artificial_event; } + +protected: /* !!! Protected in this patch to allow old usage */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1116,13 +1199,6 @@ public: uint8 *post_header_len; Format_description_log_event(uint8 binlog_ver, const char* server_ver=0); - -#ifndef MYSQL_CLIENT -#ifdef HAVE_REPLICATION - int exec_event(struct st_relay_log_info* rli); -#endif /* HAVE_REPLICATION */ -#endif - Format_description_log_event(const char* buf, uint event_len, const Format_description_log_event* description_event); ~Format_description_log_event() { my_free((gptr)post_header_len, MYF(0)); } @@ -1145,6 +1221,11 @@ public: */ return FORMAT_DESCRIPTION_HEADER_LEN; } + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1168,7 +1249,6 @@ public: {} #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1183,6 +1263,11 @@ public: bool write(IO_CACHE* file); #endif bool is_valid() const { return 1; } + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1209,7 +1294,6 @@ class Rand_log_event: public Log_event {} #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1223,6 +1307,11 @@ class Rand_log_event: public Log_event bool write(IO_CACHE* file); #endif bool is_valid() const { return 1; } + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; /***************************************************************************** @@ -1246,7 +1335,6 @@ class Xid_log_event: public Log_event Xid_log_event(THD* thd_arg, my_xid x): Log_event(thd_arg,0,0), xid(x) {} #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1260,6 +1348,11 @@ class Xid_log_event: public Log_event bool write(IO_CACHE* file); #endif bool is_valid() const { return 1; } + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; /***************************************************************************** @@ -1289,7 +1382,6 @@ public: val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg) { is_null= !val; } void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); #endif @@ -1301,6 +1393,11 @@ public: bool write(IO_CACHE* file); #endif bool is_valid() const { return 1; } + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1315,7 +1412,6 @@ public: #ifndef MYSQL_CLIENT Stop_log_event() :Log_event() {} - int exec_event(struct st_relay_log_info* rli); #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); #endif @@ -1326,6 +1422,11 @@ public: ~Stop_log_event() {} Log_event_type get_type_code() { return STOP_EVENT;} bool is_valid() const { return 1; } + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; /***************************************************************************** @@ -1352,7 +1453,6 @@ public: ulonglong pos_arg, uint flags); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1371,6 +1471,11 @@ public: #ifndef MYSQL_CLIENT bool write(IO_CACHE* file); #endif + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1405,7 +1510,6 @@ public: bool using_trans); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1439,6 +1543,11 @@ public: */ bool write_base(IO_CACHE* file); #endif + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1471,7 +1580,6 @@ public: Append_block_log_event(THD* thd, const char* db_arg, char* block_arg, uint block_len_arg, bool using_trans); #ifdef HAVE_REPLICATION - int exec_event(struct st_relay_log_info* rli); void pack_info(Protocol* protocol); virtual int get_create_or_append() const; #endif /* HAVE_REPLICATION */ @@ -1489,6 +1597,11 @@ public: bool write(IO_CACHE* file); const char* get_db() { return db; } #endif + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1508,7 +1621,6 @@ public: Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1525,6 +1637,11 @@ public: bool write(IO_CACHE* file); const char* get_db() { return db; } #endif + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1544,7 +1661,6 @@ public: Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1560,6 +1676,11 @@ public: bool write(IO_CACHE* file); const char* get_db() { return db; } #endif + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif }; @@ -1629,7 +1750,6 @@ public: bool using_trans, bool suppress_use); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); - int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -1648,7 +1768,12 @@ public: #ifndef MYSQL_CLIENT bool write_post_header_for_derived(IO_CACHE* file); #endif - }; + +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif +}; #ifdef MYSQL_CLIENT @@ -1745,7 +1870,6 @@ public: #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int exec_event(struct st_relay_log_info *rli); virtual void pack_info(Protocol *protocol); #endif @@ -1755,6 +1879,10 @@ public: private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); +#endif + #ifndef MYSQL_CLIENT TABLE *m_table; #endif @@ -1826,7 +1954,6 @@ public: flag_set get_flags(flag_set flags) const { return m_flags & flags; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int exec_event(struct st_relay_log_info *rli); virtual void pack_info(Protocol *protocol); #endif @@ -1910,6 +2037,8 @@ protected: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int apply_event_impl(RELAY_LOG_INFO* rli); + /* Primitive to prepare for a sequence of row executions. From baaa102de52611e2eef0822bd129bf2ef343e4f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Nov 2006 15:10:41 +0100 Subject: [PATCH 004/789] BUG#23171 (Illegal slave restart group position): Second patch to fix skipping code. Moving relay and binary log position changing code from do_apply_event [old exec_event()] into do_update_pos() and doing other changes necessary to support that. Fixing a bug that can cause deadlock if rotating binary log when committing a changes to a transactional table that is not inside a transaction and cause a rotate log. sql/log.cc: Changing condition in binlog_commit() to skip calling binlog_end_trans() twice to match condition in binlog_end_trans(). sql/log_event.cc: Name change: apply_event_impl() -> do_apply_event() Name change: advance_coord_impl() -> do_update_pos() do_apply_event() now uses pointer to constant RELAY_LOG_INFO to prevent inadvertandly changing the position in the code. Doing this would make the skipping code loose track of where it is. All position changing code shall now be in do_update_pos(). Factoring out relay and binary log position updating code from do_apply_event() [previously exec_event()] into do_update_pos(). Using a safe approach to make it work: will refine the refactoring when the skipping code is implemented. Adding const casts where needed. Changing signature to use pointers to constant objects where needed. sql/rpl_rli.cc: Making cached_charset_compare() const to work with constant instances of RELAY_LOG_INFO. Debriding code. sql/rpl_rli.h: Making cached_charset_compare() const to work with constant instances of RELAY_LOG_INFO. Debriding code. sql/rpl_utility.cc: Using pointer to const RELAY_LOG_INFO to make it work with other code. sql/rpl_utility.h: Using pointer to const RELAY_LOG_INFO to make it work with other code. sql/slave.cc: Using pointer to const RELAY_LOG_INFO to make it work with other code. Adding const cast where necessary. sql/slave.h: Using pointer to const RELAY_LOG_INFO to make it work with other code. --- sql/log.cc | 20 ++- sql/log_event.cc | 344 +++++++++++++++++++++++++-------------------- sql/rpl_rli.cc | 15 +- sql/rpl_rli.h | 4 +- sql/rpl_utility.cc | 3 +- sql/rpl_utility.h | 2 +- sql/slave.cc | 20 ++- sql/slave.h | 6 +- 8 files changed, 226 insertions(+), 188 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 3db51c9cb2f..1cf89fad042 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1453,7 +1453,7 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all) do nothing. just pretend we can do 2pc, so that MySQL won't switch to 1pc. - real work will be done in MYSQL_BIN_LOG::log() + real work will be done in TC_LOG_BINLOG::log() */ return 0; } @@ -1467,9 +1467,15 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all) IO_CACHE *trans_log= &trx_data->trans_log; DBUG_ASSERT(mysql_bin_log.is_open()); - if (all && trx_data->empty()) + /* + The condition here has to be identical to the one inside + binlog_end_trans(), guarding the write of the transaction cache to + the binary log. + */ + if ((all || !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) && + trx_data->empty()) { - // we're here because trans_log was flushed in MYSQL_BIN_LOG::log() + // we're here because trans_log was flushed in TC_LOG_BINLOG::log() trx_data->reset(); DBUG_RETURN(0); } @@ -3117,8 +3123,10 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock) { tc_log_page_waits++; pthread_mutex_lock(&LOCK_prep_xids); - while (prepared_xids) + while (prepared_xids) { + DBUG_PRINT("info", ("prepared_xids=%lu", prepared_xids)); pthread_cond_wait(&COND_prep_xids, &LOCK_prep_xids); + } pthread_mutex_unlock(&LOCK_prep_xids); } @@ -4905,8 +4913,10 @@ void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid) { pthread_mutex_lock(&LOCK_prep_xids); DBUG_ASSERT(prepared_xids > 0); - if (--prepared_xids == 0) + if (--prepared_xids == 0) { + DBUG_PRINT("info", ("prepared_xids=%lu", prepared_xids)); pthread_cond_signal(&COND_prep_xids); + } pthread_mutex_unlock(&LOCK_prep_xids); rotate_and_purge(0); // as ::write() did not rotate } diff --git a/sql/log_event.cc b/sql/log_event.cc index 3b8a953539b..3bdc6412dc6 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -531,23 +531,19 @@ Log_event::Log_event(const char* buf, #ifndef MYSQL_CLIENT #ifdef HAVE_REPLICATION -/* - Log_event::apply_event_impl() -*/ - -int Log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Log_event::do_update_pos(RELAY_LOG_INFO *rli) { - DBUG_ENTER("Log_event::apply_event_impl"); - /* rli is null when (as far as I (Guilhem) know) the caller is - Load_log_event::apply_event_impl *and* that one is called from - Execute_load_log_event::apply_event_impl. In this case, we don't - do anything here ; Execute_load_log_event::apply_event_impl will - call Log_event::apply_event_impl again later with the proper rli. + Load_log_event::do_apply_event *and* that one is called from + Execute_load_log_event::do_apply_event. In this case, we don't + do anything here ; Execute_load_log_event::do_apply_event will + call Log_event::do_apply_event again later with the proper rli. Strictly speaking, if we were sure that rli is null only in the case discussed above, 'if (rli)' is useless here. But as we are not 100% sure, keep it for now. + + Matz: I don't think we will need this check with this refactoring. */ if (rli) { @@ -583,7 +579,7 @@ int Log_event::apply_event_impl(RELAY_LOG_INFO* rli) rli->inc_group_relay_log_pos(log_pos); flush_relay_log_info(rli); /* - Note that Rotate_log_event::apply_event_impl() does not call + Note that Rotate_log_event::do_apply_event() does not call this function, so there is no chance that a fake rotate event resets last_master_timestamp. Note that we update without mutex (probably ok - except in some very rare cases, only @@ -593,9 +589,9 @@ int Log_event::apply_event_impl(RELAY_LOG_INFO* rli) rli->last_master_timestamp= when; } } - DBUG_RETURN(0); -} + return 0; // Cannot fail currently +} /* Log_event::pack_info() @@ -1819,18 +1815,18 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - Query_log_event::apply_event_impl() + Query_log_event::do_apply_event() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Query_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { - return apply_event_impl(rli, query, q_len); + return do_apply_event(rli, query, q_len); } -int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli, +int Query_log_event::do_apply_event(RELAY_LOG_INFO const *rli, const char *query_arg, uint32 q_len_arg) { LEX_STRING new_db; @@ -1839,7 +1835,7 @@ int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli, Colleagues: please never free(thd->catalog) in MySQL. This would lead to bugs as here thd->catalog is a part of an alloced block, not an entire alloced block (see - Query_log_event::apply_event_impl()). Same for thd->db. Thank + Query_log_event::do_apply_event()). Same for thd->db. Thank you. */ thd->catalog= catalog_len ? (char *) catalog : (char *)""; @@ -1859,11 +1855,11 @@ int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli, END of the current log event (COMMIT). We save it in rli so that InnoDB can access it. */ - rli->future_group_master_log_pos= log_pos; + const_cast(rli)->future_group_master_log_pos= log_pos; DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos)); - clear_all_errors(thd, rli); - rli->clear_tables_to_lock(); + clear_all_errors(thd, const_cast(rli)); + const_cast(rli)->clear_tables_to_lock(); /* Note: We do not need to execute reset_one_shot_variables() if this @@ -1872,7 +1868,7 @@ int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli, its companion query. If the SET is ignored because of db_ok(), the companion query will also be ignored, and if the companion query is ignored in the db_ok() test of - ::apply_event_impl(), then the companion SET also have so + ::do_apply_event(), then the companion SET also have so we don't need to reset_one_shot_variables(). */ if (rpl_filter->db_ok(thd->db)) @@ -1962,7 +1958,7 @@ int Query_log_event::apply_event_impl(RELAY_LOG_INFO* rli, to check/fix it. */ if (mysql_test_parse_for_slave(thd, thd->query, thd->query_length)) - clear_all_errors(thd, rli); /* Can ignore query */ + clear_all_errors(thd, const_cast(rli)); /* Can ignore query */ else { slave_print_msg(ERROR_LEVEL, rli, expected_error, @@ -2013,7 +2009,7 @@ Default database: '%s'. Query: '%s'", ignored_error_code(actual_error)) { DBUG_PRINT("info",("error ignored")); - clear_all_errors(thd, rli); + clear_all_errors(thd, const_cast(rli)); } /* Other cases: mostly we expected no error and get one. @@ -2080,16 +2076,26 @@ end: thd->first_successful_insert_id_in_prev_stmt= 0; thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0; free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); - /* - If there was an error we stop. Otherwise we increment positions. Note that - we will not increment group* positions if we are just after a SET - ONE_SHOT, because SET ONE_SHOT should not be separated from its following - updating query. - */ - return (thd->query_error ? thd->query_error : - (thd->one_shot_set ? (rli->inc_event_relay_log_pos(),0) : - Log_event::apply_event_impl(rli))); + return thd->query_error; } + +int Query_log_event::do_update_pos(RELAY_LOG_INFO *rli) +{ + /* + Note that we will not increment group* positions if we are just + after a SET ONE_SHOT, because SET ONE_SHOT should not be separated + from its following updating query. + */ + if (thd->one_shot_set) + { + rli->inc_event_relay_log_pos(); + return 0; + } + else + return Log_event::do_update_pos(rli); +} + + #endif @@ -2216,7 +2222,7 @@ bool Start_log_event_v3::write(IO_CACHE* file) /* - Start_log_event_v3::apply_event_impl() + Start_log_event_v3::do_apply_event() The master started @@ -2235,9 +2241,9 @@ bool Start_log_event_v3::write(IO_CACHE* file) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Start_log_event_v3::apply_event_impl(RELAY_LOG_INFO* rli) +int Start_log_event_v3::do_apply_event(RELAY_LOG_INFO const *rli) { - DBUG_ENTER("Start_log_event_v3::apply_event_impl"); + DBUG_ENTER("Start_log_event_v3::do_apply_event"); switch (binlog_version) { case 3: @@ -2279,7 +2285,7 @@ int Start_log_event_v3::apply_event_impl(RELAY_LOG_INFO* rli) /* this case is impossible */ DBUG_RETURN(1); } - DBUG_RETURN(Log_event::apply_event_impl(rli)); + DBUG_RETURN(0); } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -2468,22 +2474,18 @@ bool Format_description_log_event::write(IO_CACHE* file) /* SYNOPSIS - Format_description_log_event::apply_event_impl() + Format_description_log_event::do_apply_event() IMPLEMENTATION Save the information which describes the binlog's format, to be able to read all coming events. Call - Start_log_event_v3::apply_event_impl(). + Start_log_event_v3::do_apply_event(). */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Format_description_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Format_description_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { - DBUG_ENTER("Format_description_log_event::apply_event_impl"); - - /* save the information describing this binlog */ - delete rli->relay_log.description_event_for_exec; - rli->relay_log.description_event_for_exec= this; + DBUG_ENTER("Format_description_log_event::do_apply_event"); #ifdef USING_TRANSACTIONS /* @@ -2505,14 +2507,36 @@ int Format_description_log_event::apply_event_impl(RELAY_LOG_INFO* rli) "or ROLLBACK in relay log). A probable cause is that " "the master died while writing the transaction to " "its binary log, thus rolled back too."); - rli->cleanup_context(thd, 1); + const_cast(rli)->cleanup_context(thd, 1); } #endif /* If this event comes from ourselves, there is no cleaning task to - perform, we don't call Start_log_event_v3::apply_event_impl() + perform, we don't call Start_log_event_v3::do_apply_event() (this was just to update the log's description event). */ + if (server_id != (uint32) ::server_id) + { + /* + If the event was not requested by the slave i.e. the master sent + it while the slave asked for a position >4, the event will make + rli->group_master_log_pos advance. Say that the slave asked for + position 1000, and the Format_desc event's end is 96. Then in + the beginning of replication rli->group_master_log_pos will be + 0, then 96, then jump to first really asked event (which is + >96). So this is ok. + */ + DBUG_RETURN(Start_log_event_v3::do_apply_event(rli)); + } + DBUG_RETURN(0); +} + +int Format_description_log_event::do_update_pos(RELAY_LOG_INFO *rli) +{ + /* save the information describing this binlog */ + delete rli->relay_log.description_event_for_exec; + rli->relay_log.description_event_for_exec= this; + if (server_id == (uint32) ::server_id) { /* @@ -2529,19 +2553,14 @@ int Format_description_log_event::apply_event_impl(RELAY_LOG_INFO* rli) the Intvar_log_event respectively. */ rli->inc_event_relay_log_pos(); - DBUG_RETURN(0); + return 0; + } + else + { + return Log_event::do_update_pos(rli); } - - /* - If the event was not requested by the slave i.e. the master sent it while - the slave asked for a position >4, the event will make - rli->group_master_log_pos advance. Say that the slave asked for position - 1000, and the Format_desc event's end is 96. Then in the beginning of - replication rli->group_master_log_pos will be 0, then 96, then jump to - first really asked event (which is >96). So this is ok. - */ - DBUG_RETURN(Start_log_event_v3::apply_event_impl(rli)); } + #endif /************************************************************************** @@ -3023,18 +3042,18 @@ void Load_log_event::set_fields(const char* affected_db, Does the data loading job when executing a LOAD DATA on the slave SYNOPSIS - Load_log_event::apply_event_impl + Load_log_event::do_apply_event net rli use_rli_only_for_errors - if set to 1, rli is provided to - Load_log_event::apply_event_impl + Load_log_event::do_apply_event only for this function to have RPL_LOG_NAME and rli->last_slave_error, both being used by error reports. rli's position advancing is skipped (done by the caller which is - Execute_load_log_event::apply_event_impl). + Execute_load_log_event::do_apply_event). - if set to 0, rli is provided for full use, i.e. for error reports and position advancing. @@ -3047,8 +3066,8 @@ void Load_log_event::set_fields(const char* affected_db, 1 Failure */ -int Load_log_event::apply_event_impl(NET* net, RELAY_LOG_INFO* rli, - bool use_rli_only_for_errors) +int Load_log_event::do_apply_event(NET* net, RELAY_LOG_INFO const *rli, + bool use_rli_only_for_errors) { LEX_STRING new_db; new_db.length= db_len; @@ -3057,9 +3076,9 @@ int Load_log_event::apply_event_impl(NET* net, RELAY_LOG_INFO* rli, DBUG_ASSERT(thd->query == 0); thd->query_length= 0; // Should not be needed thd->query_error= 0; - clear_all_errors(thd, rli); + clear_all_errors(thd, const_cast(rli)); - /* see Query_log_event::apply_event_impl() and BUG#13360 */ + /* see Query_log_event::do_apply_event() and BUG#13360 */ DBUG_ASSERT(!rli->m_table_map.count()); /* Usually mysql_init_query() is called by mysql_parse(), but we need it here @@ -3070,9 +3089,9 @@ int Load_log_event::apply_event_impl(NET* net, RELAY_LOG_INFO* rli, { /* Saved for InnoDB, see comment in - Query_log_event::apply_event_impl() + Query_log_event::do_apply_event() */ - rli->future_group_master_log_pos= log_pos; + const_cast(rli)->future_group_master_log_pos= log_pos; DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos)); } @@ -3084,7 +3103,7 @@ int Load_log_event::apply_event_impl(NET* net, RELAY_LOG_INFO* rli, still consume a lot of space on the slave (space in the relay log + space of temp files: twice the space of the file to load...) even if it will finally be ignored. TODO: fix this; this can be - done by testing rules in Create_file_log_event::apply_event_impl() + done by testing rules in Create_file_log_event::do_apply_event() and then discarding Append_block and al. Another way is do the filtering in the I/O thread (more efficient: no disk writes at all). @@ -3096,7 +3115,7 @@ int Load_log_event::apply_event_impl(NET* net, RELAY_LOG_INFO* rli, its companion query. If the SET is ignored because of db_ok(), the companion query will also be ignored, and if the companion query is ignored in the db_ok() test of - ::apply_event_impl(), then the companion SET also have so + ::do_apply_event(), then the companion SET also have so we don't need to reset_one_shot_variables(). */ if (rpl_filter->db_ok(thd->db)) @@ -3293,7 +3312,7 @@ Fatal error running LOAD DATA INFILE on table '%s'. Default database: '%s'", return 1; } - return ( use_rli_only_for_errors ? 0 : Log_event::apply_event_impl(rli) ); + return ( use_rli_only_for_errors ? 0 : Log_event::do_apply_event(rli) ); } #endif @@ -3407,7 +3426,7 @@ bool Rotate_log_event::write(IO_CACHE* file) #endif /* - Rotate_log_event::apply_event_impl() + Rotate_log_event::do_apply_event() Got a rotate log event from the master @@ -3424,10 +3443,9 @@ bool Rotate_log_event::write(IO_CACHE* file) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Rotate_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli) { - DBUG_ENTER("Rotate_log_event::apply_event_impl"); - + DBUG_ENTER("Rotate_log_event::do_update_pos"); pthread_mutex_lock(&rli->data_lock); rli->event_relay_log_pos= my_b_tell(rli->cur_log); /* @@ -3470,8 +3488,10 @@ int Rotate_log_event::apply_event_impl(RELAY_LOG_INFO* rli) pthread_mutex_unlock(&rli->data_lock); pthread_cond_broadcast(&rli->data_cond); flush_relay_log_info(rli); + DBUG_RETURN(0); } + #endif @@ -3577,11 +3597,11 @@ void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - Intvar_log_event::apply_event_impl() + Intvar_log_event::do_apply_event() */ #if defined(HAVE_REPLICATION)&& !defined(MYSQL_CLIENT) -int Intvar_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Intvar_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { switch (type) { case LAST_INSERT_ID_EVENT: @@ -3592,6 +3612,11 @@ int Intvar_log_event::apply_event_impl(RELAY_LOG_INFO* rli) thd->force_one_auto_inc_interval(val); break; } + return 0; +} + +int Intvar_log_event::do_update_pos(RELAY_LOG_INFO *rli) +{ rli->inc_event_relay_log_pos(); return 0; } @@ -3656,13 +3681,19 @@ void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Rand_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Rand_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { thd->rand.seed1= (ulong) seed1; thd->rand.seed2= (ulong) seed2; + return 0; +} + +int Rand_log_event::do_update_pos(RELAY_LOG_INFO *rli) +{ rli->inc_event_relay_log_pos(); return 0; } + #endif /* !MYSQL_CLIENT */ @@ -3729,12 +3760,12 @@ void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Xid_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Xid_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { /* For a slave Xid_log_event is COMMIT */ general_log_print(thd, COM_QUERY, "COMMIT /* implicit, from Xid_log_event */"); - return end_trans(thd, COMMIT) || Log_event::apply_event_impl(rli); + return end_trans(thd, COMMIT); } #endif /* !MYSQL_CLIENT */ @@ -4010,11 +4041,11 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - User_var_log_event::apply_event_impl() + User_var_log_event::do_apply_event() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int User_var_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int User_var_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { Item *it= 0; CHARSET_INFO *charset; @@ -4076,9 +4107,15 @@ int User_var_log_event::apply_event_impl(RELAY_LOG_INFO* rli) e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT, 0); free_root(thd->mem_root,0); + return 0; +} + +int User_var_log_event::do_update_pos(RELAY_LOG_INFO *rli) +{ rli->inc_event_relay_log_pos(); return 0; } + #endif /* !MYSQL_CLIENT */ @@ -4228,11 +4265,11 @@ Slave_log_event::Slave_log_event(const char* buf, uint event_len) #ifndef MYSQL_CLIENT -int Slave_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Slave_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { if (mysql_bin_log.is_open()) mysql_bin_log.write(this); - return Log_event::apply_event_impl(rli); + return 0; } #endif /* !MYSQL_CLIENT */ @@ -4261,7 +4298,7 @@ void Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) /* - Stop_log_event::apply_event_impl() + Stop_log_event::do_apply_event() The master stopped. We used to clean up all temporary tables but this is useless as, as the master has shut down properly, it has @@ -4270,12 +4307,12 @@ void Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) slave_load_tmpdir, but this is useless as it has been cleared at the end of LOAD DATA INFILE. So we have nothing to do here. The place were we must do this cleaning is in - Start_log_event_v3::apply_event_impl(), not here. Because if we come + Start_log_event_v3::do_apply_event(), not here. Because if we come here, the master was sane. */ #ifndef MYSQL_CLIENT -int Stop_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Stop_log_event::do_update_pos(RELAY_LOG_INFO *rli) { /* We do not want to update master_log pos because we get a rotate event @@ -4293,6 +4330,7 @@ int Stop_log_event::apply_event_impl(RELAY_LOG_INFO* rli) } return 0; } + #endif /* !MYSQL_CLIENT */ #endif /* HAVE_REPLICATION */ @@ -4483,11 +4521,11 @@ void Create_file_log_event::pack_info(Protocol *protocol) /* - Create_file_log_event::apply_event_impl() + Create_file_log_event::do_apply_event() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Create_file_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Create_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { char proc_info[17+FN_REFLEN+10], *fname_buf; char *ext; @@ -4549,7 +4587,7 @@ err: if (fd >= 0) my_close(fd, MYF(0)); thd->proc_info= 0; - return error ? 1 : Log_event::apply_event_impl(rli); + return error == 0; } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -4657,15 +4695,15 @@ int Append_block_log_event::get_create_or_append() const } /* - Append_block_log_event::apply_event_impl() + Append_block_log_event::do_apply_event() */ -int Append_block_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Append_block_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { char proc_info[17+FN_REFLEN+10], *fname= proc_info+17; int fd; int error = 1; - DBUG_ENTER("Append_block_log_event::apply_event_impl"); + DBUG_ENTER("Append_block_log_event::do_apply_event"); fname= strmov(proc_info, "Making temp file "); slave_load_file_stem(fname, file_id, server_id, ".data"); @@ -4704,7 +4742,7 @@ err: if (fd >= 0) my_close(fd, MYF(0)); thd->proc_info= 0; - DBUG_RETURN(error ? error : Log_event::apply_event_impl(rli)); + DBUG_RETURN(error); } #endif @@ -4788,18 +4826,18 @@ void Delete_file_log_event::pack_info(Protocol *protocol) #endif /* - Delete_file_log_event::apply_event_impl() + Delete_file_log_event::do_apply_event() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -int Delete_file_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Delete_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { char fname[FN_REFLEN+10]; char *ext= slave_load_file_stem(fname, file_id, server_id, ".data"); (void) my_delete(fname, MYF(MY_WME)); strmov(ext, ".info"); (void) my_delete(fname, MYF(MY_WME)); - return Log_event::apply_event_impl(rli); + return 0; } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -4885,10 +4923,10 @@ void Execute_load_log_event::pack_info(Protocol *protocol) /* - Execute_load_log_event::apply_event_impl() + Execute_load_log_event::do_apply_event() */ -int Execute_load_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +int Execute_load_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { char fname[FN_REFLEN+10]; char *ext; @@ -4919,15 +4957,15 @@ int Execute_load_log_event::apply_event_impl(RELAY_LOG_INFO* rli) lev->thd = thd; /* - lev->apply_event_impl should use rli only for errors i.e. should + lev->do_apply_event should use rli only for errors i.e. should not advance rli's position. - lev->apply_event_impl is the place where the table is loaded (it + lev->do_apply_event is the place where the table is loaded (it calls mysql_load()). */ - rli->future_group_master_log_pos= log_pos; - if (lev->apply_event_impl(0,rli,1)) + const_cast(rli)->future_group_master_log_pos= log_pos; + if (lev->do_apply_event(0,rli,1)) { /* We want to indicate the name of the file that could not be loaded @@ -4970,7 +5008,7 @@ err: my_close(fd, MYF(0)); end_io_cache(&file); } - return error ? error : Log_event::apply_event_impl(rli); + return error; } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -5138,7 +5176,7 @@ void Execute_load_query_log_event::pack_info(Protocol *protocol) int -Execute_load_query_log_event::apply_event_impl(RELAY_LOG_INFO* rli) +Execute_load_query_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { char *p; char *buf; @@ -5175,7 +5213,7 @@ Execute_load_query_log_event::apply_event_impl(RELAY_LOG_INFO* rli) p= strmake(p, STRING_WITH_LEN(" INTO")); p= strmake(p, query+fn_pos_end, q_len-fn_pos_end); - error= Query_log_event::apply_event_impl(rli, buf, p-buf); + error= Query_log_event::do_apply_event(rli, buf, p-buf); /* Forging file name for deletion in same buffer */ *fname_end= 0; @@ -5488,7 +5526,7 @@ int Rows_log_event::do_add_row_data(byte *const row_data, the master does not have a default value (and isn't nullable) */ static int -unpack_row(RELAY_LOG_INFO *rli, +unpack_row(RELAY_LOG_INFO const *rli, TABLE *table, uint const colcnt, byte *record, char const *row, MY_BITMAP const *cols, char const **row_end, ulong *master_reclength, @@ -5590,17 +5628,17 @@ unpack_row(RELAY_LOG_INFO *rli, return error; } -int Rows_log_event::apply_event_impl(st_relay_log_info *rli) +int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { - DBUG_ENTER("Rows_log_event::apply_event_impl(st_relay_log_info*)"); + DBUG_ENTER("Rows_log_event::do_apply_event(st_relay_log_info*)"); int error= 0; char const *row_start= (char const *)m_rows_buf; /* - If m_table_id == ~0UL, then we have a dummy event that does - not contain any data. In that case, we just remove all tables in - the tables_to_lock list, close the thread tables, step the relay - log position, and return with success. + If m_table_id == ~0UL, then we have a dummy event that does not + contain any data. In that case, we just remove all tables in the + tables_to_lock list, close the thread tables, and return with + success. The relay log position will be stepped in */ if (m_table_id == ~0UL) { @@ -5610,16 +5648,15 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) */ DBUG_ASSERT(get_flags(STMT_END_F)); - rli->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); close_thread_tables(thd); thd->clear_error(); - rli->inc_event_relay_log_pos(); DBUG_RETURN(0); } /* 'thd' has been set by exec_relay_log_event(), just before calling - apply_event_impl(). We still check here to prevent future coding + do_apply_event(). We still check here to prevent future coding errors. */ DBUG_ASSERT(rli->sql_thd == thd); @@ -5637,7 +5674,7 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) /* lock_tables() reads the contents of thd->lex, so they must be initialized. Contrary to in - Table_map_log_event::apply_event_impl() we don't call + Table_map_log_event::do_apply_event() we don't call mysql_init_query() as that may reset the binlog format. */ lex_start(thd, NULL, 0); @@ -5650,7 +5687,7 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) slave_print_msg(ERROR_LEVEL, rli, error, "Error in %s event: when locking tables", get_type_str()); - rli->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(error); } @@ -5668,10 +5705,12 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) need to add code to assert that is the case. */ thd->binlog_flush_pending_rows_event(false); - close_tables_for_reopen(thd, &rli->tables_to_lock); + close_tables_for_reopen(thd, &const_cast(rli)->tables_to_lock); - if ((error= open_tables(thd, &rli->tables_to_lock, - &rli->tables_to_lock_count, 0))) + if ((error= open_tables(thd, + &const_cast(rli)->tables_to_lock, + &const_cast(rli)->tables_to_lock_count, + 0))) { if (thd->query_error || thd->is_fatal_error) { @@ -5686,7 +5725,7 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) "unexpected success or fatal error")); thd->query_error= 1; } - rli->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(error); } } @@ -5701,23 +5740,23 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) TABLE_LIST *ptr; for (ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global) { - rli->m_table_map.set_table(ptr->table_id, ptr->table); + const_cast(rli)->m_table_map.set_table(ptr->table_id, ptr->table); } #ifdef HAVE_QUERY_CACHE query_cache.invalidate_locked_for_write(rli->tables_to_lock); #endif - rli->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); } DBUG_ASSERT(rli->tables_to_lock == NULL && rli->tables_to_lock_count == 0); - TABLE* table= rli->m_table_map.get_table(m_table_id); + TABLE* table= const_cast(rli)->m_table_map.get_table(m_table_id); if (table) { /* table == NULL means that this table should not be replicated - (this was set up by Table_map_log_event::apply_event_impl() + (this was set up by Table_map_log_event::do_apply_event() which tested replicate-* rules). */ @@ -5785,7 +5824,7 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) row_start= row_end; } DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event", - rli->abort_slave=1;); + const_cast(rli)->abort_slave= 1;); error= do_after_row_operations(table, error); if (!cache_stmt) { @@ -5812,7 +5851,7 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) thread is certainly going to stop. */ thd->reset_current_stmt_binlog_row_based(); - rli->cleanup_context(thd, 1); + const_cast(rli)->cleanup_context(thd, 1); thd->query_error= 1; DBUG_RETURN(error); } @@ -5856,8 +5895,7 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) */ thd->reset_current_stmt_binlog_row_based(); - rli->cleanup_context(thd, 0); - rli->transaction_end(thd); + const_cast(rli)->cleanup_context(thd, 0); if (error == 0) { @@ -5870,7 +5908,6 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) do not become visible. We still prefer to wipe them out. */ thd->clear_error(); - error= Log_event::apply_event_impl(rli); } else slave_print_msg(ERROR_LEVEL, rli, error, @@ -5899,15 +5936,15 @@ int Rows_log_event::apply_event_impl(st_relay_log_info *rli) problem. When WL#2975 is implemented, just remove the member st_relay_log_info::unsafe_to_stop_at and all its occurences. */ - rli->unsafe_to_stop_at= time(0); + const_cast(rli)->unsafe_to_stop_at= time(0); } DBUG_ASSERT(error == 0); thd->clear_error(); - rli->inc_event_relay_log_pos(); - + DBUG_RETURN(0); } + #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ #ifndef MYSQL_CLIENT @@ -6081,15 +6118,15 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len, const char *const vpart= buf + common_header_len + post_header_len; /* Extract the length of the various parts from the buffer */ - byte const* const ptr_dblen= (byte const*)vpart + 0; + byte const *const ptr_dblen= (byte const*)vpart + 0; m_dblen= *(uchar*) ptr_dblen; /* Length of database name + counter + terminating null */ - byte const* const ptr_tbllen= ptr_dblen + m_dblen + 2; + byte const *const ptr_tbllen= ptr_dblen + m_dblen + 2; m_tbllen= *(uchar*) ptr_tbllen; /* Length of table name + counter + terminating null */ - byte const* const ptr_colcnt= ptr_tbllen + m_tbllen + 2; + byte const *const ptr_colcnt= ptr_tbllen + m_tbllen + 2; uchar *ptr_after_colcnt= (uchar*) ptr_colcnt; m_colcnt= net_field_length(&ptr_after_colcnt); @@ -6134,9 +6171,9 @@ Table_map_log_event::~Table_map_log_event() */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) -int Table_map_log_event::apply_event_impl(st_relay_log_info *rli) +int Table_map_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { - DBUG_ENTER("Table_map_log_event::apply_event_impl(st_relay_log_info*)"); + DBUG_ENTER("Table_map_log_event::do_apply_event(st_relay_log_info*)"); DBUG_ASSERT(rli->sql_thd == thd); @@ -6240,29 +6277,24 @@ int Table_map_log_event::apply_event_impl(st_relay_log_info *rli) locked by linking the table into the list of tables to lock. */ table_list->next_global= table_list->next_local= rli->tables_to_lock; - rli->tables_to_lock= table_list; - rli->tables_to_lock_count++; + const_cast(rli)->tables_to_lock= table_list; + const_cast(rli)->tables_to_lock_count++; /* 'memory' is freed in clear_tables_to_lock */ } - /* - We explicitly do not call Log_event::apply_event_impl() here since - we do not want the relay log position to be flushed to disk. The - flushing will be done by the last Rows_log_event that either ends - a statement (outside a transaction) or a transaction. - - A table map event can *never* end a transaction or a statement, so we - just step the relay log position. - */ - - if (likely(!error)) - rli->inc_event_relay_log_pos(); DBUG_RETURN(error); err: my_free((gptr) memory, MYF(MY_WME)); DBUG_RETURN(error); } + +int Table_map_log_event::do_update_pos(RELAY_LOG_INFO *rli) +{ + rli->inc_event_relay_log_pos(); + return 0; +} + #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ #ifndef MYSQL_CLIENT @@ -6427,7 +6459,7 @@ int Write_rows_log_event::do_after_row_operations(TABLE *table, int error) return error; } -int Write_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, +int Write_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli, TABLE *table, char const *row_start, char const **row_end) @@ -6973,7 +7005,7 @@ int Delete_rows_log_event::do_after_row_operations(TABLE *table, int error) return error; } -int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, +int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli, TABLE *table, char const *row_start, char const **row_end) @@ -7110,7 +7142,7 @@ int Update_rows_log_event::do_after_row_operations(TABLE *table, int error) return error; } -int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, +int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli, TABLE *table, char const *row_start, char const **row_end) diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index f01fc5d1c9e..75e4bd168ee 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1056,30 +1056,19 @@ void st_relay_log_info::cached_charset_invalidate() } -bool st_relay_log_info::cached_charset_compare(char *charset) +bool st_relay_log_info::cached_charset_compare(char *charset) const { DBUG_ENTER("st_relay_log_info::cached_charset_compare"); if (bcmp(cached_charset, charset, sizeof(cached_charset))) { - memcpy(cached_charset, charset, sizeof(cached_charset)); + memcpy(const_cast(cached_charset), charset, sizeof(cached_charset)); DBUG_RETURN(1); } DBUG_RETURN(0); } -void st_relay_log_info::transaction_end(THD* thd) -{ - DBUG_ENTER("st_relay_log_info::transaction_end"); - - /* - Nothing to do here right now. - */ - - DBUG_VOID_RETURN; -} - #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) void st_relay_log_info::cleanup_context(THD *thd, bool error) { diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index d737055baf2..cecf351fd88 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -291,9 +291,7 @@ typedef struct st_relay_log_info When the 6 bytes are equal to 0 is used to mean "cache is invalidated". */ void cached_charset_invalidate(); - bool cached_charset_compare(char *charset); - - void transaction_end(THD*); + bool cached_charset_compare(char *charset) const; void cleanup_context(THD *, bool); void clear_tables_to_lock() { diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index c80b6dc3f69..fb3d689f2f7 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -109,7 +109,7 @@ field_length_from_packed(enum_field_types const field_type, */ int -table_def::compatible_with(RELAY_LOG_INFO *rli, TABLE *table) +table_def::compatible_with(RELAY_LOG_INFO const *rli_arg, TABLE *table) const { /* @@ -117,6 +117,7 @@ table_def::compatible_with(RELAY_LOG_INFO *rli, TABLE *table) */ uint const cols_to_check= min(table->s->fields, size()); int error= 0; + RELAY_LOG_INFO const *rli= const_cast(rli_arg); TABLE_SHARE const *const tsh= table->s; diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index df0b0cd2ee1..a45a16f1ca8 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -116,7 +116,7 @@ public: 1 if the table definition is not compatible with 'table' 0 if the table definition is compatible with 'table' */ - int compatible_with(RELAY_LOG_INFO *rli, TABLE *table) const; + int compatible_with(RELAY_LOG_INFO const *rli, TABLE *table) const; private: my_size_t m_size; // Number of elements in the types array diff --git a/sql/slave.cc b/sql/slave.cc index 87f11417fcc..ed5f2aa5c44 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -555,7 +555,7 @@ static bool sql_slave_killed(THD* thd, RELAY_LOG_INFO* rli) void */ -void slave_print_msg(enum loglevel level, RELAY_LOG_INFO* rli, +void slave_print_msg(enum loglevel level, RELAY_LOG_INFO const *rli, int err_code, const char* msg, ...) { void (*report_function)(const char *, ...); @@ -577,9 +577,9 @@ void slave_print_msg(enum loglevel level, RELAY_LOG_INFO* rli, It's an error, it must be reported in Last_error and Last_errno in SHOW SLAVE STATUS. */ - pbuff= rli->last_slave_error; + pbuff= const_cast(rli)->last_slave_error; pbuffsize= sizeof(rli->last_slave_error); - rli->last_slave_errno = err_code; + const_cast(rli)->last_slave_errno = err_code; report_function= sql_print_error; break; case WARNING_LEVEL: @@ -1376,7 +1376,7 @@ void set_slave_thread_options(THD* thd) DBUG_VOID_RETURN; } -void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO *rli) +void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO const *rli) { DBUG_ENTER("set_slave_thread_default_charset"); @@ -1387,7 +1387,14 @@ void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO *rli) thd->variables.collation_server= global_system_variables.collation_server; thd->update_charset(); - rli->cached_charset_invalidate(); + + /* + We use a const cast here since the conceptual (and externally + visible) behavior of the function is to set the default charset of + the thread. That the cache has to be invalidated is a secondary + effect. + */ + const_cast(rli)->cached_charset_invalidate(); DBUG_VOID_RETURN; } @@ -1607,7 +1614,8 @@ static ulong read_event(MYSQL* mysql, MASTER_INFO *mi, bool* suppress_warnings) } -int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int expected_error) +int check_expected_error(THD* thd, RELAY_LOG_INFO const *rli, + int expected_error) { DBUG_ENTER("check_expected_error"); diff --git a/sql/slave.h b/sql/slave.h index 24ba09d78d3..1e5be3ab8bd 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -164,9 +164,9 @@ bool show_master_info(THD* thd, MASTER_INFO* mi); bool show_binlog_info(THD* thd); const char *print_slave_db_safe(const char *db); -int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code); +int check_expected_error(THD* thd, RELAY_LOG_INFO const *rli, int error_code); void skip_load_data_infile(NET* net); -void slave_print_msg(enum loglevel level, RELAY_LOG_INFO* rli, +void slave_print_msg(enum loglevel level, RELAY_LOG_INFO const *rli, int err_code, const char* msg, ...) ATTRIBUTE_FORMAT(printf, 4, 5); @@ -184,7 +184,7 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,ulonglong pos, int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset, const char** errmsg); void set_slave_thread_options(THD* thd); -void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO *rli); +void set_slave_thread_default_charset(THD *thd, RELAY_LOG_INFO const *rli); void rotate_relay_log(MASTER_INFO* mi); pthread_handler_t handle_slave_io(void *arg); From 2f11f1d3a9b4138315d4f0bcf3e8725dbfb25e02 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Dec 2006 13:53:34 +0400 Subject: [PATCH 005/789] Fix for bug #22824: strict, datetime, NULL, wrong warning During optimization we replace NULL with 0 for not null date{time} fields, so uset MODE_NO_ZERO_DATE flag for a while as we don't want to give extra warnings. mysql-test/r/strict.result: Fix for bug #22824: strict, datetime, NULL, wrong warning - test result. mysql-test/t/strict.test: Fix for bug #22824: strict, datetime, NULL, wrong warning - test case. sql/item_cmpfunc.cc: Fix for bug #22824: strict, datetime, NULL, wrong warning - turn off MODE_NO_ZERO_DATE in order not to get extra warinings in the save_in_field(). --- mysql-test/r/strict.result | 7 +++++++ mysql-test/t/strict.test | 11 +++++++++++ sql/item_cmpfunc.cc | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 702fc68bb25..4a85b5e483c 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1352,3 +1352,10 @@ t1 CREATE TABLE `t1` ( `i` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*' drop table t1; +set @@sql_mode='NO_ZERO_DATE'; +create table t1(a datetime not null); +select count(*) from t1 where a is null; +count(*) +0 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 6ebbb53ed8e..0c38385c508 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -1208,3 +1208,14 @@ create table t1 (i int) comment '123456789*123456789*123456789*123456789*123456789*123456789*'; show create table t1; drop table t1; + +# +# Bug #22824: strict, datetime, NULL, wrong warning +# + +set @@sql_mode='NO_ZERO_DATE'; +create table t1(a datetime not null); +select count(*) from t1 where a is null; +drop table t1; + +--echo End of 5.0 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 9a400d60ae6..256d2d11af8 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -241,7 +241,8 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item) { /* For comparison purposes allow invalid dates like 2000-01-32 */ ulong orig_sql_mode= thd->variables.sql_mode; - thd->variables.sql_mode|= MODE_INVALID_DATES; + thd->variables.sql_mode= (orig_sql_mode & ~MODE_NO_ZERO_DATE) | + MODE_INVALID_DATES; if (!(*item)->save_in_field(field, 1) && !((*item)->null_value)) { Item *tmp=new Item_int_with_ref(field->val_int(), *item, From c872b005e2987ebc10db219c5ce8657441fe3533 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Dec 2006 09:29:28 +0400 Subject: [PATCH 006/789] Fix for bug #21976: Unnecessary warning with count(decimal) We use val_int() calls (followed by null_value check) to determine nullness in some Item_sum_count' and Item_sum_count_distinct' methods, as a side effect we get extra warnings raised in the val_int(). Fix: use is_null() instead. mysql-test/r/func_group.result: Fix for bug #21976: Unnecessary warning with count(decimal) - test result. mysql-test/t/func_group.test: Fix for bug #21976: Unnecessary warning with count(decimal) - test case. sql/item.h: Fix for bug #21976: Unnecessary warning with count(decimal) - comment adjusted. sql/item_sum.cc: Fix for bug #21976: Unnecessary warning with count(decimal) - use is_null() to determine nullness. --- mysql-test/r/func_group.result | 10 ++++++++++ mysql-test/t/func_group.test | 11 +++++++++++ sql/item.h | 11 +++++------ sql/item_sum.cc | 32 +++++--------------------------- 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index c6117053a60..a15801f6960 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1029,3 +1029,13 @@ t1 CREATE TABLE `t1` ( `stddev(0)` double(8,4) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +create table t1 (a decimal(20)); +insert into t1 values (12345678901234567890); +select count(a) from t1; +count(a) +1 +select count(distinct a) from t1; +count(distinct a) +1 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 079d107fad8..a47fd028b92 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -700,3 +700,14 @@ create table t1 select stddev(0); show create table t1; drop table t1; +# +# Bug #21976: Unnecessary warning with count(decimal) +# + +create table t1 (a decimal(20)); +insert into t1 values (12345678901234567890); +select count(a) from t1; +select count(distinct a) from t1; +drop table t1; + +--echo End of 5.0 tests diff --git a/sql/item.h b/sql/item.h index 0cfb0b01fd8..eb98ecd6021 100644 --- a/sql/item.h +++ b/sql/item.h @@ -701,12 +701,11 @@ public: virtual bool get_date_result(TIME *ltime,uint fuzzydate) { return get_date(ltime,fuzzydate); } /* - This function is used only in Item_func_isnull/Item_func_isnotnull - (implementations of IS NULL/IS NOT NULL clauses). Item_func_is{not}null - calls this method instead of one of val/result*() methods, which - normally will set null_value. This allows to determine nullness of - a complex expression without fully evaluating it. - Any new item which can be NULL must implement this call. + The method allows to determine nullness of a complex expression + without fully evaluating it, instead of calling val/result*() then + checking null_value. Used in Item_func_isnull/Item_func_isnotnull + and Item_sum_count/Item_sum_count_distinct. + Any new item which can be NULL must implement this method. */ virtual bool is_null() { return 0; } diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 77c6e17607f..f7a92f16b29 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1034,14 +1034,8 @@ void Item_sum_count::clear() bool Item_sum_count::add() { - if (!args[0]->maybe_null) + if (!args[0]->maybe_null || !args[0]->is_null()) count++; - else - { - (void) args[0]->val_int(); - if (!args[0]->null_value) - count++; - } return 0; } @@ -1941,14 +1935,8 @@ void Item_sum_count::reset_field() char *res=result_field->ptr; longlong nr=0; - if (!args[0]->maybe_null) + if (!args[0]->maybe_null || !args[0]->is_null()) nr=1; - else - { - (void) args[0]->val_int(); - if (!args[0]->null_value) - nr=1; - } int8store(res,nr); } @@ -2051,14 +2039,8 @@ void Item_sum_count::update_field() char *res=result_field->ptr; nr=sint8korr(res); - if (!args[0]->maybe_null) + if (!args[0]->maybe_null || !args[0]->is_null()) nr++; - else - { - (void) args[0]->val_int(); - if (!args[0]->null_value) - nr++; - } int8store(res,nr); } @@ -2531,12 +2513,8 @@ bool Item_sum_count_distinct::setup(THD *thd) Item *item=args[i]; if (list.push_back(item)) return TRUE; // End of memory - if (item->const_item()) - { - (void) item->val_int(); - if (item->null_value) - always_null=1; - } + if (item->const_item() && item->is_null()) + always_null= 1; } if (always_null) return FALSE; From 4b00b3f0cecbaaa8b89b3a2e0af95e5fb1da80f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Jan 2007 15:06:37 +0100 Subject: [PATCH 007/789] BUG#23171 (Illegal slave restart position): Third patch of the bug fix where the code for skipping events and for executing events is factored out into three functions: - shall_skip() to decide if the event shall be skipped and the reason for it; - do_apply_event(), where the event is applied to the database; and - do_update_pos(), which updates the actual relay log position and group positions. mysql-test/r/rpl_row_tabledefs_2myisam.result: Result change. mysql-test/r/rpl_row_tabledefs_3innodb.result: Result change. sql/log_event.cc: Creating shall_skip(), do_update_pos(), and do_apply_event() functions for each event by factoring out the previous code. Adding debug code and fixing some error codes that were not correct. sql/rpl_rli.cc: Renaming unsafe_to_stop_at into last_event_start_time. Adding debug code. sql/rpl_rli.h: Renaming unsafe_to_stop_at into last_event_start_time. sql/slave.cc: Renaming unsafe_to_stop_at into last_event_start_time. --- mysql-test/r/rpl_row_tabledefs_2myisam.result | 2 +- mysql-test/r/rpl_row_tabledefs_3innodb.result | 2 +- sql/log_event.cc | 214 +++++++++++++++--- sql/rpl_rli.cc | 20 +- sql/rpl_rli.h | 9 +- sql/slave.cc | 75 ++---- 6 files changed, 226 insertions(+), 96 deletions(-) diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/r/rpl_row_tabledefs_2myisam.result index ae792a5dc2a..b3a55ec2447 100644 --- a/mysql-test/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/r/rpl_row_tabledefs_2myisam.result @@ -121,7 +121,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1364 +Last_Errno 1105 Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef Skip_Counter 0 Exec_Master_Log_Pos # diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/r/rpl_row_tabledefs_3innodb.result index b7f0b7b15e2..a7f3cd3db9a 100644 --- a/mysql-test/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/r/rpl_row_tabledefs_3innodb.result @@ -121,7 +121,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1364 +Last_Errno 1105 Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef Skip_Counter 0 Exec_Master_Log_Pos # diff --git a/sql/log_event.cc b/sql/log_event.cc index 3bdc6412dc6..ec7136b5d58 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -89,9 +89,10 @@ public: operator&() DESCRIPTION - Function to return a pointer to the internal, so that the object - can be treated as a IO_CACHE and used with the my_b_* IO_CACHE - functions + + Function to return a pointer to the internal cache, so that the + object can be treated as a IO_CACHE and used with the my_b_* + IO_CACHE functions RETURN VALUE A pointer to the internal IO_CACHE. @@ -593,6 +594,19 @@ int Log_event::do_update_pos(RELAY_LOG_INFO *rli) return 0; // Cannot fail currently } + +Log_event::enum_skip_reason +Log_event::shall_skip(RELAY_LOG_INFO *rli) +{ + if (this->server_id == ::server_id && !replicate_same_server_id) + return EVENT_SKIP_SAME_SID; + else if (rli->slave_skip_counter > 0) + return EVENT_SKIP_COUNT; + else + return EVENT_NOT_SKIPPED; +} + + /* Log_event::pack_info() */ @@ -736,7 +750,7 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, ulong data_len; int result=0; char buf[LOG_EVENT_MINIMAL_HEADER_LEN]; - DBUG_ENTER("read_log_event"); + DBUG_ENTER("Log_event::read_log_event"); if (log_lock) pthread_mutex_lock(log_lock); @@ -811,7 +825,7 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, const Format_description_log_event *description_event) #endif { - DBUG_ENTER("Log_event::read_log_event(IO_CACHE *, Format_description_log_event *"); + DBUG_ENTER("Log_event::read_log_event"); DBUG_ASSERT(description_event != 0); char head[LOG_EVENT_MINIMAL_HEADER_LEN]; /* @@ -2472,16 +2486,6 @@ bool Format_description_log_event::write(IO_CACHE* file) } #endif -/* - SYNOPSIS - Format_description_log_event::do_apply_event() - - IMPLEMENTATION - Save the information which describes the binlog's format, to be - able to read all coming events. Call - Start_log_event_v3::do_apply_event(). -*/ - #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) int Format_description_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { @@ -2561,6 +2565,12 @@ int Format_description_log_event::do_update_pos(RELAY_LOG_INFO *rli) } } +Log_event::enum_skip_reason +Format_description_log_event::shall_skip(RELAY_LOG_INFO *rli) +{ + return Log_event::EVENT_NOT_SKIPPED; +} + #endif /************************************************************************** @@ -3425,6 +3435,16 @@ bool Rotate_log_event::write(IO_CACHE* file) } #endif +/** + Helper function to detect if the event is inside a group. + */ +static bool is_in_group(THD *const thd, RELAY_LOG_INFO *const rli) +{ + return (thd->options & OPTION_BEGIN) != 0 || + (rli->last_event_start_time > 0); +} + + /* Rotate_log_event::do_apply_event() @@ -3446,30 +3466,40 @@ bool Rotate_log_event::write(IO_CACHE* file) int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli) { DBUG_ENTER("Rotate_log_event::do_update_pos"); +#ifndef DBUG_OFF + char buf[32]; +#endif + + DBUG_PRINT("info", ("server_id=%lu; ::server_id=%lu", this->server_id, ::server_id)); + DBUG_PRINT("info", ("new_log_ident: %s", this->new_log_ident)); + DBUG_PRINT("info", ("pos: %s", llstr(this->pos, buf))); + pthread_mutex_lock(&rli->data_lock); rli->event_relay_log_pos= my_b_tell(rli->cur_log); /* - If we are in a transaction: the only normal case is when the I/O thread was - copying a big transaction, then it was stopped and restarted: we have this - in the relay log: + If we are in a transaction or in a group: the only normal case is + when the I/O thread was copying a big transaction, then it was + stopped and restarted: we have this in the relay log: + BEGIN ... ROTATE (a fake one) ... COMMIT or ROLLBACK - In that case, we don't want to touch the coordinates which correspond to - the beginning of the transaction. - Starting from 5.0.0, there also are some rotates from the slave itself, in - the relay log. + + In that case, we don't want to touch the coordinates which + correspond to the beginning of the transaction. Starting from + 5.0.0, there also are some rotates from the slave itself, in the + relay log. */ - if (!(thd->options & OPTION_BEGIN)) + if (!is_in_group(thd, rli)) { memcpy(rli->group_master_log_name, new_log_ident, ident_len+1); rli->notify_group_master_log_name_update(); rli->group_master_log_pos= pos; rli->group_relay_log_pos= rli->event_relay_log_pos; - DBUG_PRINT("info", ("group_master_log_name: '%s' " - "group_master_log_pos: %lu", + DBUG_PRINT("info", ("new group_master_log_name: '%s' " + "new group_master_log_pos: %lu", rli->group_master_log_name, (ulong) rli->group_master_log_pos)); /* @@ -3492,6 +3522,24 @@ int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli) DBUG_RETURN(0); } + +Log_event::enum_skip_reason +Rotate_log_event::shall_skip(RELAY_LOG_INFO *rli) +{ + + enum_skip_reason reason= Log_event::shall_skip(rli); + + switch (reason) { + case Log_event::EVENT_NOT_SKIPPED: + case Log_event::EVENT_SKIP_COUNT: + return Log_event::EVENT_NOT_SKIPPED; + + case Log_event::EVENT_SKIP_SAME_SID: + return Log_event::EVENT_SKIP_SAME_SID; + } + DBUG_ASSERT(0); +} + #endif @@ -3620,6 +3668,26 @@ int Intvar_log_event::do_update_pos(RELAY_LOG_INFO *rli) rli->inc_event_relay_log_pos(); return 0; } + + +Log_event::enum_skip_reason +Intvar_log_event::shall_skip(RELAY_LOG_INFO *rli) +{ + /* + It is a common error to set the slave skip counter to 1 instead + of 2 when recovering from an insert which used a auto increment, + rand, or user var. Therefore, if the slave skip counter is 1, + we just say that this event should be skipped because of the + slave skip count, but we do not change the value of the slave + skip counter since it will be decreased by the following insert + event. + */ + if (rli->slave_skip_counter == 1) + return Log_event::EVENT_SKIP_COUNT; + else + return Log_event::shall_skip(rli); +} + #endif @@ -3694,6 +3762,25 @@ int Rand_log_event::do_update_pos(RELAY_LOG_INFO *rli) return 0; } + +Log_event::enum_skip_reason +Rand_log_event::shall_skip(RELAY_LOG_INFO *rli) +{ + /* + It is a common error to set the slave skip counter to 1 instead + of 2 when recovering from an insert which used a auto increment, + rand, or user var. Therefore, if the slave skip counter is 1, + we just say that this event should be skipped because of the + slave skip count, but we do not change the value of the slave + skip counter since it will be decreased by the following insert + event. + */ + if (rli->slave_skip_counter == 1) + return Log_event::EVENT_SKIP_COUNT; + else + return Log_event::shall_skip(rli); +} + #endif /* !MYSQL_CLIENT */ @@ -4116,6 +4203,23 @@ int User_var_log_event::do_update_pos(RELAY_LOG_INFO *rli) return 0; } +Log_event::enum_skip_reason +User_var_log_event::shall_skip(RELAY_LOG_INFO *rli) + { + /* + It is a common error to set the slave skip counter to 1 instead + of 2 when recovering from an insert which used a auto increment, + rand, or user var. Therefore, if the slave skip counter is 1, + we just say that this event should be skipped because of the + slave skip count, but we do not change the value of the slave + skip counter since it will be decreased by the following insert + event. + */ + if (rli->slave_skip_counter == 1) + return Log_event::EVENT_SKIP_COUNT; + else + return Log_event::shall_skip(rli); + } #endif /* !MYSQL_CLIENT */ @@ -5814,9 +5918,9 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) break; default: - slave_print_msg(ERROR_LEVEL, rli, error, + slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno, "Error in %s event: row application failed", - get_type_str()); + get_type_str(), error); thd->query_error= 1; break; } @@ -5835,11 +5939,12 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) if (error) { /* error has occured during the transaction */ - slave_print_msg(ERROR_LEVEL, rli, error, + slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno, "Error in %s event: error during transaction execution " "on table %s.%s", get_type_str(), table->s->db.str, table->s->table_name.str); + /* If one day we honour --skip-slave-errors in row-based replication, and the error should be skipped, then we would clear mappings, rollback, @@ -5851,7 +5956,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) thread is certainly going to stop. */ thd->reset_current_stmt_binlog_row_based(); - const_cast(rli)->cleanup_context(thd, 1); + const_cast(rli)->cleanup_context(thd, error); thd->query_error= 1; DBUG_RETURN(error); } @@ -5934,9 +6039,9 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) wait (reached end of last relay log and nothing gets appended there), we timeout after one minute, and notify DBA about the problem. When WL#2975 is implemented, just remove the member - st_relay_log_info::unsafe_to_stop_at and all its occurences. + st_relay_log_info::last_event_start_time and all its occurences. */ - const_cast(rli)->unsafe_to_stop_at= time(0); + const_cast(rli)->last_event_start_time= time(0); } DBUG_ASSERT(error == 0); @@ -6599,6 +6704,32 @@ copy_extra_record_fields(TABLE *table, return 0; // All OK } +/** + Check if an error is a duplicate key error. + + This function is used to check if an error code is one of the + duplicate key error, i.e., and error code for which it is sensible + to do a get_dup_key() to retrieve the duplicate key. + + @param errcode The error code to check. + + @return true if the error code is such that + get_dup_key() will return true, false + otherwise. + */ +bool +is_duplicate_key_error(int errcode) +{ + switch (errcode) + { + case HA_ERR_FOUND_DUPP_KEY: + case HA_ERR_FOUND_DUPP_UNIQUE: + return true; + } + return false; +} + + /* Replace the provided record in the database. @@ -6633,10 +6764,15 @@ replace_record(THD *thd, TABLE *table, while ((error= table->file->ha_write_row(table->record[0]))) { + if (!is_duplicate_key_error(error)) + { + table->file->print_error(error, MYF(0)); + DBUG_RETURN(error); + } if ((keynum= table->file->get_dup_key(error)) < 0) { /* We failed to retrieve the duplicate key */ - DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY); + DBUG_RETURN(error); } /* @@ -6653,7 +6789,10 @@ replace_record(THD *thd, TABLE *table, { error= table->file->rnd_pos(table->record[1], table->file->dup_ref); if (error) + { + table->file->print_error(error, MYF(0)); DBUG_RETURN(error); + } } else { @@ -6670,12 +6809,15 @@ replace_record(THD *thd, TABLE *table, } key_copy((byte*)key.get(), table->record[0], table->key_info + keynum, 0); - error= table->file->index_read_idx(table->record[1], keynum, + error= table->file->index_read_idx(table->record[1], keynum, (const byte*)key.get(), table->key_info[keynum].key_length, HA_READ_KEY_EXACT); if (error) + { + table->file->print_error(error, MYF(0)); DBUG_RETURN(error); + } } /* @@ -6708,15 +6850,21 @@ replace_record(THD *thd, TABLE *table, { error=table->file->ha_update_row(table->record[1], table->record[0]); + if (error) + table->file->print_error(error, MYF(0)); DBUG_RETURN(error); } else { if ((error= table->file->ha_delete_row(table->record[1]))) + { + table->file->print_error(error, MYF(0)); DBUG_RETURN(error); + } /* Will retry ha_write_row() with the offending row removed. */ } } + DBUG_RETURN(error); } diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 75e4bd168ee..36334351da2 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -36,7 +36,7 @@ st_relay_log_info::st_relay_log_info() inited(0), abort_slave(0), slave_running(0), until_condition(UNTIL_NONE), until_log_pos(0), retried_trans(0), tables_to_lock(0), tables_to_lock_count(0), - unsafe_to_stop_at(0) + last_event_start_time(0) { DBUG_ENTER("st_relay_log_info::st_relay_log_info"); @@ -1001,6 +1001,22 @@ bool st_relay_log_info::is_until_satisfied() log_pos= group_relay_log_pos; } +#ifndef DBUG_OFF + { + char buf[32]; + DBUG_PRINT("info", ("group_master_log_name='%s', group_master_log_pos=%s", + group_master_log_name, llstr(group_master_log_pos, buf))); + DBUG_PRINT("info", ("group_relay_log_name='%s', group_relay_log_pos=%s", + group_relay_log_name, llstr(group_relay_log_pos, buf))); + DBUG_PRINT("info", ("(%s) log_name='%s', log_pos=%s", + until_condition == UNTIL_MASTER_POS ? "master" : "relay", + log_name, llstr(log_pos, buf))); + DBUG_PRINT("info", ("(%s) until_log_name='%s', until_log_pos=%s", + until_condition == UNTIL_MASTER_POS ? "master" : "relay", + until_log_name, llstr(until_log_pos, buf))); + } +#endif + if (until_log_names_cmp_result == UNTIL_LOG_NAMES_CMP_UNKNOWN) { /* @@ -1095,7 +1111,7 @@ void st_relay_log_info::cleanup_context(THD *thd, bool error) m_table_map.clear_tables(); close_thread_tables(thd); clear_tables_to_lock(); - unsafe_to_stop_at= 0; + last_event_start_time= 0; DBUG_VOID_RETURN; } #endif diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index cecf351fd88..ed9ef3a9115 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -305,7 +305,14 @@ typedef struct st_relay_log_info DBUG_ASSERT(tables_to_lock == NULL && tables_to_lock_count == 0); } - time_t unsafe_to_stop_at; + /* + Used by row-based replication to detect that it should not stop at + this event, but give it a chance to send more events. The time + where the last event inside a group started is stored here. If the + variable is zero, we are not in a group (but may be in a + transaction). + */ + time_t last_event_start_time; } RELAY_LOG_INFO; diff --git a/sql/slave.cc b/sql/slave.cc index ed5f2aa5c44..b58069a82ca 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -517,11 +517,11 @@ static bool sql_slave_killed(THD* thd, RELAY_LOG_INFO* rli) really one minute of idleness, we don't timeout if the slave SQL thread is actively working. */ - if (!rli->unsafe_to_stop_at) + if (rli->last_event_start_time == 0) DBUG_RETURN(1); DBUG_PRINT("info", ("Slave SQL thread is in an unsafe situation, giving " "it some grace period")); - if (difftime(time(0), rli->unsafe_to_stop_at) > 60) + if (difftime(time(0), rli->last_event_start_time) > 60) { slave_print_msg(ERROR_LEVEL, rli, 0, "SQL thread had to stop in an unsafe situation, in " @@ -1737,61 +1737,14 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) now the relay log starts with its Format_desc, has a Rotate etc). */ - DBUG_PRINT("info",("type_code=%d, server_id=%d",type_code,ev->server_id)); + DBUG_PRINT("info",("type_code=%d (%s), server_id=%d", + type_code, ev->get_type_str(), ev->server_id)); - if ((ev->server_id == (uint32) ::server_id && - !replicate_same_server_id && - type_code != FORMAT_DESCRIPTION_EVENT) || - (rli->slave_skip_counter && - type_code != ROTATE_EVENT && type_code != STOP_EVENT && - type_code != START_EVENT_V3 && type_code!= FORMAT_DESCRIPTION_EVENT)) - { - DBUG_PRINT("info", ("event skipped")); - /* - We only skip the event here and do not increase the group log - position. In the event that we have to restart, this means - that we might have to skip the event again, but that is a - minor issue. - If we were to increase the group log position when skipping an - event, it might be that we are restarting at the wrong - position and have events before that we should have executed, - so not increasing the group log position is a sure bet in this - case. - - In this way, we just step the group log position when we - *know* that we are at the end of a group. - */ - rli->inc_event_relay_log_pos(); - - /* - Protect against common user error of setting the counter to 1 - instead of 2 while recovering from an insert which used auto_increment, - rand or user var. - */ - if (rli->slave_skip_counter && - !((type_code == INTVAR_EVENT || - type_code == RAND_EVENT || - type_code == USER_VAR_EVENT) && - rli->slave_skip_counter == 1) && - /* - The events from ourselves which have something to do with the relay - log itself must be skipped, true, but they mustn't decrement - rli->slave_skip_counter, because the user is supposed to not see - these events (they are not in the master's binlog) and if we - decremented, START SLAVE would for example decrement when it sees - the Rotate, so the event which the user probably wanted to skip - would not be skipped. - */ - !(ev->server_id == (uint32) ::server_id && - (type_code == ROTATE_EVENT || type_code == STOP_EVENT || - type_code == START_EVENT_V3 || type_code == FORMAT_DESCRIPTION_EVENT))) - --rli->slave_skip_counter; - pthread_mutex_unlock(&rli->data_lock); - delete ev; - DBUG_RETURN(0); // avoid infinite update loops - } - pthread_mutex_unlock(&rli->data_lock); + /* + Execute the event, but first we set some data that is needed for + the thread. + */ thd->server_id = ev->server_id; // use the original server id for logging thd->set_time(); // time the query @@ -1799,7 +1752,8 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) if (!ev->when) ev->when = time(NULL); ev->thd = thd; // because up to this point, ev->thd == 0 - exec_res = ev->exec_event(rli); + + exec_res= ev->exec_event(rli); DBUG_PRINT("info", ("exec_event result = %d", exec_res)); DBUG_ASSERT(rli->sql_thd==thd); /* @@ -2354,13 +2308,17 @@ Slave SQL thread aborted. Can't execute init_slave query"); THD_CHECK_SENTRY(thd); if (exec_relay_log_event(thd,rli)) { + DBUG_PRINT("info", ("exec_relay_log_event() failed")); // do not scare the user if SQL thread was simply killed or stopped if (!sql_slave_killed(thd,rli)) { /* - retrieve as much info as possible from the thd and, error codes and warnings - and print this to the error log as to allow the user to locate the error + retrieve as much info as possible from the thd and, error + codes and warnings and print this to the error log as to + allow the user to locate the error */ + DBUG_PRINT("info", ("thd->net.last_errno=%d; rli->last_slave_errno=%d", + thd->net.last_errno, rli->last_slave_errno)); if (thd->net.last_errno != 0) { if (rli->last_slave_errno == 0) @@ -2682,6 +2640,7 @@ static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf, my_free((char*) tmp_buf, MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(1); } + pthread_mutex_lock(&mi->data_lock); ev->log_pos= mi->master_log_pos; /* 3.23 events don't contain log_pos */ switch (ev->get_type_code()) { From 60f0cd8b13b73a99b4e4d843e7720526e27c9726 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Jan 2007 21:09:54 +0100 Subject: [PATCH 008/789] BUILD scripts: s/(dist)?clean/maintainer-clean/ BUILD/FINISH.sh: s/(dist)?clean/maintainer-clean/ BUILD/compile-alpha-ccc: s/(dist)?clean/maintainer-clean/ BUILD/compile-alpha-cxx: s/(dist)?clean/maintainer-clean/ BUILD/compile-alpha-debug: s/(dist)?clean/maintainer-clean/ BUILD/compile-dist: s/(dist)?clean/maintainer-clean/ BUILD/compile-hpux11-parisc2-aCC: s/(dist)?clean/maintainer-clean/ BUILD/compile-ia64-debug-max: s/(dist)?clean/maintainer-clean/ BUILD/compile-irix-mips64-mipspro: s/(dist)?clean/maintainer-clean/ BUILD/compile-pentium-pgcc: s/(dist)?clean/maintainer-clean/ BUILD/compile-solaris-sparc-forte: s/(dist)?clean/maintainer-clean/ BUILD/compile-solaris-sparc-purify: s/(dist)?clean/maintainer-clean/ --- BUILD/FINISH.sh | 2 +- BUILD/compile-alpha-ccc | 4 +++- BUILD/compile-alpha-cxx | 4 +++- BUILD/compile-alpha-debug | 4 +++- BUILD/compile-dist | 2 +- BUILD/compile-hpux11-parisc2-aCC | 2 +- BUILD/compile-ia64-debug-max | 2 +- BUILD/compile-irix-mips64-mipspro | 2 +- BUILD/compile-pentium-pgcc | 4 +++- BUILD/compile-solaris-sparc-forte | 2 +- BUILD/compile-solaris-sparc-purify | 2 +- 11 files changed, 19 insertions(+), 11 deletions(-) diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh index 6f0600c9de3..142ff7eb08e 100644 --- a/BUILD/FINISH.sh +++ b/BUILD/FINISH.sh @@ -4,7 +4,7 @@ extra_configs="$extra_configs $local_infile_configs" configure="./configure $base_configs $extra_configs" commands="\ -$make -k distclean || true +$make -k maintainer-clean || true /bin/rm -rf */.deps/*.P configure config.cache storage/*/configure storage/*/config.cache autom4te.cache storage/*/autom4te.cache; path=`dirname $0` diff --git a/BUILD/compile-alpha-ccc b/BUILD/compile-alpha-ccc index 889592295b5..59ed241d51c 100755 --- a/BUILD/compile-alpha-ccc +++ b/BUILD/compile-alpha-ccc @@ -1,5 +1,7 @@ +#! /bin/sh + /bin/rm -f */.deps/*.P */*.o -make -k clean +make -k maintainer-clean /bin/rm -f */.deps/*.P */*.o /bin/rm -f config.cache mysql-*.tar.gz diff --git a/BUILD/compile-alpha-cxx b/BUILD/compile-alpha-cxx index 1624f4ed622..a1b5605ac5e 100755 --- a/BUILD/compile-alpha-cxx +++ b/BUILD/compile-alpha-cxx @@ -1,5 +1,7 @@ +#! /bin/sh + /bin/rm -f */.deps/*.P */*.o -make -k clean +make -k maintainer-clean /bin/rm -f */.deps/*.P */*.o /bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache mysql-*.tar.gz diff --git a/BUILD/compile-alpha-debug b/BUILD/compile-alpha-debug index b565a18272f..94fe8a2b414 100755 --- a/BUILD/compile-alpha-debug +++ b/BUILD/compile-alpha-debug @@ -1,5 +1,7 @@ +#! /bin/sh + /bin/rm -f */.deps/*.P */*.o -make -k clean +make -k maintainer-clean /bin/rm -f */.deps/*.P */*.o /bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache mysql-*.tar.gz diff --git a/BUILD/compile-dist b/BUILD/compile-dist index 0504b308ceb..0ecb386bf71 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -6,7 +6,7 @@ # tree can then be picked up by "make dist" to create the "pristine source # package" that is used as the basis for all other binary builds. # -test -f Makefile && make distclean +test -f Makefile && make maintainer-clean (cd storage/innobase && aclocal && autoheader && \ libtoolize --automake --force --copy && \ automake --force --add-missing --copy && autoconf) diff --git a/BUILD/compile-hpux11-parisc2-aCC b/BUILD/compile-hpux11-parisc2-aCC index c286488bb26..0e825715663 100755 --- a/BUILD/compile-hpux11-parisc2-aCC +++ b/BUILD/compile-hpux11-parisc2-aCC @@ -61,7 +61,7 @@ done set -x -make distclean +make maintainer-clean path=`dirname $0` . "$path/autorun.sh" diff --git a/BUILD/compile-ia64-debug-max b/BUILD/compile-ia64-debug-max index d1017ad506b..123bfb06300 100755 --- a/BUILD/compile-ia64-debug-max +++ b/BUILD/compile-ia64-debug-max @@ -1,4 +1,4 @@ -gmake -k clean || true +gmake -k maintainer-clean || true /bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache path=`dirname $0` diff --git a/BUILD/compile-irix-mips64-mipspro b/BUILD/compile-irix-mips64-mipspro index 0cebb4b9f5b..5e34df20c28 100755 --- a/BUILD/compile-irix-mips64-mipspro +++ b/BUILD/compile-irix-mips64-mipspro @@ -33,7 +33,7 @@ else fi set -x -make distclean +make maintainer-clean path=`dirname $0` . "$path/autorun.sh" diff --git a/BUILD/compile-pentium-pgcc b/BUILD/compile-pentium-pgcc index 411241451cf..c13a6ff14f7 100755 --- a/BUILD/compile-pentium-pgcc +++ b/BUILD/compile-pentium-pgcc @@ -1,5 +1,7 @@ +#! /bin/sh + AM_MAKEFLAGS="-j 2" -gmake -k clean || true +gmake -k maintainer-clean || true /bin/rm -f */.deps/*.P config.cache path=`dirname $0` diff --git a/BUILD/compile-solaris-sparc-forte b/BUILD/compile-solaris-sparc-forte index 7cdbff6ae4a..43f68acbbcc 100755 --- a/BUILD/compile-solaris-sparc-forte +++ b/BUILD/compile-solaris-sparc-forte @@ -1,6 +1,6 @@ #! /bin/sh -gmake -k clean || true +gmake -k maintainer-clean || true /bin/rm -f */.deps/*.P config.cache path=`dirname $0` diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify index 8c24b0db98c..547d1b69d68 100755 --- a/BUILD/compile-solaris-sparc-purify +++ b/BUILD/compile-solaris-sparc-purify @@ -31,7 +31,7 @@ do shift done -gmake -k clean || true +gmake -k maintainer-clean || true /bin/rm -f */.deps/*.P config.cache path=`dirname $0` From 2a8ee9fb135243403a29f0de6cb26b2128b17387 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Jan 2007 21:11:42 +0100 Subject: [PATCH 009/789] dbug: don't consider double colom (::) a separator - it can be part of a function name (Item::reset) --- dbug/dbug.c | 6 ++++-- dbug/user.r | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dbug/dbug.c b/dbug/dbug.c index ef63f660543..c212e9117a1 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -1995,12 +1995,14 @@ static char *DbugMalloc(size_t size) /* - * strtok lookalike - splits on ':', magically handles :\ and :/ + * strtok lookalike - splits on ':', magically handles ::, :\ and :/ */ static const char *DbugStrTok(const char *s) { - while (s[0] && (s[0] != ':' || (s[1] == '\\' || s[1] == '/'))) + const char *start=s; + while (s[0] && (s[0] != ':' || + (s[1] == '\\' || s[1] == '/' || (s[1] == ':' && s++)))) s++; return s; } diff --git a/dbug/user.r b/dbug/user.r index 3bcc0c91d1d..e41367de321 100644 --- a/dbug/user.r +++ b/dbug/user.r @@ -908,9 +908,10 @@ via the .B DBUG_PUSH or .B DBUG_SET -macros. Control string consists of colon separate flags. A flag -may take an argument or a list of arguments. If a control string -starts from a '+' sign it works +macros. Control string consists of colon separate flags. Colons +that are part of ':\\', ':/', or '::' are not considered flag +separators. A flag may take an argument or a list of arguments. +If a control string starts from a '+' sign it works .I incrementally, that is, it can modify existing state without overriding it. In such a string every flag may be preceded by a '+' or '-' to enable or disable @@ -923,9 +924,7 @@ optional. .LI a[,file] Redirect the debugger output stream and append it to the specified file. The default output stream is stderr. A null argument list -causes output to be redirected to stdout. A colon that is followed by -the '\\' or '/' is cosidered a part of the path and not a flag -separator. +causes output to be redirected to stdout. .SP 1 EX: \fCa,C:\\tmp\\log\fR .LI A[,file] From 6e1ba88418887369ca71b49222c6fd66335bbe0c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Jan 2007 21:12:58 +0100 Subject: [PATCH 010/789] move intptr from my_atomic.h to my_global.h --- include/my_atomic.h | 8 -------- include/my_global.h | 10 +++++++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/my_atomic.h b/include/my_atomic.h index 7b066e9b529..a1347d26401 100644 --- a/include/my_atomic.h +++ b/include/my_atomic.h @@ -134,14 +134,6 @@ make_atomic_swap(ptr) #undef _atomic_h_cleanup_ #endif -#if SIZEOF_CHARP == SIZEOF_INT -typedef int intptr; -#elif SIZEOF_CHARP == SIZEOF_LONG -typedef long intptr; -#else -#error -#endif - #define MY_ATOMIC_OK 0 #define MY_ATOMIC_NOT_1CPU 1 extern int my_atomic_initialize(); diff --git a/include/my_global.h b/include/my_global.h index f758352b46c..fe60b1b8989 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -987,7 +987,7 @@ typedef long int32; typedef unsigned long uint32; #endif #else -#error "Neither int or long is of 4 bytes width" +#error Neither int or long is of 4 bytes width #endif #if !defined(HAVE_ULONG) && !defined(__USE_MISC) @@ -1017,6 +1017,14 @@ typedef unsigned __int64 my_ulonglong; typedef unsigned long long my_ulonglong; #endif +#if SIZEOF_CHARP == SIZEOF_INT +typedef int intptr; +#elif SIZEOF_CHARP == SIZEOF_LONG +typedef long intptr; +#else +#error sizeof(void *) is neither sizeof(int) nor sizeof(long) +#endif + #ifdef USE_RAID /* The following is done with a if to not get problems with pre-processors From 4e8b49d656828fbe2f84d9970a036db644185981 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Jan 2007 10:40:26 +0100 Subject: [PATCH 011/789] WL#3700: Handler API change: all index search methods - that is, index_read(), index_read_idx(), index_read_last(), and records_in_range() - instead of 'uint keylen' argument take 'ulonglong keypart_map', a bitmap showing which keyparts are present in the key value. Fallback method is provided for handlers that are lagging behind. --- include/heap.h | 2 +- include/my_base.h | 8 +- include/myisam.h | 7 +- include/myisammrg.h | 6 +- sql/event_db_repository.cc | 6 +- sql/ha_ndbcluster.cc | 20 +-- sql/ha_ndbcluster.h | 2 - sql/ha_partition.cc | 55 ++---- sql/ha_partition.h | 10 +- sql/handler.cc | 36 ++-- sql/handler.h | 38 +++- sql/item_subselect.cc | 6 +- sql/key.cc | 14 +- sql/log.cc | 2 +- sql/log_event.cc | 8 +- sql/mysql_priv.h | 2 +- sql/opt_range.cc | 243 ++++++++++++++++---------- sql/opt_range.h | 23 ++- sql/opt_sum.cc | 18 +- sql/slave.cc | 2 + sql/slave.h | 2 - sql/sp.cc | 7 +- sql/sql_acl.cc | 31 ++-- sql/sql_handler.cc | 6 +- sql/sql_help.cc | 5 +- sql/sql_insert.cc | 4 +- sql/sql_plugin.cc | 3 +- sql/sql_select.cc | 16 +- sql/sql_select.h | 5 + sql/sql_servers.cc | 13 +- sql/sql_servers.h | 1 - sql/sql_udf.cc | 3 +- sql/table.cc | 34 +++- sql/table.h | 1 + sql/tztime.cc | 12 +- storage/blackhole/ha_blackhole.cc | 9 +- storage/blackhole/ha_blackhole.h | 7 +- storage/example/ha_example.cc | 5 +- storage/example/ha_example.h | 2 +- storage/federated/ha_federated.cc | 5 +- storage/heap/ha_heap.cc | 13 +- storage/heap/ha_heap.h | 10 +- storage/heap/heapdef.h | 2 +- storage/heap/hp_hash.c | 12 +- storage/heap/hp_rkey.c | 4 +- storage/innobase/handler/ha_innodb.cc | 16 +- storage/myisam/ha_myisam.cc | 26 +-- storage/myisam/ha_myisam.h | 10 +- storage/myisam/mi_check.c | 2 +- storage/myisam/mi_key.c | 51 ++---- storage/myisam/mi_range.c | 42 ++--- storage/myisam/mi_rkey.c | 17 +- storage/myisam/myisamdef.h | 5 +- storage/myisam/rt_test.c | 2 +- storage/myisam/sp_test.c | 2 +- storage/myisammrg/ha_myisammrg.cc | 15 +- storage/myisammrg/ha_myisammrg.h | 10 +- storage/myisammrg/myrg_rkey.c | 6 +- 58 files changed, 483 insertions(+), 441 deletions(-) diff --git a/include/heap.h b/include/heap.h index af053341203..33bbd2f0b3f 100644 --- a/include/heap.h +++ b/include/heap.h @@ -226,7 +226,7 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, key_range *max_key); int hp_panic(enum ha_panic_function flag); int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, - uint key_len, enum ha_rkey_function find_flag); + ulonglong keypart_map, enum ha_rkey_function find_flag); extern gptr heap_find(HP_INFO *info,int inx,const byte *key); extern int heap_check_heap(HP_INFO *info, my_bool print_status); extern byte *heap_position(HP_INFO *info); diff --git a/include/my_base.h b/include/my_base.h index 14e4e3afb44..d7cb68efd1f 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -384,9 +384,10 @@ enum ha_base_keytype { #define HA_ERR_TABLE_NEEDS_UPGRADE 164 /* The table changed in storage engine */ #define HA_ERR_TABLE_READONLY 165 /* The table is not writable */ -#define HA_ERR_AUTOINC_READ_FAILED 166/* Failed to get the next autoinc value */ -#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set the row autoinc value */ -#define HA_ERR_LAST 167 /*Copy last error nr.*/ +#define HA_ERR_AUTOINC_READ_FAILED 166 /* Failed to get next autoinc value */ +#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set row autoinc value */ +#define HA_ERR_GENERIC 168 /* Generic error */ +#define HA_ERR_LAST 168 /*Copy last error nr.*/ /* Add error numbers before HA_ERR_LAST and change it accordingly. */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) @@ -467,6 +468,7 @@ typedef struct st_key_range { const byte *key; uint length; + ulonglong keypart_map; enum ha_rkey_function flag; } key_range; diff --git a/include/myisam.h b/include/myisam.h index f763bf07719..1dd8f6f7ec4 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -274,9 +274,8 @@ extern struct st_myisam_info *mi_open(const char *name,int mode, uint wait_if_locked); extern int mi_panic(enum ha_panic_function function); extern int mi_rfirst(struct st_myisam_info *file,byte *buf,int inx); -extern int mi_rkey(struct st_myisam_info *file,byte *buf,int inx, - const byte *key, - uint key_len, enum ha_rkey_function search_flag); +extern int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, + ulonglong keypart_map, enum ha_rkey_function search_flag); extern int mi_rlast(struct st_myisam_info *file,byte *buf,int inx); extern int mi_rnext(struct st_myisam_info *file,byte *buf,int inx); extern int mi_rnext_same(struct st_myisam_info *info, byte *buf); @@ -303,7 +302,7 @@ extern int mi_extra(struct st_myisam_info *file, enum ha_extra_function function, void *extra_arg); extern int mi_reset(struct st_myisam_info *file); -extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx, +extern ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, key_range *max_key); extern int mi_log(int activate_log); extern int mi_is_changed(struct st_myisam_info *info); diff --git a/include/myisammrg.h b/include/myisammrg.h index 6587613697a..149b72dc7e1 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -86,8 +86,8 @@ extern int myrg_rlast(MYRG_INFO *file,byte *buf,int inx); extern int myrg_rnext(MYRG_INFO *file,byte *buf,int inx); extern int myrg_rprev(MYRG_INFO *file,byte *buf,int inx); extern int myrg_rnext_same(MYRG_INFO *file,byte *buf); -extern int myrg_rkey(MYRG_INFO *file,byte *buf,int inx,const byte *key, - uint key_len, enum ha_rkey_function search_flag); +extern int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, + ulonglong keypart_map, enum ha_rkey_function search_flag); extern int myrg_rrnd(MYRG_INFO *file,byte *buf,ulonglong pos); extern int myrg_rsame(MYRG_INFO *file,byte *record,int inx); extern int myrg_update(MYRG_INFO *file,const byte *old,byte *new_rec); @@ -100,7 +100,7 @@ extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function, void *extra_arg); extern int myrg_reset(MYRG_INFO *info); extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv); -extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx, +extern ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, key_range *min_key, key_range *max_key); extern ulonglong myrg_position(MYRG_INFO *info); diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index bcc7d476fff..860cb54e27f 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -288,7 +288,7 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, { key_copy(key_buf, event_table->record[0], key_info, key_len); if (!(ret= event_table->file->index_read(event_table->record[0], key_buf, - key_len, HA_READ_PREFIX))) + (ulonglong)1, HA_READ_PREFIX))) { DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret)); do @@ -518,7 +518,6 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, my_bool create_if_not) { int ret= 0; - CHARSET_INFO *scs= system_charset_info; TABLE *table= NULL; char old_db_buf[NAME_LEN+1]; LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) }; @@ -844,8 +843,7 @@ Event_db_repository::find_named_event(THD *thd, LEX_STRING db, LEX_STRING name, key_copy(key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, key, - table->key_info->key_length, + if (table->file->index_read_idx(table->record[0], 0, key, ~ULL(0), HA_READ_KEY_EXACT)) { DBUG_PRINT("info", ("Row not found")); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 21697be83aa..cacc2a91c24 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -956,7 +956,6 @@ int ha_ndbcluster::get_ndb_partition_id(NdbOperation *ndb_op) bool ha_ndbcluster::uses_blob_value() { - uint blob_fields; MY_BITMAP *bitmap; uint *blob_index, *blob_index_end; if (table_share->blob_fields == 0) @@ -1108,7 +1107,7 @@ int ha_ndbcluster::create_indexes(Ndb *ndb, TABLE *tab) const char **key_name= tab->s->keynames.type_names; NDBDICT *dict= ndb->getDictionary(); DBUG_ENTER("ha_ndbcluster::create_indexes"); - + for (i= 0; i < tab->s->keys; i++, key_info++, key_name++) { index_name= *key_name; @@ -3375,19 +3374,6 @@ int ha_ndbcluster::index_read(byte *buf, } -int ha_ndbcluster::index_read_idx(byte *buf, uint index_no, - const byte *key, uint key_len, - enum ha_rkey_function find_flag) -{ - statistic_increment(current_thd->status_var.ha_read_key_count, &LOCK_status); - DBUG_ENTER("ha_ndbcluster::index_read_idx"); - DBUG_PRINT("enter", ("index_no: %u, key_len: %u", index_no, key_len)); - close_scan(); - index_init(index_no, 0); - DBUG_RETURN(index_read(buf, key, key_len, find_flag)); -} - - int ha_ndbcluster::index_next(byte *buf) { DBUG_ENTER("ha_ndbcluster::index_next"); @@ -3554,10 +3540,10 @@ int ha_ndbcluster::close_scan() m_multi_cursor= 0; if (!m_active_cursor && !m_multi_cursor) - DBUG_RETURN(1); + DBUG_RETURN(0); NdbScanOperation *cursor= m_active_cursor ? m_active_cursor : m_multi_cursor; - + if (m_lock_tuple) { /* diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 5b6900766b6..db94bcd24ff 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -641,8 +641,6 @@ class ha_ndbcluster: public handler int index_end(); int index_read(byte *buf, const byte *key, uint key_len, enum ha_rkey_function find_flag); - int index_read_idx(byte *buf, uint index, const byte *key, uint key_len, - enum ha_rkey_function find_flag); int index_next(byte *buf); int index_prev(byte *buf); int index_first(byte *buf); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 9d4cd69be12..8b20317d1e7 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -584,7 +584,6 @@ int ha_partition::drop_partitions(const char *path) List_iterator part_it(m_part_info->partitions); char part_name_buff[FN_REFLEN]; uint no_parts= m_part_info->partitions.elements; - uint part_count= 0; uint no_subparts= m_part_info->no_subparts; uint i= 0; uint name_variant; @@ -1075,7 +1074,6 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, uint no_parts= m_part_info->no_parts; uint no_subparts= m_part_info->no_subparts; uint i= 0; - LEX *lex= thd->lex; int error; DBUG_ENTER("ha_partition::handle_opt_partitions"); DBUG_PRINT("enter", ("all_parts %u, flag= %u", all_parts, flag)); @@ -1136,7 +1134,6 @@ int ha_partition::prepare_new_partition(TABLE *table, { int error; bool create_flag= FALSE; - bool open_flag= FALSE; DBUG_ENTER("prepare_new_partition"); if ((error= set_up_table_before_create(table, part_name, create_info, @@ -1245,7 +1242,6 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, handler **new_file_array; int error= 1; bool first; - bool copy_parts= FALSE; uint temp_partitions= m_part_info->temp_partitions.elements; THD *thd= current_thd; DBUG_ENTER("ha_partition::change_partitions"); @@ -2061,7 +2057,6 @@ bool ha_partition::new_handlers_from_part_info(MEM_ROOT *mem_root) partition_element *part_elem; uint alloc_len= (m_tot_parts + 1) * sizeof(handler*); List_iterator_fast part_it(m_part_info->partitions); - THD *thd= current_thd; DBUG_ENTER("ha_partition::new_handlers_from_part_info"); if (!(m_file= (handler **) alloc_root(mem_root, alloc_len))) @@ -3327,13 +3322,14 @@ int ha_partition::index_end() */ int ha_partition::index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, + enum ha_rkey_function find_flag) { DBUG_ENTER("ha_partition::index_read"); end_range= 0; m_index_scan_type= partition_index_read; - DBUG_RETURN(common_index_read(buf, key, key_len, find_flag)); + DBUG_RETURN(common_index_read(buf, key, keypart_map, find_flag)); } @@ -3346,14 +3342,17 @@ int ha_partition::index_read(byte * buf, const byte * key, see index_read for rest */ -int ha_partition::common_index_read(byte *buf, const byte *key, uint key_len, +int ha_partition::common_index_read(byte *buf, const byte *key, + ulonglong keypart_map, enum ha_rkey_function find_flag) { int error; bool reverse_order= FALSE; + uint key_len= calculate_key_len(table, active_index, key, keypart_map); DBUG_ENTER("ha_partition::common_index_read"); memcpy((void*)m_start_key.key, key, key_len); + m_start_key.keypart_map= keypart_map; m_start_key.length= key_len; m_start_key.flag= find_flag; @@ -3481,33 +3480,6 @@ int ha_partition::common_first_last(byte *buf) } -/* - Perform index read using index where always only one row is returned - - SYNOPSIS - index_read_idx() - see index_read for rest of parameters and return values - - DESCRIPTION - Positions an index cursor to the index specified in key. Fetches the - row if any. This is only used to read whole keys. - TODO: Optimise this code to avoid index_init and index_end -*/ - -int ha_partition::index_read_idx(byte * buf, uint index, const byte * key, - uint key_len, - enum ha_rkey_function find_flag) -{ - int res; - DBUG_ENTER("ha_partition::index_read_idx"); - - index_init(index, 0); - res= index_read(buf, key, key_len, find_flag); - index_end(); - DBUG_RETURN(res); -} - - /* Read last using key @@ -3526,14 +3498,15 @@ int ha_partition::index_read_idx(byte * buf, uint index, const byte * key, Can only be used on indexes supporting HA_READ_ORDER */ -int ha_partition::index_read_last(byte *buf, const byte *key, uint keylen) +int ha_partition::index_read_last(byte *buf, const byte *key, + ulonglong keypart_map) { DBUG_ENTER("ha_partition::index_read_last"); m_ordered= TRUE; // Safety measure end_range= 0; m_index_scan_type= partition_index_read_last; - DBUG_RETURN(common_index_read(buf, key, keylen, HA_READ_PREFIX_LAST)); + DBUG_RETURN(common_index_read(buf, key, keypart_map, HA_READ_PREFIX_LAST)); } @@ -3679,7 +3652,7 @@ int ha_partition::read_range_first(const key_range *start_key, m_index_scan_type= partition_index_read; error= common_index_read(m_rec0, start_key->key, - start_key->length, start_key->flag); + start_key->keypart_map, start_key->flag); } DBUG_RETURN(error); } @@ -3878,7 +3851,7 @@ int ha_partition::handle_unordered_scan_next_partition(byte * buf) case partition_index_read: DBUG_PRINT("info", ("index_read on partition %d", i)); error= file->index_read(buf, m_start_key.key, - m_start_key.length, + m_start_key.keypart_map, m_start_key.flag); break; case partition_index_first: @@ -3970,7 +3943,7 @@ int ha_partition::handle_ordered_index_scan(byte *buf, bool reverse_order) case partition_index_read: error= file->index_read(rec_buf_ptr, m_start_key.key, - m_start_key.length, + m_start_key.keypart_map, m_start_key.flag); break; case partition_index_first: @@ -3984,7 +3957,7 @@ int ha_partition::handle_ordered_index_scan(byte *buf, bool reverse_order) case partition_index_read_last: error= file->index_read_last(rec_buf_ptr, m_start_key.key, - m_start_key.length); + m_start_key.keypart_map); reverse_order= TRUE; break; default: diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 4fdf325fa06..ad5d412a6d2 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -378,9 +378,8 @@ public: any end processing needed. */ virtual int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - virtual int index_read_idx(byte * buf, uint idx, const byte * key, - uint key_len, enum ha_rkey_function find_flag); + ulonglong keypart_map, + enum ha_rkey_function find_flag); virtual int index_init(uint idx, bool sorted); virtual int index_end(); @@ -393,7 +392,8 @@ public: virtual int index_first(byte * buf); virtual int index_last(byte * buf); virtual int index_next_same(byte * buf, const byte * key, uint keylen); - virtual int index_read_last(byte * buf, const byte * key, uint keylen); + virtual int index_read_last(byte * buf, const byte * key, + ulonglong keypart_map); /* read_first_row is virtual method but is only implemented by @@ -419,7 +419,7 @@ public: private: int common_index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag); + ulonglong keypart_map, enum ha_rkey_function find_flag); int common_first_last(byte * buf); int partition_scan_set_up(byte * buf, bool idx_read_flag); int handle_unordered_next(byte * buf, bool next_same); diff --git a/sql/handler.cc b/sql/handler.cc index c596556fc98..1d38411330a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -48,8 +48,6 @@ KEY_CREATE_INFO default_key_create_info= { HA_KEY_ALG_UNDEF, 0, {NullS,0} }; static handler *create_default(TABLE_SHARE *table, MEM_ROOT *mem_root); -static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES; - /* number of entries in handlertons[] */ ulong total_ha= 0; /* number of storage engines (from handlertons[]) that support 2pc */ @@ -1854,7 +1852,7 @@ int handler::update_auto_increment() nr= compute_next_insert_id(nr-1, variables); } - if (table->s->next_number_key_offset == 0) + if (table->s->next_number_keypart == 0) { /* We must defer the appending until "nr" has been possibly truncated */ append= TRUE; @@ -1976,7 +1974,7 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment, table->read_set); column_bitmaps_signal(); index_init(table->s->next_number_index, 1); - if (!table->s->next_number_key_offset) + if (table->s->next_number_keypart == 0) { // Autoincrement at key-start error=index_last(table->record[1]); /* @@ -1992,7 +1990,8 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment, key_copy(key, table->record[0], table->key_info + table->s->next_number_index, table->s->next_number_key_offset); - error= index_read(table->record[1], key, table->s->next_number_key_offset, + error= index_read(table->record[1], key, + make_prev_keypart_map(table->s->next_number_keypart), HA_READ_PREFIX_LAST); /* MySQL needs to call us for next row: assume we are inserting ("a",null) @@ -3103,9 +3102,9 @@ int handler::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, multi_range_curr < multi_range_end; multi_range_curr++) { - result= read_range_first(multi_range_curr->start_key.length ? + result= read_range_first(multi_range_curr->start_key.keypart_map ? &multi_range_curr->start_key : 0, - multi_range_curr->end_key.length ? + multi_range_curr->end_key.keypart_map ? &multi_range_curr->end_key : 0, test(multi_range_curr->range_flag & EQ_RANGE), multi_range_sorted); @@ -3171,9 +3170,9 @@ int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p) multi_range_curr < multi_range_end; multi_range_curr++) { - result= read_range_first(multi_range_curr->start_key.length ? + result= read_range_first(multi_range_curr->start_key.keypart_map ? &multi_range_curr->start_key : 0, - multi_range_curr->end_key.length ? + multi_range_curr->end_key.keypart_map ? &multi_range_curr->end_key : 0, test(multi_range_curr->range_flag & EQ_RANGE), multi_range_sorted); @@ -3233,7 +3232,7 @@ int handler::read_range_first(const key_range *start_key, else result= index_read(table->record[0], start_key->key, - start_key->length, + start_key->keypart_map, start_key->flag); if (result) DBUG_RETURN((result == HA_ERR_KEY_NOT_FOUND) @@ -3307,15 +3306,19 @@ int handler::compare_key(key_range *range) return cmp; } + int handler::index_read_idx(byte * buf, uint index, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, + enum ha_rkey_function find_flag) { - int error= ha_index_init(index, 0); + int error, error1; + error= index_init(index, 0); if (!error) - error= index_read(buf, key, key_len, find_flag); - if (!error) - error= ha_index_end(); - return error; + { + error= index_read(buf, key, keypart_map, find_flag); + error1= index_end(); + } + return error ? error : error1; } @@ -3365,7 +3368,6 @@ static my_bool exts_handlerton(THD *unused, st_plugin_int *plugin, TYPELIB *ha_known_exts(void) { - MEM_ROOT *mem_root= current_thd->mem_root; if (!known_extensions.type_names || mysys_usage_id != known_extensions_id) { List found_exts; diff --git a/sql/handler.h b/sql/handler.h index 82970cc1ac6..1d02d6a7ee3 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -867,6 +867,18 @@ public: {} }; +uint calculate_key_len(TABLE *, uint, const byte *, ulonglong); +/* + bitmap with first N+1 bits set + (keypart_map for a key prefix of [0..N] keyparts) +*/ +#define make_keypart_map(N) (((ulonglong)2 << (N)) - 1) +/* + bitmap with first N bits set + (keypart_map for a key prefix of [0..N-1] keyparts) +*/ +#define make_prev_keypart_map(N) (((ulonglong)1 << (N)) - 1) + /* The handler class is the interface for dynamically loadable storage engines. Do not add ifdefs and take care when adding or @@ -1202,11 +1214,20 @@ public: DBUG_ASSERT(FALSE); return HA_ERR_WRONG_COMMAND; } - virtual int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + private: + virtual int index_read(byte * buf, const byte * key, uint key_len, + enum ha_rkey_function find_flag) { return HA_ERR_WRONG_COMMAND; } + public: + virtual int index_read(byte * buf, const byte * key, ulonglong keypart_map, + enum ha_rkey_function find_flag) + { + uint key_len= calculate_key_len(table, active_index, key, keypart_map); + return index_read(buf, key, key_len, find_flag); + } virtual int index_read_idx(byte * buf, uint index, const byte * key, - uint key_len, enum ha_rkey_function find_flag); + ulonglong keypart_map, + enum ha_rkey_function find_flag); virtual int index_next(byte * buf) { return HA_ERR_WRONG_COMMAND; } virtual int index_prev(byte * buf) @@ -1216,8 +1237,16 @@ public: virtual int index_last(byte * buf) { return HA_ERR_WRONG_COMMAND; } virtual int index_next_same(byte *buf, const byte *key, uint keylen); + private: virtual int index_read_last(byte * buf, const byte * key, uint key_len) { return (my_errno=HA_ERR_WRONG_COMMAND); } + public: + virtual int index_read_last(byte * buf, const byte * key, + ulonglong keypart_map) + { + uint key_len= calculate_key_len(table, active_index, key, keypart_map); + return index_read_last(buf, key, key_len); + } virtual int read_multi_range_first(KEY_MULTI_RANGE **found_range_p, KEY_MULTI_RANGE *ranges, uint range_count, bool sorted, HANDLER_BUFFER *buffer); @@ -1243,8 +1272,7 @@ public: { return HA_ERR_WRONG_COMMAND; } virtual int rnd_same(byte *buf, uint inx) { return HA_ERR_WRONG_COMMAND; } - virtual ha_rows records_in_range(uint inx, key_range *min_key, - key_range *max_key) + virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) { return (ha_rows) 10; } virtual void position(const byte *record)=0; virtual int info(uint)=0; // see my_base.h for full description diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index e131072d9bf..9867464e88e 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -2013,7 +2013,8 @@ int subselect_uniquesubquery_engine::exec() table->file->ha_index_init(tab->ref.key, 0); error= table->file->index_read(table->record[0], tab->ref.key_buff, - tab->ref.key_length,HA_READ_KEY_EXACT); + tab_to_keypart_map(tab), + HA_READ_KEY_EXACT); if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) error= report_error(table, error); @@ -2122,7 +2123,8 @@ int subselect_indexsubquery_engine::exec() table->file->ha_index_init(tab->ref.key, 1); error= table->file->index_read(table->record[0], tab->ref.key_buff, - tab->ref.key_length,HA_READ_KEY_EXACT); + tab_to_keypart_map(tab), + HA_READ_KEY_EXACT); if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) error= report_error(table, error); diff --git a/sql/key.cc b/sql/key.cc index bd614b10a70..faa7bf1f04b 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -29,6 +29,7 @@ field Field to search after key_length On partial match, contains length of fields before field + keypart key part # of a field NOTES Used when calculating key for NEXT_NUMBER @@ -45,7 +46,7 @@ */ int find_ref_key(KEY *key, uint key_count, byte *record, Field *field, - uint *key_length) + uint *key_length, uint *keypart) { reg2 int i; reg3 KEY *key_info; @@ -60,8 +61,8 @@ int find_ref_key(KEY *key, uint key_count, byte *record, Field *field, { if (key_info->key_part[0].offset == fieldpos) { /* Found key. Calc keylength */ - *key_length=0; - return(i); /* Use this key */ + *key_length= *keypart= 0; + return i; /* Use this key */ } } @@ -78,8 +79,11 @@ int find_ref_key(KEY *key, uint key_count, byte *record, Field *field, j++, key_part++) { if (key_part->offset == fieldpos) - return(i); /* Use this key */ - *key_length+=key_part->store_length; + { + *keypart= j; + return i; /* Use this key */ + } + *key_length+= key_part->store_length; } } return(-1); /* No key is ok */ diff --git a/sql/log.cc b/sql/log.cc index 1b432ca15c0..5dc15ecc445 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3787,7 +3787,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) nb_elements())); /* If the auto_increment was second in a table's index (possible with - MyISAM or BDB) (table->next_number_key_offset != 0), such event is + MyISAM or BDB) (table->next_number_keypart != 0), such event is in fact not necessary. We could avoid logging it. */ Intvar_log_event e(thd, (uchar) INSERT_ID_EVENT, diff --git a/sql/log_event.cc b/sql/log_event.cc index 82fb64bfe15..673b23d933f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6720,9 +6720,8 @@ replace_record(THD *thd, TABLE *table, } key_copy((byte*)key.get(), table->record[0], table->key_info + keynum, 0); - error= table->file->index_read_idx(table->record[1], keynum, - (const byte*)key.get(), - table->key_info[keynum].key_length, + error= table->file->index_read_idx(table->record[1], keynum, + (const byte*)key.get(), ~ULL(0), HA_READ_KEY_EXACT); if (error) DBUG_RETURN(error); @@ -6907,8 +6906,7 @@ static int find_and_fetch_row(TABLE *table, byte *key) table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; table->record[1][pos]= 0xFF; if ((error= table->file->index_read(table->record[1], key, - table->key_info->key_length, - HA_READ_KEY_EXACT))) + ~(ulonglong)0, HA_READ_KEY_EXACT))) { table->file->print_error(error, MYF(0)); table->file->ha_index_end(); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 742efc71e63..faac6f4a7ca 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1445,7 +1445,7 @@ void print_plan(JOIN* join,uint idx, double record_count, double read_time, void mysql_print_status(); /* key.cc */ int find_ref_key(KEY *key, uint key_count, byte *record, Field *field, - uint *key_length); + uint *key_length, uint *keypart); void key_copy(byte *to_key, byte *from_record, KEY *key_info, uint key_length); void key_restore(byte *to_record, byte *from_key, KEY *key_info, uint key_length); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 628b07631c1..3c729688e8d 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -310,7 +310,7 @@ public: min_value=arg->max_value; min_flag=arg->max_flag & NEAR_MAX ? 0 : NEAR_MIN; } - void store_min(uint length,char **min_key,uint min_key_flag) + int store_min(uint length,char **min_key,uint min_key_flag) { if ((min_flag & GEOM_FLAG) || (!(min_flag & NO_MIN_RANGE) && @@ -324,12 +324,12 @@ public: else memcpy(*min_key,min_value,length); (*min_key)+= length; + return 1; } + return 0; } - void store(uint length,char **min_key,uint min_key_flag, - char **max_key, uint max_key_flag) + int store_max(uint length,char **max_key, uint max_key_flag) { - store_min(length, min_key, min_key_flag); if (!(max_flag & NO_MAX_RANGE) && !(max_key_flag & (NO_MAX_RANGE | NEAR_MAX))) { @@ -341,33 +341,45 @@ public: else memcpy(*max_key,max_value,length); (*max_key)+= length; + return 1; } + return 0; } + /*void store(uint length,char **min_key,uint min_key_flag, + char **max_key, uint max_key_flag) + { + store_min(length, min_key, min_key_flag); + store_max(length, max_key, max_key_flag); + }*/ - void store_min_key(KEY_PART *key,char **range_key, uint *range_key_flag) + int store_min_key(KEY_PART *key,char **range_key, uint *range_key_flag) { SEL_ARG *key_tree= first(); - key_tree->store(key[key_tree->part].store_length, - range_key,*range_key_flag,range_key,NO_MAX_RANGE); + uint res= key_tree->store_min(key[key_tree->part].store_length, + range_key, *range_key_flag); *range_key_flag|= key_tree->min_flag; if (key_tree->next_key_part && key_tree->next_key_part->part == key_tree->part+1 && !(*range_key_flag & (NO_MIN_RANGE | NEAR_MIN)) && key_tree->next_key_part->type == SEL_ARG::KEY_RANGE) - key_tree->next_key_part->store_min_key(key,range_key, range_key_flag); + res+= key_tree->next_key_part->store_min_key(key, range_key, + range_key_flag); + return res; } - void store_max_key(KEY_PART *key,char **range_key, uint *range_key_flag) + int store_max_key(KEY_PART *key,char **range_key, uint *range_key_flag) { SEL_ARG *key_tree= last(); - key_tree->store(key[key_tree->part].store_length, - range_key, NO_MIN_RANGE, range_key,*range_key_flag); + uint res=key_tree->store_max(key[key_tree->part].store_length, + range_key, *range_key_flag); (*range_key_flag)|= key_tree->max_flag; if (key_tree->next_key_part && key_tree->next_key_part->part == key_tree->part+1 && !(*range_key_flag & (NO_MAX_RANGE | NEAR_MAX)) && key_tree->next_key_part->type == SEL_ARG::KEY_RANGE) - key_tree->next_key_part->store_max_key(key,range_key, range_key_flag); + res+= key_tree->next_key_part->store_max_key(key, range_key, + range_key_flag); + return res; } SEL_ARG *insert(SEL_ARG *key); @@ -583,8 +595,8 @@ static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts); static ha_rows check_quick_select(PARAM *param,uint index,SEL_ARG *key_tree, bool update_tbl_stats); static ha_rows check_quick_keys(PARAM *param,uint index,SEL_ARG *key_tree, - char *min_key,uint min_key_flag, - char *max_key, uint max_key_flag); + char *min_key, uint min_key_flag, int, + char *max_key, uint max_key_flag, int); QUICK_RANGE_SELECT *get_quick_select(PARAM *param,uint index, SEL_ARG *key_tree, @@ -606,9 +618,6 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, double read_time); static TRP_GROUP_MIN_MAX *get_best_group_min_max(PARAM *param, SEL_TREE *tree); -static int get_index_merge_params(PARAM *param, key_map& needed_reg, - SEL_IMERGE *imerge, double *read_time, - ha_rows* imerge_rows); static double get_index_only_read_time(const PARAM* param, ha_rows records, int keynr); @@ -1455,6 +1464,7 @@ QUICK_ROR_UNION_SELECT::~QUICK_ROR_UNION_SELECT() QUICK_RANGE::QUICK_RANGE() :min_key(0),max_key(0),min_length(0),max_length(0), + min_keypart_map(0), max_keypart_map(0), flag(NO_MIN_RANGE | NO_MAX_RANGE) {} @@ -2425,8 +2435,6 @@ static int find_used_partitions_imerge(PART_PRUNE_PARAM *ppar, static int find_used_partitions_imerge_list(PART_PRUNE_PARAM *ppar, List &merges); static void mark_all_partitions_as_used(partition_info *part_info); -static uint32 part_num_to_part_id_range(PART_PRUNE_PARAM* prune_par, - uint32 num); #ifndef DBUG_OFF static void print_partitioning_index(KEY_PART *parts, KEY_PART *parts_end); @@ -4035,9 +4043,9 @@ void ror_intersect_cpy(ROR_INTERSECT_INFO *dst, const ROR_INTERSECT_INFO *src) The calculation is conducted as follows: Lets denote #records(keypart1, ... keypartK) as n_k. We need to calculate - n_{k1} n_{k_2} + n_{k1} n_{k2} --------- * --------- * .... (3) - n_{k1-1} n_{k2_1} + n_{k1-1} n_{k2-1} where k1,k2,... are key parts which fields were not yet marked as fixed ( this is result of application of option b) of the recursion step for @@ -4045,9 +4053,9 @@ void ror_intersect_cpy(ROR_INTERSECT_INFO *dst, const ROR_INTERSECT_INFO *src) Since it is reasonable to expect that most of the fields are not marked as fixed, we calculate (3) as - n_{i1} n_{i_2} + n_{i1} n_{i2} (3) = n_{max_key_part} / ( --------- * --------- * .... ) - n_{i1-1} n_{i2_1} + n_{i1-1} n_{i2-1} where i1,i2, .. are key parts that were already marked as fixed. @@ -4056,7 +4064,6 @@ void ror_intersect_cpy(ROR_INTERSECT_INFO *dst, const ROR_INTERSECT_INFO *src) RETURN Selectivity of given ROR scan. - */ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, @@ -4067,6 +4074,7 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, byte key_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH]; /* key values tuple */ char *key_ptr= (char*) key_val; SEL_ARG *sel_arg, *tuple_arg= NULL; + ulonglong keypart_map= 0; bool cur_covered; bool prev_covered= test(bitmap_is_set(&info->covered_fields, key_part->fieldnr-1)); @@ -4077,7 +4085,7 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, max_range.key= (byte*) key_val; max_range.flag= HA_READ_AFTER_KEY; ha_rows prev_records= info->param->table->file->stats.records; - DBUG_ENTER("ror_intersect_selectivity"); + DBUG_ENTER("ror_scan_selectivity"); for (sel_arg= scan->sel_arg; sel_arg; sel_arg= sel_arg->next_key_part) @@ -4094,13 +4102,17 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, tuple_arg= scan->sel_arg; /* Here we use the length of the first key part */ tuple_arg->store_min(key_part->store_length, &key_ptr, 0); + keypart_map= 1; } while (tuple_arg->next_key_part != sel_arg) { tuple_arg= tuple_arg->next_key_part; - tuple_arg->store_min(key_part[tuple_arg->part].store_length, &key_ptr, 0); + tuple_arg->store_min(key_part[tuple_arg->part].store_length, + &key_ptr, 0); + keypart_map= (keypart_map << 1) | 1; } min_range.length= max_range.length= ((char*) key_ptr - (char*) key_val); + min_range.keypart_map= max_range.keypart_map= keypart_map; records= (info->param->table->file-> records_in_range(scan->keynr, &min_range, &max_range)); if (cur_covered) @@ -5310,12 +5322,11 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond) */ for (uint i= 1 ; i < cond_func->arg_count ; i++) { - if (cond_func->arguments()[i]->real_item()->type() == Item::FIELD_ITEM) { field_item= (Item_field*) (cond_func->arguments()[i]->real_item()); SEL_TREE *tmp= get_full_func_mm_tree(param, cond_func, - field_item, (Item*) i, inv); + field_item, (Item*)(intptr)i, inv); if (inv) tree= !tree ? tmp : tree_or(param, tree, tmp); else @@ -7046,7 +7057,9 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree, bool update_tbl_stats) } param->n_ranges= 0; - records=check_quick_keys(param,idx,tree,param->min_key,0,param->max_key,0); + records= check_quick_keys(param, idx, tree, + param->min_key, 0, -1, + param->max_key, 0, -1); if (records != HA_POS_ERROR) { if (update_tbl_stats) @@ -7109,12 +7122,13 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree, bool update_tbl_stats) */ static ha_rows -check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, - char *min_key,uint min_key_flag, char *max_key, - uint max_key_flag) +check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree, + char *min_key, uint min_key_flag, int min_keypart, + char *max_key, uint max_key_flag, int max_keypart) { ha_rows records=0, tmp; uint tmp_min_flag, tmp_max_flag, keynr, min_key_length, max_key_length; + uint tmp_min_keypart= min_keypart, tmp_max_keypart= max_keypart; char *tmp_min_key, *tmp_max_key; param->max_key_part=max(param->max_key_part,key_tree->part); @@ -7127,18 +7141,21 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, This is not a ROR scan if the key is not Clustered Primary Key. */ param->is_ror_scan= FALSE; - records=check_quick_keys(param,idx,key_tree->left,min_key,min_key_flag, - max_key,max_key_flag); + records=check_quick_keys(param, idx, key_tree->left, + min_key, min_key_flag, min_keypart, + max_key, max_key_flag, max_keypart); if (records == HA_POS_ERROR) // Impossible return records; } tmp_min_key= min_key; tmp_max_key= max_key; - key_tree->store(param->key[idx][key_tree->part].store_length, - &tmp_min_key,min_key_flag,&tmp_max_key,max_key_flag); - min_key_length= (uint) (tmp_min_key- param->min_key); - max_key_length= (uint) (tmp_max_key- param->max_key); + tmp_min_keypart+= key_tree->store_min(param->key[idx][key_tree->part].store_length, + &tmp_min_key, min_key_flag); + tmp_max_keypart+= key_tree->store_max(param->key[idx][key_tree->part].store_length, + &tmp_max_key, max_key_flag); + min_key_length= (uint) (tmp_min_key - param->min_key); + max_key_length= (uint) (tmp_max_key - param->max_key); if (param->is_ror_scan) { @@ -7158,12 +7175,13 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, key_tree->next_key_part->type == SEL_ARG::KEY_RANGE) { // const key as prefix if (min_key_length == max_key_length && - !memcmp(min_key,max_key, (uint) (tmp_max_key - max_key)) && + !memcmp(min_key, max_key, (uint) (tmp_max_key - max_key)) && !key_tree->min_flag && !key_tree->max_flag) { - tmp=check_quick_keys(param,idx,key_tree->next_key_part, - tmp_min_key, min_key_flag | key_tree->min_flag, - tmp_max_key, max_key_flag | key_tree->max_flag); + tmp=check_quick_keys(param,idx,key_tree->next_key_part, tmp_min_key, + min_key_flag | key_tree->min_flag, tmp_min_keypart, + tmp_max_key, max_key_flag | key_tree->max_flag, + tmp_max_keypart); goto end; // Ugly, but efficient } else @@ -7175,18 +7193,20 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, tmp_min_flag=key_tree->min_flag; tmp_max_flag=key_tree->max_flag; if (!tmp_min_flag) + tmp_min_keypart+= key_tree->next_key_part->store_min_key(param->key[idx], &tmp_min_key, &tmp_min_flag); if (!tmp_max_flag) + tmp_max_keypart+= key_tree->next_key_part->store_max_key(param->key[idx], &tmp_max_key, &tmp_max_flag); - min_key_length= (uint) (tmp_min_key- param->min_key); - max_key_length= (uint) (tmp_max_key- param->max_key); + min_key_length= (uint) (tmp_min_key - param->min_key); + max_key_length= (uint) (tmp_max_key - param->max_key); } else { - tmp_min_flag=min_key_flag | key_tree->min_flag; - tmp_max_flag=max_key_flag | key_tree->max_flag; + tmp_min_flag= min_key_flag | key_tree->min_flag; + tmp_max_flag= max_key_flag | key_tree->max_flag; } keynr=param->real_keynr[idx]; @@ -7194,9 +7214,8 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, if (!tmp_min_flag && ! tmp_max_flag && (uint) key_tree->part+1 == param->table->key_info[keynr].key_parts && (param->table->key_info[keynr].flags & (HA_NOSAME | HA_END_SPACE_KEY)) == - HA_NOSAME && - min_key_length == max_key_length && - !memcmp(param->min_key,param->max_key,min_key_length)) + HA_NOSAME && min_key_length == max_key_length && + !memcmp(param->min_key, param->max_key, min_key_length)) { tmp=1; // Max one record param->n_ranges++; @@ -7215,7 +7234,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, first members of clustered primary key. */ if (!(min_key_length == max_key_length && - !memcmp(min_key,max_key, (uint) (tmp_max_key - max_key)) && + !memcmp(min_key, max_key, (uint) (tmp_max_key - max_key)) && !key_tree->min_flag && !key_tree->max_flag && is_key_scan_ror(param, keynr, key_tree->part + 1))) param->is_ror_scan= FALSE; @@ -7227,11 +7246,12 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, key_range min_range; min_range.key= (byte*) param->min_key; min_range.length= min_key_length; + min_range.keypart_map= make_keypart_map(tmp_min_keypart); /* In this case tmp_min_flag contains the handler-read-function */ min_range.flag= (ha_rkey_function) (tmp_min_flag ^ GEOM_FLAG); - tmp= param->table->file->records_in_range(keynr, &min_range, - (key_range*) 0); + tmp= param->table->file->records_in_range(keynr, + &min_range, (key_range*) 0); } else { @@ -7241,10 +7261,12 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, min_range.length= min_key_length; min_range.flag= (tmp_min_flag & NEAR_MIN ? HA_READ_AFTER_KEY : HA_READ_KEY_EXACT); + min_range.keypart_map= make_keypart_map(tmp_min_keypart); max_range.key= (byte*) param->max_key; max_range.length= max_key_length; max_range.flag= (tmp_max_flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); + max_range.keypart_map= make_keypart_map(tmp_max_keypart); tmp=param->table->file->records_in_range(keynr, (min_key_length ? &min_range : (key_range*) 0), @@ -7265,8 +7287,9 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, This is not a ROR scan if the key is not Clustered Primary Key. */ param->is_ror_scan= FALSE; - tmp=check_quick_keys(param,idx,key_tree->right,min_key,min_key_flag, - max_key,max_key_flag); + tmp=check_quick_keys(param, idx, key_tree->right, + min_key, min_key_flag, min_keypart, + max_key, max_key_flag, max_keypart); if (tmp == HA_POS_ERROR) return tmp; records+=tmp; @@ -7412,6 +7435,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, { QUICK_RANGE *range; uint flag; + int min_part= key_tree->part-1, max_part=key_tree->part-1; if (key_tree->left != &null_element) { @@ -7420,16 +7444,18 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, return 1; } char *tmp_min_key=min_key,*tmp_max_key=max_key; - key_tree->store(key[key_tree->part].store_length, - &tmp_min_key,min_key_flag,&tmp_max_key,max_key_flag); + min_part+= key_tree->store_min(key[key_tree->part].store_length, + &tmp_min_key,min_key_flag); + max_part+= key_tree->store_max(key[key_tree->part].store_length, + &tmp_max_key,max_key_flag); if (key_tree->next_key_part && key_tree->next_key_part->part == key_tree->part+1 && key_tree->next_key_part->type == SEL_ARG::KEY_RANGE) { // const key as prefix - if (!((tmp_min_key - min_key) != (tmp_max_key - max_key) || - memcmp(min_key,max_key, (uint) (tmp_max_key - max_key)) || - key_tree->min_flag || key_tree->max_flag)) + if ((tmp_min_key - min_key) == (tmp_max_key - max_key) && + memcmp(min_key, max_key, (uint)(tmp_max_key - max_key))==0 && + key_tree->min_flag==0 && key_tree->max_flag==0) { if (get_quick_keys(param,quick,key,key_tree->next_key_part, tmp_min_key, min_key_flag | key_tree->min_flag, @@ -7440,11 +7466,15 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, { uint tmp_min_flag=key_tree->min_flag,tmp_max_flag=key_tree->max_flag; if (!tmp_min_flag) - key_tree->next_key_part->store_min_key(key, &tmp_min_key, + { + min_part+= key_tree->next_key_part->store_min_key(key, &tmp_min_key, &tmp_min_flag); + } if (!tmp_max_flag) - key_tree->next_key_part->store_max_key(key, &tmp_max_key, + { + max_part+= key_tree->next_key_part->store_max_key(key, &tmp_max_key, &tmp_max_flag); + } flag=tmp_min_flag | tmp_max_flag; } } @@ -7494,13 +7524,15 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, /* Get range for retrieving rows in QUICK_SELECT::get_next */ if (!(range= new QUICK_RANGE((const char *) param->min_key, (uint) (tmp_min_key - param->min_key), + min_part >=0 ? make_keypart_map(min_part) : 0, (const char *) param->max_key, (uint) (tmp_max_key - param->max_key), + max_part >=0 ? make_keypart_map(max_part) : 0, flag))) return 1; // out of memory - set_if_bigger(quick->max_used_key_length,range->min_length); - set_if_bigger(quick->max_used_key_length,range->max_length); + set_if_bigger(quick->max_used_key_length, range->min_length); + set_if_bigger(quick->max_used_key_length, range->max_length); set_if_bigger(quick->used_key_parts, (uint) key_tree->part+1); if (insert_dynamic(&quick->ranges, (gptr)&range)) return 1; @@ -7642,6 +7674,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, range->min_key=range->max_key=(char*) ref->key_buff; range->min_length=range->max_length=ref->key_length; + range->min_keypart_map= range->max_keypart_map= (1 << ref->key_parts) - 1; range->flag= ((ref->key_length == key_info->key_length && (key_info->flags & (HA_NOSAME | HA_END_SPACE_KEY)) == HA_NOSAME) ? EQ_RANGE : 0); @@ -7675,8 +7708,10 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, *ref->null_ref_key= 1; // Set null byte then create a range if (!(null_range= new (alloc) QUICK_RANGE((char*)ref->key_buff, ref->key_length, + (1 << ref->key_parts) - 1, (char*)ref->key_buff, ref->key_length, + (1 << ref->key_parts) - 1, EQ_RANGE))) goto err; *ref->null_ref_key= 0; // Clear null byte @@ -8129,6 +8164,7 @@ int QUICK_RANGE_SELECT::get_next() start_key->flag= ((range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : (range->flag & EQ_RANGE) ? HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT); + start_key->keypart_map= range->min_keypart_map; end_key->key= (const byte*) range->max_key; end_key->length= range->max_length; /* @@ -8137,6 +8173,7 @@ int QUICK_RANGE_SELECT::get_next() */ end_key->flag= (range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); + end_key->keypart_map= range->max_keypart_map; mrange_slot->range_flag= range->flag; } @@ -8186,7 +8223,9 @@ end: other if some error occurred */ -int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, byte *cur_prefix) +int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, + ulonglong keypart_map, + byte *cur_prefix) { DBUG_ENTER("QUICK_RANGE_SELECT::get_next_prefix"); @@ -8198,8 +8237,7 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, byte *cur_prefix) { /* Read the next record in the same range with prefix after cur_prefix. */ DBUG_ASSERT(cur_prefix != 0); - result= file->index_read(record, cur_prefix, prefix_length, - HA_READ_AFTER_KEY); + result= file->index_read(record, cur_prefix, keypart_map, HA_READ_AFTER_KEY); if (result || (file->compare_key(file->end_range) <= 0)) DBUG_RETURN(result); } @@ -8215,11 +8253,13 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, byte *cur_prefix) start_key.key= (const byte*) range->min_key; start_key.length= min(range->min_length, prefix_length); + start_key.keypart_map= range->min_keypart_map & keypart_map; start_key.flag= ((range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : (range->flag & EQ_RANGE) ? HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT); end_key.key= (const byte*) range->max_key; end_key.length= min(range->max_length, prefix_length); + end_key.keypart_map= range->max_keypart_map & keypart_map; /* We use READ_AFTER_KEY here because if we are reading on a key prefix we want to find all keys with this prefix @@ -8227,8 +8267,8 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, byte *cur_prefix) end_key.flag= (range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); - result= file->read_range_first(range->min_length ? &start_key : 0, - range->max_length ? &end_key : 0, + result= file->read_range_first(range->min_keypart_map ? &start_key : 0, + range->max_keypart_map ? &end_key : 0, test(range->flag & EQ_RANGE), sorted); if (range->flag == (UNIQUE_RANGE | EQ_RANGE)) @@ -8268,9 +8308,8 @@ int QUICK_RANGE_SELECT_GEOM::get_next() } range= *(cur_range++); - result= file->index_read(record, - (byte*) range->min_key, - range->min_length, + result= file->index_read(record, (byte*) range->min_key, + range->min_keypart_map, (ha_rkey_function)(range->flag ^ GEOM_FLAG)); if (result != HA_ERR_KEY_NOT_FOUND && result != HA_ERR_END_OF_FILE) DBUG_RETURN(result); @@ -8403,13 +8442,13 @@ int QUICK_SELECT_DESC::get_next() if (range->flag & EQ_RANGE) { result = file->index_read(record, (byte*) range->max_key, - range->max_length, HA_READ_KEY_EXACT); + range->max_keypart_map, HA_READ_KEY_EXACT); } else { DBUG_ASSERT(range->flag & NEAR_MAX || range_reads_after_key(range)); result=file->index_read(record, (byte*) range->max_key, - range->max_length, + range->max_keypart_map, ((range->flag & NEAR_MAX) ? HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV)); } @@ -8728,8 +8767,7 @@ void QUICK_ROR_UNION_SELECT::add_keys_and_lengths(String *key_names, static inline uint get_field_keypart(KEY *index, Field *field); static inline SEL_ARG * get_index_range_tree(uint index, SEL_TREE* range_tree, PARAM *param, uint *param_idx); -static bool -get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree, +static bool get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree, KEY_PART_INFO *first_non_group_part, KEY_PART_INFO *min_max_arg_part, KEY_PART_INFO *last_part, THD *thd, @@ -9127,7 +9165,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) NULL; first_non_infix_part= min_max_arg_part ? (min_max_arg_part < last_part) ? - min_max_arg_part + 1 : + min_max_arg_part : NULL : NULL; if (first_non_group_part && @@ -9184,7 +9222,9 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) */ if (first_non_infix_part) { - for (cur_part= first_non_infix_part; cur_part != last_part; cur_part++) + cur_part= first_non_infix_part + + (min_max_arg_part && (min_max_arg_part < last_part)); + for (; cur_part != last_part; cur_part++) { if (bitmap_is_set(table->read_set, cur_part->field->field_index)) goto next_index; @@ -9730,7 +9770,7 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, RETURN New QUICK_GROUP_MIN_MAX_SELECT object if successfully created, - NULL o/w. + NULL otherwise. */ QUICK_SELECT_I * @@ -9743,10 +9783,10 @@ TRP_GROUP_MIN_MAX::make_quick(PARAM *param, bool retrieve_full_rows, quick= new QUICK_GROUP_MIN_MAX_SELECT(param->table, param->thd->lex->current_select->join, have_min, have_max, min_max_arg_part, - group_prefix_len, used_key_parts, - index_info, index, read_cost, records, - key_infix_len, key_infix, - parent_alloc); + group_prefix_len, group_key_parts, + used_key_parts, index_info, index, + read_cost, records, key_infix_len, + key_infix, parent_alloc); if (!quick) DBUG_RETURN(NULL); @@ -9835,7 +9875,7 @@ QUICK_GROUP_MIN_MAX_SELECT:: QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_arg, bool have_max_arg, KEY_PART_INFO *min_max_arg_part_arg, - uint group_prefix_len_arg, + uint group_prefix_len_arg, uint group_key_parts_arg, uint used_key_parts_arg, KEY *index_info_arg, uint use_index, double read_cost_arg, ha_rows records_arg, uint key_infix_len_arg, @@ -9845,7 +9885,7 @@ QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_arg, have_max(have_max_arg), seen_first_key(FALSE), min_max_arg_part(min_max_arg_part_arg), key_infix(key_infix_arg), key_infix_len(key_infix_len_arg), min_functions_it(NULL), - max_functions_it(NULL) + max_functions_it(NULL), group_key_parts(group_key_parts_arg) { head= table; file= head->file; @@ -9855,6 +9895,7 @@ QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_arg, read_time= read_cost_arg; records= records_arg; used_key_parts= used_key_parts_arg; + real_key_parts= used_key_parts_arg; real_prefix_len= group_prefix_len + key_infix_len; group_prefix= NULL; min_max_arg_len= min_max_arg_part ? min_max_arg_part->store_length : 0; @@ -10021,7 +10062,9 @@ bool QUICK_GROUP_MIN_MAX_SELECT::add_range(SEL_ARG *sel_range) range_flag|= EQ_RANGE; /* equality condition */ } range= new QUICK_RANGE(sel_range->min_value, min_max_arg_len, + make_keypart_map(sel_range->part), sel_range->max_value, min_max_arg_len, + make_keypart_map(sel_range->part), range_flag); if (!range) return TRUE; @@ -10256,7 +10299,8 @@ int QUICK_GROUP_MIN_MAX_SELECT::get_next() first sub-group with the extended prefix. */ if (!have_min && !have_max && key_infix_len > 0) - result= file->index_read(record, group_prefix, real_prefix_len, + result= file->index_read(record, group_prefix, + make_prev_keypart_map(real_key_parts), HA_READ_KEY_EXACT); result= have_min ? min_res : have_max ? max_res : result; @@ -10319,7 +10363,8 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min() /* Apply the constant equality conditions to the non-group select fields */ if (key_infix_len > 0) { - if ((result= file->index_read(record, group_prefix, real_prefix_len, + if ((result= file->index_read(record, group_prefix, + make_prev_keypart_map(real_key_parts), HA_READ_KEY_EXACT))) DBUG_RETURN(result); } @@ -10336,7 +10381,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min() /* Find the first subsequent record without NULL in the MIN/MAX field. */ key_copy(tmp_record, record, index_info, 0); result= file->index_read(record, tmp_record, - real_prefix_len + min_max_arg_len, + make_keypart_map(real_key_parts), HA_READ_AFTER_KEY); /* Check if the new record belongs to the current group by comparing its @@ -10392,7 +10437,8 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max() if (min_max_ranges.elements > 0) result= next_max_in_range(); else - result= file->index_read(record, group_prefix, real_prefix_len, + result= file->index_read(record, group_prefix, + make_prev_keypart_map(real_key_parts), HA_READ_PREFIX_LAST); DBUG_RETURN(result); } @@ -10428,7 +10474,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix() { byte *cur_prefix= seen_first_key ? group_prefix : NULL; if ((result= quick_prefix_select->get_next_prefix(group_prefix_len, - cur_prefix))) + (ULL(1) << group_key_parts) - 1, cur_prefix))) DBUG_RETURN(result); seen_first_key= TRUE; } @@ -10444,7 +10490,8 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix() else { /* Load the first key in this group into record. */ - result= file->index_read(record, group_prefix, group_prefix_len, + result= file->index_read(record, group_prefix, + make_prev_keypart_map(group_key_parts), HA_READ_AFTER_KEY); if (result) DBUG_RETURN(result); @@ -10487,6 +10534,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() { ha_rkey_function find_flag; uint search_prefix_len; + ulonglong keypart_map; QUICK_RANGE *cur_range; bool found_null= FALSE; int result= HA_ERR_KEY_NOT_FOUND; @@ -10508,8 +10556,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() if (cur_range->flag & NO_MIN_RANGE) { - find_flag= HA_READ_KEY_EXACT; search_prefix_len= real_prefix_len; + keypart_map= (ULL(1) << real_key_parts) - 1; + find_flag= HA_READ_KEY_EXACT; } else { @@ -10517,13 +10566,13 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() memcpy(group_prefix + real_prefix_len, cur_range->min_key, cur_range->min_length); search_prefix_len= real_prefix_len + min_max_arg_len; + keypart_map= (ULL(2) << real_key_parts) - 1; find_flag= (cur_range->flag & (EQ_RANGE | NULL_RANGE)) ? HA_READ_KEY_EXACT : (cur_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : HA_READ_KEY_OR_NEXT; } - result= file->index_read(record, group_prefix, search_prefix_len, - find_flag); + result= file->index_read(record, group_prefix, keypart_map, find_flag); if (result) { if ((result == HA_ERR_KEY_NOT_FOUND || result == HA_ERR_END_OF_FILE) && @@ -10621,6 +10670,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range() { ha_rkey_function find_flag; uint search_prefix_len; + ulonglong keypart_map; QUICK_RANGE *cur_range; int result; @@ -10642,8 +10692,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range() if (cur_range->flag & NO_MAX_RANGE) { - find_flag= HA_READ_PREFIX_LAST; search_prefix_len= real_prefix_len; + keypart_map= (ULL(1) << real_key_parts) - 1; + find_flag= HA_READ_PREFIX_LAST; } else { @@ -10651,13 +10702,13 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range() memcpy(group_prefix + real_prefix_len, cur_range->max_key, cur_range->max_length); search_prefix_len= real_prefix_len + min_max_arg_len; + keypart_map= (ULL(2) << real_key_parts) - 1; find_flag= (cur_range->flag & EQ_RANGE) ? HA_READ_KEY_EXACT : (cur_range->flag & NEAR_MAX) ? HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV; } - result= file->index_read(record, group_prefix, search_prefix_len, - find_flag); + result= file->index_read(record, group_prefix, keypart_map, find_flag); if (result) { diff --git a/sql/opt_range.h b/sql/opt_range.h index 525a0adcff7..40c0f0c6388 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -37,17 +37,22 @@ class QUICK_RANGE :public Sql_alloc { public: char *min_key,*max_key; uint16 min_length,max_length,flag; + ulonglong min_keypart_map, max_keypart_map; #ifdef HAVE_purify uint16 dummy; /* Avoid warnings on 'flag' */ #endif QUICK_RANGE(); /* Full range */ - QUICK_RANGE(const char *min_key_arg,uint min_length_arg, - const char *max_key_arg,uint max_length_arg, + QUICK_RANGE(const char *min_key_arg, uint min_length_arg, + ulonglong min_keypart_map_arg, + const char *max_key_arg, uint max_length_arg, + ulonglong max_keypart_map_arg, uint flag_arg) : min_key((char*) sql_memdup(min_key_arg,min_length_arg+1)), max_key((char*) sql_memdup(max_key_arg,max_length_arg+1)), min_length((uint16) min_length_arg), max_length((uint16) max_length_arg), + min_keypart_map(min_keypart_map_arg), + max_keypart_map(max_keypart_map_arg), flag((uint16) flag_arg) { #ifdef HAVE_purify @@ -318,7 +323,8 @@ public: int reset(void); int get_next(); void range_end(); - int get_next_prefix(uint prefix_length, byte *cur_prefix); + int get_next_prefix(uint prefix_length, ulonglong keypart_map, + byte *cur_prefix); bool reverse_sorted() { return 0; } bool unique_key_range(); int init_ror_merged_scan(bool reuse_handler); @@ -605,6 +611,7 @@ private: byte *tmp_record; /* Temporary storage for next_min(), next_max(). */ byte *group_prefix; /* Key prefix consisting of the GROUP fields. */ uint group_prefix_len; /* Length of the group prefix. */ + uint group_key_parts; byte *last_prefix; /* Prefix of the last group for detecting EOF. */ bool have_min; /* Specify whether we are computing */ bool have_max; /* a MIN, a MAX, or both. */ @@ -616,6 +623,7 @@ private: uint key_infix_len; DYNAMIC_ARRAY min_max_ranges; /* Array of range ptrs for the MIN/MAX field. */ uint real_prefix_len; /* Length of key prefix extended with key_infix. */ + uint real_key_parts; List *min_functions; List *max_functions; List_iterator *min_functions_it; @@ -638,10 +646,11 @@ private: public: QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join, bool have_min, bool have_max, KEY_PART_INFO *min_max_arg_part, - uint group_prefix_len, uint used_key_parts, - KEY *index_info, uint use_index, double read_cost, - ha_rows records, uint key_infix_len, - byte *key_infix, MEM_ROOT *parent_alloc); + uint group_prefix_len, uint group_key_parts, + uint used_key_parts, KEY *index_info, uint + use_index, double read_cost, ha_rows records, uint + key_infix_len, byte *key_infix, MEM_ROOT + *parent_alloc); ~QUICK_GROUP_MIN_MAX_SELECT(); bool add_range(SEL_ARG *sel_range); void update_key_stat(); diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 90a3ff66a22..9b3197d0589 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -251,7 +251,7 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) error= table->file->index_first(table->record[0]); else error= table->file->index_read(table->record[0],key_buff, - ref.key_length, + make_prev_keypart_map(ref.key_parts), range_fl & NEAR_MIN ? HA_READ_AFTER_KEY : HA_READ_KEY_OR_NEXT); @@ -338,11 +338,11 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) error= table->file->index_last(table->record[0]); else error= table->file->index_read(table->record[0], key_buff, - ref.key_length, + make_prev_keypart_map(ref.key_parts), range_fl & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV); - if (!error && reckey_in_range(1, &ref, item_field->field, + if (!error && reckey_in_range(1, &ref, item_field->field, conds, range_fl, prefix_len)) error= HA_ERR_KEY_NOT_FOUND; if (table->key_read) @@ -605,15 +605,13 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, /* Check if field is part of the tested partial key */ byte *key_ptr= ref->key_buff; KEY_PART_INFO *part; - for (part= keyinfo->key_part; - ; - key_ptr+= part++->store_length) + for (part= keyinfo->key_part; ; key_ptr+= part++->store_length) { if (part > field_part) return 0; // Field is beyond the tested parts if (part->field->eq(((Item_field*) args[0])->field)) - break; // Found a part od the key for the field + break; // Found a part of the key for the field } bool is_field_part= part == field_part; @@ -625,8 +623,11 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, { uint length= (key_ptr-ref->key_buff)+part->store_length; if (ref->key_length < length) + { /* Ultimately ref->key_length will contain the length of the search key */ ref->key_length= length; + ref->key_parts= (part - keyinfo->key_part) + 1; + } if (!*prefix_len && part+1 == field_part) *prefix_len= length; if (is_field_part && eq_type) @@ -773,6 +774,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, { ref->key= idx; ref->key_length= 0; + ref->key_parts= 0; key_part_map key_part_used= 0; *range_fl= NO_MIN_RANGE | NO_MAX_RANGE; if (matching_cond(max_fl, ref, keyinfo, part, cond, @@ -788,6 +790,8 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, */ ref->key_buff[ref->key_length]= 1; ref->key_length+= part->store_length; + ref->key_parts++; + DBUG_ASSERT(ref->key_parts == jdx+1); *range_fl&= ~NO_MIN_RANGE; *range_fl|= NEAR_MIN; // > NULL } diff --git a/sql/slave.cc b/sql/slave.cc index c21aec49e88..a0916adb8eb 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -31,6 +31,8 @@ #include "rpl_tblmap.h" int queue_event(MASTER_INFO* mi,const char* buf,ulong event_len); +static Log_event* next_event(RELAY_LOG_INFO* rli); + #define FLAGSTR(V,F) ((V)&(F)?#F" ":"") diff --git a/sql/slave.h b/sql/slave.h index 43eb71be601..bc039f6eb75 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -111,8 +111,6 @@ extern ulonglong relay_log_space_limit; #define MYSQL_SLAVE_RUN_NOT_CONNECT 1 #define MYSQL_SLAVE_RUN_CONNECT 2 -static Log_event* next_event(RELAY_LOG_INFO* rli); - #define RPL_LOG_NAME (rli->group_master_log_name[0] ? rli->group_master_log_name :\ "FIRST") #define IO_RPL_LOG_NAME (mi->master_log_name[0] ? mi->master_log_name :\ diff --git a/sql/sp.cc b/sql/sp.cc index 14703e3aa42..19195a4f043 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -218,8 +218,7 @@ db_find_routine_aux(THD *thd, int type, sp_name *name, TABLE *table) key_copy(key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, - key, table->key_info->key_length, + if (table->file->index_read_idx(table->record[0], 0, key, ~ULL(0), HA_READ_KEY_EXACT)) DBUG_RETURN(SP_KEY_NOT_FOUND); @@ -494,8 +493,6 @@ db_create_routine(THD *thd, int type, sp_head *sp) int ret; TABLE *table; char definer[USER_HOST_BUFF_SIZE]; - char old_db_buf[NAME_LEN+1]; - LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) }; DBUG_ENTER("db_create_routine"); DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length, sp->m_name.str)); @@ -906,7 +903,7 @@ sp_drop_db_routines(THD *thd, char *db) table->file->ha_index_init(0, 1); if (! table->file->index_read(table->record[0], (byte *)table->field[MYSQL_PROC_FIELD_DB]->ptr, - key_len, HA_READ_KEY_EXACT)) + (ulonglong)1, HA_READ_KEY_EXACT)) { int nxtres; bool deleted= FALSE; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 0d9653172e0..f72cf94c0ac 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1813,8 +1813,7 @@ static bool update_user_table(THD *thd, TABLE *table, table->key_info->key_length); if (table->file->index_read_idx(table->record[0], 0, - (byte *) user_key, - table->key_info->key_length, + (byte *) user_key, ~ULL(0), HA_READ_KEY_EXACT)) { my_message(ER_PASSWORD_NO_MATCH, ER(ER_PASSWORD_NO_MATCH), @@ -1905,8 +1904,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, - user_key, table->key_info->key_length, + if (table->file->index_read_idx(table->record[0], 0, user_key, ~ULL(0), HA_READ_KEY_EXACT)) { /* what == 'N' means revoke */ @@ -2123,8 +2121,7 @@ static int replace_db_table(TABLE *table, const char *db, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0],0, - user_key, table->key_info->key_length, + if (table->file->index_read_idx(table->record[0],0, user_key, ~ULL(0), HA_READ_KEY_EXACT)) { if (what == 'N') @@ -2341,9 +2338,8 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs) col_privs->field[4]->store("",0, &my_charset_latin1); col_privs->file->ha_index_init(0, 1); - if (col_privs->file->index_read(col_privs->record[0], - (byte*) key, - key_prefix_len, HA_READ_KEY_EXACT)) + if (col_privs->file->index_read(col_privs->record[0], (byte*) key, + (ulonglong)15, HA_READ_KEY_EXACT)) { cols = 0; /* purecov: deadcode */ col_privs->file->ha_index_end(); @@ -2479,7 +2475,7 @@ static int replace_column_table(GRANT_TABLE *g_t, table->field[3]->store(table_name,(uint) strlen(table_name), system_charset_info); - /* Get length of 3 first key parts */ + /* Get length of 4 first key parts */ key_prefix_length= (key_part[0].store_length + key_part[1].store_length + key_part[2].store_length + key_part[3].store_length); key_copy(key, table->record[0], table->key_info, key_prefix_length); @@ -2505,8 +2501,7 @@ static int replace_column_table(GRANT_TABLE *g_t, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read(table->record[0], user_key, - table->key_info->key_length, + if (table->file->index_read(table->record[0], user_key, ~(ulonglong)0, HA_READ_KEY_EXACT)) { if (revoke_grant) @@ -2582,8 +2577,7 @@ static int replace_column_table(GRANT_TABLE *g_t, key_copy(user_key, table->record[0], table->key_info, key_prefix_length); - if (table->file->index_read(table->record[0], user_key, - key_prefix_length, + if (table->file->index_read(table->record[0], user_key, (ulonglong)15, HA_READ_KEY_EXACT)) goto end; @@ -2684,8 +2678,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, - user_key, table->key_info->key_length, + if (table->file->index_read_idx(table->record[0], 0, user_key, ~ULL(0), HA_READ_KEY_EXACT)) { /* @@ -2808,8 +2801,8 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name, TRUE); store_record(table,record[1]); // store at pos 1 - if (table->file->index_read_idx(table->record[0],0, - (byte*) table->field[0]->ptr,0, + if (table->file->index_read_idx(table->record[0], 0, + (byte*) table->field[0]->ptr, ~ULL(0), HA_READ_KEY_EXACT)) { /* @@ -4987,7 +4980,7 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop, key_copy(user_key, table->record[0], table->key_info, key_prefix_length); if ((error= table->file->index_read_idx(table->record[0], 0, - user_key, key_prefix_length, + user_key, ULL(3), HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 91e61be0478..9c6c98cb151 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -515,7 +515,8 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, } List_iterator it_ke(*key_expr); Item *item; - for (key_len=0 ; (item=it_ke++) ; key_part++) + ulonglong keypart_map; + for (keypart_map= key_len=0 ; (item=it_ke++) ; key_part++) { my_bitmap_map *old_map; // 'item' can be changed by fix_fields() call @@ -532,6 +533,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, (void) item->save_in_field(key_part->field, 1); dbug_tmp_restore_column_map(table->write_set, old_map); key_len+=key_part->store_length; + keypart_map= (keypart_map << 1) | 1; } if (!(key= (byte*) thd->calloc(ALIGN_SIZE(key_len)))) @@ -540,7 +542,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, table->file->ha_index_init(keyno, 1); key_copy(key, table->record[0], table->key_info + keyno, key_len); error= table->file->index_read(table->record[0], - key,key_len,ha_rkey_mode); + key, keypart_map, ha_rkey_mode); mode=rkey_to_rnext[(int)ha_rkey_mode]; break; } diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 7b7f7602163..6656543e13d 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -295,8 +295,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, rkey_id->store((longlong) key_id, TRUE); rkey_id->get_key_image(buff, rkey_id->pack_length(), Field::itRAW); int key_res= relations->file->index_read(relations->record[0], - (byte *) buff, - rkey_id->pack_length(), + (byte *) buff, (ulonglong)1, HA_READ_KEY_EXACT); for ( ; @@ -310,7 +309,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, field->get_key_image(topic_id_buff, field->pack_length(), Field::itRAW); if (!topics->file->index_read(topics->record[0], (byte *)topic_id_buff, - field->pack_length(), HA_READ_KEY_EXACT)) + (ulonglong)1, HA_READ_KEY_EXACT)) { memorize_variant_topic(thd,topics,count,find_fields, names,name,description,example); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 4ad8e5ee128..08af2960631 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1165,9 +1165,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) } key_copy((byte*) key,table->record[0],table->key_info+key_nr,0); if ((error=(table->file->index_read_idx(table->record[1],key_nr, - (byte*) key, - table->key_info[key_nr]. - key_length, + (byte*) key, ~ULL(0), HA_READ_KEY_EXACT)))) goto err; } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 1d711b7835c..defbc344327 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -921,8 +921,7 @@ my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) table->use_all_columns(); table->field[0]->store(name->str, name->length, system_charset_info); if (! table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, - table->key_info[0].key_length, + (byte *)table->field[0]->ptr, ~ULL(0), HA_READ_KEY_EXACT)) { int error; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c11553e9eed..0805b0fd861 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -10854,7 +10854,8 @@ int safe_index_read(JOIN_TAB *tab) TABLE *table= tab->table; if ((error=table->file->index_read(table->record[0], tab->ref.key_buff, - tab->ref.key_length, HA_READ_KEY_EXACT))) + tab_to_keypart_map(tab), + HA_READ_KEY_EXACT))) return report_error(table, error); return 0; } @@ -10992,7 +10993,8 @@ join_read_const(JOIN_TAB *tab) { error=table->file->index_read_idx(table->record[0],tab->ref.key, (byte*) tab->ref.key_buff, - tab->ref.key_length,HA_READ_KEY_EXACT); + tab_to_keypart_map(tab), + HA_READ_KEY_EXACT); } if (error) { @@ -11035,7 +11037,8 @@ join_read_key(JOIN_TAB *tab) } error=table->file->index_read(table->record[0], tab->ref.key_buff, - tab->ref.key_length,HA_READ_KEY_EXACT); + tab_to_keypart_map(tab), + HA_READ_KEY_EXACT); if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) return report_error(table, error); } @@ -11063,7 +11066,8 @@ join_read_always_key(JOIN_TAB *tab) return -1; if ((error=table->file->index_read(table->record[0], tab->ref.key_buff, - tab->ref.key_length,HA_READ_KEY_EXACT))) + tab_to_keypart_map(tab), + HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) return report_error(table, error); @@ -11090,7 +11094,7 @@ join_read_last_key(JOIN_TAB *tab) return -1; if ((error=table->file->index_read_last(table->record[0], tab->ref.key_buff, - tab->ref.key_length))) + tab_to_keypart_map(tab)))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) return report_error(table, error); @@ -11631,7 +11635,7 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), group->buff[-1]= (char) group->field->is_null(); } if (!table->file->index_read(table->record[1], - join->tmp_table_param.group_buff,0, + join->tmp_table_param.group_buff, ~(ulonglong)0, HA_READ_KEY_EXACT)) { /* Update old record */ restore_record(table,record[1]); diff --git a/sql/sql_select.h b/sql/sql_select.h index 1d1fa666c60..4e47f5a8134 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -202,6 +202,11 @@ typedef struct st_join_table { } } JOIN_TAB; +static inline ulonglong tab_to_keypart_map(JOIN_TAB *tab) +{ + return (ULL(1) << tab->ref.key_parts) - 1; +} + enum_nested_loop_state sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool end_of_records); enum_nested_loop_state sub_select(JOIN *join,JOIN_TAB *join_tab, bool diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 0ec7c54487a..d89462e8522 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -25,6 +25,7 @@ #include "sp_head.h" #include "sp.h" +static my_bool servers_load(THD *thd, TABLE_LIST *tables); HASH servers_cache; pthread_mutex_t servers_cache_mutex; // To init the hash uint servers_cache_initialised=FALSE; @@ -356,8 +357,7 @@ my_bool server_exists_in_table(THD *thd, LEX_SERVER_OPTIONS *server_options) system_charset_info); if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, - table->key_info[0].key_length, + (byte *)table->field[0]->ptr, ~(ulonglong)0, HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) @@ -556,8 +556,7 @@ int insert_server_record(TABLE *table, FOREIGN_SERVER *server) /* read index until record is that specified in server_name */ if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, - table->key_info[0].key_length, + (byte *)table->field[0]->ptr, ~(longlong)0, HA_READ_KEY_EXACT))) { /* if not found, err */ @@ -876,8 +875,7 @@ int update_server_record(TABLE *table, FOREIGN_SERVER *server) system_charset_info); if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, - table->key_info[0].key_length, + (byte *)table->field[0]->ptr, ~(longlong)0, HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) @@ -931,8 +929,7 @@ int delete_server_record(TABLE *table, table->field[0]->store(server_name, server_name_length, system_charset_info); if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, - table->key_info[0].key_length, + (byte *)table->field[0]->ptr, ~(ulonglong)0, HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) diff --git a/sql/sql_servers.h b/sql/sql_servers.h index 36fb4d07d1b..23b8cefd5bb 100644 --- a/sql/sql_servers.h +++ b/sql/sql_servers.h @@ -26,7 +26,6 @@ typedef struct st_federated_server /* cache handlers */ my_bool servers_init(bool dont_read_server_table); -static my_bool servers_load(THD *thd, TABLE_LIST *tables); my_bool servers_reload(THD *thd); my_bool get_server_from_table_to_cache(TABLE *table); void servers_free(bool end=0); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 7dec58d9b6e..b0e7831465a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -514,8 +514,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) table->use_all_columns(); table->field[0]->store(exact_name_str, exact_name_len, &my_charset_bin); if (!table->file->index_read_idx(table->record[0], 0, - (byte*) table->field[0]->ptr, - table->key_info[0].key_length, + (byte*) table->field[0]->ptr, ~ULL(0), HA_READ_KEY_EXACT)) { int error; diff --git a/sql/table.cc b/sql/table.cc index cf2eb1705a5..894e8b82266 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1223,12 +1223,12 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if ((int) (share->next_number_index= (uint) find_ref_key(share->key_info, share->keys, share->default_values, reg_field, - &share->next_number_key_offset)) < 0) + &share->next_number_key_offset, + &share->next_number_keypart)) < 0) { /* Wrong field definition */ - DBUG_ASSERT(0); - reg_field->unireg_check= Field::NONE; /* purecov: inspected */ - share->found_next_number_field= 0; + error= 4; + goto err; } else reg_field->flags |= AUTO_INCREMENT_FLAG; @@ -2245,6 +2245,30 @@ char *get_field(MEM_ROOT *mem, Field *field) return to; } +/* + DESCRIPTION + given a buffer with a key value, and a map of keyparts + that are present in this value, returns the length of the value +*/ +uint calculate_key_len(TABLE *table, uint key, const byte *buf, + ulonglong keypart_map) +{ + /* works only with key prefixes */ + DBUG_ASSERT(((keypart_map + 1) & keypart_map) == 0); + + KEY *key_info= table->s->key_info+key; + KEY_PART_INFO *key_part= key_info->key_part; + KEY_PART_INFO *end_key_part= key_part + key_info->key_parts; + uint length= 0; + + while (key_part < end_key_part && keypart_map) + { + length+= key_part->store_length; + keypart_map >>= 1; + key_part++; + } + return length; +} /* Check if database name is valid @@ -3936,7 +3960,7 @@ void st_table::mark_auto_increment_column() */ bitmap_set_bit(read_set, found_next_number_field->field_index); bitmap_set_bit(write_set, found_next_number_field->field_index); - if (s->next_number_key_offset) + if (s->next_number_keypart) mark_columns_used_by_index_no_reset(s->next_number_index, read_set); file->column_bitmaps_signal(); } diff --git a/sql/table.h b/sql/table.h index 82083d79570..841a1f7d038 100644 --- a/sql/table.h +++ b/sql/table.h @@ -194,6 +194,7 @@ typedef struct st_table_share uint primary_key; uint next_number_index; uint next_number_key_offset; + uint next_number_keypart; uint error, open_errno, errarg; /* error from open_table_def() */ uint column_bitmap_size; uchar frm_version; diff --git a/sql/tztime.cc b/sql/tztime.cc index fe91aa71272..6704a7874a4 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1900,9 +1900,9 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) (void)table->file->ha_index_init(0, 1); if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - 0, HA_READ_KEY_EXACT)) + ~(ulonglong)0, HA_READ_KEY_EXACT)) { -#ifdef EXTRA_DEBUG +#ifdef EXTRA_DEBUG /* Most probably user has mistyped time zone name, so no need to bark here unless we need it for debugging. @@ -1928,7 +1928,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) (void)table->file->ha_index_init(0, 1); if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - 0, HA_READ_KEY_EXACT)) + ~(ulonglong)0, HA_READ_KEY_EXACT)) { sql_print_error("Can't find description of time zone '%u'", tzid); goto end; @@ -1955,9 +1955,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) table->field[0]->store((longlong) tzid, TRUE); (void)table->file->ha_index_init(0, 1); - // FIXME Is there any better approach than explicitly specifying 4 ??? res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - 4, HA_READ_KEY_EXACT); + (ulonglong)1, HA_READ_KEY_EXACT); while (!res) { ttid= (uint)table->field[1]->val_int(); @@ -2028,9 +2027,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) table->field[0]->store((longlong) tzid, TRUE); (void)table->file->ha_index_init(0, 1); - // FIXME Is there any better approach than explicitly specifying 4 ??? res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - 4, HA_READ_KEY_EXACT); + (ulonglong)1, HA_READ_KEY_EXACT); while (!res) { ttime= (my_time_t)table->field[1]->val_int(); diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc index 7bdb4e40b3d..b128ab16cc7 100644 --- a/storage/blackhole/ha_blackhole.cc +++ b/storage/blackhole/ha_blackhole.cc @@ -152,7 +152,8 @@ THR_LOCK_DATA **ha_blackhole::store_lock(THD *thd, int ha_blackhole::index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, uint key_len, + enum ha_rkey_function find_flag) { DBUG_ENTER("ha_blackhole::index_read"); DBUG_RETURN(0); @@ -160,14 +161,16 @@ int ha_blackhole::index_read(byte * buf, const byte * key, int ha_blackhole::index_read_idx(byte * buf, uint idx, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, uint key_len, + enum ha_rkey_function find_flag) { DBUG_ENTER("ha_blackhole::index_read_idx"); DBUG_RETURN(HA_ERR_END_OF_FILE); } -int ha_blackhole::index_read_last(byte * buf, const byte * key, uint key_len) +int ha_blackhole::index_read_last(byte * buf, const byte * key, + ulonglong keypart_map) { DBUG_ENTER("ha_blackhole::index_read_last"); DBUG_RETURN(HA_ERR_END_OF_FILE); diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h index 5388dcfc187..cd8b6491dba 100644 --- a/storage/blackhole/ha_blackhole.h +++ b/storage/blackhole/ha_blackhole.h @@ -64,11 +64,12 @@ public: int rnd_init(bool scan); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); - int index_read(byte * buf, const byte * key, + int index_read(byte * buf, const byte * key, ulonglong keypart_map, uint key_len, enum ha_rkey_function find_flag); int index_read_idx(byte * buf, uint idx, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_last(byte * buf, const byte * key, uint key_len); + ulonglong keypart_map, uint key_len, + enum ha_rkey_function find_flag); + int index_read_last(byte * buf, const byte * key, ulonglong keypart_map); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 12ca91f0a6f..65554eb1252 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -90,14 +90,13 @@ static handler *example_create_handler(handlerton *hton, TABLE_SHARE *table, MEM_ROOT *mem_root); -static int example_init_func(); +static int example_init_func(void *); handlerton *example_hton; /* Variables for example share methods */ static HASH example_open_tables; ///< Hash used to track the number of open tables; variable for example share methods pthread_mutex_t example_mutex; ///< This is the mutex used to init the hash; variable for example share methods -static int example_init= 0; ///< This variable is used to check the init state of hash; variable for example share methods /** @brief Function we use in the creation of our hash to get key. @@ -372,7 +371,7 @@ int ha_example::delete_row(const byte * buf) index. */ int ha_example::index_read(byte * buf, const byte * key, - uint key_len __attribute__((unused)), + ulonglong keypart_map __attribute__((unused)), enum ha_rkey_function find_flag __attribute__((unused))) { diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index 9b912514887..ee60b412974 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -191,7 +191,7 @@ public: skip it and and MySQL will treat it as not implemented. */ int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag); + ulonglong keypart_map, enum ha_rkey_function find_flag); /** @brief We implement this in ha_example.cc. It's not an obligatory method; diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 9290418c7aa..cb599715b9d 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -362,7 +362,7 @@ static handler *federated_create_handler(handlerton *hton, MEM_ROOT *mem_root); static int federated_commit(handlerton *hton, THD *thd, bool all); static int federated_rollback(handlerton *hton, THD *thd, bool all); -static int federated_db_init(void); +static int federated_db_init(void *); /* Federated storage engine handlerton */ @@ -573,9 +573,6 @@ int get_connection(FEDERATED_SHARE *share) int error_num= ER_FOREIGN_SERVER_DOESNT_EXIST; char error_buffer[FEDERATED_QUERY_BUFFER_SIZE]; FOREIGN_SERVER *server; - MYSQL *mysql_conn= 0; - MYSQL_RES *result= 0; - MYSQL_ROW row= 0; DBUG_ENTER("ha_federated::get_connection"); if (!(server= diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 7a2f8e20c56..c0ca0af3923 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -238,34 +238,35 @@ int ha_heap::delete_row(const byte * buf) return res; } -int ha_heap::index_read(byte * buf, const byte * key, uint key_len, +int ha_heap::index_read(byte * buf, const byte * key, ulonglong keypart_map, enum ha_rkey_function find_flag) { DBUG_ASSERT(inited==INDEX); statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error = heap_rkey(file,buf,active_index, key, key_len, find_flag); + int error = heap_rkey(file,buf,active_index, key, keypart_map, find_flag); table->status = error ? STATUS_NOT_FOUND : 0; return error; } -int ha_heap::index_read_last(byte *buf, const byte *key, uint key_len) +int ha_heap::index_read_last(byte *buf, const byte *key, ulonglong keypart_map) { DBUG_ASSERT(inited==INDEX); statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error= heap_rkey(file, buf, active_index, key, key_len, + int error= heap_rkey(file, buf, active_index, key, keypart_map, HA_READ_PREFIX_LAST); table->status= error ? STATUS_NOT_FOUND : 0; return error; } int ha_heap::index_read_idx(byte * buf, uint index, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, + enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error = heap_rkey(file, buf, index, key, key_len, find_flag); + int error = heap_rkey(file, buf, index, key, keypart_map, find_flag); table->status = error ? STATUS_NOT_FOUND : 0; return error; } diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index 2de80c76999..b49ded6e33d 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -75,11 +75,11 @@ public: ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values); - int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_idx(byte * buf, uint idx, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_last(byte * buf, const byte * key, uint key_len); + int index_read(byte * buf, const byte * key, ulonglong keypart_map, + enum ha_rkey_function find_flag); + int index_read_last(byte *buf, const byte *key, ulonglong keypart_map); + int index_read_idx(byte * buf, uint index, const byte * key, + ulonglong keypart_map, enum ha_rkey_function find_flag); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h index 016c83db8e0..d9c3ff147b4 100644 --- a/storage/heap/heapdef.h +++ b/storage/heap/heapdef.h @@ -100,7 +100,7 @@ extern int hp_close(register HP_INFO *info); extern void hp_clear(HP_SHARE *info); extern void hp_clear_keys(HP_SHARE *info); extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, - uint k_len); + ulonglong keypart_map); #ifdef THREAD extern pthread_mutex_t THR_LOCK_heap; #else diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c index c5a30a3ef65..326f6adea45 100644 --- a/storage/heap/hp_hash.c +++ b/storage/heap/hp_hash.c @@ -784,30 +784,26 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key, uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, - uint k_len) + ulonglong keypart_map) { HA_KEYSEG *seg, *endseg; uchar *start_key= key; for (seg= keydef->seg, endseg= seg + keydef->keysegs; - seg < endseg && (int) k_len > 0; old+= seg->length, seg++) + seg < endseg && keypart_map; old+= seg->length, seg++) { uint char_length; + keypart_map>>= 1; if (seg->null_bit) { - k_len--; if (!(*key++= (char) 1 - *old++)) - { - k_len-= seg->length; continue; } - } if (seg->flag & HA_SWAP_KEY) { uint length= seg->length; byte *pos= (byte*) old + length; - k_len-= length; while (length--) { *key++= *--pos; @@ -822,7 +818,6 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, CHARSET_INFO *cs= seg->charset; char_length= length/cs->mbmaxlen; - k_len-= 2+length; old+= 2; set_if_smaller(length,tmp_length); /* Safety */ FIX_LENGTH(cs, old, length, char_length); @@ -843,7 +838,6 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, } memcpy(key, old, (size_t) char_length); key+= seg->length; - k_len-= seg->length; } return (uint) (key - start_key); } diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c index a095336d295..98714bf875f 100644 --- a/storage/heap/hp_rkey.c +++ b/storage/heap/hp_rkey.c @@ -16,7 +16,7 @@ #include "heapdef.h" int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, enum ha_rkey_function find_flag) { byte *pos; HP_SHARE *share= info->s; @@ -38,7 +38,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, custom_arg.keyseg= info->s->keydef[inx].seg; custom_arg.key_length= info->lastkey_len= hp_rb_pack_key(keyinfo, (uchar*) info->lastkey, - (uchar*) key, key_len); + (uchar*) key, keypart_map); custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME; /* for next rkey() after deletion */ if (find_flag == HA_READ_AFTER_KEY) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b5b354d4b39..bebd0422a24 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3920,14 +3920,14 @@ statement issued by the user. We also increment trx->n_mysql_tables_in_use. 2) If prebuilt->sql_stat_start == TRUE we 'pre-compile' the MySQL search instructions to prebuilt->template of the table handle instance in -::index_read. The template is used to save CPU time in large joins. +::index_read_old. The template is used to save CPU time in large joins. 3) In row_search_for_mysql, if prebuilt->sql_stat_start is true, we allocate a new consistent read view for the trx if it does not yet have one, or in the case of a locking read, set an InnoDB 'intention' table level lock on the table. - 4) We do the SELECT. MySQL may repeatedly call ::index_read for the + 4) We do the SELECT. MySQL may repeatedly call ::index_read_old for the same table handle instance, if it is a join. 5) When the SELECT ends, MySQL removes its intention table level locks @@ -3941,7 +3941,7 @@ table handler in that case has to execute the COMMIT in ::external_lock. B) If the user has explicitly set MySQL table level locks, then MySQL does NOT call ::external_lock at the start of the statement. To determine when we are at the start of a new SQL statement we at the start of -::index_read also compare the query id to the latest query id where the +::index_read_old also compare the query id to the latest query id where the table handle instance was used. If it has changed, we know we are at the start of a new SQL statement. Since the query id can theoretically overwrap, we use this test only as a secondary way of determining the @@ -3978,7 +3978,7 @@ ha_innobase::index_read( int error; ulint ret; - DBUG_ENTER("index_read"); + DBUG_ENTER("index_read_old"); ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[ht->slot]); @@ -4060,7 +4060,7 @@ ha_innobase::index_read( } /*********************************************************************** -The following functions works like index_read, but it find the last +The following functions works like index_read_old, but it find the last row with the current key value or prefix. */ int @@ -4166,7 +4166,7 @@ ha_innobase::index_read_idx( /*************************************************************************** Reads the next or previous row from a cursor, which must have previously been -positioned using index_read. */ +positioned using index_read_old. */ int ha_innobase::general_fetch( @@ -4215,7 +4215,7 @@ ha_innobase::general_fetch( /*************************************************************************** Reads the next row from a cursor, which must have previously been -positioned using index_read. */ +positioned using index_read_old. */ int ha_innobase::index_next( @@ -4251,7 +4251,7 @@ ha_innobase::index_next_same( /*************************************************************************** Reads the previous row from a cursor, which must have previously been -positioned using index_read. */ +positioned using index_read_old. */ int ha_innobase::index_prev( diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 397856a4a4e..83180872f5f 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1203,34 +1203,37 @@ int ha_myisam::delete_row(const byte * buf) return mi_delete(file,buf); } -int ha_myisam::index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag) +int ha_myisam::index_read(byte *buf, const byte *key, ulonglong keypart_map, + enum ha_rkey_function find_flag) { DBUG_ASSERT(inited==INDEX); statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error=mi_rkey(file,buf,active_index, key, key_len, find_flag); + int error=mi_rkey(file, buf, active_index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; return error; } -int ha_myisam::index_read_idx(byte * buf, uint index, const byte * key, - uint key_len, enum ha_rkey_function find_flag) +int ha_myisam::index_read_idx(byte *buf, uint index, const byte *key, + ulonglong keypart_map, + enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error=mi_rkey(file,buf,index, key, key_len, find_flag); + int error=mi_rkey(file, buf, index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; return error; } -int ha_myisam::index_read_last(byte * buf, const byte * key, uint key_len) +int ha_myisam::index_read_last(byte *buf, const byte *key, + ulonglong keypart_map) { DBUG_ENTER("ha_myisam::index_read_last"); DBUG_ASSERT(inited==INDEX); statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error=mi_rkey(file,buf,active_index, key, key_len, HA_READ_PREFIX_LAST); + int error=mi_rkey(file, buf, active_index, key, keypart_map, + HA_READ_PREFIX_LAST); table->status=error ? STATUS_NOT_FOUND: 0; DBUG_RETURN(error); } @@ -1338,7 +1341,7 @@ int ha_myisam::info(uint flag) stats.index_file_length=info.index_file_length; stats.delete_length = info.delete_length; stats.check_time = info.check_time; - stats. mean_rec_length=info.mean_reclength; + stats.mean_rec_length=info.mean_reclength; } if (flag & HA_STATUS_CONST) { @@ -1698,8 +1701,9 @@ void ha_myisam::get_auto_increment(ulonglong offset, ulonglong increment, key_copy(key, table->record[0], table->key_info + table->s->next_number_index, table->s->next_number_key_offset); - error= mi_rkey(file,table->record[1],(int) table->s->next_number_index, - key,table->s->next_number_key_offset,HA_READ_PREFIX_LAST); + error= mi_rkey(file, table->record[1], (int) table->s->next_number_index, + key, make_prev_keypart_map(table->s->next_number_keypart), + HA_READ_PREFIX_LAST); if (error) nr= 1; else diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 882900bd35f..b66a9e5cca4 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -69,11 +69,11 @@ class ha_myisam: public handler int write_row(byte * buf); int update_row(const byte * old_data, byte * new_data); int delete_row(const byte * buf); - int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_idx(byte * buf, uint idx, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_last(byte * buf, const byte * key, uint key_len); + int index_read(byte *buf, const byte *key, ulonglong keypart_map, + enum ha_rkey_function find_flag); + int index_read_idx(byte *buf, uint index, const byte *key, + ulonglong keypart_map, enum ha_rkey_function find_flag); + int index_read_last(byte *buf, const byte *key, ulonglong keypart_map); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 7bcb8041fe0..5c67404559e 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -532,7 +532,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) mi_extra(info,HA_EXTRA_KEYREAD,0); bzero(info->lastkey,keyinfo->seg->length); if (!mi_rkey(info, info->rec_buff, key, (const byte*) info->lastkey, - keyinfo->seg->length, HA_READ_KEY_EXACT)) + ULL(1), HA_READ_KEY_EXACT)) { /* Don't count this as a real warning, as myisamchk can't correct it */ uint save=param->warning_printed; diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index b203286d544..1b7ba676139 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -206,7 +206,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, uint keynr key number key Store packed key here old Not packed key - k_length Length of 'old' to use + keypart_map bitmap of used keyparts last_used_keyseg out parameter. May be NULL RETURN @@ -216,34 +216,36 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, */ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, - uint k_length, HA_KEYSEG **last_used_keyseg) + ulonglong keypart_map, HA_KEYSEG **last_used_keyseg) { uchar *start_key=key; HA_KEYSEG *keyseg; my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; DBUG_ENTER("_mi_pack_key"); - for (keyseg=info->s->keyinfo[keynr].seg ; - keyseg->type && (int) k_length > 0; - old+=keyseg->length, keyseg++) + /* "one part" rtree key is 2*SPDIMS part key in MyISAM */ + if (info->s->keyinfo[keynr].key_alg == HA_KEY_ALG_RTREE) + keypart_map= (ULL(1) << (2*SPDIMS)) - 1; + + /* only key prefixes are supported */ + DBUG_ASSERT(((keypart_map+1) & keypart_map) == 0); + + for (keyseg= info->s->keyinfo[keynr].seg ; keyseg->type && keypart_map; + old+= keyseg->length, keyseg++) { - enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; - uint length=min((uint) keyseg->length,(uint) k_length); + enum ha_base_keytype type= (enum ha_base_keytype) keyseg->type; + uint length= keyseg->length; uint char_length; uchar *pos; CHARSET_INFO *cs=keyseg->charset; + keypart_map>>= 1; if (keyseg->null_bit) { - k_length--; if (!(*key++= (char) 1-*old++)) /* Copy null marker */ { - k_length-=length; if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) - { - k_length-=2; /* Skip length */ old+= 2; - } continue; /* Found NULL */ } } @@ -262,7 +264,6 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, while (pos < end && pos[0] == ' ') pos++; } - k_length-=length; length=(uint) (end-pos); FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); @@ -274,7 +275,6 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, { /* Length of key-part used with mi_rkey() always 2 */ uint tmp_length=uint2korr(pos); - k_length-= 2+length; pos+=2; set_if_smaller(length,tmp_length); /* Safety */ FIX_LENGTH(cs, pos, length, char_length); @@ -287,11 +287,8 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, else if (keyseg->flag & HA_SWAP_KEY) { /* Numerical column */ pos+=length; - k_length-=length; while (length--) - { *key++ = *--pos; - } continue; } FIX_LENGTH(cs, pos, length, char_length); @@ -299,30 +296,10 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, if (length > char_length) cs->cset->fill(cs, (char*) key+char_length, length-char_length, ' '); key+= length; - k_length-=length; } if (last_used_keyseg) *last_used_keyseg= keyseg; -#ifdef NOT_USED - if (keyseg->type) - { - /* Part-key ; fill with ASCII 0 for easier searching */ - length= (uint) -k_length; /* unused part of last key */ - do - { - if (keyseg->flag & HA_NULL_PART) - length++; - if (keyseg->flag & HA_SPACE_PACK) - length+=2; - else - length+= keyseg->length; - keyseg++; - } while (keyseg->type); - bzero((byte*) key,length); - key+=length; - } -#endif DBUG_RETURN((uint) (key-start_key)); } /* _mi_pack_key */ diff --git a/storage/myisam/mi_range.c b/storage/myisam/mi_range.c index 6655f5a7de6..5e5fe3c6b22 100644 --- a/storage/myisam/mi_range.c +++ b/storage/myisam/mi_range.c @@ -21,13 +21,10 @@ #include "myisamdef.h" #include "rt_index.h" -static ha_rows _mi_record_pos(MI_INFO *info,const byte *key,uint key_len, - enum ha_rkey_function search_flag); -static double _mi_search_pos(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key, - uint key_len,uint nextflag,my_off_t pos); -static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, - uchar *keypos,uint *ret_max_key); - +static ha_rows _mi_record_pos(MI_INFO *, const byte *, ulonglong, + enum ha_rkey_function); +static double _mi_search_pos(MI_INFO *,MI_KEYDEF *,uchar *, uint,uint,my_off_t); +static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *,uchar *, uchar *,uint *); /* Estimate how many records there is in a given range @@ -47,9 +44,8 @@ static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, number Estimated number of rows */ - -ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, - key_range *max_key) +ha_rows mi_records_in_range(MI_INFO *info, int inx, + key_range *min_key, key_range *max_key) { ha_rows start_pos,end_pos,res; DBUG_ENTER("mi_records_in_range"); @@ -87,7 +83,7 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, } key_buff= info->lastkey+info->s->base.max_key_length; start_key_len= _mi_pack_key(info,inx, key_buff, - (uchar*) min_key->key, min_key->length, + (uchar*) min_key->key, min_key->keypart_map, (HA_KEYSEG**) 0); res= rtree_estimate(info, inx, key_buff, start_key_len, myisam_read_vec[min_key->flag]); @@ -97,14 +93,12 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, #endif case HA_KEY_ALG_BTREE: default: - start_pos= (min_key ? - _mi_record_pos(info, min_key->key, min_key->length, - min_key->flag) : - (ha_rows) 0); - end_pos= (max_key ? - _mi_record_pos(info, max_key->key, max_key->length, - max_key->flag) : - info->state->records+ (ha_rows) 1); + start_pos= (min_key ? _mi_record_pos(info, min_key->key, + min_key->keypart_map, min_key->flag) + : (ha_rows) 0); + end_pos= (max_key ? _mi_record_pos(info, max_key->key, + max_key->keypart_map, max_key->flag) + : info->state->records + (ha_rows) 1); res= (end_pos < start_pos ? (ha_rows) 0 : (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos)); if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR) @@ -122,21 +116,21 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, /* Find relative position (in records) for key in index-tree */ -static ha_rows _mi_record_pos(MI_INFO *info, const byte *key, uint key_len, +static ha_rows _mi_record_pos(MI_INFO *info, const byte *key, + ulonglong keypart_map, enum ha_rkey_function search_flag) { - uint inx=(uint) info->lastinx, nextflag; + uint inx=(uint) info->lastinx, nextflag, key_len; MI_KEYDEF *keyinfo=info->s->keyinfo+inx; uchar *key_buff; double pos; DBUG_ENTER("_mi_record_pos"); DBUG_PRINT("enter",("search_flag: %d",search_flag)); + DBUG_ASSERT(keypart_map); - if (key_len == 0) - key_len=USE_WHOLE_KEY; key_buff=info->lastkey+info->s->base.max_key_length; - key_len=_mi_pack_key(info,inx,key_buff,(uchar*) key,key_len, + key_len=_mi_pack_key(info,inx,key_buff,(uchar*) key, keypart_map, (HA_KEYSEG**) 0); DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg, (uchar*) key_buff,key_len);); diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c index 6323c95ffd7..027d3d8dea0 100644 --- a/storage/myisam/mi_rkey.c +++ b/storage/myisam/mi_rkey.c @@ -21,8 +21,8 @@ /* Read a record using key */ /* Ordinary search_flag is 0 ; Give error if no record with key */ -int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, - enum ha_rkey_function search_flag) +int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, + ulonglong keypart_map, enum ha_rkey_function search_flag) { uchar *key_buff; MYISAM_SHARE *share=info->s; @@ -30,8 +30,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, HA_KEYSEG *last_used_keyseg; uint pack_key_length, use_key_length, nextflag; DBUG_ENTER("mi_rkey"); - DBUG_PRINT("enter", ("base: %lx buf: %lx inx: %d search_flag: %d", - (long) info, (long) buf, inx, search_flag)); + DBUG_PRINT("enter", ("base: %lx buf: %lx inx: %d keyparts %lx search_flag: %d", + (long) info, (long) buf, inx, keypart_map, search_flag)); if ((inx = _mi_check_index(info,inx)) < 0) DBUG_RETURN(my_errno); @@ -47,18 +47,17 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, key is already packed!; This happens when we are using a MERGE TABLE */ key_buff=info->lastkey+info->s->base.max_key_length; - pack_key_length= key_len; - bmove(key_buff,key,key_len); + pack_key_length= keypart_map; + bmove(key_buff, key, pack_key_length); last_used_keyseg= 0; } else { - if (key_len == 0) - key_len=USE_WHOLE_KEY; + DBUG_ASSERT(keypart_map); /* Save the packed key for later use in the second buffer of lastkey. */ key_buff=info->lastkey+info->s->base.max_key_length; pack_key_length=_mi_pack_key(info,(uint) inx, key_buff, (uchar*) key, - key_len, &last_used_keyseg); + keypart_map, &last_used_keyseg); /* Save packed_key_length for use by the MERGE engine. */ info->pack_key_length= pack_key_length; DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index dceccd10ae2..f1ca1754696 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -604,8 +604,9 @@ extern int _mi_dispose(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos, extern my_off_t _mi_new(MI_INFO *info,MI_KEYDEF *keyinfo,int level); extern uint _mi_make_key(MI_INFO *info,uint keynr,uchar *key, const byte *record,my_off_t filepos); -extern uint _mi_pack_key(MI_INFO *info,uint keynr,uchar *key,uchar *old, - uint key_length, HA_KEYSEG **last_used_keyseg); +extern uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, + uchar *old, ulonglong keypart_map, + HA_KEYSEG **last_used_keyseg); extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,byte *buf); extern int _mi_read_cache(IO_CACHE *info,byte *buff,my_off_t pos, uint length,int re_read_if_possibly); diff --git a/storage/myisam/rt_test.c b/storage/myisam/rt_test.c index 1126266d2f9..55b52c0c3bf 100644 --- a/storage/myisam/rt_test.c +++ b/storage/myisam/rt_test.c @@ -323,7 +323,7 @@ static int run_test(const char *filename) range.key= record+1; range.length= 1000; /* Big enough */ range.flag= HA_READ_MBR_INTERSECT; - hrows= mi_records_in_range(file,0, &range, (key_range*) 0); + hrows= mi_records_in_range(file, 0, &range, (key_range*) 0); printf(" %ld rows\n", (long) hrows); if (mi_close(file)) goto err; diff --git a/storage/myisam/sp_test.c b/storage/myisam/sp_test.c index c7226589811..96ba05e8a74 100644 --- a/storage/myisam/sp_test.c +++ b/storage/myisam/sp_test.c @@ -255,7 +255,7 @@ int run_test(const char *filename) max_range.key= record+1; max_range.length= 1000; /* Big enough */ max_range.flag= HA_READ_KEY_EXACT; - hrows= mi_records_in_range(file,0, &min_range, &max_range); + hrows= mi_records_in_range(file, 0, &min_range, &max_range); printf(" %ld rows\n", (long) hrows); if (mi_close(file)) goto err; diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 7df81a4802f..9ed24f35aba 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -145,30 +145,33 @@ int ha_myisammrg::delete_row(const byte * buf) } int ha_myisammrg::index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, + enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error=myrg_rkey(file,buf,active_index, key, key_len, find_flag); + int error=myrg_rkey(file,buf,active_index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; return error; } int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key, - uint key_len, enum ha_rkey_function find_flag) + ulonglong keypart_map, + enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error=myrg_rkey(file,buf,index, key, key_len, find_flag); + int error=myrg_rkey(file,buf,index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; return error; } -int ha_myisammrg::index_read_last(byte * buf, const byte * key, uint key_len) +int ha_myisammrg::index_read_last(byte * buf, const byte * key, + ulonglong keypart_map) { statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); - int error=myrg_rkey(file,buf,active_index, key, key_len, + int error=myrg_rkey(file,buf,active_index, key, keypart_map, HA_READ_PREFIX_LAST); table->status=error ? STATUS_NOT_FOUND: 0; return error; diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index ffa55673ad1..ee2a46e3d00 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -56,11 +56,11 @@ class ha_myisammrg: public handler int write_row(byte * buf); int update_row(const byte * old_data, byte * new_data); int delete_row(const byte * buf); - int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_idx(byte * buf, uint idx, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_last(byte * buf, const byte * key, uint key_len); + int index_read(byte * buf, const byte * key, ulonglong keypart_map, + enum ha_rkey_function find_flag); + int index_read_idx(byte * buf, uint index, const byte * key, + ulonglong keypart_map, enum ha_rkey_function find_flag); + int index_read_last(byte * buf, const byte * key, ulonglong keypart_map); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/myisammrg/myrg_rkey.c b/storage/myisammrg/myrg_rkey.c index f7b7f082019..2273f7d62b8 100644 --- a/storage/myisammrg/myrg_rkey.c +++ b/storage/myisammrg/myrg_rkey.c @@ -36,7 +36,7 @@ */ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, - uint key_len, enum ha_rkey_function search_flag) + ulonglong keypart_map, enum ha_rkey_function search_flag) { byte *key_buff; uint pack_key_length; @@ -56,7 +56,7 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, if (table == info->open_tables) { - err=mi_rkey(mi,0,inx,key,key_len,search_flag); + err=mi_rkey(mi, 0, inx, key, keypart_map, search_flag); /* Get the saved packed key and packed key length. */ key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length; pack_key_length=mi->pack_key_length; @@ -64,7 +64,7 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, else { mi->once_flags|= USE_PACKED_KEYS; - err=mi_rkey(mi,0,inx,key_buff,pack_key_length,search_flag); + err=mi_rkey(mi, 0, inx, key_buff, pack_key_length, search_flag); } info->last_used_table=table+1; From f106321eae6cc1529ad6c3bc25286ff7b1a8014b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Jan 2007 15:17:40 +0000 Subject: [PATCH 012/789] Bug#23354 Add explaination when ndb_mgm do restart ndb/src/mgmclient/CommandInterpreter.cpp: Add printout to indicate the usage of "-n" --- ndb/src/mgmclient/CommandInterpreter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 420dbd121a1..d6952f0b0eb 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -2029,6 +2029,9 @@ CommandInterpreter::executeRestart(Vector &command_list, return -1; } + if (!nostart) + ndbout_c("Shutting down nodes with \"-n, no start\" option, to subsequently start the nodes."); + result= ndb_mgm_restart3(m_mgmsrv, no_of_nodes, node_ids, initialstart, nostart, abort, &need_disconnect); From 46b52ddaf19f6bb36df0d2e83d067d584c0dc410 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Jan 2007 18:07:02 +0100 Subject: [PATCH 013/789] making diff-p-helper obsolete --- BitKeeper/triggers/post-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index 86f3db012ee..b4dcb311dde 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -72,7 +72,7 @@ X-CSetKey: <$CSETKEY> $BH EOF bk changes -v -r+ - bk cset -r+ -d + bk rset -r+ -ah | bk gnupatch -h -dup -T ) > $BKROOT/BitKeeper/tmp/dev_public.txt $SENDMAIL -t < $BKROOT/BitKeeper/tmp/dev_public.txt From 7f028f6b03dc9bb01a2a631dfb1def842be35b30 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Jan 2007 22:48:05 +0100 Subject: [PATCH 014/789] Mechanical class renaming: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary and also THD::protocol_simple->THD::protocol_text, THD::protocol_prep->THD::protocol_binary. Reason: the binary protocol is not bound to be used only with prepared statements long term (see WL#3559 "Decouple binary protocol from prepared statements"). Renaming now is pressing because the fix for BUG#735 "Prepared Statements: there is no support for Query Cache" will introduce a new member in class Query_cache_flags telling about the protocol's nature. Other reason: "simple" is less accurate than "text". Future patches for BUG#735 will rely on this cset. libmysqld/lib_sql.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/protocol.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/protocol.h: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/set_var.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/sql_class.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/sql_class.h: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary sql/sql_prepare.cc: Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary --- libmysqld/lib_sql.cc | 12 ++++---- sql/protocol.cc | 68 ++++++++++++++++++++++---------------------- sql/protocol.h | 12 ++++---- sql/set_var.cc | 4 +-- sql/sql_class.cc | 6 ++-- sql/sql_class.h | 4 +-- sql/sql_prepare.cc | 32 ++++++++++----------- 7 files changed, 69 insertions(+), 69 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 2853baf2dfe..1d40d433488 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -825,7 +825,7 @@ int Protocol::begin_dataset() remove last row of current recordset SYNOPSIS - Protocol_simple::remove_last_row() + Protocol_text::remove_last_row() NOTES does the loop from the beginning of the current recordset to @@ -833,12 +833,12 @@ int Protocol::begin_dataset() Not supposed to be frequently called. */ -void Protocol_simple::remove_last_row() +void Protocol_text::remove_last_row() { MYSQL_DATA *data= thd->cur_data; MYSQL_ROWS **last_row_hook= &data->data; uint count= data->rows; - DBUG_ENTER("Protocol_simple::remove_last_row"); + DBUG_ENTER("Protocol_text::remove_last_row"); while (--count) last_row_hook= &(*last_row_hook)->next; @@ -967,7 +967,7 @@ bool Protocol::write() return false; } -bool Protocol_prep::write() +bool Protocol_binary::write() { MYSQL_ROWS *cur; MYSQL_DATA *data= thd->cur_data; @@ -1034,7 +1034,7 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err) } -void Protocol_simple::prepare_for_resend() +void Protocol_text::prepare_for_resend() { MYSQL_ROWS *cur; MYSQL_DATA *data= thd->cur_data; @@ -1058,7 +1058,7 @@ void Protocol_simple::prepare_for_resend() DBUG_VOID_RETURN; } -bool Protocol_simple::store_null() +bool Protocol_text::store_null() { *(next_field++)= NULL; ++next_mysql_field; diff --git a/sql/protocol.cc b/sql/protocol.cc index da46405dea2..9d313680582 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -33,7 +33,7 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err); #ifndef EMBEDDED_LIBRARY bool Protocol::net_store_data(const char *from, uint length) #else -bool Protocol_prep::net_store_data(const char *from, uint length) +bool Protocol_binary::net_store_data(const char *from, uint length) #endif { ulong packet_length=packet->length(); @@ -555,7 +555,7 @@ bool Protocol::send_fields(List *list, uint flags) Item *item; char buff[80]; String tmp((char*) buff,sizeof(buff),&my_charset_bin); - Protocol_simple prot(thd); + Protocol_text prot(thd); String *local_packet= prot.storage_packet(); CHARSET_INFO *thd_charset= thd->variables.character_set_results; DBUG_ENTER("send_fields"); @@ -758,7 +758,7 @@ bool Protocol::store(I_List* str_list) ****************************************************************************/ #ifndef EMBEDDED_LIBRARY -void Protocol_simple::prepare_for_resend() +void Protocol_text::prepare_for_resend() { packet->length(0); #ifndef DBUG_OFF @@ -766,7 +766,7 @@ void Protocol_simple::prepare_for_resend() #endif } -bool Protocol_simple::store_null() +bool Protocol_text::store_null() { #ifndef DBUG_OFF field_pos++; @@ -799,7 +799,7 @@ bool Protocol::store_string_aux(const char *from, uint length, } -bool Protocol_simple::store(const char *from, uint length, +bool Protocol_text::store(const char *from, uint length, CHARSET_INFO *fromcs, CHARSET_INFO *tocs) { #ifndef DBUG_OFF @@ -815,7 +815,7 @@ bool Protocol_simple::store(const char *from, uint length, } -bool Protocol_simple::store(const char *from, uint length, +bool Protocol_text::store(const char *from, uint length, CHARSET_INFO *fromcs) { CHARSET_INFO *tocs= this->thd->variables.character_set_results; @@ -832,7 +832,7 @@ bool Protocol_simple::store(const char *from, uint length, } -bool Protocol_simple::store_tiny(longlong from) +bool Protocol_text::store_tiny(longlong from) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_TINY); @@ -844,7 +844,7 @@ bool Protocol_simple::store_tiny(longlong from) } -bool Protocol_simple::store_short(longlong from) +bool Protocol_text::store_short(longlong from) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -858,7 +858,7 @@ bool Protocol_simple::store_short(longlong from) } -bool Protocol_simple::store_long(longlong from) +bool Protocol_text::store_long(longlong from) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -872,7 +872,7 @@ bool Protocol_simple::store_long(longlong from) } -bool Protocol_simple::store_longlong(longlong from, bool unsigned_flag) +bool Protocol_text::store_longlong(longlong from, bool unsigned_flag) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -887,7 +887,7 @@ bool Protocol_simple::store_longlong(longlong from, bool unsigned_flag) } -bool Protocol_simple::store_decimal(const my_decimal *d) +bool Protocol_text::store_decimal(const my_decimal *d) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -901,7 +901,7 @@ bool Protocol_simple::store_decimal(const my_decimal *d) } -bool Protocol_simple::store(float from, uint32 decimals, String *buffer) +bool Protocol_text::store(float from, uint32 decimals, String *buffer) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -913,7 +913,7 @@ bool Protocol_simple::store(float from, uint32 decimals, String *buffer) } -bool Protocol_simple::store(double from, uint32 decimals, String *buffer) +bool Protocol_text::store(double from, uint32 decimals, String *buffer) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -925,7 +925,7 @@ bool Protocol_simple::store(double from, uint32 decimals, String *buffer) } -bool Protocol_simple::store(Field *field) +bool Protocol_text::store(Field *field) { if (field->is_null()) return store_null(); @@ -959,7 +959,7 @@ bool Protocol_simple::store(Field *field) */ -bool Protocol_simple::store(TIME *tm) +bool Protocol_text::store(TIME *tm) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -982,7 +982,7 @@ bool Protocol_simple::store(TIME *tm) } -bool Protocol_simple::store_date(TIME *tm) +bool Protocol_text::store_date(TIME *tm) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -1001,7 +1001,7 @@ bool Protocol_simple::store_date(TIME *tm) we support 0-6 decimals for time. */ -bool Protocol_simple::store_time(TIME *tm) +bool Protocol_text::store_time(TIME *tm) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -1041,7 +1041,7 @@ bool Protocol_simple::store_time(TIME *tm) [..]..[[length]data] data ****************************************************************************/ -bool Protocol_prep::prepare_for_send(List *item_list) +bool Protocol_binary::prepare_for_send(List *item_list) { Protocol::prepare_for_send(item_list); bit_fields= (field_count+9)/8; @@ -1052,7 +1052,7 @@ bool Protocol_prep::prepare_for_send(List *item_list) } -void Protocol_prep::prepare_for_resend() +void Protocol_binary::prepare_for_resend() { packet->length(bit_fields+1); bzero((char*) packet->ptr(), 1+bit_fields); @@ -1060,21 +1060,21 @@ void Protocol_prep::prepare_for_resend() } -bool Protocol_prep::store(const char *from, uint length, CHARSET_INFO *fromcs) +bool Protocol_binary::store(const char *from, uint length, CHARSET_INFO *fromcs) { CHARSET_INFO *tocs= thd->variables.character_set_results; field_pos++; return store_string_aux(from, length, fromcs, tocs); } -bool Protocol_prep::store(const char *from,uint length, +bool Protocol_binary::store(const char *from,uint length, CHARSET_INFO *fromcs, CHARSET_INFO *tocs) { field_pos++; return store_string_aux(from, length, fromcs, tocs); } -bool Protocol_prep::store_null() +bool Protocol_binary::store_null() { uint offset= (field_pos+2)/8+1, bit= (1 << ((field_pos+2) & 7)); /* Room for this as it's allocated in prepare_for_send */ @@ -1085,7 +1085,7 @@ bool Protocol_prep::store_null() } -bool Protocol_prep::store_tiny(longlong from) +bool Protocol_binary::store_tiny(longlong from) { char buff[1]; field_pos++; @@ -1094,7 +1094,7 @@ bool Protocol_prep::store_tiny(longlong from) } -bool Protocol_prep::store_short(longlong from) +bool Protocol_binary::store_short(longlong from) { field_pos++; char *to= packet->prep_append(2, PACKET_BUFFER_EXTRA_ALLOC); @@ -1105,7 +1105,7 @@ bool Protocol_prep::store_short(longlong from) } -bool Protocol_prep::store_long(longlong from) +bool Protocol_binary::store_long(longlong from) { field_pos++; char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC); @@ -1116,7 +1116,7 @@ bool Protocol_prep::store_long(longlong from) } -bool Protocol_prep::store_longlong(longlong from, bool unsigned_flag) +bool Protocol_binary::store_longlong(longlong from, bool unsigned_flag) { field_pos++; char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC); @@ -1126,7 +1126,7 @@ bool Protocol_prep::store_longlong(longlong from, bool unsigned_flag) return 0; } -bool Protocol_prep::store_decimal(const my_decimal *d) +bool Protocol_binary::store_decimal(const my_decimal *d) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -1139,7 +1139,7 @@ bool Protocol_prep::store_decimal(const my_decimal *d) return store(str.ptr(), str.length(), str.charset()); } -bool Protocol_prep::store(float from, uint32 decimals, String *buffer) +bool Protocol_binary::store(float from, uint32 decimals, String *buffer) { field_pos++; char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC); @@ -1150,7 +1150,7 @@ bool Protocol_prep::store(float from, uint32 decimals, String *buffer) } -bool Protocol_prep::store(double from, uint32 decimals, String *buffer) +bool Protocol_binary::store(double from, uint32 decimals, String *buffer) { field_pos++; char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC); @@ -1161,7 +1161,7 @@ bool Protocol_prep::store(double from, uint32 decimals, String *buffer) } -bool Protocol_prep::store(Field *field) +bool Protocol_binary::store(Field *field) { /* We should not increment field_pos here as send_binary() will call another @@ -1173,7 +1173,7 @@ bool Protocol_prep::store(Field *field) } -bool Protocol_prep::store(TIME *tm) +bool Protocol_binary::store(TIME *tm) { char buff[12],*pos; uint length; @@ -1199,15 +1199,15 @@ bool Protocol_prep::store(TIME *tm) return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC); } -bool Protocol_prep::store_date(TIME *tm) +bool Protocol_binary::store_date(TIME *tm) { tm->hour= tm->minute= tm->second=0; tm->second_part= 0; - return Protocol_prep::store(tm); + return Protocol_binary::store(tm); } -bool Protocol_prep::store_time(TIME *tm) +bool Protocol_binary::store_time(TIME *tm) { char buff[13], *pos; uint length; diff --git a/sql/protocol.h b/sql/protocol.h index 0e00a7c21e0..b75ce38dc37 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -101,11 +101,11 @@ public: /* Class used for the old (MySQL 4.0 protocol) */ -class Protocol_simple :public Protocol +class Protocol_text :public Protocol { public: - Protocol_simple() {} - Protocol_simple(THD *thd_arg) :Protocol(thd_arg) {} + Protocol_text() {} + Protocol_text(THD *thd_arg) :Protocol(thd_arg) {} virtual void prepare_for_resend(); virtual bool store_null(); virtual bool store_tiny(longlong from); @@ -128,13 +128,13 @@ public: }; -class Protocol_prep :public Protocol +class Protocol_binary :public Protocol { private: uint bit_fields; public: - Protocol_prep() {} - Protocol_prep(THD *thd_arg) :Protocol(thd_arg) {} + Protocol_binary() {} + Protocol_binary(THD *thd_arg) :Protocol(thd_arg) {} virtual bool prepare_for_send(List *item_list); virtual void prepare_for_resend(); #ifdef EMBEDDED_LIBRARY diff --git a/sql/set_var.cc b/sql/set_var.cc index 1f079eee0c6..55a3970b54e 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2730,8 +2730,8 @@ int set_var_collation_client::update(THD *thd) thd->variables.character_set_results= character_set_results; thd->variables.collation_connection= collation_connection; thd->update_charset(); - thd->protocol_simple.init(thd); - thd->protocol_prep.init(thd); + thd->protocol_text.init(thd); + thd->protocol_binary.init(thd); return 0; } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index cbe033f99b8..fc078640a96 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -300,9 +300,9 @@ THD::THD() bzero((char*) &user_var_events, sizeof(user_var_events)); /* Protocol */ - protocol= &protocol_simple; // Default protocol - protocol_simple.init(this); - protocol_prep.init(this); + protocol= &protocol_text; // Default protocol + protocol_text.init(this); + protocol_binary.init(this); tablespace_op=FALSE; ulong tmp=sql_rnd_with_mutex(); diff --git a/sql/sql_class.h b/sql/sql_class.h index 588d936fd57..e73806d75fa 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -853,8 +853,8 @@ public: NET net; // client connection descriptor MEM_ROOT warn_root; // For warnings and errors Protocol *protocol; // Current protocol - Protocol_simple protocol_simple; // Normal protocol - Protocol_prep protocol_prep; // Binary protocol + Protocol_text protocol_text; // Normal protocol + Protocol_binary protocol_binary; // Binary protocol HASH user_vars; // hash for user variables String packet; // dynamic buffer for network I/O String convert_buffer; // buffer for charset conversions diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 249d69d174a..57f7ee056d7 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -83,11 +83,11 @@ When one supplies long data for a placeholder: /* A result class used to send cursor rows using the binary protocol. */ -class Select_fetch_protocol_prep: public select_send +class Select_fetch_protocol_binary: public select_send { - Protocol_prep protocol; + Protocol_binary protocol; public: - Select_fetch_protocol_prep(THD *thd); + Select_fetch_protocol_binary(THD *thd); virtual bool send_fields(List &list, uint flags); virtual bool send_data(List &items); virtual bool send_eof(); @@ -112,7 +112,7 @@ public: }; THD *thd; - Select_fetch_protocol_prep result; + Select_fetch_protocol_binary result; Protocol *protocol; Item_param **param_array; uint param_count; @@ -224,9 +224,9 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns) */ DBUG_RETURN(my_net_write(net, buff, sizeof(buff)) || (stmt->param_count && - stmt->thd->protocol_simple.send_fields((List *) - &stmt->lex->param_list, - Protocol::SEND_EOF))); + stmt->thd->protocol_text.send_fields((List *) + &stmt->lex->param_list, + Protocol::SEND_EOF))); } #else static bool send_prep_stmt(Prepared_statement *stmt, @@ -1882,7 +1882,7 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length) /* First of all clear possible warnings from the previous command */ mysql_reset_thd_for_next_command(thd); - if (! (stmt= new Prepared_statement(thd, &thd->protocol_prep))) + if (! (stmt= new Prepared_statement(thd, &thd->protocol_binary))) DBUG_VOID_RETURN; /* out of memory: error is set in Sql_alloc */ if (thd->stmt_map.insert(thd, stmt)) @@ -2054,7 +2054,7 @@ void mysql_sql_stmt_prepare(THD *thd) const char *query; uint query_len; DBUG_ENTER("mysql_sql_stmt_prepare"); - DBUG_ASSERT(thd->protocol == &thd->protocol_simple); + DBUG_ASSERT(thd->protocol == &thd->protocol_text); if ((stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name))) { @@ -2067,7 +2067,7 @@ void mysql_sql_stmt_prepare(THD *thd) } if (! (query= get_dynamic_sql_string(lex, &query_len)) || - ! (stmt= new Prepared_statement(thd, &thd->protocol_simple))) + ! (stmt= new Prepared_statement(thd, &thd->protocol_text))) { DBUG_VOID_RETURN; /* out of memory */ } @@ -2617,14 +2617,14 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) /*************************************************************************** - Select_fetch_protocol_prep + Select_fetch_protocol_binary ****************************************************************************/ -Select_fetch_protocol_prep::Select_fetch_protocol_prep(THD *thd) +Select_fetch_protocol_binary::Select_fetch_protocol_binary(THD *thd) :protocol(thd) {} -bool Select_fetch_protocol_prep::send_fields(List &list, uint flags) +bool Select_fetch_protocol_binary::send_fields(List &list, uint flags) { bool rc; Protocol *save_protocol= thd->protocol; @@ -2642,7 +2642,7 @@ bool Select_fetch_protocol_prep::send_fields(List &list, uint flags) return rc; } -bool Select_fetch_protocol_prep::send_eof() +bool Select_fetch_protocol_binary::send_eof() { Protocol *save_protocol= thd->protocol; @@ -2654,7 +2654,7 @@ bool Select_fetch_protocol_prep::send_eof() bool -Select_fetch_protocol_prep::send_data(List &fields) +Select_fetch_protocol_binary::send_data(List &fields) { Protocol *save_protocol= thd->protocol; bool rc; @@ -2998,7 +2998,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR, &result, &cursor) : mysql_execute_command(thd)); - thd->protocol= &thd->protocol_simple; /* use normal protocol */ + thd->protocol= &thd->protocol_text; /* use normal protocol */ /* Assert that if an error, no cursor is open */ DBUG_ASSERT(! (error && cursor)); From 9b7c4adbbe0141b68444388f3ddc62dae9c9d79f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Feb 2007 16:48:08 +0800 Subject: [PATCH 015/789] BUG#24363 If the table structure has been changed, the default action about the restore will fail. You can skip the table structure check with --skip-table-check (-s) option. storage/ndb/tools/restore/consumer.hpp: The method is used to judge whether the table structure has been changed when restoring the data. storage/ndb/tools/restore/consumer_restore.cpp: The method is used to judge whether the table structure has been changed when restoring the data. storage/ndb/tools/restore/consumer_restore.hpp: The method is used to judge whether the table structure has been changed when restoring the data. storage/ndb/tools/restore/restore_main.cpp: Add --skip-table-check flag for ndb_restore. Its default value is false, so if the table structure has been changed, the restore will fail. If using it will skip the table schema check. --- storage/ndb/tools/restore/consumer.hpp | 1 + .../ndb/tools/restore/consumer_restore.cpp | 56 +++++++++++++++++++ .../ndb/tools/restore/consumer_restore.hpp | 1 + storage/ndb/tools/restore/restore_main.cpp | 20 +++++++ 4 files changed, 78 insertions(+) diff --git a/storage/ndb/tools/restore/consumer.hpp b/storage/ndb/tools/restore/consumer.hpp index 37f67884e01..1f141bf0cda 100644 --- a/storage/ndb/tools/restore/consumer.hpp +++ b/storage/ndb/tools/restore/consumer.hpp @@ -41,6 +41,7 @@ public: NODE_GROUP_MAP *m_nodegroup_map; uint m_nodegroup_map_len; virtual bool has_temp_error() {return false;} + virtual bool table_equal(const TableS &) {return true;} }; #endif diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp index bd8edc4c47c..6aa10323a2b 100644 --- a/storage/ndb/tools/restore/consumer_restore.cpp +++ b/storage/ndb/tools/restore/consumer_restore.cpp @@ -666,6 +666,62 @@ err: return result; } +bool +BackupRestore::table_equal(const TableS &tableS){ + const char *tablename = tableS.getTableName(); + + if(tableS.m_dictTable == NULL){ + ndbout<<"Table %s has no m_dictTable " << tablename << endl; + return false; + } + /** + * Ignore blob tables + */ + if(match_blob(tablename) >= 0) + return true; + + const NdbTableImpl & tmptab = NdbTableImpl::getImpl(* tableS.m_dictTable); + if ((int) tmptab.m_indexType != (int) NdbDictionary::Index::Undefined){ + return true; + } + + BaseString tmp(tablename); + Vector split; + if(tmp.split(split, "/") != 3){ + err << "Invalid table name format " << tablename << endl; + return false; + } + + m_ndb->setDatabaseName(split[0].c_str()); + m_ndb->setSchemaName(split[1].c_str()); + + NdbDictionary::Dictionary* dict = m_ndb->getDictionary(); + const NdbDictionary::Table* tab = dict->getTable(split[2].c_str()); + if(tab == 0){ + err << "Unable to find table: " << split[2].c_str() << endl; + return false; + } + + if(tab->getNoOfColumns() != tableS.m_dictTable->getNoOfColumns()) + { + ndbout_c("m_columns.size %d != %d",tab->getNoOfColumns(), + tableS.m_dictTable->getNoOfColumns()); + return false; + } + + for(int i = 0; igetNoOfColumns(); i++) + { + if(!tab->getColumn(i)->equal(*(tableS.m_dictTable->getColumn(i)))) + { + ndbout_c("m_columns %s != %s",tab->getColumn(i)->getName(), + tableS.m_dictTable->getColumn(i)->getName()); + return false; + } + } + + return true; +} + bool BackupRestore::createSystable(const TableS & tables){ const char *tablename = tables.getTableName(); diff --git a/storage/ndb/tools/restore/consumer_restore.hpp b/storage/ndb/tools/restore/consumer_restore.hpp index 3d20cb3041e..e4bf481d231 100644 --- a/storage/ndb/tools/restore/consumer_restore.hpp +++ b/storage/ndb/tools/restore/consumer_restore.hpp @@ -74,6 +74,7 @@ public: virtual bool finalize_table(const TableS &); virtual bool has_temp_error(); virtual bool createSystable(const TableS & table); + virtual bool table_equal(const TableS & table); virtual bool update_apply_status(const RestoreMetaData &metaData); void connectToMysql(); bool map_in_frm(char *new_data, const char *data, diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp index 8a632d388e0..1e73b372a8d 100644 --- a/storage/ndb/tools/restore/restore_main.cpp +++ b/storage/ndb/tools/restore/restore_main.cpp @@ -51,6 +51,7 @@ NDB_STD_OPTS_VARS; static bool ga_restore_epoch = false; static bool ga_restore = false; static bool ga_print = false; +static bool ga_skip_table_check = false; static int _print = 0; static int _print_meta = 0; static int _print_data = 0; @@ -92,6 +93,9 @@ static struct my_option my_long_options[] = NDB_REP_DB "." NDB_APPLY_TABLE " with id 0 will be updated/inserted.", (gptr*) &ga_restore_epoch, (gptr*) &ga_restore_epoch, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "skip-table-check", 's', "Skip table structure check during restore of data", + (gptr*) &ga_skip_table_check, (gptr*) &ga_skip_table_check, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "parallelism", 'p', "No of parallel transactions during restore of data." "(parallelism can be 1 to 1024)", @@ -460,6 +464,8 @@ main(int argc, char** argv) g_options.appfmt(" -n %d", ga_nodeId); if (_restore_meta) g_options.appfmt(" -m"); + if (ga_skip_table_check) + g_options.appfmt(" -s"); if (_restore_data) g_options.appfmt(" -r"); if (ga_restore_epoch) @@ -590,6 +596,20 @@ main(int argc, char** argv) { if(_restore_data || _print_data) { + if (!ga_skip_table_check){ + for(i=0; i < metaData.getNoOfTables(); i++){ + if (checkSysTable(metaData, i)) + { + for(Uint32 j= 0; j < g_consumers.size(); j++) + if (!g_consumers[j]->table_equal(* metaData[i])) + { + err << "Restore: Failed to restore data, "; + err << metaData[i]->getTableName() << " table structure doesn't match backup ... Exiting " << endl; + exitHandler(NDBT_FAILED); + } + } + } + } RestoreDataIterator dataIter(metaData, &free_data_callback); // Read data file header From fdffc5a566500dd8a4986b21d5fd92a7834aa94e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Feb 2007 20:00:00 +0800 Subject: [PATCH 016/789] BUG#19378 Job Buffer Full error appears for too large MaxNoOfTables storage/ndb/src/mgmsrv/ConfigInfo.cpp: The high bound of MaxNoOfTables changes into MAX_TABLES defined in ndb_limits.h storage/ndb/src/mgmsrv/ParamInfo.cpp: The high bound of MaxNoOfTables changes into MAX_TABLES defined in ndb_limits.h --- storage/ndb/src/mgmsrv/ConfigInfo.cpp | 2 +- storage/ndb/src/mgmsrv/ParamInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp index 3b71bcea45d..c3c8625051e 100644 --- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp @@ -449,7 +449,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::CI_INT, "128", "8", - STR_VALUE(MAX_INT_RNIL) }, + STR_VALUE(MAX_TABLES) }, { CFG_DB_NO_ORDERED_INDEXES, diff --git a/storage/ndb/src/mgmsrv/ParamInfo.cpp b/storage/ndb/src/mgmsrv/ParamInfo.cpp index 4a4e80eb079..888b7948c05 100644 --- a/storage/ndb/src/mgmsrv/ParamInfo.cpp +++ b/storage/ndb/src/mgmsrv/ParamInfo.cpp @@ -275,7 +275,7 @@ const ParamInfo ParamInfoArray[] = { CI_INT, "128", "8", - STR_VALUE(MAX_INT_RNIL) }, + STR_VALUE(MAX_TABLES) }, { CFG_DB_NO_ORDERED_INDEXES, From 34d20085f320334e7d6e561d8f85a90f31fa784a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Feb 2007 11:56:18 +0400 Subject: [PATCH 017/789] Fix for bug #25301: Non-zero dates with year 0000 are invalid The 0000 year is valid. The ISO standard for "Representation of dates and times" says: "Calendar years are numbered in ascending order according to the Gregorian calendar by values in the range [0000] to [9999]." Reverted fix for 21789: DATETIME with 0000-00-00 11:22:33 should be invalid, but is accepted as it's not a bug. Fix for 19370: DateTime datatype in MySQL has two bugs in it will be reverted during 4.1 -> 5.0 merging as it was pushed to the 5.0 tree. mysql-test/r/date_formats.result: Fix for bug #25301: Non-zero dates with year 0000 are invalid - reverted fix for bug #21789: DATETIME with 0000-00-00 11:22:33 should be invalid, but is accepted sql-common/my_time.c: Fix for bug #25301: Non-zero dates with year 0000 are invalid - reverted fix for bug #21789: DATETIME with 0000-00-00 11:22:33 should be invalid, but is accepted --- mysql-test/r/date_formats.result | 57 ++++++++++---------------------- sql-common/my_time.c | 5 +-- 2 files changed, 19 insertions(+), 43 deletions(-) diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index d4f9a4f0c56..07cc37fe6bc 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -181,12 +181,12 @@ date format datetime 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450 2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12 -10:20:10 %H:%i:%s 0000-00-00 00:00:00 -10:20:10 %h:%i:%s.%f 0000-00-00 00:00:00 -10:20:10 %T 0000-00-00 00:00:00 -10:20:10AM %h:%i:%s%p 0000-00-00 00:00:00 -10:20:10AM %r 0000-00-00 00:00:00 -10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 00:00:00 +10:20:10 %H:%i:%s 0000-00-00 10:20:10 +10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10 +10:20:10 %T 0000-00-00 10:20:10 +10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10 +10:20:10AM %r 0000-00-00 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000 15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58 15 September 2001 %d %M %Y 2001-09-15 00:00:00 15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00 @@ -203,13 +203,6 @@ Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00 15-01-20 %d-%m-%y 2020-01-15 00:00:00 15-2001-1 %d-%Y-%c 2001-01-15 00:00:00 -Warnings: -Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10.440000' select date,format,DATE(str_to_date(date, format)) as date2 from t1; date format date2 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 @@ -250,12 +243,12 @@ date format time 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 -10:20:10 %H:%i:%s NULL -10:20:10 %h:%i:%s.%f NULL -10:20:10 %T NULL -10:20:10AM %h:%i:%s%p NULL -10:20:10AM %r NULL -10:20:10.44AM %h:%i:%s.%f%p NULL +10:20:10 %H:%i:%s 10:20:10 +10:20:10 %h:%i:%s.%f 10:20:10 +10:20:10 %T 10:20:10 +10:20:10AM %h:%i:%s%p 10:20:10 +10:20:10AM %r 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000 15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 15 September 2001 %d %M %Y 00:00:00 15 SEPTEMB 2001 %d %M %Y 00:00:00 @@ -272,13 +265,6 @@ Tuesday 52 2001 %W %V %X 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 15-01-20 %d-%m-%y 00:00:00 15-2001-1 %d-%Y-%c 00:00:00 -Warnings: -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000' select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; date format time2 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 @@ -288,12 +274,12 @@ date format time2 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 -10:20:10 %H:%i:%s NULL -10:20:10 %h:%i:%s.%f NULL -10:20:10 %T NULL -10:20:10AM %h:%i:%s%p NULL -10:20:10AM %r NULL -10:20:10.44AM %h:%i:%s.%f%p NULL +10:20:10 %H:%i:%s 10:20:10 +10:20:10 %h:%i:%s.%f 10:20:10 +10:20:10 %T 10:20:10 +10:20:10AM %h:%i:%s%p 10:20:10 +10:20:10AM %r 10:20:10 +10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000 15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 15 September 2001 %d %M %Y 00:00:00 15 SEPTEMB 2001 %d %M %Y 00:00:00 @@ -310,13 +296,6 @@ Tuesday 52 2001 %W %V %X 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 15-01-20 %d-%m-%y 00:00:00 15-2001-1 %d-%Y-%c 00:00:00 -Warnings: -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10' -Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000' select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) 2003-01-02 08:11:02.123456 diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 2d3d71e646c..0d8ad167ff5 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -350,10 +350,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, l_time->year > 9999 || l_time->month > 12 || l_time->day > 31 || l_time->hour > 23 || l_time->minute > 59 || l_time->second > 59 || - (!(flags & TIME_FUZZY_DATE) && - (l_time->month == 0 || l_time->day == 0)) || - (l_time->year == 0 && l_time->month == 0 && l_time->day == 0 && - (l_time->hour != 0 || l_time->minute != 0 || l_time->second != 0))) + (!(flags & TIME_FUZZY_DATE) && (l_time->month == 0 || l_time->day == 0))) { /* Only give warning for a zero date if there is some garbage after */ if (!not_zero_date) /* If zero date */ From cc2c4e265a721a7b4ff53907b57256b6c51f8df3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Feb 2007 12:53:18 +0400 Subject: [PATCH 018/789] After merge fix. Reverted fix for 19370 DateTime datatype in MySQL has two bugs in it as it's not a bug. --- mysql-test/r/date_formats.result | 4 +--- mysql-test/r/strict.result | 14 ++++---------- mysql-test/r/type_datetime.result | 4 +--- mysql-test/t/strict.test | 8 -------- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 0f7f23b7f2c..f4ec6830cd5 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -449,8 +449,6 @@ create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:% str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2, str_to_date("2003-01-02", "%Y-%m-%d") as f3, str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5; -Warnings: -Warning 1265 Data truncated for column 'f4' at row 1 describe t1; Field Type Null Key Default Extra f1 datetime YES NULL @@ -460,7 +458,7 @@ f4 date YES NULL f5 time YES NULL select * from t1; f1 f2 f3 f4 f5 -2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-00 58:00:00 +2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-02 58:00:00 drop table t1; create table t1 select "02 10" as a, "%d %H" as b; select str_to_date(a,b) from t1; diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 702fc68bb25..3ba9771f12d 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -7,7 +7,6 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (col1 date); INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29'); INSERT INTO t1 VALUES('0000-10-31'); -ERROR 22007: Incorrect date value: '0000-10-31' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-0-31'); ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31'); @@ -57,6 +56,7 @@ select * from t1; col1 2004-01-01 2004-02-29 +0000-10-31 2004-01-02 2004-01-03 2004-00-31 @@ -124,7 +124,6 @@ set @@sql_mode='ansi,traditional'; CREATE TABLE t1 (col1 datetime); INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00'); INSERT INTO t1 VALUES('0000-10-31 15:30:00'); -ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-0-31 15:30:00'); ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-10-0 15:30:00'); @@ -145,6 +144,7 @@ select * from t1; col1 2004-10-31 15:30:00 2004-02-29 15:30:00 +0000-10-31 15:30:00 drop table t1; CREATE TABLE t1 (col1 timestamp); INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00'); @@ -206,7 +206,6 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y')); INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect date value: '0000-10-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -222,7 +221,6 @@ ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_ti INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); -ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -259,7 +257,6 @@ INSERT INTO t1 (col1) VALUES (CAST('2004-10-15' AS DATE)); INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE)); -ERROR 22007: Truncated incorrect datetime value: '0000-10-31' INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE)); ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE)); @@ -267,7 +264,6 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE)); ERROR 22007: Truncated incorrect datetime value: '0000-00-00' INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); -ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); @@ -275,7 +271,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME)); ERROR 22007: Truncated incorrect datetime value: '0000-00-00' INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); -ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' +ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); @@ -288,7 +284,6 @@ INSERT INTO t1 (col1) VALUES (CONVERT('2004-10-15',DATE)); INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE)); -ERROR 22007: Truncated incorrect datetime value: '0000-10-31' INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE)); ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE)); @@ -296,7 +291,6 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE)); ERROR 22007: Truncated incorrect datetime value: '0000-00-00' INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); -ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); @@ -304,7 +298,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME)); ERROR 22007: Truncated incorrect datetime value: '0000-00-00' INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); -ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' +ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 7fc1c4f398d..63094fff896 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -26,8 +26,6 @@ Table Op Msg_type Msg_text test.t1 check status OK delete from t1; insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); -Warnings: -Warning 1264 Out of range value adjusted for column 't' at row 5 insert into t1 values ("2003-003-03"); insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01"); select * from t1; @@ -36,7 +34,7 @@ t 2069-12-31 00:00:00 1970-01-01 00:00:00 1999-12-31 00:00:00 -0000-00-00 00:00:00 +0000-01-01 00:00:00 0001-01-01 00:00:00 9999-12-31 00:00:00 2000-10-10 00:00:00 diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 224a7422de1..65744068711 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -14,7 +14,6 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (col1 date); INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29'); ---error 1292 INSERT INTO t1 VALUES('0000-10-31'); # All test cases expected to fail should return @@ -100,7 +99,6 @@ set @@sql_mode='ansi,traditional'; CREATE TABLE t1 (col1 datetime); INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00'); ---error 1292 INSERT INTO t1 VALUES('0000-10-31 15:30:00'); # All test cases expected to fail should return @@ -194,7 +192,6 @@ INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); # All test cases expected to fail should return # SQLSTATE 22007 ---error 1292 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); --error 1292 @@ -216,7 +213,6 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); # All test cases expected to fail should return # SQLSTATE 22007 ---error 1292 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); --error 1292 @@ -271,7 +267,6 @@ INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); # All test cases expected to fail should return # SQLSTATE 22007 ---error 1292 INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE)); --error 1292 @@ -299,7 +294,6 @@ INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE)); # All test cases expected to fail should return # SQLSTATE 22007 ---error 1292 INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); --error 1292 @@ -367,7 +361,6 @@ INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); # All test cases expected to fail should return # SQLSTATE 22007 ---error 1292 INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE)); --error 1292 @@ -394,7 +387,6 @@ INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE)); # All test cases expected to fail should return # SQLSTATE 22007 ---error 1292 INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); --error 1292 From ab45dc80de6291afbb400a0ef8728c80dd9fe646 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Feb 2007 16:35:32 +0800 Subject: [PATCH 019/789] BUG#19378 Job Buffer Full error appears for too large MaxNoOfTables ndb/src/mgmsrv/ConfigInfo.cpp: The high bound of MaxNoOfTables changes into MAX_TABLES defined in ndb_limits.h --- ndb/src/mgmsrv/ConfigInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index d4e72a7ff1d..3a8c8f26b09 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -459,7 +459,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::CI_INT, "128", "8", - STR_VALUE(MAX_INT_RNIL) }, + STR_VALUE(MAX_TABLES) }, { CFG_DB_NO_ORDERED_INDEXES, From e4146a9f7a9945ea8c5654fa9aba8ccdd05c6c4a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Feb 2007 16:46:42 +0100 Subject: [PATCH 020/789] BUG#22583 (RBR between MyISAM and non-MyISAM tables containing BIT field does not work): Changing packed row format to only include null bits for those columns that are present in the row as well as writing BIT columns in a storage engine-independent format. The change in row format is incompatible with the previous format and a slave will not be able to read the new events. mysql-test/extra/rpl_tests/rpl_deadlock.test: Position change since Format_description_log_event is longer. mysql-test/extra/rpl_tests/rpl_log.test: Position change since Format_description_log_event is longer. mysql-test/extra/rpl_tests/rpl_row_charset.test: Position change since Format_description_log_event is longer. mysql-test/r/rpl_000015.result: Result change. mysql-test/r/rpl_change_master.result: Result change. mysql-test/r/rpl_deadlock_innodb.result: Result change. mysql-test/r/rpl_flushlog_loop.result: Result change. mysql-test/r/rpl_log_pos.result: Result change. mysql-test/r/rpl_row_basic_11bugs.result: Result change. mysql-test/r/rpl_row_charset.result: Result change. mysql-test/r/rpl_row_create_table.result: Result change. mysql-test/r/rpl_row_delayed_ins.result: Result change. mysql-test/r/rpl_row_drop.result: Result change. mysql-test/r/rpl_row_flsh_tbls.result: Result change. mysql-test/r/rpl_row_inexist_tbl.result: Result change. mysql-test/r/rpl_row_log.result: Result change. mysql-test/r/rpl_row_log_innodb.result: Result change. mysql-test/r/rpl_row_max_relay_size.result: Result change. mysql-test/r/rpl_row_reset_slave.result: Result change. mysql-test/r/rpl_row_until.result: Result change. mysql-test/r/rpl_server_id1.result: Result change. mysql-test/r/rpl_server_id2.result: Result change. mysql-test/r/rpl_switch_stm_row_mixed.result: Result change. mysql-test/r/rpl_truncate_2myisam.result: Result change. mysql-test/r/rpl_truncate_3innodb.result: Result change. mysql-test/t/rpl_loaddata_s.test: Position change since Format_description_log_event is longer. mysql-test/t/rpl_log_pos.test: Position change since Format_description_log_event is longer. mysql-test/t/rpl_row_basic_11bugs-master.opt: Adding --innodb option mysql-test/t/rpl_row_basic_11bugs.test: Testing explicitly for RBR MyISAM -> InnoDB and vice versa. Position change since Format_description_log_event is longer. mysql-test/t/rpl_row_create_table.test: Position change since Format_description_log_event is longer. mysql-test/t/rpl_row_flsh_tbls.test: Position change since Format_description_log_event is longer. mysql-test/t/rpl_row_mysqlbinlog.test: Position change since Format_description_log_event is longer. mysql-test/t/rpl_switch_stm_row_mixed.test: Position change since Format_description_log_event is longer. mysql-test/t/user_var-binlog.test: Position change since Format_description_log_event is longer. sql/log_event.cc: Changing packed row format to only include null bits for those columns that are present in the row as well as writing BIT columns in a storage engine-independent format. Changing unpack_row() to accomodate for the changes. sql/log_event.h: Renumbering old row events and adding new codes. sql/sql_class.cc: Changing packed row format to only include null bits for those columns that are present in the row as well as writing BIT columns in a storage engine-independent format. Changing THD::pack_row() to accomodate for the changes and adding documentation. mysql-test/t/rpl_row_basic_11bugs-slave.opt: New BitKeeper file ``mysql-test/t/rpl_row_basic_11bugs-slave.opt'' --- mysql-test/extra/rpl_tests/rpl_deadlock.test | 4 +- mysql-test/extra/rpl_tests/rpl_log.test | 6 +- .../extra/rpl_tests/rpl_row_charset.test | 2 +- mysql-test/r/rpl_000015.result | 4 +- mysql-test/r/rpl_change_master.result | 4 +- mysql-test/r/rpl_deadlock_innodb.result | 4 +- mysql-test/r/rpl_flushlog_loop.result | 4 +- mysql-test/r/rpl_log_pos.result | 8 +- mysql-test/r/rpl_row_basic_11bugs.result | 115 ++++++++++++++- mysql-test/r/rpl_row_charset.result | 2 +- mysql-test/r/rpl_row_create_table.result | 32 ++-- mysql-test/r/rpl_row_delayed_ins.result | 14 +- mysql-test/r/rpl_row_drop.result | 8 +- mysql-test/r/rpl_row_flsh_tbls.result | 4 +- mysql-test/r/rpl_row_inexist_tbl.result | 2 +- mysql-test/r/rpl_row_log.result | 16 +- mysql-test/r/rpl_row_log_innodb.result | 16 +- mysql-test/r/rpl_row_max_relay_size.result | 22 +-- mysql-test/r/rpl_row_reset_slave.result | 6 +- mysql-test/r/rpl_row_until.result | 8 +- mysql-test/r/rpl_server_id1.result | 2 +- mysql-test/r/rpl_server_id2.result | 2 +- mysql-test/r/rpl_switch_stm_row_mixed.result | 4 +- mysql-test/r/rpl_truncate_2myisam.result | 66 ++++----- mysql-test/r/rpl_truncate_3innodb.result | 90 ++++++------ mysql-test/t/rpl_loaddata_s.test | 2 +- mysql-test/t/rpl_log_pos.test | 2 +- mysql-test/t/rpl_row_basic_11bugs-master.opt | 3 +- mysql-test/t/rpl_row_basic_11bugs-slave.opt | 1 + mysql-test/t/rpl_row_basic_11bugs.test | 70 ++++++++- mysql-test/t/rpl_row_create_table.test | 10 +- mysql-test/t/rpl_row_flsh_tbls.test | 2 +- mysql-test/t/rpl_row_mysqlbinlog.test | 4 +- mysql-test/t/rpl_switch_stm_row_mixed.test | 4 +- mysql-test/t/user_var-binlog.test | 2 +- sql/log_event.cc | 139 ++++++++++-------- sql/log_event.h | 19 ++- sql/sql_class.cc | 113 ++++++++++++-- 38 files changed, 549 insertions(+), 267 deletions(-) create mode 100644 mysql-test/t/rpl_row_basic_11bugs-slave.opt diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test index 64df1f272cc..d132c34ef90 100644 --- a/mysql-test/extra/rpl_tests/rpl_deadlock.test +++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test @@ -73,7 +73,7 @@ show slave status; # 2) Test lock wait timeout stop slave; -change master to master_log_pos=536; # the BEGIN log event +change master to master_log_pos=539; # the BEGIN log event begin; select * from t2 for update; # hold lock start slave; @@ -96,7 +96,7 @@ set global max_relay_log_size=0; # This is really copy-paste of 2) of above stop slave; -change master to master_log_pos=536; +change master to master_log_pos=539; begin; select * from t2 for update; start slave; diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test index cc3a9b4ffb5..4f40cab4e7e 100644 --- a/mysql-test/extra/rpl_tests/rpl_log.test +++ b/mysql-test/extra/rpl_tests/rpl_log.test @@ -42,13 +42,13 @@ select count(*) from t1; show binlog events; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 102 limit 1; +show binlog events from 105 limit 1; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 102 limit 2; +show binlog events from 105 limit 2; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 102 limit 2,1; +show binlog events from 105 limit 2,1; flush logs; # We need an extra update before doing save_master_pos. diff --git a/mysql-test/extra/rpl_tests/rpl_row_charset.test b/mysql-test/extra/rpl_tests/rpl_row_charset.test index 336a038db10..b3959c53d15 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_row_charset.test @@ -115,7 +115,7 @@ drop database mysqltest2; drop database mysqltest3; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; sync_slave_with_master; # Check that we can change global.collation_server (since 5.0.3) diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/r/rpl_000015.result index a2763d4f023..eb9b1ef4882 100644 --- a/mysql-test/r/rpl_000015.result +++ b/mysql-test/r/rpl_000015.result @@ -1,7 +1,7 @@ reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 105 reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -17,7 +17,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 105 # # master-bin.000001 Yes Yes 0 0 105 # None 0 No # drop table if exists t1; create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result index 513de9494ba..a9ea380df09 100644 --- a/mysql-test/r/rpl_change_master.result +++ b/mysql-test/r/rpl_change_master.result @@ -13,11 +13,11 @@ insert into t1 values(2); stop slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 190 # None 0 No # change master to master_user='root'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 190 # None 0 No # start slave; select * from t1; n diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/r/rpl_deadlock_innodb.result index b9a23950ed8..22ca1c3cec1 100644 --- a/mysql-test/r/rpl_deadlock_innodb.result +++ b/mysql-test/r/rpl_deadlock_innodb.result @@ -78,7 +78,7 @@ Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # stop slave; -change master to master_log_pos=536; +change master to master_log_pos=539; begin; select * from t2 for update; a @@ -128,7 +128,7 @@ Master_SSL_Key Seconds_Behind_Master # set global max_relay_log_size=0; stop slave; -change master to master_log_pos=536; +change master to master_log_pos=539; begin; select * from t2 for update; a diff --git a/mysql-test/r/rpl_flushlog_loop.result b/mysql-test/r/rpl_flushlog_loop.result index 16d8ba251f4..a600f103069 100644 --- a/mysql-test/r/rpl_flushlog_loop.result +++ b/mysql-test/r/rpl_flushlog_loop.result @@ -24,7 +24,7 @@ Master_User root Master_Port SLAVE_PORT Connect_Retry 60 Master_Log_File slave-bin.000001 -Read_Master_Log_Pos 212 +Read_Master_Log_Pos 215 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File slave-bin.000001 @@ -39,7 +39,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 212 +Exec_Master_Log_Pos 215 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result index c7484022b23..8a80b5315d4 100644 --- a/mysql-test/r/rpl_log_pos.result +++ b/mysql-test/r/rpl_log_pos.result @@ -6,10 +6,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 105 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes 0 0 105 # None 0 No # stop slave; change master to master_log_pos=74; start slave; @@ -30,13 +30,13 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No # show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 105 create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); stop slave; -change master to master_log_pos=102; +change master to master_log_pos=105; start slave; select * from t1 ORDER BY n; n diff --git a/mysql-test/r/rpl_row_basic_11bugs.result b/mysql-test/r/rpl_row_basic_11bugs.result index e49facd2d70..a3542f9a931 100644 --- a/mysql-test/r/rpl_row_basic_11bugs.result +++ b/mysql-test/r/rpl_row_basic_11bugs.result @@ -25,11 +25,11 @@ SHOW TABLES; Tables_in_test_ignore t2 INSERT INTO t2 VALUES (3,3), (4,4); -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 105; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 102 Query 1 195 use `test`; CREATE TABLE t1 (a INT, b INT) -master-bin.000001 195 Table_map 1 235 table_id: # (test.t1) -master-bin.000001 235 Write_rows 1 282 table_id: # flags: STMT_END_F +master-bin.000001 105 Query 1 198 use `test`; CREATE TABLE t1 (a INT, b INT) +master-bin.000001 198 Table_map 1 238 table_id: # (test.t1) +master-bin.000001 238 Write_rows 1 285 table_id: # flags: STMT_END_F **** On Slave **** SHOW DATABASES; Database @@ -56,10 +56,10 @@ DELETE FROM t1 WHERE a = 0; UPDATE t1 SET a=99 WHERE a = 0; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) -master-bin.000001 227 Write_rows 1 266 table_id: # flags: STMT_END_F +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 191 use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 191 Table_map 1 230 table_id: # (test.t1) +master-bin.000001 230 Write_rows 1 269 table_id: # flags: STMT_END_F DROP TABLE t1; ================ Test for BUG#17620 ================ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; @@ -120,3 +120,102 @@ HEX(a) b SELECT HEX(a),b FROM t1; HEX(a) b 0 2 +DROP TABLE IF EXISTS t1; +================ Test for BUG#22583 ================ +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +**** On Master **** +CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM; +CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB; +CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM; +CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB; +**** On Slave **** +ALTER TABLE t1_myisam ENGINE=INNODB; +ALTER TABLE t1_innodb ENGINE=MYISAM; +ALTER TABLE t2_myisam ENGINE=INNODB; +ALTER TABLE t2_innodb ENGINE=MYISAM; +**** On Master **** +INSERT INTO t1_myisam VALUES(1, b'0', 257); +INSERT INTO t1_myisam VALUES(2, b'1', 256); +INSERT INTO t1_innodb VALUES(1, b'0', 257); +INSERT INTO t1_innodb VALUES(2, b'1', 256); +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +k HEX(a) HEX(b) +1 0 101 +2 1 100 +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +k HEX(a) HEX(b) +1 0 101 +2 1 100 +INSERT INTO t2_myisam VALUES(1, b'0', 9); +INSERT INTO t2_myisam VALUES(2, b'1', 8); +INSERT INTO t2_innodb VALUES(1, b'0', 9); +INSERT INTO t2_innodb VALUES(2, b'1', 8); +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +k HEX(a) HEX(b) +1 0 9 +2 1 8 +SELECT k, HEX(a),HEX(b) FROM t2_innodb; +k HEX(a) HEX(b) +1 0 9 +2 1 8 +**** On Slave **** +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +k HEX(a) HEX(b) +1 0 101 +2 1 100 +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +k HEX(a) HEX(b) +1 0 101 +2 1 100 +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +k HEX(a) HEX(b) +1 0 9 +2 1 8 +SELECT k, HEX(a),HEX(b) FROM t2_innodb; +k HEX(a) HEX(b) +1 0 9 +2 1 8 +**** On Master **** +UPDATE t1_myisam SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +k HEX(a) HEX(b) +1 0 101 +2 0 100 +UPDATE t1_innodb SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +k HEX(a) HEX(b) +1 0 101 +2 0 100 +UPDATE t2_myisam SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +k HEX(a) HEX(b) +1 0 9 +2 0 8 +UPDATE t2_innodb SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t2_innodb; +k HEX(a) HEX(b) +1 0 9 +2 0 8 +**** On Slave **** +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +k HEX(a) HEX(b) +1 0 101 +2 0 100 +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +k HEX(a) HEX(b) +1 0 101 +2 0 100 +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +k HEX(a) HEX(b) +1 0 9 +2 0 8 +SELECT k, HEX(a),HEX(b) FROM t2_innodb; +k HEX(a) HEX(b) +1 0 9 +2 0 8 +**** On Master **** +DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb; diff --git a/mysql-test/r/rpl_row_charset.result b/mysql-test/r/rpl_row_charset.result index 79cf75c8cc1..2462dd0b505 100644 --- a/mysql-test/r/rpl_row_charset.result +++ b/mysql-test/r/rpl_row_charset.result @@ -109,7 +109,7 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest2 master-bin.000001 # Query 1 # drop database if exists mysqltest3 diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result index 03388f59b8c..6a1877c0fec 100644 --- a/mysql-test/r/rpl_row_create_table.result +++ b/mysql-test/r/rpl_row_create_table.result @@ -8,27 +8,27 @@ CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT) ENGINE=Merge; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; -SHOW BINLOG EVENTS FROM 212; +SHOW BINLOG EVENTS FROM 215; Log_name # -Pos 212 +Pos 215 Event_type Query Server_id # End_log_pos # Info use `test`; CREATE TABLE t1 (a INT, b INT) Log_name # -Pos 305 +Pos 308 Event_type Query Server_id # End_log_pos # Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge Log_name # -Pos 411 +Pos 414 Event_type Query Server_id # End_log_pos # Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8 Log_name # -Pos 517 +Pos 520 Event_type Query Server_id # End_log_pos # @@ -127,7 +127,7 @@ NULL 5 10 NULL 6 12 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; ERROR 23000: Duplicate entry '2' for key 'b' -SHOW BINLOG EVENTS FROM 1256; +SHOW BINLOG EVENTS FROM 1097; Log_name Pos Event_type Server_id End_log_pos Info CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; @@ -137,11 +137,11 @@ a b 1 2 2 4 3 6 -SHOW BINLOG EVENTS FROM 1118; +SHOW BINLOG EVENTS FROM 1097; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1118 Query 1 1218 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) -master-bin.000001 1218 Table_map 1 1258 table_id: # (test.t7) -master-bin.000001 1258 Write_rows 1 1314 table_id: # flags: STMT_END_F +master-bin.000001 1097 Query 1 1197 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) +master-bin.000001 1197 Table_map 1 1237 table_id: # (test.t7) +master-bin.000001 1237 Write_rows 1 1293 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -154,10 +154,10 @@ INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -SHOW BINLOG EVENTS FROM 1314; +SHOW BINLOG EVENTS FROM 1293; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1314 Table_map 1 1354 table_id: # (test.t7) -master-bin.000001 1354 Write_rows 1 1410 table_id: # flags: STMT_END_F +master-bin.000001 1293 Table_map 1 1333 table_id: # (test.t7) +master-bin.000001 1333 Write_rows 1 1389 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -192,10 +192,10 @@ Create Table CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW BINLOG EVENTS FROM 1410; +SHOW BINLOG EVENTS FROM 1389; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1410 Query 1 1496 use `test`; CREATE TABLE t8 LIKE t4 -master-bin.000001 1496 Query 1 1635 use `test`; CREATE TABLE `t9` ( +master-bin.000001 1389 Query 1 1475 use `test`; CREATE TABLE t8 LIKE t4 +master-bin.000001 1475 Query 1 1614 use `test`; CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/r/rpl_row_delayed_ins.result index 31fffeb59cc..cad38f77d52 100644 --- a/mysql-test/r/rpl_row_delayed_ins.result +++ b/mysql-test/r/rpl_row_delayed_ins.result @@ -14,13 +14,13 @@ a 3 show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 222 use `test`; create table t1(a int not null primary key) engine=myisam -master-bin.000001 222 Table_map 1 261 table_id: # (test.t1) -master-bin.000001 261 Write_rows 1 295 table_id: # flags: STMT_END_F -master-bin.000001 295 Table_map 1 334 table_id: # (test.t1) -master-bin.000001 334 Write_rows 1 373 table_id: # flags: STMT_END_F -master-bin.000001 373 Query 1 448 use `test`; flush tables +master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 225 use `test`; create table t1(a int not null primary key) engine=myisam +master-bin.000001 225 Table_map 1 264 table_id: # (test.t1) +master-bin.000001 264 Write_rows 1 298 table_id: # flags: STMT_END_F +master-bin.000001 298 Table_map 1 337 table_id: # (test.t1) +master-bin.000001 337 Write_rows 1 376 table_id: # flags: STMT_END_F +master-bin.000001 376 Query 1 451 use `test`; flush tables SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/r/rpl_row_drop.result b/mysql-test/r/rpl_row_drop.result index 4ef21884fda..cdf52ceb9b9 100644 --- a/mysql-test/r/rpl_row_drop.result +++ b/mysql-test/r/rpl_row_drop.result @@ -43,10 +43,10 @@ t2 DROP TABLE t1,t2; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a int) -master-bin.000001 188 Query 1 274 use `test`; CREATE TABLE t2 (a int) -master-bin.000001 274 Query 1 378 use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 191 use `test`; CREATE TABLE t1 (a int) +master-bin.000001 191 Query 1 277 use `test`; CREATE TABLE t2 (a int) +master-bin.000001 277 Query 1 381 use `test`; DROP TABLE `t1` /* generated by server */ SHOW TABLES; Tables_in_test t2 diff --git a/mysql-test/r/rpl_row_flsh_tbls.result b/mysql-test/r/rpl_row_flsh_tbls.result index e2352b8605b..d5b8dc48009 100644 --- a/mysql-test/r/rpl_row_flsh_tbls.result +++ b/mysql-test/r/rpl_row_flsh_tbls.result @@ -12,13 +12,13 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 615 ; +SHOW BINLOG EVENTS FROM 618 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 615 ; +SHOW BINLOG EVENTS FROM 618 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 # Query 1 # use `test`; flush tables diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/r/rpl_row_inexist_tbl.result index 5f5a4556d76..188dfd5924a 100644 --- a/mysql-test/r/rpl_row_inexist_tbl.result +++ b/mysql-test/r/rpl_row_inexist_tbl.result @@ -39,7 +39,7 @@ Replicate_Wild_Ignore_Table Last_Errno 1146 Last_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1` Skip_Counter 0 -Exec_Master_Log_Pos 519 +Exec_Master_Log_Pos 522 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result index 89163e1e37b..b7785bbe6b3 100644 --- a/mysql-test/r/rpl_row_log.result +++ b/mysql-test/r/rpl_row_log.result @@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -show binlog events from 102 limit 1; +show binlog events from 105 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 102 limit 2; +show binlog events from 105 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Table_map 1 # table_id: # (test.t1) -show binlog events from 102 limit 2,1; +show binlog events from 105 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F flush logs; @@ -67,13 +67,13 @@ master-bin.000002 # Table_map 1 # table_id: # (test.t2) master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F show binary logs; Log_name File_size -master-bin.000001 1256 -master-bin.000002 373 +master-bin.000001 1259 +master-bin.000002 376 start slave; show binary logs; Log_name File_size -slave-bin.000001 1354 -slave-bin.000002 274 +slave-bin.000001 1357 +slave-bin.000002 277 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -94,7 +94,7 @@ slave-bin.000002 # Table_map 1 # table_id: # (test.t2) slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 373 # # master-bin.000002 Yes Yes # 0 0 373 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 376 # # master-bin.000002 Yes Yes # 0 0 376 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/r/rpl_row_log_innodb.result index 3bcd8a6a0fb..f51d99a07c3 100644 --- a/mysql-test/r/rpl_row_log_innodb.result +++ b/mysql-test/r/rpl_row_log_innodb.result @@ -28,14 +28,14 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not nul master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Xid 1 # COMMIT /* XID */ -show binlog events from 102 limit 1; +show binlog events from 105 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -show binlog events from 102 limit 2; +show binlog events from 105 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB master-bin.000001 # Table_map 1 # table_id: # (test.t1) -show binlog events from 102 limit 2,1; +show binlog events from 105 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F flush logs; @@ -72,13 +72,13 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Xid 1 # COMMIT /* XID */ show binary logs; Log_name File_size -master-bin.000001 1310 -master-bin.000002 400 +master-bin.000001 1313 +master-bin.000002 403 start slave; show binary logs; Log_name File_size -slave-bin.000001 1408 -slave-bin.000002 301 +slave-bin.000001 1411 +slave-bin.000002 304 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -102,7 +102,7 @@ slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Xid 1 # COMMIT /* XID */ show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 400 # # master-bin.000002 Yes Yes # 0 0 400 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 403 # # master-bin.000002 Yes Yes # 0 0 403 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_row_max_relay_size.result b/mysql-test/r/rpl_row_max_relay_size.result index 163e8231de5..9f420c120d3 100644 --- a/mysql-test/r/rpl_row_max_relay_size.result +++ b/mysql-test/r/rpl_row_max_relay_size.result @@ -29,7 +29,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58664 +Read_Master_Log_Pos 58667 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -44,7 +44,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58664 +Exec_Master_Log_Pos 58667 Relay_Log_Space # Until_Condition None Until_Log_File @@ -72,7 +72,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58664 +Read_Master_Log_Pos 58667 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -87,7 +87,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58664 +Exec_Master_Log_Pos 58667 Relay_Log_Space # Until_Condition None Until_Log_File @@ -115,7 +115,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58664 +Read_Master_Log_Pos 58667 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -130,7 +130,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58664 +Exec_Master_Log_Pos 58667 Relay_Log_Space # Until_Condition None Until_Log_File @@ -196,7 +196,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58750 +Read_Master_Log_Pos 58753 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -211,7 +211,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58750 +Exec_Master_Log_Pos 58753 Relay_Log_Space # Until_Condition None Until_Log_File @@ -235,7 +235,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58826 +Read_Master_Log_Pos 58829 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -250,7 +250,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58826 +Exec_Master_Log_Pos 58829 Relay_Log_Space # Until_Condition None Until_Log_File @@ -265,7 +265,7 @@ Seconds_Behind_Master # flush logs; show master status; File master-bin.000002 -Position 102 +Position 105 Binlog_Do_DB Binlog_Ignore_DB # diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/r/rpl_row_reset_slave.result index 57fc95708e5..a93db7b2c7e 100644 --- a/mysql-test/r/rpl_row_reset_slave.result +++ b/mysql-test/r/rpl_row_reset_slave.result @@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # stop slave; change master to master_user='test'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 No No # 0 0 105 # None 0 No # reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/r/rpl_row_until.result index 8d4b0d6b591..6d0da57baeb 100644 --- a/mysql-test/r/rpl_row_until.result +++ b/mysql-test/r/rpl_row_until.result @@ -21,7 +21,7 @@ n 4 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-bin.000001 311 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 # No 0 0 314 # Master master-bin.000001 311 No # start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; select * from t1; n @@ -31,7 +31,7 @@ n 4 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-no-such-bin.000001 291 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 # No 0 0 314 # Master master-no-such-bin.000001 291 No # start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; select * from t2; n @@ -39,13 +39,13 @@ n 2 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 586 # Relay slave-relay-bin.000004 728 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 # No 0 0 589 # Relay slave-relay-bin.000004 728 No # start slave; stop slave; start slave until master_log_file='master-bin.000001', master_log_pos=740; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 740 # Master master-bin.000001 740 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 743 # Master master-bin.000001 740 No # start slave until master_log_file='master-bin', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result index c94a7748fcd..7091a26f272 100644 --- a/mysql-test/r/rpl_server_id1.result +++ b/mysql-test/r/rpl_server_id1.result @@ -10,7 +10,7 @@ stop slave; change master to master_port=SLAVE_PORT; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 102 None 0 No NULL + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 105 None 0 No NULL start slave; insert into t1 values (1); show status like "slave_running"; diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result index 72db862040e..3ad15d7ce5b 100644 --- a/mysql-test/r/rpl_server_id2.result +++ b/mysql-test/r/rpl_server_id2.result @@ -10,7 +10,7 @@ stop slave; change master to master_port=SLAVE_PORT; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 102 None 0 No NULL + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 105 None 0 No NULL start slave; insert into t1 values (1); select * from t1; diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/r/rpl_switch_stm_row_mixed.result index 047bfe53704..2f970adea11 100644 --- a/mysql-test/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/r/rpl_switch_stm_row_mixed.result @@ -382,7 +382,7 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest1 master-bin.000001 # Query 1 # create database mysqltest1 @@ -692,7 +692,7 @@ master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t12 master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t12 (data LONG) master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest1 master-bin.000001 # Query 1 # create database mysqltest1 diff --git a/mysql-test/r/rpl_truncate_2myisam.result b/mysql-test/r/rpl_truncate_2myisam.result index 41640a709b9..23e4630c3c8 100644 --- a/mysql-test/r/rpl_truncate_2myisam.result +++ b/mysql-test/r/rpl_truncate_2myisam.result @@ -31,11 +31,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 387 use `test`; TRUNCATE TABLE t1 -master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Query 1 390 use `test`; TRUNCATE TABLE t1 +master-bin.000001 390 Query 1 466 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -63,11 +63,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 387 use `test`; TRUNCATE TABLE t1 -master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Query 1 390 use `test`; TRUNCATE TABLE t1 +master-bin.000001 390 Query 1 466 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -95,12 +95,12 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Table_map 1 250 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 297 table_id: # flags: STMT_END_F -master-bin.000001 297 Query 1 377 use `test`; TRUNCATE TABLE t1 -master-bin.000001 377 Query 1 453 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 213 Table_map 1 253 table_id: # (test.t1) +master-bin.000001 253 Write_rows 1 300 table_id: # flags: STMT_END_F +master-bin.000001 300 Query 1 380 use `test`; TRUNCATE TABLE t1 +master-bin.000001 380 Query 1 456 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -128,11 +128,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 384 use `test`; DELETE FROM t1 -master-bin.000001 384 Query 1 460 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Query 1 387 use `test`; DELETE FROM t1 +master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -160,11 +160,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 384 use `test`; DELETE FROM t1 -master-bin.000001 384 Query 1 460 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Query 1 387 use `test`; DELETE FROM t1 +master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -193,10 +193,10 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Table_map 1 250 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 297 table_id: # flags: STMT_END_F -master-bin.000001 297 Table_map 1 337 table_id: # (test.t1) -master-bin.000001 337 Delete_rows 1 384 table_id: # flags: STMT_END_F -master-bin.000001 384 Query 1 460 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 213 Table_map 1 253 table_id: # (test.t1) +master-bin.000001 253 Write_rows 1 300 table_id: # flags: STMT_END_F +master-bin.000001 300 Table_map 1 340 table_id: # (test.t1) +master-bin.000001 340 Delete_rows 1 387 table_id: # flags: STMT_END_F +master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/rpl_truncate_3innodb.result b/mysql-test/r/rpl_truncate_3innodb.result index 062c9704ae0..c7edd5014c2 100644 --- a/mysql-test/r/rpl_truncate_3innodb.result +++ b/mysql-test/r/rpl_truncate_3innodb.result @@ -31,13 +31,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ -master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ +master-bin.000001 337 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 417 Xid 1 444 COMMIT /* xid= */ +master-bin.000001 444 Query 1 520 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -65,13 +65,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ -master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ +master-bin.000001 337 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 417 Xid 1 444 COMMIT /* xid= */ +master-bin.000001 444 Query 1 520 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -99,14 +99,14 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 297 Xid 1 324 COMMIT /* xid= */ -master-bin.000001 324 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 404 Xid 1 431 COMMIT /* xid= */ -master-bin.000001 431 Query 1 507 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 213 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 253 Write_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 300 Xid 1 327 COMMIT /* xid= */ +master-bin.000001 327 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 407 Xid 1 434 COMMIT /* xid= */ +master-bin.000001 434 Query 1 510 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -134,13 +134,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 411 Xid 1 438 COMMIT /* xid= */ -master-bin.000001 438 Query 1 514 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ +master-bin.000001 337 Query 1 77 use `test`; DELETE FROM t1 +master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ +master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -168,13 +168,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 411 Xid 1 438 COMMIT /* xid= */ -master-bin.000001 438 Query 1 514 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ +master-bin.000001 337 Query 1 77 use `test`; DELETE FROM t1 +master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ +master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -203,12 +203,12 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 297 Xid 1 324 COMMIT /* xid= */ -master-bin.000001 324 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 364 Delete_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 411 Xid 1 438 COMMIT /* xid= */ -master-bin.000001 438 Query 1 514 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 213 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 253 Write_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 300 Xid 1 327 COMMIT /* xid= */ +master-bin.000001 327 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 367 Delete_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ +master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/t/rpl_loaddata_s.test index 2c94c8ef953..e9c0ce96925 100644 --- a/mysql-test/t/rpl_loaddata_s.test +++ b/mysql-test/t/rpl_loaddata_s.test @@ -22,7 +22,7 @@ sync_with_master; select count(*) from test.t1; # check that LOAD was replicated --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; # should be nothing +show binlog events from 105; # should be nothing # Cleanup connection master; diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test index 61c24da514e..ffc62bb2f51 100644 --- a/mysql-test/t/rpl_log_pos.test +++ b/mysql-test/t/rpl_log_pos.test @@ -49,7 +49,7 @@ insert into t1 values (1),(2),(3); save_master_pos; connection slave; stop slave; -change master to master_log_pos=102; +change master to master_log_pos=105; start slave; sync_with_master; select * from t1 ORDER BY n; diff --git a/mysql-test/t/rpl_row_basic_11bugs-master.opt b/mysql-test/t/rpl_row_basic_11bugs-master.opt index ad03cdaa6d1..ceba85f40e5 100644 --- a/mysql-test/t/rpl_row_basic_11bugs-master.opt +++ b/mysql-test/t/rpl_row_basic_11bugs-master.opt @@ -1 +1,2 @@ ---binlog_ignore_db=test_ignore +--binlog_ignore_db=test_ignore --innodb + diff --git a/mysql-test/t/rpl_row_basic_11bugs-slave.opt b/mysql-test/t/rpl_row_basic_11bugs-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_row_basic_11bugs-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_row_basic_11bugs.test b/mysql-test/t/rpl_row_basic_11bugs.test index 37bfd01e260..bec3478f456 100644 --- a/mysql-test/t/rpl_row_basic_11bugs.test +++ b/mysql-test/t/rpl_row_basic_11bugs.test @@ -26,7 +26,7 @@ CREATE TABLE t2 (a INT, b INT); SHOW TABLES; INSERT INTO t2 VALUES (3,3), (4,4); --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 105; sync_slave_with_master; --echo **** On Slave **** SHOW DATABASES; @@ -114,3 +114,71 @@ UPDATE t1 SET a=0 WHERE b=2; SELECT HEX(a),b FROM t1; sync_slave_with_master; SELECT HEX(a),b FROM t1; + +connection master; +DROP TABLE IF EXISTS t1; +sync_slave_with_master; + +# BUG#22583: RBR between MyISAM and non-MyISAM tables containing a BIT +# field does not work + +--echo ================ Test for BUG#22583 ================ +--disable_query_log +--source include/master-slave-reset.inc +--enable_query_log + +--echo **** On Master **** +connection master; +CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM; +CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB; +CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM; +CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB; +--echo **** On Slave **** +sync_slave_with_master; +ALTER TABLE t1_myisam ENGINE=INNODB; +ALTER TABLE t1_innodb ENGINE=MYISAM; +ALTER TABLE t2_myisam ENGINE=INNODB; +ALTER TABLE t2_innodb ENGINE=MYISAM; + +--echo **** On Master **** +connection master; +INSERT INTO t1_myisam VALUES(1, b'0', 257); +INSERT INTO t1_myisam VALUES(2, b'1', 256); +INSERT INTO t1_innodb VALUES(1, b'0', 257); +INSERT INTO t1_innodb VALUES(2, b'1', 256); +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +INSERT INTO t2_myisam VALUES(1, b'0', 9); +INSERT INTO t2_myisam VALUES(2, b'1', 8); +INSERT INTO t2_innodb VALUES(1, b'0', 9); +INSERT INTO t2_innodb VALUES(2, b'1', 8); +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +SELECT k, HEX(a),HEX(b) FROM t2_innodb; +--echo **** On Slave **** +sync_slave_with_master; +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +SELECT k, HEX(a),HEX(b) FROM t2_innodb; + +--echo **** On Master **** +connection master; +UPDATE t1_myisam SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +UPDATE t1_innodb SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +UPDATE t2_myisam SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +UPDATE t2_innodb SET a=0 WHERE k=2; +SELECT k, HEX(a),HEX(b) FROM t2_innodb; +--echo **** On Slave **** +sync_slave_with_master; +SELECT k, HEX(a),HEX(b) FROM t1_myisam; +SELECT k, HEX(a),HEX(b) FROM t1_innodb; +SELECT k, HEX(a),HEX(b) FROM t2_myisam; +SELECT k, HEX(a),HEX(b) FROM t2_innodb; + +--echo **** On Master **** +connection master; +DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test index 3a711e5b496..bc1752b3d5b 100644 --- a/mysql-test/t/rpl_row_create_table.test +++ b/mysql-test/t/rpl_row_create_table.test @@ -32,7 +32,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; --replace_column 1 # 4 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ ---query_vertical SHOW BINLOG EVENTS FROM 212 +--query_vertical SHOW BINLOG EVENTS FROM 215 --echo **** On Master **** --query_vertical SHOW CREATE TABLE t1 --query_vertical SHOW CREATE TABLE t2 @@ -67,7 +67,7 @@ connection master; CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; # Shouldn't be written to the binary log --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1256; +SHOW BINLOG EVENTS FROM 1097; # Test that INSERT-SELECT works the same way as for SBR. CREATE TABLE t7 (a INT, b INT UNIQUE); @@ -76,7 +76,7 @@ INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1118; +SHOW BINLOG EVENTS FROM 1097; sync_slave_with_master; SELECT * FROM t7 ORDER BY a,b; @@ -87,7 +87,7 @@ BEGIN; INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1314; +SHOW BINLOG EVENTS FROM 1293; SELECT * FROM t7 ORDER BY a,b; sync_slave_with_master; SELECT * FROM t7 ORDER BY a,b; @@ -102,7 +102,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1; --query_vertical SHOW CREATE TABLE t8 --query_vertical SHOW CREATE TABLE t9 --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1410; +SHOW BINLOG EVENTS FROM 1389; sync_slave_with_master; --echo **** On Slave **** --query_vertical SHOW CREATE TABLE t8 diff --git a/mysql-test/t/rpl_row_flsh_tbls.test b/mysql-test/t/rpl_row_flsh_tbls.test index 9e8efc1ac9c..ef8fb171989 100644 --- a/mysql-test/t/rpl_row_flsh_tbls.test +++ b/mysql-test/t/rpl_row_flsh_tbls.test @@ -1,7 +1,7 @@ # depends on the binlog output -- source include/have_binlog_format_row.inc -let $rename_event_pos= 615; +let $rename_event_pos= 618; # Bug#18326: Do not lock table for writing during prepare of statement # The use of the ps protocol causes extra table maps in the binlog, so diff --git a/mysql-test/t/rpl_row_mysqlbinlog.test b/mysql-test/t/rpl_row_mysqlbinlog.test index 3b4c8db86d8..0bef8b5a62f 100644 --- a/mysql-test/t/rpl_row_mysqlbinlog.test +++ b/mysql-test/t/rpl_row_mysqlbinlog.test @@ -167,7 +167,7 @@ connection master; select "--- Test 2 position test --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=412 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=415 $MYSQLTEST_VARDIR/log/master-bin.000001 # These are tests for remote binlog. # They should return the same as previous test. @@ -263,7 +263,7 @@ select "--- Test 6 reading stdin --" as ""; select "--- Test 7 reading stdin w/position --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --position=412 - < $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --position=415 - < $MYSQLTEST_VARDIR/log/master-bin.000001 # Bug#16217 (mysql client did not know how not switch its internal charset) --disable_query_log diff --git a/mysql-test/t/rpl_switch_stm_row_mixed.test b/mysql-test/t/rpl_switch_stm_row_mixed.test index d345b62b8eb..24e1c17f59c 100644 --- a/mysql-test/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/t/rpl_switch_stm_row_mixed.test @@ -498,7 +498,7 @@ UNLOCK TABLES; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; sync_slave_with_master; # as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID @@ -515,7 +515,7 @@ sync_slave_with_master; connection master; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; # Now test that mysqlbinlog works fine on a binlog generated by the # mixed mode diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index 6615e48ca42..9f1c790847d 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -15,7 +15,7 @@ SET @var2=char(ascii('a')); insert into t1 values (@var1),(@var2); --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). diff --git a/sql/log_event.cc b/sql/log_event.cc index 4a6346bf57c..804c29724d5 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1000,7 +1000,8 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Execute_load_query_log_event(buf, event_len, description_event); break; default: - DBUG_PRINT("error",("Unknown evernt code: %d",(int) buf[EVENT_TYPE_OFFSET])); + DBUG_PRINT("error",("Unknown event code: %d", + (int) buf[EVENT_TYPE_OFFSET])); ev= NULL; break; } @@ -5449,19 +5450,19 @@ int Rows_log_event::do_add_row_data(byte *const row_data, SYNOPSIS unpack_row() - rli Relay log info - table Table to unpack into - colcnt Number of columns to read from record - record Record where the data should be unpacked - row Packed row data - cols Pointer to columns data to fill in - row_end Pointer to variable that will hold the value of the - one-after-end position for the row + rli Relay log info + table Table to unpack into + colcnt Number of columns to read from record + record Record where the data should be unpacked + row_data Packed row data + cols Pointer to columns data to fill in + row_end Pointer to variable that will hold the value of the + one-after-end position for the row master_reclength - Pointer to variable that will be set to the length of the - record on the master side - rw_set Pointer to bitmap that holds either the read_set or the - write_set of the table + Pointer to variable that will be set to the length of the + record on the master side + rw_set Pointer to bitmap that holds either the read_set or the + write_set of the table DESCRIPTION @@ -5484,62 +5485,78 @@ int Rows_log_event::do_add_row_data(byte *const row_data, static int unpack_row(RELAY_LOG_INFO *rli, TABLE *table, uint const colcnt, byte *record, - char const *row, MY_BITMAP const *cols, - char const **row_end, ulong *master_reclength, + char const *const row_data, MY_BITMAP const *cols, + char const **const row_end, ulong *const master_reclength, MY_BITMAP* const rw_set, Log_event_type const event_type) { - DBUG_ASSERT(record && row); + DBUG_ENTER("unpack_row"); + DBUG_ASSERT(record && row_data); my_ptrdiff_t const offset= record - (byte*) table->record[0]; - my_size_t master_null_bytes= table->s->null_bytes; - - if (colcnt != table->s->fields) - { - Field **fptr= &table->field[colcnt-1]; - do - master_null_bytes= (*fptr)->last_null_byte(); - while (master_null_bytes == Field::LAST_NULL_BYTE_UNDEF && - fptr-- > table->field); - - /* - If master_null_bytes is LAST_NULL_BYTE_UNDEF (0) at this time, - there were no nullable fields nor BIT fields at all in the - columns that are common to the master and the slave. In that - case, there is only one null byte holding the X bit. - - OBSERVE! There might still be nullable columns following the - common columns, so table->s->null_bytes might be greater than 1. - */ - if (master_null_bytes == Field::LAST_NULL_BYTE_UNDEF) - master_null_bytes= 1; - } - - DBUG_ASSERT(master_null_bytes <= table->s->null_bytes); - memcpy(record, row, master_null_bytes); // [1] + my_size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8; int error= 0; - bitmap_set_all(rw_set); + char const *null_ptr= row_data; + char const *pack_ptr= row_data + master_null_byte_count; + + bitmap_clear_all(rw_set); + + memcpy(record, table->s->default_values, table->s->null_bytes); Field **const begin_ptr = table->field; Field **field_ptr; - char const *ptr= row + master_null_bytes; Field **const end_ptr= begin_ptr + colcnt; + + DBUG_ASSERT(null_ptr < row_data + master_null_byte_count); + + // Mask to mask out the correct bit among the null bits + unsigned int null_mask= 1U; + // The "current" null bits + unsigned int null_bits= *null_ptr++; for (field_ptr= begin_ptr ; field_ptr < end_ptr ; ++field_ptr) { Field *const f= *field_ptr; if (bitmap_is_set(cols, field_ptr - begin_ptr)) { - f->move_field_offset(offset); - ptr= f->unpack(f->ptr, ptr); - f->move_field_offset(-offset); + if ((null_mask & 0xFF) == 0) + { + DBUG_ASSERT(null_ptr < row_data + master_null_byte_count); + null_mask= 1U; + null_bits= *null_ptr++; + } + + DBUG_ASSERT(null_mask & 0xFF); // One of the 8 LSB should be set + + /* Field...::unpack() cannot return 0 */ - DBUG_ASSERT(ptr != NULL); + DBUG_ASSERT(pack_ptr != NULL); + + if ((null_bits & null_mask) && f->maybe_null()) + f->set_null(offset); + else + { + f->set_notnull(offset); + + /* + We only unpack the field if it was non-null + */ + f->move_field_offset(offset); + pack_ptr= f->unpack(f->ptr, pack_ptr); + f->move_field_offset(-offset); + } + + bitmap_set_bit(rw_set, field_ptr - begin_ptr); + null_mask <<= 1; } - else - bitmap_clear_bit(rw_set, field_ptr - begin_ptr); } - *row_end = ptr; + /* + We should now have read all the null bytes, otherwise something is + really wrong. + */ + DBUG_ASSERT(null_ptr == row_data + master_null_byte_count); + + *row_end = pack_ptr; if (master_reclength) { if (*field_ptr) @@ -5563,10 +5580,6 @@ unpack_row(RELAY_LOG_INFO *rli, { uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG; - DBUG_PRINT("debug", ("flags = 0x%x, mask = 0x%x, flags & mask = 0x%x", - (*field_ptr)->flags, mask, - (*field_ptr)->flags & mask)); - if (event_type == WRITE_ROWS_EVENT && ((*field_ptr)->flags & mask) == mask) { @@ -5581,7 +5594,7 @@ unpack_row(RELAY_LOG_INFO *rli, (*field_ptr)->set_default(); } - return error; + DBUG_RETURN(error); } int Rows_log_event::exec_event(st_relay_log_info *rli) @@ -6740,6 +6753,8 @@ static int find_and_fetch_row(TABLE *table, byte *key) DBUG_ASSERT(table->in_use != NULL); + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) && table->s->primary_key < MAX_KEY) { @@ -6842,16 +6857,18 @@ static int find_and_fetch_row(TABLE *table, byte *key) /* Continue until we find the right record or have made a full loop */ do { + error= table->file->rnd_next(table->record[1]); + /* - We need to set the null bytes to ensure that the filler bit - are all set when returning. There are storage engines that - just set the necessary bits on the bytes and don't set the - filler bits correctly. + Patching the returned record since some storage engines do + not set the filler bits correctly. */ my_ptrdiff_t const pos= table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; - table->record[1][pos]= 0xFF; - error= table->file->rnd_next(table->record[1]); + table->record[1][pos]|= 256U - (1U << table->s->last_null_bit_pos); + + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + DBUG_DUMP("record[1]", table->record[1], table->s->reclength); switch (error) { diff --git a/sql/log_event.h b/sql/log_event.h index 81ce2f18b4d..93546ddba8a 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -442,10 +442,23 @@ enum Log_event_type XID_EVENT= 16, BEGIN_LOAD_QUERY_EVENT= 17, EXECUTE_LOAD_QUERY_EVENT= 18, + TABLE_MAP_EVENT = 19, - WRITE_ROWS_EVENT = 20, - UPDATE_ROWS_EVENT = 21, - DELETE_ROWS_EVENT = 22, + + /* + These event numbers were used for 5.1.0 to 5.1.15 and are + therefore obsolete. + */ + PRE_GA_WRITE_ROWS_EVENT = 20, + PRE_GA_UPDATE_ROWS_EVENT = 21, + PRE_GA_DELETE_ROWS_EVENT = 22, + + /* + These event numbers are used from 5.1.16 and forward + */ + WRITE_ROWS_EVENT = 23, + UPDATE_ROWS_EVENT = 24, + DELETE_ROWS_EVENT = 25, /* Add new events here - right above this comment! diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 3fd0e621422..00a68a3d30e 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2527,30 +2527,113 @@ my_size_t THD::max_row_length_blob(TABLE *table, const byte *data) const } -my_size_t THD::pack_row(TABLE *table, MY_BITMAP const* cols, byte *row_data, - const byte *record) const +/* + Pack a record of data for a table into a format suitable for + transfer via the binary log. + + SYNOPSIS + THD::pack_row() + table Table describing the format of the record + cols Bitmap with a set bit for each column that should be + stored in the row + row_data Pointer to memory where row will be written + record Pointer to record that should be packed. It is assumed + that the pointer refers to either record[0] or + record[1], but no such check is made since the code does + not rely on that. + + DESCRIPTION + + The format for a row in transfer with N fields is the following: + + ceil(N/8) null bytes: + One null bit for every column *regardless of whether it can be + null or not*. This simplifies the decoding. Observe that the + number of null bits is equal to the number of set bits in the + 'cols' bitmap. The number of null bytes is the smallest number + of bytes necessary to store the null bits. + + Padding bits are 1. + + N packets: + Each field is stored in packed format. + + + RETURN VALUE + + The number of bytes written at 'row_data'. + */ +my_size_t +THD::pack_row(TABLE *table, MY_BITMAP const* cols, + byte *const row_data, const byte *record) const { Field **p_field= table->field, *field; - int n_null_bytes= table->s->null_bytes; - byte *ptr; - uint i; + int const null_byte_count= (bitmap_bits_set(cols) + 7) / 8; + byte *pack_ptr = row_data + null_byte_count; + byte *null_ptr = row_data; my_ptrdiff_t const rec_offset= record - table->record[0]; my_ptrdiff_t const def_offset= table->s->default_values - table->record[0]; - memcpy(row_data, record, n_null_bytes); - ptr= row_data+n_null_bytes; - for (i= 0 ; (field= *p_field) ; i++, p_field++) + /* + We write the null bits and the packed records using one pass + through all the fields. The null bytes are written little-endian, + i.e., the first fields are in the first byte. + */ + unsigned int null_bits= (1U << 8) - 1; + // Mask to mask out the correct but among the null bits + unsigned int null_mask= 1U; + for ( ; (field= *p_field) ; p_field++) { - if (bitmap_is_set(cols,i)) + DBUG_PRINT("debug", ("null_mask=%d; null_ptr=%p; row_data=%p; null_byte_count=%d", + null_mask, null_ptr, row_data, null_byte_count)); + if (bitmap_is_set(cols, p_field - table->field)) { - my_ptrdiff_t const offset= - field->is_null(rec_offset) ? def_offset : rec_offset; - field->move_field_offset(offset); - ptr= (byte*)field->pack((char *) ptr, field->ptr); - field->move_field_offset(-offset); + my_ptrdiff_t offset; + if (field->is_null(rec_offset)) + { + offset= def_offset; + null_bits |= null_mask; + } + else + { + offset= rec_offset; + null_bits &= ~null_mask; + + /* + We only store the data of the field if it is non-null + */ + field->move_field_offset(offset); + pack_ptr= (byte*)field->pack((char *) pack_ptr, field->ptr); + field->move_field_offset(-offset); + } + + null_mask <<= 1; + if ((null_mask & 0xFF) == 0) + { + DBUG_ASSERT(null_ptr < row_data + null_byte_count); + null_mask = 1U; + *null_ptr++ = null_bits; + null_bits= (1U << 8) - 1; + } } } - return (static_cast(ptr - row_data)); + + /* + Write the last (partial) byte, if there is one + */ + if ((null_mask & 0xFF) > 1) + { + DBUG_ASSERT(null_ptr < row_data + null_byte_count); + *null_ptr++ = null_bits; + } + + /* + The null pointer should now point to the first byte of the + packed data. If it doesn't, something is very wrong. + */ + DBUG_ASSERT(null_ptr == row_data + null_byte_count); + + return static_cast(pack_ptr - row_data); } From 6a575c2a91ceb29ffdf14a524be02a6b05e321fd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 12:42:11 +0100 Subject: [PATCH 021/789] /usr/share/aclocal/mysql.m4 server-tools/CMakeLists.txt: Change mode to -rw-rw-r-- --- server-tools/CMakeLists.txt | 0 support-files/Makefile.am | 3 + support-files/mysql.m4 | 108 ++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) mode change 100755 => 100644 server-tools/CMakeLists.txt create mode 100644 support-files/mysql.m4 diff --git a/server-tools/CMakeLists.txt b/server-tools/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/support-files/Makefile.am b/support-files/Makefile.am index da8c25ccb1e..ce39b67ef5d 100644 --- a/support-files/Makefile.am +++ b/support-files/Makefile.am @@ -43,6 +43,9 @@ pkgdata_DATA = my-small.cnf \ pkgdata_SCRIPTS = mysql.server +aclocaldir = $(datadir)/aclocal +aclocal_DATA = mysql.m4 + noinst_DATA = mysql-@VERSION@.spec \ MySQL-shared-compat.spec diff --git a/support-files/mysql.m4 b/support-files/mysql.m4 new file mode 100644 index 00000000000..a440353c196 --- /dev/null +++ b/support-files/mysql.m4 @@ -0,0 +1,108 @@ +# Copyright (C) 2007 MySQL AB +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., 59 +# Temple Place, Suite 330, Boston, MA 02111-1307 USA + +AC_DEFUN([_MYSQL_CONFIG],[ + AC_ARG_WITH([mysql-config], + AS_HELP_STRING([--with-mysql-config=PATH], [A path to mysql_config script]), + [mysql_config="$withval"], [mysql_config=mysql_config]) +]) + +dnl +dnl Usage: +dnl +dnl MYSQL_CLIENT([version], [client|thread-safe|embedded]) +dnl +dnl Two optional arguments: +dnl first: The minimal version of the MySQL to use +dnl if not specified, any version will be accepted. +dnl The version should be specified as three numbers, +dnl without suffixes. E.g. 4.10.15 or 5.0.3 +dnl second: force the specified library flavor to be selected, +dnl if not specified, a user will be able to choose +dnl between client (non-thread-safe) and embedded +dnl +dnl On successful execution sets MYSQL_CLIENT_CFLAGS and +dnl MYSQL_CLIENT_LIBS shell variables and makes substitutions +dnl out of them (calls AC_SUBST) +dnl + +AC_DEFUN([MYSQL_CLIENT],[ + AC_REQUIRE([_MYSQL_CONFIG]) + AC_MSG_CHECKING([for MySQL]) + ifelse([$2], [client], + [mysql_libs=--libs mysql_cflags=--cflags], + [$2], [thread-safe], + [mysql_libs=--libs_r mysql_cflags=--cflags], + [$2], [embedded], + [mysql_libs=--libmysqld-libs mysql_cflags=--cflags], + [$2], [], [ + AC_ARG_WITH([mysql-library], + AS_HELP_STRING([--with-mysql-library], ['client' or 'embedded']), + [mysql_lib="$withval"], [mysql_lib=client]) +[ + case "$mysql_lib" in + client) mysql_libs=--libs mysql_cflags=--cflags ;; + embedded) mysql_libs=--libmysqld-libs mysql_cflags=--cflags ;; + *) ]AC_MSG_ERROR([Bad value for --with-mysql-library])[ + esac +] + ], + [AC_FATAL([Bad second (library flavor) argument to MYSQL_CLIENT])]) +[ + mysql_version=`$mysql_config --version` + if test -z "$mysql_version" ; then + ]AC_MSG_ERROR([Cannot execute $mysql_config])[ + fi +] + ifelse([$1], [], [], [ + ifelse(regexp([$1], [^[0-9][0-9]?\.[0-9][0-9]?\.[0-9][0-9]?$]), -1, + [AC_FATAL([Bad first (version) argument to MYSQL_CLIENT])], [ +dnl +dnl Transformation below works as follows: +dnl assume, we have a number 1.2.3-beta +dnl *a* line removes the suffix and adds first and last dot to the version: +dnl .1.2.3. +dnl *b* line adds a 0 to a "single digit surrounded by dots" +dnl .01.2.03. +dnl note that the pattern that matched .1. has eaten the dot for .2. +dnl and 2 still has no 0 +dnl *c* we repeat the same replacement as in *b*, matching .2. this time +dnl .01.02.03. +dnl the last replacement removes all dots +dnl 010203 +dnl giving us a number we can compare with +dnl + mysql_ver=`echo ${mysql_version}|dnl + sed 's/[[-a-z]].*//; s/.*/.&./;dnl *a* + s/\.\([[0-9]]\)\./.0\1./g;dnl *b* + s/\.\([[0-9]]\)\./.0\1./g;dnl *c* + s/\.//g'` + if test "$mysql_ver" -lt]dnl +dnl the same as sed transformation above, without suffix-stripping, in m4 + patsubst(patsubst(patsubst(.[$1]., [\.\([0-9]\)\.], [.0\1.]), [\.\([0-9]\)\.], [.0\1.]), [\.], [])[ ; then + AC_MSG_ERROR([MySQL version $mysql_version is too low, minimum of $1 is required]) + fi + ])]) + + MYSQL_CLIENT_CFLAGS=`$mysql_config $mysql_cflags` + MYSQL_CLIENT_LIBS=`$mysql_config $mysql_libs` + AC_SUBST(MYSQL_CLIENT_CFLAGS) + AC_SUBST(MYSQL_CLIENT_LIBS) + + # should we try to build a test program ? + + AC_MSG_RESULT([$mysql_version]) +]) + From 35f79a6f5d30bbfa5d7abdd6e5bc096ab2dbaa90 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Feb 2007 16:52:23 +0800 Subject: [PATCH 022/789] BUG#21715 mgm client command status return version(0.0.0.0) ndb/src/mgmclient/CommandInterpreter.cpp: Adding the judgement for node type to distinguish the data nodes and non-data nodes. From the return value. Management client can't distinguish the really not connected status for data nodes and status of non-data nodes. We can get the connect status about non-data nodes from version, if the version is 0, it means no connected status. --- ndb/src/mgmclient/CommandInterpreter.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 65d5b038707..e38c1109077 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1627,6 +1627,19 @@ CommandInterpreter::executeStatus(int processId, ndbout << processId << ": Node not found" << endl; return -1; } + if (cl->node_states[i].node_type != NDB_MGM_NODE_TYPE_NDB){ + if (cl->node_states[i].version != 0){ + version = cl->node_states[i].version; + ndbout << "Node "<< cl->node_states[i].node_id <<": connected" ; + ndbout_c(" (Version %d.%d.%d)", + getMajor(version) , + getMinor(version), + getBuild(version)); + + }else + ndbout << "Node "<< cl->node_states[i].node_id <<": not connected" << endl; + return 0; + } status = cl->node_states[i].node_status; startPhase = cl->node_states[i].start_phase; version = cl->node_states[i].version; From 4957c80827e8f1ecb0544c4fb8d2f7e95962e349 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Feb 2007 19:18:09 +0100 Subject: [PATCH 023/789] after merge --- sql/opt_range.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 6eb7d927ed6..f87439dd3eb 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -8195,7 +8195,7 @@ int QUICK_RANGE_SELECT::get_next() */ end_key->flag= (last_range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); - end_key->keypart_map= range->max_keypart_map; + end_key->keypart_map= last_range->max_keypart_map; mrange_slot->range_flag= last_range->flag; } From b3a28c0883c7dd967a47d133becb9dc8e75ed522 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Feb 2007 09:12:07 +0100 Subject: [PATCH 024/789] Bug#25460 - High concurrency MyISAM access causes severe mysqld crash. Decreased code duplication by calling memory mapping function through mi_extra(). --- storage/myisam/mi_open.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 830332fe0c1..a06b21ee5b4 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -506,22 +506,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) share->data_file_type = DYNAMIC_RECORD; my_afree((gptr) disk_cache); mi_setup_functions(share); - if (open_flags & HA_OPEN_MMAP) - { - info.s= share; - if (mi_dynmap_file(&info, share->state.state.data_file_length)) - { - /* purecov: begin inspected */ - /* Ignore if mmap fails. Use file I/O instead. */ - DBUG_PRINT("warning", ("mmap failed: errno: %d", errno)); - /* purecov: end */ - } - else - { - share->file_read= mi_mmap_pread; - share->file_write= mi_mmap_pwrite; - } - } share->is_log_table= FALSE; #ifdef THREAD thr_lock_init(&share->lock); @@ -552,6 +536,14 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) } } #endif + /* + Memory mapping can only be requested after initializing intern_lock. + */ + if (open_flags & HA_OPEN_MMAP) + { + info.s= share; + mi_extra(&info, HA_EXTRA_MMAP, 0); + } } else { From 4e4152c56f70367a98717f2329ca1b8be39c2eb0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Feb 2007 18:49:41 +0200 Subject: [PATCH 025/789] Bug #26186: When handling DELETE ... FROM if there is no condition it is internally transformed to TRUNCATE for more efficient execution by the storage handler. The check for validity of the optional ORDER BY clause is done after the check for the above optimization and will not be performed if the optimization can be applied. Moved the validity check for ORDER BY before the optimization so it performed regardless of the optimization. mysql-test/r/delete.result: Bug #26186: test case mysql-test/t/delete.test: Bug #26186: test case sql/sql_delete.cc: Bug #26186: do validity check of the ORDER BY before deciding to skip it. --- mysql-test/r/delete.result | 9 +++++++++ mysql-test/t/delete.test | 18 ++++++++++++++++++ sql/sql_delete.cc | 37 +++++++++++++++++++++---------------- 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index ba4e9386312..4bdf1c770d3 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -214,3 +214,12 @@ select count(*) from t1; count(*) 0 drop table t1; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +DELETE FROM t1 ORDER BY x; +ERROR 42S22: Unknown column 'x' in 'order clause' +DELETE FROM t1 ORDER BY t2.x; +ERROR 42S22: Unknown column 't2.x' in 'order clause' +DELETE FROM t1 ORDER BY (SELECT x); +ERROR 42S22: Unknown column 'x' in 'field list' +DROP TABLE t1; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 306447dbd5a..36d627209db 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -203,3 +203,21 @@ select * from t1 where a is null; delete from t1 where a is null; select count(*) from t1; drop table t1; + +# +# Bug #26186: delete order by, sometimes accept unknown column +# +CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); + +--error ER_BAD_FIELD_ERROR +DELETE FROM t1 ORDER BY x; + +# even columns from a table not used in query (and not even existing) +--error ER_BAD_FIELD_ERROR +DELETE FROM t1 ORDER BY t2.x; + +# subquery (as long as the subquery from is valid or DUAL) +--error ER_BAD_FIELD_ERROR +DELETE FROM t1 ORDER BY (SELECT x); + +DROP TABLE t1; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 749ee04493b..e4b013ef088 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -60,6 +60,27 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, if (mysql_prepare_delete(thd, table_list, &conds)) DBUG_RETURN(TRUE); + /* check ORDER BY even if it can be ignored */ + if (order && order->elements) + { + TABLE_LIST tables; + List fields; + List all_fields; + + bzero((char*) &tables,sizeof(tables)); + tables.table = table; + tables.alias = table_list->alias; + + if (select_lex->setup_ref_array(thd, order->elements) || + setup_order(thd, select_lex->ref_pointer_array, &tables, + fields, all_fields, (ORDER*) order->first)) + { + delete select; + free_underlaid_joins(thd, &thd->lex->select_lex); + DBUG_RETURN(TRUE); + } + } + const_cond= (!conds || conds->const_item()); safe_update=test(thd->options & OPTION_SAFE_UPDATES); if (safe_update && const_cond) @@ -148,23 +169,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, { uint length= 0; SORT_FIELD *sortorder; - TABLE_LIST tables; - List fields; - List all_fields; ha_rows examined_rows; - - bzero((char*) &tables,sizeof(tables)); - tables.table = table; - tables.alias = table_list->alias; - - if (select_lex->setup_ref_array(thd, order->elements) || - setup_order(thd, select_lex->ref_pointer_array, &tables, - fields, all_fields, (ORDER*) order->first)) - { - delete select; - free_underlaid_joins(thd, &thd->lex->select_lex); - DBUG_RETURN(TRUE); - } if ((!select || table->quick_keys.is_clear_all()) && limit != HA_POS_ERROR) usable_index= get_index_for_order(table, (ORDER*)(order->first), limit); From d9dbd4caf4d8c53a4e66037fcd344e5c9b7d4f64 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Feb 2007 14:27:19 +0400 Subject: [PATCH 026/789] BUG#26080 - Memory Storage engine not working properly Extending varchar column length with ALTER TABLE may result in unusable memory table. The problem is that we use fast ALTER TABLE in this case, which is not supported by now. This is fixed by refusing fast ALTER TABLE when extending varchar column. In other words force copy of a table during ALTER TABLE. Affects MEMORY tables in 5.1 only. mysql-test/r/heap.result: A test case for BUG#26080. mysql-test/t/heap.test: A test case for BUG#26080. storage/heap/ha_heap.cc: For MEMORY, if varchar column extended, it should return incompatible for now. In other words force copy of a table during alter table. --- mysql-test/r/heap.result | 7 +++++++ mysql-test/t/heap.test | 9 +++++++++ storage/heap/ha_heap.cc | 7 ++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 29bdfcbef7a..ddf675e2f73 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -731,3 +731,10 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); COUNT(*) 2 DROP TABLE t1; +CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY; +INSERT INTO t1 VALUES('', 0); +ALTER TABLE t1 MODIFY c1 VARCHAR(101); +SELECT c2 FROM t1; +c2 +0 +DROP TABLE t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 624597cd8d7..b47a5fc2033 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -471,3 +471,12 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); DROP TABLE t1; # End of 5.0 tests + +# +# BUG#26080 - Memory Storage engine not working properly +# +CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY; +INSERT INTO t1 VALUES('', 0); +ALTER TABLE t1 MODIFY c1 VARCHAR(101); +SELECT c2 FROM t1; +DROP TABLE t1; diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index cf11c9923eb..f2caa7e6d18 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -703,9 +703,10 @@ bool ha_heap::check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes) { /* Check that auto_increment value was not changed */ - if ((table_changes != IS_EQUAL_YES && - info->used_fields & HA_CREATE_USED_AUTO) && - info->auto_increment_value != 0) + if ((info->used_fields & HA_CREATE_USED_AUTO && + info->auto_increment_value != 0) || + table_changes == IS_EQUAL_NO || + table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet return COMPATIBLE_DATA_NO; return COMPATIBLE_DATA_YES; } From af44be2d25e25189363044265089fab391e060d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Feb 2007 18:34:35 +0400 Subject: [PATCH 027/789] BUG#26238 - inserted delayed always inserts 0 for BIT columns INSERT DELAYED inserts garbage for BIT columns. When delayed thread clones TABLE object, it didn't adjusted bit_ptr to newly created record (though it correctly adjusts ptr and null_ptr). This is fixed by correctly adjusting bit_ptr when performing a clone. With this fix BIT values are stored correctly by INSERT DELAYED. mysql-test/r/delayed.result: A test case for BUG#26238. mysql-test/t/delayed.test: A test case for BUG#26238. sql/field.h: Added move_field() to Field_bit class. When moving a field, adjust bit_ptr also, which is specific to Field_bit class. --- mysql-test/r/delayed.result | 7 +++++++ mysql-test/t/delayed.test | 8 ++++++++ sql/field.h | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 6295fceec2b..82a308c63e7 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -243,3 +243,10 @@ SET @@session.auto_increment_offset= @bug20830_old_session_auto_increment_offset; SET @@session.auto_increment_increment= @bug20830_old_session_auto_increment_increment; +CREATE TABLE t1(a BIT); +INSERT DELAYED INTO t1 VALUES(1); +FLUSH TABLE t1; +SELECT HEX(a) FROM t1; +HEX(a) +1 +DROP TABLE t1; diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index fe8bc167e0f..773927f6015 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -234,3 +234,11 @@ SET @@session.auto_increment_offset= SET @@session.auto_increment_increment= @bug20830_old_session_auto_increment_increment; +# +# BUG#26238 - inserted delayed always inserts 0 for BIT columns +# +CREATE TABLE t1(a BIT); +INSERT DELAYED INTO t1 VALUES(1); +FLUSH TABLE t1; +SELECT HEX(a) FROM t1; +DROP TABLE t1; diff --git a/sql/field.h b/sql/field.h index fe3c59c89f5..d46f5f699af 100644 --- a/sql/field.h +++ b/sql/field.h @@ -225,7 +225,7 @@ public: ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg; } inline void move_field(char *ptr_arg) { ptr=ptr_arg; } - inline void move_field(my_ptrdiff_t ptr_diff) + virtual inline void move_field(my_ptrdiff_t ptr_diff) { ptr=ADD_TO_PTR(ptr,ptr_diff,char*); if (null_ptr) @@ -1407,6 +1407,11 @@ public: Field *new_key_field(MEM_ROOT *root, struct st_table *new_table, char *new_ptr, uchar *new_null_ptr, uint new_null_bit); + inline void move_field(my_ptrdiff_t ptr_diff) + { + Field::move_field(ptr_diff); + bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*); + } void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg) { bit_ptr= bit_ptr_arg; From b2490bc2f56c73fa2a08eb53298a28afa7aef730 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Feb 2007 19:37:31 +0100 Subject: [PATCH 028/789] Update version to 5.2.0-alpha - new 5.2 tree storage/ndb/src/common/util/version.c: Add version 5.2 to ndbCompatibleTable_full configure.in: Set version number to 5.2.0-alpha --- configure.in | 2 +- storage/ndb/src/common/util/version.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9581b5ac46a..a62a950a288 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.1.17-beta) +AM_INIT_AUTOMAKE(mysql, 5.2.0-alpha) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/storage/ndb/src/common/util/version.c b/storage/ndb/src/common/util/version.c index b2ebb87c144..9f35b04173e 100644 --- a/storage/ndb/src/common/util/version.c +++ b/storage/ndb/src/common/util/version.c @@ -91,6 +91,7 @@ void ndbSetOwnVersion() {} #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { + { MAKE_VERSION(5,2,NDB_VERSION_BUILD), MAKE_VERSION(5,2,0), UG_Range}, { MAKE_VERSION(5,1,NDB_VERSION_BUILD), MAKE_VERSION(5,1,0), UG_Range}, { MAKE_VERSION(5,0,NDB_VERSION_BUILD), MAKE_VERSION(5,0,12), UG_Range}, { MAKE_VERSION(5,0,11), MAKE_VERSION(5,0,2), UG_Range}, From 3a6ee28ef454640b4e9cb244060bb16548458712 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 15:13:33 +0800 Subject: [PATCH 029/789] correct NAND/NOR scan operations, and add a test case for it. ndb/src/ndbapi/NdbScanFilter.cpp: translate NAND/NOR into AND/OR, since AND/OR operations are all correct ndb/test/include/NDBT_Test.hpp: add a new method executeOneCtx() in class NDBT_TestSuite, declare it ndb/test/ndbapi/Makefile.am: Add a new test case: testScanFIlter.cpp to test/ndbapi/, thus modify the Makefile.am related to it ndb/test/src/NDBT_Test.cpp: add a new method in class NDBT_TestSuite in order to adapt to some customized test cases, because the default NDBT's test talbes and flow are fixed, if just modify related existing methods, it will influence other test cases in test/ndbapi/ ndb/test/ndbapi/testScanFilter.cpp: It's a test case for ndbapi scan filter, test for AND/OR/NAND/NOR scan operations. --- ndb/src/ndbapi/NdbScanFilter.cpp | 46 +- ndb/test/include/NDBT_Test.hpp | 6 + ndb/test/ndbapi/Makefile.am | 2 + ndb/test/ndbapi/testScanFilter.cpp | 851 +++++++++++++++++++++++++++++ ndb/test/src/NDBT_Test.cpp | 57 ++ 5 files changed, 961 insertions(+), 1 deletion(-) create mode 100644 ndb/test/ndbapi/testScanFilter.cpp diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index 2e9e338d5aa..bec039b3eea 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -41,7 +41,9 @@ public: int m_label; State m_current; + Uint32 m_negative; //used for translating NAND/NOR to AND/OR, equal 0 or 1 Vector m_stack; + Vector m_stack2; //to store info of m_negative NdbOperation * m_operation; Uint32 m_latestAttrib; @@ -65,6 +67,7 @@ NdbScanFilter::NdbScanFilter(class NdbOperation * op) m_impl.m_label = 0; m_impl.m_latestAttrib = ~0; m_impl.m_operation = op; + m_impl.m_negative = 0; } NdbScanFilter::~NdbScanFilter(){ @@ -74,18 +77,39 @@ NdbScanFilter::~NdbScanFilter(){ int NdbScanFilter::begin(Group group){ + m_impl.m_stack2.push_back(m_impl.m_negative); switch(group){ case NdbScanFilter::AND: INT_DEBUG(("Begin(AND)")); + if(m_impl.m_negative == 1){ + group = NdbScanFilter::OR; + } break; case NdbScanFilter::OR: INT_DEBUG(("Begin(OR)")); + if(m_impl.m_negative == 1){ + group = NdbScanFilter::AND; + } break; case NdbScanFilter::NAND: INT_DEBUG(("Begin(NAND)")); + if(m_impl.m_negative == 0){ + group = NdbScanFilter::OR; + m_impl.m_negative = 1; + }else{ + group = NdbScanFilter::AND; + m_impl.m_negative = 0; + } break; case NdbScanFilter::NOR: INT_DEBUG(("Begin(NOR)")); + if(m_impl.m_negative == 0){ + group = NdbScanFilter::AND; + m_impl.m_negative = 1; + }else{ + group = NdbScanFilter::OR; + m_impl.m_negative = 0; + } break; } @@ -129,6 +153,13 @@ NdbScanFilter::begin(Group group){ int NdbScanFilter::end(){ + if(m_impl.m_stack2.size() == 0){ + m_impl.m_operation->setErrorCodeAbort(4259); + return -1; + } + m_impl.m_negative = m_impl.m_stack2.back(); + m_impl.m_stack2.erase(m_impl.m_stack2.size() - 1); + switch(m_impl.m_current.m_group){ case NdbScanFilter::AND: INT_DEBUG(("End(AND pc=%d)", m_impl.m_current.m_popCount)); @@ -150,6 +181,10 @@ NdbScanFilter::end(){ } NdbScanFilterImpl::State tmp = m_impl.m_current; + if(m_impl.m_stack.size() == 0){ + m_impl.m_operation->setErrorCodeAbort(4259); + return -1; + } m_impl.m_current = m_impl.m_stack.back(); m_impl.m_stack.erase(m_impl.m_stack.size() - 1); @@ -394,8 +429,17 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, m_operation->setErrorCodeAbort(4260); return -1; } + + StrBranch2 branch; + if(m_negative == 1){ //change NdbOperation to its negative + if(m_current.m_group == NdbScanFilter::AND) + branch = table3[op].m_branches[(Uint32)(m_current.m_group) + 1]; + if(m_current.m_group == NdbScanFilter::OR) + branch = table3[op].m_branches[(Uint32)(m_current.m_group) - 1]; + }else{ + branch = table3[op].m_branches[(Uint32)(m_current.m_group)]; + } - StrBranch2 branch = table3[op].m_branches[m_current.m_group]; const NdbDictionary::Column * col = m_operation->m_currentTable->getColumn(AttrId); diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index c102c569933..e476a1a0759 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -325,6 +325,12 @@ public: // supply argc and argv as parameters int execute(int, const char**); + // NDBT's test tables are fixed and it always create + // and drop fixed table when execute, add this method + // in order to run CTX only and adapt to some new + // customized testsuite + int executeOneCtx(Ndb_cluster_connection&, + const NdbDictionary::Table* ptab, const char* testname = NULL); // These function can be used from main in the test program // to control the behaviour of the testsuite diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 4766e6b83b3..9019d71ada2 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -39,6 +39,7 @@ testOperations \ testRestartGci \ testScan \ testInterpreter \ +testScanFilter \ testScanInterpreter \ testScanPerf \ testSystemRestart \ @@ -83,6 +84,7 @@ testOperations_SOURCES = testOperations.cpp testRestartGci_SOURCES = testRestartGci.cpp testScan_SOURCES = testScan.cpp ScanFunctions.hpp testInterpreter_SOURCES = testInterpreter.cpp +testScanFilter_SOURCES = testScanFilter.cpp testScanInterpreter_SOURCES = testScanInterpreter.cpp ScanFilter.hpp ScanInterpretTest.hpp testScanPerf_SOURCES = testScanPerf.cpp testSystemRestart_SOURCES = testSystemRestart.cpp diff --git a/ndb/test/ndbapi/testScanFilter.cpp b/ndb/test/ndbapi/testScanFilter.cpp new file mode 100644 index 00000000000..e195c04bd93 --- /dev/null +++ b/ndb/test/ndbapi/testScanFilter.cpp @@ -0,0 +1,851 @@ +/* Copyright (C) 2007, Justin He, MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +#define ERR_EXIT(obj, msg) \ +do \ +{ \ +fprintf(stderr, "%s: %s (%d) in %s:%d\n", \ +msg, obj->getNdbError().message, obj->getNdbError().code, __FILE__, __LINE__); \ +exit(-1); \ +} \ +while (0); + +#define PRINT_ERROR(code,msg) \ +do \ +{ \ +fprintf(stderr, "Error in %s, line: %d, code: %d, msg: %s.\n", __FILE__, __LINE__, code, msg); \ +} \ +while (0); + +#define MYSQLERROR(mysql) { \ + PRINT_ERROR(mysql_errno(&mysql),mysql_error(&mysql)); \ + exit(-1); } +#define APIERROR(error) { \ + PRINT_ERROR(error.code,error.message); \ + exit(-1); } + +#define TEST_NAME "TestScanFilter" +#define TABLE_NAME "TABLE_SCAN" + +const char *COL_NAME[] = {"id", "i", "j", "k", "l", "m", "n"}; +const char COL_LEN = 7; +/* +* Not to change TUPLE_NUM, because the column in TABLE_NAME is fixed, +* there are six columns, 'i', 'j', 'k', 'l', 'm', 'n', and each on is equal to 1 or 1, +* Since each tuple should be unique in this case, then TUPLE_NUM = 2 power 6 = 64 +*/ +const int TUPLE_NUM = (int)pow(2, COL_LEN-1); + +/* +* the recursive level of random scan filter, can +* modify this parameter more or less, range from +* 1 to 100, larger num consumes more scan time +*/ +const int RECURSIVE_LEVEL = 10; + +const int MAX_STR_LEN = (RECURSIVE_LEVEL * (COL_LEN+1) * 4); + +/* +* Each time stands for one test, it will produce a random +* filter string, and scan through ndb api and through +* calculation with tuples' data, then compare the result, +* if they are equal, this test passed, or failed. +* Only all TEST_NUM times tests passed, we can believe +* the suite of test cases are okay. +* Change TEST_NUM to larger will need more time to test +*/ +const int TEST_NUM = 5000; + + +/* Table definition*/ +static +const +NDBT_Attribute MYTAB1Attribs[] = { + NDBT_Attribute("id", NdbDictionary::Column::Unsigned, 1, true), + NDBT_Attribute("i", NdbDictionary::Column::Unsigned), + NDBT_Attribute("j", NdbDictionary::Column::Unsigned), + NDBT_Attribute("k", NdbDictionary::Column::Unsigned), + NDBT_Attribute("l", NdbDictionary::Column::Unsigned), + NDBT_Attribute("m", NdbDictionary::Column::Unsigned), + NDBT_Attribute("n", NdbDictionary::Column::Unsigned), +}; +static +const +NDBT_Table MYTAB1(TABLE_NAME, sizeof(MYTAB1Attribs)/sizeof(NDBT_Attribute), MYTAB1Attribs); + + +int createTable(Ndb* pNdb, const NdbDictionary::Table* tab, bool _temp, + bool existsOk, NDBT_CreateTableHook f) +{ + int r = 0; + do{ + NdbDictionary::Table tmpTab(* tab); + tmpTab.setStoredTable(_temp ? 0 : 1); + if(f != 0 && f(pNdb, tmpTab, 0)) + { + ndbout << "Failed to create table" << endl; + return NDBT_FAILED; + } + r = pNdb->getDictionary()->createTable(tmpTab); + if(r == -1){ + if(!existsOk){ + ndbout << "Error: " << pNdb->getDictionary()->getNdbError() << endl; + break; + } + if(pNdb->getDictionary()->getNdbError().code != 721){ + ndbout << "Error: " << pNdb->getDictionary()->getNdbError() << endl; + break; + } + r = 0; + } + }while(false); + + return r; +} + +/* +* Function to produce the tuples' data +*/ +int runPopulate(NDBT_Context* ctx, NDBT_Step* step) +{ + Ndb *myNdb = GETNDB(step); + const NdbDictionary::Dictionary* myDict= myNdb->getDictionary(); + const NdbDictionary::Table *myTable= myDict->getTable(TABLE_NAME); + if(myTable == NULL) + APIERROR(myDict->getNdbError()); + + NdbTransaction* myTrans = myNdb->startTransaction(); + if (myTrans == NULL) + APIERROR(myNdb->getNdbError()); + + for(int num = 0; num < TUPLE_NUM; num++) + { + NdbOperation* myNdbOperation = myTrans->getNdbOperation(myTable); + if(myNdbOperation == NULL) + { + APIERROR(myTrans->getNdbError()); + } + +/* the tuples' data in TABLE_NAME ++----+---+---+---+---+---+---+ +| id | i | j | k | l | m | n | ++----+---+---+---+---+---+---+ +| 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| 1 | 0 | 0 | 0 | 0 | 0 | 1 | +| 2 | 0 | 0 | 0 | 0 | 1 | 0 | +| 3 | 0 | 0 | 0 | 0 | 1 | 1 | +| 4 | 0 | 0 | 0 | 1 | 0 | 0 | +| 5 | 0 | 0 | 0 | 1 | 0 | 1 | +| 6 | 0 | 0 | 0 | 1 | 1 | 0 | +| 7 | 0 | 0 | 0 | 1 | 1 | 1 | +| 8 | 0 | 0 | 1 | 0 | 0 | 0 | +| 9 | 0 | 0 | 1 | 0 | 0 | 1 | +| 10 | 0 | 0 | 1 | 0 | 1 | 0 | +| 11 | 0 | 0 | 1 | 0 | 1 | 1 | +| 12 | 0 | 0 | 1 | 1 | 0 | 0 | +| 13 | 0 | 0 | 1 | 1 | 0 | 1 | +| 14 | 0 | 0 | 1 | 1 | 1 | 0 | +| 15 | 0 | 0 | 1 | 1 | 1 | 1 | +| 16 | 0 | 1 | 0 | 0 | 0 | 0 | +| 17 | 0 | 1 | 0 | 0 | 0 | 1 | +| 18 | 0 | 1 | 0 | 0 | 1 | 0 | +| 19 | 0 | 1 | 0 | 0 | 1 | 1 | +| 20 | 0 | 1 | 0 | 1 | 0 | 0 | +| 21 | 0 | 1 | 0 | 1 | 0 | 1 | +| 22 | 0 | 1 | 0 | 1 | 1 | 0 | +| 23 | 0 | 1 | 0 | 1 | 1 | 1 | +| 24 | 0 | 1 | 1 | 0 | 0 | 0 | +| 25 | 0 | 1 | 1 | 0 | 0 | 1 | +| 26 | 0 | 1 | 1 | 0 | 1 | 0 | +| 27 | 0 | 1 | 1 | 0 | 1 | 1 | +| 28 | 0 | 1 | 1 | 1 | 0 | 0 | +| 29 | 0 | 1 | 1 | 1 | 0 | 1 | +| 30 | 0 | 1 | 1 | 1 | 1 | 0 | +| 31 | 0 | 1 | 1 | 1 | 1 | 1 | +| 32 | 1 | 0 | 0 | 0 | 0 | 0 | +| 33 | 1 | 0 | 0 | 0 | 0 | 1 | +| 34 | 1 | 0 | 0 | 0 | 1 | 0 | +| 35 | 1 | 0 | 0 | 0 | 1 | 1 | +| 36 | 1 | 0 | 0 | 1 | 0 | 0 | +| 37 | 1 | 0 | 0 | 1 | 0 | 1 | +| 38 | 1 | 0 | 0 | 1 | 1 | 0 | +| 39 | 1 | 0 | 0 | 1 | 1 | 1 | +| 40 | 1 | 0 | 1 | 0 | 0 | 0 | +| 41 | 1 | 0 | 1 | 0 | 0 | 1 | +| 42 | 1 | 0 | 1 | 0 | 1 | 0 | +| 43 | 1 | 0 | 1 | 0 | 1 | 1 | +| 44 | 1 | 0 | 1 | 1 | 0 | 0 | +| 45 | 1 | 0 | 1 | 1 | 0 | 1 | +| 46 | 1 | 0 | 1 | 1 | 1 | 0 | +| 47 | 1 | 0 | 1 | 1 | 1 | 1 | +| 48 | 1 | 1 | 0 | 0 | 0 | 0 | +| 49 | 1 | 1 | 0 | 0 | 0 | 1 | +| 50 | 1 | 1 | 0 | 0 | 1 | 0 | +| 51 | 1 | 1 | 0 | 0 | 1 | 1 | +| 52 | 1 | 1 | 0 | 1 | 0 | 0 | +| 53 | 1 | 1 | 0 | 1 | 0 | 1 | +| 54 | 1 | 1 | 0 | 1 | 1 | 0 | +| 55 | 1 | 1 | 0 | 1 | 1 | 1 | +| 56 | 1 | 1 | 1 | 0 | 0 | 0 | +| 57 | 1 | 1 | 1 | 0 | 0 | 1 | +| 58 | 1 | 1 | 1 | 0 | 1 | 0 | +| 59 | 1 | 1 | 1 | 0 | 1 | 1 | +| 60 | 1 | 1 | 1 | 1 | 0 | 0 | +| 61 | 1 | 1 | 1 | 1 | 0 | 1 | +| 62 | 1 | 1 | 1 | 1 | 1 | 0 | +| 63 | 1 | 1 | 1 | 1 | 1 | 1 | ++----+---+---+---+---+---+---+ +*/ + myNdbOperation->insertTuple(); + myNdbOperation->equal(COL_NAME[0], num); + for(int col = 1; col < COL_LEN; col++) + { + myNdbOperation->setValue(COL_NAME[col], (num>>(COL_LEN-1-col))&1); + } + } + + int check = myTrans->execute(NdbTransaction::Commit); + + myTrans->close(); + + if (check == -1) + return NDBT_FAILED; + else + return NDBT_OK; + +} + + + +/* +* a=AND, o=OR, A=NAND, O=NOR +*/ +char op_string[] = "aoAO"; +/* +* the six columns' name of test table +*/ +char col_string[] = "ijklmn"; +const int op_len = strlen(op_string); +const int col_len = strlen(col_string); + +/* +* get a random op from "aoAO" +*/ +int get_rand_op_ch(char *ch) +{ + static unsigned int num = 0; + if(++num == 0) + num = 1; + srand(num*time(NULL)); + *ch = op_string[rand() % op_len]; + return 1; +} + +/* +* get a random order form of "ijklmn" trough exchanging letter +*/ +void change_col_order() +{ + int pos1,pos2; + char temp; + for (int i = 0; i < 10; i++) //exchange for 10 times + { + srand(time(NULL)/(i+1)); + pos1 = rand() % col_len; + srand((i+1)*time(NULL)); + pos2 = rand() % col_len; + if (pos1 == pos2) + continue; + temp = col_string[pos1]; + col_string[pos1] = col_string[pos2]; + col_string[pos2] = temp; + } +} + +/* +* get a random sub string of "ijklmn" +*/ +int get_rand_col_str(char *str) +{ + int len; + static unsigned int num = 0; + if(++num == 0) + num = 1; + srand(num*time(NULL)); + len = rand() % col_len + 1; + change_col_order(); + snprintf(str, len+1, "%s", col_string); //len+1, including '\0' + return len; +} + +/* +* get a random string including operation and column +* eg, Alnikx +*/ +int get_rand_op_str(char *str) +{ + char temp[256]; + int len1, len2, len; + len1 = get_rand_op_ch(temp); + len2 = get_rand_col_str(temp+len1); + len = len1 + len2; + temp[len] = 'x'; + snprintf(str, len+1+1, "%s", temp); //len+1, including '\0' + return len+1; +} + +/* +* replace a letter of source string with a new string +* e.g., source string: 'Aijkx', replace i with new string 'olmx' +* then source string is changed to 'Aolmxjkx' +* source: its format should be produced from get_rand_op_str() +* pos: range from 1 to strlen(source)-2 +*/ +int replace_a_to_str(char *source, int pos, char *newstr) +{ + char temp[MAX_STR_LEN]; + snprintf(temp, pos+1, "%s", source); + snprintf(temp+pos, strlen(newstr)+1, "%s", newstr); + snprintf(temp+pos+strlen(newstr), strlen(source)-pos, "%s", source+pos+1); + snprintf(source, strlen(temp)+1, "%s", temp); + return strlen(source); +} + +/* +* check whether the inputed char is an operation +*/ +bool check_op(char ch) +{ + if( ch == 'a' || ch == 'A' || ch == 'o' || ch == 'O') + return true; + else + return false; +} + +/* +* check whether the inputed char is end flag +*/ +bool check_end(char ch) +{ + return (ch == 'x'); +} + +/* +* check whether the inputed char is end flag +*/ +bool check_col(char ch) +{ + if( ch == 'i' || ch == 'j' || ch == 'k' + || ch == 'l' || ch == 'm' || ch == 'n' ) + return true; + else + return false; +} + +/* +* To ensure we can get a random string with RECURSIVE_LEVEL, +* we need a position where can replace a letter with a new string. +*/ +int get_rand_replace_pos(char *str, int len) +{ + int pos_op = 0; + int pos_x = 0; + int pos_col = 0; + int span = 0; + static int num = 0; + char temp; + + for(int i = 0; i < len; i++) + { + temp = str[i]; + if(! check_end(temp)) + { + if(check_op(temp)) + pos_op = i; + } + else + { + pos_x = i; + break; + } + } + + if(++num == 0) + num = 1; + + span = pos_x - pos_op - 1; + if(span <= 1) + { + pos_col = pos_op + 1; + } + else + { + srand(num*time(NULL)); + pos_col = pos_op + rand() % span + 1; + } + return pos_col; +} + +/* +* Check whether the given random string is valid +* and applicable for this test case +*/ +bool check_random_str(char *str) +{ + char *p; + int op_num = 0; + int end_num = 0; + + for(p = str; *p; p++) + { + bool tmp1 = false, tmp2 = false; + if(tmp1 = check_op(*p)) + op_num++; + if(tmp2 = check_end(*p)) + end_num++; + if(!(tmp1 || tmp2 || check_col(*p))) //there are illegal letters + return false; + } + + if(op_num != end_num) //begins are not equal to ends + return false; + + return true; +} + +/* +* Get a random string with RECURSIVE_LEVEL +*/ +void get_rand_op_str_compound(char *str) +{ + char small_str[256]; + int pos; + int tmp; + int level; + static int num = 0; + + if(++num == 0) + num = 1; + + srand(num*time(NULL)); + level = 1 + rand() % RECURSIVE_LEVEL; + + get_rand_op_str(str); + + for(int i = 0; i < level; i++) + { + get_rand_op_str(small_str); + tmp = strlen(small_str); + get_rand_op_str(small_str + tmp); //get two operations + pos = get_rand_replace_pos(str, strlen(str)); + replace_a_to_str(str, pos, small_str); + } + + //check the random string + if(!check_random_str(str)) + { + fprintf(stderr, "Error random string! \n"); + exit(-1); + } +} + +/* +* get column id of i,j,k,l,m,n +*/ +int get_column_id(char ch) +{ + return (ch - 'i' + 1); //from 1 to 6 +} + +/* +* check whether column value of the NO. tuple is equal to 1 +* col_id: column id, range from 1 to 6 +* tuple_no: record NO., range from 0 to 63 +*/ +bool check_col_equal_one(int tuple_no, int col_id) +{ + int i = (int)pow(2, 6 - col_id); + int j = tuple_no / i; + if(j % 2) + return true; + else + return false; +} + +/* +* get a result after all elements in the array with AND +* value: pointer to a bool array +* len: length of the bool array +*/ +bool AND_op(bool *value, int len) +{ + for(int i = 0; i < len; i++) + { + if(! value[i]) + return false; + } + return true; +} + +/* +* get a result after all elements in the array with OR +* value: pointer to a bool array +* len: length of the bool array +*/ +bool OR_op(bool *value, int len) +{ + for(int i = 0; i < len; i++) + { + if(value[i]) + return true; + } + return false; +} + +/* +* get a result after all elements in the array with NAND +* value: pointer to a bool array +* len: length of the bool array +*/ +bool NAND_op(bool *value, int len) +{ + return (! AND_op(value, len)); +} + +/* +* get a result after all elements in the array with NOR +* value: pointer to a bool array +* len: length of the bool array +*/ +bool NOR_op(bool *value, int len) +{ + return (! OR_op(value, len)); +} + +/* +* AND/NAND/OR/NOR operation for a bool array +*/ +bool calculate_one_op(char op_type, bool *value, int len) +{ + switch(op_type) + { + case 'a': + return AND_op(value, len); + break; + case 'o': + return OR_op(value, len); + break; + case 'A': + return NAND_op(value, len); + break; + case 'O': + return NOR_op(value, len); + break; + } + return false; //make gcc happy +} + +typedef struct _stack_element +{ + char type; + int num; +}stack_element; + +/* +* stack_op, store info for AND,OR,NAND,NOR +* stack_col, store value of column(i,j,k,l,m,n) and temporary result for an operation +*/ +stack_element stack_op[RECURSIVE_LEVEL * COL_LEN]; +bool stack_col[RECURSIVE_LEVEL * COL_LEN * 2]; + +/* +* check whether the given tuple is chosen by judgement condition +* tuple_no, the NO of tuple in TABLE_NAME, range from 0 to TUPLE_NUM +* str: a random string of scan opearation and condition +* len: length of str +*/ +bool check_one_tuple(int tuple_no, char *str, int len) +{ + int pop_op = 0; + int pop_col = 0; + for(int i = 0; i < len; i++) + { + char letter = *(str + i); + if(check_op(letter)) //push + { + stack_op[pop_op].type = letter; + stack_op[pop_op].num = 0; + pop_op++; + } + if(check_col(letter)) //push + { + stack_col[pop_col] = check_col_equal_one(tuple_no, get_column_id(letter)); + pop_col++; + stack_op[pop_op-1].num += 1; + } + if(check_end(letter)) + { + if(pop_op <= 1) + { + return calculate_one_op(stack_op[pop_op-1].type, + stack_col, + stack_op[pop_op-1].num); + } + else + { + bool tmp1 = calculate_one_op(stack_op[pop_op-1].type, + stack_col + pop_col - stack_op[pop_op-1].num, + stack_op[pop_op-1].num); + pop_col -= stack_op[pop_op-1].num; //pop + pop_op--; + stack_col[pop_col] = tmp1; //push + pop_col++; + stack_op[pop_op-1].num += 1; + } + } + } + return false; //make gcc happy +} + +/* +* get lists of tuples which match the scan condiction through calculating +* str: a random string of scan opearation and condition +*/ +void check_all_tuples(char *str, bool *res) +{ + for (int i = 0; i < TUPLE_NUM; i++) + { + if(check_one_tuple(i, str, strlen(str))) + res[i] = true; + } +} + +/* +* convert a letter to group number what ndbapi need +*/ +NdbScanFilter::Group get_api_group(char op_name) +{ + switch (op_name) { + case 'a': return NdbScanFilter::AND; + case 'o': return NdbScanFilter::OR; + case 'A': return NdbScanFilter::NAND; + case 'O': return NdbScanFilter::NOR; + default: + fprintf(stderr, "Invalid group name %c !\n", op_name); + exit(3); + } +} + +/* +* with ndbapi, call begin, eq/ne/lt/gt/le/ge..., end +*/ +NdbScanFilter * call_ndbapi(char *str, NdbTransaction *transaction, + NdbScanOperation *scan, NdbDictionary::Column const *col[]) +{ + NdbScanFilter *scanfilter = new NdbScanFilter(scan); + char *p; + + for (p = str; *p; p++) + { + if(check_op(*p)) + { + if(scanfilter->begin(get_api_group(*p))) + ERR_EXIT(transaction, "filter begin() failed"); + } + if(check_col(*p)) + { + if(scanfilter->eq(col[*p-'i'+1]->getColumnNo(), (Uint32)1)) + ERR_EXIT(transaction, "filter eq() failed"); + } + if(check_end(*p)) + { + if(scanfilter->end()) + ERR_EXIT(transaction, "filter end() failed"); + } + } + + return scanfilter; +} + +/* +* get the tuples through ndbapi, and save the tuples NO. +* str: a random string of scan opearation and condition +*/ +void ndbapi_tuples(Ndb *ndb, char *str, bool *res) +{ + const NdbDictionary::Dictionary *dict = ndb->getDictionary(); + if (!dict) + ERR_EXIT(ndb, "Can't get dict"); + + const NdbDictionary::Table *table = dict->getTable(TABLE_NAME); + if (!table) + ERR_EXIT(dict, "Can't get table"TABLE_NAME); + + const NdbDictionary::Column *col[COL_LEN]; + for(int i = 0; i < COL_LEN; i++) + { + char tmp[128]; + col[i] = table->getColumn(COL_NAME[i]); + if(!col[i]) + { + snprintf(tmp, 128, "Can't get column %s", COL_NAME[i]); + ERR_EXIT(dict, tmp); + } + } + + NdbTransaction *transaction; + NdbScanOperation *scan; + NdbScanFilter *filter; + + transaction = ndb->startTransaction(); + if (!transaction) + ERR_EXIT(ndb, "Can't start transaction"); + + scan = transaction->getNdbScanOperation(table); + if (!scan) + ERR_EXIT(transaction, "Can't get scan op"); + + if (scan->readTuples(NdbOperation::LM_Exclusive)) + ERR_EXIT(scan, "Can't set up read"); + + NdbRecAttr *rec[COL_LEN]; + for(int i = 0; i < COL_LEN; i++) + { + char tmp[128]; + rec[i] = scan->getValue(COL_NAME[i]); + if(!rec[i]) + { + snprintf(tmp, 128, "Can't get rec of %s", COL_NAME[i]); + ERR_EXIT(scan, tmp); + } + } + + filter = call_ndbapi(str, transaction, scan, col); + + if (transaction->execute(NdbTransaction::NoCommit)) + ERR_EXIT(transaction, "Can't execute"); + + int i,j,k,l,m,n; + while (scan->nextResult(true) == 0) + { + do + { + i = rec[1]->u_32_value(); + j = rec[2]->u_32_value(); + k = rec[3]->u_32_value(); + l = rec[4]->u_32_value(); + m = rec[5]->u_32_value(); + n = rec[6]->u_32_value(); + res[32*i+16*j+8*k+4*l+2*m+n] = true; + } while (scan->nextResult(false) == 0); + } + + delete filter; + transaction->close(); +} + +/* +* compare the result between calculation and NDBAPI +* str: a random string of scan opearation and condition +* return: true stands for ndbapi ok, false stands for ndbapi failed +*/ +bool compare_cal_ndb(char *str, Ndb *ndb) +{ + bool res_cal[TUPLE_NUM], res_ndb[TUPLE_NUM]; + + for(int i = 0; i < TUPLE_NUM; i++) + { + res_cal[i] = false; + res_ndb[i] = false; + } + + check_all_tuples(str, res_cal); + ndbapi_tuples(ndb, str, res_ndb); + + for(int i = 0; i < TUPLE_NUM; i++) + { + if(res_cal[i] != res_ndb[i]) + return false; + } + return true; +} + + +int runCreateTables(NDBT_Context* ctx, NDBT_Step* step) +{ + Ndb *pNdb = GETNDB(step); + pNdb->getDictionary()->dropTable(MYTAB1.getName()); + int ret = createTable(pNdb, &MYTAB1, false, true, 0); + if(ret) + return ret; + return NDBT_OK; +} + + +int runDropTables(NDBT_Context* ctx, NDBT_Step* step) +{ + int ret = GETNDB(step)->getDictionary()->dropTable(MYTAB1.getName()); + if(ret == -1) + return NDBT_FAILED; + + return NDBT_OK; +} + +int runScanRandomFilterTest(NDBT_Context* ctx, NDBT_Step* step) +{ + char random_str[MAX_STR_LEN]; + Ndb *myNdb = GETNDB(step); + bool res = true; + + for(int i = 0; i < TEST_NUM; i++) + { + get_rand_op_str_compound(random_str); + if( !compare_cal_ndb(random_str, myNdb)) + return NDBT_FAILED; + } + + return NDBT_OK; +} + +NDBT_TESTSUITE(testScanFilter); +TESTCASE(TEST_NAME, + "Scan table TABLE_NAME for the records which accord with \ + conditions of logical scan operations: AND/OR/NAND/NOR") +{ + INITIALIZER(runCreateTables); + INITIALIZER(runPopulate); + INITIALIZER(runScanRandomFilterTest); + FINALIZER(runDropTables); +} + +NDBT_TESTSUITE_END(testScanFilter); + + +int main(int argc, const char** argv) +{ + ndb_init(); + + Ndb_cluster_connection con; + if(con.connect(12, 5, 1)) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + return testScanFilter.executeOneCtx(con, &MYTAB1, TEST_NAME); +} diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 37100732eca..391af3e5d95 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -817,6 +817,63 @@ NDBT_TestSuite::executeOne(Ndb_cluster_connection& con, } } +int +NDBT_TestSuite::executeOneCtx(Ndb_cluster_connection& con, + const NdbDictionary::Table *ptab, const char* _testname){ + + testSuiteTimer.doStart(); + + do{ + if(tests.size() == 0) + break; + + Ndb ndb(&con, "TEST_DB"); + ndb.init(1024); + + int result = ndb.waitUntilReady(300); // 5 minutes + if (result != 0){ + g_err << name <<": Ndb was not ready" << endl; + break; + } + + ndbout << name << " started [" << getDate() << "]" << endl; + ndbout << "|- " << ptab->getName() << endl; + + for (unsigned t = 0; t < tests.size(); t++){ + + if (_testname != NULL && + strcasecmp(tests[t]->getName(), _testname) != 0) + continue; + + tests[t]->initBeforeTest(); + + ctx = new NDBT_Context(con); + ctx->setTab(ptab); + ctx->setNumRecords(records); + ctx->setNumLoops(loops); + if(remote_mgm != NULL) + ctx->setRemoteMgm(remote_mgm); + ctx->setSuite(this); + + result = tests[t]->execute(ctx); + if (result != NDBT_OK) + numTestsFail++; + else + numTestsOk++; + numTestsExecuted++; + + delete ctx; + } + + if (numTestsFail > 0) + break; + }while(0); + + testSuiteTimer.doStop(); + int res = report(_testname); + return NDBT_ProgramExit(res); +} + void NDBT_TestSuite::execute(Ndb_cluster_connection& con, Ndb* ndb, const NdbDictionary::Table* pTab, const char* _testname){ From a0684ef25f7b2a1f6f02abf3fe4d1f3d7ebb7298 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 15:28:10 +0200 Subject: [PATCH 030/789] Correctly recognize Intel Core2Duo Extreme in build. BUILD/check-cpu: Correctly recognize Intel Core2Duo Extreme. --- BUILD/check-cpu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 55f4e62327b..3fded0a680f 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -114,6 +114,10 @@ check_cpu () { *i386*i486*) cpu_arg="pentium-m"; ;; + #Core 2 Duo + *Intel*Core\(TM\)2*) + cpu_arg="nocona"; + ;; # Intel ia64 *Itanium*) From f8d58c1d1f89a2147466d11feeb54ca3c217c077 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2007 20:58:51 +0100 Subject: [PATCH 031/789] BUG#26701 check-cpu compile flags in x86-64 doesn't support gcc < 3.4, apply suggestion from jocelyn fournier --- BUILD/check-cpu | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 55f4e62327b..8c41b79a126 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -179,7 +179,14 @@ check_cpu () { check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg' ;; x86_64-*) - check_cpu_args='-mtune=$cpu_arg' + case "$cc_verno" in + 3.4*|3.5*|4.*) + check_cpu_args='-mtune=$cpu_arg' + ;; + *) + check_cpu_args='-mcpu=$cpu_arg' + ;; + esac ;; *) check_cpu_cflags="" From 1437a9c532df2ff1f7dc5d72fdc50cdb89014c90 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 00:09:22 +0300 Subject: [PATCH 032/789] Bug#25122: Views based on a self-joined table aren't insertable. When INSERT is done over a view the table being inserted into is checked to be unique among all views tables. But if the view contains self-joined table an error will be thrown even if all tables are used under different aliases. The unique_table() function now also checks tables' aliases when needed. sql/mysql_priv.h: Bug#25122: Views based on a self-joined table aren't insertable. Updated prototype of the unique_table() function. sql/sql_base.cc: Bug#25122: Views based on a self-joined table aren't insertable. Now the unique_table() function checks tables' aliases when needed. sql/sql_delete.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_insert.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_load.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_parse.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_update.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. --- sql/mysql_priv.h | 3 ++- sql/sql_base.cc | 9 +++++++-- sql/sql_delete.cc | 4 ++-- sql/sql_insert.cc | 4 ++-- sql/sql_load.cc | 2 +- sql/sql_parse.cc | 4 ++-- sql/sql_update.cc | 6 +++--- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0948487869a..d2f4938c07c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1064,7 +1064,8 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table, st_table_list *TABLE_LIST::*link, const char *db_name, const char *table_name); -TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list); +TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, + bool check_alias); TABLE **find_temporary_table(THD *thd, const char *db, const char *table_name); bool close_temporary_table(THD *thd, const char *db, const char *table_name); void close_temporary(TABLE *table, bool delete_table); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 239c787eca5..ea937be4e70 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -796,6 +796,7 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table, thd thread handle table table which should be checked table_list list of tables + check_alias whether to check tables' aliases NOTE: to exclude derived tables from check we use following mechanism: a) during derived table processing set THD::derived_tables_processing @@ -823,10 +824,11 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table, 0 if table is unique */ -TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list) +TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, + bool check_alias) { TABLE_LIST *res; - const char *d_name, *t_name; + const char *d_name, *t_name, *t_alias; DBUG_ENTER("unique_table"); DBUG_PRINT("enter", ("table alias: %s", table->alias)); @@ -854,6 +856,7 @@ TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list) } d_name= table->db; t_name= table->table_name; + t_alias= table->alias; DBUG_PRINT("info", ("real table: %s.%s", d_name, t_name)); for (;;) @@ -861,6 +864,8 @@ TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list) if (((! (res= find_table_in_global_list(table_list, d_name, t_name))) && (! (res= mysql_lock_have_duplicate(thd, table, table_list)))) || ((!res->table || res->table != table->table) && + (!check_alias || !(lower_case_table_names ? + strcasecmp(t_alias, res->alias) : strcmp(t_alias, res->alias))) && res->select_lex && !res->select_lex->exclude_from_table_unique_test && !res->prelocking_placeholder)) break; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 94d753eb703..7771a10966d 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -370,7 +370,7 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds) } { TABLE_LIST *duplicate; - if ((duplicate= unique_table(thd, table_list, table_list->next_global))) + if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0))) { update_non_unique_table_error(table_list, "DELETE", duplicate); DBUG_RETURN(TRUE); @@ -462,7 +462,7 @@ bool mysql_multi_delete_prepare(THD *thd) { TABLE_LIST *duplicate; if ((duplicate= unique_table(thd, target_tbl->correspondent_table, - lex->query_tables))) + lex->query_tables, 0))) { update_non_unique_table_error(target_tbl->correspondent_table, "DELETE", duplicate); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 332c4c82ba1..55c9d2e6882 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1044,7 +1044,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, { Item *fake_conds= 0; TABLE_LIST *duplicate; - if ((duplicate= unique_table(thd, table_list, table_list->next_global))) + if ((duplicate= unique_table(thd, table_list, table_list->next_global, 1))) { update_non_unique_table_error(table_list, "INSERT", duplicate); DBUG_RETURN(TRUE); @@ -2424,7 +2424,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) query */ if (!(lex->current_select->options & OPTION_BUFFER_RESULT) && - unique_table(thd, table_list, table_list->next_global)) + unique_table(thd, table_list, table_list->next_global, 0)) { /* Using same table for INSERT and SELECT */ lex->current_select->options|= OPTION_BUFFER_RESULT; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 0e4057d9ae4..cb156cc51f0 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -175,7 +175,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table is marked to be 'used for insert' in which case we should never mark this table as as 'const table' (ie, one that has only one row). */ - if (unique_table(thd, table_list, table_list->next_global)) + if (unique_table(thd, table_list, table_list->next_global, 0)) { my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name); DBUG_RETURN(TRUE); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index affa6e130dc..fbe000ac78e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2993,7 +2993,7 @@ mysql_execute_command(THD *thd) if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE)) { TABLE_LIST *duplicate; - if ((duplicate= unique_table(thd, create_table, select_tables))) + if ((duplicate= unique_table(thd, create_table, select_tables, 0))) { update_non_unique_table_error(create_table, "CREATE", duplicate); res= 1; @@ -3009,7 +3009,7 @@ mysql_execute_command(THD *thd) tab= tab->next_local) { TABLE_LIST *duplicate; - if ((duplicate= unique_table(thd, tab, select_tables))) + if ((duplicate= unique_table(thd, tab, select_tables, 0))) { update_non_unique_table_error(tab, "CREATE", duplicate); res= 1; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 1db77f8704c..b20e3689f64 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -636,7 +636,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, /* Check that we are not using table that we are updating in a sub select */ { TABLE_LIST *duplicate; - if ((duplicate= unique_table(thd, table_list, table_list->next_global))) + if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0))) { update_non_unique_table_error(table_list, "UPDATE", duplicate); my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name); @@ -863,7 +863,7 @@ reopen_tables: tl->lock_type != TL_READ_NO_INSERT) { TABLE_LIST *duplicate; - if ((duplicate= unique_table(thd, tl, table_list))) + if ((duplicate= unique_table(thd, tl, table_list, 0))) { update_non_unique_table_error(table_list, "UPDATE", duplicate); DBUG_RETURN(TRUE); @@ -1082,7 +1082,7 @@ static bool safe_update_on_fly(THD *thd, JOIN_TAB *join_tab, List *fields) { TABLE *table= join_tab->table; - if (unique_table(thd, table_ref, all_tables)) + if (unique_table(thd, table_ref, all_tables, 0)) return 0; switch (join_tab->type) { case JT_SYSTEM: From 38f9206acb9733fbe479cf9da2aa680b84ffdf58 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 09:41:47 +0800 Subject: [PATCH 033/789] bug#24568, NdbScanFilter NAND/NOR operations sometimes do not work as expected, add a new file in 5.0 and rename it in 5.1 because the directory of ndb is changed from 5.0 to 5.1 storage/ndb/test/ndbapi/testScanFilter.cpp: Rename: ndb/test/ndbapi/testScanFilter.cpp -> storage/ndb/test/ndbapi/testScanFilter.cpp --- {ndb => storage/ndb}/test/ndbapi/testScanFilter.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {ndb => storage/ndb}/test/ndbapi/testScanFilter.cpp (100%) diff --git a/ndb/test/ndbapi/testScanFilter.cpp b/storage/ndb/test/ndbapi/testScanFilter.cpp similarity index 100% rename from ndb/test/ndbapi/testScanFilter.cpp rename to storage/ndb/test/ndbapi/testScanFilter.cpp From 7ee5cfd0edeac7d0b31f2bb3a2e6d232bac89adb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 11:03:16 +0800 Subject: [PATCH 034/789] bug#24568, NdbScanFilter NAND/NOR operations sometimes do not work as expected when merge from 5.0 to 5.1, update a function call in testScanFilter.cpp beacuase the function's definition is changed from 5.0 to 5.1 storage/ndb/test/ndbapi/testScanFilter.cpp: bug#24568 it need change f() call because NDBT_CreateTableHook definition is changed from 5.0 to 5.1 --- storage/ndb/test/ndbapi/testScanFilter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/test/ndbapi/testScanFilter.cpp b/storage/ndb/test/ndbapi/testScanFilter.cpp index e195c04bd93..ba869dc8ce4 100644 --- a/storage/ndb/test/ndbapi/testScanFilter.cpp +++ b/storage/ndb/test/ndbapi/testScanFilter.cpp @@ -97,7 +97,7 @@ int createTable(Ndb* pNdb, const NdbDictionary::Table* tab, bool _temp, do{ NdbDictionary::Table tmpTab(* tab); tmpTab.setStoredTable(_temp ? 0 : 1); - if(f != 0 && f(pNdb, tmpTab, 0)) + if(f != 0 && f(pNdb, tmpTab, 0, NULL)) { ndbout << "Failed to create table" << endl; return NDBT_FAILED; From 399bf23c1d9b5666c29bca6779e4459ed8fdbc4d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 12:14:50 +0200 Subject: [PATCH 035/789] Bug #26537: item_unhex() was not expected to return NULL for non-NULL arguments. This is not the case as it can return NULL for invalid hexidecimal strings. Fixed by setting the maybe_null flag. mysql-test/r/func_str.result: Bug #26537: test case mysql-test/t/func_str.test: Bug #26537: test case sql/item_strfunc.h: Bug #26537: item_unhex() can return NULLs even for guaranteed non-null arguments. --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 6 ++++++ sql/item_strfunc.h | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 052451f8c54..d09d3aeb529 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1940,4 +1940,10 @@ abcxx select lpad('abc', cast(5 as unsigned integer), 'x'); lpad('abc', cast(5 as unsigned integer), 'x') xxabc +SELECT UNHEX('G'); +UNHEX('G') +NULL +SELECT UNHEX('G') IS NULL; +UNHEX('G') IS NULL +1 End of 5.0 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 64b59025d44..2e76dc2ca31 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1008,4 +1008,10 @@ select repeat('a', cast(2 as unsigned int)); select rpad('abc', cast(5 as unsigned integer), 'x'); select lpad('abc', cast(5 as unsigned integer), 'x'); +# +# Bug #26537: UNHEX() IS NULL comparison fails +# +SELECT UNHEX('G'); +SELECT UNHEX('G') IS NULL; + --echo End of 5.0 tests diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 60547d00a5c..778ea6e9496 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -605,7 +605,11 @@ class Item_func_unhex :public Item_str_func { String tmp_value; public: - Item_func_unhex(Item *a) :Item_str_func(a) {} + Item_func_unhex(Item *a) :Item_str_func(a) + { + /* there can be bad hex strings */ + maybe_null= 1; + } const char *func_name() const { return "unhex"; } String *val_str(String *); void fix_length_and_dec() From 19948e8a7fa9b63220345203a0db3c371514f83e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 13:25:41 +0300 Subject: [PATCH 036/789] sql_base.cc: Post fix for bug#25122. sql/sql_base.cc: Post fix for bug#25122. --- sql/sql_base.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 86cb9f77703..9945057cd1b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -865,7 +865,8 @@ TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, (! (res= mysql_lock_have_duplicate(thd, table, table_list)))) || ((!res->table || res->table != table->table) && (!check_alias || !(lower_case_table_names ? - strcasecmp(t_alias, res->alias) : strcmp(t_alias, res->alias))) && + my_strcasecmp(files_charset_info, t_alias, res->alias) : + strcmp(t_alias, res->alias))) && res->select_lex && !res->select_lex->exclude_from_table_unique_test && !res->prelocking_placeholder)) break; From b114118ab77b36ccc3549542252f5ea2796bbc33 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 16:25:56 +0200 Subject: [PATCH 037/789] Bug #19342: Several problems here : 1. The conversion to double of an hex string const item was not taking into account the unsigned flag. 2. IN was not behaving in the same was way as comparisons when performed over an INT/DATE/DATETIME/TIMESTAMP column and a constant. The ordinary comparisons in that case convert the constant to an INTEGER value and do int comparisons. Fixed the IN to do the same. 3. IN is not taking into account the unsigned flag when calculating IN (, , ...). Extended the implementation of IN to store and process the unsigned flag for its arguments. mysql-test/r/func_in.result: Bug #19342: test case mysql-test/t/func_in.test: Bug #19342: test case sql/item.h: Bug #19342: correct handling of sign in conersion to real. sql/item_cmpfunc.cc: Bug #19342: exteneded the IN values list to support unsigned longlong values. Correct comparison of integers in IN with regard of signedness. Compare DATE/DATETIME/TIMESTAMP values as integers in IN. sql/item_cmpfunc.h: Bug #19342: exteneded the IN values list to support unsigned longlong values. Correct comparison of integers in IN with regard of signedness. --- mysql-test/r/func_in.result | 66 ++++++++++++++++++ mysql-test/t/func_in.test | 58 ++++++++++++++++ sql/item.h | 5 +- sql/item_cmpfunc.cc | 130 ++++++++++++++++++++++++++++++++++-- sql/item_cmpfunc.h | 17 ++++- 5 files changed, 268 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index d9ca9e80e44..36bcc6f1711 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -398,4 +398,70 @@ WHERE t3.a=t1.a AND t3.a=t2.a; 3 3 DROP TABLE t1,t2,t3,t4; +CREATE TABLE t1(a BIGINT UNSIGNED); +INSERT INTO t1 VALUES (0xFFFFFFFFFFFFFFFF); +SELECT * FROM t1 WHERE a=-1 OR a=-2 ; +a +SELECT * FROM t1 WHERE a IN (-1, -2); +a +CREATE TABLE t2 (a BIGINT UNSIGNED); +insert into t2 values(13491727406643098568), +(0x7fffffefffffffff), +(0x7ffffffeffffffff), +(0x7fffffffefffffff), +(0x7ffffffffeffffff), +(0x7fffffffffefffff), +(0x7ffffffffffeffff), +(0x7fffffffffffefff), +(0x7ffffffffffffeff), +(0x7fffffffffffffef), +(0x7ffffffffffffffe), +(0x7fffffffffffffff), +(0x8000000000000000), +(0x8000000000000001), +(0x8000000000000002), +(0x8000000000000300), +(0x8000000000000400), +(0x8000000000000401), +(0x8000000000004001), +(0x8000000000040001), +(0x8000000000400001), +(0x8000000004000001), +(0x8000000040000001), +(0x8000000400000001), +(0x8000004000000001), +(0x8000040000000001); +SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42); +HEX(a) +BB3C3E98175D33C8 +SELECT HEX(a) FROM t2 WHERE a IN +(0xBB3C3E98175D33C8, +0x7fffffffffffffff, +0x8000000000000000, +0x8000000000000400, +0x8000000000000401, +42); +HEX(a) +BB3C3E98175D33C8 +7FFFFFFFFFFFFFFF +8000000000000000 +8000000000000400 +8000000000000401 +SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001); +HEX(a) +7FFFFFFFFFFFFFFF +8000000000000001 +SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff); +HEX(a) +7FFFFFFFFFFFFFFE +7FFFFFFFFFFFFFFF +SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc'); +HEX(a) +7FFFFFFFFFFFFFFE +7FFFFFFFFFFFFFFF +CREATE TABLE t3 (a BIGINT UNSIGNED); +INSERT INTO t3 VALUES (9223372036854775551); +SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42); +HEX(a) +DROP TABLE t1,t2,t3; End of 5.0 tests diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 54b81bed133..7ba54747d4b 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -298,4 +298,62 @@ SELECT STRAIGHT_JOIN DROP TABLE t1,t2,t3,t4; +# +# BUG#19342: IN works incorrectly for BIGINT UNSIGNED values +# +CREATE TABLE t1(a BIGINT UNSIGNED); +INSERT INTO t1 VALUES (0xFFFFFFFFFFFFFFFF); + +SELECT * FROM t1 WHERE a=-1 OR a=-2 ; +SELECT * FROM t1 WHERE a IN (-1, -2); + +CREATE TABLE t2 (a BIGINT UNSIGNED); +insert into t2 values(13491727406643098568), + (0x7fffffefffffffff), + (0x7ffffffeffffffff), + (0x7fffffffefffffff), + (0x7ffffffffeffffff), + (0x7fffffffffefffff), + (0x7ffffffffffeffff), + (0x7fffffffffffefff), + (0x7ffffffffffffeff), + (0x7fffffffffffffef), + (0x7ffffffffffffffe), + (0x7fffffffffffffff), + (0x8000000000000000), + (0x8000000000000001), + (0x8000000000000002), + (0x8000000000000300), + (0x8000000000000400), + (0x8000000000000401), + (0x8000000000004001), + (0x8000000000040001), + (0x8000000000400001), + (0x8000000004000001), + (0x8000000040000001), + (0x8000000400000001), + (0x8000004000000001), + (0x8000040000000001); + +SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42); + +SELECT HEX(a) FROM t2 WHERE a IN +(0xBB3C3E98175D33C8, + 0x7fffffffffffffff, + 0x8000000000000000, + 0x8000000000000400, + 0x8000000000000401, + 42); + +SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001); +SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff); +SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc'); + +CREATE TABLE t3 (a BIGINT UNSIGNED); +INSERT INTO t3 VALUES (9223372036854775551); + +SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42); + +DROP TABLE t1,t2,t3; + --echo End of 5.0 tests diff --git a/sql/item.h b/sql/item.h index 6c41aa09f80..f02d4f0c65d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1766,7 +1766,10 @@ public: Item_hex_string(const char *str,uint str_length); enum Type type() const { return VARBIN_ITEM; } double val_real() - { DBUG_ASSERT(fixed == 1); return (double) Item_hex_string::val_int(); } + { + DBUG_ASSERT(fixed == 1); + return (double) (ulonglong) Item_hex_string::val_int(); + } longlong val_int(); bool basic_const_item() const { return 1; } String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; } diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 08f9c16384a..f239e3ea18e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2034,9 +2034,100 @@ void Item_func_coalesce::fix_length_and_dec() Classes and function for the IN operator ****************************************************************************/ -static int cmp_longlong(void *cmp_arg, longlong *a,longlong *b) +/* + Determine which of the signed longlong arguments is bigger + + SYNOPSIS + cmp_longs() + a_val left argument + b_val right argument + + DESCRIPTION + This function will compare two signed longlong arguments + and will return -1, 0, or 1 if left argument is smaller than, + equal to or greater than the right argument. + + RETURN VALUE + -1 left argument is smaller than the right argument. + 0 left argument is equal to the right argument. + 1 left argument is greater than the right argument. +*/ +static inline int cmp_longs (longlong a_val, longlong b_val) { - return *a < *b ? -1 : *a == *b ? 0 : 1; + return a_val < b_val ? -1 : a_val == b_val ? 0 : 1; +} + + +/* + Determine which of the unsigned longlong arguments is bigger + + SYNOPSIS + cmp_ulongs() + a_val left argument + b_val right argument + + DESCRIPTION + This function will compare two unsigned longlong arguments + and will return -1, 0, or 1 if left argument is smaller than, + equal to or greater than the right argument. + + RETURN VALUE + -1 left argument is smaller than the right argument. + 0 left argument is equal to the right argument. + 1 left argument is greater than the right argument. +*/ +static inline int cmp_ulongs (ulonglong a_val, ulonglong b_val) +{ + return a_val < b_val ? -1 : a_val == b_val ? 0 : 1; +} + + +/* + Compare two integers in IN value list format (packed_longlong) + + SYNOPSIS + cmp_longlong() + cmp_arg an argument passed to the calling function (qsort2) + a left argument + b right argument + + DESCRIPTION + This function will compare two integer arguments in the IN value list + format and will return -1, 0, or 1 if left argument is smaller than, + equal to or greater than the right argument. + It's used in sorting the IN values list and finding an element in it. + Depending on the signedness of the arguments cmp_longlong() will + compare them as either signed (using cmp_longs()) or unsigned (using + cmp_ulongs()). + + RETURN VALUE + -1 left argument is smaller than the right argument. + 0 left argument is equal to the right argument. + 1 left argument is greater than the right argument. +*/ +int cmp_longlong(void *cmp_arg, + in_longlong::packed_longlong *a, + in_longlong::packed_longlong *b) +{ + if (a->unsigned_flag != b->unsigned_flag) + { + /* + One of the args is unsigned and is too big to fit into the + positive signed range. Report no match. + */ + if (a->unsigned_flag && ((ulonglong) a->val) > LONGLONG_MAX || + b->unsigned_flag && ((ulonglong) b->val) > LONGLONG_MAX) + return a->unsigned_flag ? 1 : -1; + /* + Although the signedness differs both args can fit into the signed + positive range. Make them signed and compare as usual. + */ + return cmp_longs (a->val, b->val); + } + if (a->unsigned_flag) + return cmp_ulongs ((ulonglong) a->val, (ulonglong) b->val); + else + return cmp_longs (a->val, b->val); } static int cmp_double(void *cmp_arg, double *a,double *b) @@ -2161,19 +2252,23 @@ void in_row::set(uint pos, Item *item) } in_longlong::in_longlong(uint elements) - :in_vector(elements,sizeof(longlong),(qsort2_cmp) cmp_longlong, 0) + :in_vector(elements,sizeof(packed_longlong),(qsort2_cmp) cmp_longlong, 0) {} void in_longlong::set(uint pos,Item *item) { - ((longlong*) base)[pos]=item->val_int(); + struct packed_longlong *buff= &((packed_longlong*) base)[pos]; + + buff->val= item->val_int(); + buff->unsigned_flag= item->unsigned_flag; } byte *in_longlong::get_value(Item *item) { - tmp= item->val_int(); + tmp.val= item->val_int(); if (item->null_value) return 0; + tmp.unsigned_flag= item->unsigned_flag; return (byte*) &tmp; } @@ -2494,6 +2589,31 @@ void Item_func_in::fix_length_and_dec() */ if (const_itm && !nulls_in_row()) { + /* + IN must compare INT/DATE/DATETIME/TIMESTAMP columns and constants + as int values (the same way as equality does). + So we must check here if the column on the left and all the constant + values on the right can be compared as integers and adjust the + comparison type accordingly. + */ + if (args[0]->real_item()->type() == FIELD_ITEM && + thd->lex->sql_command != SQLCOM_CREATE_VIEW && + thd->lex->sql_command != SQLCOM_SHOW_CREATE && + cmp_type != INT_RESULT) + { + Field *field= ((Item_field*) (args[0]->real_item()))->field; + if (field->can_be_compared_as_longlong()) + { + bool all_converted= TRUE; + for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++) + { + if (!convert_constant_item (thd, field, &arg[0])) + all_converted= FALSE; + } + if (all_converted) + cmp_type= INT_RESULT; + } + } switch (cmp_type) { case STRING_RESULT: array=new in_string(arg_count-1,(qsort2_cmp) srtcmp_in, diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index f18728c554b..80115549336 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -731,7 +731,16 @@ public: class in_longlong :public in_vector { - longlong tmp; + /* + Here we declare a temporary variable (tmp) of the same type as the + elements of this vector. tmp is used in finding if a given value is in + the list. + */ + struct packed_longlong + { + longlong val; + longlong unsigned_flag; // Use longlong, not bool, to preserve alignment + } tmp; public: in_longlong(uint elements); void set(uint pos,Item *item); @@ -747,8 +756,12 @@ public: } void value_to_item(uint pos, Item *item) { - ((Item_int*)item)->value= ((longlong*)base)[pos]; + ((Item_int*) item)->value= ((packed_longlong*) base)[pos].val; + ((Item_int*) item)->unsigned_flag= + ((packed_longlong*) base)[pos].unsigned_flag; } + + friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b); }; class in_double :public in_vector From 68915daf31d7eee6d61f0cce7950c83382209ba8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 19:27:32 +0200 Subject: [PATCH 038/789] fixed win32 warning --- sql/item_cmpfunc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 80115549336..b612553e840 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -757,7 +757,7 @@ public: void value_to_item(uint pos, Item *item) { ((Item_int*) item)->value= ((packed_longlong*) base)[pos].val; - ((Item_int*) item)->unsigned_flag= + ((Item_int*) item)->unsigned_flag= (my_bool) ((packed_longlong*) base)[pos].unsigned_flag; } From 476f91b50c9e8993920f4aafbf16a447e65689cb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 19:32:46 +0200 Subject: [PATCH 039/789] fixed win32 warnings --- sql/item_cmpfunc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index b0d85ba92a1..e50e744668a 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -760,7 +760,7 @@ public: void value_to_item(uint pos, Item *item) { ((Item_int*) item)->value= ((packed_longlong*) base)[pos].val; - ((Item_int*) item)->unsigned_flag= + ((Item_int*) item)->unsigned_flag= (my_bool) ((packed_longlong*) base)[pos].unsigned_flag; } From 2c27d1a3b9c2f200e51b2bfe25835de4db7f913f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2007 18:45:09 +0000 Subject: [PATCH 040/789] BUG#26307 correct inconsistant jam() and ljam() use in DBTUP source files. storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: redefine jam and jamEntry and change offset ranges of source files storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: redefine jam and jamEntry storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp: redefine jam and jamEntry --- storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 109 +++++++-- .../src/kernel/blocks/dbtup/DbtupAbort.cpp | 66 +++-- .../src/kernel/blocks/dbtup/DbtupBuffer.cpp | 34 ++- .../src/kernel/blocks/dbtup/DbtupCommit.cpp | 42 ++-- .../src/kernel/blocks/dbtup/DbtupDebug.cpp | 14 +- .../kernel/blocks/dbtup/DbtupDiskAlloc.cpp | 1 + .../src/kernel/blocks/dbtup/DbtupFixAlloc.cpp | 12 +- .../ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 82 +++---- .../src/kernel/blocks/dbtup/DbtupIndex.cpp | 70 +++--- .../ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 96 ++++---- .../src/kernel/blocks/dbtup/DbtupPagMan.cpp | 54 ++--- .../src/kernel/blocks/dbtup/DbtupPageMap.cpp | 78 +++--- .../src/kernel/blocks/dbtup/DbtupRoutines.cpp | 228 +++++++++--------- .../ndb/src/kernel/blocks/dbtup/DbtupScan.cpp | 1 + .../blocks/dbtup/DbtupStoredProcDef.cpp | 26 +- .../kernel/blocks/dbtup/DbtupTabDesMan.cpp | 38 ++- .../src/kernel/blocks/dbtup/DbtupTrigger.cpp | 172 +++++++------ .../src/kernel/blocks/dbtup/DbtupVarAlloc.cpp | 37 ++- 18 files changed, 604 insertions(+), 556 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 230895c942a..5481cafd4f1 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -32,6 +32,82 @@ #include <../pgman.hpp> #include <../tsman.hpp> +// jams +#undef jam +#undef jamEntry +#ifdef DBTUP_BUFFER_CPP +#define jam() jamLine(10000 + __LINE__) +#define jamEntry() jamEntryLine(10000 + __LINE__) +#endif +#ifdef DBTUP_ROUTINES_CPP +#define jam() jamLine(15000 + __LINE__) +#define jamEntry() jamEntryLine(15000 + __LINE__) +#endif +#ifdef DBTUP_COMMIT_CPP +#define jam() jamLine(20000 + __LINE__) +#define jamEntry() jamEntryLine(20000 + __LINE__) +#endif +#ifdef DBTUP_FIXALLOC_CPP +#define jam() jamLine(25000 + __LINE__) +#define jamEntry() jamEntryLine(25000 + __LINE__) +#endif +#ifdef DBTUP_TRIGGER_CPP +#define jam() jamLine(30000 + __LINE__) +#define jamEntry() jamEntryLine(30000 + __LINE__) +#endif +#ifdef DBTUP_ABORT_CPP +#define jam() jamLine(35000 + __LINE__) +#define jamEntry() jamEntryLine(35000 + __LINE__) +#endif +#ifdef DBTUP_PAGE_MAP_CPP +#define jam() jamLine(40000 + __LINE__) +#define jamEntry() jamEntryLine(40000 + __LINE__) +#endif +#ifdef DBTUP_PAG_MAN_CPP +#define jam() jamLine(45000 + __LINE__) +#define jamEntry() jamEntryLine(45000 + __LINE__) +#endif +#ifdef DBTUP_STORE_PROC_DEF_CPP +#define jam() jamLine(50000 + __LINE__) +#define jamEntry() jamEntryLine(50000 + __LINE__) +#endif +#ifdef DBTUP_META_CPP +#define jam() jamLine(55000 + __LINE__) +#define jamEntry() jamEntryLine(55000 + __LINE__) +#endif +#ifdef DBTUP_TAB_DES_MAN_CPP +#define jam() jamLine(60000 + __LINE__) +#define jamEntry() jamEntryLine(60000 + __LINE__) +#endif +#ifdef DBTUP_GEN_CPP +#define jam() jamLine(65000 + __LINE__) +#define jamEntry() jamEntryLine(65000 + __LINE__) +#endif +#ifdef DBTUP_INDEX_CPP +#define jam() jamLine(70000 + __LINE__) +#define jamEntry() jamEntryLine(70000 + __LINE__) +#endif +#ifdef DBTUP_DEBUG_CPP +#define jam() jamLine(75000 + __LINE__) +#define jamEntry() jamEntryLine(75000 + __LINE__) +#endif +#ifdef DBTUP_VAR_ALLOC_CPP +#define jam() jamLine(80000 + __LINE__) +#define jamEntry() jamEntryLine(80000 + __LINE__) +#endif +#ifdef DBTUP_SCAN_CPP +#define jam() jamLine(85000 + __LINE__) +#define jamEntry() jamEntryLine(85000 + __LINE__) +#endif +#ifdef DBTUP_DISK_ALLOC_CPP +#define jam() jamLine(90000 + __LINE__) +#define jamEntry() jamEntryLine(90000 + __LINE__) +#endif +#ifndef jam +#define jam() jamLine(__LINE__) +#define jamEntry() jamEntryLine(__LINE__) +#endif + #ifdef VM_TRACE inline const char* dbgmask(const Bitmask& bm) { static int i=0; static char buf[5][200]; @@ -70,22 +146,23 @@ inline const Uint32* ALIGN_WORD(const void* ptr) // only reports the line number in the file it currently is located in. // // DbtupExecQuery.cpp 0 -// DbtupBuffer.cpp 2000 -// DbtupRoutines.cpp 3000 -// DbtupCommit.cpp 5000 -// DbtupFixAlloc.cpp 6000 -// DbtupTrigger.cpp 7000 -// DbtupAbort.cpp 9000 -// DbtupPageMap.cpp 14000 -// DbtupPagMan.cpp 16000 -// DbtupStoredProcDef.cpp 18000 -// DbtupMeta.cpp 20000 -// DbtupTabDesMan.cpp 22000 -// DbtupGen.cpp 24000 -// DbtupIndex.cpp 28000 -// DbtupDebug.cpp 30000 -// DbtupVarAlloc.cpp 32000 -// DbtupScan.cpp 33000 +// DbtupBuffer.cpp 10000 +// DbtupRoutines.cpp 15000 +// DbtupCommit.cpp 20000 +// DbtupFixAlloc.cpp 25000 +// DbtupTrigger.cpp 30000 +// DbtupAbort.cpp 35000 +// DbtupPageMap.cpp 40000 +// DbtupPagMan.cpp 45000 +// DbtupStoredProcDef.cpp 50000 +// DbtupMeta.cpp 55000 +// DbtupTabDesMan.cpp 60000 +// DbtupGen.cpp 65000 +// DbtupIndex.cpp 70000 +// DbtupDebug.cpp 75000 +// DbtupVarAlloc.cpp 80000 +// DbtupScan.cpp 85000 +// DbtupDiskAlloc.cpp 90000 //------------------------------------------------------------------ /* diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp index 904629fff77..77cd59dc2e9 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp @@ -14,21 +14,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_ABORT_CPP #include "Dbtup.hpp" #include #include #include -#define ljam() { jamLine(9000 + __LINE__); } -#define ljamEntry() { jamEntryLine(9000 + __LINE__); } - void Dbtup::freeAllAttrBuffers(Operationrec* const regOperPtr) { if (regOperPtr->storedProcedureId == RNIL) { - ljam(); + jam(); freeAttrinbufrec(regOperPtr->firstAttrinbufrec); } else { - ljam(); + jam(); StoredProcPtr storedPtr; c_storedProcPool.getPtr(storedPtr, (Uint32)regOperPtr->storedProcedureId); ndbrequire(storedPtr.p->storedCode == ZSCAN_PROCEDURE); @@ -46,7 +44,7 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf) Uint32 RnoFree = cnoFreeAttrbufrec; localAttrBufPtr.i = anAttrBuf; while (localAttrBufPtr.i != RNIL) { - ljam(); + jam(); ptrCheckGuard(localAttrBufPtr, cnoOfAttrbufrec, attrbufrec); Ttemp = localAttrBufPtr.p->attrbuf[ZBUF_NEXT]; localAttrBufPtr.p->attrbuf[ZBUF_NEXT] = cfirstfreeAttrbufrec; @@ -62,7 +60,7 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf) */ void Dbtup::execTUP_ABORTREQ(Signal* signal) { - ljamEntry(); + jamEntry(); do_tup_abortreq(signal, 0); } @@ -80,7 +78,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags) (trans_state == TRANS_ERROR_WAIT_TUPKEYREQ) || (trans_state == TRANS_IDLE)); if (regOperPtr.p->op_struct.op_type == ZREAD) { - ljam(); + jam(); freeAllAttrBuffers(regOperPtr.p); initOpConnection(regOperPtr.p); return; @@ -94,7 +92,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags) if (get_tuple_state(regOperPtr.p) == TUPLE_PREPARED) { - ljam(); + jam(); if (!regTabPtr.p->tuxCustomTriggers.isEmpty() && (flags & ZSKIP_TUX_TRIGGERS) == 0) executeTuxAbortTriggers(signal, @@ -105,12 +103,12 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags) OperationrecPtr loopOpPtr; loopOpPtr.i = regOperPtr.p->nextActiveOp; while (loopOpPtr.i != RNIL) { - ljam(); + jam(); c_operation_pool.getPtr(loopOpPtr); if (get_tuple_state(loopOpPtr.p) != TUPLE_ALREADY_ABORTED && !regTabPtr.p->tuxCustomTriggers.isEmpty() && (flags & ZSKIP_TUX_TRIGGERS) == 0) { - ljam(); + jam(); executeTuxAbortTriggers(signal, loopOpPtr.p, regFragPtr.p, @@ -211,116 +209,116 @@ int Dbtup::TUPKEY_abort(Signal* signal, int error_type) case 1: //tmupdate_alloc_error: terrorCode= ZMEM_NOMEM_ERROR; - ljam(); + jam(); break; case 15: - ljam(); + jam(); terrorCode = ZREGISTER_INIT_ERROR; break; case 16: - ljam(); + jam(); terrorCode = ZTRY_TO_UPDATE_ERROR; break; case 17: - ljam(); + jam(); terrorCode = ZNO_ILLEGAL_NULL_ATTR; break; case 19: - ljam(); + jam(); terrorCode = ZTRY_TO_UPDATE_ERROR; break; case 20: - ljam(); + jam(); terrorCode = ZREGISTER_INIT_ERROR; break; case 22: - ljam(); + jam(); terrorCode = ZTOTAL_LEN_ERROR; break; case 23: - ljam(); + jam(); terrorCode = ZREGISTER_INIT_ERROR; break; case 24: - ljam(); + jam(); terrorCode = ZREGISTER_INIT_ERROR; break; case 26: - ljam(); + jam(); terrorCode = ZREGISTER_INIT_ERROR; break; case 27: - ljam(); + jam(); terrorCode = ZREGISTER_INIT_ERROR; break; case 28: - ljam(); + jam(); terrorCode = ZREGISTER_INIT_ERROR; break; case 29: - ljam(); + jam(); break; case 30: - ljam(); + jam(); terrorCode = ZCALL_ERROR; break; case 31: - ljam(); + jam(); terrorCode = ZSTACK_OVERFLOW_ERROR; break; case 32: - ljam(); + jam(); terrorCode = ZSTACK_UNDERFLOW_ERROR; break; case 33: - ljam(); + jam(); terrorCode = ZNO_INSTRUCTION_ERROR; break; case 34: - ljam(); + jam(); terrorCode = ZOUTSIDE_OF_PROGRAM_ERROR; break; case 35: - ljam(); + jam(); terrorCode = ZTOO_MANY_INSTRUCTIONS_ERROR; break; case 38: - ljam(); + jam(); terrorCode = ZTEMPORARY_RESOURCE_FAILURE; break; case 39: if (get_trans_state(operPtr.p) == TRANS_TOO_MUCH_AI) { - ljam(); + jam(); terrorCode = ZTOO_MUCH_ATTRINFO_ERROR; } else if (get_trans_state(operPtr.p) == TRANS_ERROR_WAIT_TUPKEYREQ) { - ljam(); + jam(); terrorCode = ZSEIZE_ATTRINBUFREC_ERROR; } else { ndbrequire(false); }//if break; case 40: - ljam(); + jam(); terrorCode = ZUNSUPPORTED_BRANCH; break; default: diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp index 60c0c22ae6c..adac4d3d460 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp @@ -14,28 +14,26 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_BUFFER_CPP #include "Dbtup.hpp" #include #include #include #include -#define ljam() { jamLine(2000 + __LINE__); } -#define ljamEntry() { jamEntryLine(2000 + __LINE__); } - void Dbtup::execSEND_PACKED(Signal* signal) { Uint16 hostId; Uint32 i; Uint32 TpackedListIndex= cpackedListIndex; - ljamEntry(); + jamEntry(); for (i= 0; i < TpackedListIndex; i++) { - ljam(); + jam(); hostId= cpackedList[i]; ndbrequire((hostId - 1) < (MAX_NODES - 1)); // Also check not zero Uint32 TpacketTA= hostBuffer[hostId].noOfPacketsTA; if (TpacketTA != 0) { - ljam(); + jam(); BlockReference TBref= numberToRef(API_PACKED, hostId); Uint32 TpacketLen= hostBuffer[hostId].packetLenTA; MEMCOPY_NO_WORDS(&signal->theData[0], @@ -73,7 +71,7 @@ void Dbtup::bufferTRANSID_AI(Signal* signal, BlockReference aRef, // There is still space in the buffer. We will copy it into the // buffer. // ---------------------------------------------------------------- - ljam(); + jam(); updatePackedList(signal, hostId); } else if (false && TnoOfPackets == 1) { // ---------------------------------------------------------------- @@ -118,7 +116,7 @@ void Dbtup::updatePackedList(Signal* signal, Uint16 hostId) { if (hostBuffer[hostId].inPackedList == false) { Uint32 TpackedListIndex= cpackedListIndex; - ljam(); + jam(); hostBuffer[hostId].inPackedList= true; cpackedList[TpackedListIndex]= hostId; cpackedListIndex= TpackedListIndex + 1; @@ -149,7 +147,7 @@ void Dbtup::sendReadAttrinfo(Signal* signal, if (ERROR_INSERTED(4006) && (nodeId != getOwnNodeId())){ // Use error insert to turn routing on - ljam(); + jam(); connectedToNode= false; } @@ -167,18 +165,18 @@ void Dbtup::sendReadAttrinfo(Signal* signal, * Own node -> execute direct */ if(nodeId != getOwnNodeId()){ - ljam(); + jam(); /** * Send long sig */ if (ToutBufIndex >= 22 && is_api && !old_dest) { - ljam(); + jam(); /** * Flush buffer so that order is maintained */ if (TpacketTA != 0) { - ljam(); + jam(); BlockReference TBref = numberToRef(API_PACKED, nodeId); MEMCOPY_NO_WORDS(&signal->theData[0], &hostBuffer[nodeId].packetBufferTA[0], @@ -202,7 +200,7 @@ void Dbtup::sendReadAttrinfo(Signal* signal, */ #ifndef NDB_NO_DROPPED_SIGNAL if (ToutBufIndex < 22 && is_api){ - ljam(); + jam(); bufferTRANSID_AI(signal, recBlockref, 3+ToutBufIndex); return; } @@ -214,7 +212,7 @@ void Dbtup::sendReadAttrinfo(Signal* signal, Uint32 * src= signal->theData+25; if (ToutBufIndex >= 22){ do { - ljam(); + jam(); MEMCOPY_NO_WORDS(&signal->theData[3], src, 22); sendSignal(recBlockref, GSN_TRANSID_AI, signal, 25, JBB); ToutBufIndex -= 22; @@ -223,14 +221,14 @@ void Dbtup::sendReadAttrinfo(Signal* signal, } if (ToutBufIndex > 0){ - ljam(); + jam(); MEMCOPY_NO_WORDS(&signal->theData[3], src, ToutBufIndex); sendSignal(recBlockref, GSN_TRANSID_AI, signal, 3+ToutBufIndex, JBB); } return; } EXECUTE_DIRECT(block, GSN_TRANSID_AI, signal, 3 + ToutBufIndex); - ljamEntry(); + jamEntry(); return; } @@ -242,7 +240,7 @@ void Dbtup::sendReadAttrinfo(Signal* signal, Uint32 routeBlockref= req_struct->TC_ref; if (true){ // TODO is_api && !old_dest){ - ljam(); + jam(); transIdAI->attrData[0]= recBlockref; LinearSectionPtr ptr[3]; ptr[0].p= &signal->theData[25]; @@ -260,7 +258,7 @@ void Dbtup::sendReadAttrinfo(Signal* signal, Uint32 sent= 0; Uint32 maxLen= TransIdAI::DataLength - 1; while (sent < tot) { - ljam(); + jam(); Uint32 dataLen= (tot - sent > maxLen) ? maxLen : tot - sent; Uint32 sigLen= dataLen + TransIdAI::HeaderLength + 1; MEMCOPY_NO_WORDS(&transIdAI->attrData, diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp index 1f703599cf5..75b4832aafe 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp @@ -14,6 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_COMMIT_CPP #include "Dbtup.hpp" #include #include @@ -21,16 +22,13 @@ #include #include "../dblqh/Dblqh.hpp" -#define ljam() { jamLine(5000 + __LINE__); } -#define ljamEntry() { jamEntryLine(5000 + __LINE__); } - void Dbtup::execTUP_DEALLOCREQ(Signal* signal) { TablerecPtr regTabPtr; FragrecordPtr regFragPtr; Uint32 frag_page_id, frag_id; - ljamEntry(); + jamEntry(); frag_id= signal->theData[0]; regTabPtr.i= signal->theData[1]; @@ -62,7 +60,7 @@ void Dbtup::execTUP_DEALLOCREQ(Signal* signal) if (regTabPtr.p->m_attributes[MM].m_no_of_varsize) { - ljam(); + jam(); free_var_rec(regFragPtr.p, regTabPtr.p, &tmp, pagePtr); } else { free_fix_rec(regFragPtr.p, regTabPtr.p, &tmp, (Fix_page*)pagePtr.p); @@ -78,7 +76,7 @@ void Dbtup::execTUP_WRITELOG_REQ(Signal* signal) Uint32 gci= signal->theData[1]; c_operation_pool.getPtr(loopOpPtr); while (loopOpPtr.p->prevActiveOp != RNIL) { - ljam(); + jam(); loopOpPtr.i= loopOpPtr.p->prevActiveOp; c_operation_pool.getPtr(loopOpPtr); } @@ -87,11 +85,11 @@ void Dbtup::execTUP_WRITELOG_REQ(Signal* signal) signal->theData[0]= loopOpPtr.p->userpointer; signal->theData[1]= gci; if (loopOpPtr.p->nextActiveOp == RNIL) { - ljam(); + jam(); EXECUTE_DIRECT(DBLQH, GSN_LQH_WRITELOG_REQ, signal, 2); return; } - ljam(); + jam(); EXECUTE_DIRECT(DBLQH, GSN_LQH_WRITELOG_REQ, signal, 2); jamEntry(); loopOpPtr.i= loopOpPtr.p->nextActiveOp; @@ -114,16 +112,16 @@ void Dbtup::removeActiveOpList(Operationrec* const regOperPtr, if (regOperPtr->op_struct.in_active_list) { regOperPtr->op_struct.in_active_list= false; if (regOperPtr->nextActiveOp != RNIL) { - ljam(); + jam(); raoOperPtr.i= regOperPtr->nextActiveOp; c_operation_pool.getPtr(raoOperPtr); raoOperPtr.p->prevActiveOp= regOperPtr->prevActiveOp; } else { - ljam(); + jam(); tuple_ptr->m_operation_ptr_i = regOperPtr->prevActiveOp; } if (regOperPtr->prevActiveOp != RNIL) { - ljam(); + jam(); raoOperPtr.i= regOperPtr->prevActiveOp; c_operation_pool.getPtr(raoOperPtr); raoOperPtr.p->nextActiveOp= regOperPtr->nextActiveOp; @@ -343,7 +341,7 @@ Dbtup::disk_page_commit_callback(Signal* signal, Uint32 gci; OperationrecPtr regOperPtr; - ljamEntry(); + jamEntry(); c_operation_pool.getPtr(regOperPtr, opPtrI); c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci); @@ -379,7 +377,7 @@ Dbtup::disk_page_log_buffer_callback(Signal* signal, Uint32 gci; OperationrecPtr regOperPtr; - ljamEntry(); + jamEntry(); c_operation_pool.getPtr(regOperPtr, opPtrI); c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci); @@ -447,7 +445,7 @@ void Dbtup::execTUP_COMMITREQ(Signal* signal) TupCommitReq * const tupCommitReq= (TupCommitReq *)signal->getDataPtr(); regOperPtr.i= tupCommitReq->opPtr; - ljamEntry(); + jamEntry(); c_operation_pool.getPtr(regOperPtr); if(!regOperPtr.p->is_first_operation()) @@ -603,7 +601,7 @@ skip_disk: * why can't we instead remove "own version" (when approriate ofcourse) */ if (!regTabPtr.p->tuxCustomTriggers.isEmpty()) { - ljam(); + jam(); OperationrecPtr loopPtr= regOperPtr; while(loopPtr.i != RNIL) { @@ -656,18 +654,18 @@ Dbtup::set_change_mask_info(KeyReqStruct * const req_struct, { ChangeMaskState state = get_change_mask_state(regOperPtr); if (state == USE_SAVED_CHANGE_MASK) { - ljam(); + jam(); req_struct->changeMask.setWord(0, regOperPtr->saved_change_mask[0]); req_struct->changeMask.setWord(1, regOperPtr->saved_change_mask[1]); } else if (state == RECALCULATE_CHANGE_MASK) { - ljam(); + jam(); // Recompute change mask, for now set all bits req_struct->changeMask.set(); } else if (state == SET_ALL_MASK) { - ljam(); + jam(); req_struct->changeMask.set(); } else { - ljam(); + jam(); ndbrequire(state == DELETE_CHANGES); req_struct->changeMask.set(); } @@ -687,17 +685,17 @@ Dbtup::calculateChangeMask(Page* const pagePtr, ndbrequire(loopOpPtr.p->op_struct.op_type == ZUPDATE); ChangeMaskState change_mask= get_change_mask_state(loopOpPtr.p); if (change_mask == USE_SAVED_CHANGE_MASK) { - ljam(); + jam(); saved_word1|= loopOpPtr.p->saved_change_mask[0]; saved_word2|= loopOpPtr.p->saved_change_mask[1]; } else if (change_mask == RECALCULATE_CHANGE_MASK) { - ljam(); + jam(); //Recompute change mask, for now set all bits req_struct->changeMask.set(); return; } else { ndbrequire(change_mask == SET_ALL_MASK); - ljam(); + jam(); req_struct->changeMask.set(); return; } diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp index ccb0bdcb537..708b4e0e8d7 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp @@ -15,6 +15,7 @@ #define DBTUP_C +#define DBTUP_DEBUG_CPP #include "Dbtup.hpp" #include #include @@ -24,9 +25,6 @@ #include #include -#define ljam() { jamLine(30000 + __LINE__); } -#define ljamEntry() { jamEntryLine(30000 + __LINE__); } - /* **************************************************************** */ /* ---------------------------------------------------------------- */ /* ------------------------ DEBUG MODULE -------------------------- */ @@ -35,7 +33,7 @@ void Dbtup::execDEBUG_SIG(Signal* signal) { PagePtr regPagePtr; - ljamEntry(); + jamEntry(); regPagePtr.i = signal->theData[0]; c_page_pool.getPtr(regPagePtr); }//Dbtup::execDEBUG_SIG() @@ -248,18 +246,18 @@ void Dbtup::execMEMCHECKREQ(Signal* signal) PagePtr regPagePtr; Uint32* data = &signal->theData[0]; - ljamEntry(); + jamEntry(); BlockReference blockref = signal->theData[0]; Uint32 i; for (i = 0; i < 25; i++) { - ljam(); + jam(); data[i] = 0; }//for for (i = 0; i < 16; i++) { regPagePtr.i = cfreepageList[i]; - ljam(); + jam(); while (regPagePtr.i != RNIL) { - ljam(); + jam(); ptrCheckGuard(regPagePtr, cnoOfPage, cpage); regPagePtr.i = regPagePtr.p->next_page; data[0]++; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp index 54abbf18664..496936a4e9e 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp @@ -14,6 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_DISK_ALLOC_CPP #include "Dbtup.hpp" static bool f_undo_done = true; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp index 88a818e6fd7..84421962290 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp @@ -14,14 +14,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_FIXALLOC_CPP #include "Dbtup.hpp" #include #include #include -#define ljam() { jamLine(6000 + __LINE__); } -#define ljamEntry() { jamEntryLine(6000 + __LINE__); } - // // Fixed Allocator // This module is used to allocate and free fixed size tuples from the @@ -79,7 +77,7 @@ Dbtup::alloc_fix_rec(Fragrecord* const regFragPtr, /* ---------------------------------------------------------------- */ pagePtr.i = getEmptyPage(regFragPtr); if (pagePtr.i != RNIL) { - ljam(); + jam(); /* ---------------------------------------------------------------- */ // We found empty pages on the fragment. Allocate an empty page and // convert it into a tuple header page and put it in thFreeFirst-list. @@ -95,14 +93,14 @@ Dbtup::alloc_fix_rec(Fragrecord* const regFragPtr, LocalDLList free_pages(c_page_pool, regFragPtr->thFreeFirst); free_pages.add(pagePtr); } else { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* THERE ARE NO EMPTY PAGES. MEMORY CAN NOT BE ALLOCATED. */ /* ---------------------------------------------------------------- */ return 0; } } else { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* THIS SHOULD BE THE COMMON PATH THROUGH THE CODE, FREE */ /* COPY PAGE EXISTED. */ @@ -194,7 +192,7 @@ void Dbtup::free_fix_rec(Fragrecord* regFragPtr, if(free == 1) { - ljam(); + jam(); PagePtr pagePtr = { (Page*)regPagePtr, key->m_page_no }; LocalDLList free_pages(c_page_pool, regFragPtr->thFreeFirst); ndbrequire(regPagePtr->page_state == ZTH_MM_FULL); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 3e9469c4edf..bdcefffd2e7 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -15,6 +15,7 @@ #define DBTUP_C +#define DBTUP_GEN_CPP #include "Dbtup.hpp" #include #include @@ -34,9 +35,6 @@ #define DEBUG(x) { ndbout << "TUP::" << x << endl; } -#define ljam() { jamLine(24000 + __LINE__); } -#define ljamEntry() { jamEntryLine(24000 + __LINE__); } - void Dbtup::initData() { cnoOfAttrbufrec = ZNO_OF_ATTRBUFREC; @@ -152,21 +150,21 @@ BLOCK_FUNCTIONS(Dbtup) void Dbtup::execCONTINUEB(Signal* signal) { - ljamEntry(); + jamEntry(); Uint32 actionType = signal->theData[0]; Uint32 dataPtr = signal->theData[1]; switch (actionType) { case ZINITIALISE_RECORDS: - ljam(); + jam(); initialiseRecordsLab(signal, dataPtr, signal->theData[2], signal->theData[3]); break; case ZREL_FRAG: - ljam(); + jam(); releaseFragment(signal, dataPtr, signal->theData[2]); break; case ZREPORT_MEMORY_USAGE:{ - ljam(); + jam(); static int c_currentMemUsed = 0; Uint32 cnt = signal->theData[1]; Uint32 tmp = c_page_pool.getSize(); @@ -201,11 +199,11 @@ void Dbtup::execCONTINUEB(Signal* signal) return; } case ZBUILD_INDEX: - ljam(); + jam(); buildIndex(signal, dataPtr); break; case ZTUP_SCAN: - ljam(); + jam(); { ScanOpPtr scanPtr; c_scanOpPool.getPtr(scanPtr, dataPtr); @@ -214,7 +212,7 @@ void Dbtup::execCONTINUEB(Signal* signal) return; case ZFREE_EXTENT: { - ljam(); + jam(); TablerecPtr tabPtr; tabPtr.i= dataPtr; @@ -227,7 +225,7 @@ void Dbtup::execCONTINUEB(Signal* signal) } case ZUNMAP_PAGES: { - ljam(); + jam(); TablerecPtr tabPtr; tabPtr.i= dataPtr; @@ -240,7 +238,7 @@ void Dbtup::execCONTINUEB(Signal* signal) } case ZFREE_VAR_PAGES: { - ljam(); + jam(); drop_fragment_free_var_pages(signal); return; } @@ -257,12 +255,12 @@ void Dbtup::execCONTINUEB(Signal* signal) /* **************************************************************** */ void Dbtup::execSTTOR(Signal* signal) { - ljamEntry(); + jamEntry(); Uint32 startPhase = signal->theData[1]; Uint32 sigKey = signal->theData[6]; switch (startPhase) { case ZSTARTPHASE1: - ljam(); + jam(); CLEAR_ERROR_INSERT_VALUE; ndbrequire((c_lqh= (Dblqh*)globalData.getBlock(DBLQH)) != 0); ndbrequire((c_tsman= (Tsman*)globalData.getBlock(TSMAN)) != 0); @@ -270,7 +268,7 @@ void Dbtup::execSTTOR(Signal* signal) cownref = calcTupBlockRef(0); break; default: - ljam(); + jam(); break; }//switch signal->theData[0] = sigKey; @@ -293,7 +291,7 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal) Uint32 senderData = req->senderData; ndbrequire(req->noOfParameters == 0); - ljamEntry(); + jamEntry(); const ndb_mgm_configuration_iterator * p = m_ctx.m_config.getOwnConfigIterator(); @@ -413,58 +411,58 @@ void Dbtup::initialiseRecordsLab(Signal* signal, Uint32 switchData, { switch (switchData) { case 0: - ljam(); + jam(); initializeHostBuffer(); break; case 1: - ljam(); + jam(); initializeOperationrec(); break; case 2: - ljam(); + jam(); initializePage(); break; case 3: - ljam(); + jam(); break; case 4: - ljam(); + jam(); initializeTablerec(); break; case 5: - ljam(); + jam(); break; case 6: - ljam(); + jam(); initializeFragrecord(); break; case 7: - ljam(); + jam(); initializeFragoperrec(); break; case 8: - ljam(); + jam(); initializePageRange(); break; case 9: - ljam(); + jam(); initializeTabDescr(); break; case 10: - ljam(); + jam(); break; case 11: - ljam(); + jam(); break; case 12: - ljam(); + jam(); initializeAttrbufrec(); break; case 13: - ljam(); + jam(); break; case 14: - ljam(); + jam(); { ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend(); @@ -488,28 +486,28 @@ void Dbtup::initialiseRecordsLab(Signal* signal, Uint32 switchData, void Dbtup::execNDB_STTOR(Signal* signal) { - ljamEntry(); + jamEntry(); cndbcntrRef = signal->theData[0]; Uint32 ownNodeId = signal->theData[1]; Uint32 startPhase = signal->theData[2]; switch (startPhase) { case ZSTARTPHASE1: - ljam(); + jam(); cownNodeId = ownNodeId; cownref = calcTupBlockRef(ownNodeId); break; case ZSTARTPHASE2: - ljam(); + jam(); break; case ZSTARTPHASE3: - ljam(); + jam(); startphase3Lab(signal, ~0, ~0); break; case ZSTARTPHASE4: - ljam(); + jam(); break; case ZSTARTPHASE6: - ljam(); + jam(); /*****************************************/ /* NOW SET THE DISK WRITE SPEED TO */ /* PAGES PER TICK AFTER SYSTEM */ @@ -520,7 +518,7 @@ void Dbtup::execNDB_STTOR(Signal* signal) sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 1); break; default: - ljam(); + jam(); break; }//switch signal->theData[0] = cownref; @@ -597,7 +595,7 @@ void Dbtup::initializeTablerec() { TablerecPtr regTabPtr; for (regTabPtr.i = 0; regTabPtr.i < cnoOfTablerec; regTabPtr.i++) { - ljam(); + jam(); refresh_watch_dog(); ptrAss(regTabPtr, tablerec); initTab(regTabPtr.p); @@ -668,12 +666,12 @@ void Dbtup::initializeTabDescr() void Dbtup::execTUPSEIZEREQ(Signal* signal) { OperationrecPtr regOperPtr; - ljamEntry(); + jamEntry(); Uint32 userPtr = signal->theData[0]; BlockReference userRef = signal->theData[1]; if (!c_operation_pool.seize(regOperPtr)) { - ljam(); + jam(); signal->theData[0] = userPtr; signal->theData[1] = ZGET_OPREC_ERROR; sendSignal(userRef, GSN_TUPSEIZEREF, signal, 2, JBB); @@ -707,7 +705,7 @@ void Dbtup::execTUPSEIZEREQ(Signal* signal) void Dbtup::execTUPRELEASEREQ(Signal* signal) { OperationrecPtr regOperPtr; - ljamEntry(); + jamEntry(); regOperPtr.i = signal->theData[0]; c_operation_pool.getPtr(regOperPtr); set_trans_state(regOperPtr.p, TRANS_DISCONNECTED); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp index 3f42f0151e6..e4a26f8ccd0 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp @@ -14,6 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_INDEX_CPP #include "Dbtup.hpp" #include #include @@ -23,9 +24,6 @@ #include #include -#define ljam() { jamLine(28000 + __LINE__); } -#define ljamEntry() { jamEntryLine(28000 + __LINE__); } - // methods used by ordered index void @@ -34,7 +32,7 @@ Dbtup::tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageIndex, Uint32& tupAddr) { - ljamEntry(); + jamEntry(); PagePtr pagePtr; c_page_pool.getPtr(pagePtr, pageId); Uint32 fragPageId= pagePtr.p->frag_page_id; @@ -48,7 +46,7 @@ Dbtup::tuxAllocNode(Signal* signal, Uint32& pageOffset, Uint32*& node) { - ljamEntry(); + jamEntry(); FragrecordPtr fragPtr; fragPtr.i= fragPtrI; ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); @@ -61,7 +59,7 @@ Dbtup::tuxAllocNode(Signal* signal, Uint32* ptr, frag_page_id; if ((ptr= alloc_fix_rec(fragPtr.p, tablePtr.p, &key, &frag_page_id)) == 0) { - ljam(); + jam(); terrorCode = ZMEM_NOMEM_ERROR; // caller sets error return terrorCode; } @@ -82,7 +80,7 @@ Dbtup::tuxFreeNode(Signal* signal, Uint32 pageOffset, Uint32* node) { - ljamEntry(); + jamEntry(); FragrecordPtr fragPtr; fragPtr.i= fragPtrI; ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); @@ -105,7 +103,7 @@ Dbtup::tuxGetNode(Uint32 fragPtrI, Uint32 pageOffset, Uint32*& node) { - ljamEntry(); + jamEntry(); FragrecordPtr fragPtr; fragPtr.i= fragPtrI; ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); @@ -130,7 +128,7 @@ Dbtup::tuxReadAttrs(Uint32 fragPtrI, Uint32 numAttrs, Uint32* dataOut) { - ljamEntry(); + jamEntry(); // use own variables instead of globals FragrecordPtr fragPtr; fragPtr.i= fragPtrI; @@ -150,21 +148,21 @@ Dbtup::tuxReadAttrs(Uint32 fragPtrI, Tuple_header *tuple_ptr= req_struct.m_tuple_ptr; if (tuple_ptr->get_tuple_version() != tupVersion) { - ljam(); + jam(); OperationrecPtr opPtr; opPtr.i= tuple_ptr->m_operation_ptr_i; Uint32 loopGuard= 0; while (opPtr.i != RNIL) { c_operation_pool.getPtr(opPtr); if (opPtr.p->tupVersion == tupVersion) { - ljam(); + jam(); if (!opPtr.p->m_copy_tuple_location.isNull()) { req_struct.m_tuple_ptr= (Tuple_header*) c_undo_buffer.get_ptr(&opPtr.p->m_copy_tuple_location); } break; } - ljam(); + jam(); opPtr.i= opPtr.p->prevActiveOp; ndbrequire(++loopGuard < (1 << ZTUP_VERSION_BITS)); } @@ -202,7 +200,7 @@ Dbtup::tuxReadAttrs(Uint32 fragPtrI, int Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageIndex, Uint32* dataOut, bool xfrmFlag) { - ljamEntry(); + jamEntry(); // use own variables instead of globals FragrecordPtr fragPtr; fragPtr.i= fragPtrI; @@ -305,7 +303,7 @@ Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageIndex, Uint32* dataO int Dbtup::accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIndex, Uint32* dataOut, bool xfrmFlag) { - ljamEntry(); + jamEntry(); // get table TablerecPtr tablePtr; tablePtr.i = tableId; @@ -329,7 +327,7 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 transId2, Uint32 savePointId) { - ljamEntry(); + jamEntry(); FragrecordPtr fragPtr; fragPtr.i= fragPtrI; ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); @@ -358,9 +356,9 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, * for this transaction and savepoint id. If its tuple version * equals the requested then we have a visible tuple otherwise not. */ - ljam(); + jam(); if (req_struct.m_tuple_ptr->get_tuple_version() == tupVersion) { - ljam(); + jam(); return true; } } @@ -378,7 +376,7 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, void Dbtup::execBUILDINDXREQ(Signal* signal) { - ljamEntry(); + jamEntry(); #ifdef TIME_MEASUREMENT time_events= 0; tot_time_passed= 0; @@ -387,7 +385,7 @@ Dbtup::execBUILDINDXREQ(Signal* signal) // get new operation BuildIndexPtr buildPtr; if (! c_buildIndexList.seize(buildPtr)) { - ljam(); + jam(); BuildIndexRec buildRec; memcpy(buildRec.m_request, signal->theData, sizeof(buildRec.m_request)); buildRec.m_errorCode= BuildIndxRef::Busy; @@ -402,7 +400,7 @@ Dbtup::execBUILDINDXREQ(Signal* signal) do { const BuildIndxReq* buildReq= (const BuildIndxReq*)buildPtr.p->m_request; if (buildReq->getTableId() >= cnoOfTablerec) { - ljam(); + jam(); buildPtr.p->m_errorCode= BuildIndxRef::InvalidPrimaryTable; break; } @@ -410,7 +408,7 @@ Dbtup::execBUILDINDXREQ(Signal* signal) tablePtr.i= buildReq->getTableId(); ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec); if (tablePtr.p->tableStatus != DEFINED) { - ljam(); + jam(); buildPtr.p->m_errorCode= BuildIndxRef::InvalidPrimaryTable; break; } @@ -418,7 +416,7 @@ Dbtup::execBUILDINDXREQ(Signal* signal) buildPtr.p->m_build_vs = tablePtr.p->m_attributes[MM].m_no_of_varsize > 0; if (DictTabInfo::isOrderedIndex(buildReq->getIndexType())) { - ljam(); + jam(); const DLList& triggerList = tablePtr.p->tuxCustomTriggers; @@ -426,13 +424,13 @@ Dbtup::execBUILDINDXREQ(Signal* signal) triggerList.first(triggerPtr); while (triggerPtr.i != RNIL) { if (triggerPtr.p->indexId == buildReq->getIndexId()) { - ljam(); + jam(); break; } triggerList.next(triggerPtr); } if (triggerPtr.i == RNIL) { - ljam(); + jam(); // trigger was not created buildPtr.p->m_errorCode = BuildIndxRef::InternalError; break; @@ -440,12 +438,12 @@ Dbtup::execBUILDINDXREQ(Signal* signal) buildPtr.p->m_indexId = buildReq->getIndexId(); buildPtr.p->m_buildRef = DBTUX; } else if(buildReq->getIndexId() == RNIL) { - ljam(); + jam(); // REBUILD of acc buildPtr.p->m_indexId = RNIL; buildPtr.p->m_buildRef = DBACC; } else { - ljam(); + jam(); buildPtr.p->m_errorCode = BuildIndxRef::InvalidIndexType; break; } @@ -490,7 +488,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) // get fragment FragrecordPtr fragPtr; if (buildPtr.p->m_fragNo == MAX_FRAG_PER_NODE) { - ljam(); + jam(); // build ready buildIndexReply(signal, buildPtr.p); c_buildIndexList.release(buildPtr); @@ -499,7 +497,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) ndbrequire(buildPtr.p->m_fragNo < MAX_FRAG_PER_NODE); fragPtr.i= tablePtr.p->fragrec[buildPtr.p->m_fragNo]; if (fragPtr.i == RNIL) { - ljam(); + jam(); buildPtr.p->m_fragNo++; buildPtr.p->m_pageId= 0; buildPtr.p->m_tupleNo= firstTupleNo; @@ -509,7 +507,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) // get page PagePtr pagePtr; if (buildPtr.p->m_pageId >= fragPtr.p->noOfPages) { - ljam(); + jam(); buildPtr.p->m_fragNo++; buildPtr.p->m_pageId= 0; buildPtr.p->m_tupleNo= firstTupleNo; @@ -520,7 +518,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) Uint32 pageState= pagePtr.p->page_state; // skip empty page if (pageState == ZEMPTY_MM) { - ljam(); + jam(); buildPtr.p->m_pageId++; buildPtr.p->m_tupleNo= firstTupleNo; break; @@ -530,7 +528,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) const Tuple_header* tuple_ptr = 0; pageIndex = buildPtr.p->m_tupleNo * tupheadsize; if (pageIndex + tupheadsize > Fix_page::DATA_WORDS) { - ljam(); + jam(); buildPtr.p->m_pageId++; buildPtr.p->m_tupleNo= firstTupleNo; break; @@ -538,7 +536,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) tuple_ptr = (Tuple_header*)&pagePtr.p->m_data[pageIndex]; // skip over free tuple if (tuple_ptr->m_header_bits & Tuple_header::FREE) { - ljam(); + jam(); buildPtr.p->m_tupleNo++; break; } @@ -581,7 +579,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) tuple as a copy tuple. The original tuple is stable and is thus preferrable to store in TUX. */ - ljam(); + jam(); /** * Since copy tuples now can't be found on real pages. @@ -610,11 +608,11 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) } while(req->errorCode == 0 && pageOperPtr.i != RNIL); } - ljamEntry(); + jamEntry(); if (req->errorCode != 0) { switch (req->errorCode) { case TuxMaintReq::NoMemError: - ljam(); + jam(); buildPtr.p->m_errorCode= BuildIndxRef::AllocationFailure; break; default: @@ -666,7 +664,7 @@ Dbtup::buildIndexReply(Signal* signal, const BuildIndexRec* buildPtrP) rep->setIndexId(buildReq->getIndexId()); // conf if (buildPtrP->m_errorCode == BuildIndxRef::NoError) { - ljam(); + jam(); sendSignal(rep->getUserRef(), GSN_BUILDINDXCONF, signal, BuildIndxConf::SignalLength, JBB); return; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index b5010205880..aa1b1b546ac 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -15,6 +15,7 @@ #define DBTUP_C +#define DBTUP_META_CPP #include "Dbtup.hpp" #include #include @@ -29,16 +30,13 @@ #include "AttributeOffset.hpp" #include -#define ljam() { jamLine(20000 + __LINE__); } -#define ljamEntry() { jamEntryLine(20000 + __LINE__); } - void Dbtup::execTUPFRAGREQ(Signal* signal) { - ljamEntry(); + jamEntry(); TupFragReq* tupFragReq = (TupFragReq*)signal->getDataPtr(); if (tupFragReq->userPtr == (Uint32)-1) { - ljam(); + jam(); abortAddFragOp(signal); return; } @@ -70,7 +68,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) #ifndef VM_TRACE // config mismatch - do not crash if release compiled if (regTabPtr.i >= cnoOfTablerec) { - ljam(); + jam(); tupFragReq->userPtr = userptr; tupFragReq->userRef = 800; sendSignal(userblockref, GSN_TUPFRAGREF, signal, 2, JBB); @@ -80,7 +78,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) ptrCheckGuard(regTabPtr, cnoOfTablerec, tablerec); if (cfirstfreeFragopr == RNIL) { - ljam(); + jam(); tupFragReq->userPtr = userptr; tupFragReq->userRef = ZNOFREE_FRAGOP_ERROR; sendSignal(userblockref, GSN_TUPFRAGREF, signal, 2, JBB); @@ -109,29 +107,29 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) getFragmentrec(regFragPtr, fragId, regTabPtr.p); if (regFragPtr.i != RNIL) { - ljam(); + jam(); terrorCode= ZEXIST_FRAG_ERROR; fragrefuse1Lab(signal, fragOperPtr); return; } if (cfirstfreefrag != RNIL) { - ljam(); + jam(); seizeFragrecord(regFragPtr); } else { - ljam(); + jam(); terrorCode= ZFULL_FRAGRECORD_ERROR; fragrefuse1Lab(signal, fragOperPtr); return; } initFragRange(regFragPtr.p); if (!addfragtotab(regTabPtr.p, fragId, regFragPtr.i)) { - ljam(); + jam(); terrorCode= ZNO_FREE_TAB_ENTRY_ERROR; fragrefuse2Lab(signal, fragOperPtr, regFragPtr); return; } if (cfirstfreerange == RNIL) { - ljam(); + jam(); terrorCode= ZNO_FREE_PAGE_RANGE_ERROR; fragrefuse3Lab(signal, fragOperPtr, regFragPtr, regTabPtr.p, fragId); return; @@ -147,7 +145,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) if (ERROR_INSERTED(4007) && regTabPtr.p->fragid[0] == fragId || ERROR_INSERTED(4008) && regTabPtr.p->fragid[1] == fragId) { - ljam(); + jam(); terrorCode = 1; fragrefuse4Lab(signal, fragOperPtr, regFragPtr, regTabPtr.p, fragId); CLEAR_ERROR_INSERT_VALUE; @@ -155,7 +153,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) } if (regTabPtr.p->tableStatus == NOT_DEFINED) { - ljam(); + jam(); //----------------------------------------------------------------------------- // We are setting up references to the header of the tuple. // Active operation This word contains a reference to the operation active @@ -201,13 +199,13 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) Uint32 offset[10]; Uint32 tableDescriptorRef= allocTabDescr(regTabPtr.p, offset); if (tableDescriptorRef == RNIL) { - ljam(); + jam(); fragrefuse4Lab(signal, fragOperPtr, regFragPtr, regTabPtr.p, fragId); return; } setUpDescriptorReferences(tableDescriptorRef, regTabPtr.p, offset); } else { - ljam(); + jam(); fragOperPtr.p->definingFragment= false; } signal->theData[0]= fragOperPtr.p->lqhPtrFrag; @@ -223,9 +221,9 @@ bool Dbtup::addfragtotab(Tablerec* const regTabPtr, Uint32 fragIndex) { for (Uint32 i = 0; i < MAX_FRAG_PER_NODE; i++) { - ljam(); + jam(); if (regTabPtr->fragid[i] == RNIL) { - ljam(); + jam(); regTabPtr->fragid[i]= fragId; regTabPtr->fragrec[i]= fragIndex; return true; @@ -239,9 +237,9 @@ void Dbtup::getFragmentrec(FragrecordPtr& regFragPtr, Tablerec* const regTabPtr) { for (Uint32 i = 0; i < MAX_FRAG_PER_NODE; i++) { - ljam(); + jam(); if (regTabPtr->fragid[i] == fragId) { - ljam(); + jam(); regFragPtr.i= regTabPtr->fragrec[i]; ptrCheckGuard(regFragPtr, cnoOfFragrec, fragrecord); return; @@ -277,7 +275,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) FragoperrecPtr fragOperPtr; TablerecPtr regTabPtr; - ljamEntry(); + jamEntry(); fragOperPtr.i= signal->theData[0]; ptrCheckGuard(fragOperPtr, cnoOfFragoprec, fragoperrec); Uint32 attrId = signal->theData[2]; @@ -338,7 +336,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) Uint32 attrDes2= 0; if (!AttributeDescriptor::getDynamic(attrDescriptor)) { - ljam(); + jam(); Uint32 pos= 0, null_pos; Uint32 bytes= AttributeDescriptor::getSizeInBytes(attrDescriptor); Uint32 words= (bytes + 3) / 4; @@ -348,7 +346,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) if (AttributeDescriptor::getNullable(attrDescriptor)) { - ljam(); + jam(); fragOperPtr.p->m_null_bits[ind]++; } else @@ -363,17 +361,17 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) switch (AttributeDescriptor::getArrayType(attrDescriptor)) { case NDB_ARRAYTYPE_FIXED: { - ljam(); + jam(); regTabPtr.p->m_attributes[ind].m_no_of_fixsize++; if(attrLen != 0) { - ljam(); + jam(); pos= fragOperPtr.p->m_fix_attributes_size[ind]; fragOperPtr.p->m_fix_attributes_size[ind] += words; } else { - ljam(); + jam(); Uint32 bitCount = AttributeDescriptor::getArraySize(attrDescriptor); fragOperPtr.p->m_null_bits[ind] += bitCount; } @@ -381,7 +379,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) } default: { - ljam(); + jam(); fragOperPtr.p->m_var_attributes_size[ind] += bytes; pos= regTabPtr.p->m_attributes[ind].m_no_of_varsize++; break; @@ -398,13 +396,13 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) ndbrequire(cs != NULL); Uint32 i = 0; while (i < fragOperPtr.p->charsetIndex) { - ljam(); + jam(); if (regTabPtr.p->charsetArray[i] == cs) break; i++; } if (i == fragOperPtr.p->charsetIndex) { - ljam(); + jam(); fragOperPtr.p->charsetIndex++; } ndbrequire(i < regTabPtr.p->noOfCharsets); @@ -417,7 +415,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) ERROR_INSERTED(4010) && regTabPtr.p->fragid[0] == fragId && lastAttr || ERROR_INSERTED(4011) && regTabPtr.p->fragid[1] == fragId && attrId == 0|| ERROR_INSERTED(4012) && regTabPtr.p->fragid[1] == fragId && lastAttr) { - ljam(); + jam(); terrorCode = 1; addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); CLEAR_ERROR_INSERT_VALUE; @@ -428,7 +426,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) /* ************** TUP_ADD_ATTCONF ****************** */ /* **************************************************************** */ if (! lastAttr) { - ljam(); + jam(); signal->theData[0] = fragOperPtr.p->lqhPtrFrag; signal->theData[1] = lastAttr; sendSignal(fragOperPtr.p->lqhBlockrefFrag, GSN_TUP_ADD_ATTCONF, @@ -554,7 +552,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) noAllocatedPages = allocFragPages(regFragPtr.p, noAllocatedPages); if (noAllocatedPages == 0) { - ljam(); + jam(); terrorCode = ZNO_PAGES_ALLOCATED_ERROR; addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); return; @@ -564,7 +562,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) CreateFilegroupImplReq rep; if(regTabPtr.p->m_no_of_disk_attributes) { - ljam(); + jam(); Tablespace_client tsman(0, c_tsman, 0, 0, regFragPtr.p->m_tablespace_id); ndbrequire(tsman.get_tablespace_info(&rep) == 0); @@ -581,12 +579,12 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) if (regTabPtr.p->m_no_of_disk_attributes) { - ljam(); + jam(); if(!(getNodeState().startLevel == NodeState::SL_STARTING && getNodeState().starting.startPhase <= 4)) { Callback cb; - ljam(); + jam(); cb.m_callbackData= fragOperPtr.i; cb.m_callbackFunction = @@ -600,7 +598,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) int res= lgman.get_log_buffer(signal, sz, &cb); switch(res){ case 0: - ljam(); + jam(); signal->theData[0] = 1; return; case -1: @@ -719,11 +717,11 @@ void Dbtup::setUpKeyArray(Tablerec* const regTabPtr) Uint32* keyArray= &tableDescriptor[regTabPtr->readKeyArray].tabDescr; Uint32 countKeyAttr= 0; for (Uint32 i= 0; i < regTabPtr->m_no_of_attributes; i++) { - ljam(); + jam(); Uint32 refAttr= regTabPtr->tabDescriptor + (i * ZAD_SIZE); Uint32 attrDescriptor= getTabDescrWord(refAttr); if (AttributeDescriptor::getPrimaryKey(attrDescriptor)) { - ljam(); + jam(); AttributeHeader::init(&keyArray[countKeyAttr], i, 0); countKeyAttr++; } @@ -743,7 +741,7 @@ void Dbtup::setUpKeyArray(Tablerec* const regTabPtr) { for (Uint32 i= 0; i < regTabPtr->m_no_of_attributes; i++) { - ljam(); + jam(); Uint32 refAttr= regTabPtr->tabDescriptor + (i * ZAD_SIZE); Uint32 desc = getTabDescrWord(refAttr); Uint32 t = 0; @@ -838,9 +836,9 @@ void Dbtup::releaseFragoperrec(FragoperrecPtr fragOperPtr) void Dbtup::deleteFragTab(Tablerec* const regTabPtr, Uint32 fragId) { for (Uint32 i = 0; i < MAX_FRAG_PER_NODE; i++) { - ljam(); + jam(); if (regTabPtr->fragid[i] == fragId) { - ljam(); + jam(); regTabPtr->fragid[i]= RNIL; regTabPtr->fragrec[i]= RNIL; return; @@ -866,7 +864,7 @@ void Dbtup::abortAddFragOp(Signal* signal) void Dbtup::execDROP_TAB_REQ(Signal* signal) { - ljamEntry(); + jamEntry(); if (ERROR_INSERTED(4013)) { #ifdef VM_TRACE verifytabdes(); @@ -892,7 +890,7 @@ void Dbtup::releaseTabDescr(Tablerec* const regTabPtr) { Uint32 descriptor= regTabPtr->readKeyArray; if (descriptor != RNIL) { - ljam(); + jam(); Uint32 offset[10]; getTabDescrOffsets(regTabPtr, offset); @@ -923,16 +921,16 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, Uint32 fragId = RNIL; Uint32 i = 0; for (i = 0; i < MAX_FRAG_PER_NODE; i++) { - ljam(); + jam(); if (tabPtr.p->fragid[i] != RNIL) { - ljam(); + jam(); fragIndex= tabPtr.p->fragrec[i]; fragId= tabPtr.p->fragid[i]; break; } } if (fragIndex != RNIL) { - ljam(); + jam(); signal->theData[0] = ZUNMAP_PAGES; signal->theData[1] = tabPtr.i; @@ -957,7 +955,7 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, int res= lgman.get_log_buffer(signal, sz, &cb); switch(res){ case 0: - ljam(); + jam(); return; case -1: ndbrequire("NOT YET IMPLEMENTED" == 0); @@ -1088,7 +1086,7 @@ Dbtup::drop_fragment_free_extent(Signal *signal, int res= lgman.get_log_buffer(signal, sz, &cb); switch(res){ case 0: - ljam(); + jam(); return; case -1: ndbrequire("NOT YET IMPLEMENTED" == 0); @@ -1239,7 +1237,7 @@ Dbtup::drop_fragment_free_extent_log_buffer_callback(Signal* signal, void Dbtup::drop_fragment_free_var_pages(Signal* signal) { - ljam(); + jam(); Uint32 tableId = signal->theData[1]; Uint32 fragPtrI = signal->theData[2]; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp index 73755494207..d10fabf42da 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp @@ -14,14 +14,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_PAG_MAN_CPP #include "Dbtup.hpp" #include #include #include -#define ljam() { jamLine(16000 + __LINE__); } -#define ljamEntry() { jamEntryLine(16000 + __LINE__); } - /* ---------------------------------------------------------------- */ // 4) Page Memory Manager (buddy algorithm) // @@ -121,7 +119,7 @@ void Dbtup::initializePage() }//for PagePtr pagePtr; for (pagePtr.i = 0; pagePtr.i < c_page_pool.getSize(); pagePtr.i++) { - ljam(); + jam(); refresh_watch_dog(); c_page_pool.getPtr(pagePtr); pagePtr.p->physical_page_id= RNIL; @@ -153,16 +151,16 @@ void Dbtup::allocConsPages(Uint32 noOfPagesToAllocate, Uint32& allocPageRef) { if (noOfPagesToAllocate == 0){ - ljam(); + jam(); noOfPagesAllocated = 0; return; }//if Uint32 firstListToCheck = nextHigherTwoLog(noOfPagesToAllocate - 1); for (Uint32 i = firstListToCheck; i < 16; i++) { - ljam(); + jam(); if (cfreepageList[i] != RNIL) { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* PROPER AMOUNT OF PAGES WERE FOUND. NOW SPLIT THE FOUND */ /* AREA AND RETURN THE PART NOT NEEDED. */ @@ -182,11 +180,11 @@ void Dbtup::allocConsPages(Uint32 noOfPagesToAllocate, /* ---------------------------------------------------------------- */ if (firstListToCheck) { - ljam(); + jam(); for (Uint32 j = firstListToCheck - 1; (Uint32)~j; j--) { - ljam(); + jam(); if (cfreepageList[j] != RNIL) { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* SOME AREA WAS FOUND, ALLOCATE ALL OF IT. */ /* ---------------------------------------------------------------- */ @@ -212,9 +210,9 @@ void Dbtup::allocConsPages(Uint32 noOfPagesToAllocate, void Dbtup::returnCommonArea(Uint32 retPageRef, Uint32 retNo) { do { - ljam(); + jam(); if (retNo == 0) { - ljam(); + jam(); return; }//if Uint32 list = nextHigherTwoLog(retNo) - 1; @@ -231,28 +229,28 @@ void Dbtup::findFreeLeftNeighbours(Uint32& allocPageRef, PagePtr pageFirstPtr, pageLastPtr; Uint32 remainAllocate = noOfPagesToAllocate - noPagesAllocated; while (allocPageRef > 0) { - ljam(); + jam(); pageLastPtr.i = allocPageRef - 1; c_page_pool.getPtr(pageLastPtr); if (pageLastPtr.p->page_state != ZFREE_COMMON) { - ljam(); + jam(); return; } else { - ljam(); + jam(); pageFirstPtr.i = pageLastPtr.p->first_cluster_page; ndbrequire(pageFirstPtr.i != RNIL); Uint32 list = nextHigherTwoLog(pageLastPtr.i - pageFirstPtr.i); removeCommonArea(pageFirstPtr.i, list); Uint32 listSize = 1 << list; if (listSize > remainAllocate) { - ljam(); + jam(); Uint32 retNo = listSize - remainAllocate; returnCommonArea(pageFirstPtr.i, retNo); allocPageRef = pageFirstPtr.i + retNo; noPagesAllocated = noOfPagesToAllocate; return; } else { - ljam(); + jam(); allocPageRef = pageFirstPtr.i; noPagesAllocated += listSize; remainAllocate -= listSize; @@ -268,32 +266,32 @@ void Dbtup::findFreeRightNeighbours(Uint32& allocPageRef, PagePtr pageFirstPtr, pageLastPtr; Uint32 remainAllocate = noOfPagesToAllocate - noPagesAllocated; if (remainAllocate == 0) { - ljam(); + jam(); return; }//if while ((allocPageRef + noPagesAllocated) < c_page_pool.getSize()) { - ljam(); + jam(); pageFirstPtr.i = allocPageRef + noPagesAllocated; c_page_pool.getPtr(pageFirstPtr); if (pageFirstPtr.p->page_state != ZFREE_COMMON) { - ljam(); + jam(); return; } else { - ljam(); + jam(); pageLastPtr.i = pageFirstPtr.p->last_cluster_page; ndbrequire(pageLastPtr.i != RNIL); Uint32 list = nextHigherTwoLog(pageLastPtr.i - pageFirstPtr.i); removeCommonArea(pageFirstPtr.i, list); Uint32 listSize = 1 << list; if (listSize > remainAllocate) { - ljam(); + jam(); Uint32 retPageRef = pageFirstPtr.i + remainAllocate; Uint32 retNo = listSize - remainAllocate; returnCommonArea(retPageRef, retNo); noPagesAllocated += remainAllocate; return; } else { - ljam(); + jam(); noPagesAllocated += listSize; remainAllocate -= listSize; }//if @@ -328,30 +326,30 @@ void Dbtup::removeCommonArea(Uint32 remPageRef, Uint32 list) c_page_pool.getPtr(remPagePtr, remPageRef); ndbrequire(list < 16); if (cfreepageList[list] == remPagePtr.i) { - ljam(); + jam(); cfreepageList[list] = remPagePtr.p->next_cluster_page; pageNextPtr.i = cfreepageList[list]; if (pageNextPtr.i != RNIL) { - ljam(); + jam(); c_page_pool.getPtr(pageNextPtr); pageNextPtr.p->prev_cluster_page = RNIL; }//if } else { pageSearchPtr.i = cfreepageList[list]; while (true) { - ljam(); + jam(); c_page_pool.getPtr(pageSearchPtr); pagePrevPtr = pageSearchPtr; pageSearchPtr.i = pageSearchPtr.p->next_cluster_page; if (pageSearchPtr.i == remPagePtr.i) { - ljam(); + jam(); break; }//if }//while pageNextPtr.i = remPagePtr.p->next_cluster_page; pagePrevPtr.p->next_cluster_page = pageNextPtr.i; if (pageNextPtr.i != RNIL) { - ljam(); + jam(); c_page_pool.getPtr(pageNextPtr); pageNextPtr.p->prev_cluster_page = pagePrevPtr.i; }//if diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp index 26373708b66..cbbbc1fa56c 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp @@ -15,14 +15,12 @@ #define DBTUP_C +#define DBTUP_PAGE_MAP_CPP #include "Dbtup.hpp" #include #include #include -#define ljam() { jamLine(14000 + __LINE__); } -#define ljamEntry() { jamEntryLine(14000 + __LINE__); } - // // PageMap is a service used by Dbtup to map logical page id's to physical // page id's. The mapping is needs the fragment and the logical page id to @@ -92,11 +90,11 @@ Uint32 Dbtup::getEmptyPage(Fragrecord* regFragPtr) { Uint32 pageId = regFragPtr->emptyPrimPage.firstItem; if (pageId == RNIL) { - ljam(); + jam(); allocMoreFragPages(regFragPtr); pageId = regFragPtr->emptyPrimPage.firstItem; if (pageId == RNIL) { - ljam(); + jam(); return RNIL; }//if }//if @@ -122,11 +120,11 @@ Uint32 Dbtup::getRealpid(Fragrecord* regFragPtr, Uint32 logicalPageId) loopLimit = grpPageRangePtr.p->currentIndexPos; ndbrequire(loopLimit <= 3); for (Uint32 i = 0; i <= loopLimit; i++) { - ljam(); + jam(); if (grpPageRangePtr.p->startRange[i] <= logicalPageId) { if (grpPageRangePtr.p->endRange[i] >= logicalPageId) { if (grpPageRangePtr.p->type[i] == ZLEAF) { - ljam(); + jam(); Uint32 realPageId = (logicalPageId - grpPageRangePtr.p->startRange[i]) + grpPageRangePtr.p->basePageId[i]; return realPageId; @@ -167,12 +165,12 @@ bool Dbtup::insertPageRangeTab(Fragrecord* const regFragPtr, { PageRangePtr currPageRangePtr; if (cfirstfreerange == RNIL) { - ljam(); + jam(); return false; }//if currPageRangePtr.i = regFragPtr->currentPageRange; if (currPageRangePtr.i == RNIL) { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* THE FIRST PAGE RANGE IS HANDLED WITH SPECIAL CODE */ /* ---------------------------------------------------------------- */ @@ -181,10 +179,10 @@ bool Dbtup::insertPageRangeTab(Fragrecord* const regFragPtr, currPageRangePtr.p->currentIndexPos = 0; currPageRangePtr.p->parentPtr = RNIL; } else { - ljam(); + jam(); ptrCheckGuard(currPageRangePtr, cnoOfPageRangeRec, pageRange); if (currPageRangePtr.p->currentIndexPos < 3) { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* THE SIMPLE CASE WHEN IT IS ONLY NECESSARY TO FILL IN THE */ /* NEXT EMPTY POSITION IN THE PAGE RANGE RECORD IS TREATED */ @@ -192,7 +190,7 @@ bool Dbtup::insertPageRangeTab(Fragrecord* const regFragPtr, /* ---------------------------------------------------------------- */ currPageRangePtr.p->currentIndexPos++; } else { - ljam(); + jam(); ndbrequire(currPageRangePtr.p->currentIndexPos == 3); currPageRangePtr.i = leafPageRangeFull(regFragPtr, currPageRangePtr); if (currPageRangePtr.i == RNIL) { @@ -223,15 +221,15 @@ bool Dbtup::insertPageRangeTab(Fragrecord* const regFragPtr, PageRangePtr loopPageRangePtr; loopPageRangePtr = currPageRangePtr; while (true) { - ljam(); + jam(); loopPageRangePtr.i = loopPageRangePtr.p->parentPtr; if (loopPageRangePtr.i != RNIL) { - ljam(); + jam(); ptrCheckGuard(loopPageRangePtr, cnoOfPageRangeRec, pageRange); ndbrequire(loopPageRangePtr.p->currentIndexPos < 4); loopPageRangePtr.p->endRange[loopPageRangePtr.p->currentIndexPos] += noPages; } else { - ljam(); + jam(); break; }//if }//while @@ -243,26 +241,26 @@ bool Dbtup::insertPageRangeTab(Fragrecord* const regFragPtr, void Dbtup::releaseFragPages(Fragrecord* regFragPtr) { if (regFragPtr->rootPageRange == RNIL) { - ljam(); + jam(); return; }//if PageRangePtr regPRPtr; regPRPtr.i = regFragPtr->rootPageRange; ptrCheckGuard(regPRPtr, cnoOfPageRangeRec, pageRange); while (true) { - ljam(); + jam(); const Uint32 indexPos = regPRPtr.p->currentIndexPos; ndbrequire(indexPos < 4); const Uint32 basePageId = regPRPtr.p->basePageId[indexPos]; regPRPtr.p->basePageId[indexPos] = RNIL; if (basePageId == RNIL) { - ljam(); + jam(); /** * Finished with indexPos continue with next */ if (indexPos > 0) { - ljam(); + jam(); regPRPtr.p->currentIndexPos--; continue; }//if @@ -274,13 +272,13 @@ void Dbtup::releaseFragPages(Fragrecord* regFragPtr) releasePagerange(regPRPtr); if (parentPtr != RNIL) { - ljam(); + jam(); regPRPtr.i = parentPtr; ptrCheckGuard(regPRPtr, cnoOfPageRangeRec, pageRange); continue; }//if - ljam(); + jam(); ndbrequire(regPRPtr.i == regFragPtr->rootPageRange); initFragRange(regFragPtr); for (Uint32 i = 0; inextStartRange; if (!insertPageRangeTab(regFragPtr, retPageRef, noOfPagesAllocated)) { - ljam(); + jam(); returnCommonArea(retPageRef, noOfPagesAllocated); return tafpPagesAllocated; }//if @@ -388,7 +386,7 @@ Uint32 Dbtup::allocFragPages(Fragrecord* regFragPtr, Uint32 tafpNoAllocRequested /* ---------------------------------------------------------------- */ Uint32 prev = RNIL; for (loopPagePtr.i = retPageRef; loopPagePtr.i < loopLimit; loopPagePtr.i++) { - ljam(); + jam(); c_page_pool.getPtr(loopPagePtr); loopPagePtr.p->page_state = ZEMPTY_MM; loopPagePtr.p->frag_page_id = startRange + @@ -416,10 +414,10 @@ Uint32 Dbtup::allocFragPages(Fragrecord* regFragPtr, Uint32 tafpNoAllocRequested /* WAS ENOUGH PAGES ALLOCATED OR ARE MORE NEEDED. */ /* ---------------------------------------------------------------- */ if (tafpPagesAllocated < tafpNoAllocRequested) { - ljam(); + jam(); } else { ndbrequire(tafpPagesAllocated == tafpNoAllocRequested); - ljam(); + jam(); return tafpNoAllocRequested; }//if }//while @@ -451,15 +449,15 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr parentPageRangePtr = currPageRangePtr; Uint32 tiprNoLevels = 1; while (true) { - ljam(); + jam(); parentPageRangePtr.i = parentPageRangePtr.p->parentPtr; if (parentPageRangePtr.i == RNIL) { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* WE HAVE REACHED THE ROOT. A NEW ROOT MUST BE ALLOCATED. */ /* ---------------------------------------------------------------- */ if (c_noOfFreePageRanges < tiprNoLevels) { - ljam(); + jam(); return RNIL; }//if PageRangePtr oldRootPRPtr; @@ -482,10 +480,10 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr foundPageRangePtr = newRootPRPtr; break; } else { - ljam(); + jam(); ptrCheckGuard(parentPageRangePtr, cnoOfPageRangeRec, pageRange); if (parentPageRangePtr.p->currentIndexPos < 3) { - ljam(); + jam(); /* ---------------------------------------------------------------- */ /* WE HAVE FOUND AN EMPTY ENTRY IN A PAGE RANGE RECORD. */ /* ALLOCATE A NEW PAGE RANGE RECORD, FILL IN THE START RANGE, */ @@ -498,7 +496,7 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr foundPageRangePtr = parentPageRangePtr; break; } else { - ljam(); + jam(); ndbrequire(parentPageRangePtr.p->currentIndexPos == 3); /* ---------------------------------------------------------------- */ /* THE PAGE RANGE RECORD WAS FULL. FIND THE PARENT RECORD */ @@ -516,7 +514,7 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr PageRangePtr prevPageRangePtr; prevPageRangePtr = foundPageRangePtr; if (c_noOfFreePageRanges < tiprNoLevels) { - ljam(); + jam(); return RNIL; }//if /* ---------------------------------------------------------------- */ @@ -527,7 +525,7 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr /* ARE ALSO PROPERLY UPDATED ON THE PATH TO THE LEAF LEVEL. */ /* ---------------------------------------------------------------- */ while (true) { - ljam(); + jam(); seizePagerange(newPageRangePtr); tiprNoLevels--; ndbrequire(prevPageRangePtr.p->currentIndexPos < 4); @@ -535,13 +533,13 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr newPageRangePtr.p->parentPtr = prevPageRangePtr.i; newPageRangePtr.p->currentIndexPos = 0; if (tiprNoLevels > 0) { - ljam(); + jam(); newPageRangePtr.p->startRange[0] = regFragPtr->nextStartRange; newPageRangePtr.p->endRange[0] = regFragPtr->nextStartRange - 1; newPageRangePtr.p->type[0] = ZNON_LEAF; prevPageRangePtr = newPageRangePtr; } else { - ljam(); + jam(); break; }//if }//while @@ -576,16 +574,16 @@ void Dbtup::errorHandler(Uint32 errorCode) { switch (errorCode) { case 0: - ljam(); + jam(); break; case 1: - ljam(); + jam(); break; case 2: - ljam(); + jam(); break; default: - ljam(); + jam(); } ndbrequire(false); }//Dbtup::errorHandler() diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index c8546209f94..44c0092811c 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -15,6 +15,7 @@ #define DBTUP_C +#define DBTUP_ROUTINES_CPP #include "Dbtup.hpp" #include #include @@ -23,9 +24,6 @@ #include "AttributeOffset.hpp" #include -#define ljam() { jamLine(3000 + __LINE__); } -#define ljamEntry() { jamEntryLine(3000 + __LINE__); } - void Dbtup::setUpQueryRoutines(Tablerec *regTabPtr) { @@ -40,23 +38,23 @@ Dbtup::setUpQueryRoutines(Tablerec *regTabPtr) if (AttributeDescriptor::getArrayType(attrDescr) == NDB_ARRAYTYPE_FIXED){ if (!AttributeDescriptor::getNullable(attrDescr)) { if (AttributeDescriptor::getSize(attrDescr) == 0){ - ljam(); + jam(); regTabPtr->readFunctionArray[i] = &Dbtup::readBitsNotNULL; regTabPtr->updateFunctionArray[i] = &Dbtup::updateBitsNotNULL; } else if (AttributeDescriptor::getSizeInBytes(attrDescr) == 4) { - ljam(); + jam(); regTabPtr->readFunctionArray[i]= &Dbtup::readFixedSizeTHOneWordNotNULL; regTabPtr->updateFunctionArray[i]= &Dbtup::updateFixedSizeTHOneWordNotNULL; } else if (AttributeDescriptor::getSizeInBytes(attrDescr) == 8) { - ljam(); + jam(); regTabPtr->readFunctionArray[i]= &Dbtup::readFixedSizeTHTwoWordNotNULL; regTabPtr->updateFunctionArray[i]= &Dbtup::updateFixedSizeTHTwoWordNotNULL; } else { - ljam(); + jam(); regTabPtr->readFunctionArray[i]= &Dbtup::readFixedSizeTHManyWordNotNULL; regTabPtr->updateFunctionArray[i]= @@ -64,27 +62,27 @@ Dbtup::setUpQueryRoutines(Tablerec *regTabPtr) } // replace functions for char attribute if (AttributeOffset::getCharsetFlag(attrOffset)) { - ljam(); + jam(); regTabPtr->readFunctionArray[i] = &Dbtup::readFixedSizeTHManyWordNotNULL; regTabPtr->updateFunctionArray[i] = &Dbtup::updateFixedSizeTHManyWordNotNULL; } } else { if (AttributeDescriptor::getSize(attrDescr) == 0){ - ljam(); + jam(); regTabPtr->readFunctionArray[i] = &Dbtup::readBitsNULLable; regTabPtr->updateFunctionArray[i] = &Dbtup::updateBitsNULLable; } else if (AttributeDescriptor::getSizeInBytes(attrDescr) == 4){ - ljam(); + jam(); regTabPtr->readFunctionArray[i] = &Dbtup::readFixedSizeTHOneWordNULLable; regTabPtr->updateFunctionArray[i] = &Dbtup::updateFixedSizeTHManyWordNULLable; } else if (AttributeDescriptor::getSizeInBytes(attrDescr) == 8) { - ljam(); + jam(); regTabPtr->readFunctionArray[i]= &Dbtup::readFixedSizeTHTwoWordNULLable; regTabPtr->updateFunctionArray[i]= &Dbtup::updateFixedSizeTHManyWordNULLable; } else { - ljam(); + jam(); regTabPtr->readFunctionArray[i]= &Dbtup::readFixedSizeTHManyWordNULLable; regTabPtr->updateFunctionArray[i]= @@ -92,7 +90,7 @@ Dbtup::setUpQueryRoutines(Tablerec *regTabPtr) } // replace functions for char attribute if (AttributeOffset::getCharsetFlag(attrOffset)) { - ljam(); + jam(); regTabPtr->readFunctionArray[i] = &Dbtup::readFixedSizeTHManyWordNULLable; regTabPtr->updateFunctionArray[i] = &Dbtup::updateFixedSizeTHManyWordNULLable; } @@ -144,7 +142,7 @@ Dbtup::setUpQueryRoutines(Tablerec *regTabPtr) } } else { if (AttributeDescriptor::getArrayType(attrDescr) == NDB_ARRAYTYPE_FIXED){ - ljam(); + jam(); regTabPtr->readFunctionArray[i]= &Dbtup::readDynFixedSize; regTabPtr->updateFunctionArray[i]= &Dbtup::updateDynFixedSize; } else { @@ -204,7 +202,7 @@ int Dbtup::readAttributes(KeyReqStruct *req_struct, inBufIndex++; attributeId= ahIn.getAttributeId(); descr_index= attributeId << ZAD_LOG_SIZE; - ljam(); + jam(); AttributeHeader::init(&outBuffer[tmpAttrBufIndex], attributeId, 0); ahOut= (AttributeHeader*)&outBuffer[tmpAttrBufIndex]; @@ -223,7 +221,7 @@ int Dbtup::readAttributes(KeyReqStruct *req_struct, return -1; } } else if(attributeId & AttributeHeader::PSEUDO) { - ljam(); + jam(); Uint32 sz= read_pseudo(attributeId, req_struct, outBuffer+tmpAttrBufIndex+1); @@ -252,13 +250,13 @@ Dbtup::readFixedSizeTHOneWordNotNULL(Uint32* outBuffer, ndbrequire(readOffset < req_struct->check_offset[MM]); if (newIndexBuf <= maxRead) { - ljam(); + jam(); outBuffer[indexBuf]= wordRead; ahOut->setDataSize(1); req_struct->out_buf_index= newIndexBuf; return true; } else { - ljam(); + jam(); terrorCode= ZTRY_TO_READ_TOO_MUCH_ERROR; return false; } @@ -280,14 +278,14 @@ Dbtup::readFixedSizeTHTwoWordNotNULL(Uint32* outBuffer, ndbrequire(readOffset + 1 < req_struct->check_offset[MM]); if (newIndexBuf <= maxRead) { - ljam(); + jam(); ahOut->setDataSize(2); outBuffer[indexBuf]= wordReadFirst; outBuffer[indexBuf + 1]= wordReadSecond; req_struct->out_buf_index= newIndexBuf; return true; } else { - ljam(); + jam(); terrorCode= ZTRY_TO_READ_TOO_MUCH_ERROR; return false; } @@ -311,7 +309,7 @@ Dbtup::readFixedSizeTHManyWordNotNULL(Uint32* outBuffer, if (! charsetFlag || ! req_struct->xfrm_flag) { Uint32 newIndexBuf = indexBuf + attrNoOfWords; if (newIndexBuf <= maxRead) { - ljam(); + jam(); ahOut->setByteSize(AttributeDescriptor::getSizeInBytes(attrDescriptor)); MEMCOPY_NO_WORDS(&outBuffer[indexBuf], &tuple_header[readOffset], @@ -319,11 +317,11 @@ Dbtup::readFixedSizeTHManyWordNotNULL(Uint32* outBuffer, req_struct->out_buf_index = newIndexBuf; return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; }//if } else { - ljam(); + jam(); Tablerec* regTabPtr = tabptr.p; Uint32 srcBytes = AttributeDescriptor::getSizeInBytes(attrDescriptor); uchar* dstPtr = (uchar*)&outBuffer[indexBuf]; @@ -340,7 +338,7 @@ Dbtup::readFixedSizeTHManyWordNotNULL(Uint32* outBuffer, Uint32 dstLen = xmul * (srcBytes - lb); Uint32 maxIndexBuf = indexBuf + (dstLen >> 2); if (maxIndexBuf <= maxRead && ok) { - ljam(); + jam(); const char* ssrcPtr = (const char*)srcPtr; int n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len); ndbrequire(n != -1); @@ -354,7 +352,7 @@ Dbtup::readFixedSizeTHManyWordNotNULL(Uint32* outBuffer, req_struct->out_buf_index = newIndexBuf; return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; } } @@ -368,13 +366,13 @@ Dbtup::readFixedSizeTHOneWordNULLable(Uint32* outBuffer, Uint32 attrDes2) { if (!nullFlagCheck(req_struct, attrDes2)) { - ljam(); + jam(); return readFixedSizeTHOneWordNotNULL(outBuffer, req_struct, ahOut, attrDes2); } else { - ljam(); + jam(); ahOut->setNULL(); return true; } @@ -387,13 +385,13 @@ Dbtup::readFixedSizeTHTwoWordNULLable(Uint32* outBuffer, Uint32 attrDes2) { if (!nullFlagCheck(req_struct, attrDes2)) { - ljam(); + jam(); return readFixedSizeTHTwoWordNotNULL(outBuffer, req_struct, ahOut, attrDes2); } else { - ljam(); + jam(); ahOut->setNULL(); return true; } @@ -406,13 +404,13 @@ Dbtup::readFixedSizeTHManyWordNULLable(Uint32* outBuffer, Uint32 attrDes2) { if (!nullFlagCheck(req_struct, attrDes2)) { - ljam(); + jam(); return readFixedSizeTHManyWordNotNULL(outBuffer, req_struct, ahOut, attrDes2); } else { - ljam(); + jam(); ahOut->setNULL(); return true; } @@ -424,9 +422,9 @@ Dbtup::readFixedSizeTHZeroWordNULLable(Uint32* outBuffer, AttributeHeader* ahOut, Uint32 attrDes2) { - ljam(); + jam(); if (nullFlagCheck(req_struct, attrDes2)) { - ljam(); + jam(); ahOut->setNULL(); } return true; @@ -478,7 +476,7 @@ Dbtup::readVarSizeNotNULL(Uint32* out_buffer, if (! charsetFlag || ! req_struct->xfrm_flag) { if (new_index <= max_read) { - ljam(); + jam(); ah_out->setByteSize(vsize_in_bytes); out_buffer[index_buf + (vsize_in_bytes >> 2)] = 0; memcpy(out_buffer+index_buf, @@ -490,7 +488,7 @@ Dbtup::readVarSizeNotNULL(Uint32* out_buffer, } else { - ljam(); + jam(); Tablerec* regTabPtr = tabptr.p; Uint32 maxBytes = AttributeDescriptor::getSizeInBytes(attr_descriptor); Uint32 srcBytes = vsize_in_bytes; @@ -509,7 +507,7 @@ Dbtup::readVarSizeNotNULL(Uint32* out_buffer, Uint32 dstLen = xmul * (maxBytes - lb); Uint32 maxIndexBuf = index_buf + (dstLen >> 2); if (maxIndexBuf <= max_read && ok) { - ljam(); + jam(); const char* ssrcPtr = (const char*)srcPtr; int n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len); ndbrequire(n != -1); @@ -524,7 +522,7 @@ Dbtup::readVarSizeNotNULL(Uint32* out_buffer, return true; } } - ljam(); + jam(); terrorCode= ZTRY_TO_READ_TOO_MUCH_ERROR; return false; } @@ -536,13 +534,13 @@ Dbtup::readVarSizeNULLable(Uint32* outBuffer, Uint32 attrDes2) { if (!nullFlagCheck(req_struct, attrDes2)) { - ljam(); + jam(); return readVarSizeNotNULL(outBuffer, req_struct, ahOut, attrDes2); } else { - ljam(); + jam(); ahOut->setNULL(); return true; } @@ -554,7 +552,7 @@ Dbtup::readDynFixedSize(Uint32* outBuffer, AttributeHeader* ahOut, Uint32 attrDes2) { - ljam(); + jam(); terrorCode= ZVAR_SIZED_NOT_SUPPORTED; return false; } @@ -565,7 +563,7 @@ Dbtup::readDynVarSize(Uint32* outBuffer, AttributeHeader* ahOut, Uint32 attrDes2) { - ljam(); + jam(); terrorCode= ZVAR_SIZED_NOT_SUPPORTED; return false; }//Dbtup::readDynBigVarSize() @@ -588,7 +586,7 @@ Dbtup::readDiskFixedSizeNotNULL(Uint32* outBuffer, if (! charsetFlag || ! req_struct->xfrm_flag) { Uint32 newIndexBuf = indexBuf + attrNoOfWords; if (newIndexBuf <= maxRead) { - ljam(); + jam(); ahOut->setByteSize(AttributeDescriptor::getSizeInBytes(attrDescriptor)); MEMCOPY_NO_WORDS(&outBuffer[indexBuf], &tuple_header[readOffset], @@ -596,11 +594,11 @@ Dbtup::readDiskFixedSizeNotNULL(Uint32* outBuffer, req_struct->out_buf_index = newIndexBuf; return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; }//if } else { - ljam(); + jam(); Tablerec* regTabPtr = tabptr.p; Uint32 srcBytes = AttributeDescriptor::getSizeInBytes(attrDescriptor); uchar* dstPtr = (uchar*)&outBuffer[indexBuf]; @@ -617,7 +615,7 @@ Dbtup::readDiskFixedSizeNotNULL(Uint32* outBuffer, Uint32 dstLen = xmul * (srcBytes - lb); Uint32 maxIndexBuf = indexBuf + (dstLen >> 2); if (maxIndexBuf <= maxRead && ok) { - ljam(); + jam(); const char* ssrcPtr = (const char*)srcPtr; int n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len); ndbrequire(n != -1); @@ -631,7 +629,7 @@ Dbtup::readDiskFixedSizeNotNULL(Uint32* outBuffer, req_struct->out_buf_index = newIndexBuf; return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; } } @@ -645,13 +643,13 @@ Dbtup::readDiskFixedSizeNULLable(Uint32* outBuffer, Uint32 attrDes2) { if (!disk_nullFlagCheck(req_struct, attrDes2)) { - ljam(); + jam(); return readDiskFixedSizeNotNULL(outBuffer, req_struct, ahOut, attrDes2); } else { - ljam(); + jam(); ahOut->setNULL(); return true; } @@ -680,7 +678,7 @@ Dbtup::readDiskVarSizeNotNULL(Uint32* out_buffer, ndbrequire(vsize_in_words <= max_var_size); if (new_index <= max_read) { - ljam(); + jam(); ah_out->setByteSize(vsize_in_bytes); memcpy(out_buffer+index_buf, req_struct->m_var_data[DD].m_data_ptr+var_attr_pos, @@ -688,7 +686,7 @@ Dbtup::readDiskVarSizeNotNULL(Uint32* out_buffer, req_struct->out_buf_index= new_index; return true; } else { - ljam(); + jam(); terrorCode= ZTRY_TO_READ_TOO_MUCH_ERROR; return false; } @@ -701,13 +699,13 @@ Dbtup::readDiskVarSizeNULLable(Uint32* outBuffer, Uint32 attrDes2) { if (!disk_nullFlagCheck(req_struct, attrDes2)) { - ljam(); + jam(); return readDiskVarSizeNotNULL(outBuffer, req_struct, ahOut, attrDes2); } else { - ljam(); + jam(); ahOut->setNULL(); return true; } @@ -749,13 +747,13 @@ int Dbtup::updateAttributes(KeyReqStruct *req_struct, if (checkUpdateOfPrimaryKey(req_struct, &inBuffer[inBufIndex], regTabPtr)) { - ljam(); + jam(); terrorCode= ZTRY_UPDATE_PRIMARY_KEY; return -1; } } UpdateFunction f= regTabPtr->updateFunctionArray[attributeId]; - ljam(); + jam(); req_struct->attr_descriptor= attrDescriptor; req_struct->changeMask.set(attributeId); if (attributeId >= 64) { @@ -771,13 +769,13 @@ int Dbtup::updateAttributes(KeyReqStruct *req_struct, inBufIndex= req_struct->in_buf_index; continue; } else { - ljam(); + jam(); return -1; } } else if(attributeId == AttributeHeader::DISK_REF) { - ljam(); + jam(); Uint32 sz= ahIn.getDataSize(); ndbrequire(sz == 2); req_struct->m_tuple_ptr->m_header_bits |= Tuple_header::DISK_PART; @@ -788,7 +786,7 @@ int Dbtup::updateAttributes(KeyReqStruct *req_struct, } else { - ljam(); + jam(); terrorCode= ZATTRIBUTE_ID_ERROR; return -1; } @@ -842,13 +840,13 @@ Dbtup::checkUpdateOfPrimaryKey(KeyReqStruct* req_struct, ndbrequire(req_struct->out_buf_index == ahOut->getDataSize()); if (ahIn.getDataSize() != ahOut->getDataSize()) { - ljam(); + jam(); return true; } if (memcmp(&keyReadBuffer[0], &updateBuffer[1], req_struct->out_buf_index << 2) != 0) { - ljam(); + jam(); return true; } return false; @@ -871,17 +869,17 @@ Dbtup::updateFixedSizeTHOneWordNotNULL(Uint32* inBuffer, if (newIndex <= inBufLen) { Uint32 updateWord= inBuffer[indexBuf + 1]; if (!nullIndicator) { - ljam(); + jam(); req_struct->in_buf_index= newIndex; tuple_header[updateOffset]= updateWord; return true; } else { - ljam(); + jam(); terrorCode= ZNOT_NULL_ATTR; return false; } } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -906,18 +904,18 @@ Dbtup::updateFixedSizeTHTwoWordNotNULL(Uint32* inBuffer, Uint32 updateWord1= inBuffer[indexBuf + 1]; Uint32 updateWord2= inBuffer[indexBuf + 2]; if (!nullIndicator) { - ljam(); + jam(); req_struct->in_buf_index= newIndex; tuple_header[updateOffset]= updateWord1; tuple_header[updateOffset + 1]= updateWord2; return true; } else { - ljam(); + jam(); terrorCode= ZNOT_NULL_ATTR; return false; } } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -943,9 +941,9 @@ Dbtup::updateFixedSizeTHManyWordNotNULL(Uint32* inBuffer, if (newIndex <= inBufLen) { if (!nullIndicator) { - ljam(); + jam(); if (charsetFlag) { - ljam(); + jam(); Tablerec* regTabPtr = tabptr.p; Uint32 typeId = AttributeDescriptor::getType(attrDescriptor); Uint32 bytes = AttributeDescriptor::getSizeInBytes(attrDescriptor); @@ -957,14 +955,14 @@ Dbtup::updateFixedSizeTHManyWordNotNULL(Uint32* inBuffer, const char* ssrc = (const char*)&inBuffer[indexBuf + 1]; Uint32 lb, len; if (! NdbSqlUtil::get_var_length(typeId, ssrc, bytes, lb, len)) { - ljam(); + jam(); terrorCode = ZINVALID_CHAR_FORMAT; return false; } // fast fix bug#7340 if (typeId != NDB_TYPE_TEXT && (*cs->cset->well_formed_len)(cs, ssrc + lb, ssrc + lb + len, ZNIL, ¬_used) != len) { - ljam(); + jam(); terrorCode = ZINVALID_CHAR_FORMAT; return false; } @@ -976,12 +974,12 @@ Dbtup::updateFixedSizeTHManyWordNotNULL(Uint32* inBuffer, return true; } else { - ljam(); + jam(); terrorCode= ZNOT_NULL_ATTR; return false; } } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -999,7 +997,7 @@ Dbtup::updateFixedSizeTHManyWordNULLable(Uint32* inBuffer, Uint32 *bits= req_struct->m_tuple_ptr->get_null_bits(regTabPtr); if (!nullIndicator) { - ljam(); + jam(); BitmaskImpl::clear(regTabPtr->m_offsets[MM].m_null_words, bits, pos); return updateFixedSizeTHManyWordNotNULL(inBuffer, req_struct, @@ -1008,11 +1006,11 @@ Dbtup::updateFixedSizeTHManyWordNULLable(Uint32* inBuffer, Uint32 newIndex= req_struct->in_buf_index + 1; if (newIndex <= req_struct->in_buf_len) { BitmaskImpl::set(regTabPtr->m_offsets[MM].m_null_words, bits, pos); - ljam(); + jam(); req_struct->in_buf_index= newIndex; return true; } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -1046,7 +1044,7 @@ Dbtup::updateVarSizeNotNULL(Uint32* in_buffer, if (new_index <= in_buf_len && vsize_in_words <= max_var_size) { if (!null_ind) { - ljam(); + jam(); var_attr_pos= vpos_array[var_index]; var_data_start= req_struct->m_var_data[MM].m_data_ptr; vpos_array[var_index+idx]= var_attr_pos+size_in_bytes; @@ -1057,12 +1055,12 @@ Dbtup::updateVarSizeNotNULL(Uint32* in_buffer, size_in_bytes); return true; } else { - ljam(); + jam(); terrorCode= ZNOT_NULL_ATTR; return false; } } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -1082,7 +1080,7 @@ Dbtup::updateVarSizeNULLable(Uint32* inBuffer, Uint32 idx= req_struct->m_var_data[MM].m_var_len_offset; if (!nullIndicator) { - ljam(); + jam(); BitmaskImpl::clear(regTabPtr->m_offsets[MM].m_null_words, bits, pos); return updateVarSizeNotNULL(inBuffer, req_struct, @@ -1092,13 +1090,13 @@ Dbtup::updateVarSizeNULLable(Uint32* inBuffer, Uint32 var_index= AttributeOffset::getOffset(attrDes2); Uint32 var_pos= req_struct->var_pos_array[var_index]; if (newIndex <= req_struct->in_buf_len) { - ljam(); + jam(); BitmaskImpl::set(regTabPtr->m_offsets[MM].m_null_words, bits, pos); req_struct->var_pos_array[var_index+idx]= var_pos; req_struct->in_buf_index= newIndex; return true; } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -1110,7 +1108,7 @@ Dbtup::updateDynFixedSize(Uint32* inBuffer, KeyReqStruct *req_struct, Uint32 attrDes2) { - ljam(); + jam(); terrorCode= ZVAR_SIZED_NOT_SUPPORTED; return false; } @@ -1120,7 +1118,7 @@ Dbtup::updateDynVarSize(Uint32* inBuffer, KeyReqStruct *req_struct, Uint32 attrDes2) { - ljam(); + jam(); terrorCode= ZVAR_SIZED_NOT_SUPPORTED; return false; } @@ -1218,7 +1216,7 @@ Dbtup::readBitsNotNULL(Uint32* outBuffer, Uint32 maxRead = req_struct->max_read; Uint32 *bits= req_struct->m_tuple_ptr->get_null_bits(regTabPtr); if (newIndexBuf <= maxRead) { - ljam(); + jam(); ahOut->setDataSize((bitCount + 31) >> 5); req_struct->out_buf_index = newIndexBuf; @@ -1227,7 +1225,7 @@ Dbtup::readBitsNotNULL(Uint32* outBuffer, return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; return false; }//if @@ -1251,20 +1249,20 @@ Dbtup::readBitsNULLable(Uint32* outBuffer, if(BitmaskImpl::get(regTabPtr->m_offsets[MM].m_null_words, bits, pos)) { - ljam(); + jam(); ahOut->setNULL(); return true; } if (newIndexBuf <= maxRead) { - ljam(); + jam(); ahOut->setDataSize((bitCount + 31) >> 5); req_struct->out_buf_index = newIndexBuf; BitmaskImpl::getField(regTabPtr->m_offsets[MM].m_null_words, bits, pos+1, bitCount, outBuffer+indexBuf); return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; return false; }//if @@ -1293,12 +1291,12 @@ Dbtup::updateBitsNotNULL(Uint32* inBuffer, req_struct->in_buf_index = newIndex; return true; } else { - ljam(); + jam(); terrorCode = ZNOT_NULL_ATTR; return false; }//if } else { - ljam(); + jam(); terrorCode = ZAI_INCONSISTENCY_ERROR; return false; }//if @@ -1331,13 +1329,13 @@ Dbtup::updateBitsNULLable(Uint32* inBuffer, Uint32 newIndex = indexBuf + 1; if (newIndex <= req_struct->in_buf_len) { - ljam(); + jam(); BitmaskImpl::set(regTabPtr->m_offsets[MM].m_null_words, bits, pos); req_struct->in_buf_index = newIndex; return true; } else { - ljam(); + jam(); terrorCode = ZAI_INCONSISTENCY_ERROR; return false; }//if @@ -1364,9 +1362,9 @@ Dbtup::updateDiskFixedSizeNotNULL(Uint32* inBuffer, if (newIndex <= inBufLen) { if (!nullIndicator) { - ljam(); + jam(); if (charsetFlag) { - ljam(); + jam(); Tablerec* regTabPtr = tabptr.p; Uint32 typeId = AttributeDescriptor::getType(attrDescriptor); Uint32 bytes = AttributeDescriptor::getSizeInBytes(attrDescriptor); @@ -1378,14 +1376,14 @@ Dbtup::updateDiskFixedSizeNotNULL(Uint32* inBuffer, const char* ssrc = (const char*)&inBuffer[indexBuf + 1]; Uint32 lb, len; if (! NdbSqlUtil::get_var_length(typeId, ssrc, bytes, lb, len)) { - ljam(); + jam(); terrorCode = ZINVALID_CHAR_FORMAT; return false; } // fast fix bug#7340 if (typeId != NDB_TYPE_TEXT && (*cs->cset->well_formed_len)(cs, ssrc + lb, ssrc + lb + len, ZNIL, ¬_used) != len) { - ljam(); + jam(); terrorCode = ZINVALID_CHAR_FORMAT; return false; } @@ -1396,12 +1394,12 @@ Dbtup::updateDiskFixedSizeNotNULL(Uint32* inBuffer, noOfWords); return true; } else { - ljam(); + jam(); terrorCode= ZNOT_NULL_ATTR; return false; } } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -1419,7 +1417,7 @@ Dbtup::updateDiskFixedSizeNULLable(Uint32* inBuffer, Uint32 *bits= req_struct->m_disk_ptr->get_null_bits(regTabPtr, DD); if (!nullIndicator) { - ljam(); + jam(); BitmaskImpl::clear(regTabPtr->m_offsets[DD].m_null_words, bits, pos); return updateDiskFixedSizeNotNULL(inBuffer, req_struct, @@ -1428,11 +1426,11 @@ Dbtup::updateDiskFixedSizeNULLable(Uint32* inBuffer, Uint32 newIndex= req_struct->in_buf_index + 1; if (newIndex <= req_struct->in_buf_len) { BitmaskImpl::set(regTabPtr->m_offsets[DD].m_null_words, bits, pos); - ljam(); + jam(); req_struct->in_buf_index= newIndex; return true; } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -1466,7 +1464,7 @@ Dbtup::updateDiskVarSizeNotNULL(Uint32* in_buffer, if (new_index <= in_buf_len && vsize_in_words <= max_var_size) { if (!null_ind) { - ljam(); + jam(); var_attr_pos= vpos_array[var_index]; var_data_start= req_struct->m_var_data[DD].m_data_ptr; vpos_array[var_index+idx]= var_attr_pos+size_in_bytes; @@ -1477,12 +1475,12 @@ Dbtup::updateDiskVarSizeNotNULL(Uint32* in_buffer, size_in_bytes); return true; } else { - ljam(); + jam(); terrorCode= ZNOT_NULL_ATTR; return false; } } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -1502,7 +1500,7 @@ Dbtup::updateDiskVarSizeNULLable(Uint32* inBuffer, Uint32 idx= req_struct->m_var_data[DD].m_var_len_offset; if (!nullIndicator) { - ljam(); + jam(); BitmaskImpl::clear(regTabPtr->m_offsets[DD].m_null_words, bits, pos); return updateDiskVarSizeNotNULL(inBuffer, req_struct, @@ -1512,13 +1510,13 @@ Dbtup::updateDiskVarSizeNULLable(Uint32* inBuffer, Uint32 var_index= AttributeOffset::getOffset(attrDes2); Uint32 var_pos= req_struct->var_pos_array[var_index]; if (newIndex <= req_struct->in_buf_len) { - ljam(); + jam(); BitmaskImpl::set(regTabPtr->m_offsets[DD].m_null_words, bits, pos); req_struct->var_pos_array[var_index+idx]= var_pos; req_struct->in_buf_index= newIndex; return true; } else { - ljam(); + jam(); terrorCode= ZAI_INCONSISTENCY_ERROR; return false; } @@ -1540,7 +1538,7 @@ Dbtup::readDiskBitsNotNULL(Uint32* outBuffer, Uint32 maxRead = req_struct->max_read; Uint32 *bits= req_struct->m_disk_ptr->get_null_bits(regTabPtr, DD); if (newIndexBuf <= maxRead) { - ljam(); + jam(); ahOut->setDataSize((bitCount + 31) >> 5); req_struct->out_buf_index = newIndexBuf; @@ -1549,7 +1547,7 @@ Dbtup::readDiskBitsNotNULL(Uint32* outBuffer, return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; return false; }//if @@ -1573,20 +1571,20 @@ Dbtup::readDiskBitsNULLable(Uint32* outBuffer, if(BitmaskImpl::get(regTabPtr->m_offsets[DD].m_null_words, bits, pos)) { - ljam(); + jam(); ahOut->setNULL(); return true; } if (newIndexBuf <= maxRead) { - ljam(); + jam(); ahOut->setDataSize((bitCount + 31) >> 5); req_struct->out_buf_index = newIndexBuf; BitmaskImpl::getField(regTabPtr->m_offsets[DD].m_null_words, bits, pos+1, bitCount, outBuffer+indexBuf); return true; } else { - ljam(); + jam(); terrorCode = ZTRY_TO_READ_TOO_MUCH_ERROR; return false; }//if @@ -1615,12 +1613,12 @@ Dbtup::updateDiskBitsNotNULL(Uint32* inBuffer, req_struct->in_buf_index = newIndex; return true; } else { - ljam(); + jam(); terrorCode = ZNOT_NULL_ATTR; return false; }//if } else { - ljam(); + jam(); terrorCode = ZAI_INCONSISTENCY_ERROR; return false; }//if @@ -1653,13 +1651,13 @@ Dbtup::updateDiskBitsNULLable(Uint32* inBuffer, Uint32 newIndex = indexBuf + 1; if (newIndex <= req_struct->in_buf_len) { - ljam(); + jam(); BitmaskImpl::set(regTabPtr->m_offsets[DD].m_null_words, bits, pos); req_struct->in_buf_index = newIndex; return true; } else { - ljam(); + jam(); terrorCode = ZAI_INCONSISTENCY_ERROR; return false; }//if diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index 653a24ba6a1..b1627ca7652 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -14,6 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_SCAN_CPP #include "Dbtup.hpp" #include #include diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp index b2c42418418..c1ccf5952da 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp @@ -15,14 +15,12 @@ #define DBTUP_C +#define DBTUP_STORE_PROC_DEF_CPP #include "Dbtup.hpp" #include #include #include -#define ljam() { jamLine(18000 + __LINE__); } -#define ljamEntry() { jamEntryLine(18000 + __LINE__); } - /* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */ /* ------------ADD/DROP STORED PROCEDURE MODULE ------------------- */ @@ -32,7 +30,7 @@ void Dbtup::execSTORED_PROCREQ(Signal* signal) { OperationrecPtr regOperPtr; TablerecPtr regTabPtr; - ljamEntry(); + jamEntry(); regOperPtr.i = signal->theData[0]; c_operation_pool.getPtr(regOperPtr); regTabPtr.i = signal->theData[1]; @@ -46,17 +44,17 @@ void Dbtup::execSTORED_PROCREQ(Signal* signal) ndbrequire(regTabPtr.p->tableStatus == DEFINED); switch (requestInfo) { case ZSCAN_PROCEDURE: - ljam(); + jam(); scanProcedure(signal, regOperPtr.p, signal->theData[4]); break; case ZCOPY_PROCEDURE: - ljam(); + jam(); copyProcedure(signal, regTabPtr, regOperPtr.p); break; case ZSTORED_PROCEDURE_DELETE: - ljam(); + jam(); deleteScanProcedure(signal, regOperPtr.p); break; default: @@ -124,14 +122,14 @@ void Dbtup::copyProcedure(Signal* signal, AttributeHeader::init(&signal->theData[length + 1], Ti, 0); length++; if (length == 24) { - ljam(); + jam(); ndbrequire(storedProcedureAttrInfo(signal, regOperPtr, signal->theData+1, length, true)); length = 0; }//if }//for if (length != 0) { - ljam(); + jam(); ndbrequire(storedProcedureAttrInfo(signal, regOperPtr, signal->theData+1, length, true)); }//if @@ -155,7 +153,7 @@ bool Dbtup::storedProcedureAttrInfo(Signal* signal, ndbrequire(regOperPtr->currentAttrinbufLen <= regOperPtr->attrinbufLen); if ((RnoFree > MIN_ATTRBUF) || (copyProcedure)) { - ljam(); + jam(); regAttrPtr.i = cfirstfreeAttrbufrec; ptrCheckGuard(regAttrPtr, cnoOfAttrbufrec, attrbufrec); regAttrPtr.p->attrbuf[ZBUF_DATA_LEN] = 0; @@ -163,18 +161,18 @@ bool Dbtup::storedProcedureAttrInfo(Signal* signal, cnoFreeAttrbufrec = RnoFree - 1; regAttrPtr.p->attrbuf[ZBUF_NEXT] = RNIL; } else { - ljam(); + jam(); storedSeizeAttrinbufrecErrorLab(signal, regOperPtr); return false; }//if if (regOperPtr->firstAttrinbufrec == RNIL) { - ljam(); + jam(); regOperPtr->firstAttrinbufrec = regAttrPtr.i; }//if regAttrPtr.p->attrbuf[ZBUF_NEXT] = RNIL; if (regOperPtr->lastAttrinbufrec != RNIL) { AttrbufrecPtr tempAttrinbufptr; - ljam(); + jam(); tempAttrinbufptr.i = regOperPtr->lastAttrinbufrec; ptrCheckGuard(tempAttrinbufptr, cnoOfAttrbufrec, attrbufrec); tempAttrinbufptr.p->attrbuf[ZBUF_NEXT] = regAttrPtr.i; @@ -187,7 +185,7 @@ bool Dbtup::storedProcedureAttrInfo(Signal* signal, length); if (regOperPtr->currentAttrinbufLen < regOperPtr->attrinbufLen) { - ljam(); + jam(); return true; }//if if (ERROR_INSERTED(4005) && !copyProcedure) { diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp index b85a2a8394d..6406bdefe1e 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp @@ -15,14 +15,12 @@ #define DBTUP_C +#define DBTUP_TAB_DES_MAN_CPP #include "Dbtup.hpp" #include #include #include -#define ljam() { jamLine(22000 + __LINE__); } -#define ljamEntry() { jamEntryLine(22000 + __LINE__); } - /* * TABLE DESCRIPTOR MEMORY MANAGER * @@ -65,30 +63,30 @@ Uint32 Dbtup::allocTabDescr(const Tablerec* regTabPtr, Uint32* offset) allocSize = (((allocSize - 1) >> 4) + 1) << 4; Uint32 list = nextHigherTwoLog(allocSize - 1); /* CALCULATE WHICH LIST IT BELONGS TO */ for (Uint32 i = list; i < 16; i++) { - ljam(); + jam(); if (cfreeTdList[i] != RNIL) { - ljam(); + jam(); reference = cfreeTdList[i]; removeTdArea(reference, i); /* REMOVE THE AREA FROM THE FREELIST */ Uint32 retNo = (1 << i) - allocSize; /* CALCULATE THE DIFFERENCE */ if (retNo >= ZTD_FREE_SIZE) { - ljam(); + jam(); // return unused words, of course without attempting left merge Uint32 retRef = reference + allocSize; freeTabDescr(retRef, retNo, false); } else { - ljam(); + jam(); allocSize = 1 << i; }//if break; }//if }//for if (reference == RNIL) { - ljam(); + jam(); terrorCode = ZMEM_NOTABDESCR_ERROR; return RNIL; } else { - ljam(); + jam(); setTabDescrWord((reference + allocSize) - ZTD_TR_TYPE, ZTD_TYPE_NORMAL); setTabDescrWord(reference + ZTD_DATASIZE, allocSize); @@ -105,7 +103,7 @@ void Dbtup::freeTabDescr(Uint32 retRef, Uint32 retNo, bool normal) { itdaMergeTabDescr(retRef, retNo, normal); /* MERGE WITH POSSIBLE NEIGHBOURS */ while (retNo >= ZTD_FREE_SIZE) { - ljam(); + jam(); Uint32 list = nextHigherTwoLog(retNo); list--; /* RETURN TO NEXT LOWER LIST */ Uint32 sizeOfChunk = 1 << list; @@ -136,7 +134,7 @@ void Dbtup::insertTdArea(Uint32 tabDesRef, Uint32 list) setTabDescrWord(tabDesRef + ZTD_FL_HEADER, ZTD_TYPE_FREE); setTabDescrWord(tabDesRef + ZTD_FL_NEXT, cfreeTdList[list]); if (cfreeTdList[list] != RNIL) { - ljam(); /* PREVIOUSLY EMPTY SLOT */ + jam(); /* PREVIOUSLY EMPTY SLOT */ setTabDescrWord(cfreeTdList[list] + ZTD_FL_PREV, tabDesRef); }//if cfreeTdList[list] = tabDesRef; /* RELINK THE LIST */ @@ -156,28 +154,28 @@ void Dbtup::itdaMergeTabDescr(Uint32& retRef, Uint32& retNo, bool normal) { // merge right while ((retRef + retNo) < cnoOfTabDescrRec) { - ljam(); + jam(); Uint32 tabDesRef = retRef + retNo; Uint32 headerWord = getTabDescrWord(tabDesRef + ZTD_FL_HEADER); if (headerWord == ZTD_TYPE_FREE) { - ljam(); + jam(); Uint32 sizeOfMergedPart = getTabDescrWord(tabDesRef + ZTD_FL_SIZE); retNo += sizeOfMergedPart; Uint32 list = nextHigherTwoLog(sizeOfMergedPart - 1); removeTdArea(tabDesRef, list); } else { - ljam(); + jam(); break; } } // merge left const bool mergeLeft = normal; while (mergeLeft && retRef > 0) { - ljam(); + jam(); Uint32 trailerWord = getTabDescrWord(retRef - ZTD_TR_TYPE); if (trailerWord == ZTD_TYPE_FREE) { - ljam(); + jam(); Uint32 sizeOfMergedPart = getTabDescrWord(retRef - ZTD_TR_SIZE); ndbrequire(retRef >= sizeOfMergedPart); retRef -= sizeOfMergedPart; @@ -185,7 +183,7 @@ void Dbtup::itdaMergeTabDescr(Uint32& retRef, Uint32& retNo, bool normal) Uint32 list = nextHigherTwoLog(sizeOfMergedPart - 1); removeTdArea(retRef, list); } else { - ljam(); + jam(); break; } } @@ -213,15 +211,15 @@ void Dbtup::removeTdArea(Uint32 tabDesRef, Uint32 list) setTabDescrWord((tabDesRef + (1 << list)) - ZTD_TR_TYPE, ZTD_TYPE_NORMAL); if (tabDesRef == cfreeTdList[list]) { - ljam(); + jam(); cfreeTdList[list] = tabDescrNextPtr; /* RELINK THE LIST */ }//if if (tabDescrNextPtr != RNIL) { - ljam(); + jam(); setTabDescrWord(tabDescrNextPtr + ZTD_FL_PREV, tabDescrPrevPtr); }//if if (tabDescrPrevPtr != RNIL) { - ljam(); + jam(); setTabDescrWord(tabDescrPrevPtr + ZTD_FL_NEXT, tabDescrNextPtr); }//if }//Dbtup::removeTdArea() diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp index 9615047540b..0c6a1491543 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp @@ -15,6 +15,7 @@ #define DBTUP_C +#define DBTUP_TRIGGER_CPP #include "Dbtup.hpp" #include #include @@ -26,9 +27,6 @@ #include #include -#define ljam() { jamLine(7000 + __LINE__); } -#define ljamEntry() { jamEntryLine(7000 + __LINE__); } - /* **************************************************************** */ /* ---------------------------------------------------------------- */ /* ----------------------- TRIGGER HANDLING ----------------------- */ @@ -47,17 +45,17 @@ Dbtup::findTriggerList(Tablerec* table, case TriggerType::SUBSCRIPTION_BEFORE: switch (tevent) { case TriggerEvent::TE_INSERT: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_DETACHED) tlist = &table->subscriptionInsertTriggers; break; case TriggerEvent::TE_UPDATE: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_DETACHED) tlist = &table->subscriptionUpdateTriggers; break; case TriggerEvent::TE_DELETE: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_DETACHED) tlist = &table->subscriptionDeleteTriggers; break; @@ -68,17 +66,17 @@ Dbtup::findTriggerList(Tablerec* table, case TriggerType::SECONDARY_INDEX: switch (tevent) { case TriggerEvent::TE_INSERT: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_AFTER) tlist = &table->afterInsertTriggers; break; case TriggerEvent::TE_UPDATE: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_AFTER) tlist = &table->afterUpdateTriggers; break; case TriggerEvent::TE_DELETE: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_AFTER) tlist = &table->afterDeleteTriggers; break; @@ -89,7 +87,7 @@ Dbtup::findTriggerList(Tablerec* table, case TriggerType::ORDERED_INDEX: switch (tevent) { case TriggerEvent::TE_CUSTOM: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_CUSTOM) tlist = &table->tuxCustomTriggers; break; @@ -100,7 +98,7 @@ Dbtup::findTriggerList(Tablerec* table, case TriggerType::READ_ONLY_CONSTRAINT: switch (tevent) { case TriggerEvent::TE_UPDATE: - ljam(); + jam(); if (ttime == TriggerActionTime::TA_AFTER) tlist = &table->constraintUpdateTriggers; break; @@ -118,7 +116,7 @@ Dbtup::findTriggerList(Tablerec* table, void Dbtup::execCREATE_TRIG_REQ(Signal* signal) { - ljamEntry(); + jamEntry(); BlockReference senderRef = signal->getSendersBlockRef(); const CreateTrigReq reqCopy = *(const CreateTrigReq*)signal->getDataPtr(); const CreateTrigReq* const req = &reqCopy; @@ -131,13 +129,13 @@ Dbtup::execCREATE_TRIG_REQ(Signal* signal) if (tabPtr.p->tableStatus != DEFINED ) { - ljam(); + jam(); error= CreateTrigRef::InvalidTable; } // Create trigger and associate it with the table else if (createTrigger(tabPtr.p, req)) { - ljam(); + jam(); // Send conf CreateTrigConf* const conf = (CreateTrigConf*)signal->getDataPtrSend(); conf->setUserRef(reference()); @@ -153,7 +151,7 @@ Dbtup::execCREATE_TRIG_REQ(Signal* signal) } else { - ljam(); + jam(); error= CreateTrigRef::TooManyTriggers; } ndbassert(error != CreateTrigRef::NoError); @@ -174,7 +172,7 @@ Dbtup::execCREATE_TRIG_REQ(Signal* signal) void Dbtup::execDROP_TRIG_REQ(Signal* signal) { - ljamEntry(); + jamEntry(); BlockReference senderRef = signal->getSendersBlockRef(); const DropTrigReq reqCopy = *(const DropTrigReq*)signal->getDataPtr(); const DropTrigReq* const req = &reqCopy; @@ -262,7 +260,7 @@ Dbtup::createTrigger(Tablerec* table, const CreateTrigReq* req) if ((tptr.p->triggerType == TriggerType::SUBSCRIPTION) && ((tptr.p->triggerEvent == TriggerEvent::TE_UPDATE) || (tptr.p->triggerEvent == TriggerEvent::TE_DELETE))) { - ljam(); + jam(); tptr.p->sendBeforeValues = false; } /* @@ -270,7 +268,7 @@ Dbtup::createTrigger(Tablerec* table, const CreateTrigReq* req) if (((tptr.p->triggerType == TriggerType::SUBSCRIPTION) || (tptr.p->triggerType == TriggerType::SUBSCRIPTION_BEFORE)) && (tptr.p->triggerEvent == TriggerEvent::TE_UPDATE)) { - ljam(); + jam(); tptr.p->sendOnlyChangedAttributes = true; } */ @@ -282,16 +280,16 @@ Dbtup::createTrigger(Tablerec* table, const CreateTrigReq* req) tptr.p->attributeMask.clear(); if (tptr.p->monitorAllAttributes) { - ljam(); + jam(); for(Uint32 i = 0; i < table->m_no_of_attributes; i++) { if (!primaryKey(table, i)) { - ljam(); + jam(); tptr.p->attributeMask.set(i); } } } else { // Set attribute mask - ljam(); + jam(); tptr.p->attributeMask = req->getAttributeMask(); } return true; @@ -336,7 +334,7 @@ Dbtup::dropTrigger(Tablerec* table, const DropTrigReq* req, BlockNumber sender) Ptr ptr; for (tlist->first(ptr); !ptr.isNull(); tlist->next(ptr)) { - ljam(); + jam(); if (ptr.p->triggerId == triggerId) { if(ttype==TriggerType::SUBSCRIPTION && sender != ptr.p->m_receiverBlock) { @@ -348,10 +346,10 @@ Dbtup::dropTrigger(Tablerec* table, const DropTrigReq* req, BlockNumber sender) * * Backup doesn't really care about the Ids though. */ - ljam(); + jam(); continue; } - ljam(); + jam(); tlist->release(ptr.i); return 0; } @@ -379,7 +377,7 @@ Dbtup::checkImmediateTriggersAfterInsert(KeyReqStruct *req_struct, if ((regOperPtr->op_struct.primary_replica) && (!(regTablePtr->afterInsertTriggers.isEmpty()))) { - ljam(); + jam(); fireImmediateTriggers(req_struct, regTablePtr->afterInsertTriggers, regOperPtr); @@ -397,14 +395,14 @@ Dbtup::checkImmediateTriggersAfterUpdate(KeyReqStruct *req_struct, if ((regOperPtr->op_struct.primary_replica) && (!(regTablePtr->afterUpdateTriggers.isEmpty()))) { - ljam(); + jam(); fireImmediateTriggers(req_struct, regTablePtr->afterUpdateTriggers, regOperPtr); } if ((regOperPtr->op_struct.primary_replica) && (!(regTablePtr->constraintUpdateTriggers.isEmpty()))) { - ljam(); + jam(); fireImmediateTriggers(req_struct, regTablePtr->constraintUpdateTriggers, regOperPtr); @@ -422,7 +420,7 @@ Dbtup::checkImmediateTriggersAfterDelete(KeyReqStruct *req_struct, if ((regOperPtr->op_struct.primary_replica) && (!(regTablePtr->afterDeleteTriggers.isEmpty()))) { - ljam(); + jam(); executeTriggers(req_struct, regTablePtr->afterDeleteTriggers, regOperPtr); @@ -443,7 +441,7 @@ void Dbtup::checkDeferredTriggers(Signal* signal, Operationrec* const regOperPtr, Tablerec* const regTablePtr) { - ljam(); + jam(); // NYI }//Dbtup::checkDeferredTriggers() #endif @@ -479,7 +477,7 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, if (save_ptr->m_header_bits & Tuple_header::ALLOC) { if (save_type == ZDELETE) { // insert + delete = nothing - ljam(); + jam(); return; goto end; } @@ -495,10 +493,10 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, switch(regOperPtr->op_struct.op_type) { case(ZINSERT): - ljam(); + jam(); if (regTablePtr->subscriptionInsertTriggers.isEmpty()) { // Table has no active triggers monitoring inserts at commit - ljam(); + jam(); goto end; } @@ -508,10 +506,10 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, regOperPtr); break; case(ZDELETE): - ljam(); + jam(); if (regTablePtr->subscriptionDeleteTriggers.isEmpty()) { // Table has no active triggers monitoring deletes at commit - ljam(); + jam(); goto end; } @@ -522,10 +520,10 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, regOperPtr); break; case(ZUPDATE): - ljam(); + jam(); if (regTablePtr->subscriptionUpdateTriggers.isEmpty()) { // Table has no active triggers monitoring updates at commit - ljam(); + jam(); goto end; } @@ -553,10 +551,10 @@ Dbtup::fireImmediateTriggers(KeyReqStruct *req_struct, TriggerPtr trigPtr; triggerList.first(trigPtr); while (trigPtr.i != RNIL) { - ljam(); + jam(); if (trigPtr.p->monitorAllAttributes || trigPtr.p->attributeMask.overlaps(req_struct->changeMask)) { - ljam(); + jam(); executeTrigger(req_struct, trigPtr.p, regOperPtr); @@ -575,10 +573,10 @@ Dbtup::fireDeferredTriggers(Signal* signal, TriggerPtr trigPtr; triggerList.first(trigPtr); while (trigPtr.i != RNIL) { - ljam(); + jam(); if (trigPtr.p->monitorAllAttributes || trigPtr.p->attributeMask.overlaps(req_struct->changeMask)) { - ljam(); + jam(); executeTrigger(req_struct, trigPtr, regOperPtr); @@ -604,12 +602,12 @@ Dbtup::fireDetachedTriggers(KeyReqStruct *req_struct, ndbrequire(regOperPtr->is_first_operation()); triggerList.first(trigPtr); while (trigPtr.i != RNIL) { - ljam(); + jam(); if ((trigPtr.p->monitorReplicas || regOperPtr->op_struct.primary_replica) && (trigPtr.p->monitorAllAttributes || trigPtr.p->attributeMask.overlaps(req_struct->changeMask))) { - ljam(); + jam(); executeTrigger(req_struct, trigPtr.p, regOperPtr); @@ -625,7 +623,7 @@ void Dbtup::executeTriggers(KeyReqStruct *req_struct, TriggerPtr trigPtr; triggerList.first(trigPtr); while (trigPtr.i != RNIL) { - ljam(); + jam(); executeTrigger(req_struct, trigPtr.p, regOperPtr); @@ -675,7 +673,7 @@ void Dbtup::executeTrigger(KeyReqStruct *req_struct, ptrCheckGuard(regFragPtr, cnoOfFragrec, fragrecord); if (ref == BACKUP) { - ljam(); + jam(); /* In order for the implementation of BACKUP to work even when changing primaries in the middle of the backup we need to set the trigger on @@ -688,9 +686,9 @@ void Dbtup::executeTrigger(KeyReqStruct *req_struct, signal->theData[0] = trigPtr->triggerId; signal->theData[1] = regFragPtr.p->fragmentId; EXECUTE_DIRECT(BACKUP, GSN_BACKUP_TRIG_REQ, signal, 2); - ljamEntry(); + jamEntry(); if (signal->theData[0] == 0) { - ljam(); + jam(); return; } } @@ -704,7 +702,7 @@ void Dbtup::executeTrigger(KeyReqStruct *req_struct, noAfterWords, beforeBuffer, noBeforeWords)) { - ljam(); + jam(); return; } //-------------------------------------------------------------------- @@ -720,13 +718,13 @@ void Dbtup::executeTrigger(KeyReqStruct *req_struct, switch(trigPtr->triggerType) { case (TriggerType::SECONDARY_INDEX): - ljam(); + jam(); ref = req_struct->TC_ref; executeDirect = false; break; case (TriggerType::SUBSCRIPTION): case (TriggerType::SUBSCRIPTION_BEFORE): - ljam(); + jam(); // Since only backup uses subscription triggers we send to backup directly for now ref = trigPtr->m_receiverBlock; executeDirect = true; @@ -747,22 +745,22 @@ void Dbtup::executeTrigger(KeyReqStruct *req_struct, switch(regOperPtr->op_struct.op_type) { case(ZINSERT): - ljam(); + jam(); // Send AttrInfo signals with new attribute values trigAttrInfo->setAttrInfoType(TrigAttrInfo::AFTER_VALUES); sendTrigAttrInfo(signal, afterBuffer, noAfterWords, executeDirect, ref); break; case(ZDELETE): if (trigPtr->sendBeforeValues) { - ljam(); + jam(); trigAttrInfo->setAttrInfoType(TrigAttrInfo::BEFORE_VALUES); sendTrigAttrInfo(signal, beforeBuffer, noBeforeWords, executeDirect,ref); } break; case(ZUPDATE): - ljam(); + jam(); if (trigPtr->sendBeforeValues) { - ljam(); + jam(); trigAttrInfo->setAttrInfoType(TrigAttrInfo::BEFORE_VALUES); sendTrigAttrInfo(signal, beforeBuffer, noBeforeWords, executeDirect,ref); } @@ -788,9 +786,9 @@ Uint32 Dbtup::setAttrIds(Bitmask& attributeMask, { Uint32 bufIndx = 0; for (Uint32 i = 0; i < m_no_of_attributesibutes; i++) { - ljam(); + jam(); if (attributeMask.get(i)) { - ljam(); + jam(); AttributeHeader::init(&inBuffer[bufIndx++], i, 0); } } @@ -858,7 +856,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, Uint32 numAttrsToRead; if ((regOperPtr->op_struct.op_type == ZUPDATE) && (trigPtr->sendOnlyChangedAttributes)) { - ljam(); + jam(); //-------------------------------------------------------------------- // Update that sends only changed information //-------------------------------------------------------------------- @@ -870,13 +868,13 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, } else if ((regOperPtr->op_struct.op_type == ZDELETE) && (!trigPtr->sendBeforeValues)) { - ljam(); + jam(); //-------------------------------------------------------------------- // Delete without sending before values only read Primary Key //-------------------------------------------------------------------- return true; } else { - ljam(); + jam(); //-------------------------------------------------------------------- // All others send all attributes that are monitored, except: // Omit unchanged blob inlines on update i.e. @@ -898,7 +896,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, //-------------------------------------------------------------------- if (regOperPtr->op_struct.op_type != ZDELETE) { - ljam(); + jam(); int ret = readAttributes(req_struct, &readBuffer[0], numAttrsToRead, @@ -908,7 +906,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, ndbrequire(ret != -1); noAfterWords= ret; } else { - ljam(); + jam(); noAfterWords = 0; } @@ -920,7 +918,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, if ((regOperPtr->op_struct.op_type == ZUPDATE || regOperPtr->op_struct.op_type == ZDELETE) && (trigPtr->sendBeforeValues)) { - ljam(); + jam(); Tuple_header *save= req_struct->m_tuple_ptr; PagePtr tmp; @@ -956,7 +954,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, // Although a trigger was fired it was not necessary since the old // value and the new value was exactly the same //-------------------------------------------------------------------- - ljam(); + jam(); //XXX does this work with collations? return false; } @@ -976,21 +974,21 @@ void Dbtup::sendTrigAttrInfo(Signal* signal, do { sigLen = dataLen - dataIndex; if (sigLen > TrigAttrInfo::DataLength) { - ljam(); + jam(); sigLen = TrigAttrInfo::DataLength; } MEMCOPY_NO_WORDS(trigAttrInfo->getData(), data + dataIndex, sigLen); if (executeDirect) { - ljam(); + jam(); EXECUTE_DIRECT(receiverReference, GSN_TRIG_ATTRINFO, signal, TrigAttrInfo::StaticLength + sigLen); - ljamEntry(); + jamEntry(); } else { - ljam(); + jam(); sendSignal(receiverReference, GSN_TRIG_ATTRINFO, signal, @@ -1018,15 +1016,15 @@ void Dbtup::sendFireTrigOrd(Signal* signal, switch(regOperPtr->op_struct.op_type) { case(ZINSERT): - ljam(); + jam(); fireTrigOrd->setTriggerEvent(TriggerEvent::TE_INSERT); break; case(ZDELETE): - ljam(); + jam(); fireTrigOrd->setTriggerEvent(TriggerEvent::TE_DELETE); break; case(ZUPDATE): - ljam(); + jam(); fireTrigOrd->setTriggerEvent(TriggerEvent::TE_UPDATE); break; default: @@ -1040,12 +1038,12 @@ void Dbtup::sendFireTrigOrd(Signal* signal, switch(trigPtr->triggerType) { case (TriggerType::SECONDARY_INDEX): - ljam(); + jam(); sendSignal(req_struct->TC_ref, GSN_FIRE_TRIG_ORD, signal, FireTrigOrd::SignalLength, JBB); break; case (TriggerType::SUBSCRIPTION_BEFORE): // Only Suma - ljam(); + jam(); // Since only backup uses subscription triggers we // send to backup directly for now fireTrigOrd->setGCI(req_struct->gci); @@ -1056,7 +1054,7 @@ void Dbtup::sendFireTrigOrd(Signal* signal, FireTrigOrd::SignalWithHashValueLength); break; case (TriggerType::SUBSCRIPTION): - ljam(); + jam(); // Since only backup uses subscription triggers we // send to backup directly for now fireTrigOrd->setGCI(req_struct->gci); @@ -1123,7 +1121,7 @@ Dbtup::addTuxEntries(Signal* signal, Tablerec* regTabPtr) { if (ERROR_INSERTED(4022)) { - ljam(); + jam(); CLEAR_ERROR_INSERT_VALUE; terrorCode = 9999; return -1; @@ -1134,12 +1132,12 @@ Dbtup::addTuxEntries(Signal* signal, Uint32 failPtrI; triggerList.first(triggerPtr); while (triggerPtr.i != RNIL) { - ljam(); + jam(); req->indexId = triggerPtr.p->indexId; req->errorCode = RNIL; if (ERROR_INSERTED(4023) && ! triggerList.hasNext(triggerPtr)) { - ljam(); + jam(); CLEAR_ERROR_INSERT_VALUE; terrorCode = 9999; failPtrI = triggerPtr.i; @@ -1147,9 +1145,9 @@ Dbtup::addTuxEntries(Signal* signal, } EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ, signal, TuxMaintReq::SignalLength); - ljamEntry(); + jamEntry(); if (req->errorCode != 0) { - ljam(); + jam(); terrorCode = req->errorCode; failPtrI = triggerPtr.i; goto fail; @@ -1161,12 +1159,12 @@ fail: req->opInfo = TuxMaintReq::OpRemove; triggerList.first(triggerPtr); while (triggerPtr.i != failPtrI) { - ljam(); + jam(); req->indexId = triggerPtr.p->indexId; req->errorCode = RNIL; EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ, signal, TuxMaintReq::SignalLength); - ljamEntry(); + jamEntry(); ndbrequire(req->errorCode == 0); triggerList.next(triggerPtr); } @@ -1197,15 +1195,15 @@ Dbtup::executeTuxCommitTriggers(Signal* signal, if (regOperPtr->op_struct.op_type == ZINSERT) { if (! regOperPtr->op_struct.delete_insert_flag) return; - ljam(); + jam(); tupVersion= decr_tup_version(regOperPtr->tupVersion); } else if (regOperPtr->op_struct.op_type == ZUPDATE) { - ljam(); + jam(); tupVersion= decr_tup_version(regOperPtr->tupVersion); } else if (regOperPtr->op_struct.op_type == ZDELETE) { if (regOperPtr->op_struct.delete_insert_flag) return; - ljam(); + jam(); tupVersion= regOperPtr->tupVersion; } else { ndbrequire(false); @@ -1231,13 +1229,13 @@ Dbtup::executeTuxAbortTriggers(Signal* signal, // get version Uint32 tupVersion; if (regOperPtr->op_struct.op_type == ZINSERT) { - ljam(); + jam(); tupVersion = regOperPtr->tupVersion; } else if (regOperPtr->op_struct.op_type == ZUPDATE) { - ljam(); + jam(); tupVersion = regOperPtr->tupVersion; } else if (regOperPtr->op_struct.op_type == ZDELETE) { - ljam(); + jam(); return; } else { ndbrequire(false); @@ -1262,12 +1260,12 @@ Dbtup::removeTuxEntries(Signal* signal, TriggerPtr triggerPtr; triggerList.first(triggerPtr); while (triggerPtr.i != RNIL) { - ljam(); + jam(); req->indexId = triggerPtr.p->indexId; req->errorCode = RNIL, EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ, signal, TuxMaintReq::SignalLength); - ljamEntry(); + jamEntry(); // must succeed ndbrequire(req->errorCode == 0); triggerList.next(triggerPtr); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp index 28543882255..a32fae16790 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp @@ -14,12 +14,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBTUP_C +#define DBTUP_VAR_ALLOC_CPP #include "Dbtup.hpp" -#define ljam() { jamLine(32000 + __LINE__); } -#define ljamEntry() { jamEntryLine(32000 + __LINE__); } - - void Dbtup::init_list_sizes(void) { c_min_list_size[0]= 200; @@ -109,9 +106,9 @@ Dbtup::alloc_var_part(Fragrecord* fragPtr, PagePtr pagePtr; pagePtr.i= get_alloc_page(fragPtr, (alloc_size + 1)); if (pagePtr.i == RNIL) { - ljam(); + jam(); if ((pagePtr.i= get_empty_var_page(fragPtr)) == RNIL) { - ljam(); + jam(); return 0; } c_page_pool.getPtr(pagePtr); @@ -127,7 +124,7 @@ Dbtup::alloc_var_part(Fragrecord* fragPtr, pagePtr.p->page_state = ZTH_MM_FREE; } else { c_page_pool.getPtr(pagePtr); - ljam(); + jam(); } Uint32 idx= ((Var_page*)pagePtr.p) ->alloc_record(alloc_size, (Var_page*)ctemp_page, Var_page::CHAIN); @@ -178,7 +175,7 @@ void Dbtup::free_var_rec(Fragrecord* fragPtr, ndbassert(pagePtr.p->free_space <= Var_page::DATA_WORDS); if (pagePtr.p->free_space == Var_page::DATA_WORDS - 1) { - ljam(); + jam(); /* This code could be used when we release pages. remove_free_page(signal,fragPtr,page_header,page_header->list_index); @@ -186,7 +183,7 @@ void Dbtup::free_var_rec(Fragrecord* fragPtr, */ update_free_page_list(fragPtr, pagePtr); } else { - ljam(); + jam(); update_free_page_list(fragPtr, pagePtr); } return; @@ -260,16 +257,16 @@ Dbtup::get_alloc_page(Fragrecord* fragPtr, Uint32 alloc_size) start_index= calculate_free_list_impl(alloc_size); if (start_index == (MAX_FREE_LIST - 1)) { - ljam(); + jam(); } else { - ljam(); + jam(); ndbrequire(start_index < (MAX_FREE_LIST - 1)); start_index++; } for (i= start_index; i < MAX_FREE_LIST; i++) { - ljam(); + jam(); if (!fragPtr->free_var_page_array[i].isEmpty()) { - ljam(); + jam(); return fragPtr->free_var_page_array[i].firstItem; } } @@ -278,9 +275,9 @@ Dbtup::get_alloc_page(Fragrecord* fragPtr, Uint32 alloc_size) LocalDLList list(c_page_pool, fragPtr->free_var_page_array[i]); for(list.first(pagePtr); !pagePtr.isNull() && loop < 16; ) { - ljam(); + jam(); if (pagePtr.p->free_space >= alloc_size) { - ljam(); + jam(); return pagePtr.i; } loop++; @@ -347,7 +344,7 @@ void Dbtup::update_free_page_list(Fragrecord* fragPtr, (free_space > c_max_list_size[list_index])) { Uint32 new_list_index= calculate_free_list_impl(free_space); if (list_index != MAX_FREE_LIST) { - ljam(); + jam(); /* * Only remove it from its list if it is in a list */ @@ -362,11 +359,11 @@ void Dbtup::update_free_page_list(Fragrecord* fragPtr, This can only happen for the free list with least guaranteed free space. */ - ljam(); + jam(); ndbrequire(new_list_index == 0); pagePtr.p->list_index= MAX_FREE_LIST; } else { - ljam(); + jam(); LocalDLList list(c_page_pool, fragPtr->free_var_page_array[new_list_index]); list.add(pagePtr); @@ -382,9 +379,9 @@ Uint32 Dbtup::calculate_free_list_impl(Uint32 free_space_size) const { Uint32 i; for (i = 0; i < MAX_FREE_LIST; i++) { - ljam(); + jam(); if (free_space_size <= c_max_list_size[i]) { - ljam(); + jam(); return i; } } From 72773f4f8adfe8b4973d0392914d15ada43021e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 4 Mar 2007 00:47:42 +0300 Subject: [PATCH 041/789] Bug#25126: Wrongly resolved field leads to a crash. When the ORDER BY clause gets fixed it's allowed to search in the current item_list in order to find aliased fields and expressions. This is ok for a SELECT but wrong for an UPDATE statement. If the ORDER BY clause will contain a non-existing field which is mentioned in the UPDATE set list then the server will crash due to using of non-existing (0x0) field. When an Item_field is getting fixed it's allowed to search item list for aliased expressions and fields only for selects. sql/sql_base.cc: Bug#25126: Wrongly resolved field leads to a crash. When an Item_field is getting fixed it's allowed to search item list for aliased expressions and fields only for selects. sql/sql_select.cc: Bug#25126: Wrongly resolved field leads to a crash. When an Item_field is getting fixed it's allowed to search item list for aliased expressions and fields only for selects. mysql-test/r/update.result: Added a test case for bug#25126: Wrongly resolved field leads to a crash. mysql-test/t/update.test: Added a test case for bug#25126: Wrongly resolved field leads to a crash. --- mysql-test/r/update.result | 4 ++++ mysql-test/t/update.test | 8 ++++++++ sql/sql_base.cc | 31 ++++++++++++++++++++++++++++++- sql/sql_select.cc | 7 ++----- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 0f86a959250..186e0955e61 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -377,3 +377,7 @@ create table t1(f1 int, `*f2` int); insert into t1 values (1,1); update t1 set `*f2`=1; drop table t1; +create table t1(f1 int); +update t1 set f2=1 order by f2; +ERROR 42S22: Unknown column 'f2' in 'order clause' +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index c69c56f0331..e5287eacbc8 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -306,4 +306,12 @@ create table t1(f1 int, `*f2` int); insert into t1 values (1,1); update t1 set `*f2`=1; drop table t1; + +# +# Bug#25126: Wrongly resolved field leads to a crash +# +create table t1(f1 int); +--error 1054 +update t1 set f2=1 order by f2; +drop table t1; # End of 4.1 tests diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 05ecfe9b484..2f7661182a6 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2518,11 +2518,14 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, { reg2 Item *item; List_iterator it(fields); + bool save_is_item_list_lookup; DBUG_ENTER("setup_fields"); thd->set_query_id=set_query_id; thd->allow_sum_func= allow_sum_func; thd->where="field list"; + save_is_item_list_lookup= thd->lex->current_select->is_item_list_lookup; + thd->lex->current_select->is_item_list_lookup= 0; /* To prevent fail on forward lookup we fill it with zerows, @@ -2543,7 +2546,10 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, { if (!item->fixed && item->fix_fields(thd, tables, it.ref()) || (item= *(it.ref()))->check_cols(1)) + { + thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; DBUG_RETURN(-1); /* purecov: inspected */ + } if (ref) *(ref++)= item; if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM && @@ -2551,6 +2557,7 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, item->split_sum_func(thd, ref_pointer_array, *sum_func_list); thd->used_tables|=item->used_tables(); } + thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; DBUG_RETURN(test(thd->net.report_error)); } @@ -2747,6 +2754,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { table_map not_null_tables= 0; Item_arena *arena= 0, backup; + bool save_is_item_list_lookup= thd->lex->current_select->is_item_list_lookup; + thd->lex->current_select->is_item_list_lookup= 0; DBUG_ENTER("setup_conds"); thd->set_query_id=1; @@ -2756,7 +2765,10 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) thd->where="where clause"; if (!(*conds)->fixed && (*conds)->fix_fields(thd, tables, conds) || (*conds)->check_cols(1)) + { + thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; DBUG_RETURN(1); + } not_null_tables= (*conds)->not_null_tables(); } @@ -2772,7 +2784,10 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) if (!table->on_expr->fixed && table->on_expr->fix_fields(thd, tables, &table->on_expr) || table->on_expr->check_cols(1)) + { + thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; DBUG_RETURN(1); + } thd->lex->current_select->cond_count++; /* @@ -2794,7 +2809,11 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) } if ((*conds) && !(*conds)->fixed && (*conds)->fix_fields(thd, tables, conds)) + { + thd->lex->current_select->is_item_list_lookup= + save_is_item_list_lookup; DBUG_RETURN(1); + } } } if (table->natural_join) @@ -2846,7 +2865,11 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { if (!(*conds)->fixed && (*conds)->fix_fields(thd, tables, conds)) + { + thd->lex->current_select->is_item_list_lookup= + save_is_item_list_lookup; DBUG_RETURN(1); + } } } else @@ -2859,7 +2882,11 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { if (!table->on_expr->fixed && table->on_expr->fix_fields(thd, tables, &table->on_expr)) - DBUG_RETURN(1); + { + thd->lex->current_select->is_item_list_lookup= + save_is_item_list_lookup; + DBUG_RETURN(1); + } } } } @@ -2881,9 +2908,11 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) */ thd->lex->current_select->where= *conds; } + thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; DBUG_RETURN(test(thd->net.report_error)); err: + thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(1); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9eb9d2640e9..af3ad782ee3 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -265,6 +265,7 @@ JOIN::prepare(Item ***rref_pointer_array, select_lex->join= this; union_part= (unit_arg->first_select()->next_select() != 0); + thd->lex->current_select->is_item_list_lookup= 1; /* Check that all tables, fields, conds and order are ok */ if (setup_tables(tables_list) || @@ -8702,16 +8703,12 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, 'it' reassigned in if condition because fix_field can change it. */ - thd->lex->current_select->is_item_list_lookup= 1; if (!it->fixed && (it->fix_fields(thd, tables, order->item) || (it= *order->item)->check_cols(1) || thd->is_fatal_error)) - { - thd->lex->current_select->is_item_list_lookup= 0; return 1; // Wrong field - } - thd->lex->current_select->is_item_list_lookup= 0; + uint el= all_fields.elements; all_fields.push_front(it); // Add new field to field list ref_pointer_array[el]= it; From b25ea49f373186ecfaf717c35bdfef4e575199d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Mar 2007 02:09:24 +0400 Subject: [PATCH 042/789] bug #26538 (flush2.test fails in embedded run) in the embedded result we don't have 'log_slave_updates OFF' line as replication is disabled in the embedded server. As we don't need to check for log_slave_updates variable in this test, we can not to SHOW it at all mysql-test/r/flush2.result: result fixed mysql-test/t/flush2.test: here we only need to check for log_bin% variables --- mysql-test/r/flush2.result | 18 ++---------------- mysql-test/t/flush2.test | 4 ++-- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result index 8257fa05b41..13bcc371ef6 100644 --- a/mysql-test/r/flush2.result +++ b/mysql-test/r/flush2.result @@ -1,26 +1,12 @@ flush logs; set global expire_logs_days = 3; -show variables like 'log%'; +show variables like 'log_bin%'; Variable_name Value -log ON log_bin OFF log_bin_trust_function_creators ON -log_error -log_output TABLE -log_queries_not_using_indexes OFF -log_slave_updates OFF -log_slow_queries OFF -log_warnings 1 flush logs; -show variables like 'log%'; +show variables like 'log_bin%'; Variable_name Value -log ON log_bin OFF log_bin_trust_function_creators ON -log_error -log_output TABLE -log_queries_not_using_indexes OFF -log_slave_updates OFF -log_slow_queries OFF -log_warnings 1 set global expire_logs_days = 0; diff --git a/mysql-test/t/flush2.test b/mysql-test/t/flush2.test index fc9e88e3141..7582ab8426b 100644 --- a/mysql-test/t/flush2.test +++ b/mysql-test/t/flush2.test @@ -3,7 +3,7 @@ # flush logs; set global expire_logs_days = 3; -show variables like 'log%'; +show variables like 'log_bin%'; flush logs; -show variables like 'log%'; +show variables like 'log_bin%'; set global expire_logs_days = 0; From 81e15b49cb0e181c41a378502a7a3f9511d6f043 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Mar 2007 11:25:44 +0800 Subject: [PATCH 043/789] BUG#25992 Data nodes died during creating many tables based on different tablespaces. storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Because TableSpaces, Datafiles, Undofiles and LogfileGroups uses the same id-space with Tables, when they are created, the objId allocated for TableSpaces, Datafiles, Undofiles and LogfileGroups shouldn't satisfy the rule of (tableId < c_tableRecordPool.getSize()). --- storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 00a984e591b..f020d012023 100644 --- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -1090,7 +1090,6 @@ Dbdict::updateSchemaState(Signal* signal, Uint32 tableId, SchemaFile::TableEntry* te, Callback* callback, bool savetodisk){ jam(); - ndbrequire(tableId < c_tableRecordPool.getSize()); XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0]; SchemaFile::TableEntry * tableEntry = getTableEntry(xsf, tableId); From 6da758c216f288d8ab95dd454a1d096ac829fac3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 4 Mar 2007 19:54:35 -0800 Subject: [PATCH 044/789] Fixed bug #26560. The flag alias_name_used was not set on for the outer references in subqueries. It resulted in replacement of any outer reference resolved against an alias for a full field name when the frm representation of a view with a subquery was generated. If the subquery and the outer query referenced the same table in their from lists this replacement effectively changed the meaning of the view and led to wrong results for selects from this view. Modified several functions to ensure setting the right value of the alias_name_used flag for outer references resolved against aliases. mysql-test/r/view.result: Added a test case for bug #26560. mysql-test/t/view.test: Added a test case for bug #26560. sql/item.cc: Fixed bug #26560. Made the function resolve_ref_in_select_and_group analyze the return value of the last parameter with the type of the name resolution for the submitted reference. If the reference has been resolved against an alias name from select list then its flag alias_name_used is set on. Now this value is used in Item_field::fix_outer_field to initialize the flag when the item_ref object is created for an outer reference. Added a parameter for the second Item_ref::Item_ref constructor to initialize properly the flag alias_name_used. The default value of the parameter is FALSE. If this flag is set on at the creation of an object by this constructor it will never be changed. Corrected appropriately the Item_ref::set_properties function. The function Item_ref::print now prints alias name for an outer reference if the flag alias_name_used is set on. sql/item.h: Fixed bug #26560. Added a parameter for the second Item_ref::Item_ref constructor to initialize properly the flag alias_name_used. The default value of the parameter is FALSE. A similar change has been applied to the first Item_direct_ref::Item_direct_ref constructor. sql/mysql_priv.h: Fixed bug #26560. Added an an enumeration type enum_resolution_type to return info on how the function find_item_in_list has resolved the submitted item. The type is used only for this function. sql/sql_base.cc: Fixed bug #26560. Made the last parameter of the function find_field_in_tables return more detailed information on how the submitted item has been resolved. Now it says whether the item has been resolved against an alias name, or as a field name without alias, or as a field name hidden by alias, or was resolved ignoring alias. sql/sql_select.cc: Fixed bug #26560. Took into account the new type of the last parameter of the function find_item_in_list. --- mysql-test/r/view.result | 37 ++++++++++++ mysql-test/t/view.test | 40 +++++++++++++ sql/item.cc | 26 ++++++--- sql/item.h | 10 +++- sql/mysql_priv.h | 22 ++++++- sql/sql_base.cc | 121 ++++++++++++++++++++++----------------- sql/sql_select.cc | 8 +-- 7 files changed, 195 insertions(+), 69 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 50b41e1352f..cfa4f7cbba5 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3135,4 +3135,41 @@ code COUNT(DISTINCT country) 100 2 DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 ( +lid int NOT NULL PRIMARY KEY, +name char(10) NOT NULL +); +INSERT INTO t1 (lid, name) VALUES +(1, 'YES'), (2, 'NO'); +CREATE TABLE t2 ( +id int NOT NULL PRIMARY KEY, +gid int NOT NULL, +lid int NOT NULL, +dt date +); +INSERT INTO t2 (id, gid, lid, dt) VALUES +(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'), +(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02'); +SELECT DISTINCT t2.gid AS lgid, +(SELECT t1.name FROM t1, t2 +WHERE t1.lid = t2.lid AND t2.gid = lgid +ORDER BY t2.dt DESC LIMIT 1 +) as clid +FROM t2; +lgid clid +1 NO +2 YES +CREATE VIEW v1 AS +SELECT DISTINCT t2.gid AS lgid, +(SELECT t1.name FROM t1, t2 +WHERE t1.lid = t2.lid AND t2.gid = lgid +ORDER BY t2.dt DESC LIMIT 1 +) as clid +FROM t2; +SELECT * FROM v1; +lgid clid +1 NO +2 YES +DROP VIEW v1; +DROP table t1,t2; End of 5.0 tests. diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 33e381af476..32776e85e85 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3058,4 +3058,44 @@ SELECT code, COUNT(DISTINCT country) FROM v1 GROUP BY code ORDER BY MAX(id); DROP VIEW v1; DROP TABLE t1; +# +# Bug#26560: view using subquery with a reference to an outer alias +# + +CREATE TABLE t1 ( + lid int NOT NULL PRIMARY KEY, + name char(10) NOT NULL +); +INSERT INTO t1 (lid, name) VALUES + (1, 'YES'), (2, 'NO'); + +CREATE TABLE t2 ( + id int NOT NULL PRIMARY KEY, + gid int NOT NULL, + lid int NOT NULL, + dt date +); +INSERT INTO t2 (id, gid, lid, dt) VALUES + (1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'), + (3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02'); + +SELECT DISTINCT t2.gid AS lgid, + (SELECT t1.name FROM t1, t2 + WHERE t1.lid = t2.lid AND t2.gid = lgid + ORDER BY t2.dt DESC LIMIT 1 + ) as clid + FROM t2; + +CREATE VIEW v1 AS +SELECT DISTINCT t2.gid AS lgid, + (SELECT t1.name FROM t1, t2 + WHERE t1.lid = t2.lid AND t2.gid = lgid + ORDER BY t2.dt DESC LIMIT 1 + ) as clid + FROM t2; +SELECT * FROM v1; + +DROP VIEW v1; +DROP table t1,t2; + --echo End of 5.0 tests. diff --git a/sql/item.cc b/sql/item.cc index 257687ebaaf..c5d8a62761c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3320,7 +3320,7 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select) ORDER *group_list= (ORDER*) select->group_list.first; bool ambiguous_fields= FALSE; uint counter; - bool not_used; + enum_resolution_type resolution; /* Search for a column or derived column named as 'ref' in the SELECT @@ -3328,8 +3328,10 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select) */ if (!(select_ref= find_item_in_list(ref, *(select->get_item_list()), &counter, REPORT_EXCEPT_NOT_FOUND, - ¬_used))) + &resolution))) return NULL; /* Some error occurred. */ + if (resolution == RESOLVED_AGAINST_ALIAS) + ref->alias_name_used= TRUE; /* If this is a non-aggregated field inside HAVING, search in GROUP BY. */ if (select->having_fix_field && !ref->with_sum_func && group_list) @@ -3630,9 +3632,9 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) *ref= NULL; // Don't call set_properties() rf= (place == IN_HAVING ? new Item_ref(context, ref, (char*) table_name, - (char*) field_name) : + (char*) field_name, alias_name_used) : new Item_direct_ref(context, ref, (char*) table_name, - (char*) field_name)); + (char*) field_name, alias_name_used)); *ref= save; if (!rf) return -1; @@ -3750,12 +3752,14 @@ bool Item_field::fix_fields(THD *thd, Item **reference) if (thd->lex->current_select->is_item_list_lookup) { uint counter; - bool not_used; + enum_resolution_type resolution; Item** res= find_item_in_list(this, thd->lex->current_select->item_list, &counter, REPORT_EXCEPT_NOT_FOUND, - ¬_used); + &resolution); if (!res) return 1; + if (resolution == RESOLVED_AGAINST_ALIAS) + alias_name_used= TRUE; if (res != (Item **)not_found_item) { if ((*res)->type() == Item::FIELD_ITEM) @@ -4898,10 +4902,12 @@ Item *Item_field::update_value_transformer(byte *select_arg) Item_ref::Item_ref(Name_resolution_context *context_arg, Item **item, const char *table_name_arg, - const char *field_name_arg) + const char *field_name_arg, + bool alias_name_used_arg) :Item_ident(context_arg, NullS, table_name_arg, field_name_arg), result_field(0), ref(item) { + alias_name_used= alias_name_used_arg; /* This constructor used to create some internals references over fixed items */ @@ -5184,11 +5190,13 @@ void Item_ref::set_properties() */ with_sum_func= (*ref)->with_sum_func; unsigned_flag= (*ref)->unsigned_flag; + fixed= 1; + if (alias_name_used) + return; if ((*ref)->type() == FIELD_ITEM) alias_name_used= ((Item_ident *) (*ref))->alias_name_used; else alias_name_used= TRUE; // it is not field, so it is was resolved by alias - fixed= 1; } @@ -5206,7 +5214,7 @@ void Item_ref::print(String *str) if (ref) { if ((*ref)->type() != Item::CACHE_ITEM && ref_type() != VIEW_REF && - ref_type() != OUTER_REF && name && alias_name_used) + !table_name && name && alias_name_used) { THD *thd= current_thd; append_identifier(thd, str, name, (uint) strlen(name)); diff --git a/sql/item.h b/sql/item.h index d792f95055d..2a121523423 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1851,7 +1851,8 @@ public: with Bar, and if we have a more broader set of problems like this. */ Item_ref(Name_resolution_context *context_arg, Item **item, - const char *table_name_arg, const char *field_name_arg); + const char *table_name_arg, const char *field_name_arg, + bool alias_name_used_arg= FALSE); /* Constructor need to process subselect with temporary tables (see Item) */ Item_ref(THD *thd, Item_ref *item) @@ -1926,8 +1927,11 @@ class Item_direct_ref :public Item_ref public: Item_direct_ref(Name_resolution_context *context_arg, Item **item, const char *table_name_arg, - const char *field_name_arg) - :Item_ref(context_arg, item, table_name_arg, field_name_arg) {} + const char *field_name_arg, + bool alias_name_used_arg= FALSE) + :Item_ref(context_arg, item, table_name_arg, + field_name_arg, alias_name_used_arg) + {} /* Constructor need to process subselect with temporary tables (see Item) */ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 7c9b43f23b9..cf5e9799fae 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1008,9 +1008,29 @@ SQL_SELECT *make_select(TABLE *head, table_map const_tables, table_map read_tables, COND *conds, bool allow_null_cond, int *error); extern Item **not_found_item; + +/* + This enumeration type is used only by the function find_item_in_list + to return the info on how an item has been resolved against a list + of possibly aliased items. + The item can be resolved: + - against an alias name of the list's element (RESOLVED_AGAINST_ALIAS) + - against non-aliased field name of the list (RESOLVED_WITH_NO_ALIAS) + - against an aliased field name of the list (RESOLVED_BEHIND_ALIAS) + - ignoring the alias name in cases when SQL requires to ignore aliases + (e.g. when the resolved field reference contains a table name or + when the resolved item is an expression) (RESOLVED_IGNORING_ALIAS) +*/ +enum enum_resolution_type { + NOT_RESOLVED=0, + RESOLVED_IGNORING_ALIAS, + RESOLVED_BEHIND_ALIAS, + RESOLVED_WITH_NO_ALIAS, + RESOLVED_AGAINST_ALIAS +}; Item ** find_item_in_list(Item *item, List &items, uint *counter, find_item_error_report_type report_error, - bool *unaliased); + enum_resolution_type *resolution); bool get_key_map_from_key_list(key_map *map, TABLE *table, List *index_list); bool insert_fields(THD *thd, Name_resolution_context *context, diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9945057cd1b..0ebfd2b1044 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3468,10 +3468,13 @@ find_field_in_tables(THD *thd, Item_ident *item, return not_found_item, report other errors, return 0 IGNORE_ERRORS Do not report errors, return 0 if error - unaliased Set to true if item is field which was found - by original field name and not by its alias - in item list. Set to false otherwise. - + resolution Set to the resolution type if the item is found + (it says whether the item is resolved + against an alias name, + or as a field name without alias, + or as a field hidden by alias, + or ignoring alias) + RETURN VALUES 0 Item is not found or item is not unique, error message is reported @@ -3487,7 +3490,8 @@ Item **not_found_item= (Item**) 0x1; Item ** find_item_in_list(Item *find, List &items, uint *counter, - find_item_error_report_type report_error, bool *unaliased) + find_item_error_report_type report_error, + enum_resolution_type *resolution) { List_iterator li(items); Item **found=0, **found_unaliased= 0, *item; @@ -3501,10 +3505,9 @@ find_item_in_list(Item *find, List &items, uint *counter, */ bool is_ref_by_name= 0; uint unaliased_counter; - LINT_INIT(unaliased_counter); // Dependent on found_unaliased - *unaliased= FALSE; + *resolution= NOT_RESOLVED; is_ref_by_name= (find->type() == Item::FIELD_ITEM || find->type() == Item::REF_ITEM); @@ -3571,63 +3574,77 @@ find_item_in_list(Item *find, List &items, uint *counter, } found_unaliased= li.ref(); unaliased_counter= i; + *resolution= RESOLVED_IGNORING_ALIAS; if (db_name) break; // Perfect match } } - else if (!my_strcasecmp(system_charset_info, item_field->name, - field_name)) + else { - /* - If table name was not given we should scan through aliases - (or non-aliased fields) first. We are also checking unaliased - name of the field in then next else-if, to be able to find - instantly field (hidden by alias) if no suitable alias (or - non-aliased field) was found. - */ - if (found) + int fname_cmp= my_strcasecmp(system_charset_info, + item_field->field_name, + field_name); + if (!my_strcasecmp(system_charset_info, + item_field->name,field_name)) { - if ((*found)->eq(item, 0)) - continue; // Same field twice - if (report_error != IGNORE_ERRORS) - my_error(ER_NON_UNIQ_ERROR, MYF(0), - find->full_name(), current_thd->where); - return (Item**) 0; + /* + If table name was not given we should scan through aliases + and non-aliased fields first. We are also checking unaliased + name of the field in then next else-if, to be able to find + instantly field (hidden by alias) if no suitable alias or + non-aliased field was found. + */ + if (found) + { + if ((*found)->eq(item, 0)) + continue; // Same field twice + if (report_error != IGNORE_ERRORS) + my_error(ER_NON_UNIQ_ERROR, MYF(0), + find->full_name(), current_thd->where); + return (Item**) 0; + } + found= li.ref(); + *counter= i; + *resolution= fname_cmp ? RESOLVED_AGAINST_ALIAS: + RESOLVED_WITH_NO_ALIAS; } - found= li.ref(); - *counter= i; - } - else if (!my_strcasecmp(system_charset_info, item_field->field_name, - field_name)) - { - /* - We will use un-aliased field or react on such ambiguities only if - we won't be able to find aliased field. - Again if we have ambiguity with field outside of select list - we should prefer fields from select list. - */ - if (found_unaliased) - { - if ((*found_unaliased)->eq(item, 0)) - continue; // Same field twice - found_unaliased_non_uniq= 1; - } - else + else if (!fname_cmp) { + /* + We will use non-aliased field or react on such ambiguities only if + we won't be able to find aliased field. + Again if we have ambiguity with field outside of select list + we should prefer fields from select list. + */ + if (found_unaliased) + { + if ((*found_unaliased)->eq(item, 0)) + continue; // Same field twice + found_unaliased_non_uniq= 1; + } found_unaliased= li.ref(); unaliased_counter= i; } } } - else if (!table_name && (find->eq(item,0) || - is_ref_by_name && find->name && item->name && - !my_strcasecmp(system_charset_info, - item->name,find->name))) - { - found= li.ref(); - *counter= i; - break; - } + else if (!table_name) + { + if (is_ref_by_name && find->name && item->name && + !my_strcasecmp(system_charset_info,item->name,find->name)) + { + found= li.ref(); + *counter= i; + *resolution= RESOLVED_AGAINST_ALIAS; + break; + } + else if (find->eq(item,0)) + { + found= li.ref(); + *counter= i; + *resolution= RESOLVED_IGNORING_ALIAS; + break; + } + } } if (!found) { @@ -3642,7 +3659,7 @@ find_item_in_list(Item *find, List &items, uint *counter, { found= found_unaliased; *counter= unaliased_counter; - *unaliased= TRUE; + *resolution= RESOLVED_BEHIND_ALIAS; } } if (found) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5202f35f4de..7538d3bf599 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13158,7 +13158,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, Item **select_item; /* The corresponding item from the SELECT clause. */ Field *from_field; /* The corresponding field from the FROM clause. */ uint counter; - bool unaliased; + enum_resolution_type resolution; /* Local SP variables may be int but are expressions, not positions. @@ -13181,7 +13181,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, } /* Lookup the current GROUP/ORDER field in the SELECT clause. */ select_item= find_item_in_list(order_item, fields, &counter, - REPORT_EXCEPT_NOT_FOUND, &unaliased); + REPORT_EXCEPT_NOT_FOUND, &resolution); if (!select_item) return TRUE; /* The item is not unique, or some other error occured. */ @@ -13195,7 +13195,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, original field name, we should additionaly check if we have conflict for this name (in case if we would perform lookup in all tables). */ - if (unaliased && !order_item->fixed && + if (resolution == RESOLVED_BEHIND_ALIAS && !order_item->fixed && order_item->fix_fields(thd, order->item)) return TRUE; @@ -13429,7 +13429,7 @@ setup_new_fields(THD *thd, List &fields, thd->set_query_id=1; // Not really needed, but... uint counter; - bool not_used; + enum_resolution_type not_used; for (; new_field ; new_field= new_field->next) { if ((item= find_item_in_list(*new_field->item, fields, &counter, From 5c2d49dbedd4aff65d3459ae6648b21a3d1727b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Mar 2007 11:35:04 +0400 Subject: [PATCH 045/789] bug #25492 (Invalid deallocation in mysql_stmt_fetch()) Additional patch. mysql_flush_use_result() fixed. libmysqld/lib_sql.cc: now emb_flush_use_result() uses emb_free_rows() duplicating code removed --- libmysqld/lib_sql.cc | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 8992bea943b..9ee8d48eec4 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -69,10 +69,14 @@ void embedded_get_error(MYSQL *mysql) static void emb_free_rows(THD *thd) { + if (!thd->data) + return; + if (thd->current_stmt) free_root(&thd->data->alloc,MYF(0)); else free_rows(thd->data); + thd->data= NULL; } @@ -86,11 +90,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, THD *thd=(THD *) mysql->thd; NET *net= &mysql->net; - if (thd->data) - { - emb_free_rows(thd); - thd->data= 0; - } + emb_free_rows(thd); + /* Check that we are calling the client functions in right order */ if (mysql->status != MYSQL_STATUS_READY) { @@ -143,13 +144,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, static void emb_flush_use_result(MYSQL *mysql) { - MYSQL_DATA *data= ((THD*)(mysql->thd))->data; - - if (data) - { - free_rows(data); - ((THD*)(mysql->thd))->data= NULL; - } + emb_free_rows((THD*) (mysql->thd)); } static MYSQL_DATA * @@ -304,8 +299,7 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row) static void emb_free_embedded_thd(MYSQL *mysql) { THD *thd= (THD*)mysql->thd; - if (thd->data) - emb_free_rows(thd); + emb_free_rows(thd); thread_count--; delete thd; mysql->thd=0; From da9c659c8196d1da63330fc7b1b6710217801a6f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Mar 2007 11:52:28 +0100 Subject: [PATCH 046/789] Bug#26464 - insert delayed + update + merge = corruption Using INSERT DELAYED on MERGE tables could lead to table corruptions. The manual lists a couple of storage engines, which can be used with INSERT DELAYED. MERGE is not in this list. The attempt to try it anyway has not been rejected yet. This bug was not detected earlier as it can work under special circumstances. Most notable is low concurrency. To be safe, this patch rejects any attempt to use INSERT DELAYED on MERGE tables. mysql-test/r/merge.result: Bug#26464 - insert delayed + update + merge = corruption Added test result. mysql-test/t/merge.test: Bug#26464 - insert delayed + update + merge = corruption Added test. sql/ha_myisammrg.h: Bug#26464 - insert delayed + update + merge = corruption Removed HA_CAN_INSERT_DELAYED flag from table_flags(). The insert delayed thread upgrades the lock from the first entry in MYSQL_LOCK::locks only. Hence it is incapable to handle MERGE tables, which have as many entries in this array as they have MyISAM sub-tables. --- mysql-test/r/merge.result | 5 +++++ mysql-test/t/merge.test | 9 +++++++++ sql/ha_myisammrg.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index eb333cdadb7..33de735d714 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -801,3 +801,8 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM tm1; ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, tm1; +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); +INSERT DELAYED INTO t2 VALUES(1); +ERROR HY000: Table storage engine for 't2' doesn't have this option +DROP TABLE t1, t2; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 700a807e62c..f759d20dd80 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -428,4 +428,13 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM tm1; DROP TABLE t1, tm1; +# +# Bug#26464 - insert delayed + update + merge = corruption +# +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); +--error 1031 +INSERT DELAYED INTO t2 VALUES(1); +DROP TABLE t1, t2; + # End of 4.1 tests diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h index 84eaae04590..84af55b262e 100644 --- a/sql/ha_myisammrg.h +++ b/sql/ha_myisammrg.h @@ -37,7 +37,7 @@ class ha_myisammrg: public handler { return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME | HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED | - HA_CAN_INSERT_DELAYED | HA_ANY_INDEX_MAY_BE_UNIQUE); + HA_ANY_INDEX_MAY_BE_UNIQUE); } ulong index_flags(uint inx, uint part, bool all_parts) const { From 6db06b61fe2a803335a27f9ce89a8018fa7af06a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Mar 2007 19:14:56 +0800 Subject: [PATCH 047/789] BUG#25877, After DROP INDEX non-indexed data isn't moved from memory into tablespace sql/ha_ndbcluster.cc: add/drop index online will change storage media type, so add storage type check in check_if_incompatible_data(), when storage type is changed, will create a new table, then this can correct the column and table's storage type. --- sql/ha_ndbcluster.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 86a2f9d8544..3394962b141 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -10606,10 +10606,23 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info, int pk= 0; int ai= 0; + + if (create_info->tablespace) + create_info->storage_media = HA_SM_DISK; + else + create_info->storage_media = HA_SM_MEMORY; + for (i= 0; i < table->s->fields; i++) { Field *field= table->field[i]; const NDBCOL *col= tab->getColumn(i); + if (col->getStorageType() == NDB_STORAGETYPE_MEMORY && create_info->storage_media != HA_SM_MEMORY || + col->getStorageType() == NDB_STORAGETYPE_DISK && create_info->storage_media != HA_SM_DISK) + { + DBUG_PRINT("info", ("Column storage media is changed")); + DBUG_RETURN(COMPATIBLE_DATA_NO); + } + if (field->flags & FIELD_IS_RENAMED) { DBUG_PRINT("info", ("Field has been renamed, copy table")); From 79542930ea1c969a9300fe622be15eeecee2c48e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Mar 2007 19:08:41 +0200 Subject: [PATCH 048/789] WL#3527: Extend IGNORE INDEX so places where index is ignored can be specified Currently MySQL allows one to specify what indexes to ignore during join optimization. The scope of the current USE/FORCE/IGNORE INDEX statement is only the FROM clause, while all other clauses are not affected. However, in certain cases, the optimizer may incorrectly choose an index for sorting and/or grouping, and produce an inefficient query plan. This task provides the means to specify what indexes are ignored/used for what operation in a more fine-grained manner, thus making it possible to manually force a better plan. We do this by extending the current IGNORE/USE/FORCE INDEX syntax to: IGNORE/USE/FORCE INDEX [FOR {JOIN | ORDER | GROUP BY}] so that: - if no FOR is specified, the index hint will apply everywhere. - if MySQL is started with the compatibility option --old_mode then an index hint without a FOR clause works as in 5.0 (i.e, the index will only be ignored for JOINs, but can still be used to compute ORDER BY). See the WL#3527 for further details. BitKeeper/deleted/.del-mysqld.cc.rej: Rename: sql/mysqld.cc.rej -> BitKeeper/deleted/.del-mysqld.cc.rej BitKeeper/deleted/.del-sql_parse.cc.rej: Rename: sql/sql_parse.cc.rej -> BitKeeper/deleted/.del-sql_parse.cc.rej BitKeeper/deleted/.del-table.cc.rej: Rename: sql/table.cc.rej -> BitKeeper/deleted/.del-table.cc.rej mysql-test/r/endspace.result: WL3527 : fixed undeterministic test mysql-test/r/group_by.result: WL#3527: test cases mysql-test/t/endspace.test: WL3527 : fixed undeterministic test mysql-test/t/group_by.test: WL#3527: test cases sql/item.cc: WL#3527: renames sql/mysql_priv.h: WL#3527: corrected initialization sql/mysqld.cc: WL#3527: added old_mode command line option sql/opt_range.cc: WL#3527: renames sql/sql_base.cc: WL#3527: - renames - correct initialization - extended the processing of USE/FORCE/IGNORE index sql/sql_class.h: WL#3527: added old_mode command line option sql/sql_delete.cc: WL#3527: renames sql/sql_help.cc: WL#3527: renames sql/sql_lex.cc: WL#3527: extended parsing of USE/FORCE/IGNORE index sql/sql_lex.h: WL#3527: extended parsing of USE/FORCE/IGNORE index sql/sql_parse.cc: WL#3527: extended parsing of USE/FORCE/IGNORE index sql/sql_select.cc: WL#3527: - renames - passing additional info to support the extended USE/FORCE/IGNORE INDEX syntax - If there is a covering index, and we have IGNORE INDEX FOR GROUP/ORDER, and this index is used for the JOIN part, then we have to ignore the IGNORE INDEX FOR GROUP/ORDER. sql/sql_show.cc: WL#3527: passing additional info to support the extended USE/FORCE/IGNORE INDEX syntax sql/sql_update.cc: WL#3527: renames sql/sql_yacc.yy: WL#3527: extended parsing of USE/FORCE/IGNORE index sql/table.cc: WL#3527: extended the processing of USE/FORCE/IGNORE index sql/table.h: WL#3527: extended the processing of USE/FORCE/IGNORE index storage/myisam/ha_myisam.cc: WL#3527: extended the processing of USE/FORCE/IGNORE index --- mysql-test/r/endspace.result | 15 +-- mysql-test/r/group_by.result | 112 +++++++++++++++++++++-- mysql-test/t/endspace.test | 9 +- mysql-test/t/group_by.test | 66 +++++++++++++- sql/item.cc | 2 +- sql/mysql_priv.h | 3 +- sql/mysqld.cc | 7 +- sql/mysqld.cc.rej | 17 ---- sql/opt_range.cc | 8 +- sql/sql_base.cc | 37 ++------ sql/sql_class.h | 6 ++ sql/sql_delete.cc | 4 +- sql/sql_help.cc | 2 +- sql/sql_lex.cc | 91 +++++++++++++++---- sql/sql_lex.h | 81 +++++++++++++++-- sql/sql_parse.cc | 13 +-- sql/sql_parse.cc.rej | 166 ---------------------------------- sql/sql_select.cc | 96 ++++++++++++-------- sql/sql_show.cc | 6 +- sql/sql_update.cc | 16 ++-- sql/sql_yacc.yy | 162 +++++++++++++++++---------------- sql/table.cc | 171 ++++++++++++++++++++++++++++++++++- sql/table.cc.rej | 17 ---- sql/table.h | 29 +++++- storage/myisam/ha_myisam.cc | 49 +++++----- 25 files changed, 727 insertions(+), 458 deletions(-) delete mode 100644 sql/mysqld.cc.rej delete mode 100644 sql/sql_parse.cc.rej delete mode 100644 sql/table.cc.rej diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result index 0e68418a80f..d7135fe3e2c 100644 --- a/mysql-test/r/endspace.result +++ b/mysql-test/r/endspace.result @@ -25,10 +25,11 @@ insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); check table t1; Table Op Msg_type Msg_text test.t1 check status OK -select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +select * from t1 ignore key (key1) where text1='teststring' or +text1 like 'teststring_%' ORDER BY text1; text1 -teststring teststring +teststring select * from t1 where text1='teststring' or text1 like 'teststring_%'; text1 teststring @@ -48,10 +49,11 @@ alter table t1 modify text1 char(32) binary not null; check table t1; Table Op Msg_type Msg_text test.t1 check status OK -select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +select * from t1 ignore key (key1) where text1='teststring' or +text1 like 'teststring_%' ORDER BY text1; text1 -teststring teststring +teststring select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; concat('|', text1, '|') |teststring | @@ -132,10 +134,11 @@ concat('|', text1, '|') drop table t1; create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap; insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); -select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +select * from t1 ignore key (key1) where text1='teststring' or +text1 like 'teststring_%' ORDER BY text1; text1 -teststring teststring +teststring select * from t1 where text1='teststring' or text1 like 'teststring_%'; text1 teststring diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 663ef6cced4..14f517a9520 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -933,12 +933,110 @@ b sum(1) 18 6 19 6 DROP TABLE t1; -CREATE TABLE t1 (a INT, b INT, KEY(a)); -INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4); -EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2; +CREATE TABLE t1 (a INT, b INT, +PRIMARY KEY (a), +KEY i2(a,b)); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); +INSERT INTO t1 SELECT a + 8,b FROM t1; +INSERT INTO t1 SELECT a + 16,b FROM t1; +INSERT INTO t1 SELECT a + 32,b FROM t1; +INSERT INTO t1 SELECT a + 64,b FROM t1; +INSERT INTO t1 SELECT a + 128,b FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 WHERE a < 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL a 5 NULL 4 -EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2; +1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index +EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort -DROP TABLE t1; +1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index +EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 2 Using where; Using index +EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 256 +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 256 +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) +IGNORE INDEX FOR GROUP BY (i2) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index +EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL i2 9 NULL 256 Using index +EXPLAIN SELECT a FROM t1 FORCE INDEX (i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL i2 9 NULL 256 Using index +EXPLAIN SELECT a FROM t1 USE INDEX (); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 256 +EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 256 +EXPLAIN SELECT a FROM t1 +FORCE INDEX (PRIMARY) +IGNORE INDEX FOR GROUP BY (i2) +IGNORE INDEX FOR ORDER BY (i2) +USE INDEX (i2); +ERROR HY000: Incorrect usage of USE INDEX and FORCE INDEX +EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX (); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL i2 9 NULL 256 Using index +EXPLAIN SELECT a FROM t1 FORCE INDEX (); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +EXPLAIN SELECT a FROM t1 IGNORE INDEX (); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2) +USE INDEX FOR GROUP BY (i2) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL i2 9 NULL 256 Using index +EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2) +FORCE INDEX FOR GROUP BY (i2) GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL i2 4 NULL 257 Using index for group-by +EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 256 +EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX (); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 256 +EXPLAIN SELECT a FROM t1 +USE INDEX FOR GROUP BY (i2) +USE INDEX FOR ORDER BY (i2) +USE INDEX FOR JOIN (i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL i2 9 NULL 256 Using index +EXPLAIN SELECT a FROM t1 +USE INDEX FOR JOIN (i2) +USE INDEX FOR JOIN (i2) +USE INDEX FOR JOIN (i2,i2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL i2 9 NULL 256 Using index +EXPLAIN SELECT 1 FROM t1 WHERE a IN +(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL PRIMARY 4 NULL 256 Using where; Using index +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where +CREATE TABLE t2 (a INT, b INT, KEY(a)); +INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4); +EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL a 5 NULL 4 +EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort +EXPLAIN SELECT 1 FROM t2 WHERE a IN +(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where +DROP TABLE t1, t2; diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test index c4d53450910..b223c683cde 100644 --- a/mysql-test/t/endspace.test +++ b/mysql-test/t/endspace.test @@ -16,7 +16,8 @@ drop table if exists t1; create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)); insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); check table t1; -select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +select * from t1 ignore key (key1) where text1='teststring' or + text1 like 'teststring_%' ORDER BY text1; select * from t1 where text1='teststring' or text1 like 'teststring_%'; select * from t1 where text1='teststring' or text1 > 'teststring\t'; select * from t1 order by text1; @@ -24,7 +25,8 @@ explain select * from t1 order by text1; alter table t1 modify text1 char(32) binary not null; check table t1; -select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +select * from t1 ignore key (key1) where text1='teststring' or + text1 like 'teststring_%' ORDER BY text1; select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; select text1, length(text1) from t1 order by text1; @@ -57,7 +59,8 @@ drop table t1; create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap; insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); -select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%'; +select * from t1 ignore key (key1) where text1='teststring' or + text1 like 'teststring_%' ORDER BY text1; select * from t1 where text1='teststring' or text1 like 'teststring_%'; select * from t1 where text1='teststring' or text1 >= 'teststring\t'; select * from t1 order by text1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 7f887335753..96ca79e15b5 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -706,10 +706,66 @@ DROP TABLE t1; # Bug #21174: Index degrades sort performance and # optimizer does not honor IGNORE INDEX # -CREATE TABLE t1 (a INT, b INT, KEY(a)); -INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4); +CREATE TABLE t1 (a INT, b INT, + PRIMARY KEY (a), + KEY i2(a,b)); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); +INSERT INTO t1 SELECT a + 8,b FROM t1; +INSERT INTO t1 SELECT a + 16,b FROM t1; +INSERT INTO t1 SELECT a + 32,b FROM t1; +INSERT INTO t1 SELECT a + 64,b FROM t1; +INSERT INTO t1 SELECT a + 128,b FROM t1; +ANALYZE TABLE t1; +EXPLAIN SELECT a FROM t1 WHERE a < 2; +EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a; +EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a; +EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2); +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2); +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a; +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a; +EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) + IGNORE INDEX FOR GROUP BY (i2) GROUP BY a; +EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2); +EXPLAIN SELECT a FROM t1 FORCE INDEX (i2); +EXPLAIN SELECT a FROM t1 USE INDEX (); +EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2); +--error ER_WRONG_USAGE +EXPLAIN SELECT a FROM t1 + FORCE INDEX (PRIMARY) + IGNORE INDEX FOR GROUP BY (i2) + IGNORE INDEX FOR ORDER BY (i2) + USE INDEX (i2); +EXPLAIN SELECT a FROM t1 USE INDEX (i2) USE INDEX (); +--error ER_PARSE_ERROR +EXPLAIN SELECT a FROM t1 FORCE INDEX (); +--error ER_PARSE_ERROR +EXPLAIN SELECT a FROM t1 IGNORE INDEX (); +EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2) + USE INDEX FOR GROUP BY (i2) GROUP BY a; +EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2) + FORCE INDEX FOR GROUP BY (i2) GROUP BY a; +EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2); +EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX (); -EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2; -EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2; +EXPLAIN SELECT a FROM t1 + USE INDEX FOR GROUP BY (i2) + USE INDEX FOR ORDER BY (i2) + USE INDEX FOR JOIN (i2); -DROP TABLE t1; +EXPLAIN SELECT a FROM t1 + USE INDEX FOR JOIN (i2) + USE INDEX FOR JOIN (i2) + USE INDEX FOR JOIN (i2,i2); + +EXPLAIN SELECT 1 FROM t1 WHERE a IN + (SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2)); + +CREATE TABLE t2 (a INT, b INT, KEY(a)); +INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4); +EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2; +EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2; + +EXPLAIN SELECT 1 FROM t2 WHERE a IN + (SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2)); + +DROP TABLE t1, t2; diff --git a/sql/item.cc b/sql/item.cc index e2ab28dd452..0bd5e70773a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3828,7 +3828,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) { /* First usage of column */ table->used_fields++; // Used to optimize loops - table->used_keys.intersect(field->part_of_key); + table->covering_keys.intersect(field->part_of_key); } } } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 812268fc92c..410dbd71304 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1957,7 +1957,6 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) table->const_table= 0; table->null_row= 0; table->status= STATUS_NO_RECORD; - table->keys_in_use_for_query= table->s->keys_in_use; table->maybe_null= table_list->outer_join; TABLE_LIST *embedding= table_list->embedding; while (!table->maybe_null && embedding) @@ -1968,6 +1967,8 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) table->tablenr= tablenr; table->map= (table_map) 1 << tablenr; table->force_index= table_list->force_index; + table->covering_keys= table->s->keys_for_keyread; + table->merge_keys.clear_all(); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 96dfb3d01ec..a8406451b75 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4869,7 +4869,8 @@ enum options_mysqld OPT_PORT_OPEN_TIMEOUT, OPT_GENERAL_LOG, OPT_SLOW_LOG, - OPT_MERGE + OPT_MERGE, + OPT_OLD_MODE }; @@ -6080,6 +6081,10 @@ The minimum value for this variable is 4096.", (gptr*) &global_system_variables.net_write_timeout, (gptr*) &max_system_variables.net_write_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, + { "old_mode", OPT_OLD_MODE, "Use compatible behaviour.", + (gptr*) &global_system_variables.old_mode, + (gptr*) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"open_files_limit", OPT_OPEN_FILES_LIMIT, "If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.", (gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG, diff --git a/sql/mysqld.cc.rej b/sql/mysqld.cc.rej deleted file mode 100644 index 62f0357622d..00000000000 --- a/sql/mysqld.cc.rej +++ /dev/null @@ -1,17 +0,0 @@ -*************** -*** 5316,5322 **** - (gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \ - --skip-merge.", -! (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0}, - {"myisam-recover", OPT_MYISAM_RECOVER, - "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.", - (gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0, ---- 5336,5342 ---- - (gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \ - --skip-merge.", -! (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"myisam-recover", OPT_MYISAM_RECOVER, - "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.", - (gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0, diff --git a/sql/opt_range.cc b/sql/opt_range.cc index fa575e73c39..e8c37856151 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2109,9 +2109,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, param.key_parts_end=key_parts; /* Calculate cost of full index read for the shortest covering index */ - if (!head->used_keys.is_clear_all()) + if (!head->covering_keys.is_clear_all()) { - int key_for_use= find_shortest_key(head, &head->used_keys); + int key_for_use= find_shortest_key(head, &head->covering_keys); double key_read_time= (get_index_only_read_time(¶m, records, key_for_use) + (double) records / TIME_FOR_COMPARE); @@ -4646,7 +4646,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, param->needed_reg->set_bit(keynr); bool read_index_only= index_read_must_be_used ? TRUE : - (bool) param->table->used_keys.is_set(keynr); + (bool) param->table->covering_keys.is_set(keynr); found_records= check_quick_select(param, idx, *key, update_tbl_stats); if (param->is_ror_scan) @@ -8988,7 +8988,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) cur_index_info++, cur_index++) { /* Check (B1) - if current index is covering. */ - if (!table->used_keys.is_set(cur_index)) + if (!table->covering_keys.is_set(cur_index)) goto next_index; /* diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 3fd09d909a4..e7a0a9ed89e 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1792,8 +1792,6 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list) table->const_table=0; table->null_row= table->maybe_null= table->force_index= 0; table->status=STATUS_NO_RECORD; - table->keys_in_use_for_query= share->keys_in_use; - table->used_keys= share->keys_for_keyread; DBUG_RETURN(FALSE); } @@ -2115,9 +2113,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table->const_table=0; table->null_row= table->maybe_null= table->force_index= 0; table->status=STATUS_NO_RECORD; - table->keys_in_use_for_query= table->s->keys_in_use; table->insert_values= 0; - table->used_keys= table->s->keys_for_keyread; table->fulltext_searched= 0; table->file->ft_handler= 0; if (table->timestamp_field) @@ -2202,8 +2198,6 @@ static bool reopen_table(TABLE *table) tmp.null_row= table->null_row; tmp.maybe_null= table->maybe_null; tmp.status= table->status; - tmp.keys_in_use_for_query= tmp.s->keys_in_use; - tmp.used_keys= tmp.s->keys_for_keyread; tmp.s->table_map_id= table->s->table_map_id; @@ -3621,7 +3615,7 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table) been set for all fields (for example for view). */ - table->used_keys.intersect(field->part_of_key); + table->covering_keys.intersect(field->part_of_key); table->merge_keys.merge(field->part_of_key); if (thd->mark_used_columns == MARK_COLUMNS_READ) @@ -4798,7 +4792,7 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, TABLE *table_1= nj_col_1->table_ref->table; /* Mark field_1 used for table cache. */ bitmap_set_bit(table_1->read_set, field_1->field_index); - table_1->used_keys.intersect(field_1->part_of_key); + table_1->covering_keys.intersect(field_1->part_of_key); table_1->merge_keys.merge(field_1->part_of_key); } if (field_2) @@ -4806,7 +4800,7 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, TABLE *table_2= nj_col_2->table_ref->table; /* Mark field_2 used for table cache. */ bitmap_set_bit(table_2->read_set, field_2->field_index); - table_2->used_keys.intersect(field_2->part_of_key); + table_2->covering_keys.intersect(field_2->part_of_key); table_2->merge_keys.merge(field_2->part_of_key); } @@ -5446,25 +5440,8 @@ bool setup_tables(THD *thd, Name_resolution_context *context, tablenr= 0; } setup_table_map(table, table_list, tablenr); - table->used_keys= table->s->keys_for_keyread; - table->merge_keys.clear_all(); - if (table_list->use_index) - { - key_map map; - get_key_map_from_key_list(&map, table, table_list->use_index); - if (map.is_set_all()) - DBUG_RETURN(1); - table->keys_in_use_for_query=map; - } - if (table_list->ignore_index) - { - key_map map; - get_key_map_from_key_list(&map, table, table_list->ignore_index); - if (map.is_set_all()) - DBUG_RETURN(1); - table->keys_in_use_for_query.subtract(map); - } - table->used_keys.intersect(table->keys_in_use_for_query); + if (table_list->process_index_hints(table)) + DBUG_RETURN(1); } if (tablenr > MAX_TABLES) { @@ -5746,7 +5723,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, bitmap_set_bit(field->table->read_set, field->field_index); if (table) { - table->used_keys.intersect(field->part_of_key); + table->covering_keys.intersect(field->part_of_key); table->merge_keys.merge(field->part_of_key); } if (tables->is_natural_join) @@ -5764,7 +5741,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, if (field_table) { thd->used_tables|= field_table->map; - field_table->used_keys.intersect(field->part_of_key); + field_table->covering_keys.intersect(field->part_of_key); field_table->merge_keys.merge(field->part_of_key); field_table->used_fields++; } diff --git a/sql/sql_class.h b/sql/sql_class.h index de4a394d53c..7c61bdbb14e 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -240,6 +240,11 @@ struct system_variables my_bool low_priority_updates; my_bool new_mode; + /* + compatibility option: + - index usage hints (USE INDEX without a FOR clause) behave as in 5.0 + */ + my_bool old_mode; my_bool query_cache_wlock_invalidate; my_bool engine_condition_pushdown; my_bool innodb_table_locks; @@ -277,6 +282,7 @@ struct system_variables DATE_TIME_FORMAT *datetime_format; DATE_TIME_FORMAT *time_format; my_bool sysdate_is_now; + }; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index df24dad2d4c..085b8348da2 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -117,7 +117,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, /* Update the table->file->stats.records number */ table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); - table->used_keys.clear_all(); + table->covering_keys.clear_all(); table->quick_keys.clear_all(); // Can't use 'only index' select=make_select(table, 0, 0, conds, 0, &error); if (error) @@ -548,7 +548,7 @@ multi_delete::initialize_tables(JOIN *join) tbl->no_keyread=1; /* Don't use record cache */ tbl->no_cache= 1; - tbl->used_keys.clear_all(); + tbl->covering_keys.clear_all(); if (tbl->file->has_transactions()) transactional_tables= 1; else diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 69d21f8b7bb..adca77d86c4 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -568,7 +568,7 @@ SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, cond->fix_fields(thd, &cond); // can never fail /* Assume that no indexes cover all required fields */ - table->used_keys.clear_all(); + table->covering_keys.clear_all(); SQL_SELECT *res= make_select(table, 0, 0, cond, 0, error); if (*error || (res && res->check_quick(thd, 0, HA_POS_ERROR)) || diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index d156973a790..d4906122f76 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -70,6 +70,17 @@ static uchar to_upper_lex[]= 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 }; +/* + Names of the index hints (for error messages). Keep in sync with + index_hint_type +*/ + +const char * index_hint_type_name[] = +{ + "IGNORE INDEX", + "USE INDEX", + "FORCE INDEX" +}; inline int lex_casecmp(const char *s, const char *t, uint len) { @@ -1173,7 +1184,6 @@ void st_select_lex::init_select() group_list.empty(); type= db= 0; having= 0; - use_index_ptr= ignore_index_ptr= 0; table_join_options= 0; in_sum_expr= with_wild= 0; options= 0; @@ -1182,7 +1192,6 @@ void st_select_lex::init_select() when_list.empty(); expr_list.empty(); interval_list.empty(); - use_index.empty(); ftfunc_list_alloc.empty(); inner_sum_func_list= 0; ftfunc_list= &ftfunc_list_alloc; @@ -1397,14 +1406,11 @@ bool st_select_lex_node::inc_in_sum_expr() { return 1; } uint st_select_lex_node::get_in_sum_expr() { return 0; } TABLE_LIST* st_select_lex_node::get_table_list() { return 0; } List* st_select_lex_node::get_item_list() { return 0; } -List* st_select_lex_node::get_use_index() { return 0; } -List* st_select_lex_node::get_ignore_index() { return 0; } -TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table, +TABLE_LIST *st_select_lex_node::add_table_to_list (THD *thd, Table_ident *table, LEX_STRING *alias, ulong table_join_options, thr_lock_type flags, - List *use_index, - List *ignore_index, + List *hints, LEX_STRING *option) { return 0; @@ -1511,19 +1517,6 @@ List* st_select_lex::get_item_list() return &item_list; } - -List* st_select_lex::get_use_index() -{ - return use_index_ptr; -} - - -List* st_select_lex::get_ignore_index() -{ - return ignore_index_ptr; -} - - ulong st_select_lex::get_table_join_options() { return table_join_options; @@ -2260,3 +2253,61 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds, are in sql_union.cc */ +/* + Sets the kind of hints to be added by the calls to add_index_hint(). + + SYNOPSIS + set_index_hint_type() + type the kind of hints to be added from now on. + clause the clause to use for hints to be added from now on. + + DESCRIPTION + Used in filling up the tagged hints list. + This list is filled by first setting the kind of the hint as a + context variable and then adding hints of the current kind. + Then the context variable index_hint_type can be reset to the + next hint type. +*/ +void st_select_lex::set_index_hint_type(enum index_hint_type type, + index_clause_map clause) +{ + current_index_hint_type= type; + current_index_hint_clause= clause; +} + + +/* + Makes an array to store index usage hints (ADD/FORCE/IGNORE INDEX). + + SYNOPSIS + alloc_index_hints() + thd current thread. +*/ + +void st_select_lex::alloc_index_hints (THD *thd) +{ + index_hints= new (thd->mem_root) List(); +} + + + +/* + adds an element to the array storing index usage hints + (ADD/FORCE/IGNORE INDEX). + + SYNOPSIS + add_index_hint() + thd current thread. + str name of the index. + length number of characters in str. + + RETURN VALUE + 0 on success, non-zero otherwise +*/ +bool st_select_lex::add_index_hint (THD *thd, char *str, uint length) +{ + return index_hints->push_front (new (thd->mem_root) + index_hint(current_index_hint_type, + current_index_hint_clause, + str, length)); +} diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 7fd60cbfa58..0e91b2a786b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -208,6 +208,47 @@ enum tablespace_op_type NO_TABLESPACE_OP, DISCARD_TABLESPACE, IMPORT_TABLESPACE }; +/* + String names used to print a statement with index hints. + Keep in sync with index_hint_type. +*/ +extern const char * index_hint_type_name[]; +typedef byte index_clause_map; + +/* + Bits in index_clause_map : one for each possible FOR clause in + USE/FORCE/IGNORE INDEX index hint specification +*/ +#define INDEX_HINT_MASK_JOIN (1) +#define INDEX_HINT_MASK_GROUP (1 << 1) +#define INDEX_HINT_MASK_ORDER (1 << 2) + +#define INDEX_HINT_MASK_ALL (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | \ + INDEX_HINT_MASK_ORDER) + +/* Single element of an USE/FORCE/IGNORE INDEX list specified as a SQL hint */ +class index_hint : public Sql_alloc +{ +public: + /* The type of the hint : USE/FORCE/IGNORE */ + enum index_hint_type type; + /* Where the hit applies to. A bitmask of INDEX_HINT_MASK_ values */ + index_clause_map clause; + /* + The index name. Empty (str=NULL) name represents an empty list + USE INDEX () clause + */ + LEX_STRING key_name; + + index_hint (enum index_hint_type type_arg, index_clause_map clause_arg, + char *str, uint length) : + type(type_arg), clause(clause_arg) + { + key_name.str= str; + key_name.length= length; + } +}; + /* The state of the lex parsing for selects @@ -386,15 +427,12 @@ public: virtual uint get_in_sum_expr(); virtual TABLE_LIST* get_table_list(); virtual List* get_item_list(); - virtual List* get_use_index(); - virtual List* get_ignore_index(); virtual ulong get_table_join_options(); virtual TABLE_LIST *add_table_to_list(THD *thd, Table_ident *table, LEX_STRING *alias, ulong table_options, thr_lock_type flags= TL_UNLOCK, - List *use_index= 0, - List *ignore_index= 0, + List *hints= 0, LEX_STRING *option= 0); virtual void set_lock_for_tables(thr_lock_type lock_type) {} @@ -521,8 +559,7 @@ public: SQL_LIST table_list; SQL_LIST group_list; /* GROUP BY clause. */ List item_list; /* list of fields & expressions */ - List interval_list, use_index, *use_index_ptr, - ignore_index, *ignore_index_ptr; + List interval_list; bool is_item_list_lookup; /* Usualy it is pointer to ftfunc_list_alloc, but in union used to create fake @@ -645,8 +682,7 @@ public: LEX_STRING *alias, ulong table_options, thr_lock_type flags= TL_UNLOCK, - List *use_index= 0, - List *ignore_index= 0, + List *hints= 0, LEX_STRING *option= 0); TABLE_LIST* get_table_list(); bool init_nested_join(THD *thd); @@ -655,8 +691,6 @@ public: void add_joined_table(TABLE_LIST *table); TABLE_LIST *convert_right_join(); List* get_item_list(); - List* get_use_index(); - List* get_ignore_index(); ulong get_table_join_options(); void set_lock_for_tables(thr_lock_type lock_type); inline void init_order() @@ -696,6 +730,33 @@ public: select lexes. */ void cleanup_all_joins(bool full); + + void set_index_hint_type(enum index_hint_type type, index_clause_map clause); + + /* + Add a index hint to the tagged list of hints. The type and clause of the + hint will be the current ones (set by set_index_hint()) + */ + bool add_index_hint (THD *thd, char *str, uint length); + + /* make a list to hold index hints */ + void alloc_index_hints (THD *thd); + /* read and clear the index hints */ + List* pop_index_hints(void) + { + List *hints= index_hints; + index_hints= NULL; + return hints; + } + + void clear_index_hints(void) { index_hints= NULL; } + +private: + /* current index hint kind. used in filling up index_hints */ + enum index_hint_type current_index_hint_type; + index_clause_map current_index_hint_clause; + /* a list of USE/FORCE/IGNORE INDEX */ + List *index_hints; }; typedef class st_select_lex SELECT_LEX; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1c46c3189d9..5fa3c22408f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2382,8 +2382,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, /* 'parent_lex' is used in init_query() so it must be before it. */ sel->parent_lex= lex; sel->init_query(); - if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ, - (List *) 0, (List *) 0)) + if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ)) DBUG_RETURN(1); lex->query_tables_last= query_tables_last; TABLE_LIST *table_list= (TABLE_LIST*) sel->table_list.first; @@ -6336,8 +6335,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, LEX_STRING *alias, ulong table_options, thr_lock_type lock_type, - List *use_index_arg, - List *ignore_index_arg, + List *index_hints_arg, LEX_STRING *option) { register TABLE_LIST *ptr; @@ -6412,12 +6410,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, } ptr->select_lex= lex->current_select; ptr->cacheable_table= 1; - if (use_index_arg) - ptr->use_index=(List *) thd->memdup((gptr) use_index_arg, - sizeof(*use_index_arg)); - if (ignore_index_arg) - ptr->ignore_index=(List *) thd->memdup((gptr) ignore_index_arg, - sizeof(*ignore_index_arg)); + ptr->index_hints= index_hints_arg; ptr->option= option ? option->str : 0; /* check that used name is unique */ if (lock_type != TL_IGNORE) diff --git a/sql/sql_parse.cc.rej b/sql/sql_parse.cc.rej deleted file mode 100644 index 6e2bd03867d..00000000000 --- a/sql/sql_parse.cc.rej +++ /dev/null @@ -1,166 +0,0 @@ -*************** -*** 67,109 **** - static void decrease_user_connections(USER_CONN *uc); - #endif /* NO_EMBEDDED_ACCESS_CHECKS */ - static bool check_multi_update_lock(THD *thd); -- static void remove_escape(char *name); - static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables); - - const char *any_db="*any*"; // Special symbol for check_access - -! LEX_STRING command_name[]={ -! (char *)STRING_WITH_LEN("Sleep"), -! (char *)STRING_WITH_LEN("Quit"), -! (char *)STRING_WITH_LEN("Init DB"), -! (char *)STRING_WITH_LEN("Query"), -! (char *)STRING_WITH_LEN("Field List"), -! (char *)STRING_WITH_LEN("Create DB"), -! (char *)STRING_WITH_LEN("Drop DB"), -! (char *)STRING_WITH_LEN("Refresh"), -! (char *)STRING_WITH_LEN("Shutdown"), -! (char *)STRING_WITH_LEN("Statistics"), -! (char *)STRING_WITH_LEN("Processlist"), -! (char *)STRING_WITH_LEN("Connect"), -! (char *)STRING_WITH_LEN("Kill"), -! (char *)STRING_WITH_LEN("Debug"), -! (char *)STRING_WITH_LEN("Ping"), -! (char *)STRING_WITH_LEN("Time"), -! (char *)STRING_WITH_LEN("Delayed insert"), -! (char *)STRING_WITH_LEN("Change user"), -! (char *)STRING_WITH_LEN("Binlog Dump"), -! (char *)STRING_WITH_LEN("Table Dump"), -! (char *)STRING_WITH_LEN("Connect Out"), -! (char *)STRING_WITH_LEN("Register Slave"), -! (char *)STRING_WITH_LEN("Prepare"), -! (char *)STRING_WITH_LEN("Execute"), -! (char *)STRING_WITH_LEN("Long Data"), -! (char *)STRING_WITH_LEN("Close stmt"), -! (char *)STRING_WITH_LEN("Reset stmt"), -! (char *)STRING_WITH_LEN("Set option"), -! (char *)STRING_WITH_LEN("Fetch"), -! (char *)STRING_WITH_LEN("Daemon"), -! (char *)STRING_WITH_LEN("Error") // Last command number - }; - - const char *xa_state_names[]={ ---- 67,108 ---- - static void decrease_user_connections(USER_CONN *uc); - #endif /* NO_EMBEDDED_ACCESS_CHECKS */ - static bool check_multi_update_lock(THD *thd); - static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables); - - const char *any_db="*any*"; // Special symbol for check_access - -! const LEX_STRING command_name[]={ -! C_STRING_WITH_LEN("Sleep"), -! C_STRING_WITH_LEN("Quit"), -! C_STRING_WITH_LEN("Init DB"), -! C_STRING_WITH_LEN("Query"), -! C_STRING_WITH_LEN("Field List"), -! C_STRING_WITH_LEN("Create DB"), -! C_STRING_WITH_LEN("Drop DB"), -! C_STRING_WITH_LEN("Refresh"), -! C_STRING_WITH_LEN("Shutdown"), -! C_STRING_WITH_LEN("Statistics"), -! C_STRING_WITH_LEN("Processlist"), -! C_STRING_WITH_LEN("Connect"), -! C_STRING_WITH_LEN("Kill"), -! C_STRING_WITH_LEN("Debug"), -! C_STRING_WITH_LEN("Ping"), -! C_STRING_WITH_LEN("Time"), -! C_STRING_WITH_LEN("Delayed insert"), -! C_STRING_WITH_LEN("Change user"), -! C_STRING_WITH_LEN("Binlog Dump"), -! C_STRING_WITH_LEN("Table Dump"), -! C_STRING_WITH_LEN("Connect Out"), -! C_STRING_WITH_LEN("Register Slave"), -! C_STRING_WITH_LEN("Prepare"), -! C_STRING_WITH_LEN("Execute"), -! C_STRING_WITH_LEN("Long Data"), -! C_STRING_WITH_LEN("Close stmt"), -! C_STRING_WITH_LEN("Reset stmt"), -! C_STRING_WITH_LEN("Set option"), -! C_STRING_WITH_LEN("Fetch"), -! C_STRING_WITH_LEN("Daemon"), -! C_STRING_WITH_LEN("Error") // Last command number - }; - - const char *xa_state_names[]={ -*************** -*** 1738,1744 **** - password. New clients send the size (1 byte) + string (not null - terminated, so also '\0' for empty string). - */ -! char db_buff[NAME_LEN+1]; // buffer to store db in utf8 - char *db= passwd; - uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? - *passwd++ : strlen(passwd); ---- 1736,1742 ---- - password. New clients send the size (1 byte) + string (not null - terminated, so also '\0' for empty string). - */ -! char db_buff[NAME_LEN+1]; // buffer to store db in utf8 - char *db= passwd; - uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? - *passwd++ : strlen(passwd); -*************** -*** 2315,2321 **** - DBUG_RETURN(1); - } - db= lex->select_lex.db; -- remove_escape(db); // Fix escaped '_' - if (check_db_name(db)) - { - my_error(ER_WRONG_DB_NAME, MYF(0), db); ---- 2312,2317 ---- - DBUG_RETURN(1); - } - db= lex->select_lex.db; - if (check_db_name(db)) - { - my_error(ER_WRONG_DB_NAME, MYF(0), db); -*************** -*** 6310,6345 **** - } - - -- /* Fix escaping of _, % and \ in database and table names (for ODBC) */ -- -- static void remove_escape(char *name) -- { -- if (!*name) // For empty DB names -- return; -- char *to; -- #ifdef USE_MB -- char *strend=name+(uint) strlen(name); -- #endif -- for (to=name; *name ; name++) -- { -- #ifdef USE_MB -- int l; -- if (use_mb(system_charset_info) && -- (l = my_ismbchar(system_charset_info, name, strend))) -- { -- while (l--) -- *to++ = *name++; -- name--; -- continue; -- } -- #endif -- if (*name == '\\' && name[1]) -- name++; // Skip '\\' -- *to++= *name; -- } -- *to=0; -- } -- - /**************************************************************************** - ** save order by and tables in own lists - ****************************************************************************/ ---- 6296,6301 ---- - } - - - /**************************************************************************** - ** save order by and tables in own lists - ****************************************************************************/ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9a64055f2e3..f05bf555816 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -165,13 +165,15 @@ static COND *make_cond_for_table(COND *cond,table_map table, static Item* part_of_refkey(TABLE *form,Field *field); uint find_shortest_key(TABLE *table, const key_map *usable_keys); static bool test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order, - ha_rows select_limit, bool no_changes); + ha_rows select_limit, bool no_changes, + key_map *map); static bool list_contains_unique_index(TABLE *table, bool (*find_func) (Field *, void *), void *data); static bool find_field_in_item_list (Field *field, void *data); static bool find_field_in_order_list (Field *field, void *data); static int create_sort_index(THD *thd, JOIN *join, ORDER *order, - ha_rows filesort_limit, ha_rows select_limit); + ha_rows filesort_limit, ha_rows select_limit, + bool is_order_by); static int remove_duplicates(JOIN *join,TABLE *entry,List &fields, Item *having); static int remove_dup_with_compare(THD *thd, TABLE *entry, Field **field, @@ -916,14 +918,15 @@ JOIN::optimize() JOIN_TAB *tab= &join_tab[const_tables]; bool all_order_fields_used; if (order) - skip_sort_order= test_if_skip_sort_order(tab, order, select_limit, 1); + skip_sort_order= test_if_skip_sort_order(tab, order, select_limit, 1, + &tab->table->keys_in_use_for_order_by); if ((group_list=create_distinct_group(thd, select_lex->ref_pointer_array, order, fields_list, &all_order_fields_used))) { bool skip_group= (skip_sort_order && - test_if_skip_sort_order(tab, group_list, select_limit, - 1) != 0); + test_if_skip_sort_order(tab, group_list, select_limit, 1, + &tab->table->keys_in_use_for_group_by) != 0); if ((skip_group && all_order_fields_used) || select_limit == HA_POS_ERROR || (order && !skip_sort_order)) @@ -1113,7 +1116,9 @@ JOIN::optimize() ((group_list && (!simple_group || !test_if_skip_sort_order(&join_tab[const_tables], group_list, - unit->select_limit_cnt, 0))) || + unit->select_limit_cnt, 0, + &join_tab[const_tables].table-> + keys_in_use_for_group_by))) || select_distinct) && tmp_table_param.quick_group && !procedure) { @@ -1215,7 +1220,7 @@ JOIN::optimize() DBUG_PRINT("info",("Sorting for group")); thd->proc_info="Sorting for group"; if (create_sort_index(thd, this, group_list, - HA_POS_ERROR, HA_POS_ERROR) || + HA_POS_ERROR, HA_POS_ERROR, FALSE) || alloc_group_fields(this, group_list) || make_sum_func_list(all_fields, fields_list, 1) || setup_sum_funcs(thd, sum_funcs)) @@ -1232,7 +1237,7 @@ JOIN::optimize() DBUG_PRINT("info",("Sorting for order")); thd->proc_info="Sorting for order"; if (create_sort_index(thd, this, order, - HA_POS_ERROR, HA_POS_ERROR)) + HA_POS_ERROR, HA_POS_ERROR, TRUE)) DBUG_RETURN(1); order=0; } @@ -1259,7 +1264,9 @@ JOIN::optimize() { /* Should always succeed */ if (test_if_skip_sort_order(&join_tab[const_tables], - order, unit->select_limit_cnt, 0)) + order, unit->select_limit_cnt, 0, + &join_tab[const_tables].table-> + keys_in_use_for_order_by)) order=0; } } @@ -1452,7 +1459,9 @@ JOIN::exec() (const_tables == tables || ((simple_order || skip_sort_order) && test_if_skip_sort_order(&join_tab[const_tables], order, - select_limit, 0)))) + select_limit, 0, + &join_tab[const_tables].table-> + keys_in_use_for_order_by)))) order=0; having= tmp_having; select_describe(this, need_tmp, @@ -1628,7 +1637,7 @@ JOIN::exec() DBUG_VOID_RETURN; } if (create_sort_index(thd, curr_join, curr_join->group_list, - HA_POS_ERROR, HA_POS_ERROR) || + HA_POS_ERROR, HA_POS_ERROR, FALSE) || make_group_fields(this, curr_join)) { DBUG_VOID_RETURN; @@ -1844,7 +1853,8 @@ JOIN::exec() curr_join->group_list : curr_join->order, curr_join->select_limit, (select_options & OPTION_FOUND_ROWS ? - HA_POS_ERROR : unit->select_limit_cnt))) + HA_POS_ERROR : unit->select_limit_cnt), + curr_join->group_list ? TRUE : FALSE)) DBUG_VOID_RETURN; sortorder= curr_join->sortorder; if (curr_join->const_tables != curr_join->tables && @@ -3842,7 +3852,7 @@ best_access_path(JOIN *join, /* Limit the number of matched rows */ tmp= records; set_if_smaller(tmp, (double) thd->variables.max_seeks_for_key); - if (table->used_keys.is_set(key)) + if (table->covering_keys.is_set(key)) { /* we can use only index tree */ uint keys_per_block= table->file->stats.block_size/2/ @@ -4009,7 +4019,7 @@ best_access_path(JOIN *join, /* Limit the number of matched rows */ set_if_smaller(tmp, (double) thd->variables.max_seeks_for_key); - if (table->used_keys.is_set(key)) + if (table->covering_keys.is_set(key)) { /* we can use only index tree */ uint keys_per_block= table->file->stats.block_size/2/ @@ -4068,7 +4078,7 @@ best_access_path(JOIN *join, !(s->quick && best_key && s->quick->index == best_key->key && // (2) best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&// (2) !((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) && // (3) - ! s->table->used_keys.is_clear_all() && best_key) && // (3) + ! s->table->covering_keys.is_clear_all() && best_key) && // (3) !(s->table->force_index && best_key && !s->quick)) // (4) { // Check full join ha_rows rnd_records= s->found_records; @@ -5965,7 +5975,7 @@ make_join_readinfo(JOIN *join, ulonglong options) (table == join->sort_by_table && (!join->order || join->skip_sort_order || test_if_skip_sort_order(tab, join->order, join->select_limit, - 1)) + 1, &table->keys_in_use_for_order_by)) ) || (join->sort_by_table == (TABLE *) 1 && i != join->const_tables)) ordered_set= 1; @@ -5982,7 +5992,7 @@ make_join_readinfo(JOIN *join, ulonglong options) table->status=STATUS_NO_RECORD; tab->read_first_record= join_read_const; tab->read_record.read_record= join_no_more_records; - if (table->used_keys.is_set(tab->ref.key) && + if (table->covering_keys.is_set(tab->ref.key) && !table->no_keyread) { table->key_read=1; @@ -6000,7 +6010,7 @@ make_join_readinfo(JOIN *join, ulonglong options) tab->quick=0; tab->read_first_record= join_read_key; tab->read_record.read_record= join_no_more_records; - if (table->used_keys.is_set(tab->ref.key) && + if (table->covering_keys.is_set(tab->ref.key) && !table->no_keyread) { table->key_read=1; @@ -6017,7 +6027,7 @@ make_join_readinfo(JOIN *join, ulonglong options) } delete tab->quick; tab->quick=0; - if (table->used_keys.is_set(tab->ref.key) && + if (table->covering_keys.is_set(tab->ref.key) && !table->no_keyread) { table->key_read=1; @@ -6103,15 +6113,15 @@ make_join_readinfo(JOIN *join, ulonglong options) { if (tab->select && tab->select->quick && tab->select->quick->index != MAX_KEY && //not index_merge - table->used_keys.is_set(tab->select->quick->index)) + table->covering_keys.is_set(tab->select->quick->index)) { table->key_read=1; table->file->extra(HA_EXTRA_KEYREAD); } - else if (!table->used_keys.is_clear_all() && + else if (!table->covering_keys.is_clear_all() && !(tab->select && tab->select->quick)) { // Only read index tree - tab->index=find_shortest_key(table, & table->used_keys); + tab->index=find_shortest_key(table, & table->covering_keys); tab->read_first_record= join_read_first; tab->type=JT_NEXT; // Read with index_first / index_next } @@ -9179,7 +9189,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, table->copy_blobs= 1; table->in_use= thd; table->quick_keys.init(); - table->used_keys.init(); + table->covering_keys.init(); table->keys_in_use_for_query.init(); table->s= share; @@ -10804,7 +10814,7 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos) } else { - if (!table->key_read && table->used_keys.is_set(tab->ref.key) && + if (!table->key_read && table->covering_keys.is_set(tab->ref.key) && !table->no_keyread && (int) table->reginfo.lock_type <= (int) TL_READ_HIGH_PRIORITY) { @@ -11109,7 +11119,7 @@ join_read_first(JOIN_TAB *tab) { int error; TABLE *table=tab->table; - if (!table->key_read && table->used_keys.is_set(tab->index) && + if (!table->key_read && table->covering_keys.is_set(tab->index) && !table->no_keyread) { table->key_read=1; @@ -11148,7 +11158,7 @@ join_read_last(JOIN_TAB *tab) { TABLE *table=tab->table; int error; - if (!table->key_read && table->used_keys.is_set(tab->index) && + if (!table->key_read && table->covering_keys.is_set(tab->index) && !table->no_keyread) { table->key_read=1; @@ -12170,7 +12180,7 @@ find_field_in_item_list (Field *field, void *data) static bool test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, - bool no_changes) + bool no_changes, key_map *map) { int ref_key; uint ref_key_parts; @@ -12184,9 +12194,16 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, Check which keys can be used to resolve ORDER BY. We must not try to use disabled keys. */ - usable_keys= table->s->keys_in_use; - /* we must not consider keys that are disabled by IGNORE INDEX */ - usable_keys.intersect(table->keys_in_use_for_query); + usable_keys= *map; + + /* + If there is a covering index, and we have IGNORE INDEX FOR GROUP/ORDER + and this index is used for the JOIN part, then we have to ignore the + IGNORE INDEX FOR GROUP/ORDER + */ + if (table->key_read || + (table->covering_keys.is_set(tab->index) && !table->no_keyread)) + usable_keys.set_bit (tab->index); for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next) { @@ -12244,8 +12261,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, If using index only read, only consider other possible index only keys */ - if (table->used_keys.is_set(ref_key)) - usable_keys.intersect(table->used_keys); + if (table->covering_keys.is_set(ref_key)) + usable_keys.intersect(table->covering_keys); if ((new_ref_key= test_if_subkey(order, table, ref_key, ref_key_parts, &usable_keys)) < MAX_KEY) { @@ -12360,7 +12377,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, if (select_limit >= table->file->stats.records) { keys= *table->file->keys_to_use_for_scanning(); - keys.merge(table->used_keys); + keys.merge(table->covering_keys); /* We are adding here also the index specified in FORCE INDEX clause, @@ -12388,7 +12405,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, tab->read_first_record= (flag > 0 ? join_read_first: join_read_last); tab->type=JT_NEXT; // Read with index_first(), index_next() - if (table->used_keys.is_set(nr)) + if (table->covering_keys.is_set(nr)) { table->key_read=1; table->file->extra(HA_EXTRA_KEYREAD); @@ -12414,6 +12431,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, filesort_limit Max number of rows that needs to be sorted select_limit Max number of rows in final output Used to decide if we should use index or not + is_order_by true if we are sorting on ORDER BY, false if GROUP BY + Used to decide if we should use index or not IMPLEMENTATION @@ -12432,7 +12451,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, static int create_sort_index(THD *thd, JOIN *join, ORDER *order, - ha_rows filesort_limit, ha_rows select_limit) + ha_rows filesort_limit, ha_rows select_limit, + bool is_order_by) { uint length; ha_rows examined_rows; @@ -12453,7 +12473,9 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, */ if ((order != join->group_list || !(join->select_options & SELECT_BIG_RESULT)) && - test_if_skip_sort_order(tab,order,select_limit,0)) + test_if_skip_sort_order(tab,order,select_limit,0, + is_order_by ? &table->keys_in_use_for_order_by : + &table->keys_in_use_for_group_by)) DBUG_RETURN(0); if (!(join->sortorder= make_unireg_sortorder(order,&length,join->sortorder))) @@ -15047,7 +15069,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, /* Build "Extra" field and add it to item_list. */ my_bool key_read=table->key_read; if ((tab->type == JT_NEXT || tab->type == JT_CONST) && - table->used_keys.is_set(tab->index)) + table->covering_keys.is_set(tab->index)) key_read=1; if (quick_type == QUICK_SELECT_I::QS_TYPE_ROR_INTERSECT && !((QUICK_ROR_INTERSECT_SELECT*)tab->select->quick)->need_to_fetch_row) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 0ebccba43ca..622a415a743 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2269,8 +2269,7 @@ int make_table_list(THD *thd, SELECT_LEX *sel, ident_table.length= strlen(table); table_ident= new Table_ident(thd, ident_db, ident_table, 1); sel->init_query(); - if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ, - (List *) 0, (List *) 0)) + if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ)) return 1; return 0; } @@ -4934,8 +4933,7 @@ int make_schema_select(THD *thd, SELECT_LEX *sel, strlen(schema_table->table_name), 0); if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */ !sel->add_table_to_list(thd, new Table_ident(thd, db, table, 0), - 0, 0, TL_READ, (List *) 0, - (List *) 0)) + 0, 0, TL_READ)) { DBUG_RETURN(1); } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index a379ea66db6..41ddd89f759 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -130,7 +130,7 @@ int mysql_update(THD *thd, #endif uint table_count= 0; ha_rows updated, found; - key_map old_used_keys; + key_map old_covering_keys; TABLE *table; SQL_SELECT *select; READ_RECORD info; @@ -168,8 +168,8 @@ int mysql_update(THD *thd, thd->proc_info="init"; table= table_list->table; - /* Calculate "table->used_keys" based on the WHERE */ - table->used_keys= table->s->keys_in_use; + /* Calculate "table->covering_keys" based on the WHERE */ + table->covering_keys= table->s->keys_in_use; table->quick_keys.clear_all(); #ifndef NO_EMBEDDED_ACCESS_CHECKS @@ -179,7 +179,7 @@ int mysql_update(THD *thd, if (mysql_prepare_update(thd, table_list, &conds, order_num, order)) DBUG_RETURN(1); - old_used_keys= table->used_keys; // Keys used in WHERE + old_covering_keys= table->covering_keys; // Keys used in WHERE /* Check the fields we are going to modify */ #ifndef NO_EMBEDDED_ACCESS_CHECKS table_list->grant.want_privilege= table->grant.want_privilege= want_privilege; @@ -228,7 +228,7 @@ int mysql_update(THD *thd, limit= 0; // Impossible WHERE } // Don't count on usage of 'only index' when calculating which key to use - table->used_keys.clear_all(); + table->covering_keys.clear_all(); #ifdef WITH_PARTITION_STORAGE_ENGINE if (prune_partitions(thd, table, conds)) @@ -303,7 +303,7 @@ int mysql_update(THD *thd, We can't update table directly; We must first search after all matching rows before updating the table! */ - if (used_index < MAX_KEY && old_used_keys.is_set(used_index)) + if (used_index < MAX_KEY && old_covering_keys.is_set(used_index)) { table->key_read=1; table->mark_columns_used_by_index(used_index); @@ -1091,7 +1091,7 @@ int multi_update::prepare(List ¬_used_values, } /* - We have to check values after setup_tables to get used_keys right in + We have to check values after setup_tables to get covering_keys right in reference tables */ @@ -1118,7 +1118,7 @@ int multi_update::prepare(List ¬_used_values, update.link_in_list((byte*) tl, (byte**) &tl->next_local); tl->shared= table_count++; table->no_keyread=1; - table->used_keys.clear_all(); + table->covering_keys.clear_all(); table->pos_in_table_list= tl; } } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 704c505ded9..b067443ba8c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -150,6 +150,7 @@ static bool is_native_function(THD *thd, const LEX_STRING *name) struct st_lex *lex; sp_head *sphead; struct p_elem_val *p_elem_value; + enum index_hint_type index_hint; } %{ @@ -820,7 +821,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); btree_or_rtree %type - key_usage_list using_list + using_list %type key_part @@ -890,7 +891,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); opt_column_list grant_privileges grant_ident grant_list grant_option object_privilege object_privilege_list user_list rename_list clear_privileges flush_options flush_option - equal optional_braces opt_key_definition key_usage_list2 + equal optional_braces opt_mi_check_type opt_to mi_check_types normal_join db_to_db table_to_table_list table_to_table opt_table_list opt_as handler_rkey_function handler_read_or_scan @@ -924,6 +925,8 @@ END_OF_INPUT %type sp_decls sp_decl %type sp_cursor_stmt %type sp_name +%type index_hint_type +%type index_hint_clause %type '-' '+' '*' '/' '%' '(' ')' @@ -5523,12 +5526,8 @@ keycache_list: assign_to_keycache: table_ident cache_keys_spec { - LEX *lex=Lex; - SELECT_LEX *sel= &lex->select_lex; - if (!sel->add_table_to_list(lex->thd, $1, NULL, 0, - TL_READ, - sel->get_use_index(), - (List *)0)) + if (!Select->add_table_to_list(YYTHD, $1, NULL, 0, TL_READ, + Select->pop_index_hints())) YYABORT; } ; @@ -5555,33 +5554,26 @@ preload_list: preload_keys: table_ident cache_keys_spec opt_ignore_leaves { - LEX *lex=Lex; - SELECT_LEX *sel= &lex->select_lex; - if (!sel->add_table_to_list(lex->thd, $1, NULL, $3, - TL_READ, - sel->get_use_index(), - (List *)0)) + if (!Select->add_table_to_list(YYTHD, $1, NULL, $3, TL_READ, + Select->pop_index_hints())) YYABORT; } ; cache_keys_spec: - { Select->interval_list.empty(); } - cache_key_list_or_empty - { - LEX *lex=Lex; - SELECT_LEX *sel= &lex->select_lex; - sel->use_index= sel->interval_list; + { + Lex->select_lex.alloc_index_hints(YYTHD); + Select->set_index_hint_type(INDEX_HINT_USE, + global_system_variables.old_mode ? + INDEX_HINT_MASK_JOIN : + INDEX_HINT_MASK_ALL); } + cache_key_list_or_empty ; cache_key_list_or_empty: - /* empty */ { Lex->select_lex.use_index_ptr= 0; } - | opt_key_or_index '(' key_usage_list2 ')' - { - SELECT_LEX *sel= &Lex->select_lex; - sel->use_index_ptr= &sel->use_index; - } + /* empty */ { } + | key_or_index '(' opt_key_usage_list ')' ; opt_ignore_leaves: @@ -6949,20 +6941,16 @@ normal_join: table_factor: { SELECT_LEX *sel= Select; - sel->use_index_ptr=sel->ignore_index_ptr=0; sel->table_join_options= 0; } table_ident opt_table_alias opt_key_definition { - LEX *lex= Lex; - SELECT_LEX *sel= lex->current_select; - if (!($$= sel->add_table_to_list(lex->thd, $2, $3, - sel->get_table_join_options(), - lex->lock_option, - sel->get_use_index(), - sel->get_ignore_index()))) + if (!($$= Select->add_table_to_list(YYTHD, $2, $3, + Select->get_table_join_options(), + Lex->lock_option, + Select->pop_index_hints()))) YYABORT; - sel->add_joined_table($$); + Select->add_joined_table($$); } | '{' ident table_ref LEFT OUTER JOIN_SYM table_ref ON @@ -7031,8 +7019,7 @@ table_factor: lex->current_select= sel= unit->outer_select(); if (!($$= sel-> add_table_to_list(lex->thd, new Table_ident(unit), $6, 0, - TL_READ,(List *)0, - (List *)0))) + TL_READ))) YYABORT; sel->add_joined_table($$); @@ -7131,52 +7118,67 @@ opt_outer: /* empty */ {} | OUTER {}; +index_hint_clause: + /* empty */ + { + $$= global_system_variables.old_mode ? + INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL; + } + | FOR_SYM JOIN_SYM { $$= INDEX_HINT_MASK_JOIN; } + | FOR_SYM ORDER_SYM BY { $$= INDEX_HINT_MASK_ORDER; } + | FOR_SYM GROUP BY { $$= INDEX_HINT_MASK_GROUP; } + ; + +index_hint_type: + FORCE_SYM { $$= INDEX_HINT_FORCE; } + | IGNORE_SYM { $$= INDEX_HINT_IGNORE; } + ; + +index_hint_definition: + index_hint_type key_or_index index_hint_clause + { + Select->set_index_hint_type($1, $3); + } + '(' key_usage_list ')'; + | USE_SYM key_or_index index_hint_clause + { + Select->set_index_hint_type(INDEX_HINT_USE, $3); + } + '(' opt_key_usage_list ')'; + + +index_hints_list: + index_hint_definition + | index_hints_list index_hint_definition + ; + +opt_index_hints_list: + /* empty */ + | { Select->alloc_index_hints(YYTHD); } index_hints_list + ; + opt_key_definition: - /* empty */ {} - | USE_SYM key_usage_list - { - SELECT_LEX *sel= Select; - sel->use_index= *$2; - sel->use_index_ptr= &sel->use_index; - } - | FORCE_SYM key_usage_list - { - SELECT_LEX *sel= Select; - sel->use_index= *$2; - sel->use_index_ptr= &sel->use_index; - sel->table_join_options|= TL_OPTION_FORCE_INDEX; - } - | IGNORE_SYM key_usage_list - { - SELECT_LEX *sel= Select; - sel->ignore_index= *$2; - sel->ignore_index_ptr= &sel->ignore_index; - }; + { Select->clear_index_hints(); } + opt_index_hints_list + ; + +opt_key_usage_list: + /* empty */ { Select->add_index_hint(YYTHD, NULL, 0); } + | key_usage_list {} + ; + +key_usage_element: + ident { Select->add_index_hint(YYTHD, $1.str, $1.length); } + | PRIMARY_SYM + { + Select->add_index_hint(YYTHD, (char *)"PRIMARY", 7); + } + ; key_usage_list: - key_or_index { Select->interval_list.empty(); } - '(' key_list_or_empty ')' - { $$= &Select->interval_list; } - ; - -key_list_or_empty: - /* empty */ {} - | key_usage_list2 {} - ; - -key_usage_list2: - key_usage_list2 ',' ident - { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) $3.str, $3.length, - system_charset_info)); } - | ident - { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) $1.str, $1.length, - system_charset_info)); } - | PRIMARY_SYM - { Select-> - interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, - system_charset_info)); }; + key_usage_element + | key_usage_list ',' key_usage_element + ; using_list: ident diff --git a/sql/table.cc b/sql/table.cc index 52074ee1e7c..9d74affb788 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1354,7 +1354,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, if (!(outparam->alias= my_strdup(alias, MYF(MY_WME)))) goto err; outparam->quick_keys.init(); - outparam->used_keys.init(); + outparam->covering_keys.init(); outparam->keys_in_use_for_query.init(); /* Allocate handler */ @@ -4133,6 +4133,175 @@ Item_subselect *st_table_list::containing_subselect() return (select_lex ? select_lex->master_unit()->item : 0); } +/* + Compiles the tagged hints list and fills up the bitmasks. + + SYNOPSIS + process_index_hints() + table the TABLE to operate on. + + DESCRIPTION + The parser collects the index hints for each table in a "tagged list" + (st_table_list::index_hints). Using the information in this tagged list + this function sets the members st_table::keys_in_use_for_query, + st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by, + st_table::force_index and st_table::covering_keys. + + Current implementation of the runtime does not allow mixing FORCE INDEX + and USE INDEX, so this is checked here. Then the FORCE INDEX list + (if non-empty) is appended to the USE INDEX list and a flag is set. + + Multiple hints of the same kind are processed so that each clause + is applied to what is computed in the previous clause. + For example: + USE INDEX (i1) USE INDEX (i2) + is equivalent to + USE INDEX (i1,i2) + and means "consider only i1 and i2". + + Similarly + USE INDEX () USE INDEX (i1) + is equivalent to + USE INDEX (i1) + and means "consider only the index i1" + + It is OK to have the same index several times, e.g. "USE INDEX (i1,i1)" is + not an error. + + Different kind of hints (USE/FORCE/IGNORE) are processed in the following + order: + 1. All indexes in USE (or FORCE) INDEX are added to the mask. + 2. All IGNORE INDEX + + e.g. "USE INDEX i1, IGNORE INDEX i1, USE INDEX i1" will not use i1 at all + as if we had "USE INDEX i1, USE INDEX i1, IGNORE INDEX i1". + + As an optimization if there is a covering index, and we have + IGNORE INDEX FOR GROUP/ORDER, and this index is used for the JOIN part, + then we have to ignore the IGNORE INDEX FROM GROUP/ORDER. + + RETURN VALUE + FALSE no errors found + TRUE found and reported an error. +*/ +bool st_table_list::process_index_hints(TABLE *table) +{ + /* initialize the result variables */ + table->keys_in_use_for_query= table->keys_in_use_for_group_by= + table->keys_in_use_for_order_by= table->s->keys_in_use; + + /* index hint list processing */ + if (index_hints) + { + key_map index_join[INDEX_HINT_FORCE + 1]; + key_map index_order[INDEX_HINT_FORCE + 1]; + key_map index_group[INDEX_HINT_FORCE + 1]; + index_hint *hint; + int type; + bool have_empty_use_join= FALSE, have_empty_use_order= FALSE, + have_empty_use_group= FALSE; + List_iterator iter(*index_hints); + + /* initialize temporary variables used to collect hints of each kind */ + for (type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++) + { + index_join[type].clear_all(); + index_order[type].clear_all(); + index_group[type].clear_all(); + } + + /* iterate over the hints list */ + while ((hint= iter++)) + { + uint pos; + + /* process empty USE INDEX () */ + if (hint->type == INDEX_HINT_USE && !hint->key_name.str) + { + if (hint->clause & INDEX_HINT_MASK_JOIN) + { + index_join[hint->type].clear_all(); + have_empty_use_join= TRUE; + } + if (hint->clause & INDEX_HINT_MASK_ORDER) + { + index_order[hint->type].clear_all(); + have_empty_use_order= TRUE; + } + if (hint->clause & INDEX_HINT_MASK_GROUP) + { + index_group[hint->type].clear_all(); + have_empty_use_group= TRUE; + } + continue; + } + + /* + Check if an index with the given name exists and get his offset in + the keys bitmask for the table + */ + if (table->s->keynames.type_names == 0 || + (pos= find_type(&table->s->keynames, hint->key_name.str, + hint->key_name.length, 1)) <= 0) + { + my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias); + return 1; + } + + pos--; + + /* add to the appropriate clause mask */ + if (hint->clause & INDEX_HINT_MASK_JOIN) + index_join[hint->type].set_bit (pos); + if (hint->clause & INDEX_HINT_MASK_ORDER) + index_order[hint->type].set_bit (pos); + if (hint->clause & INDEX_HINT_MASK_GROUP) + index_group[hint->type].set_bit (pos); + } + + /* cannot mix USE INDEX and FORCE INDEX */ + if ((!index_join[INDEX_HINT_FORCE].is_clear_all() || + !index_order[INDEX_HINT_FORCE].is_clear_all() || + !index_group[INDEX_HINT_FORCE].is_clear_all()) && + (!index_join[INDEX_HINT_USE].is_clear_all() || have_empty_use_join || + !index_order[INDEX_HINT_USE].is_clear_all() || have_empty_use_order || + !index_group[INDEX_HINT_USE].is_clear_all() || have_empty_use_group)) + { + my_error(ER_WRONG_USAGE, MYF(0), index_hint_type_name[INDEX_HINT_USE], + index_hint_type_name[INDEX_HINT_FORCE]); + return 1; + } + + /* process FORCE INDEX as USE INDEX with a flag */ + if (!index_join[INDEX_HINT_FORCE].is_clear_all() || + !index_order[INDEX_HINT_FORCE].is_clear_all() || + !index_group[INDEX_HINT_FORCE].is_clear_all()) + { + table->force_index= TRUE; + index_join[INDEX_HINT_USE].merge(index_join[INDEX_HINT_FORCE]); + index_order[INDEX_HINT_USE].merge(index_order[INDEX_HINT_FORCE]); + index_group[INDEX_HINT_USE].merge(index_group[INDEX_HINT_FORCE]); + } + + /* apply USE INDEX */ + if (!index_join[INDEX_HINT_USE].is_clear_all() || have_empty_use_join) + table->keys_in_use_for_query= index_join[INDEX_HINT_USE]; + if (!index_order[INDEX_HINT_USE].is_clear_all() || have_empty_use_order) + table->keys_in_use_for_order_by= index_order[INDEX_HINT_USE]; + if (!index_group[INDEX_HINT_USE].is_clear_all() || have_empty_use_group) + table->keys_in_use_for_group_by= index_group[INDEX_HINT_USE]; + + /* apply IGNORE INDEX */ + table->keys_in_use_for_query.subtract (index_join[INDEX_HINT_IGNORE]); + table->keys_in_use_for_order_by.subtract (index_order[INDEX_HINT_IGNORE]); + table->keys_in_use_for_group_by.subtract (index_group[INDEX_HINT_IGNORE]); + } + + /* make sure covering_keys don't include indexes disabled with a hint */ + table->covering_keys.intersect(table->keys_in_use_for_query); + return 0; +} + /***************************************************************************** ** Instansiate templates *****************************************************************************/ diff --git a/sql/table.cc.rej b/sql/table.cc.rej deleted file mode 100644 index fd728ba9965..00000000000 --- a/sql/table.cc.rej +++ /dev/null @@ -1,17 +0,0 @@ -*************** -*** 2246,2252 **** - - bool check_db_name(char *name) - { -! char *start=name; - /* Used to catch empty names and names with end space */ - bool last_char_is_space= TRUE; - ---- 2257,2263 ---- - - bool check_db_name(char *name) - { -! char *start= name; - /* Used to catch empty names and names with end space */ - bool last_char_is_space= TRUE; - diff --git a/sql/table.h b/sql/table.h index 13666c82f4b..0dfca83d454 100644 --- a/sql/table.h +++ b/sql/table.h @@ -295,6 +295,12 @@ typedef struct st_table_share /* Information for one open table */ +enum index_hint_type +{ + INDEX_HINT_IGNORE, + INDEX_HINT_USE, + INDEX_HINT_FORCE +}; struct st_table { st_table() {} /* Remove gcc warning */ @@ -314,7 +320,18 @@ struct st_table { byte *write_row_record; /* Used as optimisation in THD::write_row */ byte *insert_values; /* used by INSERT ... UPDATE */ - key_map quick_keys, used_keys, keys_in_use_for_query, merge_keys; + /* + Map of keys that can be used to retrieve all data from this table + needed by the query without reading the row. + */ + key_map covering_keys; + key_map quick_keys, merge_keys; + /* Map of keys that can be used to access the table */ + key_map keys_in_use_for_query; + /* Map of keys that can be used to calculate GROUP BY without sorting */ + key_map keys_in_use_for_group_by; + /* Map of keys that can be used to calculate ORDER BY without sorting */ + key_map keys_in_use_for_order_by; KEY *key_info; /* data of keys in database */ Field *next_number_field; /* Set if next_number is activated */ @@ -636,6 +653,7 @@ public: (TABLE_LIST::join_using_fields != NULL) */ +class index_hint; typedef struct st_table_list { st_table_list() {} /* Remove gcc warning */ @@ -692,7 +710,7 @@ typedef struct st_table_list */ struct st_table_list *next_name_resolution_table; /* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */ - List *use_index, *ignore_index; + List *index_hints; TABLE *table; /* opened table */ uint table_id; /* table id (from binlog) for opened table */ /* @@ -866,6 +884,13 @@ typedef struct st_table_list void reinit_before_use(THD *thd); Item_subselect *containing_subselect(); + /* + Compiles the tagged hints list and fills up st_table::keys_in_use_for_query, + st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by, + st_table::force_index and st_table::covering_keys. + */ + bool process_index_hints(TABLE *table); + private: bool prep_check_option(THD *thd, uint8 check_opt_type); bool prep_where(THD *thd, Item **conds, bool no_where_clause); diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index f407f62fa0c..906d4e8a1a5 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -804,23 +804,22 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt) KEY_CACHE *new_key_cache= check_opt->key_cache; const char *errmsg= 0; int error= HA_ADMIN_OK; - ulonglong map= ~(ulonglong) 0; + ulonglong map; TABLE_LIST *table_list= table->pos_in_table_list; DBUG_ENTER("ha_myisam::assign_to_keycache"); - /* Check validity of the index references */ - if (table_list->use_index) + table->keys_in_use_for_query.clear_all(); + + if (table_list->process_index_hints(table)) { - /* We only come here when the user did specify an index map */ - key_map kmap; - if (get_key_map_from_key_list(&kmap, table, table_list->use_index)) - { - errmsg= thd->net.last_error; - error= HA_ADMIN_FAILED; - goto err; - } - map= kmap.to_ulonglong(); + errmsg= thd->net.last_error; + error= HA_ADMIN_FAILED; + goto err; } + map= ~(ulonglong) 0; + if (!table->keys_in_use_for_query.is_clear_all()) + /* use all keys if there's no list specified by the user through hints */ + map= table->keys_in_use_for_query.to_ulonglong(); if ((error= mi_assign_to_key_cache(file, map, new_key_cache))) { @@ -856,27 +855,27 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt) { int error; const char *errmsg; - ulonglong map= ~(ulonglong) 0; + ulonglong map; TABLE_LIST *table_list= table->pos_in_table_list; my_bool ignore_leaves= table_list->ignore_leaves; DBUG_ENTER("ha_myisam::preload_keys"); - /* Check validity of the index references */ - if (table_list->use_index) + table->keys_in_use_for_query.clear_all(); + + if (table_list->process_index_hints(table)) { - key_map kmap; - get_key_map_from_key_list(&kmap, table, table_list->use_index); - if (kmap.is_set_all()) - { - errmsg= thd->net.last_error; - error= HA_ADMIN_FAILED; - goto err; - } - if (!kmap.is_clear_all()) - map= kmap.to_ulonglong(); + errmsg= thd->net.last_error; + error= HA_ADMIN_FAILED; + goto err; } + map= ~(ulonglong) 0; + /* Check validity of the index references */ + if (!table->keys_in_use_for_query.is_clear_all()) + /* use all keys if there's no list specified by the user through hints */ + map= table->keys_in_use_for_query.to_ulonglong(); + mi_extra(file, HA_EXTRA_PRELOAD_BUFFER_SIZE, (void *) &thd->variables.preload_buff_size); From a232d81e803b60dc60934c19f0a329b7ed53f612 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Mar 2007 18:52:00 +0200 Subject: [PATCH 049/789] Bug#19342: additional test case for code coverage --- mysql-test/r/func_in.result | 8 +++++++- mysql-test/t/func_in.test | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 36bcc6f1711..fad9a7157e1 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -463,5 +463,11 @@ CREATE TABLE t3 (a BIGINT UNSIGNED); INSERT INTO t3 VALUES (9223372036854775551); SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42); HEX(a) -DROP TABLE t1,t2,t3; +CREATE TABLE t4 (a DATE); +INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29'); +SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29'); +a +Warnings: +Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1 +DROP TABLE t1,t2,t3,t4; End of 5.0 tests diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 7ba54747d4b..f9749662ec1 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -354,6 +354,10 @@ INSERT INTO t3 VALUES (9223372036854775551); SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42); -DROP TABLE t1,t2,t3; +CREATE TABLE t4 (a DATE); +INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29'); +SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29'); + +DROP TABLE t1,t2,t3,t4; --echo End of 5.0 tests From d3f71886aa2c0dae4d0e7d7aeb53b4e72c56de7e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Mar 2007 18:15:31 +0100 Subject: [PATCH 050/789] Bug#18946 Test case rpl_ndb_ddl disabled 1. Fixes within the testscripts (affects rpl_ddl.test and rpl_ndb_ddl.test) - slave connection is only an observer (-> AUTOCOMMIT = 0) This removes the problem with the hanging test around DROP DATABASE (NDB). The hanging test around DROP DATABASE is a difference to InnoDB/MyISAm behaviour but fare away of a clear bug. IMHO this behaviour does not violate the SQL standard and should be therefore simply accepted. - removal of wrong comments - CREATE/DROP TEMPORARY TABLE must not cause implicit commit of the current transaction. NDB behaves here correct and InnoDB/Falcon wrong. - Add a missing connection slave - Reenable the test rpl_ndb_ddl. 2. Disable rpl_ddl.test because of Bug#26418. 3. Reenable rpl_ndb_ddl.test 4. Improvements (affect rpl_ddl.test and rpl_ndb_ddl.test) - Better + extended comments which should prevent that somebody accidently destroys the logics of the test - Replace SELECT's printing comments by "--echo" (decreases the number of auxiliary SQL commands) - Remove the need for include/rpl_stmt_seq2.inc (was mostly redundant to rpl_stmt_seq.inc) - Remove extra/rpl_tests/rpl_ndb_ddl.test (corrected extra/rpl_tests/rpl_ddl.test is sufficient) - Shift assignment of values to $show_binlog, $manipulate (variables useful for debugging) into the toplevel scripts - The temporary tables get now their storage engine from the variable $temp_engine_type. (more deterministic testing conditions) - Add additional protocol line if the connection is switched (was partially missing) - Add two DML commands for comparison purposes BitKeeper/deleted/.del-rpl_ndb_ddl.test: Delete: mysql-test/extra/rpl_tests/rpl_ndb_ddl.test BitKeeper/deleted/.del-rpl_stmt_seq2.inc: Delete: mysql-test/include/rpl_stmt_seq2.inc mysql-test/extra/rpl_tests/rpl_ddl.test: Improvements + Fixes mysql-test/include/rpl_stmt_seq.inc: Improvements mysql-test/r/rpl_ddl.result: Updated expected results mysql-test/r/rpl_ndb_ddl.result: Updated expected results mysql-test/t/disabled.def: Reenable rpl_ndb_ddl because of bug fix. Disable rpl_ddl because of Bug#26418. mysql-test/t/rpl_ddl.test: Improvements mysql-test/t/rpl_ndb_ddl.test: Improvements --- mysql-test/extra/rpl_tests/rpl_ddl.test | 389 ++++++++------ mysql-test/extra/rpl_tests/rpl_ndb_ddl.test | 507 ------------------ mysql-test/include/rpl_stmt_seq.inc | 114 +++-- mysql-test/include/rpl_stmt_seq2.inc | 201 -------- mysql-test/r/rpl_ddl.result | 537 +++++++++----------- mysql-test/r/rpl_ndb_ddl.result | 526 +++++++++---------- mysql-test/t/disabled.def | 2 +- mysql-test/t/rpl_ddl.test | 12 +- mysql-test/t/rpl_ndb_ddl.test | 17 +- 9 files changed, 782 insertions(+), 1523 deletions(-) delete mode 100644 mysql-test/extra/rpl_tests/rpl_ndb_ddl.test delete mode 100644 mysql-test/include/rpl_stmt_seq2.inc diff --git a/mysql-test/extra/rpl_tests/rpl_ddl.test b/mysql-test/extra/rpl_tests/rpl_ddl.test index 15794e5e035..e40532f005f 100644 --- a/mysql-test/extra/rpl_tests/rpl_ddl.test +++ b/mysql-test/extra/rpl_tests/rpl_ddl.test @@ -1,31 +1,128 @@ -######################## rpl_ddl.test ######################## -# # -# DDL statements (sometimes with implicit COMMIT) executed # -# by the master and it's propagation into the slave # -# # -############################################################## +################# extra/rpl_tests/rpl_ddl.test ######################## +# # +# DDL statements (sometimes with implicit COMMIT) and other stuff # +# executed on the master and it's propagation into the slave. # +# # +# The variables # +# $engine_type -- storage engine to be tested/used for the # +# permanent tables within the master # +# $temp_engine_type -- storage engine which supports TEMPORARY # +# tables <> $engine_type # +# $temp_engine_type must point to an all # +# time available storage engine # +# 2007-02 MySQL 5.1 MyISAM and MEMORY only # +# $show_binlog -- print binlog entries # +# 0 - no (default) + fits to the file with # +# results # +# 1 - yes (important for debugging) # +# This variable is used within # +# include/rpl_stmt_seq.inc. # +# $manipulate -- Manipulation of the binary logs # +# 0 - do nothing # +# 1 - so that the output of SHOW BINLOG # +# EVENTS IN contains only # +# commands of the current test sequence # +# This is especially useful, if the # +# $show_binlog is set to 1 and many # +# subtest are executed. # +# This variable is used within # +# include/rpl_stmt_seq.inc. # +# have to be set before sourcing this script. # +# # +# General assumption about the ideal replication behaviour: # +# Whatever on the master is executed the content of the slave must # +# be in sync with it. # +# # +# Tests of special interest: # +# a) Which DDL commands cause an implicit COMMIT ? # +# This is also of interest outside of replication. # +# b) Transactions modifying table content ending with # +# - explicit COMMIT or ROLLBACK # +# - implicit COMMIT because the connection to the master # +# executed a corresponding DDL statement or runs in # +# AUTOCOMMIT mode # +# - something similar to "implicit COMMIT" if the storage # +# engine (master) is not transactional # +# c) Command which change no data like SELECT or SHOW # +# They do not change anything within the master but # +# this must be also valid for the slave. # +# # +####################################################################### +# Last update: +# 2007-02-12 ML: - slave needs AUTOCOMMIT = 1, because we want to check only +# the propagation of actions of the master connection. +# - replace comments via SQL by "--echo ..." +# - remove some bugs within the testscripts +# - remove the use of include/rpl_stmt_seq2.inc +# # -# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !! +# NOTES: +# 2006-11-15 Lars: Matthias (ML) is the "owner" of this test case. +# So, please get him to review it whenever you want to +# do changes to it. # -# 1. !All! objects to be dropped, renamed, altered ... must be created -# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test -# sequences start. +# PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !! # -# 2. Never use a test object, which was direct or indirect affected by a -# preceeding test sequence again. -# Except table d1.t1 where ONLY DML is allowed. +# Typical test architecture (--> include/rpl_stmt_seq.inc) +# -------------------------------------------------------- +# 1. Master (no AUTOCOMMIT!): INSERT INTO mysqltest1.t1 without commit +# 2. Master and slave: Check the content of mysqltest1.t1 +# 3. Master (no AUTOCOMMIT!): EXECUTE the statement to be tested +# 4. Master and slave: Check the content of mysqltest1.t1 +# 5. Master (no AUTOCOMMIT!): ROLLBACK +# 6. Master and slave: Check the content of mysqltest1.t1 +# If the previous into mysqltest1.t1 inserted row is visible, +# than the statement to be tested caused an explicit COMMIT +# (statement = COMMIT) or an implicit COMMIT (example CREATE TABLE). +# If the previous into mysqltest1.t1 inserted row is not visible, +# than the statement to be tested caused either an explicit ROLLBACK +# (statement = ROLLBACK), an implicit ROLLBACK (deadlock etc. but +# not tested here) or it does not cause any transaction end. +# 7. Flush the logs +# +# Some rules: +# ----------- +# 1. Any use of mysqltest1.t1 within the statement to be tested must be +# avoided if possible. The only known exception is around LOCK TABLE. +# +# 2. The test logics needs for +# master connection: AUTOCOMMIT = 0 +# slave connection: AUTOCOMMIT = 1 +# The master connection is the actor and the slave connection is +# only an observer. I.e. the slave connection must not influence +# the activities of master connection. # -# If one preceeding test sequence hits a (sometimes not good visible, -# because the sql error code of the statement might be 0) bug -# and these rules are ignored, a following test sequence might earn ugly -# effects like failing 'sync_slave_with_master', crashes of the slave or -# abort of the test case etc.. +# 3. !All! objects to be dropped, renamed, altered ... must be created +# before the tests start. +# --> less switching of AUTOCOMMIT mode on master side. # -# 3. The assignment of the DDL command to be tested to $my_stmt can -# be a bit difficult. "'" must be avoided, because the test -# routine "include/rpl_stmt_seq.inc" performs a -# eval SELECT CONCAT('######## ','$my_stmt',' ########') as ""; +# 4. Never use a test object, which was direct or indirect affected by a +# preceeding test sequence again. +# If one preceeding test sequence hits a (sometimes not visible, +# because the sql error code of the statement might be 0) bug +# and these rules are ignored, a following test sequence might earn ugly +# effects like failing 'sync_slave_with_master', crashes of the slave or +# abort of the test case etc.. This means during analysis the first look +# points into a totally wrong area. +# Except table mysqltest1.t1 where ONLY DML is allowed. +# +# 5. This file is used in several tests (t/rpl_ddl_.test). +# Please be aware that every change of the current file affects +# the results of these tests. +# +# ML: Some maybe banal hints: +# 1. The fact that we have here a master - slave replication does +# not cause that many general MySQL properties do not apply. +# Example: +# The connection to the slave is just a simple session and not a however +# magic working "copy" of the master session or something similar. +# - TEMPORARY TABLES and @variables are session specific +# - the slave session cannot see these things of the master. +# 2. The slave connection must not call sync_slave_with_master. +# 3. SHOW STATUS SLAVE must be run within the slave connection. +# 4. Testcase analysis becomes much more comfortable if +# $show_binlog within include/rpl_stmt_seq.inc is set to 1. # ############################################################### @@ -33,8 +130,10 @@ ############################################################### # The sync_slave_with_master is needed to make the xids deterministic. sync_slave_with_master; -connection master; +--echo +--echo -------- switch to master ------- +connection master; SET AUTOCOMMIT = 1; # # 1. DROP all objects, which probably already exist, but must be created here @@ -47,7 +146,7 @@ DROP DATABASE IF EXISTS mysqltest3; # # 2. CREATE all objects needed # working database is mysqltest1 -# working (transactional!) is mysqltest1.t1 +# working table (transactional!) is mysqltest1.t1 # CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest2; @@ -73,25 +172,23 @@ eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type; eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type; eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type; eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type; -CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); +eval CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=$temp_engine_type; # # 3. master sessions: never do AUTOCOMMIT -# slave sessions: never do AUTOCOMMIT +# slave sessions: do AUTOCOMMIT # SET AUTOCOMMIT = 0; use mysqltest1; sync_slave_with_master; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SET AUTOCOMMIT = 0; +SET AUTOCOMMIT = 1; use mysqltest1; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log # We don't want to abort the whole test if one statement sent @@ -99,6 +196,21 @@ SELECT '-------- switch to master -------' as ""; # sequences are nearly independend of the previous statements. --disable_abort_on_error +############################################################### +# Banal case: commands which should never commit +# Just for checking if the test sequence is usable +############################################################### + +let $my_stmt= SELECT 1; +let $my_master_commit= false; +let $my_slave_commit= false; +--source include/rpl_stmt_seq.inc + +let $my_stmt= SELECT COUNT(*) FROM t1; +let $my_master_commit= false; +let $my_slave_commit= false; +--source include/rpl_stmt_seq.inc + ############################################################### # Banal case: (explicit) COMMIT and ROLLBACK # Just for checking if the test sequence is usable @@ -143,84 +255,64 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW TABLES LIKE 't2'; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log SHOW TABLES LIKE 't2'; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log -# Note: Since this test is executed with a skip-innodb slave, the -# slave incorrectly commits the insert. One can *not* have InnoDB on -# master and MyISAM on slave and expect that a transactional rollback -# after a CREATE TEMPORARY TABLE should work correctly on the slave. -# For this to work properly the handler on the slave must be able to -# handle transactions (e.g. InnoDB or NDB). let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23; let $my_master_commit= false; -let $my_slave_commit= true; +let $my_slave_commit= false; --source include/rpl_stmt_seq.inc SHOW TABLES LIKE 't23'; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log SHOW TABLES LIKE 't23'; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20; let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW TABLES LIKE 't20'; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log SHOW TABLES LIKE 't20'; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT; let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc describe mysqltest1.t4; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log describe mysqltest1.t4; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log -let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE=; +let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= $engine_type; let $my_master_commit= true; let $my_slave_commit= true; ---source include/rpl_stmt_seq2.inc +--source include/rpl_stmt_seq.inc -# Note: Since this test is executed with a skip-innodb slave, the -# slave incorrectly commits the insert. One can *not* have InnoDB on -# master and MyISAM on slave and expect that a transactional rollback -# after a CREATE TEMPORARY TABLE should work correctly on the slave. -# For this to work properly the handler on the slave must be able to -# handle transactions (e.g. InnoDB or NDB). let $engine=''; let $eng_type=''; -let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); +let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=$temp_engine_type; let $my_master_commit= false; -let $my_slave_commit= true; +let $my_slave_commit= false; --source include/rpl_stmt_seq.inc let $my_stmt= TRUNCATE TABLE mysqltest1.t7; @@ -228,9 +320,12 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SELECT * FROM mysqltest1.t7; ---echo -------- switch to slave -------- sync_slave_with_master; +--echo +--echo -------- switch to slave -------- +connection slave; SELECT * FROM mysqltest1.t7; +--echo --echo -------- switch to master ------- connection master; @@ -238,8 +333,13 @@ connection master; # Cases with LOCK/UNLOCK ############################################################### -# MySQL insists in locking mysqltest1.t1, because rpl_stmt_seq performs an -# INSERT into this table. +# Attention: +# We have to LOCK mysqltest1.t1 here, though it violates the testing +# philosophy. +# Mysql response in case without previous LOCK TABLES mysqltest1.t1 +# is: +# SELECT MAX(...) FROM mysqltest1.t1 is +# ERROR HY000: Table 't1' was not locked with LOCK TABLES let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; let $my_master_commit= true; let $my_slave_commit= true; @@ -253,8 +353,9 @@ let $my_slave_commit= false; --source include/rpl_stmt_seq.inc # With prior read locking -# Note that this test generate an error since the rpl_stmt_seq.inc -# tries to insert into t1. +# Attention: +# This subtest generates an error since the rpl_stmt_seq.inc +# tries to insert into t1. LOCK TABLES mysqltest1.t1 READ; let $my_stmt= UNLOCK TABLES; let $my_master_commit= false; @@ -277,30 +378,26 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW INDEX FROM mysqltest1.t6; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log SHOW INDEX FROM mysqltest1.t6; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1); let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW INDEX FROM mysqltest1.t5; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log SHOW INDEX FROM mysqltest1.t5; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log ############################################################### # Cases with DATABASE @@ -311,35 +408,31 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW DATABASES LIKE "mysqltest2"; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log SHOW DATABASES LIKE "mysqltest2"; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log let $my_stmt= CREATE DATABASE mysqltest3; let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW DATABASES LIKE "mysqltest3"; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log SHOW DATABASES LIKE "mysqltest3"; +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log # End of 4.1 tests ############################################################### -# Cases with stored procedures +# Cases with STORED PROCEDUREs ############################################################### let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1"; let $my_master_commit= true; @@ -348,12 +441,13 @@ let $my_slave_commit= true; --vertical_results --replace_column 5 # 6 # SHOW PROCEDURE STATUS LIKE 'p1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; --replace_column 5 # 6 # SHOW PROCEDURE STATUS LIKE 'p1'; +--echo +--echo -------- switch to master ------- connection master; --horizontal_results @@ -364,12 +458,13 @@ let $my_slave_commit= true; --vertical_results --replace_column 5 # 6 # SHOW PROCEDURE STATUS LIKE 'p1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; --replace_column 5 # 6 # SHOW PROCEDURE STATUS LIKE 'p1'; +--echo +--echo -------- switch to master ------- connection master; --horizontal_results @@ -379,11 +474,12 @@ let $my_slave_commit= true; --source include/rpl_stmt_seq.inc --vertical_results SHOW PROCEDURE STATUS LIKE 'p1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SHOW PROCEDURE STATUS LIKE 'p1'; +--echo +--echo -------- switch to master ------- connection master; --horizontal_results @@ -395,11 +491,12 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW CREATE VIEW v1; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SHOW CREATE VIEW v1; +--echo +--echo -------- switch to master ------- connection master; let $my_stmt= ALTER VIEW v1 AS select f1 from t1; @@ -407,11 +504,12 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW CREATE VIEW v1; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SHOW CREATE VIEW v1; +--echo +--echo -------- switch to master ------- connection master; let $my_stmt= DROP VIEW IF EXISTS v1; @@ -420,12 +518,13 @@ let $my_slave_commit= true; --source include/rpl_stmt_seq.inc --error 1146 SHOW CREATE VIEW v1; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; --error 1146 SHOW CREATE VIEW v1; +--echo +--echo -------- switch to master ------- connection master; ############################################################### @@ -436,11 +535,12 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW TRIGGERS; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SHOW TRIGGERS; +--echo +--echo -------- switch to master ------- connection master; let $my_stmt= DROP TRIGGER trg1; @@ -448,11 +548,12 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SHOW TRIGGERS; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SHOW TRIGGERS; +--echo +--echo -------- switch to master ------- connection master; ############################################################### @@ -463,11 +564,12 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SELECT user FROM mysql.user WHERE user = 'user1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SELECT user FROM mysql.user WHERE user = 'user1'; +--echo +--echo -------- switch to master ------- connection master; let $my_stmt= RENAME USER user1@localhost TO rename1@localhost; @@ -475,11 +577,12 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SELECT user FROM mysql.user WHERE user = 'rename1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SELECT user FROM mysql.user WHERE user = 'rename1'; +--echo +--echo -------- switch to master ------- connection master; let $my_stmt= DROP USER rename1@localhost; @@ -487,21 +590,21 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SELECT user FROM mysql.user WHERE user = 'rename1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log +--echo +--echo -------- switch to slave -------- connection slave; SELECT user FROM mysql.user WHERE user = 'rename1'; -connection master; ############################################################### # Cleanup ############################################################### ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1; -DROP DATABASE IF EXISTS mysqltest2; -DROP DATABASE IF EXISTS mysqltest3; +use test; +--echo +--echo -------- switch to master ------- +connection master; +DROP DATABASE mysqltest1; +# mysqltest2 was alreday DROPPED some tests before. +DROP DATABASE mysqltest3; --enable_warnings -- source include/master-slave-end.inc - diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_ddl.test b/mysql-test/extra/rpl_tests/rpl_ndb_ddl.test deleted file mode 100644 index 26c368589ba..00000000000 --- a/mysql-test/extra/rpl_tests/rpl_ndb_ddl.test +++ /dev/null @@ -1,507 +0,0 @@ -######################## rpl_ddl.test ######################## -# # -# DDL statements (sometimes with implicit COMMIT) executed # -# by the master and it's propagation into the slave # -# # -############################################################## - -# -# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !! -# -# 1. !All! objects to be dropped, renamed, altered ... must be created -# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test -# sequences start. -# -# 2. Never use a test object, which was direct or indirect affected by a -# preceeding test sequence again. -# Except table d1.t1 where ONLY DML is allowed. -# -# If one preceeding test sequence hits a (sometimes not good visible, -# because the sql error code of the statement might be 0) bug -# and these rules are ignored, a following test sequence might earn ugly -# effects like failing 'sync_slave_with_master', crashes of the slave or -# abort of the test case etc.. -# -# 3. The assignment of the DDL command to be tested to $my_stmt can -# be a bit difficult. "'" must be avoided, because the test -# routine "include/rpl_stmt_seq.inc" performs a -# eval SELECT CONCAT('######## ','$my_stmt',' ########') as ""; -# - -############################################################### -# Some preparations -############################################################### -# The sync_slave_with_master is needed to make the xids deterministic. -sync_slave_with_master; -connection master; - -SET AUTOCOMMIT = 1; -# -# 1. DROP all objects, which probably already exist, but must be created here -# ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1; -DROP DATABASE IF EXISTS mysqltest2; -DROP DATABASE IF EXISTS mysqltest3; ---enable_warnings -# -# 2. CREATE all objects needed -# working database is mysqltest1 -# working (transactional!) is mysqltest1.t1 -# -CREATE DATABASE mysqltest1; -CREATE DATABASE mysqltest2; -eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type; -INSERT INTO mysqltest1.t1 SET f1= 0; -eval CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=$engine_type; -CREATE INDEX my_idx6 ON mysqltest1.t6(f1); -eval CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=$engine_type; -INSERT INTO mysqltest1.t7 SET f1= 0; -eval CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type; -eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type; -CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); - -# -# 3. master sessions: never do AUTOCOMMIT -# slave sessions: never do AUTOCOMMIT -# -SET AUTOCOMMIT = 0; -use mysqltest1; -sync_slave_with_master; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SET AUTOCOMMIT = 0; -use mysqltest1; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - - -# We don't want to abort the whole test if one statement sent -# to the server gets an error, because the following test -# sequences are nearly independend of the previous statements. ---disable_abort_on_error - -############################################################### -# Banal case: (explicit) COMMIT and ROLLBACK -# Just for checking if the test sequence is usable -############################################################### - -let $my_stmt= COMMIT; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc - -let $my_stmt= ROLLBACK; -let $my_master_commit= false; -let $my_slave_commit= false; ---source include/rpl_stmt_seq.inc - -############################################################### -# Cases with commands very similar to COMMIT -############################################################### - -let $my_stmt= SET AUTOCOMMIT=1; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SET AUTOCOMMIT=0; - -let $my_stmt= START TRANSACTION; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc - -let $my_stmt= BEGIN; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc - -############################################################### -# Cases with (BASE) TABLES and (UPDATABLE) VIEWs -############################################################### - -let $my_stmt= DROP TABLE mysqltest1.t2; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW TABLES LIKE 't2'; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SHOW TABLES LIKE 't2'; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -# Note: Since this test is executed with a skip-innodb slave, the -# slave incorrectly commits the insert. One can *not* have InnoDB on -# master and MyISAM on slave and expect that a transactional rollback -# after a CREATE TEMPORARY TABLE should work correctly on the slave. -# For this to work properly the handler on the slave must be able to -# handle transactions (e.g. InnoDB or NDB). -let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23; -let $my_master_commit= false; -let $my_slave_commit= false; ---source include/rpl_stmt_seq.inc -SHOW TABLES LIKE 't23'; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SHOW TABLES LIKE 't23'; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW TABLES LIKE 't20'; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SHOW TABLES LIKE 't20'; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -describe mysqltest1.t4; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -describe mysqltest1.t4; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE=; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq2.inc - -# Note: Since this test is executed with a skip-innodb slave, the -# slave incorrectly commits the insert. One can *not* have InnoDB on -# master and MyISAM on slave and expect that a transactional rollback -# after a CREATE TEMPORARY TABLE should work correctly on the slave. -# For this to work properly the handler on the slave must be able to -# handle transactions (e.g. InnoDB or NDB). -let $engine=''; -let $eng_type=''; - -let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); -let $my_master_commit= false; -let $my_slave_commit= false; ---source include/rpl_stmt_seq.inc - -let $my_stmt= TRUNCATE TABLE mysqltest1.t7; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SELECT * FROM mysqltest1.t7; ---echo -------- switch to slave -------- -sync_slave_with_master; -SELECT * FROM mysqltest1.t7; ---echo -------- switch to master ------- -connection master; - -############################################################### -# Cases with LOCK/UNLOCK -############################################################### - -# MySQL insists in locking mysqltest1.t1, because rpl_stmt_seq performs an -# INSERT into this table. -let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -UNLOCK TABLES; - -# No prior locking -let $my_stmt= UNLOCK TABLES; -let $my_master_commit= false; -let $my_slave_commit= false; ---source include/rpl_stmt_seq.inc - -# With prior read locking -# Note that this test generate an error since the rpl_stmt_seq.inc -# tries to insert into t1. -LOCK TABLES mysqltest1.t1 READ; -let $my_stmt= UNLOCK TABLES; -let $my_master_commit= false; -let $my_slave_commit= false; ---source include/rpl_stmt_seq.inc - -# With prior write locking -LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; -let $my_stmt= UNLOCK TABLES; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc - -############################################################### -# Cases with INDEXES -############################################################### - -let $my_stmt= DROP INDEX my_idx6 ON mysqltest1.t6; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW INDEX FROM mysqltest1.t6; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SHOW INDEX FROM mysqltest1.t6; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1); -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW INDEX FROM mysqltest1.t5; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SHOW INDEX FROM mysqltest1.t5; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -############################################################### -# Cases with DATABASE -############################################################### - -let $my_stmt= DROP DATABASE mysqltest2; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW DATABASES LIKE "mysqltest2"; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SHOW DATABASES LIKE "mysqltest2"; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -let $my_stmt= CREATE DATABASE mysqltest3; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW DATABASES LIKE "mysqltest3"; -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -SHOW DATABASES LIKE "mysqltest3"; -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log - -# End of 4.1 tests - -############################################################### -# Cases with stored procedures -############################################################### -let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1"; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc ---vertical_results ---replace_column 5 # 6 # -SHOW PROCEDURE STATUS LIKE 'p1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; ---replace_column 5 # 6 # -SHOW PROCEDURE STATUS LIKE 'p1'; -connection master; ---horizontal_results - -let $my_stmt= ALTER PROCEDURE p1 COMMENT "I have been altered"; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc ---vertical_results ---replace_column 5 # 6 # -SHOW PROCEDURE STATUS LIKE 'p1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; ---replace_column 5 # 6 # -SHOW PROCEDURE STATUS LIKE 'p1'; -connection master; ---horizontal_results - -let $my_stmt= DROP PROCEDURE p1; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc ---vertical_results -SHOW PROCEDURE STATUS LIKE 'p1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SHOW PROCEDURE STATUS LIKE 'p1'; -connection master; ---horizontal_results - -############################################################### -# Cases with VIEWs -############################################################### -let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW CREATE VIEW v1; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SHOW CREATE VIEW v1; -connection master; - -let $my_stmt= ALTER VIEW v1 AS select f1 from t1; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW CREATE VIEW v1; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SHOW CREATE VIEW v1; -connection master; - -let $my_stmt= DROP VIEW IF EXISTS v1; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc ---error 1146 -SHOW CREATE VIEW v1; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; ---error 1146 -SHOW CREATE VIEW v1; -connection master; - -############################################################### -# Cases with TRIGGERs -############################################################### -let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW TRIGGERS; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SHOW TRIGGERS; -connection master; - -let $my_stmt= DROP TRIGGER trg1; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SHOW TRIGGERS; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SHOW TRIGGERS; -connection master; - -############################################################### -# Cases with USERs -############################################################### -let $my_stmt= CREATE USER user1@localhost; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SELECT user FROM mysql.user WHERE user = 'user1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SELECT user FROM mysql.user WHERE user = 'user1'; -connection master; - -let $my_stmt= RENAME USER user1@localhost TO rename1@localhost; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SELECT user FROM mysql.user WHERE user = 'rename1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SELECT user FROM mysql.user WHERE user = 'rename1'; -connection master; - -let $my_stmt= DROP USER rename1@localhost; -let $my_master_commit= true; -let $my_slave_commit= true; ---source include/rpl_stmt_seq.inc -SELECT user FROM mysql.user WHERE user = 'rename1'; ---disable_query_log -SELECT '-------- switch to slave -------' as ""; ---enable_query_log -connection slave; -SELECT user FROM mysql.user WHERE user = 'rename1'; -connection master; - -############################################################### -# Cleanup -############################################################### ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1; -DROP DATABASE IF EXISTS mysqltest2; -DROP DATABASE IF EXISTS mysqltest3; ---enable_warnings - --- source include/master-slave-end.inc - diff --git a/mysql-test/include/rpl_stmt_seq.inc b/mysql-test/include/rpl_stmt_seq.inc index 3c91505d0d6..6c944dc4729 100644 --- a/mysql-test/include/rpl_stmt_seq.inc +++ b/mysql-test/include/rpl_stmt_seq.inc @@ -1,30 +1,51 @@ -# include/rpl_stmt_seq.inc -# -# Please be very careful when editing this routine, because the handling of -# the $variables is extreme sensitive. -# +################### include/rpl_stmt_seq.inc ########################### +# # +# Check if a given SQL statement (->$my_stmt) / AUTOCOMMIT mode / # +# storage engine somehow involved causes COMMIT or ROLLBACK. # +# # +# # +# The typical test sequence # +# ------------------------- # +# 1. master connection: INSERT without commit # +# check table content of master and slave # +# 2. master connection: EXECUTE the statement # +# check table content of master and slave # +# 3. master connection: ROLLBACK # +# check table content of master and slave # +# 4. flush the logs # +# # +# The variables # +# $show_binlog -- print binlog entries # +# 0 - default + fits to the file with # +# results # +# 1 - useful for debugging # +# This variable is used within # +# include/rpl_stmt_seq.inc. # +# $manipulate -- Manipulation of the binary logs # +# 0 - do nothing # +# 1 - so that the output of SHOW BINLOG # +# EVENTS IN contains only # +# commands of the current test sequence # +# This is especially useful, if the # +# $show_binlog is set to 1 and many # +# subtest are executed. # +# This variable is used within # +# include/rpl_stmt_seq.inc. # +# have to be set before sourcing this script. # +# # +# Please be very careful when editing this routine, because the # +# handling of the $variables is extreme sensitive. # +# # +######################################################################## -############################################################### -# Debug options : To debug this test script -############################################################### -let $show_binlog= 0; -let $manipulate= 1; - -######## The typical test sequence -# 1. INSERT without commit -# check table content of master and slave -# 2. EXECUTE the statement -# check table content of master and slave -# 3. ROLLBACK -# check table content of master and slave -# 4. flush the logs +# Last update: +# 2007-02-12 ML Replace comments via SQL by "--echo ..." +# let $VERSION=`select version()`; ---disable_query_log -# SELECT '######## new test sequence ########' as ""; -eval SELECT CONCAT('######## ','$my_stmt',' ########') as ""; ---enable_query_log +--echo +--echo ######## $my_stmt ######## ############################################################### @@ -49,11 +70,10 @@ let $_log_num_s= `select @aux`; ############################################################### # INSERT ############################################################### +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log -# Maybe it would be smarter to use a table with autoincrement column. +# Maybe it would be smarter to use a table with an autoincrement column. let $MAX= `SELECT MAX(f1) FROM t1` ; eval INSERT INTO t1 SET f1= $MAX + 1; # results before DDL(to be tested) @@ -66,10 +86,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; } sync_slave_with_master; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log # results before DDL(to be tested) SELECT MAX(f1) FROM t1; if ($show_binlog) @@ -82,10 +101,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; ############################################################### # command to be tested ############################################################### +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log eval $my_stmt; # Devaluate $my_stmt, to detect script bugs let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT; @@ -99,10 +117,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; } sync_slave_with_master; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log # results after DDL(to be tested) SELECT MAX(f1) FROM t1; if ($show_binlog) @@ -115,10 +132,9 @@ eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; ############################################################### # ROLLBACK ############################################################### +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log ROLLBACK; # results after final ROLLBACK SELECT MAX(f1) FROM t1; @@ -140,10 +156,9 @@ eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; } sync_slave_with_master; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log # results after final ROLLBACK SELECT MAX(f1) FROM t1; --disable_query_log @@ -172,19 +187,17 @@ if ($manipulate) # - flush the master and the slave log # ---> both start to write into new logs with incremented number # - increment $_log_num_n +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log flush logs; # sleep 1; # eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; sync_slave_with_master; +--echo +--echo -------- switch to slave -------- connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log # the final content of the binary log flush logs; # The next sleep is urgent needed. @@ -195,7 +208,6 @@ flush logs; inc $_log_num_n; } +--echo +--echo -------- switch to master ------- connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log diff --git a/mysql-test/include/rpl_stmt_seq2.inc b/mysql-test/include/rpl_stmt_seq2.inc deleted file mode 100644 index 7671a6a857c..00000000000 --- a/mysql-test/include/rpl_stmt_seq2.inc +++ /dev/null @@ -1,201 +0,0 @@ -# include/rpl_stmt_seq.inc -# -# Please be very careful when editing this routine, because the handling of -# the $variables is extreme sensitive. -# - -############################################################### -# Debug options : To debug this test script -############################################################### -let $show_binlog= 0; -let $manipulate= 1; - -######## The typical test sequence -# 1. INSERT without commit -# check table content of master and slave -# 2. EXECUTE the statement -# check table content of master and slave -# 3. ROLLBACK -# check table content of master and slave -# 4. flush the logs - -let $VERSION=`select version()`; - ---disable_query_log -# SELECT '######## new test sequence ########' as ""; -eval SELECT CONCAT('######## ','$my_stmt',' $engine_type',' ########') as ""; ---enable_query_log - - -############################################################### -# Predict the number of the current log -############################################################### -# Disable the logging of the log number computation. ---disable_query_log -# $_log_num_n should contain the number of the current binlog in numeric style. -# If this routine is called for the first time, $_log_num will not initialized -# and contain the value '' instead of '1'. So we will correct it here. -# -eval set @aux= IF('$_log_num_n' = '', '1', '$_log_num_n'); -let $_log_num_n= `SELECT @aux`; -eval set @aux= LPAD('$_log_num_n',6,'0'); -# SELECT @aux AS "@aux is"; -# -# $_log_num_s should contain the number of the current binlog in string style. -let $_log_num_s= `select @aux`; -# eval SELECT '$log_num' ; ---enable_query_log - -############################################################### -# INSERT -############################################################### -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log -# Maybe it would be smarter to use a table with autoincrement column. -let $MAX= `SELECT MAX(f1) FROM t1` ; -eval INSERT INTO t1 SET f1= $MAX + 1; -# results before DDL(to be tested) -SELECT MAX(f1) FROM t1; -if ($show_binlog) -{ ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; -} -sync_slave_with_master; - -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -# results before DDL(to be tested) -SELECT MAX(f1) FROM t1; -if ($show_binlog) -{ ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; -} - -############################################################### -# command to be tested -############################################################### -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log -eval $my_stmt $engine_type; -# Devaluate $my_stmt, to detect script bugs -let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT; -# results after DDL(to be tested) -SELECT MAX(f1) FROM t1; -if ($show_binlog) -{ ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; -} -sync_slave_with_master; - -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -# results after DDL(to be tested) -SELECT MAX(f1) FROM t1; -if ($show_binlog) -{ ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; -} - -############################################################### -# ROLLBACK -############################################################### -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log -ROLLBACK; -# results after final ROLLBACK -SELECT MAX(f1) FROM t1; -# Try to detect if the DDL command caused that the INSERT is committed -# $MAX holds the highest/last value just before the insert of MAX + 1 ---disable_query_log -eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ', - IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')), - IF((MAX(f1) = $MAX + 1) XOR NOT $my_master_commit, - ' (Succeeded)', - ' (Failed)')) AS "" - FROM mysqltest1.t1; ---enable_query_log -if ($show_binlog) -{ ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; -} -sync_slave_with_master; - -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -# results after final ROLLBACK -SELECT MAX(f1) FROM t1; ---disable_query_log -eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ', - IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')), - IF((MAX(f1) = $MAX + 1) XOR NOT $my_slave_commit, - ' (Succeeded)', - ' (Failed)')) AS "" - FROM mysqltest1.t1; ---enable_query_log -if ($show_binlog) -{ ---replace_result $VERSION VERSION ---replace_column 2 # 5 # -eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; -} - -############################################################### -# Manipulate binlog -############################################################### -if ($manipulate) -{ -#### Manipulate the binary logs, -# so that the output of SHOW BINLOG EVENTS IN -# contains only commands of the current test sequence. -# - flush the master and the slave log -# ---> both start to write into new logs with incremented number -# - increment $_log_num_n -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log -flush logs; -# sleep 1; -# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s'; -sync_slave_with_master; - -connection slave; ---disable_query_log -SELECT '-------- switch to slave --------' as ""; ---enable_query_log -# the final content of the binary log -flush logs; -# The next sleep is urgent needed. -# Without this sleep the slaves crashes often, when the SHOW BINLOG -# is executed. :-( -# sleep 1; -# eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s'; -inc $_log_num_n; -} - -connection master; ---disable_query_log -SELECT '-------- switch to master -------' as ""; ---enable_query_log diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/r/rpl_ddl.result index ace86532b12..d41462de621 100644 --- a/mysql-test/r/rpl_ddl.result +++ b/mysql-test/r/rpl_ddl.result @@ -4,45 +4,133 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; + +-------- switch to master ------- SET AUTOCOMMIT = 1; DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest3; CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest2; -CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB"; +CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=InnoDB; INSERT INTO mysqltest1.t1 SET f1= 0; -CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE="InnoDB"; +CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=InnoDB; CREATE INDEX my_idx6 ON mysqltest1.t6(f1); -CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE="InnoDB"; +CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=InnoDB; INSERT INTO mysqltest1.t7 SET f1= 0; -CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE="InnoDB"; -CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); +CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=InnoDB; +CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=MEMORY; SET AUTOCOMMIT = 0; use mysqltest1; -------- switch to slave -------- -SET AUTOCOMMIT = 0; +SET AUTOCOMMIT = 1; use mysqltest1; -------- switch to master ------- -######## COMMIT ######## +######## SELECT 1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 0 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +SELECT 1; +1 +1 +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) + +-------- switch to master ------- + +######## SELECT COUNT(*) FROM t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 0 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) + +-------- switch to master ------- + +######## COMMIT ######## -------- switch to master ------- INSERT INTO t1 SET f1= 0 + 1; @@ -82,14 +170,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## ROLLBACK ######## +######## ROLLBACK ######## -------- switch to master ------- INSERT INTO t1 SET f1= 1 + 1; @@ -129,14 +211,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## SET AUTOCOMMIT=1 ######## +######## SET AUTOCOMMIT=1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 1 + 1; @@ -175,16 +251,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SET AUTOCOMMIT=0; -######## START TRANSACTION ######## +######## START TRANSACTION ######## -------- switch to master ------- INSERT INTO t1 SET f1= 2 + 1; @@ -224,14 +294,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## BEGIN ######## +######## BEGIN ######## -------- switch to master ------- INSERT INTO t1 SET f1= 3 + 1; @@ -271,14 +335,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## DROP TABLE mysqltest1.t2 ######## +######## DROP TABLE mysqltest1.t2 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 4 + 1; @@ -317,12 +375,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW TABLES LIKE 't2'; Tables_in_mysqltest1 (t2) @@ -333,7 +385,7 @@ Tables_in_mysqltest1 (t2) -------- switch to master ------- -######## DROP TEMPORARY TABLE mysqltest1.t23 ######## +######## DROP TEMPORARY TABLE mysqltest1.t23 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 5 + 1; @@ -368,15 +420,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded) -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) -6 +5 -TEST-INFO: SLAVE: The INSERT is committed (Succeeded) - --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -------- switch to master ------- SHOW TABLES LIKE 't23'; @@ -388,7 +434,7 @@ Tables_in_mysqltest1 (t23) -------- switch to master ------- -######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ######## +######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 5 + 1; @@ -399,7 +445,7 @@ MAX(f1) -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) -6 +5 -------- switch to master ------- RENAME TABLE mysqltest1.t3 to mysqltest1.t20; @@ -427,12 +473,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW TABLES LIKE 't20'; Tables_in_mysqltest1 (t20) @@ -445,7 +485,7 @@ t20 -------- switch to master ------- -######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ######## +######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ######## -------- switch to master ------- INSERT INTO t1 SET f1= 6 + 1; @@ -484,12 +524,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- describe mysqltest1.t4; Field Type Null Key Default Extra @@ -504,7 +538,7 @@ f2 bigint(20) YES NULL -------- switch to master ------- -######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ######## +######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= InnoDB ######## -------- switch to master ------- INSERT INTO t1 SET f1= 7 + 1; @@ -518,7 +552,7 @@ MAX(f1) 7 -------- switch to master ------- -CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= InnoDB; SELECT MAX(f1) FROM t1; MAX(f1) 8 @@ -544,14 +578,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ######## +######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY ######## -------- switch to master ------- INSERT INTO t1 SET f1= 8 + 1; @@ -565,7 +593,7 @@ MAX(f1) 8 -------- switch to master ------- -CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); +CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY; SELECT MAX(f1) FROM t1; MAX(f1) 9 @@ -586,19 +614,13 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded) -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) -9 +8 -TEST-INFO: SLAVE: The INSERT is committed (Succeeded) - --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -------- switch to master ------- -######## TRUNCATE TABLE mysqltest1.t7 ######## +######## TRUNCATE TABLE mysqltest1.t7 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 8 + 1; @@ -609,7 +631,7 @@ MAX(f1) -------- switch to slave -------- SELECT MAX(f1) FROM t1; MAX(f1) -9 +8 -------- switch to master ------- TRUNCATE TABLE mysqltest1.t7; @@ -637,21 +659,17 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SELECT * FROM mysqltest1.t7; f1 + -------- switch to slave -------- SELECT * FROM mysqltest1.t7; f1 + -------- switch to master ------- -######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## +######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## -------- switch to master ------- INSERT INTO t1 SET f1= 9 + 1; @@ -690,16 +708,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- UNLOCK TABLES; -######## UNLOCK TABLES ######## +######## UNLOCK TABLES ######## -------- switch to master ------- INSERT INTO t1 SET f1= 10 + 1; @@ -738,16 +750,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- LOCK TABLES mysqltest1.t1 READ; -######## UNLOCK TABLES ######## +######## UNLOCK TABLES ######## -------- switch to master ------- INSERT INTO t1 SET f1= 10 + 1; @@ -787,16 +793,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; -######## UNLOCK TABLES ######## +######## UNLOCK TABLES ######## -------- switch to master ------- INSERT INTO t1 SET f1= 10 + 1; @@ -836,14 +836,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## DROP INDEX my_idx6 ON mysqltest1.t6 ######## +######## DROP INDEX my_idx6 ON mysqltest1.t6 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 11 + 1; @@ -882,12 +876,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW INDEX FROM mysqltest1.t6; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -898,7 +886,7 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par -------- switch to master ------- -######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ######## +######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ######## -------- switch to master ------- INSERT INTO t1 SET f1= 12 + 1; @@ -937,12 +925,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW INDEX FROM mysqltest1.t5; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -955,7 +937,7 @@ t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE -------- switch to master ------- -######## DROP DATABASE mysqltest2 ######## +######## DROP DATABASE mysqltest2 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 13 + 1; @@ -994,12 +976,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW DATABASES LIKE "mysqltest2"; Database (mysqltest2) @@ -1010,7 +986,7 @@ Database (mysqltest2) -------- switch to master ------- -######## CREATE DATABASE mysqltest3 ######## +######## CREATE DATABASE mysqltest3 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 14 + 1; @@ -1049,12 +1025,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW DATABASES LIKE "mysqltest3"; Database (mysqltest3) @@ -1067,7 +1037,7 @@ mysqltest3 -------- switch to master ------- -######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ######## +######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ######## -------- switch to master ------- INSERT INTO t1 SET f1= 15 + 1; @@ -1107,33 +1077,30 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment -------- switch to slave -------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment -------- switch to master ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment - -------- switch to slave ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment -######## ALTER PROCEDURE p1 COMMENT "I have been altered" ######## +######## ALTER PROCEDURE p1 COMMENT "I have been altered" ######## -------- switch to master ------- INSERT INTO t1 SET f1= 16 + 1; @@ -1173,33 +1140,30 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment I have been altered -------- switch to slave -------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment I have been altered -------- switch to master ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment I have been altered - -------- switch to slave ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment I have been altered -######## DROP PROCEDURE p1 ######## +######## DROP PROCEDURE p1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 17 + 1; @@ -1239,17 +1203,14 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; -------- switch to slave -------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; -------- switch to master ------- -SHOW PROCEDURE STATUS LIKE 'p1'; - -------- switch to slave ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## +######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 18 + 1; @@ -1289,22 +1250,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to slave -------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to master ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` --------- switch to slave ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` - -######## ALTER VIEW v1 AS select f1 from t1 ######## +######## ALTER VIEW v1 AS select f1 from t1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 19 + 1; @@ -1344,22 +1301,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to slave -------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to master ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` --------- switch to slave ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` - -######## DROP VIEW IF EXISTS v1 ######## +######## DROP VIEW IF EXISTS v1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 20 + 1; @@ -1399,20 +1352,16 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist -------- switch to slave -------- -flush logs; +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist -------- switch to master ------- -SHOW CREATE VIEW v1; -ERROR 42S02: Table 'mysqltest1.v1' doesn't exist --------- switch to slave ------- -SHOW CREATE VIEW v1; -ERROR 42S02: Table 'mysqltest1.v1' doesn't exist - -######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## +######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 21 + 1; @@ -1452,22 +1401,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost -------- switch to slave -------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost -------- switch to master ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost --------- switch to slave ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost - -######## DROP TRIGGER trg1 ######## +######## DROP TRIGGER trg1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 22 + 1; @@ -1507,20 +1452,16 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer -------- switch to slave -------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer -------- switch to master ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer --------- switch to slave ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer - -######## CREATE USER user1@localhost ######## +######## CREATE USER user1@localhost ######## -------- switch to master ------- INSERT INTO t1 SET f1= 23 + 1; @@ -1560,22 +1501,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 -------- switch to slave -------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 -------- switch to master ------- -SELECT user FROM mysql.user WHERE user = 'user1'; -user -user1 --------- switch to slave ------- -SELECT user FROM mysql.user WHERE user = 'user1'; -user -user1 - -######## RENAME USER user1@localhost TO rename1@localhost ######## +######## RENAME USER user1@localhost TO rename1@localhost ######## -------- switch to master ------- INSERT INTO t1 SET f1= 24 + 1; @@ -1615,22 +1552,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 -------- switch to slave -------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 -------- switch to master ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user -rename1 --------- switch to slave ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user -rename1 - -######## DROP USER rename1@localhost ######## +######## DROP USER rename1@localhost ######## -------- switch to master ------- INSERT INTO t1 SET f1= 25 + 1; @@ -1670,18 +1603,14 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user -------- switch to slave -------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +use test; -------- switch to master ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user - --------- switch to slave ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user -DROP DATABASE IF EXISTS mysqltest1; -DROP DATABASE IF EXISTS mysqltest2; -DROP DATABASE IF EXISTS mysqltest3; +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest3; diff --git a/mysql-test/r/rpl_ndb_ddl.result b/mysql-test/r/rpl_ndb_ddl.result index f5d8073be94..aeaca1e7de0 100644 --- a/mysql-test/r/rpl_ndb_ddl.result +++ b/mysql-test/r/rpl_ndb_ddl.result @@ -4,45 +4,133 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; + +-------- switch to master ------- SET AUTOCOMMIT = 1; DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest3; CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest2; -CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="NDB"; +CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=NDB; INSERT INTO mysqltest1.t1 SET f1= 0; -CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE="NDB"; +CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=NDB; CREATE INDEX my_idx6 ON mysqltest1.t6(f1); -CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE="NDB"; +CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=NDB; INSERT INTO mysqltest1.t7 SET f1= 0; -CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE="NDB"; -CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE="NDB"; -CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT); +CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=NDB; +CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=NDB; +CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=MEMORY; SET AUTOCOMMIT = 0; use mysqltest1; -------- switch to slave -------- -SET AUTOCOMMIT = 0; +SET AUTOCOMMIT = 1; use mysqltest1; -------- switch to master ------- -######## COMMIT ######## +######## SELECT 1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 0 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +SELECT 1; +1 +1 +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) + +-------- switch to master ------- + +######## SELECT COUNT(*) FROM t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 0 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: MASTER: The INSERT is not committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 + +TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) + +-------- switch to master ------- + +######## COMMIT ######## -------- switch to master ------- INSERT INTO t1 SET f1= 0 + 1; @@ -82,14 +170,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## ROLLBACK ######## +######## ROLLBACK ######## -------- switch to master ------- INSERT INTO t1 SET f1= 1 + 1; @@ -129,14 +211,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## SET AUTOCOMMIT=1 ######## +######## SET AUTOCOMMIT=1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 1 + 1; @@ -175,16 +251,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SET AUTOCOMMIT=0; -######## START TRANSACTION ######## +######## START TRANSACTION ######## -------- switch to master ------- INSERT INTO t1 SET f1= 2 + 1; @@ -224,14 +294,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## BEGIN ######## +######## BEGIN ######## -------- switch to master ------- INSERT INTO t1 SET f1= 3 + 1; @@ -271,14 +335,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## DROP TABLE mysqltest1.t2 ######## +######## DROP TABLE mysqltest1.t2 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 4 + 1; @@ -317,12 +375,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW TABLES LIKE 't2'; Tables_in_mysqltest1 (t2) @@ -333,7 +385,7 @@ Tables_in_mysqltest1 (t2) -------- switch to master ------- -######## DROP TEMPORARY TABLE mysqltest1.t23 ######## +######## DROP TEMPORARY TABLE mysqltest1.t23 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 5 + 1; @@ -372,12 +424,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW TABLES LIKE 't23'; Tables_in_mysqltest1 (t23) @@ -388,7 +434,7 @@ Tables_in_mysqltest1 (t23) -------- switch to master ------- -######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ######## +######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 5 + 1; @@ -427,12 +473,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW TABLES LIKE 't20'; Tables_in_mysqltest1 (t20) @@ -445,7 +485,7 @@ t20 -------- switch to master ------- -######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ######## +######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ######## -------- switch to master ------- INSERT INTO t1 SET f1= 6 + 1; @@ -484,12 +524,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- describe mysqltest1.t4; Field Type Null Key Default Extra @@ -504,7 +538,7 @@ f2 bigint(20) YES NULL -------- switch to master ------- -######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB" ######## +######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= NDB ######## -------- switch to master ------- INSERT INTO t1 SET f1= 7 + 1; @@ -518,7 +552,7 @@ MAX(f1) 7 -------- switch to master ------- -CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB"; +CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= NDB; SELECT MAX(f1) FROM t1; MAX(f1) 8 @@ -544,14 +578,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ######## +######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY ######## -------- switch to master ------- INSERT INTO t1 SET f1= 8 + 1; @@ -565,7 +593,7 @@ MAX(f1) 8 -------- switch to master ------- -CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT); +CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY; SELECT MAX(f1) FROM t1; MAX(f1) 9 @@ -591,14 +619,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## TRUNCATE TABLE mysqltest1.t7 ######## +######## TRUNCATE TABLE mysqltest1.t7 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 8 + 1; @@ -637,21 +659,17 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SELECT * FROM mysqltest1.t7; f1 + -------- switch to slave -------- SELECT * FROM mysqltest1.t7; f1 + -------- switch to master ------- -######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## +######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## -------- switch to master ------- INSERT INTO t1 SET f1= 9 + 1; @@ -690,16 +708,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- UNLOCK TABLES; -######## UNLOCK TABLES ######## +######## UNLOCK TABLES ######## -------- switch to master ------- INSERT INTO t1 SET f1= 10 + 1; @@ -738,16 +750,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- LOCK TABLES mysqltest1.t1 READ; -######## UNLOCK TABLES ######## +######## UNLOCK TABLES ######## -------- switch to master ------- INSERT INTO t1 SET f1= 10 + 1; @@ -787,16 +793,10 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ; -######## UNLOCK TABLES ######## +######## UNLOCK TABLES ######## -------- switch to master ------- INSERT INTO t1 SET f1= 10 + 1; @@ -836,14 +836,8 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; --------- switch to slave -------- -flush logs; - --------- switch to master ------- - -######## DROP INDEX my_idx6 ON mysqltest1.t6 ######## +######## DROP INDEX my_idx6 ON mysqltest1.t6 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 11 + 1; @@ -882,12 +876,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW INDEX FROM mysqltest1.t6; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -898,7 +886,7 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par -------- switch to master ------- -######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ######## +######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ######## -------- switch to master ------- INSERT INTO t1 SET f1= 12 + 1; @@ -937,12 +925,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW INDEX FROM mysqltest1.t5; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -955,7 +937,7 @@ t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE -------- switch to master ------- -######## DROP DATABASE mysqltest2 ######## +######## DROP DATABASE mysqltest2 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 13 + 1; @@ -994,12 +976,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW DATABASES LIKE "mysqltest2"; Database (mysqltest2) @@ -1010,7 +986,7 @@ Database (mysqltest2) -------- switch to master ------- -######## CREATE DATABASE mysqltest3 ######## +######## CREATE DATABASE mysqltest3 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 14 + 1; @@ -1049,12 +1025,6 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) --------- switch to master ------- -flush logs; - --------- switch to slave -------- -flush logs; - -------- switch to master ------- SHOW DATABASES LIKE "mysqltest3"; Database (mysqltest3) @@ -1067,7 +1037,7 @@ mysqltest3 -------- switch to master ------- -######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ######## +######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ######## -------- switch to master ------- INSERT INTO t1 SET f1= 15 + 1; @@ -1107,33 +1077,30 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment -------- switch to slave -------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment -------- switch to master ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment - -------- switch to slave ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment -######## ALTER PROCEDURE p1 COMMENT "I have been altered" ######## +######## ALTER PROCEDURE p1 COMMENT "I have been altered" ######## -------- switch to master ------- INSERT INTO t1 SET f1= 16 + 1; @@ -1173,33 +1140,30 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment I have been altered -------- switch to slave -------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; +Db mysqltest1 +Name p1 +Type PROCEDURE +Definer root@localhost +Modified # +Created # +Security_type DEFINER +Comment I have been altered -------- switch to master ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment I have been altered - -------- switch to slave ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -Db mysqltest1 -Name p1 -Type PROCEDURE -Definer root@localhost -Modified # -Created # -Security_type DEFINER -Comment I have been altered -######## DROP PROCEDURE p1 ######## +######## DROP PROCEDURE p1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 17 + 1; @@ -1239,17 +1203,14 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; -------- switch to slave -------- -flush logs; +SHOW PROCEDURE STATUS LIKE 'p1'; -------- switch to master ------- -SHOW PROCEDURE STATUS LIKE 'p1'; - -------- switch to slave ------- -SHOW PROCEDURE STATUS LIKE 'p1'; -######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## +######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 18 + 1; @@ -1289,22 +1250,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to slave -------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to master ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` --------- switch to slave ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` - -######## ALTER VIEW v1 AS select f1 from t1 ######## +######## ALTER VIEW v1 AS select f1 from t1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 19 + 1; @@ -1344,22 +1301,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to slave -------- -flush logs; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` -------- switch to master ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` --------- switch to slave ------- -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` - -######## DROP VIEW IF EXISTS v1 ######## +######## DROP VIEW IF EXISTS v1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 20 + 1; @@ -1399,20 +1352,16 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist -------- switch to slave -------- -flush logs; +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist -------- switch to master ------- -SHOW CREATE VIEW v1; -ERROR 42S02: Table 'mysqltest1.v1' doesn't exist --------- switch to slave ------- -SHOW CREATE VIEW v1; -ERROR 42S02: Table 'mysqltest1.v1' doesn't exist - -######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## +######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 21 + 1; @@ -1452,22 +1401,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost -------- switch to slave -------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost -------- switch to master ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost --------- switch to slave ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer -trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost - -######## DROP TRIGGER trg1 ######## +######## DROP TRIGGER trg1 ######## -------- switch to master ------- INSERT INTO t1 SET f1= 22 + 1; @@ -1507,20 +1452,16 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer -------- switch to slave -------- -flush logs; +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode Definer -------- switch to master ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer --------- switch to slave ------- -SHOW TRIGGERS; -Trigger Event Table Statement Timing Created sql_mode Definer - -######## CREATE USER user1@localhost ######## +######## CREATE USER user1@localhost ######## -------- switch to master ------- INSERT INTO t1 SET f1= 23 + 1; @@ -1560,22 +1501,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 -------- switch to slave -------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 -------- switch to master ------- -SELECT user FROM mysql.user WHERE user = 'user1'; -user -user1 --------- switch to slave ------- -SELECT user FROM mysql.user WHERE user = 'user1'; -user -user1 - -######## RENAME USER user1@localhost TO rename1@localhost ######## +######## RENAME USER user1@localhost TO rename1@localhost ######## -------- switch to master ------- INSERT INTO t1 SET f1= 24 + 1; @@ -1615,22 +1552,18 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 -------- switch to slave -------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 -------- switch to master ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user -rename1 --------- switch to slave ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user -rename1 - -######## DROP USER rename1@localhost ######## +######## DROP USER rename1@localhost ######## -------- switch to master ------- INSERT INTO t1 SET f1= 25 + 1; @@ -1670,19 +1603,14 @@ MAX(f1) TEST-INFO: SLAVE: The INSERT is committed (Succeeded) -------- switch to master ------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user -------- switch to slave -------- -flush logs; +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +use test; -------- switch to master ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user - --------- switch to slave ------- -SELECT user FROM mysql.user WHERE user = 'rename1'; -user -DROP DATABASE IF EXISTS mysqltest1; -DROP DATABASE IF EXISTS mysqltest2; -DROP DATABASE IF EXISTS mysqltest3; -ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest3; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index ab3892cd5ca..7174dcada9e 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -24,7 +24,7 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when up rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD -rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked +rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test index ca1c25c5f09..80df16a7a00 100644 --- a/mysql-test/t/rpl_ddl.test +++ b/mysql-test/t/rpl_ddl.test @@ -22,13 +22,11 @@ # effects like failing 'sync_slave_with_master', crashes of the slave or # abort of the test case etc.. # -# 3. The assignment of the DDL command to be tested to $my_stmt can -# be a bit difficult. "'" must be avoided, because the test -# routine "include/rpl_stmt_seq.inc" performs a -# eval SELECT CONCAT('######## ','$my_stmt',' ########') as ""; -# --source include/not_ndb_default.inc ---source include/have_innodb.inc --source include/master-slave.inc -let $engine_type= "InnoDB"; +--source include/have_innodb.inc +let $engine_type= InnoDB; +let $temp_engine_type= MEMORY; +let $show_binlog = 0; +let $manipulate = 0; -- source extra/rpl_tests/rpl_ddl.test diff --git a/mysql-test/t/rpl_ndb_ddl.test b/mysql-test/t/rpl_ndb_ddl.test index 0c503e56c9c..ca7a4ce4968 100644 --- a/mysql-test/t/rpl_ndb_ddl.test +++ b/mysql-test/t/rpl_ndb_ddl.test @@ -1,4 +1,4 @@ -######################## rpl_ddl.test ######################## +#################### rpl_ndb_ddl.test ######################## # # # DDL statements (sometimes with implicit COMMIT) executed # # by the master and it's propagation into the slave # @@ -22,14 +22,11 @@ # effects like failing 'sync_slave_with_master', crashes of the slave or # abort of the test case etc.. # -# 3. The assignment of the DDL command to be tested to $my_stmt can -# be a bit difficult. "'" must be avoided, because the test -# routine "include/rpl_stmt_seq.inc" performs a -# eval SELECT CONCAT('######## ','$my_stmt',' ########') as ""; -# ---source include/have_ndb.inc --source include/master-slave.inc -let $engine_type= "NDB"; --- source extra/rpl_tests/rpl_ndb_ddl.test - +--source include/have_ndb.inc +let $engine_type= NDB; +let $temp_engine_type= MEMORY; +let $show_binlog = 0; +let $manipulate = 0; +-- source extra/rpl_tests/rpl_ddl.test From 38acf43e34a617480f9bdb21df25f5ca76d54c8a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Mar 2007 23:58:10 +0300 Subject: [PATCH 051/789] Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result. Functions over sum functions wasn't set up correctly for the ORDER BY clause which leads to a wrong order of the result set. The split_sum_func() function is called now for each ORDER BY item that contains a sum function to set it up correctly. mysql-test/t/order_by.test: Added a test case for bug#25376: Incomplete setup of ORDER BY clause results in a wrong result. mysql-test/r/order_by.result: Added a test case for bug#25376: Incomplete setup of ORDER BY clause results in a wrong result. sql/sql_select.cc: Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result. The split_sum_func() function is called now for each ORDER BY item that contains a sum function to set it up correctly. --- mysql-test/r/order_by.result | 8 ++++++++ mysql-test/t/order_by.test | 8 ++++++++ sql/sql_select.cc | 11 +++++++++++ 3 files changed, 27 insertions(+) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index e81d46c9199..0b1edfd3e8f 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -926,3 +926,11 @@ NULL 2 3 DROP TABLE t1,t2,t3,t4; +create table t1 (a int, b int, c int); +insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9); +select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc; +a ratio +1 0.5000 +19 1.3333 +9 2.6667 +drop table t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 012b38ff8b7..a3aa2c0081d 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -640,3 +640,11 @@ SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a) ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b; DROP TABLE t1,t2,t3,t4; + +# +# Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result. +# +create table t1 (a int, b int, c int); +insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9); +select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc; +drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5202f35f4de..fae4a0ce4aa 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -455,6 +455,17 @@ JOIN::prepare(Item ***rref_pointer_array, select_lex->fix_prepare_information(thd, &conds, &having); + if (order) + { + ORDER *ord; + for (ord= order; ord; ord= ord->next) + { + Item *item= *ord->item; + if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM) + item->split_sum_func(thd, ref_pointer_array, all_fields); + } + } + if (having && having->with_sum_func) having->split_sum_func2(thd, ref_pointer_array, all_fields, &having, TRUE); From 7ab5c6820c1a58f66b612d76373e539485bc3966 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Mar 2007 17:14:59 -0800 Subject: [PATCH 052/789] Fixed buffer overflow cases (should not be possible to do...) Fixed for autoincrement support/GUID client/client_priv.h: Option for autoincrement client/mysqlslap.c: Fixed buffer overflow where sprintf is used (now removed). Fixed for auto-increment support/GUID. mysql-test/t/mysqlslap.test: Added test for auto increment, update, write, read, and mixed. --- client/client_priv.h | 2 + client/mysqlslap.c | 373 +++++++++++++++++++++++++++++++++--- mysql-test/t/mysqlslap.test | 14 ++ 3 files changed, 359 insertions(+), 30 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 646619f62b1..c8cf68bfd13 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -58,6 +58,8 @@ enum options_client OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA, OPT_SLAP_CSV, OPT_SLAP_CREATE_STRING, OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, OPT_SLAP_AUTO_GENERATE_WRITE_NUM, + OPT_SLAP_AUTO_GENERATE_ADD_AUTO, + OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_DEBUG_INFO, OPT_COLUMN_TYPES diff --git a/client/mysqlslap.c b/client/mysqlslap.c index ad2c8685ba1..047193495d2 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -71,9 +71,16 @@ TODO: #define SHOW_VERSION "0.9" -#define HUGE_STRING_LENGTH 8096 +#define HUGE_STRING_LENGTH 8196 #define RAND_STRING_SIZE 126 +/* Types */ +#define SELECT_TYPE 0 +#define UPDATE_TYPE 1 +#define INSERT_TYPE 2 +#define UPDATE_TYPE_REQUERIES_PREFIX 3 +#define CREATE_TABLE_TYPE 4 + #include "client_priv.h" #ifdef HAVE_LIBPTHREAD #include @@ -107,6 +114,9 @@ static char *shared_memory_base_name=0; static char **defaults_argv; +char *primary_keys; +unsigned long long primary_keys_number_of; + static char *host= NULL, *opt_password= NULL, *user= NULL, *user_supplied_query= NULL, *default_engine= NULL, @@ -127,6 +137,8 @@ static my_bool opt_slave; static my_bool opt_compress= FALSE, tty_password= FALSE, opt_silent= FALSE, + auto_generate_sql_autoincrement= FALSE, + auto_generate_sql_guid_primary= FALSE, auto_generate_sql= FALSE; const char *auto_generate_sql_type= "mixed"; @@ -159,6 +171,7 @@ typedef struct statement statement; struct statement { char *string; size_t length; + unsigned char type; statement *next; }; @@ -206,7 +219,10 @@ static int drop_schema(MYSQL *mysql, const char *db); uint get_random_string(char *buf); static statement *build_table_string(void); static statement *build_insert_string(void); +static statement *build_update_string(void); static statement *build_query_string(void); +static int generate_primary_key_list(MYSQL *mysql); +static int drop_primary_key_list(void); static int create_schema(MYSQL *mysql, const char *db, statement *stmt, statement *engine_stmt); static int run_scheduler(stats *sptr, statement *stmts, uint concur, @@ -343,6 +359,13 @@ int main(int argc, char **argv) /* First we create */ if (create_statements) create_schema(&mysql, create_schema_string, create_statements, eptr); + + /* + If we generated GUID we need to build a list of them from creation that + we can later use. + */ + if (auto_generate_sql_guid_primary) + generate_primary_key_list(&mysql); run_scheduler(sptr, query_statements, *current, client_limit); } @@ -359,6 +382,10 @@ int main(int argc, char **argv) if (!opt_preserve) drop_schema(&mysql, create_schema_string); + + if (auto_generate_sql_guid_primary) + drop_primary_key_list(); + } while (eptr ? (eptr= eptr->next) : 0); if (!opt_only_print) @@ -397,8 +424,18 @@ static struct my_option my_long_options[] = "Generate SQL where not supplied by file or command line.", (gptr*) &auto_generate_sql, (gptr*) &auto_generate_sql, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO, + "Add autoincrement to auto-generated tables.", + (gptr*) &auto_generate_sql_autoincrement, + (gptr*) &auto_generate_sql_autoincrement, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY, + "Add GUID based primary keys to auto-generated tables.", + (gptr*) &auto_generate_sql_guid_primary, + (gptr*) &auto_generate_sql_guid_primary, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, - "Load types are mixed, write, or read. Default is mixed\n", + "Load types are mixed, update, write, or read. Default is mixed\n", (gptr*) &auto_generate_sql_type, (gptr*) &auto_generate_sql_type, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM, @@ -614,7 +651,7 @@ get_random_string(char *buf) static statement * build_table_string(void) { - char buf[512]; + char buf[HUGE_STRING_LENGTH]; int col_count; statement *ptr; DYNAMIC_STRING table_string; @@ -626,22 +663,63 @@ build_table_string(void) init_dynamic_string(&table_string, "", 1024, 1024); dynstr_append(&table_string, "CREATE TABLE `t1` ("); - for (col_count= 1; col_count <= num_int_cols; col_count++) + + if (auto_generate_sql_autoincrement) { - sprintf(buf, "intcol%d INT(32)", col_count); + if (snprintf(buf, HUGE_STRING_LENGTH, "id serial") > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in create table\n"); + exit(1); + } dynstr_append(&table_string, buf); - if (col_count < num_int_cols || num_char_cols > 0) + if (num_int_cols || num_char_cols) dynstr_append(&table_string, ","); } - for (col_count= 1; col_count <= num_char_cols; col_count++) + + if (auto_generate_sql_guid_primary) { - sprintf(buf, "charcol%d VARCHAR(128)", col_count); + if (snprintf(buf, HUGE_STRING_LENGTH, "id varchar(32) primary key") > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in create table\n"); + exit(1); + } dynstr_append(&table_string, buf); - if (col_count < num_char_cols) + if (num_int_cols || num_char_cols) dynstr_append(&table_string, ","); } + + if (num_int_cols) + for (col_count= 1; col_count <= num_int_cols; col_count++) + { + if (snprintf(buf, HUGE_STRING_LENGTH, "intcol%d INT(32)", col_count) + > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in create table\n"); + exit(1); + } + dynstr_append(&table_string, buf); + + if (col_count < num_int_cols || num_char_cols > 0) + dynstr_append(&table_string, ","); + } + + if (num_char_cols) + for (col_count= 1; col_count <= num_char_cols; col_count++) + { + if (snprintf(buf, HUGE_STRING_LENGTH, "charcol%d VARCHAR(128)", col_count) + > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating table\n"); + exit(1); + } + dynstr_append(&table_string, buf); + + if (col_count < num_char_cols) + dynstr_append(&table_string, ","); + } + dynstr_append(&table_string, ")"); ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); ptr->string = (char *)my_malloc(table_string.length+1, MYF(MY_WME)); @@ -651,6 +729,94 @@ build_table_string(void) DBUG_RETURN(ptr); } +/* + build_update_string() + + This function builds insert statements when the user opts to not supply + an insert file or string containing insert data +*/ +static statement * +build_update_string(void) +{ + char buf[HUGE_STRING_LENGTH]; + int col_count; + statement *ptr; + DYNAMIC_STRING update_string; + DBUG_ENTER("build_update_string"); + + init_dynamic_string(&update_string, "", 1024, 1024); + + dynstr_append(&update_string, "UPDATE t1 SET "); + + if (num_int_cols) + for (col_count= 1; col_count <= num_int_cols; col_count++) + { + if (snprintf(buf, HUGE_STRING_LENGTH, "intcol%d = %ld", col_count, + random()) > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating update\n"); + exit(1); + } + dynstr_append(&update_string, buf); + + if (col_count < num_int_cols || num_char_cols > 0) + dynstr_append_mem(&update_string, ",", 1); + } + + if (num_char_cols) + for (col_count= 1; col_count <= num_char_cols; col_count++) + { + char rand_buffer[RAND_STRING_SIZE]; + int buf_len= get_random_string(rand_buffer); + + if (snprintf(buf, HUGE_STRING_LENGTH, "charcol%d = '%.*s'", col_count, + buf_len, rand_buffer) + > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating update\n"); + exit(1); + } + dynstr_append(&update_string, buf); + + if (col_count < num_char_cols) + dynstr_append_mem(&update_string, ",", 1); + } + + if (auto_generate_sql_autoincrement) + { + if (snprintf(buf, HUGE_STRING_LENGTH, " WHERE id = %ld", + (long int)(random() % auto_generate_sql_number) ) + > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating update_string\n"); + exit(1); + } + dynstr_append(&update_string, buf); + } + + if (auto_generate_sql_guid_primary) + { + if (snprintf(buf, HUGE_STRING_LENGTH, " WHERE id = ") > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating update_string\n"); + exit(1); + } + dynstr_append(&update_string, buf); + } + + + ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); + ptr->string= (char *)my_malloc(update_string.length+1, MYF(MY_WME)); + ptr->length= update_string.length+1; + if (auto_generate_sql_guid_primary) + ptr->type= UPDATE_TYPE_REQUERIES_PREFIX ; + else + ptr->type= UPDATE_TYPE; + strmov(ptr->string, update_string.str); + dynstr_free(&update_string); + DBUG_RETURN(ptr); +} + /* build_insert_string() @@ -661,7 +827,7 @@ build_table_string(void) static statement * build_insert_string(void) { - char buf[RAND_STRING_SIZE]; + char buf[HUGE_STRING_LENGTH]; int col_count; statement *ptr; DYNAMIC_STRING insert_string; @@ -669,30 +835,66 @@ build_insert_string(void) init_dynamic_string(&insert_string, "", 1024, 1024); - dynstr_append_mem(&insert_string, "INSERT INTO t1 VALUES (", 23); - for (col_count= 1; col_count <= num_int_cols; col_count++) + dynstr_append(&insert_string, "INSERT INTO t1 VALUES ("); + + if (auto_generate_sql_autoincrement) { - sprintf(buf, "%ld", random()); + if (snprintf(buf, HUGE_STRING_LENGTH, "NULL") > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating insert\n"); + exit(1); + } dynstr_append(&insert_string, buf); - if (col_count < num_int_cols || num_char_cols > 0) - dynstr_append_mem(&insert_string, ",", 1); + if (num_int_cols || num_char_cols) + dynstr_append(&insert_string, ","); } - for (col_count= 1; col_count <= num_char_cols; col_count++) - { - int buf_len= get_random_string(buf); - dynstr_append_mem(&insert_string, "'", 1); - dynstr_append_mem(&insert_string, buf, buf_len); - dynstr_append_mem(&insert_string, "'", 1); - if (col_count < num_char_cols) - dynstr_append_mem(&insert_string, ",", 1); + if (auto_generate_sql_guid_primary) + { + if (snprintf(buf, HUGE_STRING_LENGTH, "uuid()") > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in create table\n"); + exit(1); + } + dynstr_append(&insert_string, buf); + + if (num_int_cols || num_char_cols) + dynstr_append(&insert_string, ","); } + + if (num_int_cols) + for (col_count= 1; col_count <= num_int_cols; col_count++) + { + if (snprintf(buf, HUGE_STRING_LENGTH, "%ld", random()) > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating insert\n"); + exit(1); + } + dynstr_append(&insert_string, buf); + + if (col_count < num_int_cols || num_char_cols > 0) + dynstr_append_mem(&insert_string, ",", 1); + } + + if (num_char_cols) + for (col_count= 1; col_count <= num_char_cols; col_count++) + { + int buf_len= get_random_string(buf); + dynstr_append_mem(&insert_string, "'", 1); + dynstr_append_mem(&insert_string, buf, buf_len); + dynstr_append_mem(&insert_string, "'", 1); + + if (col_count < num_char_cols) + dynstr_append_mem(&insert_string, ",", 1); + } + dynstr_append_mem(&insert_string, ")", 1); ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); ptr->string= (char *)my_malloc(insert_string.length+1, MYF(MY_WME)); ptr->length= insert_string.length+1; + ptr->type= INSERT_TYPE; strmov(ptr->string, insert_string.str); dynstr_free(&insert_string); DBUG_RETURN(ptr); @@ -708,7 +910,7 @@ build_insert_string(void) static statement * build_query_string(void) { - char buf[512]; + char buf[HUGE_STRING_LENGTH]; int col_count; statement *ptr; static DYNAMIC_STRING query_string; @@ -719,7 +921,12 @@ build_query_string(void) dynstr_append_mem(&query_string, "SELECT ", 7); for (col_count= 1; col_count <= num_int_cols; col_count++) { - sprintf(buf, "intcol%d", col_count); + if (snprintf(buf, HUGE_STRING_LENGTH, "intcol%d", col_count) + > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating select\n"); + exit(1); + } dynstr_append(&query_string, buf); if (col_count < num_int_cols || num_char_cols > 0) @@ -728,7 +935,12 @@ build_query_string(void) } for (col_count= 1; col_count <= num_char_cols; col_count++) { - sprintf(buf, "charcol%d", col_count); + if (snprintf(buf, HUGE_STRING_LENGTH, "charcol%d", col_count) + > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating select\n"); + exit(1); + } dynstr_append(&query_string, buf); if (col_count < num_char_cols) @@ -739,6 +951,7 @@ build_query_string(void) ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); ptr->string= (char *)my_malloc(query_string.length+1, MYF(MY_WME)); ptr->length= query_string.length+1; + ptr->type= SELECT_TYPE; strmov(ptr->string, query_string.str); dynstr_free(&query_string); DBUG_RETURN(ptr); @@ -773,6 +986,14 @@ get_options(int *argc,char ***argv) exit(1); } + if (auto_generate_sql && auto_generate_sql_guid_primary && auto_generate_sql_autoincrement) + { + fprintf(stderr, + "%s: Either auto-generate-sql-guid-primary or auto-generate-sql-add-autoincrement can be used!\n", + my_progname); + exit(1); + } + parse_comma(concurrency_str ? concurrency_str : "1", &concurrency); if (lock_directory) @@ -836,6 +1057,23 @@ get_options(int *argc,char ***argv) ptr_statement->next= build_insert_string(); } } + else if (auto_generate_sql_type[0] == 'u') + { + for (ptr_statement= create_statements, x= 0; + x < auto_generate_sql_number; + x++, ptr_statement= ptr_statement->next) + { + ptr_statement->next= build_insert_string(); + } + + query_statements= build_update_string(); + for (ptr_statement= query_statements, x= 0; + x < auto_generate_sql_number; + x++, ptr_statement= ptr_statement->next) + { + ptr_statement->next= build_update_string(); + } + } else /* Mixed mode is default */ { int coin= 0; @@ -943,6 +1181,59 @@ static int run_query(MYSQL *mysql, const char *query, int len) } +static int +generate_primary_key_list(MYSQL *mysql) +{ + char query[HUGE_STRING_LENGTH]; + int len; + MYSQL_RES *result; + MYSQL_ROW row; + char *ptr; + DBUG_ENTER("create_schema"); + + len= snprintf(query, HUGE_STRING_LENGTH, "SELECT id from t1"); + + if (run_query(mysql, query, len)) + { + fprintf(stderr,"%s: Cannot select GUID primary keys. (%s)\n", my_progname, + mysql_error(mysql)); + exit(1); + } + + if (opt_only_print) + { + primary_keys_number_of= 1; + primary_keys= (char *)my_malloc(sizeof(char) * primary_keys_number_of * 32, + MYF(MY_ZEROFILL)); + memcpy(primary_keys, "796c4422-1d94-102a-9d6d-00e0812d", 32); + DBUG_RETURN(0); + } + result= mysql_store_result(mysql); + DBUG_ASSERT(result); + primary_keys_number_of= mysql_num_rows(result); + /* + We know the GUID are 32 characters in length, so we preallocate. + */ + primary_keys= (char *)my_malloc(sizeof(char) * primary_keys_number_of * 32, + MYF(MY_ZEROFILL)); + ptr= primary_keys; + while ((row = mysql_fetch_row(result))) + { + memcpy(ptr, row[0], 32); + ptr+= 32; + } + DBUG_ASSERT(ptr == primary_keys + (primary_keys_number_of * 32)); + mysql_free_result(result); + + DBUG_RETURN(0); +} + +static int +drop_primary_key_list(void) +{ + my_free(primary_keys, MYF(0)); + return 0; +} static int create_schema(MYSQL *mysql, const char *db, statement *stmt, @@ -1219,11 +1510,33 @@ run_task(thread_context *con) limit_not_met: for (ptr= con->stmt; ptr && ptr->length; ptr= ptr->next) { - if (run_query(mysql, ptr->string, ptr->length)) + /* + We have to execute differently based on query type. This should become a function. + */ + if (ptr->type == UPDATE_TYPE_REQUERIES_PREFIX) { - fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", - my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); - goto end; + char buffer[HUGE_STRING_LENGTH]; + char *key= primary_keys + (random() % primary_keys_number_of); + int length; + + length= snprintf(buffer, HUGE_STRING_LENGTH, "%.*s '%.*s'", + (int)ptr->length, ptr->string, 32, key); + + if (run_query(mysql, buffer, length)) + { + fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", + my_progname, (uint)length, buffer, mysql_error(mysql)); + goto end; + } + } + else + { + if (run_query(mysql, ptr->string, ptr->length)) + { + fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", + my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); + goto end; + } } if (mysql_field_count(mysql)) { diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test index 01add0d7da8..c98da4b4a0f 100644 --- a/mysql-test/t/mysqlslap.test +++ b/mysql-test/t/mysqlslap.test @@ -14,3 +14,17 @@ --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --create-schema=test_env + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --create-schema=test_env --auto-generate-sql-add-autoincrement + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=update From a58b9b050a4ca36bc6c7617476811bb7f23fc7c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 10:37:30 +0700 Subject: [PATCH 053/789] source code indentation alignment with 5.1, no real change --- ndb/src/ndbapi/NdbRecAttr.cpp | 382 +++++++++++++++++----------------- 1 file changed, 193 insertions(+), 189 deletions(-) diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 18e17071777..abfbd76d2c3 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -55,7 +55,7 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) if (theStorageX) delete[] theStorageX; - + // check alignment to signal data // a future version could check alignment per data type as well @@ -181,7 +181,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) out << "[NULL]"; return out; } - + const NdbDictionary::Column* c = r.getColumn(); uint length = c->getLength(); if (length > 1) @@ -192,196 +192,200 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) if (j > 0) out << " "; - switch(r.getType()) - { - case NdbDictionary::Column::Bigunsigned: - out << r.u_64_value(); - break; - case NdbDictionary::Column::Bit: - out << hex << "H'" << r.u_32_value() << dec; - break; - case NdbDictionary::Column::Unsigned: - out << r.u_32_value(); - break; - case NdbDictionary::Column::Smallunsigned: - out << r.u_short_value(); - break; - case NdbDictionary::Column::Tinyunsigned: - out << (unsigned) r.u_char_value(); - break; - case NdbDictionary::Column::Bigint: - out << r.int64_value(); - break; - case NdbDictionary::Column::Int: - out << r.int32_value(); - break; - case NdbDictionary::Column::Smallint: - out << r.short_value(); - break; - case NdbDictionary::Column::Tinyint: - out << (int) r.char_value(); - break; - case NdbDictionary::Column::Binary: - ndbrecattr_print_string(out,"Binary",r.aRef(),r.arraySize()); - j = r.arraySize(); - break; - case NdbDictionary::Column::Char: - ndbrecattr_print_string(out,"Char",r.aRef(),r.arraySize()); - j = length; - break; - case NdbDictionary::Column::Varchar: - { - unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varchar", r.aRef()+1,len); - j = length; - } - break; - case NdbDictionary::Column::Varbinary: - { - unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varbinary", r.aRef()+1,len); - j = length; - } - break; - case NdbDictionary::Column::Float: - out << r.float_value(); - break; - case NdbDictionary::Column::Double: - out << r.double_value(); - break; - case NdbDictionary::Column::Olddecimal: - { - short len = 1 + c->getPrecision() + (c->getScale() > 0); - out.print("%.*s", len, r.aRef()); - } - break; - case NdbDictionary::Column::Olddecimalunsigned: - { - short len = 0 + c->getPrecision() + (c->getScale() > 0); - out.print("%.*s", len, r.aRef()); - } - break; - case NdbDictionary::Column::Decimal: - case NdbDictionary::Column::Decimalunsigned: - goto unknown; // TODO - break; - // for dates cut-and-paste from field.cc - case NdbDictionary::Column::Datetime: - { - ulonglong tmp=r.u_64_value(); - long part1,part2,part3; - part1=(long) (tmp/LL(1000000)); - part2=(long) (tmp - (ulonglong) part1*LL(1000000)); - char buf[40]; - char* pos=(char*) buf+19; - *pos--=0; - *pos--= (char) ('0'+(char) (part2%10)); part2/=10; - *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); - *pos--= ':'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= ':'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) part3); - *pos--= '/'; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= '-'; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); - *pos--= '-'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos=(char) ('0'+(char) part3); - out << buf; - } - break; - case NdbDictionary::Column::Date: - { - uint32 tmp=(uint32) uint3korr(r.aRef()); - int part; - char buf[40]; - char *pos=(char*) buf+10; - *pos--=0; - part=(int) (tmp & 31); - *pos--= (char) ('0'+part%10); - *pos--= (char) ('0'+part/10); - *pos--= '-'; - part=(int) (tmp >> 5 & 15); - *pos--= (char) ('0'+part%10); - *pos--= (char) ('0'+part/10); - *pos--= '-'; - part=(int) (tmp >> 9); - *pos--= (char) ('0'+part%10); part/=10; - *pos--= (char) ('0'+part%10); part/=10; - *pos--= (char) ('0'+part%10); part/=10; - *pos= (char) ('0'+part); - out << buf; - } - break; - case NdbDictionary::Column::Time: - { - long tmp=(long) sint3korr(r.aRef()); - int hour=(uint) (tmp/10000); - int minute=(uint) (tmp/100 % 100); - int second=(uint) (tmp % 100); - char buf[40]; - sprintf(buf, "%02d:%02d:%02d", hour, minute, second); - out << buf; - } - break; - case NdbDictionary::Column::Year: - { - uint year = 1900 + r.u_char_value(); - char buf[40]; - sprintf(buf, "%04d", year); - out << buf; - } - break; - case NdbDictionary::Column::Timestamp: - { - time_t time = r.u_32_value(); - out << (uint)time; - } - break; - case NdbDictionary::Column::Blob: - case NdbDictionary::Column::Text: - { - // user defined aRef() may not be aligned to Uint64 - NdbBlob::Head head; - memcpy(&head, r.aRef(), sizeof(head)); - out << head.length << ":"; - const unsigned char* p = (const unsigned char*)r.aRef() + sizeof(head); - if (r.arraySize() < sizeof(head)) - out << "***error***"; // really cannot happen - else { - unsigned n = r.arraySize() - sizeof(head); - for (unsigned k = 0; k < n && k < head.length; k++) { - if (r.getType() == NdbDictionary::Column::Blob) - out.print("%02X", (int)p[k]); - else - out.print("%c", (int)p[k]); - } - } - j = length; - } + switch(r.getType()){ + case NdbDictionary::Column::Bigunsigned: + out << r.u_64_value(); break; - case NdbDictionary::Column::Longvarchar: - { - unsigned len = uint2korr(r.aRef()); - ndbrecattr_print_string(out,"Longvarchar", r.aRef()+2,len); - j = length; + case NdbDictionary::Column::Bit: + out << hex << "H'" << r.u_32_value() << dec; + break; + case NdbDictionary::Column::Unsigned: + out << r.u_32_value(); + break; + case NdbDictionary::Column::Smallunsigned: + out << r.u_short_value(); + break; + case NdbDictionary::Column::Tinyunsigned: + out << (unsigned) r.u_char_value(); + break; + case NdbDictionary::Column::Bigint: + out << r.int64_value(); + break; + case NdbDictionary::Column::Int: + out << r.int32_value(); + break; + case NdbDictionary::Column::Smallint: + out << r.short_value(); + break; + case NdbDictionary::Column::Tinyint: + out << (int) r.char_value(); + break; + case NdbDictionary::Column::Binary: + j = r.arraySize(); + ndbrecattr_print_string(out,"Binary", r.aRef(), j); + break; + case NdbDictionary::Column::Char: + j = length; + ndbrecattr_print_string(out,"Char", r.aRef(), r.arraySize()); + break; + case NdbDictionary::Column::Varchar: + { + unsigned len = *(const unsigned char*)r.aRef(); + ndbrecattr_print_string(out,"Varchar", r.aRef()+1,len); + j = length; + } + break; + case NdbDictionary::Column::Varbinary: + { + unsigned len = *(const unsigned char*)r.aRef(); + ndbrecattr_print_string(out,"Varbinary", r.aRef()+1,len); + j = length; + } + break; + case NdbDictionary::Column::Float: + out << r.float_value(); + break; + case NdbDictionary::Column::Double: + out << r.double_value(); + break; + case NdbDictionary::Column::Olddecimal: + { + short len = 1 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Olddecimalunsigned: + { + short len = 0 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Decimal: + case NdbDictionary::Column::Decimalunsigned: + goto unknown; // TODO + break; + // for dates cut-and-paste from field.cc + case NdbDictionary::Column::Datetime: + { + ulonglong tmp=r.u_64_value(); + long part1,part2,part3; + part1=(long) (tmp/LL(1000000)); + part2=(long) (tmp - (ulonglong) part1*LL(1000000)); + char buf[40]; + char* pos=(char*) buf+19; + *pos--=0; + *pos--= (char) ('0'+(char) (part2%10)); part2/=10; + *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) part3); + *pos--= '/'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= '-'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); + *pos--= '-'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos=(char) ('0'+(char) part3); + out << buf; + } + break; + case NdbDictionary::Column::Date: + { + uint32 tmp=(uint32) uint3korr(r.aRef()); + int part; + char buf[40]; + char *pos=(char*) buf+10; + *pos--=0; + part=(int) (tmp & 31); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 5 & 15); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 9); + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos= (char) ('0'+part); + out << buf; + } + break; + case NdbDictionary::Column::Time: + { + long tmp=(long) sint3korr(r.aRef()); + int hour=(uint) (tmp/10000); + int minute=(uint) (tmp/100 % 100); + int second=(uint) (tmp % 100); + char buf[40]; + sprintf(buf, "%02d:%02d:%02d", hour, minute, second); + out << buf; + } + break; + case NdbDictionary::Column::Year: + { + uint year = 1900 + r.u_char_value(); + char buf[40]; + sprintf(buf, "%04d", year); + out << buf; + } + break; + case NdbDictionary::Column::Timestamp: + { + time_t time = r.u_32_value(); + out << (uint)time; + } + break; + case NdbDictionary::Column::Blob: + case NdbDictionary::Column::Text: + { + // user defined aRef() may not be aligned to Uint64 + NdbBlob::Head head; + memcpy(&head, r.aRef(), sizeof(head)); + out << head.length << ":"; + const unsigned char* p = (const unsigned char*)r.aRef() + sizeof(head); + if (r.arraySize() < sizeof(head)) + out << "***error***"; // really cannot happen + else { + unsigned n = r.arraySize() - sizeof(head); + for (unsigned k = 0; k < n && k < head.length; k++) { + if (r.getType() == NdbDictionary::Column::Blob) + out.print("%02X", (int)p[k]); + else + out.print("%c", (int)p[k]); } - break; - unknown: - default: /* no print functions for the rest, just print type */ - out << (int) r.getType(); - j = length; - if (j > 1) - out << " " << j << " times"; - break; } + j = length; + } + break; + case NdbDictionary::Column::Longvarchar: + { + unsigned len = uint2korr(r.aRef()); + ndbrecattr_print_string(out,"Longvarchar", r.aRef()+2,len); + j = length; + } + break; + + case NdbDictionary::Column::Undefined: + case NdbDictionary::Column::Mediumint: + case NdbDictionary::Column::Mediumunsigned: + case NdbDictionary::Column::Longvarbinary: + unknown: + //default: /* no print functions for the rest, just print type */ + out << (int) r.getType(); + j = length; + if (j > 1) + out << " " << j << " times"; + break; + } } if (length > 1) From 5d2ad21b624627868fa4861cfc601f56a4193fac Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 10:46:44 +0700 Subject: [PATCH 054/789] Bug#25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes - refactor single user and move single user checks from api to kernel --- ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 11 +- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 133 +++++++++++++++++++++--- ndb/src/ndbapi/ClusterMgr.cpp | 2 +- ndb/src/ndbapi/Ndb.cpp | 11 ++ ndb/src/ndbapi/TransporterFacade.hpp | 16 +-- 5 files changed, 143 insertions(+), 30 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index d6c4529bb72..988aa091127 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -1835,9 +1835,14 @@ private: Uint32 transid2); void removeMarkerForFailedAPI(Signal* signal, Uint32 nodeId, Uint32 bucket); - bool getAllowStartTransaction() const { - if(getNodeState().getSingleUserMode()) - return true; + bool getAllowStartTransaction(Uint32 nodeId) const { + if (unlikely(getNodeState().getSingleUserMode())) + { + if (getNodeState().getSingleUserApi() == nodeId) + return true; + else + return false; + } return getNodeState().startLevel < NodeState::SL_STOPPING_2; } diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 2b2e0e649a4..82c8e4a9634 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -1199,16 +1199,14 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) const NodeId senderNodeId = refToNode(tapiBlockref); const bool local = senderNodeId == getOwnNodeId() || senderNodeId == 0; - if(!(senderNodeId == getNodeState().getSingleUserApi()) && - !getNodeState().getSingleUserMode()) { - if(!(sl==NodeState::SL_SINGLEUSER && - senderNodeId == getNodeState().getSingleUserApi())) { + { + { if (!(sl == NodeState::SL_STARTED || (sl == NodeState::SL_STARTING && local == true))) { jam(); - Uint32 errCode; - if(!(sl == NodeState::SL_SINGLEUSER && local)) + Uint32 errCode = 0; + if(!local) { switch(sl){ case NodeState::SL_STARTING: @@ -1216,6 +1214,9 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) break; case NodeState::SL_STOPPING_1: case NodeState::SL_STOPPING_2: + if (getNodeState().getSingleUserMode() && + getNodeState().getSingleUserApi() == senderNodeId) + break; case NodeState::SL_STOPPING_3: case NodeState::SL_STOPPING_4: if(getNodeState().stopping.systemShutdown) @@ -1224,16 +1225,21 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) errCode = ZNODE_SHUTDOWN_IN_PROGRESS; break; case NodeState::SL_SINGLEUSER: + if (getNodeState().getSingleUserApi() == senderNodeId) + break; errCode = ZCLUSTER_IN_SINGLEUSER_MODE; break; default: errCode = ZWRONG_STATE; break; } - signal->theData[0] = tapiPointer; - signal->theData[1] = errCode; - sendSignal(tapiBlockref, GSN_TCSEIZEREF, signal, 2, JBB); - return; + if (errCode) + { + signal->theData[0] = tapiPointer; + signal->theData[1] = errCode; + sendSignal(tapiBlockref, GSN_TCSEIZEREF, signal, 2, JBB); + return; + } }//if (!(sl == SL_SINGLEUSER)) } //if } @@ -1720,8 +1726,14 @@ Dbtc::TCKEY_abort(Signal* signal, int place) * Initialize object before starting error handling */ initApiConnectRec(signal, apiConnectptr.p, true); +start_failure: switch(getNodeState().startLevel){ case NodeState::SL_STOPPING_2: + if (getNodeState().getSingleUserMode()) + { + terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; + break; + } case NodeState::SL_STOPPING_3: case NodeState::SL_STOPPING_4: if(getNodeState().stopping.systemShutdown) @@ -1732,6 +1744,12 @@ Dbtc::TCKEY_abort(Signal* signal, int place) case NodeState::SL_SINGLEUSER: terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; break; + case NodeState::SL_STOPPING_1: + if (getNodeState().getSingleUserMode()) + { + terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; + break; + } default: terrorCode = ZWRONG_STATE; break; @@ -1753,6 +1771,13 @@ Dbtc::TCKEY_abort(Signal* signal, int place) return; } + case 60: + { + jam(); + initApiConnectRec(signal, apiConnectptr.p, true); + apiConnectptr.p->m_exec_flag = 1; + goto start_failure; + } default: jam(); systemErrorLab(signal, __LINE__); @@ -2481,6 +2506,7 @@ Dbtc::seizeCacheRecord(Signal* signal) /*****************************************************************************/ void Dbtc::execTCKEYREQ(Signal* signal) { + Uint32 sendersNodeId = refToNode(signal->getSendersBlockRef()); UintR compare_transid1, compare_transid2; UintR titcLenAiInTckeyreq; UintR TkeyLength; @@ -2526,7 +2552,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) regApiPtr->m_exec_flag |= TexecFlag; switch (regApiPtr->apiConnectstate) { case CS_CONNECTED:{ - if (TstartFlag == 1 && getAllowStartTransaction() == true){ + if (TstartFlag == 1 && getAllowStartTransaction(sendersNodeId) == true){ //--------------------------------------------------------------------- // Initialise API connect record if transaction is started. //--------------------------------------------------------------------- @@ -2534,7 +2560,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) initApiConnectRec(signal, regApiPtr); regApiPtr->m_exec_flag = TexecFlag; } else { - if(getAllowStartTransaction() == true){ + if(getAllowStartTransaction(sendersNodeId) == true){ /*------------------------------------------------------------------ * WE EXPECTED A START TRANSACTION. SINCE NO OPERATIONS HAVE BEEN * RECEIVED WE INDICATE THIS BY SETTING FIRST_TC_CONNECT TO RNIL TO @@ -2544,9 +2570,9 @@ void Dbtc::execTCKEYREQ(Signal* signal) return; } else { /** - * getAllowStartTransaction() == false + * getAllowStartTransaction(sendersNodeId) == false */ - TCKEY_abort(signal, 57); + TCKEY_abort(signal, TexecFlag ? 60 : 57); return; }//if } @@ -6161,9 +6187,11 @@ and otherwise we spread it out 310 ms. void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) { Uint32 end_ptr, time_passed, time_out_value, mask_value; + Uint32 old_mask_value= 0; const Uint32 api_con_sz= capiConnectFilesize; const Uint32 tc_timer= ctcTimer; const Uint32 time_out_param= ctimeOutValue; + const Uint32 old_time_out_param= c_abortRec.oldTimeOutValue; ctimeOutCheckHeartbeat = tc_timer; @@ -6184,11 +6212,39 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) jam(); mask_value= 31; } + if (time_out_param != old_time_out_param && + getNodeState().getSingleUserMode()) + { + // abort during single user mode, use old_mask_value as flag + // and calculate value to be used for connections with allowed api + if (old_time_out_param > 300) { + jam(); + old_mask_value= 63; + } else if (old_time_out_param < 30) { + jam(); + old_mask_value= 7; + } else { + jam(); + old_mask_value= 31; + } + } for ( ; api_con_ptr < end_ptr; api_con_ptr++) { Uint32 api_timer= getApiConTimer(api_con_ptr); jam(); if (api_timer != 0) { time_out_value= time_out_param + (api_con_ptr & mask_value); + if (unlikely(old_mask_value)) // abort during single user mode + { + apiConnectptr.i = api_con_ptr; + ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); + if (getNodeState().getSingleUserApi() == + refToNode(apiConnectptr.p->ndbapiBlockref)) + { + // api allowed during single user, use original timeout + time_out_value= + old_time_out_param + (api_con_ptr & old_mask_value); + } + } time_passed= tc_timer - api_timer; if (time_passed > time_out_value) { @@ -6805,6 +6861,33 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr) c_scan_frag_pool.getPtr(ptr, TscanConPtr); DEBUG(TscanConPtr << " timeOutFoundFragLab: scanFragState = "<< ptr.p->scanFragState); + const Uint32 time_out_param= ctimeOutValue; + const Uint32 old_time_out_param= c_abortRec.oldTimeOutValue; + + if (unlikely(time_out_param != old_time_out_param && + getNodeState().getSingleUserMode())) + { + jam(); + ScanRecordPtr scanptr; + scanptr.i = ptr.p->scanRec; + ptrCheckGuard(scanptr, cscanrecFileSize, scanRecord); + ApiConnectRecordPtr TlocalApiConnectptr; + TlocalApiConnectptr.i = scanptr.p->scanApiRec; + ptrCheckGuard(TlocalApiConnectptr, capiConnectFilesize, apiConnectRecord); + + if (refToNode(TlocalApiConnectptr.p->ndbapiBlockref) == + getNodeState().getSingleUserApi()) + { + jam(); + Uint32 val = ctcTimer - ptr.p->scanFragTimer; + if (val <= old_time_out_param) + { + jam(); + goto next; + } + } + } + /*-------------------------------------------------------------------------*/ // The scan fragment has expired its timeout. Check its state to decide // what to do. @@ -6866,6 +6949,7 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr) break; }//switch +next: signal->theData[0] = TcContinueB::ZCONTINUE_TIME_OUT_FRAG_CONTROL; signal->theData[1] = TscanConPtr + 1; sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB); @@ -8696,6 +8780,14 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) } } + if (getNodeState().startLevel == NodeState::SL_SINGLEUSER && + getNodeState().getSingleUserApi() != + refToNode(apiConnectptr.p->ndbapiBlockref)) + { + errCode = ZCLUSTER_IN_SINGLEUSER_MODE; + goto SCAN_TAB_error; + } + seizeTcConnect(signal); tcConnectptr.p->apiConnect = apiConnectptr.i; tcConnectptr.p->tcConnectstate = OS_WAIT_SCAN; @@ -11038,7 +11130,7 @@ void Dbtc::execABORT_ALL_REQ(Signal* signal) const Uint32 senderData = req->senderData; const BlockReference senderRef = req->senderRef; - if(getAllowStartTransaction() == true && !getNodeState().getSingleUserMode()){ + if(getAllowStartTransaction(refToNode(senderRef)) == true && !getNodeState().getSingleUserMode()){ jam(); ref->senderData = senderData; @@ -11466,6 +11558,17 @@ void Dbtc::execTCINDXREQ(Signal* signal) regApiPtr->transid[1] = tcIndxReq->transId2; }//if + if (getNodeState().startLevel == NodeState::SL_SINGLEUSER && + getNodeState().getSingleUserApi() != + refToNode(regApiPtr->ndbapiBlockref)) + { + terrorCode = ZCLUSTER_IN_SINGLEUSER_MODE; + regApiPtr->m_exec_flag |= TcKeyReq::getExecuteFlag(tcIndxRequestInfo); + apiConnectptr = transPtr; + abortErrorLab(signal); + return; + } + if (ERROR_INSERTED(8036) || !seizeIndexOperation(regApiPtr, indexOpPtr)) { jam(); // Failed to allocate index operation diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index 060e5f71b6c..7ab3ee07197 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -405,7 +405,7 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ node.m_state = apiRegConf->nodeState; if (node.compatible && (node.m_state.startLevel == NodeState::SL_STARTED || - node.m_state.startLevel == NodeState::SL_SINGLEUSER)){ + node.m_state.getSingleUserMode())){ set_node_alive(node, true); } else { set_node_alive(node, false); diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 80bf0315b9c..8a1ccd53558 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -56,6 +56,8 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) // We have connections now to the desired node. Return //**************************************************************************** DBUG_RETURN(getConnectedNdbTransaction(tConNode)); + } else if (TretCode < 0) { + DBUG_RETURN(NULL); } else if (TretCode != 0) { tAnyAlive = 1; }//if @@ -79,6 +81,8 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) // We have connections now to the desired node. Return //**************************************************************************** DBUG_RETURN(getConnectedNdbTransaction(tNode)); + } else if (TretCode < 0) { + DBUG_RETURN(NULL); } else if (TretCode != 0) { tAnyAlive= 1; }//if @@ -107,6 +111,8 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) // We have connections now to the desired node. Return //**************************************************************************** DBUG_RETURN(getConnectedNdbTransaction(tNode)); + } else if (TretCode < 0) { + DBUG_RETURN(NULL); } else if (TretCode != 0) { tAnyAlive= 1; }//if @@ -207,6 +213,11 @@ Ndb::NDB_connect(Uint32 tNode) DBUG_PRINT("info", ("unsuccessful connect tReturnCode %d, tNdbCon->Status() %d", tReturnCode, tNdbCon->Status())); + if (theError.code == 299) + { + // single user mode so no need to retry with other node + DBUG_RETURN(-1); + } DBUG_RETURN(3); }//if }//Ndb::NDB_connect() diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp index 2e0f08601e5..5a826bc2309 100644 --- a/ndb/src/ndbapi/TransporterFacade.hpp +++ b/ndb/src/ndbapi/TransporterFacade.hpp @@ -315,7 +315,8 @@ inline bool TransporterFacade::get_node_stopping(NodeId n) const { const ClusterMgr::Node & node = theClusterMgr->getNodeInfo(n); - return ((node.m_state.startLevel == NodeState::SL_STOPPING_1) || + return (!node.m_state.getSingleUserMode() && + (node.m_state.startLevel == NodeState::SL_STOPPING_1) || (node.m_state.startLevel == NodeState::SL_STOPPING_2)); } @@ -326,16 +327,9 @@ TransporterFacade::getIsNodeSendable(NodeId n) const { const Uint32 startLevel = node.m_state.startLevel; if (node.m_info.m_type == NodeInfo::DB) { - if(node.m_state.singleUserMode && - ownId() == node.m_state.singleUserApi) { - return (node.compatible && - (node.m_state.startLevel == NodeState::SL_STOPPING_1 || - node.m_state.startLevel == NodeState::SL_STARTED || - node.m_state.startLevel == NodeState::SL_SINGLEUSER)); - } - else - return node.compatible && (startLevel == NodeState::SL_STARTED || - startLevel == NodeState::SL_STOPPING_1); + return node.compatible && (startLevel == NodeState::SL_STARTED || + startLevel == NodeState::SL_STOPPING_1 || + node.m_state.getSingleUserMode()); } else if (node.m_info.m_type == NodeInfo::REP) { /** * @todo Check that REP node actually has received API_REG_REQ From 16fc4db1e123b651937fae21577cb0a8e6557075 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 13:18:08 +0700 Subject: [PATCH 055/789] Bug#26899 ndb_restore cannot restore selected tables and databases Bug#26900 ndb_restore printout option does not give structured data - add data stucturing options - add database and table selection options ndb/include/ndbapi/NdbRecAttr.hpp: add formatting option to ndb recattr printing ndb/include/util/OutputStream.hpp: getter for FILE* ndb/src/ndbapi/NdbRecAttr.cpp: add formatting option to ndb recattr printing ndb/tools/restore/Restore.cpp: add formatting option to restore printing adoption to 5.1 source code ndb/tools/restore/Restore.hpp: restore adoption to 5.1 ndb/tools/restore/consumer_printer.cpp: add formatting option to restore printing ndb/tools/restore/restore_main.cpp: added option to restore only selected databases and tables added option to get CSV printout to file and stdout add formatting option to restore printing adoption to 5.1 source code --- ndb/include/ndbapi/NdbRecAttr.hpp | 19 ++ ndb/include/util/OutputStream.hpp | 3 +- ndb/src/ndbapi/NdbRecAttr.cpp | 127 ++++++-- ndb/tools/restore/Restore.cpp | 60 +++- ndb/tools/restore/Restore.hpp | 18 +- ndb/tools/restore/consumer_printer.cpp | 22 +- ndb/tools/restore/restore_main.cpp | 405 ++++++++++++++++++++----- 7 files changed, 546 insertions(+), 108 deletions(-) diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index df7f22fef60..159c7e7ce77 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -441,6 +441,25 @@ NdbRecAttr::isNULL() const class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &); +class NdbRecordPrintFormat +{ +public: + NdbRecordPrintFormat(); + virtual ~NdbRecordPrintFormat(); + const char *lines_terminated_by; + const char *fields_terminated_by; + const char *start_array_enclosure; + const char *end_array_enclosure; + const char *fields_enclosed_by; + const char *fields_optionally_enclosed_by; + const char *hex_prefix; + const char *null_string; + int hex_format; +}; +NdbOut& +ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, + const NdbRecordPrintFormat &f); + #endif // ifndef DOXYGEN_SHOULD_SKIP_INTERNAL #endif diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp index 460915e12e7..19aa1838c4b 100644 --- a/ndb/include/util/OutputStream.hpp +++ b/ndb/include/util/OutputStream.hpp @@ -34,7 +34,8 @@ class FileOutputStream : public OutputStream { FILE * f; public: FileOutputStream(FILE * file = stdout); - + FILE *getFile() { return f; } + int print(const char * fmt, ...); int println(const char * fmt, ...); void flush() { fflush(f); } diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index abfbd76d2c3..b029f9826d0 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -140,8 +140,24 @@ NdbRecAttr::receive_data(const Uint32 * data, Uint32 sz){ return false; } +NdbRecordPrintFormat::NdbRecordPrintFormat() +{ + fields_terminated_by= ";"; + start_array_enclosure= "["; + end_array_enclosure= "]"; + fields_enclosed_by= ""; + fields_optionally_enclosed_by= "\""; + lines_terminated_by= "\n"; + hex_prefix= "H'"; + null_string= "[NULL]"; + hex_format= 0; +} +NdbRecordPrintFormat::~NdbRecordPrintFormat() {}; +static const NdbRecordPrintFormat default_print_format; + static void -ndbrecattr_print_string(NdbOut& out, const char *type, +ndbrecattr_print_string(NdbOut& out, const NdbRecordPrintFormat &f, + const char *type, bool is_binary, const char *aref, unsigned sz) { const unsigned char* ref = (const unsigned char*)aref; @@ -150,6 +166,25 @@ ndbrecattr_print_string(NdbOut& out, const char *type, for (i=sz-1; i >= 0; i--) if (ref[i] == 0) sz--; else break; + if (!is_binary) + { + // trailing spaces are not printed + for (i=sz-1; i >= 0; i--) + if (ref[i] == 32) sz--; + else break; + } + if (is_binary && f.hex_format) + { + if (sz == 0) + { + out.print("0x0"); + return; + } + out.print("0x"); + for (len = 0; len < (int)sz; len++) + out.print("%02X", (int)ref[len]); + return; + } if (sz == 0) return; // empty for (len=0; len < (int)sz && ref[i] != 0; len++) @@ -170,37 +205,56 @@ ndbrecattr_print_string(NdbOut& out, const char *type, for (i= len+1; ref[i] != 0; i++) out.print("%u]",len-i); assert((int)sz > i); - ndbrecattr_print_string(out,type,aref+i,sz-i); + ndbrecattr_print_string(out,f,type,is_binary,aref+i,sz-i); } } -NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) +NdbOut& +ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, + const NdbRecordPrintFormat &f) { if (r.isNULL()) { - out << "[NULL]"; + out << f.null_string; return out; } const NdbDictionary::Column* c = r.getColumn(); uint length = c->getLength(); - if (length > 1) - out << "["; - - for (Uint32 j = 0; j < length; j++) { - if (j > 0) - out << " "; - + const char *fields_optionally_enclosed_by; + if (f.fields_enclosed_by[0] == '\0') + fields_optionally_enclosed_by= + f.fields_optionally_enclosed_by; + else + fields_optionally_enclosed_by= ""; + out << f.fields_enclosed_by; + Uint32 j; switch(r.getType()){ case NdbDictionary::Column::Bigunsigned: out << r.u_64_value(); break; case NdbDictionary::Column::Bit: - out << hex << "H'" << r.u_32_value() << dec; + for (j = (length-1)/32 + 1; j > 0; j--) + if (*((Uint32*)r.aRef() + j - 1)) + break; + if (j == 0) + { + out << "0x0"; + break; + } + out << f.hex_prefix << "0x"; + for (; j > 0; j--) + out.print("%X", *((Uint32*)r.aRef() + j - 1)); break; case NdbDictionary::Column::Unsigned: - out << r.u_32_value(); + if (length > 1) + out << f.start_array_enclosure; + out << *(Uint32*)r.aRef(); + for (j = 1; j < length; j++) + out << " " << *((Uint32*)r.aRef() + j); + if (length > 1) + out << f.end_array_enclosure; break; case NdbDictionary::Column::Smallunsigned: out << r.u_short_value(); @@ -221,25 +275,37 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) out << (int) r.char_value(); break; case NdbDictionary::Column::Binary: + if (!f.hex_format) + out << fields_optionally_enclosed_by; j = r.arraySize(); - ndbrecattr_print_string(out,"Binary", r.aRef(), j); + ndbrecattr_print_string(out,f,"Binary", true, r.aRef(), j); + if (!f.hex_format) + out << fields_optionally_enclosed_by; break; case NdbDictionary::Column::Char: + out << fields_optionally_enclosed_by; j = length; - ndbrecattr_print_string(out,"Char", r.aRef(), r.arraySize()); + ndbrecattr_print_string(out,f,"Char", false, r.aRef(), r.arraySize()); + out << fields_optionally_enclosed_by; break; case NdbDictionary::Column::Varchar: { + out << fields_optionally_enclosed_by; unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varchar", r.aRef()+1,len); + ndbrecattr_print_string(out,f,"Varchar", false, r.aRef()+1,len); j = length; + out << fields_optionally_enclosed_by; } break; case NdbDictionary::Column::Varbinary: { + if (!f.hex_format) + out << fields_optionally_enclosed_by; unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varbinary", r.aRef()+1,len); + ndbrecattr_print_string(out,f,"Varbinary", true, r.aRef()+1,len); j = length; + if (!f.hex_format) + out << fields_optionally_enclosed_by; } break; case NdbDictionary::Column::Float: @@ -368,16 +434,28 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) break; case NdbDictionary::Column::Longvarchar: { + out << fields_optionally_enclosed_by; unsigned len = uint2korr(r.aRef()); - ndbrecattr_print_string(out,"Longvarchar", r.aRef()+2,len); + ndbrecattr_print_string(out,f,"Longvarchar", false, r.aRef()+2,len); j = length; + out << fields_optionally_enclosed_by; + } + break; + case NdbDictionary::Column::Longvarbinary: + { + if (!f.hex_format) + out << fields_optionally_enclosed_by; + unsigned len = uint2korr(r.aRef()); + ndbrecattr_print_string(out,f,"Longvarbinary", true, r.aRef()+2,len); + j = length; + if (!f.hex_format) + out << fields_optionally_enclosed_by; } break; case NdbDictionary::Column::Undefined: case NdbDictionary::Column::Mediumint: case NdbDictionary::Column::Mediumunsigned: - case NdbDictionary::Column::Longvarbinary: unknown: //default: /* no print functions for the rest, just print type */ out << (int) r.getType(); @@ -386,16 +464,17 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) out << " " << j << " times"; break; } - } - - if (length > 1) - { - out << "]"; + out << f.fields_enclosed_by; } return out; } +NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) +{ + return ndbrecattr_print_formatted(out, r, default_print_format); +} + Int64 NdbRecAttr::int64_value() const { diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index 8b2e9a799a4..7ca7e91acf0 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -23,6 +23,8 @@ #include #include +extern NdbRecordPrintFormat g_ndbrecord_print_format; + Uint16 Twiddle16(Uint16 in); // Byte shift 16-bit data Uint32 Twiddle32(Uint32 in); // Byte shift 32-bit data Uint64 Twiddle64(Uint64 in); // Byte shift 64-bit data @@ -118,6 +120,8 @@ RestoreMetaData::loadContent() return 0; } } + if (! markSysTables()) + return 0; if(!readGCPEntry()) return 0; @@ -175,6 +179,49 @@ RestoreMetaData::readMetaTableDesc() { return parseTableDescriptor((Uint32*)ptr, len); } +bool +RestoreMetaData::markSysTables() +{ + Uint32 i; + for (i = 0; i < getNoOfTables(); i++) { + TableS* table = allTables[i]; + table->m_local_id = i; + const char* tableName = table->getTableName(); + if ( // XXX should use type + strcmp(tableName, "SYSTAB_0") == 0 || + strcmp(tableName, "NDB$EVENTS_0") == 0 || + strcmp(tableName, "sys/def/SYSTAB_0") == 0 || + strcmp(tableName, "sys/def/NDB$EVENTS_0") == 0) + table->isSysTable = true; + } + for (i = 0; i < getNoOfTables(); i++) { + TableS* blobTable = allTables[i]; + const char* blobTableName = blobTable->getTableName(); + // yet another match blob + int cnt, id1, id2; + char buf[256]; + cnt = sscanf(blobTableName, "%[^/]/%[^/]/NDB$BLOB_%d_%d", + buf, buf, &id1, &id2); + if (cnt == 4) { + Uint32 j; + for (j = 0; j < getNoOfTables(); j++) { + TableS* table = allTables[j]; + if (table->getTableId() == (Uint32) id1) { + if (table->isSysTable) + blobTable->isSysTable = true; + blobTable->m_main_table = table; + break; + } + } + if (j == getNoOfTables()) { + err << "Restore: Bad primary table id in " << blobTableName << endl; + return false; + } + } + } + return true; +} + bool RestoreMetaData::readGCPEntry() { @@ -259,6 +306,8 @@ TableS::TableS(Uint32 version, NdbTableImpl* tableImpl) m_max_auto_val= 0; m_noOfRecords= 0; backupVersion = version; + isSysTable = false; + m_main_table = NULL; for (int i = 0; i < tableImpl->getNoOfColumns(); i++) createAttr(tableImpl->getColumn(i)); @@ -704,6 +753,7 @@ bool RestoreDataIterator::readFragmentHeader(int & ret) return false; } + info.setLevel(254); info << "_____________________________________________________" << endl << "Processing data in table: " << m_currentTable->getTableName() << "(" << Header.TableId << ") fragment " @@ -924,13 +974,13 @@ operator<<(NdbOut& ndbout, const AttributeS& attr){ if (data.null) { - ndbout << ""; + ndbout << g_ndbrecord_print_format.null_string; return ndbout; } NdbRecAttr tmprec(0); tmprec.setup(desc.m_column, (char *)data.void_value); - ndbout << tmprec; + ndbrecattr_print_formatted(ndbout, tmprec, g_ndbrecord_print_format); return ndbout; } @@ -939,17 +989,15 @@ operator<<(NdbOut& ndbout, const AttributeS& attr){ NdbOut& operator<<(NdbOut& ndbout, const TupleS& tuple) { - ndbout << tuple.getTable()->getTableName() << "; "; for (int i = 0; i < tuple.getNoOfAttributes(); i++) { + if (i > 0) + ndbout << g_ndbrecord_print_format.fields_terminated_by; AttributeData * attr_data = tuple.getData(i); const AttributeDesc * attr_desc = tuple.getDesc(i); const AttributeS attr = {attr_desc, *attr_data}; debug << i << " " << attr_desc->m_column->getName(); ndbout << attr; - - if (i != (tuple.getNoOfAttributes() - 1)) - ndbout << delimiter << " "; } // for return ndbout; } diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index b132dda374d..afffc1a7b1e 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -25,8 +25,6 @@ #include #include -static const char * delimiter = ";"; // Delimiter in file dump - const int FileNameLenC = 256; const int TableNameLenC = 256; const int AttrNameLenC = 256; @@ -143,6 +141,10 @@ class TableS { int pos; + bool isSysTable; + TableS *m_main_table; + Uint32 m_local_id; + Uint64 m_noOfRecords; Vector m_fragmentInfo; @@ -156,6 +158,9 @@ public: Uint32 getTableId() const { return m_dictTable->getTableId(); } + Uint32 getLocalId() const { + return m_local_id; + } Uint32 getNoOfRecords() const { return m_noOfRecords; } @@ -235,6 +240,14 @@ public: return allAttributesDesc[attributeId]; } + bool getSysTable() const { + return isSysTable; + } + + const TableS *getMainTable() const { + return m_main_table; + } + TableS& operator=(TableS& org) ; }; // TableS; @@ -285,6 +298,7 @@ class RestoreMetaData : public BackupFile { Vector allTables; bool readMetaFileHeader(); bool readMetaTableDesc(); + bool markSysTables(); bool readGCPEntry(); bool readFragmentInfo(); diff --git a/ndb/tools/restore/consumer_printer.cpp b/ndb/tools/restore/consumer_printer.cpp index 8fe9805c39c..e0525522284 100644 --- a/ndb/tools/restore/consumer_printer.cpp +++ b/ndb/tools/restore/consumer_printer.cpp @@ -14,6 +14,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "consumer_printer.hpp" +extern FilteredNdbOut info; +extern NdbRecordPrintFormat g_ndbrecord_print_format; +extern const char *tab_path; bool BackupPrinter::table(const TableS & tab) @@ -21,7 +24,8 @@ BackupPrinter::table(const TableS & tab) if (m_print || m_print_meta) { m_ndbout << tab; - ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName()); + info.setLevel(254); + info << "Successfully printed table: ", tab.m_dictTable->getName(); } return true; } @@ -31,7 +35,14 @@ BackupPrinter::tuple(const TupleS & tup) { m_dataCount++; if (m_print || m_print_data) - m_ndbout << tup << endl; + { + if (m_ndbout.m_out == info.m_out) + { + info.setLevel(254); + info << tup.getTable()->getTableName() << "; "; + } + m_ndbout << tup << g_ndbrecord_print_format.lines_terminated_by; + } } void @@ -47,8 +58,9 @@ BackupPrinter::endOfLogEntrys() { if (m_print || m_print_log) { - ndbout << "Printed " << m_dataCount << " tuples and " - << m_logCount << " log entries" - << " to stdout." << endl; + info.setLevel(254); + info << "Printed " << m_dataCount << " tuples and " + << m_logCount << " log entries" + << " to stdout." << endl; } } diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index 0110782ff39..5f31a86e270 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -18,7 +18,9 @@ #include #include #include +#include #include +#include #include #include "consumer_restore.hpp" @@ -33,8 +35,18 @@ static int ga_nParallelism = 128; static int ga_backupId = 0; static bool ga_dont_ignore_systab_0 = false; static Vector g_consumers; +static BackupPrinter* g_printer = NULL; -static const char* ga_backupPath = "." DIR_SEPARATOR; +static const char* default_backupPath = "." DIR_SEPARATOR; +static const char* ga_backupPath = default_backupPath; + +const char *opt_ndb_database= NULL; +const char *opt_ndb_table= NULL; +unsigned int opt_verbose; +unsigned int opt_hex_format; +Vector g_databases; +Vector g_tables; +NdbRecordPrintFormat g_ndbrecord_print_format; NDB_STD_OPTS_VARS; @@ -53,6 +65,32 @@ BaseString g_options("ndb_restore"); const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 }; +enum ndb_restore_options { + OPT_PRINT= NDB_STD_OPTIONS_LAST, + OPT_PRINT_DATA, + OPT_PRINT_LOG, + OPT_PRINT_META, + OPT_BACKUP_PATH, + OPT_HEX_FORMAT, + OPT_FIELDS_ENCLOSED_BY, + OPT_FIELDS_TERMINATED_BY, + OPT_FIELDS_OPTIONALLY_ENCLOSED_BY, + OPT_LINES_TERMINATED_BY, + OPT_APPEND, + OPT_VERBOSE +}; +/* + the below formatting options follow the formatting from mysqldump + do not change unless to adopt to changes in mysqldump +*/ +static const char *opt_fields_enclosed_by= ""; +static const char *opt_fields_terminated_by= ";"; +static const char *opt_fields_optionally_enclosed_by= ""; +static const char *opt_lines_terminated_by= "\n"; + +static const char *tab_path= NULL; +static int opt_append; + static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_restore"), @@ -78,22 +116,56 @@ static struct my_option my_long_options[] = "(parallelism can be 1 to 1024)", (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0, GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 }, - { "print", 256, "Print data and log to stdout", + { "print", OPT_PRINT, "Print data and log to stdout", (gptr*) &_print, (gptr*) &_print, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "print_data", 257, "Print data to stdout", + { "print_data", OPT_PRINT_DATA, "Print data to stdout", (gptr*) &_print_data, (gptr*) &_print_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "print_meta", 258, "Print meta data to stdout", + { "print_meta", OPT_PRINT_META, "Print meta data to stdout", (gptr*) &_print_meta, (gptr*) &_print_meta, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "print_log", 259, "Print log to stdout", + { "print_log", OPT_PRINT_LOG, "Print log to stdout", (gptr*) &_print_log, (gptr*) &_print_log, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "backup_path", OPT_BACKUP_PATH, "Path to backup files", + (gptr*) &ga_backupPath, (gptr*) &ga_backupPath, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "dont_ignore_systab_0", 'f', "Experimental. Do not ignore system table during restore.", (gptr*) &ga_dont_ignore_systab_0, (gptr*) &ga_dont_ignore_systab_0, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "fields-enclosed-by", OPT_FIELDS_ENCLOSED_BY, + "Fields are enclosed by ...", + (gptr*) &opt_fields_enclosed_by, (gptr*) &opt_fields_enclosed_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "fields-terminated-by", OPT_FIELDS_TERMINATED_BY, + "Fields are terminated by ...", + (gptr*) &opt_fields_terminated_by, + (gptr*) &opt_fields_terminated_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "fields-optionally-enclosed-by", OPT_FIELDS_OPTIONALLY_ENCLOSED_BY, + "Fields are optionally enclosed by ...", + (gptr*) &opt_fields_optionally_enclosed_by, + (gptr*) &opt_fields_optionally_enclosed_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "hex", OPT_HEX_FORMAT, "print binary types in hex format", + (gptr*) &opt_hex_format, (gptr*) &opt_hex_format, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "tab", 'T', "Creates tab separated textfile for each table to " + "given path. (creates .txt files)", + (gptr*) &tab_path, (gptr*) &tab_path, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "append", OPT_APPEND, "for --tab append data to file", + (gptr*) &opt_append, (gptr*) &opt_append, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "lines-terminated-by", OPT_LINES_TERMINATED_BY, "", + (gptr*) &opt_lines_terminated_by, (gptr*) &opt_lines_terminated_by, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "verbose", OPT_VERBOSE, + "verbosity", + (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0, + GET_INT, REQUIRED_ARG, 1, 0, 255, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -119,19 +191,26 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), #endif ndb_std_get_one_option(optid, opt, argument); switch (optid) { + case OPT_VERBOSE: + info.setThreshold(255-opt_verbose); + break; case 'n': if (ga_nodeId == 0) { - printf("Error in --nodeid,-n setting, see --help\n"); + err << "Error in --nodeid,-n setting, see --help"; exit(NDBT_ProgramExit(NDBT_WRONGARGS)); } + info.setLevel(254); + info << "Nodeid = " << ga_nodeId << endl; break; case 'b': if (ga_backupId == 0) { - printf("Error in --backupid,-b setting, see --help\n"); + err << "Error in --backupid,-b setting, see --help"; exit(NDBT_ProgramExit(NDBT_WRONGARGS)); } + info.setLevel(254); + info << "Backup Id = " << ga_backupId << endl; break; } return 0; @@ -139,20 +218,26 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), bool readArguments(int *pargc, char*** pargv) { + Uint32 i; + debug << "Load defaults" << endl; + const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 }; + load_defaults("my",load_default_groups,pargc,pargv); + debug << "handle_options" << endl; if (handle_options(pargc, pargv, my_long_options, get_one_option)) { exit(NDBT_ProgramExit(NDBT_WRONGARGS)); } - BackupPrinter* printer = new BackupPrinter(); - if (printer == NULL) + g_printer = new BackupPrinter(); + if (g_printer == NULL) return false; BackupRestore* restore = new BackupRestore(ga_nParallelism); if (restore == NULL) { - delete printer; + delete g_printer; + g_printer = NULL; return false; } @@ -160,22 +245,22 @@ readArguments(int *pargc, char*** pargv) { ga_print = true; ga_restore = true; - printer->m_print = true; + g_printer->m_print = true; } if (_print_meta) { ga_print = true; - printer->m_print_meta = true; + g_printer->m_print_meta = true; } if (_print_data) { ga_print = true; - printer->m_print_data = true; + g_printer->m_print_data = true; } if (_print_log) { ga_print = true; - printer->m_print_log = true; + g_printer->m_print_log = true; } if (_restore_data) @@ -191,19 +276,64 @@ readArguments(int *pargc, char*** pargv) } { - BackupConsumer * c = printer; + BackupConsumer * c = g_printer; g_consumers.push_back(c); } { BackupConsumer * c = restore; g_consumers.push_back(c); } - // Set backup file path - if (*pargv[0] != NULL) + for (;;) { - ga_backupPath = *pargv[0]; + int i= 0; + if (ga_backupPath == default_backupPath) + { + // Set backup file path + if ((*pargv)[i] == NULL) + break; + ga_backupPath = (*pargv)[i++]; + } + if ((*pargv)[i] == NULL) + break; + g_databases.push_back((*pargv)[i++]); + while ((*pargv)[i] != NULL) + { + g_tables.push_back((*pargv)[i++]); + } + break; } - + info.setLevel(254); + info << "backup path = " << ga_backupPath << endl; + if (g_databases.size() > 0) + { + info << "Restoring only from database " << g_databases[0].c_str() << endl; + if (g_tables.size() > 0) + info << "Restoring only tables:"; + for (unsigned i= 0; i < g_tables.size(); i++) + { + info << " " << g_tables[i].c_str(); + } + if (g_tables.size() > 0) + info << endl; + } + /* + the below formatting follows the formatting from mysqldump + do not change unless to adopt to changes in mysqldump + */ + g_ndbrecord_print_format.fields_enclosed_by= + opt_fields_enclosed_by; + g_ndbrecord_print_format.fields_terminated_by= + opt_fields_terminated_by; + g_ndbrecord_print_format.fields_optionally_enclosed_by= + opt_fields_optionally_enclosed_by; + g_ndbrecord_print_format.lines_terminated_by= + opt_lines_terminated_by; + if (g_ndbrecord_print_format.fields_optionally_enclosed_by[0] == '\0') + g_ndbrecord_print_format.null_string= "\\N"; + else + g_ndbrecord_print_format.null_string= ""; + g_ndbrecord_print_format.hex_prefix= ""; + g_ndbrecord_print_format.hex_format= opt_hex_format; return true; } @@ -215,14 +345,81 @@ clearConsumers() g_consumers.clear(); } -static bool -checkSysTable(const char *tableName) +static inline bool +checkSysTable(const TableS* table) { - return ga_dont_ignore_systab_0 || - (strcmp(tableName, "SYSTAB_0") != 0 && - strcmp(tableName, "NDB$EVENTS_0") != 0 && - strcmp(tableName, "sys/def/SYSTAB_0") != 0 && - strcmp(tableName, "sys/def/NDB$EVENTS_0") != 0); + return ga_dont_ignore_systab_0 || ! table->getSysTable(); +} + +static inline bool +checkSysTable(const RestoreMetaData& metaData, uint i) +{ + assert(i < metaData.getNoOfTables()); + return checkSysTable(metaData[i]); +} + +static inline bool +isBlobTable(const TableS* table) +{ + return table->getMainTable() != NULL; +} + +static inline bool +isIndex(const TableS* table) +{ + const NdbTableImpl & tmptab = NdbTableImpl::getImpl(* table->m_dictTable); + return (int) tmptab.m_indexType != (int) NdbDictionary::Index::Undefined; +} + +static inline bool +checkDbAndTableName(const TableS* table) +{ + if (g_tables.size() == 0 && + g_databases.size() == 0) + return true; + if (g_databases.size() == 0) + g_databases.push_back("TEST_DB"); + + // Filter on the main table name for indexes and blobs + const char *table_name; + if (isBlobTable(table)) + table_name= table->getMainTable()->getTableName(); + else if (isIndex(table)) + table_name= + NdbTableImpl::getImpl(*table->m_dictTable).m_primaryTable.c_str(); + else + table_name= table->getTableName(); + + unsigned i; + for (i= 0; i < g_databases.size(); i++) + { + if (strncmp(table_name, g_databases[i].c_str(), + g_databases[i].length()) == 0 && + table_name[g_databases[i].length()] == '/') + { + // we have a match + if (g_databases.size() > 1 || g_tables.size() == 0) + return true; + break; + } + } + if (i == g_databases.size()) + return false; // no match found + + while (*table_name != '/') table_name++; + table_name++; + while (*table_name != '/') table_name++; + table_name++; + + for (i= 0; i < g_tables.size(); i++) + { + if (strcmp(table_name, g_tables[i].c_str()) == 0) + { + // we have a match + return true; + } + } + return false; } static void @@ -247,6 +444,7 @@ main(int argc, char** argv) { NDB_INIT(argv[0]); + debug << "Start readArguments" << endl; if (!readArguments(&argc, &argv)) { exitHandler(NDBT_FAILED); @@ -265,10 +463,11 @@ main(int argc, char** argv) /** * we must always load meta data, even if we will only print it to stdout */ + debug << "Start restoring meta data" << endl; RestoreMetaData metaData(ga_backupPath, ga_nodeId, ga_backupId); if (!metaData.readHeader()) { - ndbout << "Failed to read " << metaData.getFilename() << endl << endl; + err << "Failed to read " << metaData.getFilename() << endl << endl; exitHandler(NDBT_FAILED); } @@ -276,66 +475,108 @@ main(int argc, char** argv) const Uint32 version = tmp.NdbVersion; char buf[NDB_VERSION_STRING_BUF_SZ]; - ndbout << "Ndb version in backup files: " - << getVersionString(version, 0, buf, sizeof(buf)) << endl; + info.setLevel(254); + info << "Ndb version in backup files: " + << getVersionString(version, 0, buf, sizeof(buf)) << endl; /** * check wheater we can restore the backup (right version). */ + if (version > NDB_VERSION) + { + err << "Restore program older than backup version. Not supported. " + << "Use new restore program" << endl; + exitHandler(NDBT_FAILED); + } + + debug << "Load content" << endl; int res = metaData.loadContent(); if (res == 0) { - ndbout_c("Restore: Failed to load content"); + err << "Restore: Failed to load content" << endl; exitHandler(NDBT_FAILED); } - + debug << "Get no of Tables" << endl; if (metaData.getNoOfTables() == 0) { - ndbout_c("Restore: The backup contains no tables "); + err << "The backup contains no tables" << endl; exitHandler(NDBT_FAILED); } - + debug << "Validate Footer" << endl; if (!metaData.validateFooter()) { - ndbout_c("Restore: Failed to validate footer."); + err << "Restore: Failed to validate footer." << endl; exitHandler(NDBT_FAILED); } - + debug << "Init Backup objects" << endl; Uint32 i; for(i= 0; i < g_consumers.size(); i++) { if (!g_consumers[i]->init()) { clearConsumers(); + err << "Failed to initialize consumers" << endl; exitHandler(NDBT_FAILED); } } + Vector table_output(metaData.getNoOfTables()); + debug << "Restoring tables" << endl; for(i = 0; igetTableName())) + const TableS *table= metaData[i]; + table_output.push_back(NULL); + if (!checkDbAndTableName(table)) + continue; + if (checkSysTable(table)) { + if (!tab_path || isBlobTable(table) || isIndex(table)) + { + table_output[i]= ndbout.m_out; + } + else + { + FILE* res; + char filename[FN_REFLEN], tmp_path[FN_REFLEN]; + const char *table_name; + table_name= table->getTableName(); + while (*table_name != '/') table_name++; + table_name++; + while (*table_name != '/') table_name++; + table_name++; + convert_dirname(tmp_path, tab_path, NullS); + res= my_fopen(fn_format(filename, table_name, tmp_path, ".txt", 4), + opt_append ? + O_WRONLY|O_APPEND|O_CREAT : + O_WRONLY|O_TRUNC|O_CREAT, + MYF(MY_WME)); + if (res == 0) + { + exitHandler(NDBT_FAILED); + } + FileOutputStream *f= new FileOutputStream(res); + table_output[i]= f; + } for(Uint32 j= 0; j < g_consumers.size(); j++) - if (!g_consumers[j]->table(* metaData[i])) + if (!g_consumers[j]->table(* table)) { - ndbout_c("Restore: Failed to restore table: %s. " - "Exiting...", - metaData[i]->getTableName()); + err << "Restore: Failed to restore table: "; + err << table->getTableName() << " ... Exiting " << endl; exitHandler(NDBT_FAILED); - } + } } } - + debug << "Close tables" << endl; for(i= 0; i < g_consumers.size(); i++) if (!g_consumers[i]->endOfTables()) { - ndbout_c("Restore: Failed while closing tables"); + err << "Restore: Failed while closing tables" << endl; exitHandler(NDBT_FAILED); } - + debug << "Iterate over data" << endl; if (ga_restore || ga_print) { if(_restore_data || _print_data) @@ -345,7 +586,7 @@ main(int argc, char** argv) // Read data file header if (!dataIter.readHeader()) { - ndbout << "Failed to read header of data file. Exiting..." ; + err << "Failed to read header of data file. Exiting..." << endl; exitHandler(NDBT_FAILED); } @@ -355,20 +596,26 @@ main(int argc, char** argv) const TupleS* tuple; while ((tuple = dataIter.getNextTuple(res= 1)) != 0) { - if (checkSysTable(tuple->getTable()->getTableName())) - for(Uint32 i= 0; i < g_consumers.size(); i++) - g_consumers[i]->tuple(* tuple); + const TableS* table = tuple->getTable(); + OutputStream *output = table_output[table->getLocalId()]; + if (!output) + continue; + OutputStream *tmp = ndbout.m_out; + ndbout.m_out = output; + for(Uint32 i= 0; i < g_consumers.size(); i++) + g_consumers[i]->tuple(* tuple); + ndbout.m_out = tmp; } // while (tuple != NULL); if (res < 0) { - ndbout_c("Restore: An error occured while restoring data. " - "Exiting..."); + err <<" Restore: An error occured while restoring data. Exiting..."; + err << endl; exitHandler(NDBT_FAILED); } if (!dataIter.validateFragmentFooter()) { - ndbout_c("Restore: Error validating fragment footer. " - "Exiting..."); + err << "Restore: Error validating fragment footer. "; + err << "Exiting..." << endl; exitHandler(NDBT_FAILED); } } // while (dataIter.readFragmentHeader(res)) @@ -376,7 +623,7 @@ main(int argc, char** argv) if (res < 0) { err << "Restore: An error occured while restoring data. Exiting... " - << "res=" << res << endl; + << "res= " << res << endl; exitHandler(NDBT_FAILED); } @@ -399,9 +646,12 @@ main(int argc, char** argv) const LogEntry * logEntry = 0; while ((logEntry = logIter.getNextLogEntry(res= 0)) != 0) { - if (checkSysTable(logEntry->m_table->getTableName())) - for(Uint32 i= 0; i < g_consumers.size(); i++) - g_consumers[i]->logEntry(* logEntry); + const TableS* table = logEntry->m_table; + OutputStream *output = table_output[table->getLocalId()]; + if (!output) + continue; + for(Uint32 i= 0; i < g_consumers.size(); i++) + g_consumers[i]->logEntry(* logEntry); } if (res < 0) { @@ -418,17 +668,17 @@ main(int argc, char** argv) { for(i = 0; igetTableName())) - { - for(Uint32 j= 0; j < g_consumers.size(); j++) - if (!g_consumers[j]->finalize_table(* metaData[i])) - { - ndbout_c("Restore: Failed to finalize restore table: %s. " - "Exiting...", - metaData[i]->getTableName()); - exitHandler(NDBT_FAILED); - } - } + const TableS* table = metaData[i]; + OutputStream *output = table_output[table->getLocalId()]; + if (!output) + continue; + for(Uint32 j= 0; j < g_consumers.size(); j++) + if (!g_consumers[j]->finalize_table(*table)) + { + err << "Restore: Failed to finalize restore table: %s. "; + err << "Exiting... " << metaData[i]->getTableName() << endl; + exitHandler(NDBT_FAILED); + } } } } @@ -439,12 +689,27 @@ main(int argc, char** argv) clearConsumers(); ndbout_c("\nRestore successful, but encountered temporary error, " "please look at configuration."); - return NDBT_ProgramExit(NDBT_TEMPORARY); + } + } + + clearConsumers(); + + for(i = 0; i < metaData.getNoOfTables(); i++) + { + if (table_output[i] && + table_output[i] != ndbout.m_out) + { + my_fclose(((FileOutputStream *)table_output[i])->getFile(), MYF(MY_WME)); + delete table_output[i]; + table_output[i] = NULL; } } - clearConsumers(); - return NDBT_ProgramExit(NDBT_OK); + if (opt_verbose) + return NDBT_ProgramExit(NDBT_OK); + else + return 0; } // main template class Vector; +template class Vector; From 2d797068f1b7bc65595eba7d1aea12547520d241 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 13:19:37 +0700 Subject: [PATCH 056/789] Bug#26899 ndb_restore cannot restore selected tables and databases Bug#26900 ndb_restore printout option does not give structured data - test cases --- mysql-test/include/ndb_backup.inc | 24 ++++ mysql-test/include/ndb_backup_print.inc | 6 + mysql-test/r/ndb_restore_print.result | 124 +++++++++++++++++++++ mysql-test/t/ndb_restore_print.test | 140 ++++++++++++++++++++++++ 4 files changed, 294 insertions(+) create mode 100644 mysql-test/include/ndb_backup.inc create mode 100644 mysql-test/include/ndb_backup_print.inc create mode 100644 mysql-test/r/ndb_restore_print.result create mode 100644 mysql-test/t/ndb_restore_print.test diff --git a/mysql-test/include/ndb_backup.inc b/mysql-test/include/ndb_backup.inc new file mode 100644 index 00000000000..f0a883d4e11 --- /dev/null +++ b/mysql-test/include/ndb_backup.inc @@ -0,0 +1,24 @@ +###################################################### +# By JBM 2006-02-16 So that the code is not repeated # +# in test cases and can be reused. # +###################################################### +--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT + +# there is no neat way to find the backupid, this is a hack to find it... + +--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat + +CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; + +DELETE FROM test.backup_info; + +LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; + +--replace_column 1 + +SELECT @the_backup_id:=backup_id FROM test.backup_info; + +let the_backup_id=`select @the_backup_id`; + +DROP TABLE test.backup_info; + diff --git a/mysql-test/include/ndb_backup_print.inc b/mysql-test/include/ndb_backup_print.inc new file mode 100644 index 00000000000..57fb279491c --- /dev/null +++ b/mysql-test/include/ndb_backup_print.inc @@ -0,0 +1,6 @@ +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat +--exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat +--exec rm -f $MYSQLTEST_VARDIR/tmp/tmp.dat +--let ndb_restore_opts= +--let ndb_restore_filter= diff --git a/mysql-test/r/ndb_restore_print.result b/mysql-test/r/ndb_restore_print.result new file mode 100644 index 00000000000..006fd233ebb --- /dev/null +++ b/mysql-test/r/ndb_restore_print.result @@ -0,0 +1,124 @@ +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +create table t1 +(pk int key +,a1 BIT(1), a2 BIT(5), a3 BIT(33), a4 BIT(63), a5 BIT(64) +,b1 TINYINT, b2 TINYINT UNSIGNED +,c1 SMALLINT, c2 SMALLINT UNSIGNED +,d1 INT, d2 INT UNSIGNED +,e1 BIGINT, e2 BIGINT UNSIGNED +,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY +,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY +,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255) +,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000) +) engine ndb; +insert into t1 values +(1 +,0x1, 0x17, 0x789a, 0x789abcde, 0xfedc0001 +,127, 255 +,32767, 65535 +,2147483647, 4294967295 +,9223372036854775807, 18446744073709551615 +,'1','12345678901234567890123456789012','123456789' + ,'1','12345678901234567890123456789012','123456789' + ,0x12,0x123456789abcdef0, 0x012345 +,0x12,0x123456789abcdef0, 0x00123450 +); +insert into t1 values +(2 +,0, 0, 0, 0, 0 +,-128, 0 +,-32768, 0 +,-2147483648, 0 +,-9223372036854775808, 0 +,'','','' + ,'','','' + ,0x0,0x0,0x0 +,0x0,0x0,0x0 +); +insert into t1 values +(3 +,NULL,NULL,NULL,NULL,NULL +,NULL,NULL +,NULL,NULL +,NULL,NULL +,NULL,NULL +,NULL,NULL,NULL +,NULL,NULL,NULL +,NULL,NULL,NULL +,NULL,NULL,NULL +); +CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; +DELETE FROM test.backup_info; +LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; +SELECT @the_backup_id:=backup_id FROM test.backup_info; +@the_backup_id:=backup_id + +DROP TABLE test.backup_info; +1;0x1;0x17;0x789A;0x789ABCDE;0xFEDC0001;127;255;32767;65535;2147483647;4294967295;9223372036854775807;18446744073709551615;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x12;0x123456789ABCDEF0;0x012345;0x12;0x123456789ABCDEF0;0x00123450 +2;0x0;0x0;0x0;0x0;0x0;-128;0;-32768;0;-2147483648;0;-9223372036854775808;0;;;;;;;0x0;0x0;0x0;0x0;0x0;0x0 +3;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N +1,0x1,0x17,0x789A,0x789ABCDE,0xFEDC0001,127,255,32767,65535,2147483647,4294967295,9223372036854775807,18446744073709551615,'1','12345678901234567890123456789012','123456789','1','12345678901234567890123456789012','123456789',0x12,0x123456789ABCDEF0,0x012345,0x12,0x123456789ABCDEF0,0x00123450 +2,0x0,0x0,0x0,0x0,0x0,-128,0,-32768,0,-2147483648,0,-9223372036854775808,0,'','','','','','',0x0,0x0,0x0,0x0,0x0,0x0 +3,,,,,,,,,,,,,,,,,,,,,,,,, +drop table t1; +create table t1 +(pk int key +,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY +,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY +,h1 BINARY(1), h2 BINARY(9), h3 BINARY(255) +,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000) +) engine ndb; +insert into t1 values +(1 +,'1','12345678901234567890123456789012','123456789 ' + ,'1 ','12345678901234567890123456789012 ','123456789 ' + ,0x20,0x123456789abcdef020, 0x012345000020 +,0x1200000020,0x123456789abcdef000000020, 0x00123450000020 +); +create table t2 (pk int key, a int) engine ndb; +create table t3 (pk int key, a int) engine ndb; +create table t4 (pk int key, a int) engine ndb; +insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15); +insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25); +insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35); +CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; +DELETE FROM test.backup_info; +LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; +SELECT @the_backup_id:=backup_id FROM test.backup_info; +@the_backup_id:=backup_id + +DROP TABLE test.backup_info; +'1';'1';'12345678901234567890123456789012';'123456789';'1';'12345678901234567890123456789012';'123456789';'0x20';'0x123456789ABCDEF020';'0x012345000020';'0x1200000020';'0x123456789ABCDEF000000020';'0x00123450000020' + +t1 +-- +1;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x20;0x123456789ABCDEF020;0x012345000020;0x1200000020;0x123456789ABCDEF000000020;0x00123450000020 + +t2 +-- +1;11 +2;12 +3;13 +4;14 +5;15 + +t3 +-- +1;21 +2;22 +3;23 +4;24 +5;25 + +t4 +-- +1;31 +2;32 +3;33 +4;34 +5;35 +drop table t1; +drop table t2; +drop table t3; +drop table t4; diff --git a/mysql-test/t/ndb_restore_print.test b/mysql-test/t/ndb_restore_print.test new file mode 100644 index 00000000000..5821813a3b1 --- /dev/null +++ b/mysql-test/t/ndb_restore_print.test @@ -0,0 +1,140 @@ +-- source include/have_ndb.inc +-- source include/ndb_default_cluster.inc +-- source include/not_embedded.inc + +--disable_warnings +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +--enable_warnings + +# basic datatypes +create table t1 + (pk int key + ,a1 BIT(1), a2 BIT(5), a3 BIT(33), a4 BIT(63), a5 BIT(64) + ,b1 TINYINT, b2 TINYINT UNSIGNED + ,c1 SMALLINT, c2 SMALLINT UNSIGNED + ,d1 INT, d2 INT UNSIGNED + ,e1 BIGINT, e2 BIGINT UNSIGNED + ,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY + ,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY + ,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255) + ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000) + ) engine ndb; + +# max values +insert into t1 values + (1 + ,0x1, 0x17, 0x789a, 0x789abcde, 0xfedc0001 + ,127, 255 + ,32767, 65535 + ,2147483647, 4294967295 + ,9223372036854775807, 18446744073709551615 + ,'1','12345678901234567890123456789012','123456789' + ,'1','12345678901234567890123456789012','123456789' + ,0x12,0x123456789abcdef0, 0x012345 + ,0x12,0x123456789abcdef0, 0x00123450 + ); + +# min values +insert into t1 values + (2 + ,0, 0, 0, 0, 0 + ,-128, 0 + ,-32768, 0 + ,-2147483648, 0 + ,-9223372036854775808, 0 + ,'','','' + ,'','','' + ,0x0,0x0,0x0 + ,0x0,0x0,0x0 + ); + +# null values +insert into t1 values + (3 + ,NULL,NULL,NULL,NULL,NULL + ,NULL,NULL + ,NULL,NULL + ,NULL,NULL + ,NULL,NULL + ,NULL,NULL,NULL + ,NULL,NULL,NULL + ,NULL,NULL,NULL + ,NULL,NULL,NULL + ); + +--source include/ndb_backup.inc + +--let ndb_restore_filter=test t1 +--let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by=";" +--source include/ndb_backup_print.inc + +--let ndb_restore_filter=test t1 +--let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by="," --fields-optionally-enclosed-by="'" +--source include/ndb_backup_print.inc + + +drop table t1; + +# some binary char tests with trailing spaces +create table t1 + (pk int key + ,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY + ,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY + ,h1 BINARY(1), h2 BINARY(9), h3 BINARY(255) + ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000) + ) engine ndb; + +insert into t1 values + (1 + ,'1','12345678901234567890123456789012','123456789 ' + ,'1 ','12345678901234567890123456789012 ','123456789 ' + ,0x20,0x123456789abcdef020, 0x012345000020 + ,0x1200000020,0x123456789abcdef000000020, 0x00123450000020 + ); + +create table t2 (pk int key, a int) engine ndb; +create table t3 (pk int key, a int) engine ndb; +create table t4 (pk int key, a int) engine ndb; + +insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15); +insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25); +insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35); + +--source include/ndb_backup.inc +--let ndb_restore_opts=--verbose=0 --print_data --hex --fields-enclosed-by="'" --fields-optionally-enclosed-by="X" +--let ndb_restore_filter=test t1 +--source include/ndb_backup_print.inc + +--exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt +--exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt +--exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt +--exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt + +--let ndb_restore_opts=--verbose=0 --print_data --hex --tab $MYSQLTEST_VARDIR/tmp --append +--let ndb_restore_filter=test +--source include/ndb_backup_print.inc + +--let $message= t1 +--source include/show_msg.inc +--exec sort $MYSQLTEST_VARDIR/tmp/t1.txt +--let $message= t2 +--source include/show_msg.inc +--exec sort $MYSQLTEST_VARDIR/tmp/t2.txt +--let $message= t3 +--source include/show_msg.inc +--exec sort $MYSQLTEST_VARDIR/tmp/t3.txt +--let $message= t4 +--source include/show_msg.inc +--exec sort $MYSQLTEST_VARDIR/tmp/t4.txt + +--exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt +--exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt +--exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt +--exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt + +# clean up +drop table t1; +drop table t2; +drop table t3; +drop table t4; From 98938dd61603b2d60de9f73d68e4a8e091ab975b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 14:20:37 +0700 Subject: [PATCH 057/789] corrected manual merge --- storage/ndb/tools/restore/restore_main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp index fa123bb3fb9..1bf09acb99a 100644 --- a/storage/ndb/tools/restore/restore_main.cpp +++ b/storage/ndb/tools/restore/restore_main.cpp @@ -350,6 +350,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), to nodegroup in new cluster. */ opt_nodegroup_map_len= 0; + + info.setLevel(254); info << "Analyse node group map" << endl; if (analyse_nodegroup_map(opt_nodegroup_map_str, &opt_nodegroup_map[0])) @@ -404,8 +406,8 @@ o verify nodegroup mapping exit(NDBT_ProgramExit(NDBT_WRONGARGS)); #endif - BackupPrinter* g_printer = new BackupPrinter(opt_nodegroup_map, - opt_nodegroup_map_len); + g_printer = new BackupPrinter(opt_nodegroup_map, + opt_nodegroup_map_len); if (g_printer == NULL) return false; @@ -785,10 +787,10 @@ main(int argc, char** argv) } } else { for(Uint32 j= 0; j < g_consumers.size(); j++) - if (!g_consumers[j]->createSystable(* metaData[i])) + if (!g_consumers[j]->createSystable(* table)) { err << "Restore: Failed to restore system table: "; - err << metaData[i]->getTableName() << " ... Exiting " << endl; + err << table->getTableName() << " ... Exiting " << endl; exitHandler(NDBT_FAILED); } } From a2f9bceac09b04352020478ac8d2ed8eb951b8e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 11:54:32 +0100 Subject: [PATCH 058/789] BUG#22583 (RBR between MyISAM and non-MyISAM tables does not work): Post-merge fixes. mysql-test/extra/binlog_tests/binlog.test: Binlog position change mysql-test/extra/binlog_tests/binlog_insert_delayed.test: Binlog position change mysql-test/extra/binlog_tests/ctype_cp932_binlog.test: Binlog position change mysql-test/extra/binlog_tests/ctype_ucs_binlog.test: Binlog position change mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Binlog position change mysql-test/r/binlog_row_binlog.result: Result change mysql-test/r/binlog_row_ctype_ucs.result: Result change mysql-test/r/binlog_row_insert_select.result: Result change mysql-test/r/binlog_row_mix_innodb_myisam.result: Result change mysql-test/r/ctype_cp932_binlog_row.result: Result change mysql-test/r/flush_block_commit_notembedded.result: Result change mysql-test/r/rpl_row_create_table.result: Result change mysql-test/r/rpl_row_delayed_ins.result: Result change mysql-test/t/binlog_row_mix_innodb_myisam.test: Binlog position change mysql-test/t/rpl_row_create_table.test: Removing blinding of end_log_pos in SHOW BINLOG EVENTS output. Binlog position change. sql/log_event.cc: Post-merge fixes. --- mysql-test/extra/binlog_tests/binlog.test | 8 +- .../binlog_tests/binlog_insert_delayed.test | 2 +- .../binlog_tests/ctype_cp932_binlog.test | 2 +- .../extra/binlog_tests/ctype_ucs_binlog.test | 2 +- .../mix_innodb_myisam_binlog.test | 28 +++--- mysql-test/r/binlog_row_binlog.result | 10 +- mysql-test/r/binlog_row_ctype_ucs.result | 6 +- mysql-test/r/binlog_row_insert_select.result | 8 +- .../r/binlog_row_mix_innodb_myisam.result | 28 +++--- mysql-test/r/ctype_cp932_binlog_row.result | 2 +- .../r/flush_block_commit_notembedded.result | 4 +- mysql-test/r/rpl_row_create_table.result | 94 +++++++++---------- mysql-test/r/rpl_row_delayed_ins.result | 10 +- .../t/binlog_row_mix_innodb_myisam.test | 2 +- mysql-test/t/rpl_row_create_table.test | 13 ++- sql/log_event.cc | 37 ++++---- 16 files changed, 135 insertions(+), 121 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 48d9b859c26..a1f34606fe1 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -22,7 +22,7 @@ commit; # first COMMIT must be Query_log_event, second - Xid_log_event --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; drop table t1,t2; # @@ -44,10 +44,10 @@ commit; drop table t1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 105; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events in 'master-bin.000002' from 102; +show binlog events in 'master-bin.000002' from 105; # Test of a too big SET INSERT_ID: see if the truncated value goes # into binlog (right), or the too big value (wrong); we look at the @@ -69,7 +69,7 @@ create table if not exists t3 like tt1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; drop table t1,t2,t3,tt1; -- source extra/binlog_tests/binlog_insert_delayed.test diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test index 4da883b9e60..a2ccb34ee07 100644 --- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test +++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test @@ -25,7 +25,7 @@ inc $count; # the way --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; insert delayed into t1 values (null),(null),(null),(null); inc $count; inc $count; inc $count; inc $count; diff --git a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test index 5e93d6e126e..5c07b3b8f89 100644 --- a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test +++ b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test @@ -28,7 +28,7 @@ SET @var1= x'8300'; EXECUTE stmt1 USING @var1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 105; SELECT HEX(f1) FROM t1; DROP table t1; # end test for bug#11338 diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test index fcf39e38163..3b1ea3b959b 100644 --- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test +++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test @@ -10,7 +10,7 @@ set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index bdc49573ae5..2c6f66de8bc 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -31,7 +31,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; delete from t1; delete from t2; @@ -45,7 +45,7 @@ rollback; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; delete from t1; delete from t2; @@ -61,7 +61,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; delete from t1; delete from t2; @@ -79,7 +79,7 @@ select a from t1 order by a; # check that savepoints work :) --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; # and when ROLLBACK is not explicit? delete from t1; @@ -101,7 +101,7 @@ connection con2; select get_lock("a",10); --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; # and when not in a transact1on? delete from t1; @@ -113,7 +113,7 @@ insert into t2 select * from t1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; # Check that when the query updat1ng the MyISAM table is the first in the # transaction, we log it immediately. @@ -126,13 +126,13 @@ begin; insert into t2 select * from t1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; insert into t1 values(11); commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; # Check that things work like before this BEGIN/ROLLBACK code was added, @@ -151,7 +151,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; delete from t1; delete from t2; @@ -164,7 +164,7 @@ rollback; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; delete from t1; delete from t2; @@ -180,7 +180,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; delete from t1; delete from t2; @@ -198,7 +198,7 @@ select a from t1 order by a; # check that savepoints work :) --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; # Test for BUG#5714, where a MyISAM update in the transaction used to # release row-level locks in InnoDB @@ -259,7 +259,7 @@ connection con3; select get_lock("lock1",60); --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; do release_lock("lock1"); drop table t0,t2; @@ -326,7 +326,7 @@ SELECT * from t2; DROP TABLE t1,t2; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 105; # Test for BUG#16559 (ROLLBACK should always have a zero error code in # binlog). Has to be here and not earlier, as the SELECTs influence diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result index aee270bd7f6..4a0824e0aa3 100644 --- a/mysql-test/r/binlog_row_binlog.result +++ b/mysql-test/r/binlog_row_binlog.result @@ -8,7 +8,7 @@ commit; begin; insert t2 values (5); commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb @@ -26,7 +26,7 @@ create table t1 (n int) engine=innodb; begin; commit; drop table t1; -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb master-bin.000001 # Query 1 # use `test`; BEGIN @@ -232,7 +232,7 @@ master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Xid 1 # COMMIT /* xid= */ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002' from 102; +show binlog events in 'master-bin.000002' from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 reset master; @@ -249,7 +249,7 @@ create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -268,7 +268,7 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Table_map 1 # table_id: # (test.t1) diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/r/binlog_row_ctype_ucs.result index 4eeff79e13a..69fc0ab5781 100644 --- a/mysql-test/r/binlog_row_ctype_ucs.result +++ b/mysql-test/r/binlog_row_ctype_ucs.result @@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 102 Table_map 1 141 table_id: # (test.t2) -master-bin.000001 141 Write_rows 1 231 table_id: # flags: STMT_END_F +master-bin.000001 105 Table_map 1 144 table_id: # (test.t2) +master-bin.000001 144 Write_rows 1 234 table_id: # flags: STMT_END_F flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/r/binlog_row_insert_select.result b/mysql-test/r/binlog_row_insert_select.result index 14cef6709b6..12a9f05d84e 100644 --- a/mysql-test/r/binlog_row_insert_select.result +++ b/mysql-test/r/binlog_row_insert_select.result @@ -8,9 +8,9 @@ insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Table_map 1 141 table_id: # (test.t1) -master-bin.000001 141 Write_rows 1 175 table_id: # flags: STMT_END_F +master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 105 Table_map 1 144 table_id: # (test.t1) +master-bin.000001 144 Write_rows 1 178 table_id: # flags: STMT_END_F select * from t1; a 1 @@ -23,5 +23,5 @@ create table t2(unique(a)) select a from t1; ERROR 23000: Duplicate entry '1' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 drop table t1; diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/r/binlog_row_mix_innodb_myisam.result index 185ca33d4db..3ac5a63b93b 100644 --- a/mysql-test/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_row_mix_innodb_myisam.result @@ -6,7 +6,7 @@ begin; insert into t1 values(1); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -23,7 +23,7 @@ insert into t2 select * from t1; rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -43,7 +43,7 @@ rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -72,7 +72,7 @@ select a from t1 order by a; a 5 7 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -98,7 +98,7 @@ insert into t2 select * from t1; select get_lock("a",10); get_lock("a",10) 1 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -111,7 +111,7 @@ delete from t2; reset master; insert into t1 values(9); insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F @@ -124,7 +124,7 @@ reset master; insert into t1 values(10); begin; insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F @@ -133,7 +133,7 @@ master-bin.000001 # Table_map 1 # table_id: # (test.t2) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F insert into t1 values(11); commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F @@ -152,7 +152,7 @@ begin; insert into t1 values(12); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -167,7 +167,7 @@ begin; insert into t1 values(13); insert into t2 select * from t1; rollback; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; delete from t2; @@ -179,7 +179,7 @@ insert into t1 values(15); insert into t2 select * from t1; rollback to savepoint my_savepoint; commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -200,7 +200,7 @@ select a from t1 order by a; a 16 18 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -252,7 +252,7 @@ insert into t2 values (3); select get_lock("lock1",60); get_lock("lock1",60) 1 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -355,7 +355,7 @@ SELECT * from t2; a b 100 100 DROP TABLE t1,t2; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F diff --git a/mysql-test/r/ctype_cp932_binlog_row.result b/mysql-test/r/ctype_cp932_binlog_row.result index f1a64241fbb..9292be362af 100644 --- a/mysql-test/r/ctype_cp932_binlog_row.result +++ b/mysql-test/r/ctype_cp932_binlog_row.result @@ -6,7 +6,7 @@ CREATE TABLE t1(f1 blob); PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; SET @var1= x'8300'; EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) master-bin.000001 # Table_map 1 # table_id: # (test.t1) diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result index 1d045b21763..e49e8817967 100644 --- a/mysql-test/r/flush_block_commit_notembedded.result +++ b/mysql-test/r/flush_block_commit_notembedded.result @@ -5,11 +5,11 @@ insert t1 values (1); flush tables with read lock; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 105 commit; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 105 unlock tables; drop table t1; set autocommit=1; diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result index 7e03a75affd..d89afb3e5f3 100644 --- a/mysql-test/r/rpl_row_create_table.result +++ b/mysql-test/r/rpl_row_create_table.result @@ -13,25 +13,25 @@ Log_name # Pos 215 Event_type Query Server_id # -End_log_pos # +End_log_pos 308 Info use `test`; CREATE TABLE t1 (a INT, b INT) Log_name # Pos 308 Event_type Query Server_id # -End_log_pos # +End_log_pos 414 Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge Log_name # Pos 414 Event_type Query Server_id # -End_log_pos # +End_log_pos 520 Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8 Log_name # Pos 520 Event_type Query Server_id # -End_log_pos # +End_log_pos 639 Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8 **** On Master **** SHOW CREATE TABLE t1; @@ -127,7 +127,7 @@ NULL 5 10 NULL 6 12 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; ERROR 23000: Duplicate entry '2' for key 'b' -SHOW BINLOG EVENTS FROM 959; +SHOW BINLOG EVENTS FROM 1097; Log_name Pos Event_type Server_id End_log_pos Info CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; @@ -139,9 +139,9 @@ a b 3 6 SHOW BINLOG EVENTS FROM 1097; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1097 Query 1 1197 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) -master-bin.000001 1197 Table_map 1 1237 table_id: # (test.t7) -master-bin.000001 1237 Write_rows 1 1293 table_id: # flags: STMT_END_F +# 1097 Query # 1197 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) +# 1197 Table_map # 1237 table_id: # (test.t7) +# 1237 Write_rows # 1293 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -156,8 +156,8 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back SHOW BINLOG EVENTS FROM 1293; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1293 Table_map 1 1333 table_id: # (test.t7) -master-bin.000001 1333 Write_rows 1 1389 table_id: # flags: STMT_END_F +# 1293 Table_map # 1333 table_id: # (test.t7) +# 1333 Write_rows # 1389 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -194,8 +194,8 @@ Create Table CREATE TABLE `t9` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW BINLOG EVENTS FROM 1389; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1389 Query 1 1475 use `test`; CREATE TABLE t8 LIKE t4 -master-bin.000001 1475 Query 1 1614 use `test`; CREATE TABLE `t9` ( +# 1389 Query # 1475 use `test`; CREATE TABLE t8 LIKE t4 +# 1475 Query # 1614 use `test`; CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) @@ -274,33 +274,33 @@ a 3 SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) -master-bin.000001 227 Write_rows 1 271 table_id: # flags: STMT_END_F -master-bin.000001 271 Query 1 339 use `test`; BEGIN -master-bin.000001 339 Query 1 125 use `test`; CREATE TABLE `t2` ( +# 4 Format_desc # 105 Server ver: #, Binlog ver: # +# 105 Query # 191 use `test`; CREATE TABLE t1 (a INT) +# 191 Table_map # 230 table_id: # (test.t1) +# 230 Write_rows # 274 table_id: # flags: STMT_END_F +# 274 Query # 342 use `test`; BEGIN +# 342 Query # 125 use `test`; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -master-bin.000001 464 Table_map 1 164 table_id: # (test.t2) -master-bin.000001 503 Write_rows 1 208 table_id: # flags: STMT_END_F -master-bin.000001 547 Xid 1 574 COMMIT /* XID */ -master-bin.000001 574 Query 1 642 use `test`; BEGIN -master-bin.000001 642 Query 1 125 use `test`; CREATE TABLE `t3` ( +# 467 Table_map # 164 table_id: # (test.t2) +# 506 Write_rows # 208 table_id: # flags: STMT_END_F +# 550 Xid # 577 COMMIT /* XID */ +# 577 Query # 645 use `test`; BEGIN +# 645 Query # 125 use `test`; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -master-bin.000001 767 Table_map 1 164 table_id: # (test.t3) -master-bin.000001 806 Write_rows 1 208 table_id: # flags: STMT_END_F -master-bin.000001 850 Xid 1 877 COMMIT /* XID */ -master-bin.000001 877 Query 1 945 use `test`; BEGIN -master-bin.000001 945 Query 1 125 use `test`; CREATE TABLE `t4` ( +# 770 Table_map # 164 table_id: # (test.t3) +# 809 Write_rows # 208 table_id: # flags: STMT_END_F +# 853 Xid # 880 COMMIT /* XID */ +# 880 Query # 948 use `test`; BEGIN +# 948 Query # 125 use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -master-bin.000001 1070 Table_map 1 164 table_id: # (test.t4) -master-bin.000001 1109 Write_rows 1 208 table_id: # flags: STMT_END_F -master-bin.000001 1153 Xid 1 1180 COMMIT /* XID */ -master-bin.000001 1180 Table_map 1 1219 table_id: # (test.t1) -master-bin.000001 1219 Write_rows 1 1263 table_id: # flags: STMT_END_F +# 1073 Table_map # 164 table_id: # (test.t4) +# 1112 Write_rows # 208 table_id: # flags: STMT_END_F +# 1156 Xid # 1183 COMMIT /* XID */ +# 1183 Table_map # 1222 table_id: # (test.t1) +# 1222 Write_rows # 1266 table_id: # flags: STMT_END_F SHOW TABLES; Tables_in_test t1 @@ -365,17 +365,17 @@ a 9 SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) -master-bin.000001 227 Write_rows 1 271 table_id: # flags: STMT_END_F -master-bin.000001 271 Query 1 371 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB -master-bin.000001 371 Query 1 439 use `test`; BEGIN -master-bin.000001 439 Table_map 1 39 table_id: # (test.t2) -master-bin.000001 478 Write_rows 1 83 table_id: # flags: STMT_END_F -master-bin.000001 522 Table_map 1 122 table_id: # (test.t2) -master-bin.000001 561 Write_rows 1 161 table_id: # flags: STMT_END_F -master-bin.000001 600 Xid 1 627 COMMIT /* XID */ +# 4 Format_desc # 105 Server ver: #, Binlog ver: # +# 105 Query # 191 use `test`; CREATE TABLE t1 (a INT) +# 191 Table_map # 230 table_id: # (test.t1) +# 230 Write_rows # 274 table_id: # flags: STMT_END_F +# 274 Query # 374 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB +# 374 Query # 442 use `test`; BEGIN +# 442 Table_map # 39 table_id: # (test.t2) +# 481 Write_rows # 83 table_id: # flags: STMT_END_F +# 525 Table_map # 122 table_id: # (test.t2) +# 564 Write_rows # 161 table_id: # flags: STMT_END_F +# 603 Xid # 630 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a 1 @@ -394,10 +394,10 @@ INSERT INTO t2 SELECT a+2 FROM tt2; ROLLBACK; SELECT * FROM t2 ORDER BY a; a -SHOW BINLOG EVENTS FROM 627; +SHOW BINLOG EVENTS FROM 630; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 627 Query 1 80 use `test`; TRUNCATE TABLE t2 -master-bin.000001 707 Xid 1 734 COMMIT /* XID */ +# 630 Query # 80 use `test`; TRUNCATE TABLE t2 +# 710 Xid # 737 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a DROP TABLE t1,t2; diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/r/rpl_row_delayed_ins.result index cad38f77d52..e07a06f42fa 100644 --- a/mysql-test/r/rpl_row_delayed_ins.result +++ b/mysql-test/r/rpl_row_delayed_ins.result @@ -5,7 +5,9 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; create table t1(a int not null primary key) engine=myisam; -insert delayed into t1 values (1),(2),(3); +insert delayed into t1 values (1); +insert delayed into t1 values (2); +insert delayed into t1 values (3); flush tables; SELECT * FROM t1 ORDER BY a; a @@ -19,8 +21,10 @@ master-bin.000001 105 Query 1 225 use `test`; create table t1(a int not null pri master-bin.000001 225 Table_map 1 264 table_id: # (test.t1) master-bin.000001 264 Write_rows 1 298 table_id: # flags: STMT_END_F master-bin.000001 298 Table_map 1 337 table_id: # (test.t1) -master-bin.000001 337 Write_rows 1 376 table_id: # flags: STMT_END_F -master-bin.000001 376 Query 1 451 use `test`; flush tables +master-bin.000001 337 Write_rows 1 371 table_id: # flags: STMT_END_F +master-bin.000001 371 Table_map 1 410 table_id: # (test.t1) +master-bin.000001 410 Write_rows 1 444 table_id: # flags: STMT_END_F +master-bin.000001 444 Query 1 519 use `test`; flush tables SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/t/binlog_row_mix_innodb_myisam.test index b131e5350af..14aeb1f3428 100644 --- a/mysql-test/t/binlog_row_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_row_mix_innodb_myisam.test @@ -20,7 +20,7 @@ # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) flush logs; ---exec $MYSQL_BINLOG --start-position=516 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output +--exec $MYSQL_BINLOG --start-position=519 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test index bde1974c124..bcb3d7651f3 100644 --- a/mysql-test/t/rpl_row_create_table.test +++ b/mysql-test/t/rpl_row_create_table.test @@ -34,7 +34,7 @@ CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT) ENGINE=Merge; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; ---replace_column 1 # 4 # 5 # +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --query_vertical SHOW BINLOG EVENTS FROM 215 --echo **** On Master **** @@ -70,8 +70,9 @@ connection master; --error 1062 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; # Shouldn't be written to the binary log +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 959; +SHOW BINLOG EVENTS FROM 1097; # Test that INSERT-SELECT works the same way as for SBR. CREATE TABLE t7 (a INT, b INT UNIQUE); @@ -79,6 +80,7 @@ CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS FROM 1097; sync_slave_with_master; @@ -90,6 +92,7 @@ INSERT INTO tt4 VALUES (4,8), (5,10), (6,12); BEGIN; INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS FROM 1293; SELECT * FROM t7 ORDER BY a,b; @@ -105,6 +108,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1; --echo **** On Master **** --query_vertical SHOW CREATE TABLE t8 --query_vertical SHOW CREATE TABLE t9 +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS FROM 1389; sync_slave_with_master; @@ -156,6 +160,7 @@ SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; SELECT * FROM t3 ORDER BY a; SELECT * FROM t4 ORDER BY a; +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS; sync_slave_with_master; @@ -201,6 +206,7 @@ INSERT INTO t2 SELECT a+2 FROM tt1; COMMIT; SELECT * FROM t2 ORDER BY a; +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS; sync_slave_with_master; @@ -219,8 +225,9 @@ INSERT INTO t2 SELECT a+2 FROM tt2; ROLLBACK; SELECT * FROM t2 ORDER BY a; +--replace_column 1 # 4 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 627; +SHOW BINLOG EVENTS FROM 630; sync_slave_with_master; SELECT * FROM t2 ORDER BY a; diff --git a/sql/log_event.cc b/sql/log_event.cc index 97c40194855..c5905ad6829 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5601,8 +5601,7 @@ unpack_row(RELAY_LOG_INFO *rli, MY_BITMAP* const rw_set, Log_event_type const event_type) { DBUG_ENTER("unpack_row"); - DBUG_ASSERT(record && row_data); - my_ptrdiff_t const offset= record - (byte*) table->record[0]; + DBUG_ASSERT(row_data); my_size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8; int error= 0; @@ -5611,7 +5610,7 @@ unpack_row(RELAY_LOG_INFO *rli, bitmap_clear_all(rw_set); - memcpy(record, table->s->default_values, table->s->null_bytes); + memcpy(table->record[0], table->s->default_values, table->s->null_bytes); Field **const begin_ptr = table->field; Field **field_ptr; @@ -5642,17 +5641,15 @@ unpack_row(RELAY_LOG_INFO *rli, DBUG_ASSERT(pack_ptr != NULL); if ((null_bits & null_mask) && f->maybe_null()) - f->set_null(offset); + f->set_null(); else { - f->set_notnull(offset); + f->set_notnull(); /* We only unpack the field if it was non-null */ - f->move_field_offset(offset); pack_ptr= f->unpack(f->ptr, pack_ptr); - f->move_field_offset(-offset); } bitmap_set_bit(rw_set, field_ptr - begin_ptr); @@ -6994,15 +6991,19 @@ static int find_and_fetch_row(TABLE *table, byte *key) while (record_compare(table)) { int error; + /* We need to set the null bytes to ensure that the filler bit are all set when returning. There are storage engines that just set the necessary bits on the bytes and don't set the filler bits correctly. */ - my_ptrdiff_t const pos= - table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; - table->record[1][pos]= 0xFF; + if (table->s->null_bytes > 0) + { + table->record[1][table->s->null_bytes - 1]|= + 256U - (1U << table->s->last_null_bit_pos); + } + if ((error= table->file->index_next(table->record[1]))) { table->file->print_error(error, MYF(0)); @@ -7028,15 +7029,17 @@ static int find_and_fetch_row(TABLE *table, byte *key) /* Continue until we find the right record or have made a full loop */ do { - error= table->file->rnd_next(table->record[1]); - /* - Patching the returned record since some storage engines do - not set the filler bits correctly. + Patching the record before calling rnd_next() since some + storage engines do not set the filler bits correctly. */ - my_ptrdiff_t const pos= - table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; - table->record[1][pos]|= 256U - (1U << table->s->last_null_bit_pos); + if (table->s->null_bytes > 0) + { + table->record[1][table->s->null_bytes - 1]|= + 256U - (1U << table->s->last_null_bit_pos); + } + + error= table->file->rnd_next(table->record[1]); DBUG_DUMP("record[0]", table->record[0], table->s->reclength); DBUG_DUMP("record[1]", table->record[1], table->s->reclength); From e2706b6721324f8017affe1262dd62ba8f9f292b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 14:51:45 +0200 Subject: [PATCH 059/789] Bug #26672: DATE/DATETIME values are out of the currently supported 4 basic value types (INT,STRING,REAL and DECIMAL). So expressions (not fields) of compile type DATE/DATETIME are generally considered as STRING values. This is not so when they are compared : then they are compared as INTEGER values. But the rule for comparison as INTEGERS must be checked explicitly each time when a comparison is to be performed. filesort is one such place. However there the check was not done and hence the expressions (not fields) of type DATE/DATETIME were sorted by their string representation. Fixed to compare them as INTEGER values for filesort. mysql-test/r/order_by.result: Bug #26672: test case mysql-test/t/order_by.test: Bug #26672: test case sql/filesort.cc: Bug #26672: sort dates/times as integers --- mysql-test/r/order_by.result | 22 ++++++++++++++++++++++ mysql-test/t/order_by.test | 15 +++++++++++++++ sql/filesort.cc | 5 ++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 0b1edfd3e8f..2093b5cd465 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -934,3 +934,25 @@ a ratio 19 1.3333 9 2.6667 drop table t1; +CREATE TABLE t1 (a INT UNSIGNED NOT NULL, b TIME); +INSERT INTO t1 (a) VALUES (100000), (0), (100), (1000000),(10000), (1000), (10); +UPDATE t1 SET b = SEC_TO_TIME(a); +SELECT a, b FROM t1 ORDER BY b DESC; +a b +1000000 277:46:40 +100000 27:46:40 +10000 02:46:40 +1000 00:16:40 +100 00:01:40 +10 00:00:10 +0 00:00:00 +SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC; +a b +1000000 277:46:40 +100000 27:46:40 +10000 02:46:40 +1000 00:16:40 +100 00:01:40 +10 00:00:10 +0 00:00:00 +DROP TABLE t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index a3aa2c0081d..2de6f791cfa 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -648,3 +648,18 @@ create table t1 (a int, b int, c int); insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9); select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc; drop table t1; + +# +# Bug#26672: Incorrect SEC_TO_TIME() casting in ORDER BY +# +CREATE TABLE t1 (a INT UNSIGNED NOT NULL, b TIME); +INSERT INTO t1 (a) VALUES (100000), (0), (100), (1000000),(10000), (1000), (10); +UPDATE t1 SET b = SEC_TO_TIME(a); + +-- Correct ORDER +SELECT a, b FROM t1 ORDER BY b DESC; + +-- must be ordered as the above +SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC; + +DROP TABLE t1; diff --git a/sql/filesort.cc b/sql/filesort.cc index e40c492fe8e..23d652cb8cc 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1298,7 +1298,10 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, } else { - switch ((sortorder->result_type=sortorder->item->result_type())) { + sortorder->result_type= sortorder->item->result_type(); + if (sortorder->item->result_as_longlong()) + sortorder->result_type= INT_RESULT; + switch (sortorder->result_type) { case STRING_RESULT: sortorder->length=sortorder->item->max_length; set_if_smaller(sortorder->length, thd->variables.max_sort_length); From 6975a71edd82c35925ed4390129a9aea60db16d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 20:04:50 +0700 Subject: [PATCH 060/789] remove extra ; causing compile errors on some platforms --- ndb/src/ndbapi/NdbRecAttr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index b029f9826d0..4f4d18a1015 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -152,7 +152,7 @@ NdbRecordPrintFormat::NdbRecordPrintFormat() null_string= "[NULL]"; hex_format= 0; } -NdbRecordPrintFormat::~NdbRecordPrintFormat() {}; +NdbRecordPrintFormat::~NdbRecordPrintFormat() {} static const NdbRecordPrintFormat default_print_format; static void From 54356b6fcf487e857d229e8dfd99d9f8da50494c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 16:30:13 +0100 Subject: [PATCH 061/789] Bug#26782 - Patch: myisamchk -rq creates .MYI.MYI file on packed MyISAM tables When fixing the indexes with "myisamchk -rq" after compressing the table with "myisampack", an optionally supplied extension ".MYI" of the index file was not detected. The extension was appended unconditionally. The result was ".MYI.MYI". Now an extension is no longer appended if present already. Thanks to David Shrewsbury for providing this patch. Another problem was a misplaced parenthesis. We did never unpack the file name ("~/..") and always returned a real path. No test case. This is manually tested with the utilities "myisampack" and "myisamchk". storage/myisam/mi_create.c: Bug#26782 - Patch: myisamchk -rq creates .MYI.MYI file on packed MyISAM tables Added code to detect existing extension on index file name. Thanks to David Shrewsbury for providing this patch. Additionally fixed an parenthesis. We did never unpack the file name and always returned real path. --- storage/myisam/mi_create.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 2b8cbcc7da5..e2245aff065 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -599,10 +599,12 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, } else { + char *iext= strrchr(name, '.'); + int have_iext= iext && !strcmp(iext, MI_NAME_IEXT); fn_format(filename, name, "", MI_NAME_IEXT, - (MY_UNPACK_FILENAME | - (flags & HA_DONT_TOUCH_DATA) ? MY_RETURN_REAL_PATH : 0) | - MY_APPEND_EXT); + MY_UNPACK_FILENAME | + ((flags & HA_DONT_TOUCH_DATA) ? MY_RETURN_REAL_PATH : 0) | + (have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT)); linkname_ptr=0; /* Replace the current file */ create_flag=MY_DELETE_OLD; From 3b288b24a6c2a604fe89bd591f3c5976e33cdbf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 18:51:49 +0300 Subject: [PATCH 062/789] BUG#18326: Do not lock table for writing during prepare of statement During statement prepare phase the tables were locked as if the statement is being executed, however this is not necessary. The solution is to not lock tables on statement prepare phase. Opening tables is enough to prevent DDL on them, and during statement prepare we do not access nor modify any data. mysql-test/r/ps.result: Add result for bug#18326: Do not lock table for writing during prepare of statement. mysql-test/t/ps.test: Add test case for bug#18326: Do not lock table for writing during prepare of statement. sql/sql_prepare.cc: Do not lock tables on statement prepare phase. Opening tables is enough to prevent DDL on them, and during statement prepare we do not access nor modify any data. Use open_normal_and_derived_tables() for table opening on prepare. --- mysql-test/r/ps.result | 37 ++++++++++++++ mysql-test/t/ps.test | 57 ++++++++++++++++++++++ sql/sql_prepare.cc | 106 +++++++++++++++++++---------------------- 3 files changed, 144 insertions(+), 56 deletions(-) diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index a99fdb16868..e2037e6e87e 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -2488,3 +2488,40 @@ execute stmt2 using @to_format, @dec; format(?, ?) 10,000.00 deallocate prepare stmt2; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (i INT); +INSERT INTO t2 VALUES (2); +LOCK TABLE t1 READ, t2 WRITE; +PREPARE stmt1 FROM "SELECT i FROM t1"; +PREPARE stmt2 FROM "INSERT INTO t2 (i) VALUES (3)"; +EXECUTE stmt1; +i +1 +EXECUTE stmt2; +SELECT * FROM t2; +i +2 +UNLOCK TABLES; +SELECT * FROM t2; +i +2 +3 +ALTER TABLE t1 ADD COLUMN j INT; +ALTER TABLE t2 ADD COLUMN j INT; +INSERT INTO t1 VALUES (4, 5); +INSERT INTO t2 VALUES (4, 5); +EXECUTE stmt1; +i +1 +4 +EXECUTE stmt2; +SELECT * FROM t2; +i j +2 NULL +3 NULL +4 5 +3 NULL +DROP TABLE t1, t2; +End of 5.1 tests. diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 805abe99426..f0c9f1d8c47 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -2516,3 +2516,60 @@ set @to_format="10000"; execute stmt2 using @to_format, @dec; deallocate prepare stmt2; + +# +# BUG#18326: Do not lock table for writing during prepare of statement +# +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (i INT); +INSERT INTO t2 VALUES (2); + +LOCK TABLE t1 READ, t2 WRITE; + +connect (conn1, localhost, root, , ); + +# Prepare never acquires the lock, and thus should not block. +PREPARE stmt1 FROM "SELECT i FROM t1"; +PREPARE stmt2 FROM "INSERT INTO t2 (i) VALUES (3)"; + +# This should not block because READ lock on t1 is shared. +EXECUTE stmt1; + +# This should block because WRITE lock on t2 is exclusive. +send EXECUTE stmt2; + +connection default; + +SELECT * FROM t2; +UNLOCK TABLES; +let $wait_condition= SELECT COUNT(*) = 2 FROM t2; +--source include/wait_condition.inc +SELECT * FROM t2; + +# DDL and DML works even if some client have a prepared statement +# referencing the table. +ALTER TABLE t1 ADD COLUMN j INT; +ALTER TABLE t2 ADD COLUMN j INT; +INSERT INTO t1 VALUES (4, 5); +INSERT INTO t2 VALUES (4, 5); + +connection conn1; + +reap; +EXECUTE stmt1; +EXECUTE stmt2; +SELECT * FROM t2; + +disconnect conn1; + +connection default; + +DROP TABLE t1, t2; + + +--echo End of 5.1 tests. diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 249d69d174a..8e6d1099341 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -34,6 +34,12 @@ When one prepares a statement: [Params meta info (stubs only for now)] (if Param_count > 0) [Columns meta info] (if Column_count > 0) + During prepare the tables used in a statement are opened, but no + locks are acquired. Table opening will block any DDL during the + operation, and we do not need any locks as we neither read nor + modify any data during prepare. Tables are closed after prepare + finishes. + When one executes a statement: - Server gets the command 'COM_STMT_EXECUTE' to execute the @@ -53,6 +59,10 @@ When one executes a statement: - Execute the query without re-parsing and send back the results to client + During execution of prepared statement tables are opened and locked + the same way they would for normal (non-prepared) statement + execution. Tables are unlocked and closed after the execution. + When one supplies long data for a placeholder: - Server gets the long data in pieces with command type @@ -1120,38 +1130,20 @@ static int mysql_test_update(Prepared_statement *stmt, bool need_reopen; DBUG_ENTER("mysql_test_update"); - if (update_precheck(thd, table_list)) + if (update_precheck(thd, table_list) || + open_normal_and_derived_tables(thd, table_list, 0)) goto error; - for ( ; ; ) + if (table_list->multitable_view) { - if (open_tables(thd, &table_list, &table_count, 0)) - goto error; - - if (table_list->multitable_view) - { - DBUG_ASSERT(table_list->view != 0); - DBUG_PRINT("info", ("Switch to multi-update")); - /* pass counter value */ - thd->lex->table_count= table_count; - /* convert to multiupdate */ - DBUG_RETURN(2); - } - - if (!lock_tables(thd, table_list, table_count, &need_reopen)) - break; - if (!need_reopen) - goto error; - close_tables_for_reopen(thd, &table_list); + DBUG_ASSERT(table_list->view != 0); + DBUG_PRINT("info", ("Switch to multi-update")); + /* pass counter value */ + thd->lex->table_count= table_count; + /* convert to multiupdate */ + DBUG_RETURN(2); } - /* - thd->fill_derived_tables() is false here for sure (because it is - preparation of PS, so we even do not check it). - */ - if (mysql_handle_derived(thd->lex, &mysql_derived_prepare)) - goto error; - #ifndef NO_EMBEDDED_ACCESS_CHECKS /* TABLE_LIST contain right privilages request */ want_privilege= table_list->grant.want_privilege; @@ -1209,7 +1201,7 @@ static bool mysql_test_delete(Prepared_statement *stmt, DBUG_ENTER("mysql_test_delete"); if (delete_precheck(thd, table_list) || - open_and_lock_tables(thd, table_list)) + open_normal_and_derived_tables(thd, table_list, 0)) goto error; if (!table_list->table) @@ -1268,7 +1260,7 @@ static int mysql_test_select(Prepared_statement *stmt, goto error; } - if (open_and_lock_tables(thd, tables)) + if (open_normal_and_derived_tables(thd, tables, 0)) goto error; thd->used_tables= 0; // Updated by setup_fields @@ -1329,7 +1321,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt, if (tables && check_table_access(thd, SELECT_ACL, tables, 0)) DBUG_RETURN(TRUE); - if (open_and_lock_tables(thd, tables)) + if (open_normal_and_derived_tables(thd, tables, 0)) DBUG_RETURN(TRUE); DBUG_RETURN(setup_fields(thd, 0, *values, MARK_COLUMNS_NONE, 0, 0)); } @@ -1359,7 +1351,7 @@ static bool mysql_test_set_fields(Prepared_statement *stmt, set_var_base *var; if (tables && check_table_access(thd, SELECT_ACL, tables, 0) || - open_and_lock_tables(thd, tables)) + open_normal_and_derived_tables(thd, tables, 0)) goto error; while ((var= it++)) @@ -1385,7 +1377,7 @@ error: NOTE This function won't directly open tables used in select. They should be opened either by calling function (and in this case you probably - should use select_like_stmt_test_with_open_n_lock()) or by + should use select_like_stmt_test_with_open()) or by "specific_prepare" call (like this happens in case of multi-update). RETURN VALUE @@ -1413,14 +1405,14 @@ static bool select_like_stmt_test(Prepared_statement *stmt, } /* - Check internal SELECT of the prepared command (with opening and - locking of used tables). + Check internal SELECT of the prepared command (with opening of used + tables). SYNOPSIS - select_like_stmt_test_with_open_n_lock() + select_like_stmt_test_with_open() stmt prepared statement - tables list of tables to be opened and locked - before calling specific_prepare function + tables list of tables to be opened before calling + specific_prepare function specific_prepare function of command specific prepare setup_tables_done_option options to be passed to LEX::unit.prepare() @@ -1430,19 +1422,20 @@ static bool select_like_stmt_test(Prepared_statement *stmt, */ static bool -select_like_stmt_test_with_open_n_lock(Prepared_statement *stmt, - TABLE_LIST *tables, - bool (*specific_prepare)(THD *thd), - ulong setup_tables_done_option) +select_like_stmt_test_with_open(Prepared_statement *stmt, + TABLE_LIST *tables, + bool (*specific_prepare)(THD *thd), + ulong setup_tables_done_option) { - DBUG_ENTER("select_like_stmt_test_with_open_n_lock"); + DBUG_ENTER("select_like_stmt_test_with_open"); /* - We should not call LEX::unit.cleanup() after this open_and_lock_tables() - call because we don't allow prepared EXPLAIN yet so derived tables will - clean up after themself. + We should not call LEX::unit.cleanup() after this + open_normal_and_derived_tables() call because we don't allow + prepared EXPLAIN yet so derived tables will clean up after + themself. */ - if (open_and_lock_tables(stmt->thd, tables)) + if (open_normal_and_derived_tables(stmt->thd, tables, 0)) DBUG_RETURN(TRUE); DBUG_RETURN(select_like_stmt_test(stmt, specific_prepare, @@ -1481,7 +1474,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) if (select_lex->item_list.elements) { select_lex->context.resolve_in_select_list= TRUE; - res= select_like_stmt_test_with_open_n_lock(stmt, tables, 0, 0); + res= select_like_stmt_test_with_open(stmt, tables, 0, 0); } /* put tables back for PS rexecuting */ @@ -1541,9 +1534,9 @@ static bool mysql_test_multidelete(Prepared_statement *stmt, } if (multi_delete_precheck(stmt->thd, tables) || - select_like_stmt_test_with_open_n_lock(stmt, tables, - &mysql_multi_delete_prepare, - OPTION_SETUP_TABLES_DONE)) + select_like_stmt_test_with_open(stmt, tables, + &mysql_multi_delete_prepare, + OPTION_SETUP_TABLES_DONE)) goto error; if (!tables->table) { @@ -1559,15 +1552,16 @@ error: /* Wrapper for mysql_insert_select_prepare, to make change of local tables - after open_and_lock_tables() call. + after open_normal_and_derived_tables() call. SYNOPSIS mysql_insert_select_prepare_tester() thd thread handle NOTE - We need to remove the first local table after open_and_lock_tables, - because mysql_handle_derived uses local tables lists. + We need to remove the first local table after + open_normal_and_derived_tables(), because mysql_handle_derived + uses local tables lists. */ static bool mysql_insert_select_prepare_tester(THD *thd) @@ -1624,9 +1618,9 @@ static bool mysql_test_insert_select(Prepared_statement *stmt, DBUG_ASSERT(first_local_table != 0); res= - select_like_stmt_test_with_open_n_lock(stmt, tables, - &mysql_insert_select_prepare_tester, - OPTION_SETUP_TABLES_DONE); + select_like_stmt_test_with_open(stmt, tables, + &mysql_insert_select_prepare_tester, + OPTION_SETUP_TABLES_DONE); /* revert changes made by mysql_insert_select_prepare_tester */ lex->select_lex.table_list.first= (byte*) first_local_table; return res; From a6131b85c0a938c2ba951ca5bfd772ec94d76d06 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 09:53:46 -0700 Subject: [PATCH 063/789] Bug 8407, post review cleanup: use instr::get_cont_dest() to get the instruction continuation instruction, for CONTINUE exception handlers. sql/sp_head.cc: Post review cleanup: use instr::get_cont_dest() to get the instruction continuation instruction, for CONTINUE exception handlers. sql/sp_head.h: Post review cleanup: use instr::get_cont_dest() to get the instruction continuation instruction, for CONTINUE exception handlers. --- sql/sp_head.cc | 20 +++++++------------- sql/sp_head.h | 27 ++++++++++++--------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index baeedc1c9b3..c1643f0f82e 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1078,7 +1078,7 @@ sp_head::execute(THD *thd) case SP_HANDLER_CONTINUE: thd->restore_active_arena(&execute_arena, &backup_arena); thd->set_n_backup_active_arena(&execute_arena, &backup_arena); - ctx->push_hstack(ip); + ctx->push_hstack(i->get_cont_dest()); // Fall through default: ip= hip; @@ -2394,7 +2394,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, reinit_stmt_before_use(thd, m_lex); if (open_tables) - res= instr->exec_open_and_lock_tables(thd, m_lex->query_tables, nextp); + res= instr->exec_open_and_lock_tables(thd, m_lex->query_tables); if (!res) res= instr->exec_core(thd, nextp); @@ -2443,8 +2443,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, sp_instr class functions */ -int sp_instr::exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables, - uint *nextp) +int sp_instr::exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables) { int result; @@ -2454,19 +2453,16 @@ int sp_instr::exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables, */ if (check_table_access(thd, SELECT_ACL, tables, 0) || open_and_lock_tables(thd, tables)) - { - get_cont_dest(nextp); result= -1; - } else result= 0; return result; } -void sp_instr::get_cont_dest(uint *nextp) +uint sp_instr::get_cont_dest() { - *nextp= m_ip+1; + return (m_ip+1); } @@ -2654,9 +2650,9 @@ sp_instr_set_trigger_field::print(String *str) sp_instr_opt_meta */ -void sp_instr_opt_meta::get_cont_dest(uint *nextp) +uint sp_instr_opt_meta::get_cont_dest() { - *nextp= m_cont_dest; + return m_cont_dest; } @@ -2748,7 +2744,6 @@ sp_instr_jump_if_not::exec_core(THD *thd, uint *nextp) if (! it) { res= -1; - *nextp = m_cont_dest; } else { @@ -3317,7 +3312,6 @@ sp_instr_set_case_expr::exec_core(THD *thd, uint *nextp) spcont->clear_handler(); thd->spcont= spcont; } - *nextp= m_cont_dest; /* For continue handler */ } else *nextp= m_ip+1; diff --git a/sql/sp_head.h b/sql/sp_head.h index 10eada43721..4ef4077cc79 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -449,13 +449,15 @@ public: thd Thread handle nextp OUT index of the next instruction to execute. (For most instructions this will be the instruction following this - one). - - RETURN - 0 on success, - other if some error occured + one). Note that this parameter is undefined in case of + errors, use get_cont_dest() to find the continuation + instruction for CONTINUE error handlers. + + RETURN + 0 on success, + other if some error occurred */ - + virtual int execute(THD *thd, uint *nextp) = 0; /** @@ -463,22 +465,17 @@ public: Open and lock the tables used by this statement, as a pre-requisite to execute the core logic of this instruction with exec_core(). - If this statement fails, the next instruction to execute is also returned. - This is useful when a user defined SQL continue handler needs to be - executed. @param thd the current thread @param tables the list of tables to open and lock - @param nextp the continuation instruction, returned to the caller if this - method fails. @return zero on success, non zero on failure. */ - int exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables, uint *nextp); + int exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables); /** Get the continuation destination of this instruction. - @param nextp the continuation destination (output) + @return the continuation destination */ - virtual void get_cont_dest(uint *nextp); + virtual uint get_cont_dest(); /* Execute core function of instruction after all preparations (e.g. @@ -744,7 +741,7 @@ public: virtual void set_destination(uint old_dest, uint new_dest) = 0; - virtual void get_cont_dest(uint *nextp); + virtual uint get_cont_dest(); protected: From 6928f535325fe81d6bda70b5320b91c56d2e2064 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 00:26:23 +0700 Subject: [PATCH 064/789] ndb - Bit formatting for printout wrong --- ndb/src/ndbapi/NdbRecAttr.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 4f4d18a1015..2577151e256 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -235,17 +235,26 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, out << r.u_64_value(); break; case NdbDictionary::Column::Bit: - for (j = (length-1)/32 + 1; j > 0; j--) - if (*((Uint32*)r.aRef() + j - 1)) - break; - if (j == 0) - { - out << "0x0"; - break; - } out << f.hex_prefix << "0x"; - for (; j > 0; j--) - out.print("%X", *((Uint32*)r.aRef() + j - 1)); + if (length < 33) + { + out.print("%X", r.u_32_value()); + } + else if (length < 65) + { + out.print("%llX", r.u_64_value()); + } + else + { + const unsigned char *buf = (unsigned char *)r.aRef(); + int k = 4*((length+31)/32); + while (k > 0 && (*(buf + --k) == 0)); + do + { + out.print("%X", (Uint32)*(buf + k--)); + } + while (k >= 0); + } break; case NdbDictionary::Column::Unsigned: if (length > 1) From babe2aa421bdf199cd36e8f89ce821c78df7d27a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 20:47:39 +0300 Subject: [PATCH 065/789] Cleanup: removed unused variable that produced a warning. --- sql/sql_prepare.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 3ae203a945d..109c03742d1 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1139,7 +1139,6 @@ static int mysql_test_update(Prepared_statement *stmt, #ifndef NO_EMBEDDED_ACCESS_CHECKS uint want_privilege; #endif - bool need_reopen; DBUG_ENTER("mysql_test_update"); if (update_precheck(thd, table_list) || From fc390db47b5f6ca36a4a8391696f1188d02b340a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 01:39:45 +0700 Subject: [PATCH 066/789] Bug #26783 replication status unknown after cluster or mysqld failure - part one, extend apply_status table --- sql/ha_ndbcluster_binlog.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 38b640d5f55..66cde581b63 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -756,6 +756,9 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd) NDB_REP_DB "." NDB_APPLY_TABLE " ( server_id INT UNSIGNED NOT NULL," " epoch BIGINT UNSIGNED NOT NULL, " + " log_name VARCHAR(255) BINARY NOT NULL, " + " start_pos BIGINT UNSIGNED NOT NULL, " + " end_pos BIGINT UNSIGNED NOT NULL, " " PRIMARY KEY USING HASH (server_id) ) ENGINE=NDB"); run_query(thd, buf, end, TRUE, TRUE); @@ -3800,6 +3803,9 @@ restart: bzero(table->record[0], table->s->null_bytes); table->field[0]->store((longlong)::server_id); table->field[1]->store((longlong)gci); + table->field[2]->store("", 0, &my_charset_bin); + table->field[3]->store((longlong)0); + table->field[4]->store((longlong)0); trans.write_row(::server_id, injector::transaction::table(table, TRUE), &table->s->all_set, table->s->fields, From 6de277910bdc581ed4080641b3d0f66d7c7eee24 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 21:44:58 +0300 Subject: [PATCH 067/789] Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. During optimization stage the WHERE conditions can be changed or even be removed at all if they know for sure to be true of false. Thus they aren't showed in the EXPLAIN EXTENDED which prints conditions after optimization. Now if all elements of an Item_cond were removed this Item_cond is substituted for an Item_int with the int value of the Item_cond. If there were conditions that were totally optimized away then values of the saved cond_value and having_value will be printed instead. mysql-test/t/explain.test: Added a test case for the bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. mysql-test/r/subselect.result: Corrected test case result after fix for bug#22331. mysql-test/r/func_test.result: Corrected test case result after fix for bug#22331. mysql-test/r/explain.result: Added a test case for the bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. sql/sql_select.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Now if all elements of an Item_cond were removed this Item_cond is substituted for an Item_int with the int value of the Item_cond. If there were conditions that were totally optimized away then values of the saved cond_value and having_value will be printed instead. sql/sql_lex.h: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. The cond_value and the having_value variables are added to the SELECT_LEX class. sql/sql_lex.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. The initialization of the cond_value and the having_value variables. sql/sql_select.h: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Now having_value is also stored in the JOIN class. --- mysql-test/r/explain.result | 29 +++++++++++++++++++++++++++++ mysql-test/r/func_test.result | 2 +- mysql-test/r/subselect.result | 16 ++++++++-------- mysql-test/t/explain.test | 14 ++++++++++++++ sql/sql_lex.cc | 1 + sql/sql_lex.h | 2 ++ sql/sql_select.cc | 23 ++++++++++++++++++----- sql/sql_select.h | 2 +- 8 files changed, 74 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 3bd7b2ccc15..221a8695f60 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -57,3 +57,32 @@ select 3 into @v1; explain select 3 into @v1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +create table t1(f1 int, f2 int); +insert into t1 values (1,1); +create view v1 as select * from t1 where f1=1; +explain extended select * from v1 where f2=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 1 +explain extended select * from t1 where 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 0 +explain extended select * from t1 where 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 1 +explain extended select * from t1 having 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +Warnings: +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` having 0 +explain extended select * from t1 having 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` having 1 +drop table t1; diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index 43832bdbccc..c3fbdb3b3bf 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -79,7 +79,7 @@ explain extended select * from t1 where 1 xor 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 select - a from t1; - a -1 diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 06f8c019265..1f29497f662 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -421,7 +421,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` +Note 1003 select 1 AS `1` from `test`.`t1` where 1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -1180,7 +1180,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select (0,(select 1 AS `Not_used` from `test`.`t1` `a`)) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1190,7 +1190,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select (0,(select 1 AS `Not_used` from `test`.`t1` `a`)) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1532,7 +1532,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); @@ -1540,7 +1540,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); @@ -1548,7 +1548,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); @@ -1556,7 +1556,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a @@ -1618,7 +1618,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 UNION t1 system NULL NULL NULL NULL 1 NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1` from `test`.`t1` where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index efce0cdf3b5..85bbbfea154 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -51,4 +51,18 @@ set names latin1; select 3 into @v1; explain select 3 into @v1; +# +# Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were +# optimized away. +# +create table t1(f1 int, f2 int); +insert into t1 values (1,1); +create view v1 as select * from t1 where f1=1; +explain extended select * from v1 where f2=1; +explain extended select * from t1 where 0; +explain extended select * from t1 where 1; +explain extended select * from t1 having 0; +explain extended select * from t1 having 1; +drop table t1; + # End of 5.0 tests. diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index ce76c35b33c..86590e10535 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1192,6 +1192,7 @@ void st_select_lex::init_select() is_correlated= 0; cur_pos_in_select_list= UNDEF_POS; non_agg_fields.empty(); + cond_value= having_value= Item::COND_UNDEF; } /* diff --git a/sql/sql_lex.h b/sql/sql_lex.h index ae2b0d30a9c..4400c94e7f5 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -487,6 +487,8 @@ public: Item *where, *having; /* WHERE & HAVING clauses */ Item *prep_where; /* saved WHERE clause for prepared statement processing */ Item *prep_having;/* saved HAVING clause for prepared statement processing */ + /* Saved values of the WHERE and HAVING clauses*/ + Item::cond_result cond_value, having_value; /* point on lex in which it was created, used in view subquery detection */ st_lex *parent_lex; enum olap_type olap; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e7b18201a0a..6adb26ade29 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -681,7 +681,6 @@ JOIN::optimize() } { - Item::cond_result having_value; having= optimize_cond(this, having, join_list, &having_value); if (thd->net.report_error) { @@ -689,6 +688,10 @@ JOIN::optimize() DBUG_PRINT("error",("Error from optimize_cond")); DBUG_RETURN(1); } + if (select_lex->where) + select_lex->cond_value= cond_value; + if (select_lex->having) + select_lex->having_value= having_value; if (cond_value == Item::COND_FALSE || having_value == Item::COND_FALSE || (!unit->select_limit_cnt && !(select_options & OPTION_FOUND_ROWS))) @@ -829,6 +832,7 @@ JOIN::optimize() conds->update_used_tables(); DBUG_EXECUTE("where", print_where(conds, "after substitute_best_equal");); } + /* Permorm the the optimization on fields evaluation mentioned above for all on expressions. @@ -7535,6 +7539,9 @@ static COND* substitute_for_best_equal_field(COND *cond, break; } } + if (!((Item_cond*)cond)->argument_list()->elements) + cond= new Item_int(cond->val_bool()); + } else if (cond->type() == Item::FUNC_ITEM && ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) @@ -15259,10 +15266,13 @@ void st_select_lex::print(THD *thd, String *str) Item *cur_where= where; if (join) cur_where= join->conds; - if (cur_where) + if (cur_where || cond_value != Item::COND_UNDEF) { str->append(STRING_WITH_LEN(" where ")); - cur_where->print(str); + if (cur_where) + cur_where->print(str); + else + str->append(cond_value != Item::COND_FALSE ? "1" : "0"); } // group by & olap @@ -15288,10 +15298,13 @@ void st_select_lex::print(THD *thd, String *str) if (join) cur_having= join->having; - if (cur_having) + if (cur_having || having_value != Item::COND_UNDEF) { str->append(STRING_WITH_LEN(" having ")); - cur_having->print(str); + if (cur_having) + cur_having->print(str); + else + str->append(having_value != Item::COND_FALSE ? "1" : "0"); } if (order_list.elements) diff --git a/sql/sql_select.h b/sql/sql_select.h index a17d7fcb362..27ca633fdb5 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -292,7 +292,7 @@ public: bool need_tmp, hidden_group_fields; DYNAMIC_ARRAY keyuse; - Item::cond_result cond_value; + Item::cond_result cond_value, having_value; List all_fields; // to store all fields that used in query //Above list changed to use temporary table List tmp_all_fields1, tmp_all_fields2, tmp_all_fields3; From 11b533b8be4a9b4d8e35dd457dea3240614a13a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Mar 2007 22:11:57 +0300 Subject: [PATCH 068/789] Bug#25373: Stored functions wasn't compared correctly which leads to a wrong result. For built-in functions like sqrt() function names are hard-coded and can be compared by pointer. But this isn't the case for a used-defined stored functions - names there are dynamical and should be compared as strings. Now the Item_func::eq() function employs my_strcasecmp() function to compare used-defined stored functions names. mysql-test/t/sp.test: Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result. mysql-test/r/sp.result: Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result. sql/item_func.cc: Bug#25373: Stored functions wasn't compared correctly which leads to a wrong result. Now the Item_func::eq() function employs my_strcasecmp() function to compare used-defined stored functions names. --- mysql-test/r/sp.result | 13 +++++++++++++ mysql-test/t/sp.test | 15 +++++++++++++++ sql/item_func.cc | 9 +++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 8e3c057cc62..81e2db70357 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5741,4 +5741,17 @@ END| CALL bug24117()| DROP PROCEDURE bug24117| DROP TABLE t3| +DROP FUNCTION IF EXISTS bug25373| +CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER +LANGUAGE SQL DETERMINISTIC +RETURN p1;| +CREATE TABLE t3 (f1 INT, f2 FLOAT)| +INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| +SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| +SUM(f2) bug25373(f1) +6.3000000715256 1 +15 2 +21.300000071526 NULL +DROP FUNCTION bug25373| +DROP TABLE t3| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index cfa4937e050..5da29454b08 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6714,6 +6714,21 @@ CALL bug24117()| DROP PROCEDURE bug24117| DROP TABLE t3| +# +# Bug#25373: Stored functions wasn't compared correctly which leads to a wrong +# result. +# +--disable_warnings +DROP FUNCTION IF EXISTS bug25373| +--disable_warnings +CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER +LANGUAGE SQL DETERMINISTIC +RETURN p1;| +CREATE TABLE t3 (f1 INT, f2 FLOAT)| +INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| +SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| +DROP FUNCTION bug25373| +DROP TABLE t3| # # NOTE: The delimiter is `|`, and not `;`. It is changed to `;` # at the end of the file! diff --git a/sql/item_func.cc b/sql/item_func.cc index 638d8903dcb..c8c0671ae1d 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -409,8 +409,13 @@ bool Item_func::eq(const Item *item, bool binary_cmp) const if (item->type() != FUNC_ITEM) return 0; Item_func *item_func=(Item_func*) item; - if (arg_count != item_func->arg_count || - func_name() != item_func->func_name()) + Item_func::Functype func_type; + if ((func_type= functype()) != item_func->functype() || + arg_count != item_func->arg_count || + (func_type != Item_func::FUNC_SP && + func_name() != item_func->func_name()) || + (func_type == Item_func::FUNC_SP && + my_strcasecmp(system_charset_info, func_name(), item_func->func_name()))) return 0; for (uint i=0; i < arg_count ; i++) if (!args[i]->eq(item_func->args[i], binary_cmp)) From 1631f65dfd757282ac480fd20b3fe7b262f500c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 00:27:42 +0300 Subject: [PATCH 069/789] sql_select.cc: Postfix for bug#22331 for windows platform. explain.test, explain.result: Cleanup after bugfix#22331. mysql-test/t/explain.test: Cleanup after bugfix#22331. mysql-test/r/explain.result: Cleanup after bugfix#22331. sql/sql_select.cc: Postfix for bug#22331 for windows platform. --- mysql-test/r/explain.result | 1 + mysql-test/t/explain.test | 1 + sql/sql_select.cc | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 221a8695f60..e0afaaef201 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -85,4 +85,5 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` having 1 +drop view v1; drop table t1; diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index 85bbbfea154..04cf37f457a 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -63,6 +63,7 @@ explain extended select * from t1 where 0; explain extended select * from t1 where 1; explain extended select * from t1 having 0; explain extended select * from t1 having 1; +drop view v1; drop table t1; # End of 5.0 tests. diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fc67ffac2fb..06352d48154 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7622,7 +7622,7 @@ static COND* substitute_for_best_equal_field(COND *cond, } } if (!((Item_cond*)cond)->argument_list()->elements) - cond= new Item_int(cond->val_bool()); + cond= new Item_int((int32)cond->val_bool()); } else if (cond->type() == Item::FUNC_ITEM && From 26076b6e2aa3e17a499a95f5937b3921e9290045 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 08:22:27 +0700 Subject: [PATCH 070/789] new apply_status table test adoption new apply_status table ndb_restore adoption mysql-test/r/ndb_restore_compat.result: new apply_status table test adoption mysql-test/r/rpl_ndb_log.result: new apply_status table test adoption mysql-test/r/rpl_truncate_7ndb.result: new apply_status table test adoption storage/ndb/tools/restore/consumer_restore.cpp: new apply_status table ndb_restore adoption --- mysql-test/r/ndb_restore_compat.result | 8 +-- mysql-test/r/rpl_ndb_log.result | 8 +-- mysql-test/r/rpl_truncate_7ndb.result | 52 +++++++++---------- .../ndb/tools/restore/consumer_restore.cpp | 35 +++++++++++++ 4 files changed, 69 insertions(+), 34 deletions(-) diff --git a/mysql-test/r/ndb_restore_compat.result b/mysql-test/r/ndb_restore_compat.result index f580f680687..d495aa28135 100644 --- a/mysql-test/r/ndb_restore_compat.result +++ b/mysql-test/r/ndb_restore_compat.result @@ -45,8 +45,8 @@ SYSTEM_VALUES_ID VALUE 0 2039 1 3 SELECT * FROM mysql.ndb_apply_status WHERE server_id=0; -server_id epoch -0 151 +server_id epoch log_name start_pos end_pos +0 151 0 0 TRUNCATE GL; TRUNCATE ACCOUNT; TRUNCATE TRANSACTION; @@ -99,6 +99,6 @@ SYSTEM_VALUES_ID VALUE 0 2297 1 5 SELECT * FROM mysql.ndb_apply_status WHERE server_id=0; -server_id epoch -0 331 +server_id epoch log_name start_pos end_pos +0 331 0 0 DROP DATABASE BANK; diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result index 66db8c24bb2..cf761f1093b 100644 --- a/mysql-test/r/rpl_ndb_log.result +++ b/mysql-test/r/rpl_ndb_log.result @@ -87,12 +87,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT show binary logs; Log_name File_size -master-bin.000001 1702 -master-bin.000002 593 +master-bin.000001 1740 +master-bin.000002 612 start slave; show binary logs; Log_name File_size -slave-bin.000001 1797 +slave-bin.000001 1835 slave-bin.000002 198 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info @@ -126,7 +126,7 @@ slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Query 2 # COMMIT show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 593 # # master-bin.000002 Yes Yes # 0 0 593 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 612 # # master-bin.000002 Yes Yes # 0 0 612 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result index 63d4b0f9411..21399be4686 100644 --- a/mysql-test/r/rpl_truncate_7ndb.result +++ b/mysql-test/r/rpl_truncate_7ndb.result @@ -33,12 +33,12 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 219 Query 1 283 BEGIN master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 378 Write_rows 1 137 table_id: # -master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 467 Query 1 532 COMMIT -master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1 -master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1 +master-bin.000001 323 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 381 Write_rows 1 156 table_id: # +master-bin.000001 439 Write_rows 1 203 table_id: # flags: STMT_END_F +master-bin.000001 486 Query 1 551 COMMIT +master-bin.000001 551 Query 1 631 use `test`; TRUNCATE TABLE t1 +master-bin.000001 631 Query 1 707 use `test`; DROP TABLE t1 **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; INSERT INTO t1 VALUES (1,1), (2,2); @@ -69,23 +69,23 @@ master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 219 Query 1 283 BEGIN master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 378 Write_rows 1 137 table_id: # -master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 467 Query 1 532 COMMIT -master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1 -master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1 -master-bin.000001 688 Query 1 805 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 805 Query 1 869 BEGIN -master-bin.000001 869 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 909 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 964 Write_rows 1 137 table_id: # -master-bin.000001 1006 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 1053 Query 1 1118 COMMIT -master-bin.000001 1118 Query 1 1182 BEGIN -master-bin.000001 1182 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 1222 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1277 Write_rows 1 137 table_id: # -master-bin.000001 1319 Delete_rows 1 176 table_id: # flags: STMT_END_F -master-bin.000001 1358 Query 1 1423 COMMIT -master-bin.000001 1423 Query 1 1499 use `test`; DROP TABLE t1 +master-bin.000001 323 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 381 Write_rows 1 156 table_id: # +master-bin.000001 439 Write_rows 1 203 table_id: # flags: STMT_END_F +master-bin.000001 486 Query 1 551 COMMIT +master-bin.000001 551 Query 1 631 use `test`; TRUNCATE TABLE t1 +master-bin.000001 631 Query 1 707 use `test`; DROP TABLE t1 +master-bin.000001 707 Query 1 824 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 824 Query 1 888 BEGIN +master-bin.000001 888 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 928 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 986 Write_rows 1 156 table_id: # +master-bin.000001 1044 Write_rows 1 203 table_id: # flags: STMT_END_F +master-bin.000001 1091 Query 1 1156 COMMIT +master-bin.000001 1156 Query 1 1220 BEGIN +master-bin.000001 1220 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 1260 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1318 Write_rows 1 156 table_id: # +master-bin.000001 1376 Delete_rows 1 195 table_id: # flags: STMT_END_F +master-bin.000001 1415 Query 1 1480 COMMIT +master-bin.000001 1480 Query 1 1556 use `test`; DROP TABLE t1 diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp index 5b194fb7033..8ab5ad3c853 100644 --- a/storage/ndb/tools/restore/consumer_restore.cpp +++ b/storage/ndb/tools/restore/consumer_restore.cpp @@ -617,6 +617,7 @@ BackupRestore::update_apply_status(const RestoreMetaData &metaData) return true; bool result= false; + unsigned apply_table_format= 0; m_ndb->setDatabaseName(NDB_REP_DB); m_ndb->setSchemaName("def"); @@ -629,8 +630,33 @@ BackupRestore::update_apply_status(const RestoreMetaData &metaData) << dict->getNdbError() << endl; return false; } + if + (ndbtab->getColumn(0)->getType() == NdbDictionary::Column::Unsigned && + ndbtab->getColumn(1)->getType() == NdbDictionary::Column::Bigunsigned) + { + if (ndbtab->getNoOfColumns() == 2) + { + apply_table_format= 1; + } + else if + (ndbtab->getColumn(2)->getType() == NdbDictionary::Column::Varchar && + ndbtab->getColumn(3)->getType() == NdbDictionary::Column::Bigunsigned && + ndbtab->getColumn(4)->getType() == NdbDictionary::Column::Bigunsigned) + { + apply_table_format= 2; + } + } + if (apply_table_format == 0) + { + err << Ndb_apply_table << " has wrong format\n"; + return false; + } + Uint32 server_id= 0; Uint64 epoch= metaData.getStopGCP(); + Uint64 zero= 0; + char empty_string[1]; + empty_string[0]= 0; NdbTransaction * trans= m_ndb->startTransaction(); if (!trans) { @@ -653,6 +679,15 @@ BackupRestore::update_apply_status(const RestoreMetaData &metaData) << op->getNdbError() << endl; goto err; } + if ((apply_table_format == 2) && + (op->setValue(2u, (const char *)&empty_string, 1) || + op->setValue(3u, (const char *)&zero, sizeof(zero)) || + op->setValue(4u, (const char *)&zero, sizeof(zero)))) + { + err << Ndb_apply_table << ": " + << op->getNdbError() << endl; + goto err; + } if (trans->execute(NdbTransaction::Commit)) { err << Ndb_apply_table << ": " From 1fb285db3a28c3fc19c5f61c29e58b46a6893546 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 10:39:35 +0700 Subject: [PATCH 071/789] changed ndb_restore defaults handeling for structured printout extended ndb_restore_print test with tests mysql-test/r/ndb_restore_print.result: extended ndb_restore_print test with tests mysql-test/t/ndb_restore_print.test: extended ndb_restore_print test with tests ndb/tools/restore/restore_main.cpp: changed ndb_restore defaults handeling for structured printout --- mysql-test/r/ndb_restore_print.result | 215 +++++++++++++++++++++++--- mysql-test/t/ndb_restore_print.test | 30 +++- ndb/tools/restore/restore_main.cpp | 20 +-- 3 files changed, 234 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/ndb_restore_print.result b/mysql-test/r/ndb_restore_print.result index 006fd233ebb..b50a2f5c90b 100644 --- a/mysql-test/r/ndb_restore_print.result +++ b/mysql-test/r/ndb_restore_print.result @@ -11,7 +11,7 @@ create table t1 ,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY ,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255) ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000) -) engine ndb; +) engine myisam; insert into t1 values (1 ,0x1, 0x17, 0x789a, 0x789abcde, 0xfedc0001 @@ -48,6 +48,185 @@ insert into t1 values ,NULL,NULL,NULL ,NULL,NULL,NULL ); +select pk +,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5) +,b1, b2 +,c1 , c2 +,d1 , d2 +,e1 , e2 +,f1 , f2, f3 +,g1 , g2, g3 +,hex(h1), hex(h2), hex(h3) +,hex(i1), hex(i2), hex(i3) +from t1 order by pk; +pk 1 +hex(a1) 1 +hex(a2) 17 +hex(a3) 789A +hex(a4) 789ABCDE +hex(a5) FEDC0001 +b1 127 +b2 255 +c1 32767 +c2 65535 +d1 2147483647 +d2 4294967295 +e1 9223372036854775807 +e2 18446744073709551615 +f1 1 +f2 12345678901234567890123456789012 +f3 123456789 +g1 1 +g2 12345678901234567890123456789012 +g3 123456789 +hex(h1) 12 +hex(h2) 123456789ABCDEF0 +hex(h3) 012345000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +hex(i1) 12 +hex(i2) 123456789ABCDEF0 +hex(i3) 00123450 +pk 2 +hex(a1) 0 +hex(a2) 0 +hex(a3) 0 +hex(a4) 0 +hex(a5) 0 +b1 -128 +b2 0 +c1 -32768 +c2 0 +d1 -2147483648 +d2 0 +e1 -9223372036854775808 +e2 0 +f1 +f2 +f3 +g1 +g2 +g3 +hex(h1) 00 +hex(h2) 0000000000000000 +hex(h3) 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +hex(i1) 00 +hex(i2) 00 +hex(i3) 00 +pk 3 +hex(a1) NULL +hex(a2) NULL +hex(a3) NULL +hex(a4) NULL +hex(a5) NULL +b1 NULL +b2 NULL +c1 NULL +c2 NULL +d1 NULL +d2 NULL +e1 NULL +e2 NULL +f1 NULL +f2 NULL +f3 NULL +g1 NULL +g2 NULL +g3 NULL +hex(h1) NULL +hex(h2) NULL +hex(h3) NULL +hex(i1) NULL +hex(i2) NULL +hex(i3) NULL +alter table t1 engine ndb; +select pk +,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5) +,b1, b2 +,c1 , c2 +,d1 , d2 +,e1 , e2 +,f1 , f2, f3 +,g1 , g2, g3 +,hex(h1), hex(h2), hex(h3) +,hex(i1), hex(i2), hex(i3) +from t1 order by pk; +pk 1 +hex(a1) 1 +hex(a2) 17 +hex(a3) 789A +hex(a4) 789ABCDE +hex(a5) FEDC0001 +b1 127 +b2 255 +c1 32767 +c2 65535 +d1 2147483647 +d2 4294967295 +e1 9223372036854775807 +e2 18446744073709551615 +f1 1 +f2 12345678901234567890123456789012 +f3 123456789 +g1 1 +g2 12345678901234567890123456789012 +g3 123456789 +hex(h1) 12 +hex(h2) 123456789ABCDEF0 +hex(h3) 012345000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +hex(i1) 12 +hex(i2) 123456789ABCDEF0 +hex(i3) 00123450 +pk 2 +hex(a1) 0 +hex(a2) 0 +hex(a3) 0 +hex(a4) 0 +hex(a5) 0 +b1 -128 +b2 0 +c1 -32768 +c2 0 +d1 -2147483648 +d2 0 +e1 -9223372036854775808 +e2 0 +f1 +f2 +f3 +g1 +g2 +g3 +hex(h1) 00 +hex(h2) 0000000000000000 +hex(h3) 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +hex(i1) 00 +hex(i2) 00 +hex(i3) 00 +pk 3 +hex(a1) NULL +hex(a2) NULL +hex(a3) NULL +hex(a4) NULL +hex(a5) NULL +b1 NULL +b2 NULL +c1 NULL +c2 NULL +d1 NULL +d2 NULL +e1 NULL +e2 NULL +f1 NULL +f2 NULL +f3 NULL +g1 NULL +g2 NULL +g3 NULL +hex(h1) NULL +hex(h2) NULL +hex(h3) NULL +hex(i1) NULL +hex(i2) NULL +hex(i3) NULL CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; DELETE FROM test.backup_info; LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; @@ -89,35 +268,35 @@ SELECT @the_backup_id:=backup_id FROM test.backup_info; @the_backup_id:=backup_id DROP TABLE test.backup_info; -'1';'1';'12345678901234567890123456789012';'123456789';'1';'12345678901234567890123456789012';'123456789';'0x20';'0x123456789ABCDEF020';'0x012345000020';'0x1200000020';'0x123456789ABCDEF000000020';'0x00123450000020' +'1' '1' '12345678901234567890123456789012' '123456789' '1' '12345678901234567890123456789012' '123456789' '0x20' '0x123456789ABCDEF020' '0x012345000020' '0x1200000020' '0x123456789ABCDEF000000020' '0x00123450000020' t1 -- -1;1;12345678901234567890123456789012;123456789;1;12345678901234567890123456789012;123456789;0x20;0x123456789ABCDEF020;0x012345000020;0x1200000020;0x123456789ABCDEF000000020;0x00123450000020 +1 1 12345678901234567890123456789012 123456789 1 12345678901234567890123456789012 123456789 0x20 0x123456789ABCDEF020 0x012345000020 0x1200000020 0x123456789ABCDEF000000020 0x00123450000020 t2 -- -1;11 -2;12 -3;13 -4;14 -5;15 +1 11 +2 12 +3 13 +4 14 +5 15 t3 -- -1;21 -2;22 -3;23 -4;24 -5;25 +1 21 +2 22 +3 23 +4 24 +5 25 t4 -- -1;31 -2;32 -3;33 -4;34 -5;35 +1 31 +2 32 +3 33 +4 34 +5 35 drop table t1; drop table t2; drop table t3; diff --git a/mysql-test/t/ndb_restore_print.test b/mysql-test/t/ndb_restore_print.test index 5821813a3b1..66ad83a84a6 100644 --- a/mysql-test/t/ndb_restore_print.test +++ b/mysql-test/t/ndb_restore_print.test @@ -19,7 +19,7 @@ create table t1 ,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY ,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255) ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000) - ) engine ndb; + ) engine myisam; # max values insert into t1 values @@ -63,6 +63,34 @@ insert into t1 values ,NULL,NULL,NULL ); +--vertical_results +select pk + ,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5) + ,b1, b2 + ,c1 , c2 + ,d1 , d2 + ,e1 , e2 + ,f1 , f2, f3 + ,g1 , g2, g3 + ,hex(h1), hex(h2), hex(h3) + ,hex(i1), hex(i2), hex(i3) + from t1 order by pk; + +alter table t1 engine ndb; + +select pk + ,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5) + ,b1, b2 + ,c1 , c2 + ,d1 , d2 + ,e1 , e2 + ,f1 , f2, f3 + ,g1 , g2, g3 + ,hex(h1), hex(h2), hex(h3) + ,hex(i1), hex(i2), hex(i3) + from t1 order by pk; +--horizontal_results + --source include/ndb_backup.inc --let ndb_restore_filter=test t1 diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index 5f31a86e270..bf06ef69781 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -79,14 +79,10 @@ enum ndb_restore_options { OPT_APPEND, OPT_VERBOSE }; -/* - the below formatting options follow the formatting from mysqldump - do not change unless to adopt to changes in mysqldump -*/ -static const char *opt_fields_enclosed_by= ""; -static const char *opt_fields_terminated_by= ";"; -static const char *opt_fields_optionally_enclosed_by= ""; -static const char *opt_lines_terminated_by= "\n"; +static const char *opt_fields_enclosed_by= NULL; +static const char *opt_fields_terminated_by= NULL; +static const char *opt_fields_optionally_enclosed_by= NULL; +static const char *opt_lines_terminated_by= NULL; static const char *tab_path= NULL; static int opt_append; @@ -321,13 +317,13 @@ readArguments(int *pargc, char*** pargv) do not change unless to adopt to changes in mysqldump */ g_ndbrecord_print_format.fields_enclosed_by= - opt_fields_enclosed_by; + opt_fields_enclosed_by ? opt_fields_enclosed_by : ""; g_ndbrecord_print_format.fields_terminated_by= - opt_fields_terminated_by; + opt_fields_terminated_by ? opt_fields_terminated_by : "\t"; g_ndbrecord_print_format.fields_optionally_enclosed_by= - opt_fields_optionally_enclosed_by; + opt_fields_optionally_enclosed_by ? opt_fields_optionally_enclosed_by : ""; g_ndbrecord_print_format.lines_terminated_by= - opt_lines_terminated_by; + opt_lines_terminated_by ? opt_lines_terminated_by : "\n"; if (g_ndbrecord_print_format.fields_optionally_enclosed_by[0] == '\0') g_ndbrecord_print_format.null_string= "\\N"; else From 8927dc83c976396655de9307a0ba735836313d62 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 15:37:53 +0700 Subject: [PATCH 072/789] medium int printout support --- mysql-test/r/ndb_restore_print.result | 18 ++++++++++++++++ mysql-test/t/ndb_restore_print.test | 21 ++++++++++++++++++ ndb/include/ndbapi/NdbRecAttr.hpp | 31 +++++++++++++++++++++++++++ ndb/src/ndbapi/NdbRecAttr.cpp | 8 +++++-- 4 files changed, 76 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ndb_restore_print.result b/mysql-test/r/ndb_restore_print.result index b50a2f5c90b..e05f8e43d1a 100644 --- a/mysql-test/r/ndb_restore_print.result +++ b/mysql-test/r/ndb_restore_print.result @@ -298,6 +298,24 @@ t4 4 34 5 35 drop table t1; +create table t1 +(pk int key +,a1 MEDIUMINT, a2 MEDIUMINT UNSIGNED +) engine ndb; +insert into t1 values(1, 8388607, 16777215); +insert into t1 values(2, -8388608, 0); +insert into t1 values(3, -1, 1); +CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; +DELETE FROM test.backup_info; +LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; +SELECT @the_backup_id:=backup_id FROM test.backup_info; +@the_backup_id:=backup_id + +DROP TABLE test.backup_info; +1;8388607;16777215 +2;-8388608;0 +3;-1;1 +drop table t1; drop table t2; drop table t3; drop table t4; diff --git a/mysql-test/t/ndb_restore_print.test b/mysql-test/t/ndb_restore_print.test index 66ad83a84a6..6dbbfdf5933 100644 --- a/mysql-test/t/ndb_restore_print.test +++ b/mysql-test/t/ndb_restore_print.test @@ -161,6 +161,27 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35); --exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt --exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt +# now test some other datatypes +drop table t1; +create table t1 + (pk int key + ,a1 MEDIUMINT, a2 MEDIUMINT UNSIGNED + ) engine ndb; + +# max values +insert into t1 values(1, 8388607, 16777215); +# min values +insert into t1 values(2, -8388608, 0); +# small values +insert into t1 values(3, -1, 1); + +# backup and print +--source include/ndb_backup.inc + +--let ndb_restore_filter=test t1 +--let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by=";" +--source include/ndb_backup_print.inc + # clean up drop table t1; drop table t2; diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 159c7e7ce77..2f3a2c8383a 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -145,6 +145,13 @@ public: */ Int32 int32_value() const; + /** + * Get value stored in NdbRecAttr object. + * + * @return Medium value. + */ + Int32 medium_value() const; + /** * Get value stored in NdbRecAttr object. * @@ -173,6 +180,13 @@ public: */ Uint32 u_32_value() const; + /** + * Get value stored in NdbRecAttr object. + * + * @return Unsigned medium value. + */ + Uint32 u_medium_value() const; + /** * Get value stored in NdbRecAttr object. * @@ -318,6 +332,16 @@ NdbRecAttr::int32_value() const return *(Int32*)theRef; } +inline +Int32 +NdbRecAttr::medium_value() const +{ + Uint32 tmp = *(Uint32*)theRef; + if (tmp & (0x1<<23)) + tmp|= (0xFF<<24); + return (Int32)tmp; +} + inline short NdbRecAttr::short_value() const @@ -339,6 +363,13 @@ NdbRecAttr::u_32_value() const return *(Uint32*)theRef; } +inline +Uint32 +NdbRecAttr::u_medium_value() const +{ + return *(Uint32*)theRef; +} + inline Uint16 NdbRecAttr::u_short_value() const diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 2577151e256..a0c394603c5 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -265,6 +265,9 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, if (length > 1) out << f.end_array_enclosure; break; + case NdbDictionary::Column::Mediumunsigned: + out << r.u_medium_value(); + break; case NdbDictionary::Column::Smallunsigned: out << r.u_short_value(); break; @@ -277,6 +280,9 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, case NdbDictionary::Column::Int: out << r.int32_value(); break; + case NdbDictionary::Column::Mediumint: + out << r.medium_value(); + break; case NdbDictionary::Column::Smallint: out << r.short_value(); break; @@ -463,8 +469,6 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, break; case NdbDictionary::Column::Undefined: - case NdbDictionary::Column::Mediumint: - case NdbDictionary::Column::Mediumunsigned: unknown: //default: /* no print functions for the rest, just print type */ out << (int) r.getType(); From 548a39a104e7abeff3b3429938085b25d2a28c70 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 09:54:37 +0100 Subject: [PATCH 073/789] Bug#25673 - spatial index corruption, error 126 incorrect key file for table In certain cases it could happen that deleting a row could corrupt an RTREE index. According to Guttman's algorithm, page underflow is handled by storing the page in a list for later re-insertion. The keys from the stored pages have to be inserted into the remaining pages of the same level of the tree. Hence the level number is stored in the re-insertion list together with the page. In the MySQL RTree implementation the level counts from zero at the root page, increasing numbers for levels down the tree. If during re-insertion of the keys the tree height grows, all level numbers become invalid. The remaining keys will be inserted at the wrong level. The fix is to increment the level numbers stored in the reinsert list after a split of the root block during reinsertion. myisam/rt_index.c: Bug#25673 - spatial index corruption, error 126 incorrect key file for table Added a loop in rtree_delete() to increment the level numbers stored in the reinsert list after a split of the root block during reinsertion. Added comments and DBUG statements. myisam/rt_key.c: Bug#25673 - spatial index corruption, error 126 incorrect key file for table Added DBUG statements. myisam/rt_split.c: Bug#25673 - spatial index corruption, error 126 incorrect key file for table Added DBUG statements. mysql-test/r/gis-rtree.result: Bug#25673 - spatial index corruption, error 126 incorrect key file for table Added the test result. mysql-test/t/gis-rtree.test: Bug#25673 - spatial index corruption, error 126 incorrect key file for table Added a test. --- myisam/rt_index.c | 100 ++++-- myisam/rt_key.c | 17 +- myisam/rt_split.c | 7 +- mysql-test/r/gis-rtree.result | 552 +++++++++++++++++++++++++++++++++ mysql-test/t/gis-rtree.test | 556 ++++++++++++++++++++++++++++++++++ 5 files changed, 1200 insertions(+), 32 deletions(-) diff --git a/myisam/rt_index.c b/myisam/rt_index.c index 1806476dc39..9c58f4ba5d2 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -186,6 +186,7 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length, /* Save searched key, include data pointer. The data pointer is required if the search_flag contains MBR_DATA. + (minimum bounding rectangle) */ memcpy(info->first_mbr_key, key, keyinfo->keylength); info->last_rkey_length = key_length; @@ -540,16 +541,19 @@ static int rtree_insert_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint nod_flag; uchar *page_buf; int res; + DBUG_ENTER("rtree_insert_req"); if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length + MI_MAX_KEY_BUFF))) { my_errno = HA_ERR_OUT_OF_MEM; - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0)) goto err1; nod_flag = mi_test_if_nod(page_buf); + DBUG_PRINT("rtree", ("page: %lu level: %d ins_level: %d nod_flag: %u", + (ulong) page, level, ins_level, nod_flag)); if ((ins_level == -1 && nod_flag) || /* key: go down to leaf */ (ins_level > -1 && ins_level > level)) /* branch: go down to ins_level */ @@ -601,11 +605,11 @@ static int rtree_insert_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, ok: my_afree((byte*)page_buf); - return res; + DBUG_RETURN(res); err1: my_afree((byte*)page_buf); - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } @@ -625,7 +629,8 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key, MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; int res; my_off_t new_page; - + DBUG_ENTER("rtree_insert_level"); + if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) { int res; @@ -655,11 +660,12 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key, uchar *new_key; uint nod_flag = info->s->base.key_reflength; + DBUG_PRINT("rtree", ("root was split, grow a new root")); if (!(new_root_buf = (uchar*)my_alloca((uint)keyinfo->block_length + MI_MAX_KEY_BUFF))) { my_errno = HA_ERR_OUT_OF_MEM; - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } mi_putint(new_root_buf, 2, nod_flag); @@ -685,12 +691,14 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key, DFLT_INIT_HITS, new_root_buf)) goto err1; info->s->state.key_root[keynr] = new_root; + DBUG_PRINT("rtree", ("new root page: %lu level: %d nod_flag: %u", + (ulong) new_root, 0, mi_test_if_nod(new_root_buf))); my_afree((byte*)new_root_buf); break; err1: my_afree((byte*)new_root_buf); - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } default: case -1: /* error */ @@ -698,7 +706,7 @@ err1: break; } } - return res; + DBUG_RETURN(res); } @@ -712,8 +720,10 @@ err1: int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length) { - return (!key_length || - (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0; + DBUG_ENTER("rtree_insert"); + DBUG_RETURN((!key_length || + (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? + -1 : 0); } @@ -728,6 +738,8 @@ int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length) static int rtree_fill_reinsert_list(stPageList *ReinsertList, my_off_t page, int level) { + DBUG_ENTER("rtree_fill_reinsert_list"); + DBUG_PRINT("rtree", ("page: %lu level: %d", (ulong) page, level)); if (ReinsertList->n_pages == ReinsertList->m_pages) { ReinsertList->m_pages += REINSERT_BUFFER_INC; @@ -739,10 +751,10 @@ static int rtree_fill_reinsert_list(stPageList *ReinsertList, my_off_t page, ReinsertList->pages[ReinsertList->n_pages].offs = page; ReinsertList->pages[ReinsertList->n_pages].level = level; ReinsertList->n_pages++; - return 0; + DBUG_RETURN(0); err1: - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } @@ -766,15 +778,18 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint nod_flag; uchar *page_buf; int res; + DBUG_ENTER("rtree_delete_req"); if (!(page_buf = (uchar*)my_alloca((uint)keyinfo->block_length))) { my_errno = HA_ERR_OUT_OF_MEM; - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } if (!_mi_fetch_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf, 0)) goto err1; nod_flag = mi_test_if_nod(page_buf); + DBUG_PRINT("rtree", ("page: %lu level: %d nod_flag: %u", + (ulong) page, level, nod_flag)); k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); last = rt_PAGE_END(page_buf); @@ -795,6 +810,7 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, if (*page_size + key_length >= rt_PAGE_MIN_SIZE(keyinfo->block_length)) { /* OK */ + /* Calculate a new key value (MBR) for the shrinked block. */ if (rtree_set_key_mbr(info, keyinfo, k, key_length, _mi_kpos(nod_flag, k))) goto err1; @@ -804,10 +820,23 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, } else { - /* too small: delete key & add it descendant to reinsert list */ + /* + Too small: delete key & add it descendant to reinsert list. + Store position and level of the block so that it can be + accessed later for inserting the remaining keys. + */ + DBUG_PRINT("rtree", ("too small. move block to reinsert list")); if (rtree_fill_reinsert_list(ReinsertList, _mi_kpos(nod_flag, k), level + 1)) goto err1; + /* + Delete the key that references the block. This makes the + block disappear from the index. Hence we need to insert + its remaining keys later. Note: if the block is a branch + block, we do not only remove this block, but the whole + subtree. So we need to re-insert its keys on the same + level later to reintegrate the subtrees. + */ rtree_delete_key(info, page_buf, k, key_length, nod_flag); if (_mi_write_keypage(info, keyinfo, page, DFLT_INIT_HITS, page_buf)) @@ -867,11 +896,11 @@ static int rtree_delete_req(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, ok: my_afree((byte*)page_buf); - return res; + DBUG_RETURN(res); err1: my_afree((byte*)page_buf); - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } @@ -889,12 +918,15 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) stPageList ReinsertList; my_off_t old_root; MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + DBUG_ENTER("rtree_delete"); if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) { my_errno= HA_ERR_END_OF_FILE; - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } + DBUG_PRINT("rtree", ("starting deletion at root page: %lu", + (ulong) old_root)); ReinsertList.pages = NULL; ReinsertList.n_pages = 0; @@ -903,12 +935,12 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) switch (rtree_delete_req(info, keyinfo, key, key_length, old_root, &page_size, &ReinsertList, 0)) { - case 2: + case 2: /* empty */ { info->s->state.key_root[keynr] = HA_OFFSET_ERROR; - return 0; + DBUG_RETURN(0); } - case 0: + case 0: /* deleted */ { uint nod_flag; ulong i; @@ -928,16 +960,34 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) DFLT_INIT_HITS, page_buf, 0)) goto err1; nod_flag = mi_test_if_nod(page_buf); + DBUG_PRINT("rtree", ("reinserting keys from " + "page: %lu level: %d nod_flag: %u", + (ulong) ReinsertList.pages[i].offs, + ReinsertList.pages[i].level, nod_flag)); + k = rt_PAGE_FIRST_KEY(page_buf, nod_flag); last = rt_PAGE_END(page_buf); for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag)) { - if (rtree_insert_level(info, keynr, k, key_length, - ReinsertList.pages[i].level) == -1) + int res; + if ((res= rtree_insert_level(info, keynr, k, key_length, + ReinsertList.pages[i].level)) == -1) { my_afree((byte*)page_buf); goto err1; } + if (res) + { + int j; + DBUG_PRINT("rtree", ("root has been split, adjust levels")); + for (j= i; j < ReinsertList.n_pages; j++) + { + ReinsertList.pages[j].level++; + DBUG_PRINT("rtree", ("keys from page: %lu now level: %d", + (ulong) ReinsertList.pages[i].offs, + ReinsertList.pages[i].level)); + } + } } my_afree((byte*)page_buf); if (_mi_dispose(info, keyinfo, ReinsertList.pages[i].offs, @@ -964,20 +1014,20 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) info->s->state.key_root[keynr] = new_root; } info->update= HA_STATE_DELETED; - return 0; + DBUG_RETURN(0); err1: - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } case 1: /* not found */ { my_errno = HA_ERR_KEY_NOT_FOUND; - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } default: case -1: /* error */ { - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ } } } diff --git a/myisam/rt_key.c b/myisam/rt_key.c index e2a402fbefd..b969ac30569 100644 --- a/myisam/rt_key.c +++ b/myisam/rt_key.c @@ -35,6 +35,7 @@ int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, { uint page_size = mi_getint(page_buf); uint nod_flag = mi_test_if_nod(page_buf); + DBUG_ENTER("rtree_add_key"); if (page_size + key_length + info->s->base.rec_reflength <= keyinfo->block_length) @@ -43,22 +44,26 @@ int rtree_add_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, if (nod_flag) { /* save key */ + DBUG_ASSERT(_mi_kpos(nod_flag, key) < info->state->key_file_length); memcpy(rt_PAGE_END(page_buf), key - nod_flag, key_length + nod_flag); page_size += key_length + nod_flag; } else { /* save key */ + DBUG_ASSERT(_mi_dpos(info, nod_flag, key + key_length + + info->s->base.rec_reflength) < + info->state->data_file_length + info->s->base.pack_reclength); memcpy(rt_PAGE_END(page_buf), key, key_length + info->s->base.rec_reflength); page_size += key_length + info->s->base.rec_reflength; } mi_putint(page_buf, page_size, nod_flag); - return 0; + DBUG_RETURN(0); } - return (rtree_split_page(info, keyinfo, page_buf, key, key_length, - new_page) ? -1 : 1); + DBUG_RETURN((rtree_split_page(info, keyinfo, page_buf, key, key_length, + new_page) ? -1 : 1)); } /* @@ -90,11 +95,13 @@ int rtree_delete_key(MI_INFO *info, uchar *page_buf, uchar *key, int rtree_set_key_mbr(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key, uint key_length, my_off_t child_page) { + DBUG_ENTER("rtree_set_key_mbr"); + if (!_mi_fetch_keypage(info, keyinfo, child_page, DFLT_INIT_HITS, info->buff, 0)) - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ - return rtree_page_mbr(info, keyinfo->seg, info->buff, key, key_length); + DBUG_RETURN(rtree_page_mbr(info, keyinfo->seg, info->buff, key, key_length)); } #endif /*HAVE_RTREE_KEYS*/ diff --git a/myisam/rt_split.c b/myisam/rt_split.c index 87da22a93c7..d400274064b 100644 --- a/myisam/rt_split.c +++ b/myisam/rt_split.c @@ -268,13 +268,15 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, info->s->base.rec_reflength); int max_keys = (mi_getint(page)-2) / (full_length); + DBUG_ENTER("rtree_split_page"); + DBUG_PRINT("rtree", ("splitting block")); n_dim = keyinfo->keysegs / 2; if (!(coord_buf= (double*) my_alloca(n_dim * 2 * sizeof(double) * (max_keys + 1 + 4) + sizeof(SplitStruct) * (max_keys + 1)))) - return -1; + DBUG_RETURN(-1); /* purecov: inspected */ task= (SplitStruct *)(coord_buf + n_dim * 2 * (max_keys + 1 + 4)); @@ -346,12 +348,13 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, else err_code= _mi_write_keypage(info, keyinfo, *new_page_offs, DFLT_INIT_HITS, new_page); + DBUG_PRINT("rtree", ("split new block: %lu", (ulong) *new_page_offs)); my_afree((byte*)new_page); split_err: my_afree((byte*) coord_buf); - return err_code; + DBUG_RETURN(err_code); } #endif /*HAVE_RTREE_KEYS*/ diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index bdb3de4de75..762dda4e501 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -868,3 +868,555 @@ SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0)); 1 1 DROP TABLE t1; +CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment, +c2 varchar(15) collate utf8_bin default NULL, +c1 varchar(15) collate utf8_bin default NULL, +c3 varchar(10) collate utf8_bin default NULL, +spatial_point point NOT NULL, +PRIMARY KEY(id), +SPATIAL KEY (spatial_point(32)) +)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES +('y', 's', 'j', GeomFromText('POINT(167 74)')), +('r', 'n', 'd', GeomFromText('POINT(215 118)')), +('g', 'n', 'e', GeomFromText('POINT(203 98)')), +('h', 'd', 'd', GeomFromText('POINT(54 193)')), +('r', 'x', 'y', GeomFromText('POINT(47 69)')), +('t', 'q', 'r', GeomFromText('POINT(109 42)')), +('a', 'z', 'd', GeomFromText('POINT(0 154)')), +('x', 'v', 'o', GeomFromText('POINT(174 131)')), +('b', 'r', 'a', GeomFromText('POINT(114 253)')), +('x', 'z', 'i', GeomFromText('POINT(163 21)')), +('w', 'p', 'i', GeomFromText('POINT(42 102)')), +('g', 'j', 'j', GeomFromText('POINT(170 133)')), +('m', 'g', 'n', GeomFromText('POINT(28 22)')), +('b', 'z', 'h', GeomFromText('POINT(174 28)')), +('q', 'k', 'f', GeomFromText('POINT(233 73)')), +('w', 'w', 'a', GeomFromText('POINT(124 200)')), +('t', 'j', 'w', GeomFromText('POINT(252 101)')), +('d', 'r', 'd', GeomFromText('POINT(98 18)')), +('w', 'o', 'y', GeomFromText('POINT(165 31)')), +('y', 'h', 't', GeomFromText('POINT(14 220)')), +('d', 'p', 'u', GeomFromText('POINT(223 196)')), +('g', 'y', 'g', GeomFromText('POINT(207 96)')), +('x', 'm', 'n', GeomFromText('POINT(214 3)')), +('g', 'v', 'e', GeomFromText('POINT(140 205)')), +('g', 'm', 'm', GeomFromText('POINT(10 236)')), +('i', 'r', 'j', GeomFromText('POINT(137 228)')), +('w', 's', 'p', GeomFromText('POINT(115 6)')), +('o', 'n', 'k', GeomFromText('POINT(158 129)')), +('j', 'h', 'l', GeomFromText('POINT(129 72)')), +('f', 'x', 'l', GeomFromText('POINT(139 207)')), +('u', 'd', 'n', GeomFromText('POINT(125 109)')), +('b', 'a', 'z', GeomFromText('POINT(30 32)')), +('m', 'h', 'o', GeomFromText('POINT(251 251)')), +('f', 'r', 'd', GeomFromText('POINT(243 211)')), +('b', 'd', 'r', GeomFromText('POINT(232 80)')), +('g', 'k', 'v', GeomFromText('POINT(15 100)')), +('i', 'f', 'c', GeomFromText('POINT(109 66)')), +('r', 't', 'j', GeomFromText('POINT(178 6)')), +('y', 'n', 'f', GeomFromText('POINT(233 211)')), +('f', 'y', 'm', GeomFromText('POINT(99 16)')), +('z', 'q', 'l', GeomFromText('POINT(39 49)')), +('j', 'c', 'r', GeomFromText('POINT(75 187)')), +('c', 'y', 'y', GeomFromText('POINT(246 253)')), +('w', 'u', 'd', GeomFromText('POINT(56 190)')), +('n', 'q', 'm', GeomFromText('POINT(73 149)')), +('d', 'y', 'a', GeomFromText('POINT(134 6)')), +('z', 's', 'w', GeomFromText('POINT(216 225)')), +('d', 'u', 'k', GeomFromText('POINT(132 70)')), +('f', 'v', 't', GeomFromText('POINT(187 141)')), +('r', 'r', 'a', GeomFromText('POINT(152 39)')), +('y', 'p', 'o', GeomFromText('POINT(45 27)')), +('p', 'n', 'm', GeomFromText('POINT(228 148)')), +('e', 'g', 'e', GeomFromText('POINT(88 81)')), +('m', 'a', 'h', GeomFromText('POINT(35 29)')), +('m', 'h', 'f', GeomFromText('POINT(30 71)')), +('h', 'k', 'i', GeomFromText('POINT(244 78)')), +('z', 'v', 'd', GeomFromText('POINT(241 38)')), +('q', 'l', 'j', GeomFromText('POINT(13 71)')), +('s', 'p', 'g', GeomFromText('POINT(108 38)')), +('q', 's', 'j', GeomFromText('POINT(92 101)')), +('l', 'h', 'g', GeomFromText('POINT(120 78)')), +('w', 't', 'b', GeomFromText('POINT(193 109)')), +('b', 's', 's', GeomFromText('POINT(223 211)')), +('w', 'w', 'y', GeomFromText('POINT(122 42)')), +('q', 'c', 'c', GeomFromText('POINT(104 102)')), +('w', 'g', 'n', GeomFromText('POINT(213 120)')), +('p', 'q', 'a', GeomFromText('POINT(247 148)')), +('c', 'z', 'e', GeomFromText('POINT(18 106)')), +('z', 'u', 'n', GeomFromText('POINT(70 133)')), +('j', 'n', 'x', GeomFromText('POINT(232 13)')), +('e', 'h', 'f', GeomFromText('POINT(22 135)')), +('w', 'l', 'f', GeomFromText('POINT(9 180)')), +('a', 'v', 'q', GeomFromText('POINT(163 228)')), +('i', 'z', 'o', GeomFromText('POINT(180 100)')), +('e', 'c', 'l', GeomFromText('POINT(182 231)')), +('c', 'k', 'o', GeomFromText('POINT(19 60)')), +('q', 'f', 'p', GeomFromText('POINT(79 95)')), +('m', 'd', 'r', GeomFromText('POINT(3 127)')), +('m', 'e', 't', GeomFromText('POINT(136 154)')), +('w', 'w', 'w', GeomFromText('POINT(102 15)')), +('l', 'n', 'q', GeomFromText('POINT(71 196)')), +('p', 'k', 'c', GeomFromText('POINT(47 139)')), +('j', 'o', 'r', GeomFromText('POINT(177 128)')), +('j', 'q', 'a', GeomFromText('POINT(170 6)')), +('b', 'a', 'o', GeomFromText('POINT(63 211)')), +('g', 's', 'o', GeomFromText('POINT(144 251)')), +('w', 'u', 'w', GeomFromText('POINT(221 214)')), +('g', 'a', 'm', GeomFromText('POINT(14 102)')), +('u', 'q', 'z', GeomFromText('POINT(86 200)')), +('k', 'a', 'm', GeomFromText('POINT(144 222)')), +('j', 'u', 'r', GeomFromText('POINT(216 142)')), +('q', 'k', 'v', GeomFromText('POINT(121 236)')), +('p', 'o', 'r', GeomFromText('POINT(108 102)')), +('b', 'd', 'x', GeomFromText('POINT(127 198)')), +('k', 's', 'a', GeomFromText('POINT(2 150)')), +('f', 'm', 'f', GeomFromText('POINT(160 191)')), +('q', 'y', 'x', GeomFromText('POINT(98 111)')), +('o', 'f', 'm', GeomFromText('POINT(232 218)')), +('c', 'w', 'j', GeomFromText('POINT(156 165)')), +('s', 'q', 'v', GeomFromText('POINT(98 161)')); +SET @@RAND_SEED1=692635050, @@RAND_SEED2=297339954; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=159925977, @@RAND_SEED2=942570618; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=328169745, @@RAND_SEED2=410451954; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=178507359, @@RAND_SEED2=332493072; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=1034033013, @@RAND_SEED2=558966507; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +UPDATE t1 set spatial_point=GeomFromText('POINT(230 9)') where c1 like 'y%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(95 35)') where c1 like 'j%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(93 99)') where c1 like 'a%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(19 81)') where c1 like 'r%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(20 177)') where c1 like 'h%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(221 193)') where c1 like 'u%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(195 205)') where c1 like 'd%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(15 213)') where c1 like 'u%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(214 63)') where c1 like 'n%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(243 171)') where c1 like 'c%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(198 82)') where c1 like 'y%'; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES +('f', 'y', 'p', GeomFromText('POINT(109 235)')), +('b', 'e', 'v', GeomFromText('POINT(20 48)')), +('i', 'u', 'f', GeomFromText('POINT(15 55)')), +('o', 'r', 'z', GeomFromText('POINT(105 64)')), +('a', 'p', 'a', GeomFromText('POINT(142 236)')), +('g', 'i', 'k', GeomFromText('POINT(10 49)')), +('x', 'z', 'x', GeomFromText('POINT(192 200)')), +('c', 'v', 'r', GeomFromText('POINT(94 168)')), +('y', 'z', 'e', GeomFromText('POINT(141 51)')), +('h', 'm', 'd', GeomFromText('POINT(35 251)')), +('v', 'm', 'q', GeomFromText('POINT(44 90)')), +('j', 'l', 'z', GeomFromText('POINT(67 237)')), +('i', 'v', 'a', GeomFromText('POINT(75 14)')), +('b', 'q', 't', GeomFromText('POINT(153 33)')), +('e', 'm', 'a', GeomFromText('POINT(247 49)')), +('l', 'y', 'g', GeomFromText('POINT(56 203)')), +('v', 'o', 'r', GeomFromText('POINT(90 54)')), +('r', 'n', 'd', GeomFromText('POINT(135 83)')), +('j', 't', 'u', GeomFromText('POINT(174 239)')), +('u', 'n', 'g', GeomFromText('POINT(104 191)')), +('p', 'q', 'y', GeomFromText('POINT(63 171)')), +('o', 'q', 'p', GeomFromText('POINT(192 103)')), +('f', 'x', 'e', GeomFromText('POINT(244 30)')), +('n', 'x', 'c', GeomFromText('POINT(92 103)')), +('r', 'q', 'z', GeomFromText('POINT(166 20)')), +('s', 'a', 'j', GeomFromText('POINT(137 205)')), +('z', 't', 't', GeomFromText('POINT(99 134)')), +('o', 'm', 'j', GeomFromText('POINT(217 3)')), +('n', 'h', 'j', GeomFromText('POINT(211 17)')), +('v', 'v', 'a', GeomFromText('POINT(41 137)')), +('q', 'o', 'j', GeomFromText('POINT(5 92)')), +('z', 'y', 'e', GeomFromText('POINT(175 212)')), +('j', 'z', 'h', GeomFromText('POINT(224 194)')), +('a', 'g', 'm', GeomFromText('POINT(31 119)')), +('p', 'c', 'f', GeomFromText('POINT(17 221)')), +('t', 'h', 'k', GeomFromText('POINT(26 203)')), +('u', 'w', 'p', GeomFromText('POINT(47 185)')), +('z', 'a', 'c', GeomFromText('POINT(61 133)')), +('u', 'k', 'a', GeomFromText('POINT(210 115)')), +('k', 'f', 'h', GeomFromText('POINT(125 113)')), +('t', 'v', 'y', GeomFromText('POINT(12 239)')), +('u', 'v', 'd', GeomFromText('POINT(90 24)')), +('m', 'y', 'w', GeomFromText('POINT(25 243)')), +('d', 'n', 'g', GeomFromText('POINT(122 92)')), +('z', 'm', 'f', GeomFromText('POINT(235 110)')), +('q', 'd', 'f', GeomFromText('POINT(233 217)')), +('a', 'v', 'u', GeomFromText('POINT(69 59)')), +('x', 'k', 'p', GeomFromText('POINT(240 14)')), +('i', 'v', 'r', GeomFromText('POINT(154 42)')), +('w', 'h', 'l', GeomFromText('POINT(178 156)')), +('d', 'h', 'n', GeomFromText('POINT(65 157)')), +('c', 'k', 'z', GeomFromText('POINT(62 33)')), +('e', 'l', 'w', GeomFromText('POINT(162 1)')), +('r', 'f', 'i', GeomFromText('POINT(127 71)')), +('q', 'm', 'c', GeomFromText('POINT(63 118)')), +('c', 'h', 'u', GeomFromText('POINT(205 203)')), +('d', 't', 'p', GeomFromText('POINT(234 87)')), +('s', 'g', 'h', GeomFromText('POINT(149 34)')), +('o', 'b', 'q', GeomFromText('POINT(159 179)')), +('k', 'u', 'f', GeomFromText('POINT(202 254)')), +('u', 'f', 'g', GeomFromText('POINT(70 15)')), +('x', 's', 'b', GeomFromText('POINT(25 181)')), +('s', 'c', 'g', GeomFromText('POINT(252 17)')), +('a', 'c', 'f', GeomFromText('POINT(89 67)')), +('r', 'e', 'q', GeomFromText('POINT(55 54)')), +('f', 'i', 'k', GeomFromText('POINT(178 230)')), +('p', 'e', 'l', GeomFromText('POINT(198 28)')), +('w', 'o', 'd', GeomFromText('POINT(204 189)')), +('c', 'a', 'g', GeomFromText('POINT(230 178)')), +('r', 'o', 'e', GeomFromText('POINT(61 116)')), +('w', 'a', 'a', GeomFromText('POINT(178 237)')), +('v', 'd', 'e', GeomFromText('POINT(70 85)')), +('k', 'c', 'e', GeomFromText('POINT(147 118)')), +('d', 'q', 't', GeomFromText('POINT(218 77)')), +('k', 'g', 'f', GeomFromText('POINT(192 113)')), +('w', 'n', 'e', GeomFromText('POINT(92 124)')), +('r', 'm', 'q', GeomFromText('POINT(130 65)')), +('o', 'r', 'r', GeomFromText('POINT(174 233)')), +('k', 'n', 't', GeomFromText('POINT(175 147)')), +('q', 'm', 'r', GeomFromText('POINT(18 208)')), +('l', 'd', 'i', GeomFromText('POINT(13 104)')), +('w', 'o', 'y', GeomFromText('POINT(207 39)')), +('p', 'u', 'o', GeomFromText('POINT(114 31)')), +('y', 'a', 'p', GeomFromText('POINT(106 59)')), +('a', 'x', 'z', GeomFromText('POINT(17 57)')), +('v', 'h', 'x', GeomFromText('POINT(170 13)')), +('t', 's', 'u', GeomFromText('POINT(84 18)')), +('z', 'z', 'f', GeomFromText('POINT(250 197)')), +('l', 'z', 't', GeomFromText('POINT(59 80)')), +('j', 'g', 's', GeomFromText('POINT(54 26)')), +('g', 'v', 'm', GeomFromText('POINT(89 98)')), +('q', 'v', 'b', GeomFromText('POINT(39 240)')), +('x', 'k', 'v', GeomFromText('POINT(246 207)')), +('k', 'u', 'i', GeomFromText('POINT(105 111)')), +('w', 'z', 's', GeomFromText('POINT(235 8)')), +('d', 'd', 'd', GeomFromText('POINT(105 4)')), +('c', 'z', 'q', GeomFromText('POINT(13 140)')), +('m', 'k', 'i', GeomFromText('POINT(208 120)')), +('g', 'a', 'g', GeomFromText('POINT(9 182)')), +('z', 'j', 'r', GeomFromText('POINT(149 153)')), +('h', 'f', 'g', GeomFromText('POINT(81 236)')), +('m', 'e', 'q', GeomFromText('POINT(209 215)')), +('c', 'h', 'y', GeomFromText('POINT(235 70)')), +('i', 'e', 'g', GeomFromText('POINT(138 26)')), +('m', 't', 'u', GeomFromText('POINT(119 237)')), +('o', 'w', 's', GeomFromText('POINT(193 166)')), +('f', 'm', 'q', GeomFromText('POINT(85 96)')), +('x', 'l', 'x', GeomFromText('POINT(58 115)')), +('x', 'q', 'u', GeomFromText('POINT(108 210)')), +('b', 'h', 'i', GeomFromText('POINT(250 139)')), +('y', 'd', 'x', GeomFromText('POINT(199 135)')), +('w', 'h', 'p', GeomFromText('POINT(247 233)')), +('p', 'z', 't', GeomFromText('POINT(148 249)')), +('q', 'a', 'u', GeomFromText('POINT(174 78)')), +('v', 't', 'm', GeomFromText('POINT(70 228)')), +('t', 'n', 'f', GeomFromText('POINT(123 2)')), +('x', 't', 'b', GeomFromText('POINT(35 50)')), +('r', 'j', 'f', GeomFromText('POINT(200 51)')), +('s', 'q', 'o', GeomFromText('POINT(23 184)')), +('u', 'v', 'z', GeomFromText('POINT(7 113)')), +('v', 'u', 'l', GeomFromText('POINT(145 190)')), +('o', 'k', 'i', GeomFromText('POINT(161 122)')), +('l', 'y', 'e', GeomFromText('POINT(17 232)')), +('t', 'b', 'e', GeomFromText('POINT(120 50)')), +('e', 's', 'u', GeomFromText('POINT(254 1)')), +('d', 'd', 'u', GeomFromText('POINT(167 140)')), +('o', 'b', 'x', GeomFromText('POINT(186 237)')), +('m', 's', 's', GeomFromText('POINT(172 149)')), +('t', 'y', 'a', GeomFromText('POINT(149 85)')), +('x', 't', 'r', GeomFromText('POINT(10 165)')), +('g', 'c', 'e', GeomFromText('POINT(95 165)')), +('e', 'e', 'z', GeomFromText('POINT(98 65)')), +('f', 'v', 'i', GeomFromText('POINT(149 144)')), +('o', 'p', 'm', GeomFromText('POINT(233 67)')), +('t', 'u', 'b', GeomFromText('POINT(109 215)')), +('o', 'o', 'b', GeomFromText('POINT(130 48)')), +('e', 'm', 'h', GeomFromText('POINT(88 189)')), +('e', 'v', 'y', GeomFromText('POINT(55 29)')), +('e', 't', 'm', GeomFromText('POINT(129 55)')), +('p', 'p', 'i', GeomFromText('POINT(126 222)')), +('c', 'i', 'c', GeomFromText('POINT(19 158)')), +('c', 'b', 's', GeomFromText('POINT(13 19)')), +('u', 'y', 'a', GeomFromText('POINT(114 5)')), +('a', 'o', 'f', GeomFromText('POINT(227 232)')), +('t', 'c', 'z', GeomFromText('POINT(63 62)')), +('d', 'o', 'k', GeomFromText('POINT(48 228)')), +('x', 'c', 'e', GeomFromText('POINT(204 2)')), +('e', 'e', 'g', GeomFromText('POINT(125 43)')), +('o', 'r', 'f', GeomFromText('POINT(171 140)')); +UPDATE t1 set spatial_point=GeomFromText('POINT(163 157)') where c1 like 'w%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(53 151)') where c1 like 'd%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(96 183)') where c1 like 'r%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(57 91)') where c1 like 'q%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(202 110)') where c1 like 'c%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(120 137)') where c1 like 'w%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(207 147)') where c1 like 'c%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(31 125)') where c1 like 'e%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(27 36)') where c1 like 'r%'; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES +('b', 'c', 'e', GeomFromText('POINT(41 137)')), +('p', 'y', 'k', GeomFromText('POINT(50 22)')), +('s', 'c', 'h', GeomFromText('POINT(208 173)')), +('x', 'u', 'l', GeomFromText('POINT(199 175)')), +('s', 'r', 'h', GeomFromText('POINT(85 192)')), +('j', 'k', 'u', GeomFromText('POINT(18 25)')), +('p', 'w', 'h', GeomFromText('POINT(152 197)')), +('e', 'd', 'c', GeomFromText('POINT(229 3)')), +('o', 'x', 'k', GeomFromText('POINT(187 155)')), +('o', 'b', 'k', GeomFromText('POINT(208 150)')), +('d', 'a', 'j', GeomFromText('POINT(70 87)')), +('f', 'e', 'k', GeomFromText('POINT(156 96)')), +('u', 'y', 'p', GeomFromText('POINT(239 193)')), +('n', 'v', 'p', GeomFromText('POINT(223 98)')), +('z', 'j', 'r', GeomFromText('POINT(87 89)')), +('h', 'x', 'x', GeomFromText('POINT(92 0)')), +('r', 'v', 'r', GeomFromText('POINT(159 139)')), +('v', 'g', 'g', GeomFromText('POINT(16 229)')), +('z', 'k', 'u', GeomFromText('POINT(99 52)')), +('p', 'p', 'o', GeomFromText('POINT(105 125)')), +('w', 'h', 'y', GeomFromText('POINT(105 154)')), +('v', 'y', 'z', GeomFromText('POINT(134 238)')), +('x', 'o', 'o', GeomFromText('POINT(178 88)')), +('z', 'w', 'd', GeomFromText('POINT(123 60)')), +('q', 'f', 'u', GeomFromText('POINT(64 90)')), +('s', 'n', 't', GeomFromText('POINT(50 138)')), +('v', 'p', 't', GeomFromText('POINT(114 91)')), +('a', 'o', 'n', GeomFromText('POINT(78 43)')), +('k', 'u', 'd', GeomFromText('POINT(185 161)')), +('w', 'd', 'n', GeomFromText('POINT(25 92)')), +('k', 'w', 'a', GeomFromText('POINT(59 238)')), +('t', 'c', 'f', GeomFromText('POINT(65 87)')), +('g', 's', 'p', GeomFromText('POINT(238 126)')), +('d', 'n', 'y', GeomFromText('POINT(107 173)')), +('l', 'a', 'w', GeomFromText('POINT(125 152)')), +('m', 'd', 'j', GeomFromText('POINT(146 53)')), +('q', 'm', 'c', GeomFromText('POINT(217 187)')), +('i', 'r', 'r', GeomFromText('POINT(6 113)')), +('e', 'j', 'b', GeomFromText('POINT(37 83)')), +('w', 'w', 'h', GeomFromText('POINT(83 199)')), +('k', 'b', 's', GeomFromText('POINT(170 64)')), +('s', 'b', 'c', GeomFromText('POINT(163 130)')), +('c', 'h', 'a', GeomFromText('POINT(141 3)')), +('k', 'j', 'u', GeomFromText('POINT(143 76)')), +('r', 'h', 'o', GeomFromText('POINT(243 92)')), +('i', 'd', 'b', GeomFromText('POINT(205 13)')), +('r', 'y', 'q', GeomFromText('POINT(138 8)')), +('m', 'o', 'i', GeomFromText('POINT(36 45)')), +('v', 'g', 'm', GeomFromText('POINT(0 40)')), +('f', 'e', 'i', GeomFromText('POINT(76 6)')), +('c', 'q', 'q', GeomFromText('POINT(115 248)')), +('x', 'c', 'i', GeomFromText('POINT(29 74)')), +('l', 's', 't', GeomFromText('POINT(83 18)')), +('t', 't', 'a', GeomFromText('POINT(26 168)')), +('u', 'n', 'x', GeomFromText('POINT(200 110)')), +('j', 'b', 'd', GeomFromText('POINT(216 136)')), +('s', 'p', 'w', GeomFromText('POINT(38 156)')), +('f', 'b', 'v', GeomFromText('POINT(29 186)')), +('v', 'e', 'r', GeomFromText('POINT(149 40)')), +('v', 't', 'm', GeomFromText('POINT(184 24)')), +('y', 'g', 'a', GeomFromText('POINT(219 105)')), +('s', 'f', 'i', GeomFromText('POINT(114 130)')), +('e', 'q', 'h', GeomFromText('POINT(203 135)')), +('h', 'g', 'b', GeomFromText('POINT(9 208)')), +('o', 'l', 'r', GeomFromText('POINT(245 79)')), +('s', 's', 'v', GeomFromText('POINT(238 198)')), +('w', 'w', 'z', GeomFromText('POINT(209 232)')), +('v', 'd', 'n', GeomFromText('POINT(30 193)')), +('q', 'w', 'k', GeomFromText('POINT(133 18)')), +('o', 'h', 'o', GeomFromText('POINT(42 140)')), +('f', 'f', 'h', GeomFromText('POINT(145 1)')), +('u', 's', 'r', GeomFromText('POINT(70 62)')), +('x', 'n', 'q', GeomFromText('POINT(33 86)')), +('u', 'p', 'v', GeomFromText('POINT(232 220)')), +('z', 'e', 'a', GeomFromText('POINT(130 69)')), +('r', 'u', 'z', GeomFromText('POINT(243 241)')), +('b', 'n', 't', GeomFromText('POINT(120 12)')), +('u', 'f', 's', GeomFromText('POINT(190 212)')), +('a', 'd', 'q', GeomFromText('POINT(235 191)')), +('f', 'q', 'm', GeomFromText('POINT(176 2)')), +('n', 'c', 's', GeomFromText('POINT(218 163)')), +('e', 'm', 'h', GeomFromText('POINT(163 108)')), +('c', 'f', 'l', GeomFromText('POINT(220 115)')), +('c', 'v', 'q', GeomFromText('POINT(66 45)')), +('w', 'v', 'x', GeomFromText('POINT(251 220)')), +('f', 'w', 'z', GeomFromText('POINT(146 149)')), +('h', 'n', 'h', GeomFromText('POINT(148 128)')), +('y', 'k', 'v', GeomFromText('POINT(28 110)')), +('c', 'x', 'q', GeomFromText('POINT(13 13)')), +('e', 'd', 's', GeomFromText('POINT(91 190)')), +('c', 'w', 'c', GeomFromText('POINT(10 231)')), +('u', 'j', 'n', GeomFromText('POINT(250 21)')), +('w', 'n', 'x', GeomFromText('POINT(141 69)')), +('f', 'p', 'y', GeomFromText('POINT(228 246)')), +('d', 'q', 'f', GeomFromText('POINT(194 22)')), +('d', 'z', 'l', GeomFromText('POINT(233 181)')), +('c', 'a', 'q', GeomFromText('POINT(183 96)')), +('m', 'i', 'd', GeomFromText('POINT(117 226)')), +('z', 'y', 'y', GeomFromText('POINT(62 81)')), +('g', 'v', 'm', GeomFromText('POINT(66 158)')); +SET @@RAND_SEED1=481064922, @@RAND_SEED2=438133497; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=280535103, @@RAND_SEED2=444518646; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=1072017234, @@RAND_SEED2=484203885; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=358851897, @@RAND_SEED2=358495224; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=509031459, @@RAND_SEED2=675962925; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +UPDATE t1 set spatial_point=GeomFromText('POINT(61 203)') where c1 like 'y%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(202 194)') where c1 like 'f%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(228 18)') where c1 like 'h%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(88 18)') where c1 like 'l%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(176 94)') where c1 like 'e%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(44 47)') where c1 like 'g%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(95 191)') where c1 like 'b%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(179 218)') where c1 like 'y%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(239 40)') where c1 like 'g%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(248 41)') where c1 like 'q%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(167 82)') where c1 like 't%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(13 104)') where c1 like 'u%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(139 84)') where c1 like 'a%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(145 108)') where c1 like 'p%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(147 57)') where c1 like 't%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(217 144)') where c1 like 'n%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(160 224)') where c1 like 'w%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(38 28)') where c1 like 'j%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(104 114)') where c1 like 'q%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(88 19)') where c1 like 'c%'; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES +('f', 'x', 'p', GeomFromText('POINT(92 181)')), +('s', 'i', 'c', GeomFromText('POINT(49 60)')), +('c', 'c', 'i', GeomFromText('POINT(7 57)')), +('n', 'g', 'k', GeomFromText('POINT(252 105)')), +('g', 'b', 'm', GeomFromText('POINT(180 11)')), +('u', 'l', 'r', GeomFromText('POINT(32 90)')), +('c', 'x', 'e', GeomFromText('POINT(143 24)')), +('x', 'u', 'a', GeomFromText('POINT(123 92)')), +('s', 'b', 'h', GeomFromText('POINT(190 108)')), +('c', 'x', 'b', GeomFromText('POINT(104 100)')), +('i', 'd', 't', GeomFromText('POINT(214 104)')), +('r', 'w', 'g', GeomFromText('POINT(29 67)')), +('b', 'f', 'g', GeomFromText('POINT(149 46)')), +('r', 'r', 'd', GeomFromText('POINT(242 196)')), +('j', 'l', 'a', GeomFromText('POINT(90 196)')), +('e', 't', 'b', GeomFromText('POINT(190 64)')), +('l', 'x', 'w', GeomFromText('POINT(250 73)')), +('q', 'y', 'r', GeomFromText('POINT(120 182)')), +('s', 'j', 'a', GeomFromText('POINT(180 175)')), +('n', 'i', 'y', GeomFromText('POINT(124 136)')), +('s', 'x', 's', GeomFromText('POINT(176 209)')), +('u', 'f', 's', GeomFromText('POINT(215 173)')), +('m', 'j', 'x', GeomFromText('POINT(44 140)')), +('v', 'g', 'x', GeomFromText('POINT(177 233)')), +('u', 't', 'b', GeomFromText('POINT(136 197)')), +('f', 'g', 'b', GeomFromText('POINT(10 8)')), +('v', 'c', 'j', GeomFromText('POINT(13 81)')), +('d', 's', 'q', GeomFromText('POINT(200 100)')), +('a', 'p', 'j', GeomFromText('POINT(33 40)')), +('i', 'c', 'g', GeomFromText('POINT(168 204)')), +('k', 'h', 'i', GeomFromText('POINT(93 243)')), +('s', 'b', 's', GeomFromText('POINT(157 13)')), +('v', 'l', 'l', GeomFromText('POINT(103 6)')), +('r', 'b', 'k', GeomFromText('POINT(244 137)')), +('l', 'd', 'r', GeomFromText('POINT(162 254)')), +('q', 'b', 'z', GeomFromText('POINT(136 246)')), +('x', 'x', 'p', GeomFromText('POINT(120 37)')), +('m', 'e', 'z', GeomFromText('POINT(203 167)')), +('q', 'n', 'p', GeomFromText('POINT(94 119)')), +('b', 'g', 'u', GeomFromText('POINT(93 248)')), +('r', 'v', 'v', GeomFromText('POINT(53 88)')), +('y', 'a', 'i', GeomFromText('POINT(98 219)')), +('a', 's', 'g', GeomFromText('POINT(173 138)')), +('c', 'a', 't', GeomFromText('POINT(235 135)')), +('q', 'm', 'd', GeomFromText('POINT(224 208)')), +('e', 'p', 'k', GeomFromText('POINT(161 238)')), +('n', 'g', 'q', GeomFromText('POINT(35 204)')), +('t', 't', 'x', GeomFromText('POINT(230 178)')), +('w', 'f', 'a', GeomFromText('POINT(150 221)')), +('z', 'm', 'z', GeomFromText('POINT(119 42)')), +('l', 'j', 's', GeomFromText('POINT(97 96)')), +('f', 'z', 'x', GeomFromText('POINT(208 65)')), +('i', 'v', 'c', GeomFromText('POINT(145 79)')), +('l', 'f', 'k', GeomFromText('POINT(83 234)')), +('u', 'a', 's', GeomFromText('POINT(250 49)')), +('o', 'k', 'p', GeomFromText('POINT(46 50)')), +('d', 'e', 'z', GeomFromText('POINT(30 198)')), +('r', 'r', 'l', GeomFromText('POINT(78 189)')), +('y', 'l', 'f', GeomFromText('POINT(188 132)')), +('d', 'q', 'm', GeomFromText('POINT(247 107)')), +('p', 'j', 'n', GeomFromText('POINT(148 227)')), +('b', 'o', 'i', GeomFromText('POINT(172 25)')), +('e', 'v', 'd', GeomFromText('POINT(94 248)')), +('q', 'd', 'f', GeomFromText('POINT(15 29)')), +('w', 'b', 'b', GeomFromText('POINT(74 111)')), +('g', 'q', 'f', GeomFromText('POINT(107 215)')), +('o', 'h', 'r', GeomFromText('POINT(25 168)')), +('u', 't', 'w', GeomFromText('POINT(251 188)')), +('h', 's', 'w', GeomFromText('POINT(254 247)')), +('f', 'f', 'b', GeomFromText('POINT(166 103)')); +SET @@RAND_SEED1=866613816, @@RAND_SEED2=92289615; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES +('l', 'c', 'l', GeomFromText('POINT(202 98)')), +('k', 'c', 'b', GeomFromText('POINT(46 206)')), +('r', 'y', 'm', GeomFromText('POINT(74 140)')), +('y', 'z', 'd', GeomFromText('POINT(200 160)')), +('s', 'y', 's', GeomFromText('POINT(156 205)')), +('u', 'v', 'p', GeomFromText('POINT(86 82)')), +('j', 's', 's', GeomFromText('POINT(91 233)')), +('x', 'j', 'f', GeomFromText('POINT(3 14)')), +('l', 'z', 'v', GeomFromText('POINT(123 156)')), +('h', 'i', 'o', GeomFromText('POINT(145 229)')), +('o', 'r', 'd', GeomFromText('POINT(15 22)')), +('f', 'x', 't', GeomFromText('POINT(21 60)')), +('t', 'g', 'h', GeomFromText('POINT(50 153)')), +('g', 'u', 'b', GeomFromText('POINT(82 85)')), +('v', 'a', 'p', GeomFromText('POINT(231 178)')), +('n', 'v', 'o', GeomFromText('POINT(183 25)')), +('j', 'n', 'm', GeomFromText('POINT(50 144)')), +('e', 'f', 'i', GeomFromText('POINT(46 16)')), +('d', 'w', 'a', GeomFromText('POINT(66 6)')), +('f', 'x', 'a', GeomFromText('POINT(107 197)')), +('m', 'o', 'a', GeomFromText('POINT(142 80)')), +('q', 'l', 'g', GeomFromText('POINT(251 23)')), +('c', 's', 's', GeomFromText('POINT(158 43)')), +('y', 'd', 'o', GeomFromText('POINT(196 228)')), +('d', 'p', 'l', GeomFromText('POINT(107 5)')), +('h', 'a', 'b', GeomFromText('POINT(183 166)')), +('m', 'w', 'p', GeomFromText('POINT(19 59)')), +('b', 'y', 'o', GeomFromText('POINT(178 30)')), +('x', 'w', 'i', GeomFromText('POINT(168 94)')), +('t', 'k', 'z', GeomFromText('POINT(171 5)')), +('r', 'm', 'a', GeomFromText('POINT(222 19)')), +('u', 'v', 'e', GeomFromText('POINT(224 80)')), +('q', 'r', 'k', GeomFromText('POINT(212 218)')), +('d', 'p', 'j', GeomFromText('POINT(169 7)')), +('d', 'r', 'v', GeomFromText('POINT(193 23)')), +('n', 'y', 'y', GeomFromText('POINT(130 178)')), +('m', 'z', 'r', GeomFromText('POINT(81 200)')), +('j', 'e', 'w', GeomFromText('POINT(145 239)')), +('v', 'h', 'x', GeomFromText('POINT(24 105)')), +('z', 'm', 'a', GeomFromText('POINT(175 129)')), +('b', 'c', 'v', GeomFromText('POINT(213 10)')), +('t', 't', 'u', GeomFromText('POINT(2 129)')), +('r', 's', 'v', GeomFromText('POINT(209 192)')), +('x', 'p', 'g', GeomFromText('POINT(43 63)')), +('t', 'e', 'u', GeomFromText('POINT(139 210)')), +('l', 'e', 't', GeomFromText('POINT(245 148)')), +('a', 'i', 'k', GeomFromText('POINT(167 195)')), +('m', 'o', 'h', GeomFromText('POINT(206 120)')), +('g', 'z', 's', GeomFromText('POINT(169 240)')), +('z', 'u', 's', GeomFromText('POINT(202 120)')), +('i', 'b', 'a', GeomFromText('POINT(216 18)')), +('w', 'y', 'g', GeomFromText('POINT(119 236)')), +('h', 'y', 'p', GeomFromText('POINT(161 24)')); +UPDATE t1 set spatial_point=GeomFromText('POINT(33 100)') where c1 like 't%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%'; +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index cdd8d1f3f0f..f28a718cc11 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -242,4 +242,560 @@ INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1))); INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0))); SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0)); DROP TABLE t1; + +# +# Bug#25673 - spatial index corruption, error 126 incorrect key file for table +# +CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment, + c2 varchar(15) collate utf8_bin default NULL, + c1 varchar(15) collate utf8_bin default NULL, + c3 varchar(10) collate utf8_bin default NULL, + spatial_point point NOT NULL, + PRIMARY KEY(id), + SPATIAL KEY (spatial_point(32)) + )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +# +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES + ('y', 's', 'j', GeomFromText('POINT(167 74)')), + ('r', 'n', 'd', GeomFromText('POINT(215 118)')), + ('g', 'n', 'e', GeomFromText('POINT(203 98)')), + ('h', 'd', 'd', GeomFromText('POINT(54 193)')), + ('r', 'x', 'y', GeomFromText('POINT(47 69)')), + ('t', 'q', 'r', GeomFromText('POINT(109 42)')), + ('a', 'z', 'd', GeomFromText('POINT(0 154)')), + ('x', 'v', 'o', GeomFromText('POINT(174 131)')), + ('b', 'r', 'a', GeomFromText('POINT(114 253)')), + ('x', 'z', 'i', GeomFromText('POINT(163 21)')), + ('w', 'p', 'i', GeomFromText('POINT(42 102)')), + ('g', 'j', 'j', GeomFromText('POINT(170 133)')), + ('m', 'g', 'n', GeomFromText('POINT(28 22)')), + ('b', 'z', 'h', GeomFromText('POINT(174 28)')), + ('q', 'k', 'f', GeomFromText('POINT(233 73)')), + ('w', 'w', 'a', GeomFromText('POINT(124 200)')), + ('t', 'j', 'w', GeomFromText('POINT(252 101)')), + ('d', 'r', 'd', GeomFromText('POINT(98 18)')), + ('w', 'o', 'y', GeomFromText('POINT(165 31)')), + ('y', 'h', 't', GeomFromText('POINT(14 220)')), + ('d', 'p', 'u', GeomFromText('POINT(223 196)')), + ('g', 'y', 'g', GeomFromText('POINT(207 96)')), + ('x', 'm', 'n', GeomFromText('POINT(214 3)')), + ('g', 'v', 'e', GeomFromText('POINT(140 205)')), + ('g', 'm', 'm', GeomFromText('POINT(10 236)')), + ('i', 'r', 'j', GeomFromText('POINT(137 228)')), + ('w', 's', 'p', GeomFromText('POINT(115 6)')), + ('o', 'n', 'k', GeomFromText('POINT(158 129)')), + ('j', 'h', 'l', GeomFromText('POINT(129 72)')), + ('f', 'x', 'l', GeomFromText('POINT(139 207)')), + ('u', 'd', 'n', GeomFromText('POINT(125 109)')), + ('b', 'a', 'z', GeomFromText('POINT(30 32)')), + ('m', 'h', 'o', GeomFromText('POINT(251 251)')), + ('f', 'r', 'd', GeomFromText('POINT(243 211)')), + ('b', 'd', 'r', GeomFromText('POINT(232 80)')), + ('g', 'k', 'v', GeomFromText('POINT(15 100)')), + ('i', 'f', 'c', GeomFromText('POINT(109 66)')), + ('r', 't', 'j', GeomFromText('POINT(178 6)')), + ('y', 'n', 'f', GeomFromText('POINT(233 211)')), + ('f', 'y', 'm', GeomFromText('POINT(99 16)')), + ('z', 'q', 'l', GeomFromText('POINT(39 49)')), + ('j', 'c', 'r', GeomFromText('POINT(75 187)')), + ('c', 'y', 'y', GeomFromText('POINT(246 253)')), + ('w', 'u', 'd', GeomFromText('POINT(56 190)')), + ('n', 'q', 'm', GeomFromText('POINT(73 149)')), + ('d', 'y', 'a', GeomFromText('POINT(134 6)')), + ('z', 's', 'w', GeomFromText('POINT(216 225)')), + ('d', 'u', 'k', GeomFromText('POINT(132 70)')), + ('f', 'v', 't', GeomFromText('POINT(187 141)')), + ('r', 'r', 'a', GeomFromText('POINT(152 39)')), + ('y', 'p', 'o', GeomFromText('POINT(45 27)')), + ('p', 'n', 'm', GeomFromText('POINT(228 148)')), + ('e', 'g', 'e', GeomFromText('POINT(88 81)')), + ('m', 'a', 'h', GeomFromText('POINT(35 29)')), + ('m', 'h', 'f', GeomFromText('POINT(30 71)')), + ('h', 'k', 'i', GeomFromText('POINT(244 78)')), + ('z', 'v', 'd', GeomFromText('POINT(241 38)')), + ('q', 'l', 'j', GeomFromText('POINT(13 71)')), + ('s', 'p', 'g', GeomFromText('POINT(108 38)')), + ('q', 's', 'j', GeomFromText('POINT(92 101)')), + ('l', 'h', 'g', GeomFromText('POINT(120 78)')), + ('w', 't', 'b', GeomFromText('POINT(193 109)')), + ('b', 's', 's', GeomFromText('POINT(223 211)')), + ('w', 'w', 'y', GeomFromText('POINT(122 42)')), + ('q', 'c', 'c', GeomFromText('POINT(104 102)')), + ('w', 'g', 'n', GeomFromText('POINT(213 120)')), + ('p', 'q', 'a', GeomFromText('POINT(247 148)')), + ('c', 'z', 'e', GeomFromText('POINT(18 106)')), + ('z', 'u', 'n', GeomFromText('POINT(70 133)')), + ('j', 'n', 'x', GeomFromText('POINT(232 13)')), + ('e', 'h', 'f', GeomFromText('POINT(22 135)')), + ('w', 'l', 'f', GeomFromText('POINT(9 180)')), + ('a', 'v', 'q', GeomFromText('POINT(163 228)')), + ('i', 'z', 'o', GeomFromText('POINT(180 100)')), + ('e', 'c', 'l', GeomFromText('POINT(182 231)')), + ('c', 'k', 'o', GeomFromText('POINT(19 60)')), + ('q', 'f', 'p', GeomFromText('POINT(79 95)')), + ('m', 'd', 'r', GeomFromText('POINT(3 127)')), + ('m', 'e', 't', GeomFromText('POINT(136 154)')), + ('w', 'w', 'w', GeomFromText('POINT(102 15)')), + ('l', 'n', 'q', GeomFromText('POINT(71 196)')), + ('p', 'k', 'c', GeomFromText('POINT(47 139)')), + ('j', 'o', 'r', GeomFromText('POINT(177 128)')), + ('j', 'q', 'a', GeomFromText('POINT(170 6)')), + ('b', 'a', 'o', GeomFromText('POINT(63 211)')), + ('g', 's', 'o', GeomFromText('POINT(144 251)')), + ('w', 'u', 'w', GeomFromText('POINT(221 214)')), + ('g', 'a', 'm', GeomFromText('POINT(14 102)')), + ('u', 'q', 'z', GeomFromText('POINT(86 200)')), + ('k', 'a', 'm', GeomFromText('POINT(144 222)')), + ('j', 'u', 'r', GeomFromText('POINT(216 142)')), + ('q', 'k', 'v', GeomFromText('POINT(121 236)')), + ('p', 'o', 'r', GeomFromText('POINT(108 102)')), + ('b', 'd', 'x', GeomFromText('POINT(127 198)')), + ('k', 's', 'a', GeomFromText('POINT(2 150)')), + ('f', 'm', 'f', GeomFromText('POINT(160 191)')), + ('q', 'y', 'x', GeomFromText('POINT(98 111)')), + ('o', 'f', 'm', GeomFromText('POINT(232 218)')), + ('c', 'w', 'j', GeomFromText('POINT(156 165)')), + ('s', 'q', 'v', GeomFromText('POINT(98 161)')); +SET @@RAND_SEED1=692635050, @@RAND_SEED2=297339954; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=159925977, @@RAND_SEED2=942570618; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=328169745, @@RAND_SEED2=410451954; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=178507359, @@RAND_SEED2=332493072; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=1034033013, @@RAND_SEED2=558966507; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +UPDATE t1 set spatial_point=GeomFromText('POINT(230 9)') where c1 like 'y%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(95 35)') where c1 like 'j%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(93 99)') where c1 like 'a%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(19 81)') where c1 like 'r%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(20 177)') where c1 like 'h%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(221 193)') where c1 like 'u%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(195 205)') where c1 like 'd%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(15 213)') where c1 like 'u%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(214 63)') where c1 like 'n%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(243 171)') where c1 like 'c%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(198 82)') where c1 like 'y%'; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES + ('f', 'y', 'p', GeomFromText('POINT(109 235)')), + ('b', 'e', 'v', GeomFromText('POINT(20 48)')), + ('i', 'u', 'f', GeomFromText('POINT(15 55)')), + ('o', 'r', 'z', GeomFromText('POINT(105 64)')), + ('a', 'p', 'a', GeomFromText('POINT(142 236)')), + ('g', 'i', 'k', GeomFromText('POINT(10 49)')), + ('x', 'z', 'x', GeomFromText('POINT(192 200)')), + ('c', 'v', 'r', GeomFromText('POINT(94 168)')), + ('y', 'z', 'e', GeomFromText('POINT(141 51)')), + ('h', 'm', 'd', GeomFromText('POINT(35 251)')), + ('v', 'm', 'q', GeomFromText('POINT(44 90)')), + ('j', 'l', 'z', GeomFromText('POINT(67 237)')), + ('i', 'v', 'a', GeomFromText('POINT(75 14)')), + ('b', 'q', 't', GeomFromText('POINT(153 33)')), + ('e', 'm', 'a', GeomFromText('POINT(247 49)')), + ('l', 'y', 'g', GeomFromText('POINT(56 203)')), + ('v', 'o', 'r', GeomFromText('POINT(90 54)')), + ('r', 'n', 'd', GeomFromText('POINT(135 83)')), + ('j', 't', 'u', GeomFromText('POINT(174 239)')), + ('u', 'n', 'g', GeomFromText('POINT(104 191)')), + ('p', 'q', 'y', GeomFromText('POINT(63 171)')), + ('o', 'q', 'p', GeomFromText('POINT(192 103)')), + ('f', 'x', 'e', GeomFromText('POINT(244 30)')), + ('n', 'x', 'c', GeomFromText('POINT(92 103)')), + ('r', 'q', 'z', GeomFromText('POINT(166 20)')), + ('s', 'a', 'j', GeomFromText('POINT(137 205)')), + ('z', 't', 't', GeomFromText('POINT(99 134)')), + ('o', 'm', 'j', GeomFromText('POINT(217 3)')), + ('n', 'h', 'j', GeomFromText('POINT(211 17)')), + ('v', 'v', 'a', GeomFromText('POINT(41 137)')), + ('q', 'o', 'j', GeomFromText('POINT(5 92)')), + ('z', 'y', 'e', GeomFromText('POINT(175 212)')), + ('j', 'z', 'h', GeomFromText('POINT(224 194)')), + ('a', 'g', 'm', GeomFromText('POINT(31 119)')), + ('p', 'c', 'f', GeomFromText('POINT(17 221)')), + ('t', 'h', 'k', GeomFromText('POINT(26 203)')), + ('u', 'w', 'p', GeomFromText('POINT(47 185)')), + ('z', 'a', 'c', GeomFromText('POINT(61 133)')), + ('u', 'k', 'a', GeomFromText('POINT(210 115)')), + ('k', 'f', 'h', GeomFromText('POINT(125 113)')), + ('t', 'v', 'y', GeomFromText('POINT(12 239)')), + ('u', 'v', 'd', GeomFromText('POINT(90 24)')), + ('m', 'y', 'w', GeomFromText('POINT(25 243)')), + ('d', 'n', 'g', GeomFromText('POINT(122 92)')), + ('z', 'm', 'f', GeomFromText('POINT(235 110)')), + ('q', 'd', 'f', GeomFromText('POINT(233 217)')), + ('a', 'v', 'u', GeomFromText('POINT(69 59)')), + ('x', 'k', 'p', GeomFromText('POINT(240 14)')), + ('i', 'v', 'r', GeomFromText('POINT(154 42)')), + ('w', 'h', 'l', GeomFromText('POINT(178 156)')), + ('d', 'h', 'n', GeomFromText('POINT(65 157)')), + ('c', 'k', 'z', GeomFromText('POINT(62 33)')), + ('e', 'l', 'w', GeomFromText('POINT(162 1)')), + ('r', 'f', 'i', GeomFromText('POINT(127 71)')), + ('q', 'm', 'c', GeomFromText('POINT(63 118)')), + ('c', 'h', 'u', GeomFromText('POINT(205 203)')), + ('d', 't', 'p', GeomFromText('POINT(234 87)')), + ('s', 'g', 'h', GeomFromText('POINT(149 34)')), + ('o', 'b', 'q', GeomFromText('POINT(159 179)')), + ('k', 'u', 'f', GeomFromText('POINT(202 254)')), + ('u', 'f', 'g', GeomFromText('POINT(70 15)')), + ('x', 's', 'b', GeomFromText('POINT(25 181)')), + ('s', 'c', 'g', GeomFromText('POINT(252 17)')), + ('a', 'c', 'f', GeomFromText('POINT(89 67)')), + ('r', 'e', 'q', GeomFromText('POINT(55 54)')), + ('f', 'i', 'k', GeomFromText('POINT(178 230)')), + ('p', 'e', 'l', GeomFromText('POINT(198 28)')), + ('w', 'o', 'd', GeomFromText('POINT(204 189)')), + ('c', 'a', 'g', GeomFromText('POINT(230 178)')), + ('r', 'o', 'e', GeomFromText('POINT(61 116)')), + ('w', 'a', 'a', GeomFromText('POINT(178 237)')), + ('v', 'd', 'e', GeomFromText('POINT(70 85)')), + ('k', 'c', 'e', GeomFromText('POINT(147 118)')), + ('d', 'q', 't', GeomFromText('POINT(218 77)')), + ('k', 'g', 'f', GeomFromText('POINT(192 113)')), + ('w', 'n', 'e', GeomFromText('POINT(92 124)')), + ('r', 'm', 'q', GeomFromText('POINT(130 65)')), + ('o', 'r', 'r', GeomFromText('POINT(174 233)')), + ('k', 'n', 't', GeomFromText('POINT(175 147)')), + ('q', 'm', 'r', GeomFromText('POINT(18 208)')), + ('l', 'd', 'i', GeomFromText('POINT(13 104)')), + ('w', 'o', 'y', GeomFromText('POINT(207 39)')), + ('p', 'u', 'o', GeomFromText('POINT(114 31)')), + ('y', 'a', 'p', GeomFromText('POINT(106 59)')), + ('a', 'x', 'z', GeomFromText('POINT(17 57)')), + ('v', 'h', 'x', GeomFromText('POINT(170 13)')), + ('t', 's', 'u', GeomFromText('POINT(84 18)')), + ('z', 'z', 'f', GeomFromText('POINT(250 197)')), + ('l', 'z', 't', GeomFromText('POINT(59 80)')), + ('j', 'g', 's', GeomFromText('POINT(54 26)')), + ('g', 'v', 'm', GeomFromText('POINT(89 98)')), + ('q', 'v', 'b', GeomFromText('POINT(39 240)')), + ('x', 'k', 'v', GeomFromText('POINT(246 207)')), + ('k', 'u', 'i', GeomFromText('POINT(105 111)')), + ('w', 'z', 's', GeomFromText('POINT(235 8)')), + ('d', 'd', 'd', GeomFromText('POINT(105 4)')), + ('c', 'z', 'q', GeomFromText('POINT(13 140)')), + ('m', 'k', 'i', GeomFromText('POINT(208 120)')), + ('g', 'a', 'g', GeomFromText('POINT(9 182)')), + ('z', 'j', 'r', GeomFromText('POINT(149 153)')), + ('h', 'f', 'g', GeomFromText('POINT(81 236)')), + ('m', 'e', 'q', GeomFromText('POINT(209 215)')), + ('c', 'h', 'y', GeomFromText('POINT(235 70)')), + ('i', 'e', 'g', GeomFromText('POINT(138 26)')), + ('m', 't', 'u', GeomFromText('POINT(119 237)')), + ('o', 'w', 's', GeomFromText('POINT(193 166)')), + ('f', 'm', 'q', GeomFromText('POINT(85 96)')), + ('x', 'l', 'x', GeomFromText('POINT(58 115)')), + ('x', 'q', 'u', GeomFromText('POINT(108 210)')), + ('b', 'h', 'i', GeomFromText('POINT(250 139)')), + ('y', 'd', 'x', GeomFromText('POINT(199 135)')), + ('w', 'h', 'p', GeomFromText('POINT(247 233)')), + ('p', 'z', 't', GeomFromText('POINT(148 249)')), + ('q', 'a', 'u', GeomFromText('POINT(174 78)')), + ('v', 't', 'm', GeomFromText('POINT(70 228)')), + ('t', 'n', 'f', GeomFromText('POINT(123 2)')), + ('x', 't', 'b', GeomFromText('POINT(35 50)')), + ('r', 'j', 'f', GeomFromText('POINT(200 51)')), + ('s', 'q', 'o', GeomFromText('POINT(23 184)')), + ('u', 'v', 'z', GeomFromText('POINT(7 113)')), + ('v', 'u', 'l', GeomFromText('POINT(145 190)')), + ('o', 'k', 'i', GeomFromText('POINT(161 122)')), + ('l', 'y', 'e', GeomFromText('POINT(17 232)')), + ('t', 'b', 'e', GeomFromText('POINT(120 50)')), + ('e', 's', 'u', GeomFromText('POINT(254 1)')), + ('d', 'd', 'u', GeomFromText('POINT(167 140)')), + ('o', 'b', 'x', GeomFromText('POINT(186 237)')), + ('m', 's', 's', GeomFromText('POINT(172 149)')), + ('t', 'y', 'a', GeomFromText('POINT(149 85)')), + ('x', 't', 'r', GeomFromText('POINT(10 165)')), + ('g', 'c', 'e', GeomFromText('POINT(95 165)')), + ('e', 'e', 'z', GeomFromText('POINT(98 65)')), + ('f', 'v', 'i', GeomFromText('POINT(149 144)')), + ('o', 'p', 'm', GeomFromText('POINT(233 67)')), + ('t', 'u', 'b', GeomFromText('POINT(109 215)')), + ('o', 'o', 'b', GeomFromText('POINT(130 48)')), + ('e', 'm', 'h', GeomFromText('POINT(88 189)')), + ('e', 'v', 'y', GeomFromText('POINT(55 29)')), + ('e', 't', 'm', GeomFromText('POINT(129 55)')), + ('p', 'p', 'i', GeomFromText('POINT(126 222)')), + ('c', 'i', 'c', GeomFromText('POINT(19 158)')), + ('c', 'b', 's', GeomFromText('POINT(13 19)')), + ('u', 'y', 'a', GeomFromText('POINT(114 5)')), + ('a', 'o', 'f', GeomFromText('POINT(227 232)')), + ('t', 'c', 'z', GeomFromText('POINT(63 62)')), + ('d', 'o', 'k', GeomFromText('POINT(48 228)')), + ('x', 'c', 'e', GeomFromText('POINT(204 2)')), + ('e', 'e', 'g', GeomFromText('POINT(125 43)')), + ('o', 'r', 'f', GeomFromText('POINT(171 140)')); +UPDATE t1 set spatial_point=GeomFromText('POINT(163 157)') where c1 like 'w%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(53 151)') where c1 like 'd%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(96 183)') where c1 like 'r%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(57 91)') where c1 like 'q%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(202 110)') where c1 like 'c%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(120 137)') where c1 like 'w%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(207 147)') where c1 like 'c%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(31 125)') where c1 like 'e%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(27 36)') where c1 like 'r%'; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES + ('b', 'c', 'e', GeomFromText('POINT(41 137)')), + ('p', 'y', 'k', GeomFromText('POINT(50 22)')), + ('s', 'c', 'h', GeomFromText('POINT(208 173)')), + ('x', 'u', 'l', GeomFromText('POINT(199 175)')), + ('s', 'r', 'h', GeomFromText('POINT(85 192)')), + ('j', 'k', 'u', GeomFromText('POINT(18 25)')), + ('p', 'w', 'h', GeomFromText('POINT(152 197)')), + ('e', 'd', 'c', GeomFromText('POINT(229 3)')), + ('o', 'x', 'k', GeomFromText('POINT(187 155)')), + ('o', 'b', 'k', GeomFromText('POINT(208 150)')), + ('d', 'a', 'j', GeomFromText('POINT(70 87)')), + ('f', 'e', 'k', GeomFromText('POINT(156 96)')), + ('u', 'y', 'p', GeomFromText('POINT(239 193)')), + ('n', 'v', 'p', GeomFromText('POINT(223 98)')), + ('z', 'j', 'r', GeomFromText('POINT(87 89)')), + ('h', 'x', 'x', GeomFromText('POINT(92 0)')), + ('r', 'v', 'r', GeomFromText('POINT(159 139)')), + ('v', 'g', 'g', GeomFromText('POINT(16 229)')), + ('z', 'k', 'u', GeomFromText('POINT(99 52)')), + ('p', 'p', 'o', GeomFromText('POINT(105 125)')), + ('w', 'h', 'y', GeomFromText('POINT(105 154)')), + ('v', 'y', 'z', GeomFromText('POINT(134 238)')), + ('x', 'o', 'o', GeomFromText('POINT(178 88)')), + ('z', 'w', 'd', GeomFromText('POINT(123 60)')), + ('q', 'f', 'u', GeomFromText('POINT(64 90)')), + ('s', 'n', 't', GeomFromText('POINT(50 138)')), + ('v', 'p', 't', GeomFromText('POINT(114 91)')), + ('a', 'o', 'n', GeomFromText('POINT(78 43)')), + ('k', 'u', 'd', GeomFromText('POINT(185 161)')), + ('w', 'd', 'n', GeomFromText('POINT(25 92)')), + ('k', 'w', 'a', GeomFromText('POINT(59 238)')), + ('t', 'c', 'f', GeomFromText('POINT(65 87)')), + ('g', 's', 'p', GeomFromText('POINT(238 126)')), + ('d', 'n', 'y', GeomFromText('POINT(107 173)')), + ('l', 'a', 'w', GeomFromText('POINT(125 152)')), + ('m', 'd', 'j', GeomFromText('POINT(146 53)')), + ('q', 'm', 'c', GeomFromText('POINT(217 187)')), + ('i', 'r', 'r', GeomFromText('POINT(6 113)')), + ('e', 'j', 'b', GeomFromText('POINT(37 83)')), + ('w', 'w', 'h', GeomFromText('POINT(83 199)')), + ('k', 'b', 's', GeomFromText('POINT(170 64)')), + ('s', 'b', 'c', GeomFromText('POINT(163 130)')), + ('c', 'h', 'a', GeomFromText('POINT(141 3)')), + ('k', 'j', 'u', GeomFromText('POINT(143 76)')), + ('r', 'h', 'o', GeomFromText('POINT(243 92)')), + ('i', 'd', 'b', GeomFromText('POINT(205 13)')), + ('r', 'y', 'q', GeomFromText('POINT(138 8)')), + ('m', 'o', 'i', GeomFromText('POINT(36 45)')), + ('v', 'g', 'm', GeomFromText('POINT(0 40)')), + ('f', 'e', 'i', GeomFromText('POINT(76 6)')), + ('c', 'q', 'q', GeomFromText('POINT(115 248)')), + ('x', 'c', 'i', GeomFromText('POINT(29 74)')), + ('l', 's', 't', GeomFromText('POINT(83 18)')), + ('t', 't', 'a', GeomFromText('POINT(26 168)')), + ('u', 'n', 'x', GeomFromText('POINT(200 110)')), + ('j', 'b', 'd', GeomFromText('POINT(216 136)')), + ('s', 'p', 'w', GeomFromText('POINT(38 156)')), + ('f', 'b', 'v', GeomFromText('POINT(29 186)')), + ('v', 'e', 'r', GeomFromText('POINT(149 40)')), + ('v', 't', 'm', GeomFromText('POINT(184 24)')), + ('y', 'g', 'a', GeomFromText('POINT(219 105)')), + ('s', 'f', 'i', GeomFromText('POINT(114 130)')), + ('e', 'q', 'h', GeomFromText('POINT(203 135)')), + ('h', 'g', 'b', GeomFromText('POINT(9 208)')), + ('o', 'l', 'r', GeomFromText('POINT(245 79)')), + ('s', 's', 'v', GeomFromText('POINT(238 198)')), + ('w', 'w', 'z', GeomFromText('POINT(209 232)')), + ('v', 'd', 'n', GeomFromText('POINT(30 193)')), + ('q', 'w', 'k', GeomFromText('POINT(133 18)')), + ('o', 'h', 'o', GeomFromText('POINT(42 140)')), + ('f', 'f', 'h', GeomFromText('POINT(145 1)')), + ('u', 's', 'r', GeomFromText('POINT(70 62)')), + ('x', 'n', 'q', GeomFromText('POINT(33 86)')), + ('u', 'p', 'v', GeomFromText('POINT(232 220)')), + ('z', 'e', 'a', GeomFromText('POINT(130 69)')), + ('r', 'u', 'z', GeomFromText('POINT(243 241)')), + ('b', 'n', 't', GeomFromText('POINT(120 12)')), + ('u', 'f', 's', GeomFromText('POINT(190 212)')), + ('a', 'd', 'q', GeomFromText('POINT(235 191)')), + ('f', 'q', 'm', GeomFromText('POINT(176 2)')), + ('n', 'c', 's', GeomFromText('POINT(218 163)')), + ('e', 'm', 'h', GeomFromText('POINT(163 108)')), + ('c', 'f', 'l', GeomFromText('POINT(220 115)')), + ('c', 'v', 'q', GeomFromText('POINT(66 45)')), + ('w', 'v', 'x', GeomFromText('POINT(251 220)')), + ('f', 'w', 'z', GeomFromText('POINT(146 149)')), + ('h', 'n', 'h', GeomFromText('POINT(148 128)')), + ('y', 'k', 'v', GeomFromText('POINT(28 110)')), + ('c', 'x', 'q', GeomFromText('POINT(13 13)')), + ('e', 'd', 's', GeomFromText('POINT(91 190)')), + ('c', 'w', 'c', GeomFromText('POINT(10 231)')), + ('u', 'j', 'n', GeomFromText('POINT(250 21)')), + ('w', 'n', 'x', GeomFromText('POINT(141 69)')), + ('f', 'p', 'y', GeomFromText('POINT(228 246)')), + ('d', 'q', 'f', GeomFromText('POINT(194 22)')), + ('d', 'z', 'l', GeomFromText('POINT(233 181)')), + ('c', 'a', 'q', GeomFromText('POINT(183 96)')), + ('m', 'i', 'd', GeomFromText('POINT(117 226)')), + ('z', 'y', 'y', GeomFromText('POINT(62 81)')), + ('g', 'v', 'm', GeomFromText('POINT(66 158)')); +SET @@RAND_SEED1=481064922, @@RAND_SEED2=438133497; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=280535103, @@RAND_SEED2=444518646; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=1072017234, @@RAND_SEED2=484203885; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=358851897, @@RAND_SEED2=358495224; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +SET @@RAND_SEED1=509031459, @@RAND_SEED2=675962925; +DELETE FROM t1 ORDER BY RAND() LIMIT 10; +UPDATE t1 set spatial_point=GeomFromText('POINT(61 203)') where c1 like 'y%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(202 194)') where c1 like 'f%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(228 18)') where c1 like 'h%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(88 18)') where c1 like 'l%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(176 94)') where c1 like 'e%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(44 47)') where c1 like 'g%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(95 191)') where c1 like 'b%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(179 218)') where c1 like 'y%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(239 40)') where c1 like 'g%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(248 41)') where c1 like 'q%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(167 82)') where c1 like 't%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(13 104)') where c1 like 'u%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(139 84)') where c1 like 'a%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(145 108)') where c1 like 'p%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(147 57)') where c1 like 't%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(217 144)') where c1 like 'n%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(160 224)') where c1 like 'w%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(38 28)') where c1 like 'j%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(104 114)') where c1 like 'q%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(88 19)') where c1 like 'c%'; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES + ('f', 'x', 'p', GeomFromText('POINT(92 181)')), + ('s', 'i', 'c', GeomFromText('POINT(49 60)')), + ('c', 'c', 'i', GeomFromText('POINT(7 57)')), + ('n', 'g', 'k', GeomFromText('POINT(252 105)')), + ('g', 'b', 'm', GeomFromText('POINT(180 11)')), + ('u', 'l', 'r', GeomFromText('POINT(32 90)')), + ('c', 'x', 'e', GeomFromText('POINT(143 24)')), + ('x', 'u', 'a', GeomFromText('POINT(123 92)')), + ('s', 'b', 'h', GeomFromText('POINT(190 108)')), + ('c', 'x', 'b', GeomFromText('POINT(104 100)')), + ('i', 'd', 't', GeomFromText('POINT(214 104)')), + ('r', 'w', 'g', GeomFromText('POINT(29 67)')), + ('b', 'f', 'g', GeomFromText('POINT(149 46)')), + ('r', 'r', 'd', GeomFromText('POINT(242 196)')), + ('j', 'l', 'a', GeomFromText('POINT(90 196)')), + ('e', 't', 'b', GeomFromText('POINT(190 64)')), + ('l', 'x', 'w', GeomFromText('POINT(250 73)')), + ('q', 'y', 'r', GeomFromText('POINT(120 182)')), + ('s', 'j', 'a', GeomFromText('POINT(180 175)')), + ('n', 'i', 'y', GeomFromText('POINT(124 136)')), + ('s', 'x', 's', GeomFromText('POINT(176 209)')), + ('u', 'f', 's', GeomFromText('POINT(215 173)')), + ('m', 'j', 'x', GeomFromText('POINT(44 140)')), + ('v', 'g', 'x', GeomFromText('POINT(177 233)')), + ('u', 't', 'b', GeomFromText('POINT(136 197)')), + ('f', 'g', 'b', GeomFromText('POINT(10 8)')), + ('v', 'c', 'j', GeomFromText('POINT(13 81)')), + ('d', 's', 'q', GeomFromText('POINT(200 100)')), + ('a', 'p', 'j', GeomFromText('POINT(33 40)')), + ('i', 'c', 'g', GeomFromText('POINT(168 204)')), + ('k', 'h', 'i', GeomFromText('POINT(93 243)')), + ('s', 'b', 's', GeomFromText('POINT(157 13)')), + ('v', 'l', 'l', GeomFromText('POINT(103 6)')), + ('r', 'b', 'k', GeomFromText('POINT(244 137)')), + ('l', 'd', 'r', GeomFromText('POINT(162 254)')), + ('q', 'b', 'z', GeomFromText('POINT(136 246)')), + ('x', 'x', 'p', GeomFromText('POINT(120 37)')), + ('m', 'e', 'z', GeomFromText('POINT(203 167)')), + ('q', 'n', 'p', GeomFromText('POINT(94 119)')), + ('b', 'g', 'u', GeomFromText('POINT(93 248)')), + ('r', 'v', 'v', GeomFromText('POINT(53 88)')), + ('y', 'a', 'i', GeomFromText('POINT(98 219)')), + ('a', 's', 'g', GeomFromText('POINT(173 138)')), + ('c', 'a', 't', GeomFromText('POINT(235 135)')), + ('q', 'm', 'd', GeomFromText('POINT(224 208)')), + ('e', 'p', 'k', GeomFromText('POINT(161 238)')), + ('n', 'g', 'q', GeomFromText('POINT(35 204)')), + ('t', 't', 'x', GeomFromText('POINT(230 178)')), + ('w', 'f', 'a', GeomFromText('POINT(150 221)')), + ('z', 'm', 'z', GeomFromText('POINT(119 42)')), + ('l', 'j', 's', GeomFromText('POINT(97 96)')), + ('f', 'z', 'x', GeomFromText('POINT(208 65)')), + ('i', 'v', 'c', GeomFromText('POINT(145 79)')), + ('l', 'f', 'k', GeomFromText('POINT(83 234)')), + ('u', 'a', 's', GeomFromText('POINT(250 49)')), + ('o', 'k', 'p', GeomFromText('POINT(46 50)')), + ('d', 'e', 'z', GeomFromText('POINT(30 198)')), + ('r', 'r', 'l', GeomFromText('POINT(78 189)')), + ('y', 'l', 'f', GeomFromText('POINT(188 132)')), + ('d', 'q', 'm', GeomFromText('POINT(247 107)')), + ('p', 'j', 'n', GeomFromText('POINT(148 227)')), + ('b', 'o', 'i', GeomFromText('POINT(172 25)')), + ('e', 'v', 'd', GeomFromText('POINT(94 248)')), + ('q', 'd', 'f', GeomFromText('POINT(15 29)')), + ('w', 'b', 'b', GeomFromText('POINT(74 111)')), + ('g', 'q', 'f', GeomFromText('POINT(107 215)')), + ('o', 'h', 'r', GeomFromText('POINT(25 168)')), + ('u', 't', 'w', GeomFromText('POINT(251 188)')), + ('h', 's', 'w', GeomFromText('POINT(254 247)')), + ('f', 'f', 'b', GeomFromText('POINT(166 103)')); +SET @@RAND_SEED1=866613816, @@RAND_SEED2=92289615; +INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES + ('l', 'c', 'l', GeomFromText('POINT(202 98)')), + ('k', 'c', 'b', GeomFromText('POINT(46 206)')), + ('r', 'y', 'm', GeomFromText('POINT(74 140)')), + ('y', 'z', 'd', GeomFromText('POINT(200 160)')), + ('s', 'y', 's', GeomFromText('POINT(156 205)')), + ('u', 'v', 'p', GeomFromText('POINT(86 82)')), + ('j', 's', 's', GeomFromText('POINT(91 233)')), + ('x', 'j', 'f', GeomFromText('POINT(3 14)')), + ('l', 'z', 'v', GeomFromText('POINT(123 156)')), + ('h', 'i', 'o', GeomFromText('POINT(145 229)')), + ('o', 'r', 'd', GeomFromText('POINT(15 22)')), + ('f', 'x', 't', GeomFromText('POINT(21 60)')), + ('t', 'g', 'h', GeomFromText('POINT(50 153)')), + ('g', 'u', 'b', GeomFromText('POINT(82 85)')), + ('v', 'a', 'p', GeomFromText('POINT(231 178)')), + ('n', 'v', 'o', GeomFromText('POINT(183 25)')), + ('j', 'n', 'm', GeomFromText('POINT(50 144)')), + ('e', 'f', 'i', GeomFromText('POINT(46 16)')), + ('d', 'w', 'a', GeomFromText('POINT(66 6)')), + ('f', 'x', 'a', GeomFromText('POINT(107 197)')), + ('m', 'o', 'a', GeomFromText('POINT(142 80)')), + ('q', 'l', 'g', GeomFromText('POINT(251 23)')), + ('c', 's', 's', GeomFromText('POINT(158 43)')), + ('y', 'd', 'o', GeomFromText('POINT(196 228)')), + ('d', 'p', 'l', GeomFromText('POINT(107 5)')), + ('h', 'a', 'b', GeomFromText('POINT(183 166)')), + ('m', 'w', 'p', GeomFromText('POINT(19 59)')), + ('b', 'y', 'o', GeomFromText('POINT(178 30)')), + ('x', 'w', 'i', GeomFromText('POINT(168 94)')), + ('t', 'k', 'z', GeomFromText('POINT(171 5)')), + ('r', 'm', 'a', GeomFromText('POINT(222 19)')), + ('u', 'v', 'e', GeomFromText('POINT(224 80)')), + ('q', 'r', 'k', GeomFromText('POINT(212 218)')), + ('d', 'p', 'j', GeomFromText('POINT(169 7)')), + ('d', 'r', 'v', GeomFromText('POINT(193 23)')), + ('n', 'y', 'y', GeomFromText('POINT(130 178)')), + ('m', 'z', 'r', GeomFromText('POINT(81 200)')), + ('j', 'e', 'w', GeomFromText('POINT(145 239)')), + ('v', 'h', 'x', GeomFromText('POINT(24 105)')), + ('z', 'm', 'a', GeomFromText('POINT(175 129)')), + ('b', 'c', 'v', GeomFromText('POINT(213 10)')), + ('t', 't', 'u', GeomFromText('POINT(2 129)')), + ('r', 's', 'v', GeomFromText('POINT(209 192)')), + ('x', 'p', 'g', GeomFromText('POINT(43 63)')), + ('t', 'e', 'u', GeomFromText('POINT(139 210)')), + ('l', 'e', 't', GeomFromText('POINT(245 148)')), + ('a', 'i', 'k', GeomFromText('POINT(167 195)')), + ('m', 'o', 'h', GeomFromText('POINT(206 120)')), + ('g', 'z', 's', GeomFromText('POINT(169 240)')), + ('z', 'u', 's', GeomFromText('POINT(202 120)')), + ('i', 'b', 'a', GeomFromText('POINT(216 18)')), + ('w', 'y', 'g', GeomFromText('POINT(119 236)')), + ('h', 'y', 'p', GeomFromText('POINT(161 24)')); +UPDATE t1 set spatial_point=GeomFromText('POINT(33 100)') where c1 like 't%'; +UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%'; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; + # End of 4.1 tests From b33780693cbeb52bed77a114692e6ba5e0b008d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 12:04:45 +0300 Subject: [PATCH 074/789] Fix -ansi -pedantic warning (can't cast a pointer to function to a pointer to object, that is, int foo(); void *bar= (void*) foo is not allowed. sql/lex.h: Fix -ansi -pedantic warning. sql/lex_symbol.h: Fix -ansi -pedantic warning. --- sql/lex.h | 4 ++-- sql/lex_symbol.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/lex.h b/sql/lex.h index 5299be89d35..352d80da5c6 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -32,10 +32,10 @@ SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"}; #define SYM(A) SYM_OR_NULL(A),0,0,&sym_group_common #define F_SYM(A) SYM_OR_NULL(A) -#define CREATE_FUNC(A) (void *)(SYM_OR_NULL(A)), &sym_group_common +#define CREATE_FUNC(A) (void (*)())(SYM_OR_NULL(A)), &sym_group_common #ifdef HAVE_SPATIAL -#define CREATE_FUNC_GEOM(A) (void *)(SYM_OR_NULL(A)), &sym_group_geom +#define CREATE_FUNC_GEOM(A) (void (*)())(SYM_OR_NULL(A)), &sym_group_geom #else #define CREATE_FUNC_GEOM(A) 0, &sym_group_geom #endif diff --git a/sql/lex_symbol.h b/sql/lex_symbol.h index 5d929508030..c87cdb4ec43 100644 --- a/sql/lex_symbol.h +++ b/sql/lex_symbol.h @@ -25,7 +25,7 @@ typedef struct st_symbol { const char *name; uint tok; uint length; - void *create_func; + void (*create_func)(); struct st_sym_group *group; } SYMBOL; From 5e71938a76412e0a4308f4f957469ce561a106ba Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 17:47:13 +0800 Subject: [PATCH 075/789] BUG#25743 If undo_buffer_size (for LG) greater than the inital shared memory (default 20M), ndbd nodes are crashed storage/ndb/src/kernel/vm/Pool.hpp: Only when m_pool.seize() return true, the ptr.i and ptr.p is assigned the right value, or else the parameter ptr should be "not touched". --- storage/ndb/src/kernel/vm/Pool.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/storage/ndb/src/kernel/vm/Pool.hpp b/storage/ndb/src/kernel/vm/Pool.hpp index b585af57684..a4e062078fb 100644 --- a/storage/ndb/src/kernel/vm/Pool.hpp +++ b/storage/ndb/src/kernel/vm/Pool.hpp @@ -307,8 +307,11 @@ RecordPool::seize(Ptr & ptr) { Ptr tmp; bool ret = m_pool.seize(tmp); - ptr.i = tmp.i; - ptr.p = static_cast(tmp.p); + if(likely(ret)) + { + ptr.i = tmp.i; + ptr.p = static_cast(tmp.p); + } return ret; } From 2157f642380a766d4d859997b624a8cd0bfc7e80 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 12:08:59 +0100 Subject: [PATCH 076/789] Bug#25673 - spatial index corruption, error 126 incorrect key file for table After merge fix --- mysql-test/r/gis-rtree.result | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 03423fed78e..92de2abcdcb 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -1424,6 +1424,7 @@ UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%'; CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK +DROP TABLE t1; CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ); INSERT INTO t1(foo) VALUES (NULL); ERROR 23000: Column 'foo' cannot be null From 0381f8cfe55a7ac2b645b439cf627eefcef4d5f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 16:47:18 +0100 Subject: [PATCH 077/789] Update result for 5.1 --- mysql-test/r/rpl_ssl.result | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result index 17a16d5020d..28abab362b7 100644 --- a/mysql-test/r/rpl_ssl.result +++ b/mysql-test/r/rpl_ssl.result @@ -26,7 +26,7 @@ Master_User replssl Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 420 +Read_Master_Log_Pos 424 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 420 +Exec_Master_Log_Pos 424 Relay_Log_Space # Until_Condition None Until_Log_File @@ -64,7 +64,7 @@ Master_User replssl Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 12320 +Read_Master_Log_Pos 12324 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -79,7 +79,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 12320 +Exec_Master_Log_Pos 12324 Relay_Log_Space # Until_Condition None Until_Log_File From 4c0ab891ea2d34a2b6570d19292e4aa426e06b4c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 19:38:21 +0300 Subject: [PATCH 078/789] sql_select.cc: Postfix for bug#22331. sql/sql_select.cc: Postfix for bug#22331. --- sql/sql_select.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 06352d48154..9fe92d63da3 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7621,7 +7621,8 @@ static COND* substitute_for_best_equal_field(COND *cond, break; } } - if (!((Item_cond*)cond)->argument_list()->elements) + if (cond->type() == Item::COND_ITEM && + !((Item_cond*)cond)->argument_list()->elements) cond= new Item_int((int32)cond->val_bool()); } From 012ae63522372a16e824b7a47f04533b9f43423f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 20:57:12 +0400 Subject: [PATCH 079/789] merging --- mysql-test/r/explain.result | 20 ++++++++++---------- mysql-test/r/func_in.result | 6 ++++++ mysql-test/r/sp.result | 13 +++++++++++++ 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 13d63cdcdc3..8d5d6adefa5 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -61,28 +61,28 @@ create table t1(f1 int, f2 int); insert into t1 values (1,1); create view v1 as select * from t1 where f1=1; explain extended select * from v1 where f2=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 Warnings: Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 1 explain extended select * from t1 where 0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 0 explain extended select * from t1 where 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 Warnings: Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 1 explain extended select * from t1 having 0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING Warnings: Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` having 0 explain extended select * from t1 having 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 Warnings: Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` having 1 drop view v1; diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index dab44fa3dab..7a8f59c65f4 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -444,8 +444,14 @@ SELECT HEX(a) FROM t2 WHERE a IN 42); HEX(a) BB3C3E98175D33C8 +7FFFFFFFFFFFFEFF +7FFFFFFFFFFFFFEF +7FFFFFFFFFFFFFFE 7FFFFFFFFFFFFFFF 8000000000000000 +8000000000000001 +8000000000000002 +8000000000000300 8000000000000400 8000000000000401 SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001); diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 51ab8d5e139..2b6131cdf90 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5832,4 +5832,17 @@ END| CALL bug24117()| DROP PROCEDURE bug24117| DROP TABLE t3| +DROP FUNCTION IF EXISTS bug25373| +CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER +LANGUAGE SQL DETERMINISTIC +RETURN p1;| +CREATE TABLE t3 (f1 INT, f2 FLOAT)| +INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| +SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| +SUM(f2) bug25373(f1) +6.3000000715256 1 +15 2 +21.300000071526 NULL +DROP FUNCTION bug25373| +DROP TABLE t3| drop table t1,t2; From 4c0aa8521f52f20771c58f39aaf01bb6c08ed407 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 18:12:16 +0100 Subject: [PATCH 080/789] add comment to compiler_warnings.supp support-files/compiler_warnings.supp: add comment to make this file more useful --- support-files/compiler_warnings.supp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index a147255f9a4..d6c4bcee52a 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -1,3 +1,8 @@ +# +# This file contains compiler warnings that can +# be ignored for various reasons. +# + integer.cpp: .*control reaches end of non-void function.*: 1288-1427 DictTabInfo.cpp : .*invalid access to non-static.* DictTabInfo.cpp : .*macro was used incorrectly.* From f68891f80ddc14ef5e066c0b6aa480eef1125505 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 18:38:17 +0100 Subject: [PATCH 081/789] The most recent push into mysql-5.1 from mysql-5.2 was a mistake. This just reverses those changes. I'm really sorry about that. configure.in, version.c: Reverse last push (from mysql-5.2 into mysql-5.1) configure.in: Reverse last push (from mysql-5.2 into mysql-5.1) storage/ndb/src/common/util/version.c: Reverse last push (from mysql-5.2 into mysql-5.1) --- configure.in | 2 +- storage/ndb/src/common/util/version.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.in b/configure.in index a62a950a288..9581b5ac46a 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.2.0-alpha) +AM_INIT_AUTOMAKE(mysql, 5.1.17-beta) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/storage/ndb/src/common/util/version.c b/storage/ndb/src/common/util/version.c index 9f35b04173e..b2ebb87c144 100644 --- a/storage/ndb/src/common/util/version.c +++ b/storage/ndb/src/common/util/version.c @@ -91,7 +91,6 @@ void ndbSetOwnVersion() {} #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { - { MAKE_VERSION(5,2,NDB_VERSION_BUILD), MAKE_VERSION(5,2,0), UG_Range}, { MAKE_VERSION(5,1,NDB_VERSION_BUILD), MAKE_VERSION(5,1,0), UG_Range}, { MAKE_VERSION(5,0,NDB_VERSION_BUILD), MAKE_VERSION(5,0,12), UG_Range}, { MAKE_VERSION(5,0,11), MAKE_VERSION(5,0,2), UG_Range}, From 35d5819129fb86378a2c5ff6fa268f97befbe09b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 19:22:43 +0100 Subject: [PATCH 082/789] Bug#25673 - spatial index corruption, error 126 incorrect key file for table After backport fix. Added forgotten DBUG_RETURNs, which was detected in 5.1 only. --- myisam/rt_index.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/myisam/rt_index.c b/myisam/rt_index.c index 9c58f4ba5d2..fd988f320ff 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -636,14 +636,14 @@ static int rtree_insert_level(MI_INFO *info, uint keynr, uchar *key, int res; if ((old_root = _mi_new(info, keyinfo, DFLT_INIT_HITS)) == HA_OFFSET_ERROR) - return -1; + DBUG_RETURN(-1); info->buff_used = 1; mi_putint(info->buff, 2, 0); res = rtree_add_key(info, keyinfo, key, key_length, info->buff, NULL); if (_mi_write_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, info->buff)) - return 1; + DBUG_RETURN(1); info->s->state.key_root[keynr] = old_root; - return res; + DBUG_RETURN(res); } switch ((res = rtree_insert_req(info, keyinfo, key, key_length, From d4ede3f5098df56d844139932ac7655784004ca9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Mar 2007 19:57:35 +0100 Subject: [PATCH 083/789] rpl_ssl.result, rpl_ssl.test: Mask out *_Master_Log_Pos in rpl_ssl test; it varies depending on binlog format mysql-test/t/rpl_ssl.test: Mask out *_Master_Log_Pos in rpl_ssl test; it varies depending on binlog format mysql-test/r/rpl_ssl.result: Mask out *_Master_Log_Pos in rpl_ssl test; it varies depending on binlog format --- mysql-test/r/rpl_ssl.result | 8 ++++---- mysql-test/t/rpl_ssl.test | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result index 28abab362b7..33deb9a8c92 100644 --- a/mysql-test/r/rpl_ssl.result +++ b/mysql-test/r/rpl_ssl.result @@ -26,7 +26,7 @@ Master_User replssl Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 424 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 424 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File @@ -64,7 +64,7 @@ Master_User replssl Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 12324 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -79,7 +79,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 12324 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test index 249ed16f931..9f25f71525a 100644 --- a/mysql-test/t/rpl_ssl.test +++ b/mysql-test/t/rpl_ssl.test @@ -31,7 +31,7 @@ select * from t1; # The slave is synced and waiting/reading from master # SHOW SLAVE STATUS will show "Waiting for master to send event" --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 8 # 9 # 23 # 33 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # query_vertical show slave status; # Stop the slave, as reported in bug#21871 it would hang @@ -56,5 +56,5 @@ enable_query_log; connection master; sync_slave_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 8 # 9 # 23 # 33 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # query_vertical show slave status; From b76fb8f72ed184e6da1f299fef9dbf7bb641cf8f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 10:21:11 +0700 Subject: [PATCH 084/789] BUG#25743 If undo_buffer_size (for LG) greater than the inital shared memory (default 20M), ndbd nodes are crashed storage/ndb/src/kernel/vm/Pool.hpp: Only when m_pool.seize() return true, the ptr.i and ptr.p is assigned the ri ght value, or else the parameter ptr should be "not touched" --- storage/ndb/src/kernel/vm/Pool.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/storage/ndb/src/kernel/vm/Pool.hpp b/storage/ndb/src/kernel/vm/Pool.hpp index b585af57684..a4e062078fb 100644 --- a/storage/ndb/src/kernel/vm/Pool.hpp +++ b/storage/ndb/src/kernel/vm/Pool.hpp @@ -307,8 +307,11 @@ RecordPool::seize(Ptr & ptr) { Ptr tmp; bool ret = m_pool.seize(tmp); - ptr.i = tmp.i; - ptr.p = static_cast(tmp.p); + if(likely(ret)) + { + ptr.i = tmp.i; + ptr.p = static_cast(tmp.p); + } return ret; } From a0521cd7493ec309e4685d5af7563d2403a759b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 08:05:08 +0300 Subject: [PATCH 085/789] Polishing: use constants instead of magic numbers. include/my_global.h: Introduce constants to be used instead of magic numbers. sql/field.cc: Polishing: use contants instead of magic numbers. sql/ha_innodb.cc: Polishing: use contants instead of magic numbers. sql/handler.cc: Polishing: use contants instead of magic numbers. sql/item.cc: Polishing: use contants instead of magic numbers. sql/item.h: Polishing: use contants instead of magic numbers. sql/item_func.cc: Polishing: use contants instead of magic numbers. sql/item_subselect.cc: Polishing: use contants instead of magic numbers. sql/log_event.cc: Polishing: use contants instead of magic numbers. sql/sql_base.cc: Polishing: use contants instead of magic numbers. sql/sql_select.cc: Polishing: use contants instead of magic numbers. sql/sql_show.cc: Polishing: use contants instead of magic numbers. sql/sql_table.cc: Polishing: use contants instead of magic numbers. --- include/my_global.h | 9 +++++++++ sql/field.cc | 6 +++--- sql/ha_innodb.cc | 16 ++++++++-------- sql/handler.cc | 6 +++--- sql/item.cc | 6 +++--- sql/item.h | 9 ++++++--- sql/item_func.cc | 5 +++-- sql/item_subselect.cc | 3 ++- sql/log_event.cc | 5 +++-- sql/sql_base.cc | 3 ++- sql/sql_select.cc | 6 +++--- sql/sql_show.cc | 43 +++++++++++++++++++++++++------------------ sql/sql_table.cc | 3 ++- 13 files changed, 72 insertions(+), 48 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index 21fe1ebc3cb..61c2afc541b 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1357,4 +1357,13 @@ do { doubleget_union _tmp; \ #define NO_EMBEDDED_ACCESS_CHECKS #endif + +/* Length of decimal number represented by INT32. */ + +#define MY_INT32_NUM_DECIMAL_DIGITS 11 + +/* Length of decimal number represented by INT64. */ + +#define MY_INT64_NUM_DECIMAL_DIGITS 21 + #endif /* my_global_h */ diff --git a/sql/field.cc b/sql/field.cc index 367cbdaa0e5..aabb0ff6061 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1203,12 +1203,12 @@ static bool test_if_real(const char *str,int length, CHARSET_INFO *cs) String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_val) { CHARSET_INFO *cs= &my_charset_bin; - uint length= 21; + uint length; longlong value= val_int(); - if (val_buffer->alloc(length)) + if (val_buffer->alloc(MY_INT64_NUM_DECIMAL_DIGITS)) return 0; length= (uint) (*cs->cset->longlong10_to_str)(cs, (char*) val_buffer->ptr(), - length, + MY_INT64_NUM_DECIMAL_DIGITS, unsigned_val ? 10 : -10, value); val_buffer->length(length); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 8a35ff000a8..cbefa9d3949 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -6391,16 +6391,16 @@ innodb_mutex_show_status( #ifdef UNIV_DEBUG field_list.push_back(new Item_empty_string("Mutex", FN_REFLEN)); field_list.push_back(new Item_empty_string("Module", FN_REFLEN)); - field_list.push_back(new Item_uint("Count", 21)); - field_list.push_back(new Item_uint("Spin_waits", 21)); - field_list.push_back(new Item_uint("Spin_rounds", 21)); - field_list.push_back(new Item_uint("OS_waits", 21)); - field_list.push_back(new Item_uint("OS_yields", 21)); - field_list.push_back(new Item_uint("OS_waits_time", 21)); + field_list.push_back(new Item_uint("Count", MY_INT64_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_uint("Spin_waits", MY_INT64_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_uint("Spin_rounds", MY_INT64_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_uint("OS_waits", MY_INT64_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_uint("OS_yields", MY_INT64_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_uint("OS_waits_time", MY_INT64_NUM_DECIMAL_DIGITS)); #else /* UNIV_DEBUG */ field_list.push_back(new Item_empty_string("File", FN_REFLEN)); - field_list.push_back(new Item_uint("Line", 21)); - field_list.push_back(new Item_uint("OS_waits", 21)); + field_list.push_back(new Item_uint("Line", MY_INT64_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_uint("OS_waits", MY_INT64_NUM_DECIMAL_DIGITS)); #endif /* UNIV_DEBUG */ if (protocol->send_fields(&field_list, diff --git a/sql/handler.cc b/sql/handler.cc index 5a27e470d70..524f47209dc 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1082,9 +1082,9 @@ bool mysql_xa_recover(THD *thd) XID_STATE *xs; DBUG_ENTER("mysql_xa_recover"); - field_list.push_back(new Item_int("formatID",0,11)); - field_list.push_back(new Item_int("gtrid_length",0,11)); - field_list.push_back(new Item_int("bqual_length",0,11)); + field_list.push_back(new Item_int("formatID", 0, MY_INT32_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_int("gtrid_length", 0, MY_INT32_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_int("bqual_length", 0, MY_INT32_NUM_DECIMAL_DIGITS)); field_list.push_back(new Item_empty_string("data",XIDDATASIZE)); if (protocol->send_fields(&field_list, diff --git a/sql/item.cc b/sql/item.cc index 257687ebaaf..863b18739d1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -148,7 +148,7 @@ void Hybrid_type_traits_integer::fix_length_and_dec(Item *item, Item *arg) const { item->decimals= 0; - item->max_length= 21; + item->max_length= MY_INT64_NUM_DECIMAL_DIGITS; item->unsigned_flag= 0; } @@ -2491,7 +2491,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) item_result_type= REAL_RESULT; break; case INT_RESULT: - set_int(*(longlong*)entry->value, 21); + set_int(*(longlong*)entry->value, MY_INT64_NUM_DECIMAL_DIGITS); item_type= Item::INT_ITEM; item_result_type= INT_RESULT; break; @@ -6535,7 +6535,7 @@ uint32 Item_type_holder::display_length(Item *item) case MYSQL_TYPE_SHORT: return 6; case MYSQL_TYPE_LONG: - return 11; + return MY_INT32_NUM_DECIMAL_DIGITS; case MYSQL_TYPE_FLOAT: return 25; case MYSQL_TYPE_DOUBLE: diff --git a/sql/item.h b/sql/item.h index 833bebdee7e..39cdb68fa00 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1494,11 +1494,14 @@ class Item_int :public Item_num { public: longlong value; - Item_int(int32 i,uint length=11) :value((longlong) i) + Item_int(int32 i,uint length= MY_INT32_NUM_DECIMAL_DIGITS) + :value((longlong) i) { max_length=length; fixed= 1; } - Item_int(longlong i,uint length=21) :value(i) + Item_int(longlong i,uint length= MY_INT64_NUM_DECIMAL_DIGITS) + :value(i) { max_length=length; fixed= 1; } - Item_int(ulonglong i, uint length= 21) :value((longlong)i) + Item_int(ulonglong i, uint length= MY_INT64_NUM_DECIMAL_DIGITS) + :value((longlong)i) { max_length=length; fixed= 1; unsigned_flag= 1; } Item_int(const char *str_arg,longlong i,uint length) :value(i) { max_length=length; name=(char*) str_arg; fixed= 1; } diff --git a/sql/item_func.cc b/sql/item_func.cc index e41bf25e8e9..6c4cf8cc5bd 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -426,7 +426,7 @@ Field *Item_func::tmp_table_field(TABLE *t_arg) switch (result_type()) { case INT_RESULT: - if (max_length > 11) + if (max_length > MY_INT32_NUM_DECIMAL_DIGITS) res= new Field_longlong(max_length, maybe_null, name, t_arg, unsigned_flag); else @@ -2316,7 +2316,8 @@ longlong Item_func_coercibility::val_int() void Item_func_locate::fix_length_and_dec() { - maybe_null=0; max_length=11; + maybe_null= 0; + max_length= MY_INT32_NUM_DECIMAL_DIGITS; agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1); } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 12ae0c026eb..b3744d6eb96 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1037,7 +1037,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, Item *having= item, *orig_item= item; select_lex->item_list.empty(); select_lex->item_list.push_back(new Item_int("Not_used", - (longlong) 1, 21)); + (longlong) 1, + MY_INT64_NUM_DECIMAL_DIGITS)); select_lex->ref_pointer_array[0]= select_lex->item_list.head(); item= func->create(expr, item); diff --git a/sql/log_event.cc b/sql/log_event.cc index dbf69acf70a..e272140c080 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -541,12 +541,13 @@ int Log_event::net_send(Protocol *protocol, const char* log_name, my_off_t pos) void Log_event::init_show_field_list(List* field_list) { field_list->push_back(new Item_empty_string("Log_name", 20)); - field_list->push_back(new Item_return_int("Pos", 11, + field_list->push_back(new Item_return_int("Pos", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG)); field_list->push_back(new Item_empty_string("Event_type", 20)); field_list->push_back(new Item_return_int("Server_id", 10, MYSQL_TYPE_LONG)); - field_list->push_back(new Item_return_int("End_log_pos", 11, + field_list->push_back(new Item_return_int("End_log_pos", + MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG)); field_list->push_back(new Item_empty_string("Info", 20)); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6f114165fa6..e3f44539bc7 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4559,7 +4559,8 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List &fields, Item_int do not need fix_fields() because it is basic constant. */ - it.replace(new Item_int("Not_used", (longlong) 1, 21)); + it.replace(new Item_int("Not_used", (longlong) 1, + MY_INT64_NUM_DECIMAL_DIGITS)); } else if (insert_fields(thd, ((Item_field*) item)->context, ((Item_field*) item)->db_name, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 346b8c13940..b1ec333e81d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8491,7 +8491,7 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) if ((new_cond= new Item_func_eq(args[0], new Item_int("last_insert_id()", thd->current_insert_id, - 21)))) + MY_INT64_NUM_DECIMAL_DIGITS)))) { /* Set THD::last_insert_id_used_bin_log manually, as this @@ -8757,7 +8757,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, break; case INT_RESULT: /* Select an integer type with the minimal fit precision */ - if (item->max_length > 11) + if (item->max_length > MY_INT32_NUM_DECIMAL_DIGITS) new_field=new Field_longlong(item->max_length, maybe_null, item->name, table, item->unsigned_flag); else @@ -14964,7 +14964,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, /* Add "rows" field to item_list. */ item_list.push_back(new Item_int((longlong) (ulonglong) join->best_positions[i]. records_read, - 21)); + MY_INT64_NUM_DECIMAL_DIGITS)); /* Build "Extra" field and add it to item_list. */ my_bool key_read=table->key_read; if ((tab->type == JT_NEXT || tab->type == JT_CONST) && diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c4b06934fc3..4de70a67b36 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -205,7 +205,8 @@ bool mysqld_show_column_types(THD *thd) DBUG_ENTER("mysqld_show_column_types"); field_list.push_back(new Item_empty_string("Type",30)); - field_list.push_back(new Item_int("Size",(longlong) 1,21)); + field_list.push_back(new Item_int("Size",(longlong) 1, + MY_INT64_NUM_DECIMAL_DIGITS)); field_list.push_back(new Item_empty_string("Min_Value",20)); field_list.push_back(new Item_empty_string("Max_Value",20)); field_list.push_back(new Item_return_int("Prec", 4, MYSQL_TYPE_SHORT)); @@ -1284,7 +1285,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) Protocol *protocol= thd->protocol; DBUG_ENTER("mysqld_list_processes"); - field_list.push_back(new Item_int("Id",0,11)); + field_list.push_back(new Item_int("Id", 0, MY_INT32_NUM_DECIMAL_DIGITS)); field_list.push_back(new Item_empty_string("User",16)); field_list.push_back(new Item_empty_string("Host",LIST_PROCESS_HOST_LEN)); field_list.push_back(field=new Item_empty_string("db",NAME_LEN)); @@ -4038,20 +4039,25 @@ ST_FIELD_INFO tables_fields_info[]= {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, {"TABLE_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"ENGINE", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Engine"}, - {"VERSION", 21 , MYSQL_TYPE_LONG, 0, 1, "Version"}, + {"VERSION", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, "Version"}, {"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format"}, - {"TABLE_ROWS", 21 , MYSQL_TYPE_LONG, 0, 1, "Rows"}, - {"AVG_ROW_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, "Avg_row_length"}, - {"DATA_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, "Data_length"}, - {"MAX_DATA_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, "Max_data_length"}, - {"INDEX_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, "Index_length"}, - {"DATA_FREE", 21 , MYSQL_TYPE_LONG, 0, 1, "Data_free"}, - {"AUTO_INCREMENT", 21 , MYSQL_TYPE_LONG, 0, 1, "Auto_increment"}, + {"TABLE_ROWS", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, "Rows"}, + {"AVG_ROW_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, + "Avg_row_length"}, + {"DATA_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, + "Data_length"}, + {"MAX_DATA_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, + "Max_data_length"}, + {"INDEX_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, + "Index_length"}, + {"DATA_FREE", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, "Data_free"}, + {"AUTO_INCREMENT", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, + "Auto_increment"}, {"CREATE_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Create_time"}, {"UPDATE_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Update_time"}, {"CHECK_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Check_time"}, {"TABLE_COLLATION", 64, MYSQL_TYPE_STRING, 0, 1, "Collation"}, - {"CHECKSUM", 21 , MYSQL_TYPE_LONG, 0, 1, "Checksum"}, + {"CHECKSUM", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, "Checksum"}, {"CREATE_OPTIONS", 255, MYSQL_TYPE_STRING, 0, 1, "Create_options"}, {"TABLE_COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} @@ -4064,14 +4070,15 @@ ST_FIELD_INFO columns_fields_info[]= {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Field"}, - {"ORDINAL_POSITION", 21 , MYSQL_TYPE_LONG, 0, 0, 0}, + {"ORDINAL_POSITION", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 0, 0}, {"COLUMN_DEFAULT", MAX_FIELD_VARCHARLENGTH, MYSQL_TYPE_STRING, 0, 1, "Default"}, {"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"}, {"DATA_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"CHARACTER_MAXIMUM_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, - {"CHARACTER_OCTET_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, - {"NUMERIC_PRECISION", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, - {"NUMERIC_SCALE", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, + {"CHARACTER_MAXIMUM_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, + 0}, + {"CHARACTER_OCTET_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, 0}, + {"NUMERIC_PRECISION", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, 0}, + {"NUMERIC_SCALE", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, 0}, {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 1, 0}, {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 1, "Collation"}, {"COLUMN_TYPE", 65535, MYSQL_TYPE_STRING, 0, 0, "Type"}, @@ -4097,7 +4104,7 @@ ST_FIELD_INFO collation_fields_info[]= { {"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Collation"}, {"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Charset"}, - {"ID", 11, MYSQL_TYPE_LONG, 0, 0, "Id"}, + {"ID", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Id"}, {"IS_DEFAULT", 3, MYSQL_TYPE_STRING, 0, 0, "Default"}, {"IS_COMPILED", 3, MYSQL_TYPE_STRING, 0, 0, "Compiled"}, {"SORTLEN", 3 ,MYSQL_TYPE_LONG, 0, 0, "Sortlen"}, @@ -4150,7 +4157,7 @@ ST_FIELD_INFO stat_fields_info[]= {"SEQ_IN_INDEX", 2, MYSQL_TYPE_LONG, 0, 0, "Seq_in_index"}, {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Column_name"}, {"COLLATION", 1, MYSQL_TYPE_STRING, 0, 1, "Collation"}, - {"CARDINALITY", 21, MYSQL_TYPE_LONG, 0, 1, "Cardinality"}, + {"CARDINALITY", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 1, "Cardinality"}, {"SUB_PART", 3, MYSQL_TYPE_LONG, 0, 1, "Sub_part"}, {"PACKED", 10, MYSQL_TYPE_STRING, 0, 1, "Packed"}, {"NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"}, diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 512d990347f..6bcca55dfff 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4146,7 +4146,8 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) field_list.push_back(item = new Item_empty_string("Table", NAME_LEN*2)); item->maybe_null= 1; - field_list.push_back(item=new Item_int("Checksum",(longlong) 1,21)); + field_list.push_back(item= new Item_int("Checksum", (longlong) 1, + MY_INT64_NUM_DECIMAL_DIGITS)); item->maybe_null= 1; if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) From 264bcedd7e50f4e55b722d3ae29c5a30da461b6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 10:44:48 +0300 Subject: [PATCH 086/789] Fix typo. --- sql/sql_show.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4de70a67b36..68fa07deec4 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4157,7 +4157,7 @@ ST_FIELD_INFO stat_fields_info[]= {"SEQ_IN_INDEX", 2, MYSQL_TYPE_LONG, 0, 0, "Seq_in_index"}, {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Column_name"}, {"COLLATION", 1, MYSQL_TYPE_STRING, 0, 1, "Collation"}, - {"CARDINALITY", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 1, "Cardinality"}, + {"CARDINALITY", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 1, "Cardinality"}, {"SUB_PART", 3, MYSQL_TYPE_LONG, 0, 1, "Sub_part"}, {"PACKED", 10, MYSQL_TYPE_STRING, 0, 1, "Packed"}, {"NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"}, From 582221604e8e567e154ce499bd09e0204b965e39 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 15:37:10 +0700 Subject: [PATCH 087/789] Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes - correction of part 1 add ndb_waiter option to wait for single user mode ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes - correction of part 1 ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes - correction of part 1 ndb/tools/waiter.cpp: add ndb_waiter option to wait for single user mode --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 36 ++++++++++++++----------- ndb/src/kernel/blocks/dbdict/Dbdict.hpp | 2 ++ ndb/tools/waiter.cpp | 12 ++++++++- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 16964ec443f..b125f8d988d 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -2910,9 +2910,7 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){ break; } - if(getNodeState().getSingleUserMode() && - (refToNode(signal->getSendersBlockRef()) != - getNodeState().getSingleUserApi())) + if (checkSingleUserMode(signal->getSendersBlockRef())) { jam(); parseRecord.errorCode = CreateTableRef::SingleUser; @@ -3081,9 +3079,7 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal) return; } - if(getNodeState().getSingleUserMode() && - (refToNode(signal->getSendersBlockRef()) != - getNodeState().getSingleUserApi())) + if (checkSingleUserMode(signal->getSendersBlockRef())) { jam(); alterTableRef(signal, req, AlterTableRef::SingleUser); @@ -5419,9 +5415,7 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){ return; } - if(getNodeState().getSingleUserMode() && - (refToNode(signal->getSendersBlockRef()) != - getNodeState().getSingleUserApi())) + if (checkSingleUserMode(signal->getSendersBlockRef())) { jam(); dropTableRef(signal, req, DropTableRef::SingleUser); @@ -6558,9 +6552,7 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal) jam(); tmperr = CreateIndxRef::Busy; } - else if(getNodeState().getSingleUserMode() && - (refToNode(senderRef) != - getNodeState().getSingleUserApi())) + else if (checkSingleUserMode(senderRef)) { jam(); tmperr = CreateIndxRef::SingleUser; @@ -7135,9 +7127,7 @@ Dbdict::execDROP_INDX_REQ(Signal* signal) jam(); tmperr = DropIndxRef::Busy; } - else if(getNodeState().getSingleUserMode() && - (refToNode(senderRef) != - getNodeState().getSingleUserApi())) + else if (checkSingleUserMode(senderRef)) { jam(); tmperr = DropIndxRef::SingleUser; @@ -10579,4 +10569,20 @@ Dbdict::getMetaAttribute(MetaData::Attribute& attr, const MetaData::Table& table return 0; } +/* + return 1 if all of the below is true + a) node in single user mode + b) senderRef is not a db node + c) senderRef nodeid is not the singleUserApi +*/ + +int Dbdict::checkSingleUserMode(Uint32 senderRef) +{ + Uint32 nodeId = refToNode(senderRef); + return + getNodeState().getSingleUserMode() && + (getNodeInfo(nodeId).m_type != NodeInfo::DB) && + (nodeId != getNodeState().getSingleUserApi()); +} + CArray g_key_descriptor_pool; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 49b85affdcd..6fda440f753 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -1997,6 +1997,8 @@ private: int getMetaTable(MetaData::Table& table, const char* tableName); int getMetaAttribute(MetaData::Attribute& attribute, const MetaData::Table& table, Uint32 attributeId); int getMetaAttribute(MetaData::Attribute& attribute, const MetaData::Table& table, const char* attributeName); + + int checkSingleUserMode(Uint32 senderRef); }; #endif diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index a3a986b2929..e221a26182e 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -30,12 +30,14 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); enum ndb_waiter_options { - OPT_WAIT_STATUS_NOT_STARTED = NDB_STD_OPTIONS_LAST + OPT_WAIT_STATUS_NOT_STARTED = NDB_STD_OPTIONS_LAST, + OPT_WAIT_STATUS_SINGLE_USER }; NDB_STD_OPTS_VARS; static int _no_contact = 0; static int _not_started = 0; +static int _single_user = 0; static int _timeout = 120; const char *load_default_groups[]= { "mysql_cluster",0 }; @@ -49,6 +51,10 @@ static struct my_option my_long_options[] = { "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started", (gptr*) &_not_started, (gptr*) &_not_started, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "single-user", OPT_WAIT_STATUS_SINGLE_USER, + "Wait for cluster to enter single user mode", + (gptr*) &_single_user, (gptr*) &_single_user, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "timeout", 't', "Timeout to wait", (gptr*) &_timeout, (gptr*) &_timeout, 0, GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 }, @@ -90,6 +96,10 @@ int main(int argc, char** argv){ { wait_status= NDB_MGM_NODE_STATUS_NOT_STARTED; } + else if (_single_user) + { + wait_status= NDB_MGM_NODE_STATUS_SINGLEUSER; + } else { wait_status= NDB_MGM_NODE_STATUS_STARTED; From 224ad236b0b33996dfeab0c9c2efce19040a8681 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 10:15:33 +0100 Subject: [PATCH 088/789] Implementing the feature at BUG#26964 "option --no-beep for mysqladmin". Option --no-beep is added to mysqladmin like it already exists in the "mysql" command-line client (short option: -b; long: --no-beep). Default is to emit beeps like that "mysql" client. Can't test in the testsuite; but on my Linux I tested by hand: open a *xterm* and there do "mysqladmin shutdown" - I hear a beep; with --no-beep, no beep. client/mysqladmin.cc: new option --no-beep like in mysql.cc: if used, no beeps (ASCII 7, BEL) are emitted upon errors. Default is to emit beeps, like mysql.cc. --- client/mysqladmin.cc | 69 ++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index ccfff4d7a03..cb704d716cc 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -40,7 +40,7 @@ ulonglong last_values[MAX_MYSQL_VAR]; static int interval=0; static my_bool option_force=0,interrupted=0,new_line=0, opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0, - tty_password= 0, info_flag= 0; + tty_password= 0, info_flag= 0, opt_nobeep; static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations, opt_count_iterations= 0; static ulong opt_connect_timeout, opt_shutdown_timeout; @@ -54,6 +54,7 @@ static char *opt_ndb_connectstring=0; static char *shared_memory_base_name=0; #endif static uint opt_protocol=0; +static myf error_flags; /* flags to pass to my_printf_error, like ME_BELL */ /* When using extended-status relatively, ex_val_max_len is the estimated @@ -154,6 +155,8 @@ static struct my_option my_long_options[] = NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"no-beep", 'b', "Turn off beep on error.", (gptr*) &opt_nobeep, + (gptr*) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -352,6 +355,8 @@ int main(int argc,char *argv[]) #endif if (default_charset) mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); + error_flags= (myf)(opt_nobeep ? 0 : ME_BELL); + if (sql_connect(&mysql, option_wait)) { unsigned int err= mysql_errno(&mysql); @@ -450,7 +455,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait) if (!host) host= (char*) LOCAL_HOST; my_printf_error(0,"connect to server at '%s' failed\nerror: '%s'", - MYF(ME_BELL), host, mysql_error(mysql)); + error_flags, host, mysql_error(mysql)); if (mysql_errno(mysql) == CR_CONNECTION_ERROR) { fprintf(stderr, @@ -525,14 +530,14 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) char buff[FN_REFLEN+20]; if (argc < 2) { - my_printf_error(0,"Too few arguments to create",MYF(ME_BELL)); + my_printf_error(0, "Too few arguments to create", error_flags); return 1; } sprintf(buff,"create database `%.*s`",FN_REFLEN,argv[1]); if (mysql_query(mysql,buff)) { my_printf_error(0,"CREATE DATABASE failed; error: '%-.200s'", - MYF(ME_BELL), mysql_error(mysql)); + error_flags, mysql_error(mysql)); return -1; } argc--; argv++; @@ -542,7 +547,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { if (argc < 2) { - my_printf_error(0,"Too few arguments to drop",MYF(ME_BELL)); + my_printf_error(0, "Too few arguments to drop", error_flags); return 1; } if (drop_db(mysql,argv[1])) @@ -567,7 +572,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (mysql_shutdown(mysql, SHUTDOWN_DEFAULT)) { - my_printf_error(0,"shutdown failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "shutdown failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -588,7 +593,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) case ADMIN_RELOAD: if (mysql_query(mysql,"flush privileges")) { - my_printf_error(0,"reload failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "reload failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -599,7 +604,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) REFRESH_READ_LOCK | REFRESH_SLAVE | REFRESH_MASTER))) { - my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "refresh failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -607,7 +612,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) case ADMIN_FLUSH_THREADS: if (mysql_refresh(mysql,(uint) REFRESH_THREADS)) { - my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "refresh failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -651,7 +656,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) "show processlist")) || !(result = mysql_store_result(mysql))) { - my_printf_error(0,"process list failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "process list failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -674,7 +679,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) char *pos; if (argc < 2) { - my_printf_error(0,"Too few arguments to 'kill'",MYF(ME_BELL)); + my_printf_error(0, "Too few arguments to 'kill'", error_flags); return 1; } pos=argv[1]; @@ -682,7 +687,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { if (mysql_kill(mysql,(ulong) atol(pos))) { - my_printf_error(0,"kill failed on %ld; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "kill failed on %ld; error: '%s'", error_flags, atol(pos), mysql_error(mysql)); error=1; } @@ -698,7 +703,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) case ADMIN_DEBUG: if (mysql_dump_debug_info(mysql)) { - my_printf_error(0,"debug failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "debug failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -712,7 +717,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (mysql_query(mysql,"show /*!40003 GLOBAL */ variables") || !(res=mysql_store_result(mysql))) { - my_printf_error(0,"unable to show variables; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "unable to show variables; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -734,7 +739,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (mysql_query(mysql, "show /*!50002 GLOBAL */ status") || !(res = mysql_store_result(mysql))) { - my_printf_error(0, "unable to show status; error: '%s'", MYF(ME_BELL), + my_printf_error(0, "unable to show status; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -784,7 +789,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { if (mysql_refresh(mysql,REFRESH_LOG)) { - my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "refresh failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -794,7 +799,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { if (mysql_query(mysql,"flush hosts")) { - my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "refresh failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -804,7 +809,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { if (mysql_query(mysql,"flush tables")) { - my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "refresh failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -814,7 +819,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { if (mysql_query(mysql,"flush status")) { - my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "refresh failed; error: '%s'", error_flags, mysql_error(mysql)); return -1; } @@ -831,7 +836,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (argc < 2) { - my_printf_error(0,"Too few arguments to change password",MYF(ME_BELL)); + my_printf_error(0, "Too few arguments to change password", error_flags); return 1; } if (argv[1][0]) @@ -854,7 +859,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) { my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'", - MYF(ME_BELL),mysql_error(mysql)); + error_flags, mysql_error(mysql)); return -1; } else @@ -865,7 +870,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) my_printf_error(0, "Could not get old_passwords setting from " "server; error: '%s'", - MYF(ME_BELL),mysql_error(mysql)); + error_flags, mysql_error(mysql)); return -1; } if (!mysql_num_rows(res)) @@ -890,7 +895,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (mysql_query(mysql,"set sql_log_off=1")) { my_printf_error(0, "Can't turn off logging; error: '%s'", - MYF(ME_BELL),mysql_error(mysql)); + error_flags, mysql_error(mysql)); return -1; } if (mysql_query(mysql,buff)) @@ -898,7 +903,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (mysql_errno(mysql)!=1290) { my_printf_error(0,"unable to change password; error: '%s'", - MYF(ME_BELL),mysql_error(mysql)); + error_flags, mysql_error(mysql)); return -1; } else @@ -912,7 +917,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) " with grant tables disabled (was started with" " --skip-grant-tables).\n" "Use: \"mysqladmin flush-privileges password '*'\"" - " instead", MYF(ME_BELL)); + " instead", error_flags); return -1; } } @@ -923,7 +928,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) case ADMIN_START_SLAVE: if (mysql_query(mysql, "START SLAVE")) { - my_printf_error(0, "Error starting slave: %s", MYF(ME_BELL), + my_printf_error(0, "Error starting slave: %s", error_flags, mysql_error(mysql)); return -1; } @@ -933,7 +938,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) case ADMIN_STOP_SLAVE: if (mysql_query(mysql, "STOP SLAVE")) { - my_printf_error(0, "Error stopping slave: %s", MYF(ME_BELL), + my_printf_error(0, "Error stopping slave: %s", error_flags, mysql_error(mysql)); return -1; } @@ -959,7 +964,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) else { my_printf_error(0,"mysqld doesn't answer to ping, error: '%s'", - MYF(ME_BELL),mysql_error(mysql)); + error_flags, mysql_error(mysql)); return -1; } } @@ -970,7 +975,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { if (argc < 2) { - my_printf_error(0,"Too few arguments to ndb-mgm",MYF(ME_BELL)); + my_printf_error(0, "Too few arguments to ndb-mgm", error_flags); return 1; } { @@ -984,7 +989,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) break; #endif default: - my_printf_error(0,"Unknown command: '%-.60s'",MYF(ME_BELL),argv[0]); + my_printf_error(0, "Unknown command: '%-.60s'", error_flags, argv[0]); return 1; } } @@ -1062,7 +1067,7 @@ static int drop_db(MYSQL *mysql, const char *db) sprintf(name_buff,"drop database `%.*s`",FN_REFLEN,db); if (mysql_query(mysql,name_buff)) { - my_printf_error(0,"DROP DATABASE %s failed;\nerror: '%s'",MYF(ME_BELL), + my_printf_error(0, "DROP DATABASE %s failed;\nerror: '%s'", error_flags, db,mysql_error(mysql)); return 1; } @@ -1287,7 +1292,7 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile) if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'")) { - my_printf_error(0,"query failed; error: '%s'",MYF(ME_BELL), + my_printf_error(0, "query failed; error: '%s'", error_flags, mysql_error(mysql)); } result = mysql_store_result(mysql); From 6e9ebc2a9f013ea5ae5b87fd73787c9b9b3646d6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 10:17:21 +0100 Subject: [PATCH 089/789] BUG#25601 Missing m4 macro MYSQL_CHECK_TIME_T config/ac-macros/misc.m4: BUG#25601 MYSQL_CHECK_TIME_T macro is missing in 5.0 and upward, likely incorrectly merged up from 4.1. This patch is a verbatim copy from 4.1's acinclude.m4 (except for typos in comment). --- config/ac-macros/misc.m4 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4 index d8199f5970e..09081fb3eac 100644 --- a/config/ac-macros/misc.m4 +++ b/config/ac-macros/misc.m4 @@ -790,3 +790,27 @@ esac AC_SUBST(AR) AC_SUBST(ARFLAGS) ]) + +dnl +dnl Macro to check time_t range: according to C standard +dnl array index must be greater than 0 => if time_t is signed, +dnl the code in the macros below won't compile. +dnl + +AC_DEFUN([MYSQL_CHECK_TIME_T],[ + AC_MSG_CHECKING(if time_t is unsigned) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ +#include + ]], + [[ + int array[(((time_t)-1) > 0) ? 1 : -1]; + ]] ) + ], [ + AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned]) + AC_MSG_RESULT(yes) + ], + [AC_MSG_RESULT(no)] + ) +]) + From 5c1e48c51d938278eb185b47010387d63184781c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 13:37:06 +0400 Subject: [PATCH 090/789] aftermerge fix mysql-test/r/view.result: merging --- mysql-test/r/view.result | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 7f9353d56fe..dc87f97b322 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3272,4 +3272,41 @@ a IS TRUE old_istrue a IS NOT TRUE old_isnottrue a IS FALSE old_isfalse a IS NOT drop view view_24532_a; drop view view_24532_b; drop table table_24532; +CREATE TABLE t1 ( +lid int NOT NULL PRIMARY KEY, +name char(10) NOT NULL +); +INSERT INTO t1 (lid, name) VALUES +(1, 'YES'), (2, 'NO'); +CREATE TABLE t2 ( +id int NOT NULL PRIMARY KEY, +gid int NOT NULL, +lid int NOT NULL, +dt date +); +INSERT INTO t2 (id, gid, lid, dt) VALUES +(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'), +(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02'); +SELECT DISTINCT t2.gid AS lgid, +(SELECT t1.name FROM t1, t2 +WHERE t1.lid = t2.lid AND t2.gid = lgid +ORDER BY t2.dt DESC LIMIT 1 +) as clid +FROM t2; +lgid clid +1 NO +2 YES +CREATE VIEW v1 AS +SELECT DISTINCT t2.gid AS lgid, +(SELECT t1.name FROM t1, t2 +WHERE t1.lid = t2.lid AND t2.gid = lgid +ORDER BY t2.dt DESC LIMIT 1 +) as clid +FROM t2; +SELECT * FROM v1; +lgid clid +1 NO +2 YES +DROP VIEW v1; +DROP table t1,t2; End of 5.0 tests. From 32ed7ddccc565bdfd271aeb89371bdf1aa0a4376 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 13:38:40 +0400 Subject: [PATCH 091/789] aftermerge fix mysql-test/r/sp.result: merging mysql-test/r/view.result: merging --- mysql-test/r/sp.result | 13 +++++++++++++ mysql-test/r/view.result | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index c73a44042c3..c46558fb08f 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5857,4 +5857,17 @@ func_8407_b() 1500 drop function func_8407_a| drop function func_8407_b| +DROP FUNCTION IF EXISTS bug25373| +CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER +LANGUAGE SQL DETERMINISTIC +RETURN p1;| +CREATE TABLE t3 (f1 INT, f2 FLOAT)| +INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| +SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| +SUM(f2) bug25373(f1) +6.3000000715256 1 +15 2 +21.300000071526 NULL +DROP FUNCTION bug25373| +DROP TABLE t3| drop table t1,t2; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 30043e066db..bc0906b07f3 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3263,6 +3263,43 @@ a IS TRUE old_istrue a IS NOT TRUE old_isnottrue a IS FALSE old_isfalse a IS NOT drop view view_24532_a; drop view view_24532_b; drop table table_24532; +CREATE TABLE t1 ( +lid int NOT NULL PRIMARY KEY, +name char(10) NOT NULL +); +INSERT INTO t1 (lid, name) VALUES +(1, 'YES'), (2, 'NO'); +CREATE TABLE t2 ( +id int NOT NULL PRIMARY KEY, +gid int NOT NULL, +lid int NOT NULL, +dt date +); +INSERT INTO t2 (id, gid, lid, dt) VALUES +(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'), +(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02'); +SELECT DISTINCT t2.gid AS lgid, +(SELECT t1.name FROM t1, t2 +WHERE t1.lid = t2.lid AND t2.gid = lgid +ORDER BY t2.dt DESC LIMIT 1 +) as clid +FROM t2; +lgid clid +1 NO +2 YES +CREATE VIEW v1 AS +SELECT DISTINCT t2.gid AS lgid, +(SELECT t1.name FROM t1, t2 +WHERE t1.lid = t2.lid AND t2.gid = lgid +ORDER BY t2.dt DESC LIMIT 1 +) as clid +FROM t2; +SELECT * FROM v1; +lgid clid +1 NO +2 YES +DROP VIEW v1; +DROP table t1,t2; End of 5.0 tests. DROP DATABASE IF EXISTS `d-1`; CREATE DATABASE `d-1`; From 3dbfc95c334e9acbaa0185e387fc2af2e986d3ff Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 16:39:13 +0700 Subject: [PATCH 092/789] ndb single user basic test --- mysql-test/r/ndb_single_user.result | 46 ++++++++++++++++ mysql-test/t/ndb_single_user.test | 84 +++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 mysql-test/r/ndb_single_user.result create mode 100644 mysql-test/t/ndb_single_user.test diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result new file mode 100644 index 00000000000..711d343fffb --- /dev/null +++ b/mysql-test/r/ndb_single_user.result @@ -0,0 +1,46 @@ +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +create table t1 (a int key, b int unique, c int) engine ndb; +ERROR HY000: Can't create table './test/t1.frm' (errno: 155) +create table t1 (a int key, b int unique, c int) engine ndb; +insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); +create table t2 as select * from t1; +select * from t1 where a = 1; +a b c +1 1 0 +select * from t1 where b = 4; +a b c +4 4 0 +select * from t1 where a > 4 order by a; +a b c +5 5 0 +6 6 0 +7 7 0 +8 8 0 +9 9 0 +10 10 0 +update t1 set b=102 where a = 2; +update t1 set b=103 where b = 3; +update t1 set b=b+100; +update t1 set b=b+100 where a > 7; +delete from t1; +insert into t1 select * from t2; +drop table t1; +ERROR 42S02: Unknown table 't1' +create index new_index on t1 (c); +ERROR 42S02: Table 'test.t1' doesn't exist +insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); +ERROR 42S02: Table 'test.t1' doesn't exist +select * from t1 where a = 1; +ERROR 42S02: Table 'test.t1' doesn't exist +select * from t1 where b = 4; +ERROR 42S02: Table 'test.t1' doesn't exist +update t1 set b=102 where a = 2; +ERROR 42S02: Table 'test.t1' doesn't exist +update t1 set b=103 where b = 3; +ERROR 42S02: Table 'test.t1' doesn't exist +update t1 set b=b+100; +ERROR 42S02: Table 'test.t1' doesn't exist +update t1 set b=b+100 where a > 7; +ERROR 42S02: Table 'test.t1' doesn't exist +drop table t1; diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/t/ndb_single_user.test new file mode 100644 index 00000000000..c655124f79f --- /dev/null +++ b/mysql-test/t/ndb_single_user.test @@ -0,0 +1,84 @@ +-- source include/have_ndb.inc +-- source include/have_multi_ndb.inc +-- source include/ndb_default_cluster.inc +-- source include/not_embedded.inc + +--disable_warnings +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +--enable_warnings + +# operations allowed while cluster is in single user mode + +--connection server1 +--let $node_id= `SHOW STATUS LIKE 'Ndb_cluster_node_id'` +--disable_query_log +--eval set @node_id= SUBSTRING('$node_id', 20)+0 +--enable_query_log +--let $node_id= `SELECT @node_id` +--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT + +# verify that we are indeed in single user mode +--connection server2 +--error 1005 +create table t1 (a int key, b int unique, c int) engine ndb; + +# test some sql on first mysqld +--connection server1 +create table t1 (a int key, b int unique, c int) engine ndb; +insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); +create table t2 as select * from t1; +# read with pk +select * from t1 where a = 1; +# read with unique index +select * from t1 where b = 4; +# read with ordered index +select * from t1 where a > 4 order by a; +# update with pk +update t1 set b=102 where a = 2; +# update with unique index +update t1 set b=103 where b = 3; +# update with full table scan +update t1 set b=b+100; +# update with ordered insex scan +update t1 set b=b+100 where a > 7; +# delete with full table scan +delete from t1; +insert into t1 select * from t2; + +# test some sql on other mysqld +--connection server2 +--error 1051 +drop table t1; +--error 1146 +#--error 1296 +create index new_index on t1 (c); +--error 1146 +#--error 1296 +insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); +--error 1146 +#--error 1296 +select * from t1 where a = 1; +--error 1146 +#--error 1296 +select * from t1 where b = 4; +--error 1146 +#--error 1296 +update t1 set b=102 where a = 2; +--error 1146 +#--error 1296 +update t1 set b=103 where b = 3; +--error 1146 +#--error 1296 +update t1 set b=b+100; +--error 1146 +#--error 1296 +update t1 set b=b+100 where a > 7; + +--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT + +# cleanup +--connection server1 +drop table t1; From 729bcaf430d3c41606611b87b976645e1e744b04 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 01:45:32 -0800 Subject: [PATCH 093/789] Fixed bug #26661: crash when order by clause in a union construct references invalid name. Derived tables currently cannot use outer references. Thus there is no outer context for them. The 4.1 code takes this fact into account while the Item_field::fix_outer_field code of 5.0 lost the check that blocks any attempts to resolve names in outer context for derived tables. mysql-test/r/union.result: Added a test case for bug #26661. mysql-test/t/union.test: Added a test case for bug #26661. sql/item.cc: Fixed bug #26661. Derived tables currently cannot use outer references. Thus there is no outer context for them. The 4.1 code takes this fact into account while the Item_field::fix_outer_field code of 5.0 lost the check that blocks any attempts to resolve names in outer context for derived tables. --- mysql-test/r/union.result | 11 +++++++++++ mysql-test/t/union.test | 13 +++++++++++++ sql/item.cc | 7 ++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index dc174e35c8f..d7e222f845e 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1370,4 +1370,15 @@ select _utf8'12' union select _latin1'12345'; 12 12 12345 +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (3),(1),(2),(4),(1); +SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a) AS test; +a +1 +2 +3 +4 +SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test; +ERROR 42S22: Unknown column 'c' in 'order clause' +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index bf5c5e066f0..29a9ee36481 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -855,4 +855,17 @@ drop table t1, t2; # select _utf8'12' union select _latin1'12345'; +# +# Bug #26661: UNION with ORDER BY undefined column in FROM list +# + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (3),(1),(2),(4),(1); + +SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a) AS test; +--error 1054 +SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test; + +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/sql/item.cc b/sql/item.cc index c5d8a62761c..80c3311b2a7 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3441,7 +3441,12 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) */ Name_resolution_context *last_checked_context= context; Item **ref= (Item **) not_found_item; - Name_resolution_context *outer_context= context->outer_context; + SELECT_LEX *current_sel= (SELECT_LEX *) thd->lex->current_select; + Name_resolution_context *outer_context= 0; + /* Currently derived tables cannot be correlated */ + if (current_sel->master_unit()->first_select()->linkage != + DERIVED_TABLE_TYPE) + outer_context= context->outer_context; for (; outer_context; outer_context= outer_context->outer_context) From 0ea47f3ed46011263d696f9852190c6a2edf4772 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 13:12:31 +0300 Subject: [PATCH 094/789] BUG#9953: CONVERT_TZ requires mysql.time_zone_name to be locked The problem was that some facilities (like CONVERT_TZ() function or server HELP statement) may require implicit access to some tables in 'mysql' database. This access was done by ordinary means of adding such tables to the list of tables the query is going to open. However, if we issued LOCK TABLES before that, we would get "table was not locked" error trying to open such implicit tables. The solution is to treat certain tables as MySQL system tables, like we already do for mysql.proc. Such tables may be opened for reading at any moment regardless of any locks in effect. The cost of this is that system table may be locked for writing only together with other system tables, it is disallowed to lock system tables for writing and have any other lock on any other table. After this patch the following tables are treated as MySQL system tables: mysql.help_category mysql.help_keyword mysql.help_relation mysql.help_topic mysql.proc (it already was) mysql.time_zone mysql.time_zone_leap_second mysql.time_zone_name mysql.time_zone_transition mysql.time_zone_transition_type These tables are now opened with open_system_tables_for_read() and closed with close_system_tables(), or one table may be opened with open_system_table_for_update() and closed with close_thread_tables() (the latter is used for mysql.proc table, which is updated as part of normal MySQL server operation). These functions may be used when some tables were opened and locked already. NOTE: online update of time zone tables is not possible during replication, because there's no time zone cache flush neither on LOCK TABLES, nor on FLUSH TABLES, so the master may serve stale time zone data from cache, while on slave updated data will be loaded from the time zone tables. mysql-test/r/help.result: Update result. mysql-test/r/lock.result: Update result. mysql-test/r/sp-error.result: Update result. mysql-test/r/timezone2.result: Add result for bug#9953: CONVERT_TZ requires mysql.time_zone_name to be locked. mysql-test/r/view.result: Update result: use table t3 rather than utilize MySQL system table. mysql-test/t/help.test: Test that we can use HELP even under LOCK TABLES. mysql-test/t/lock.test: Test LOCK TABLE on system tables. mysql-test/t/timezone2.test: Add test case for bug#9953: CONVERT_TZ requires mysql.time_zone_name to be locked. mysql-test/t/view.test: Update test: use table t3 rather that utilize MySQL system table. sql/handler.h: Fix comment for 'count' parameter of check_if_locking_is_allowed(). Add 'current' and 'system_count' parameters. sql/item_create.cc: We no longer have LEX::add_time_zone_tables_to_query_tables(). sql/item_timefunc.cc: We no longer have LEX::time_zone_tables_used, so Item_func_convert_tz::fix_fields() became the same as base Item_date_func::fix_fields(). my_tz_find() no longer takes table list, but takes THD pointer now. sql/item_timefunc.h: Remove dead field and method. sql/lock.cc: Pass values for 'current' and 'system_count' to check_if_locking_is_allowed(). sql/log_event.cc: We no longer have my_tz_find_with_opening_tz_tables(), its functions is performed by my_tz_find(). sql/mysql_priv.h: Add functions to work with MySQL system tables. sql/set_var.cc: my_tz_find() no longer takes table list, but takes THD pointer now. sql/sp.cc: Remove close_proc_table(). Use close_system_tables() instead. Use open_system_tables_for_read() and open_system_table_for_update(). sql/sp.h: Remove close_proc_table() declaration. sql/sql_base.cc: Add implementation of open_system_tables_for_read(), close_system_tables(), open_system_table_for_update(). sql/sql_help.cc: Operate on MySQL system tables mysql.help_* with open_system_tables_for_read() and close_system_tables() to allow the usage of HELP statement under LOCK TABLES. sql/sql_lex.cc: Remove LEX::time_zone_tables_used and LEX::add_time_zone_tables_to_query_tables() which are no longer used. sql/sql_lex.h: Remove LEX::time_zone_tables_used and LEX::add_time_zone_tables_to_query_tables() which are no longer used. sql/sql_parse.cc: Remove references to LEX::time_zone_tables_used and my_tz_check_n_skip_implicit_tables() which are no longer used. sql/sql_show.cc: Use close_system_tables() instead of removed close_proc_table(). sql/sql_view.cc: LEX::time_zone_tables_used is no longer there. sql/sql_yacc.yy: LEX::add_time_zone_tables_to_query_tables() is no longer there. sql/table.cc: Add more tables that should be treated as MySQL system tables. sql/share/errmsg.txt: Change the error message, as now we allow write-locking of several system tables if not mixed with ordinary tables. sql/tztime.cc: Do not add time zone tables to the list of query tables in tz_init_table_list(). Remove fake_time_zone_tables_list and my_tz_get_tables_list(). In my_tz_init(), open mysql.time_zone_leap_second with simple_open_n_lock_tables(), but pass time zone name to my_tz_find(), which will open and close time zone tables as necessary. In tz_load_from_open_tables() do not call table->use_all_columns(), as this was already done in open_system_tables_for_read(). my_tz_find() takes THD pointer instead of table list, and calls open_system_tables_for_read() and close_system_tables() as necessary. Remove my_tz_find_with_opening_tz_tables(). sql/tztime.h: Remove declarations of my_tz_get_table_list(), my_tz_find_with_opening_tz_tables(), fake_time_zone_tables_list, definition of my_tz_check_n_skip_implicit_tables(). Update prototype for my_tz_find(). storage/csv/ha_tina.cc: Add new parameters to check_if_locking_is_allowed(). storage/csv/ha_tina.h: Add new parameters to check_if_locking_is_allowed(). storage/myisam/ha_myisam.cc: Add new parameters to check_if_locking_is_allowed(). In this function we count system tables. If there are system tables, but there are also non-system tables, we report an error. storage/myisam/ha_myisam.h: Add new parameters to check_if_locking_is_allowed(). --- mysql-test/r/help.result | 9 ++ mysql-test/r/lock.result | 21 ++++ mysql-test/r/sp-error.result | 4 +- mysql-test/r/timezone2.result | 11 ++ mysql-test/r/view.result | 7 +- mysql-test/t/help.test | 23 +++- mysql-test/t/lock.test | 44 +++++++- mysql-test/t/timezone2.test | 28 +++++ mysql-test/t/view.test | 5 +- sql/handler.h | 9 +- sql/item_create.cc | 3 - sql/item_timefunc.cc | 18 +-- sql/item_timefunc.h | 3 - sql/lock.cc | 3 +- sql/log_event.cc | 3 +- sql/mysql_priv.h | 6 + sql/set_var.cc | 6 +- sql/share/errmsg.txt | 3 +- sql/sp.cc | 88 ++++----------- sql/sp.h | 1 - sql/sql_base.cc | 119 ++++++++++++++++++++ sql/sql_help.cc | 10 +- sql/sql_lex.cc | 27 ----- sql/sql_lex.h | 6 - sql/sql_parse.cc | 13 +-- sql/sql_show.cc | 2 +- sql/sql_view.cc | 2 - sql/sql_yacc.yy | 9 +- sql/table.cc | 52 ++++++++- sql/tztime.cc | 203 +++++++++------------------------- sql/tztime.h | 35 +----- storage/csv/ha_tina.cc | 3 +- storage/csv/ha_tina.h | 3 +- storage/myisam/ha_myisam.cc | 13 ++- storage/myisam/ha_myisam.h | 3 +- 35 files changed, 430 insertions(+), 365 deletions(-) diff --git a/mysql-test/r/help.result b/mysql-test/r/help.result index 85ca832828d..4b7e320454e 100644 --- a/mysql-test/r/help.result +++ b/mysql-test/r/help.result @@ -257,3 +257,12 @@ delete from mysql.help_relation where help_keyword_id=@keyword1_id and help_topi delete from mysql.help_relation where help_keyword_id=@keyword2_id and help_topic_id=@topic1_id; delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic3_id; delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic4_id; +End of 4.1 tests. +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT); +LOCK TABLES t1 WRITE; +HELP no_such_topic; +name is_it_category +UNLOCK TABLES; +DROP TABLE t1; +End of 5.1 tests. diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index 7cd223197e7..1a2099b7a94 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -68,6 +68,7 @@ ERROR HY000: Table 't2' was locked with a READ lock and can't be updated delete t2 from t1,t2 where t1.a=t2.a; ERROR HY000: Table 't2' was locked with a READ lock and can't be updated drop table t1,t2; +End of 4.1 tests. drop table if exists t1; create table t1 (a int); lock table t1 write; @@ -75,3 +76,23 @@ flush tables with read lock; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables; drop table t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT); +LOCK TABLES mysql.time_zone READ, mysql.proc READ, t1 READ; +UNLOCK TABLES; +LOCK TABLES mysql.time_zone READ, mysql.proc READ, t1 WRITE; +UNLOCK TABLES; +LOCK TABLES mysql.time_zone READ, mysql.proc READ; +UNLOCK TABLES; +LOCK TABLES mysql.time_zone WRITE, mysql.proc WRITE; +UNLOCK TABLES; +LOCK TABLES mysql.time_zone READ, mysql.proc WRITE, t1 READ; +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types +LOCK TABLES mysql.time_zone WRITE, mysql.proc WRITE, t1 READ; +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types +LOCK TABLES mysql.time_zone WRITE, mysql.proc WRITE, t1 WRITE; +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types +LOCK TABLES mysql.time_zone READ, mysql.proc WRITE; +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types +DROP TABLE t1; +End of 5.1 tests. diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 0ed92aa9e7a..abf64640e94 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -292,9 +292,9 @@ call p()| unlock tables| drop procedure p| lock tables t1 read, mysql.proc write| -ERROR HY000: You can't combine write-locking of system 'mysql.proc' table with other tables +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types lock tables mysql.proc write, mysql.user write| -ERROR HY000: You can't combine write-locking of system 'mysql.proc' table with other tables +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types lock tables t1 read, mysql.proc read| unlock tables| lock tables mysql.proc write| diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index f7631e9657a..32db7ea7fa9 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -285,3 +285,14 @@ ldt ldt2 drop table t1; drop function f1; SET GLOBAL log_bin_trust_function_creators = 0; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TIMESTAMP); +INSERT INTO t1 VALUES (NULL), (NULL); +LOCK TABLES t1 WRITE; +SELECT CONVERT_TZ(NOW(), 'UTC', 'Europe/Moscow') IS NULL; +CONVERT_TZ(NOW(), 'UTC', 'Europe/Moscow') IS NULL +0 +UPDATE t1 SET t = CONVERT_TZ(t, 'UTC', 'Europe/Moscow'); +UNLOCK TABLES; +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 5e81df99d18..c18042be854 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -900,6 +900,7 @@ drop view v1; drop table t1; create table t1 (col1 int); create table t2 (col1 int); +create table t3 (col1 datetime not null); create view v1 as select * from t1; create view v2 as select * from v1; create view v3 as select v2.col1 from v2,t2 where v2.col1 = t2.col1; @@ -1004,8 +1005,8 @@ ERROR HY000: The definition of table 'v2' prevents operation INSERT on table 'v3 insert into v3 (col1) values ((select CONVERT_TZ('20050101000000','UTC','MET') from v2)); ERROR HY000: The definition of table 'v2' prevents operation INSERT on table 'v3'. insert into v3 (col1) values ((select CONVERT_TZ('20050101000000','UTC','MET') from t2)); -insert into mysql.time_zone values ('', (select CONVERT_TZ('20050101000000','UTC','MET') from t2)); -ERROR 23000: Column 'Use_leap_seconds' cannot be null +insert into t3 values ((select CONVERT_TZ('20050101000000','UTC','MET') from t2)); +ERROR 23000: Column 'col1' cannot be null create algorithm=temptable view v4 as select * from t1; insert into t1 values (1),(2),(3); insert into t1 (col1) values ((select max(col1) from v4)); @@ -1017,7 +1018,7 @@ NULL 3 3 drop view v4,v3,v2,v1; -drop table t1,t2; +drop table t1,t2,t3; create table t1 (s1 int); create view v1 as select * from t1; handler v1 open as xx; diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test index ff431fb4ebd..5f234d7c462 100644 --- a/mysql-test/t/help.test +++ b/mysql-test/t/help.test @@ -114,4 +114,25 @@ delete from mysql.help_relation where help_keyword_id=@keyword2_id and help_topi delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic3_id; delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic4_id; -# End of 4.1 tests +--echo End of 4.1 tests. + +# +# Test that we can use HELP even under LOCK TABLES. See bug#9953: +# CONVERT_TZ requires mysql.time_zone_name to be locked. +# +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (i INT); + +LOCK TABLES t1 WRITE; + +HELP no_such_topic; + +UNLOCK TABLES; + +DROP TABLE t1; + + +--echo End of 5.1 tests. diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test index fb5e45433e9..2b8b430f096 100644 --- a/mysql-test/t/lock.test +++ b/mysql-test/t/lock.test @@ -92,7 +92,8 @@ delete from t2 using t1,t2 where t1.a=t2.a; delete t2 from t1,t2 where t1.a=t2.a; drop table t1,t2; -# End of 4.1 tests +--echo End of 4.1 tests. + # # Bug#18884 "lock table + global read lock = crash" @@ -108,3 +109,44 @@ flush tables with read lock; unlock tables; drop table t1; + +# +# Test LOCK TABLE on system tables. See bug#9953: CONVERT_TZ requires +# mysql.time_zone_name to be locked. +# +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (i INT); + +LOCK TABLES mysql.time_zone READ, mysql.proc READ, t1 READ; +UNLOCK TABLES; + +LOCK TABLES mysql.time_zone READ, mysql.proc READ, t1 WRITE; +UNLOCK TABLES; + +LOCK TABLES mysql.time_zone READ, mysql.proc READ; +UNLOCK TABLES; + +LOCK TABLES mysql.time_zone WRITE, mysql.proc WRITE; +UNLOCK TABLES; + +# If at least one system table is locked for WRITE, then all other +# tables should be system tables locked also for WRITE. +--error ER_WRONG_LOCK_OF_SYSTEM_TABLE +LOCK TABLES mysql.time_zone READ, mysql.proc WRITE, t1 READ; + +--error ER_WRONG_LOCK_OF_SYSTEM_TABLE +LOCK TABLES mysql.time_zone WRITE, mysql.proc WRITE, t1 READ; + +--error ER_WRONG_LOCK_OF_SYSTEM_TABLE +LOCK TABLES mysql.time_zone WRITE, mysql.proc WRITE, t1 WRITE; + +--error ER_WRONG_LOCK_OF_SYSTEM_TABLE +LOCK TABLES mysql.time_zone READ, mysql.proc WRITE; + +DROP TABLE t1; + + +--echo End of 5.1 tests. diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index 5e1f74d388f..4f70539ca8d 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -246,3 +246,31 @@ drop function f1; SET GLOBAL log_bin_trust_function_creators = 0; # End of 5.0 tests + + +# +# BUG#9953: CONVERT_TZ requires mysql.time_zone_name to be locked +# BUG#19339: CONVERT_TZ(): overly aggressive in locking time_zone_name +# table +# +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (t TIMESTAMP); +INSERT INTO t1 VALUES (NULL), (NULL); + +LOCK TABLES t1 WRITE; + +# The following two queries should not return error that time zone +# tables aren't locked. We use IS NULL below to supress timestamp +# result. +SELECT CONVERT_TZ(NOW(), 'UTC', 'Europe/Moscow') IS NULL; +UPDATE t1 SET t = CONVERT_TZ(t, 'UTC', 'Europe/Moscow'); + +UNLOCK TABLES; + +DROP TABLE t1; + + +--echo End of 5.1 tests diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 520babafb7e..abb4a803107 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -832,6 +832,7 @@ drop table t1; # create table t1 (col1 int); create table t2 (col1 int); +create table t3 (col1 datetime not null); create view v1 as select * from t1; create view v2 as select * from v1; create view v3 as select v2.col1 from v2,t2 where v2.col1 = t2.col1; @@ -938,7 +939,7 @@ insert into v3 (col1) values ((select max(col1) from v2)); insert into v3 (col1) values ((select CONVERT_TZ('20050101000000','UTC','MET') from v2)); insert into v3 (col1) values ((select CONVERT_TZ('20050101000000','UTC','MET') from t2)); -- error 1048 -insert into mysql.time_zone values ('', (select CONVERT_TZ('20050101000000','UTC','MET') from t2)); +insert into t3 values ((select CONVERT_TZ('20050101000000','UTC','MET') from t2)); # temporary table algorithm view should be equal to subquery in the from clause create algorithm=temptable view v4 as select * from t1; insert into t1 values (1),(2),(3); @@ -946,7 +947,7 @@ insert into t1 (col1) values ((select max(col1) from v4)); select * from t1; drop view v4,v3,v2,v1; -drop table t1,t2; +drop table t1,t2,t3; # # HANDLER with VIEW diff --git a/sql/handler.h b/sql/handler.h index 82970cc1ac6..2b74b28d9ee 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -974,7 +974,11 @@ public: check_if_locking_is_allowed() thd Handler of the thread, trying to lock the table table Table handler to check - count Number of locks already granted to the table + count Total number of tables to be locked + current Index of the current table in the list of the tables + to be locked. + system_count Pointer to the counter of system tables seen thus + far. called_by_privileged_thread TRUE if called from a logger THD (general_log_thd or slow_log_thd) or by a privileged thread, which @@ -993,7 +997,8 @@ public: */ virtual bool check_if_locking_is_allowed(uint sql_command, ulong type, TABLE *table, - uint count, + uint count, uint current, + uint *system_count, bool called_by_privileged_thread) { return TRUE; diff --git a/sql/item_create.cc b/sql/item_create.cc index ff5825ef389..6a1e87a3aae 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -2877,9 +2877,6 @@ Create_func_convert_tz Create_func_convert_tz::s_singleton; Item* Create_func_convert_tz::create(THD *thd, Item *arg1, Item *arg2, Item *arg3) { - if (thd->lex->add_time_zone_tables_to_query_tables(thd)) - return NULL; - return new (thd->mem_root) Item_func_convert_tz(arg1, arg2, arg3); } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 00f077839c3..bfb2e8c33cc 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1927,19 +1927,6 @@ void Item_func_convert_tz::fix_length_and_dec() } -bool -Item_func_convert_tz::fix_fields(THD *thd_arg, Item **ref) -{ - String str; - if (Item_date_func::fix_fields(thd_arg, ref)) - return TRUE; - - tz_tables= thd_arg->lex->time_zone_tables_used; - - return FALSE; -} - - String *Item_func_convert_tz::val_str(String *str) { TIME time_tmp; @@ -1974,16 +1961,17 @@ bool Item_func_convert_tz::get_date(TIME *ltime, { my_time_t my_time_tmp; String str; + THD *thd= current_thd; if (!from_tz_cached) { - from_tz= my_tz_find(args[1]->val_str(&str), tz_tables); + from_tz= my_tz_find(thd, args[1]->val_str(&str)); from_tz_cached= args[1]->const_item(); } if (!to_tz_cached) { - to_tz= my_tz_find(args[2]->val_str(&str), tz_tables); + to_tz= my_tz_find(thd, args[2]->val_str(&str)); to_tz_cached= args[2]->const_item(); } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index e53826ce3df..3a59abf1bda 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -641,8 +641,6 @@ class Time_zone; */ class Item_func_convert_tz :public Item_date_func { - /* Cached pointer to list of pre-opened time zone tables. */ - TABLE_LIST *tz_tables; /* If time zone parameters are constants we are caching objects that represent them (we use separate from_tz_cached/to_tz_cached members @@ -658,7 +656,6 @@ class Item_func_convert_tz :public Item_date_func double val_real() { return (double) val_int(); } String *val_str(String *str); const char *func_name() const { return "convert_tz"; } - bool fix_fields(THD *, Item **); void fix_length_and_dec(); bool get_date(TIME *res, uint fuzzy_date); void cleanup(); diff --git a/sql/lock.cc b/sql/lock.cc index 533307c6b85..20ff8db691d 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -692,6 +692,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, DBUG_PRINT("info", ("count %d", count)); *write_lock_used=0; + uint system_count= 0; for (i=tables=lock_count=0 ; i < count ; i++) { if (table_ptr[i]->s->tmp_table != TMP_TABLE) @@ -705,7 +706,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, */ if (!table_ptr[i]-> file-> check_if_locking_is_allowed(thd->lex->sql_command, thd->lex->type, - table_ptr[i], count, + table_ptr[i], count, i, &system_count, (thd == logger.get_general_log_thd()) || (thd == logger.get_slow_log_thd()) || (thd == logger.get_privileged_thread()))) diff --git a/sql/log_event.cc b/sql/log_event.cc index 54d75449cd5..89b3b18e4d5 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1974,8 +1974,7 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli, if (time_zone_len) { String tmp(time_zone_str, time_zone_len, &my_charset_bin); - if (!(thd->variables.time_zone= - my_tz_find_with_opening_tz_tables(thd, &tmp))) + if (!(thd->variables.time_zone= my_tz_find(thd, &tmp))) { my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), tmp.c_ptr()); thd->variables.time_zone= global_system_variables.time_zone; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3b00149c63a..25b9c625168 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1389,6 +1389,12 @@ int abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt); void close_open_tables_and_downgrade(ALTER_PARTITION_PARAM_TYPE *lpt); void mysql_wait_completed_table(ALTER_PARTITION_PARAM_TYPE *lpt, TABLE *my_table); +/* Functions to work with system tables. */ +bool open_system_tables_for_read(THD *thd, TABLE_LIST *table_list, + Open_tables_state *backup); +void close_system_tables(THD *thd, Open_tables_state *backup); +TABLE *open_system_table_for_update(THD *thd, TABLE_LIST *one_table); + bool close_cached_tables(THD *thd, bool wait_for_refresh, TABLE_LIST *tables, bool have_lock = FALSE); void copy_field_from_tmp_record(Field *field,int offset); bool fill_record(THD *thd, Field **field, List &values, diff --git a/sql/set_var.cc b/sql/set_var.cc index 667abc0af18..7b6301c480b 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2857,8 +2857,7 @@ bool sys_var_thd_time_zone::check(THD *thd, set_var *var) String str(buff, sizeof(buff), &my_charset_latin1); String *res= var->value->val_str(&str); - if (!(var->save_result.time_zone= - my_tz_find(res, thd->lex->time_zone_tables_used))) + if (!(var->save_result.time_zone= my_tz_find(thd, res))) { my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), res ? res->c_ptr() : "NULL"); return 1; @@ -2919,8 +2918,7 @@ void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type) We are guaranteed to find this time zone since its existence is checked during start-up. */ - global_system_variables.time_zone= - my_tz_find(&str, thd->lex->time_zone_tables_used); + global_system_variables.time_zone= my_tz_find(thd, &str); } else global_system_variables.time_zone= my_tz_SYSTEM; diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 29fde49bbd6..c5bda4ac7a6 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5518,8 +5518,7 @@ ER_M_BIGGER_THAN_D 42000 S1009 eng "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.64s')." ger "Für FLOAT(M,D), DOUBLE(M,D) oder DECIMAL(M,D) muss M >= D sein (Feld '%-.64s')" ER_WRONG_LOCK_OF_SYSTEM_TABLE - eng "You can't combine write-locking of system '%-.64s.%-.64s' table with other tables" - ger "Sie können Schreibsperren auf der Systemtabelle '%-.64s.%-.64s' nicht mit anderen Tabellen kombinieren" + eng "You can't combine write-locking of system tables with other tables or lock types" ER_CONNECT_TO_FOREIGN_DATA_SOURCE eng "Unable to connect to foreign data source: %.64s" ger "Kann nicht mit Fremddatenquelle verbinden: %.64s" diff --git a/sql/sp.cc b/sql/sp.cc index 3a7bea6a4b1..b0bf0d4a805 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -68,24 +68,6 @@ enum #define SP_DEFAULT_ACCESS_MAPPING SP_CONTAINS_SQL -/* - Close mysql.proc, opened with open_proc_table_for_read(). - - SYNOPSIS - close_proc_table() - thd Thread context - backup Pointer to Open_tables_state instance which holds - information about tables which were open before we - decided to access mysql.proc. -*/ - -void close_proc_table(THD *thd, Open_tables_state *backup) -{ - close_thread_tables(thd); - thd->restore_backup_open_tables_state(backup); -} - - /* Open the mysql.proc table for read. @@ -96,13 +78,6 @@ void close_proc_table(THD *thd, Open_tables_state *backup) currently open tables will be saved, and from which will be restored when we will end work with mysql.proc. - NOTES - Thanks to restrictions which we put on opening and locking of - this table for writing, we can open and lock it for reading - even when we already have some other tables open and locked. - One must call close_proc_table() to close table opened with - this call. - RETURN 0 Error # Pointer to TABLE object of mysql.proc @@ -110,38 +85,18 @@ void close_proc_table(THD *thd, Open_tables_state *backup) TABLE *open_proc_table_for_read(THD *thd, Open_tables_state *backup) { - TABLE_LIST tables; - TABLE *table; - bool not_used; - DBUG_ENTER("open_proc_table"); + DBUG_ENTER("open_proc_table_for_read"); - thd->reset_n_backup_open_tables_state(backup); + TABLE_LIST table; + bzero((char*) &table, sizeof(table)); + table.db= (char*) "mysql"; + table.table_name= table.alias= (char*)"proc"; + table.lock_type= TL_READ; - bzero((char*) &tables, sizeof(tables)); - tables.db= (char*) "mysql"; - tables.table_name= tables.alias= (char*)"proc"; - if (!(table= open_table(thd, &tables, thd->mem_root, ¬_used, - MYSQL_LOCK_IGNORE_FLUSH))) - { - thd->restore_backup_open_tables_state(backup); + if (!open_system_tables_for_read(thd, &table, backup)) + DBUG_RETURN(table.table); + else DBUG_RETURN(0); - } - table->use_all_columns(); - - DBUG_ASSERT(table->s->system_table); - - table->reginfo.lock_type= TL_READ; - /* - We have to ensure we are not blocked by a flush tables, as this - could lead to a deadlock if we have other tables opened. - */ - if (!(thd->lock= mysql_lock_tables(thd, &table, 1, - MYSQL_LOCK_IGNORE_FLUSH, ¬_used))) - { - close_proc_table(thd, backup); - DBUG_RETURN(0); - } - DBUG_RETURN(table); } @@ -162,20 +117,15 @@ TABLE *open_proc_table_for_read(THD *thd, Open_tables_state *backup) static TABLE *open_proc_table_for_update(THD *thd) { - TABLE_LIST tables; - TABLE *table; - DBUG_ENTER("open_proc_table"); + DBUG_ENTER("open_proc_table_for_update"); - bzero((char*) &tables, sizeof(tables)); - tables.db= (char*) "mysql"; - tables.table_name= tables.alias= (char*)"proc"; - tables.lock_type= TL_WRITE; + TABLE_LIST table; + bzero((char*) &table, sizeof(table)); + table.db= (char*) "mysql"; + table.table_name= table.alias= (char*)"proc"; + table.lock_type= TL_WRITE; - table= open_ltable(thd, &tables, TL_WRITE); - if (table) - table->use_all_columns(); - - DBUG_RETURN(table); + DBUG_RETURN(open_system_table_for_update(thd, &table)); } @@ -364,7 +314,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp) chistics.comment.str= ptr; chistics.comment.length= length; - close_proc_table(thd, &open_tables_state_backup); + close_system_tables(thd, &open_tables_state_backup); table= 0; ret= db_load_routine(thd, type, name, sphp, @@ -373,7 +323,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp) done: if (table) - close_proc_table(thd, &open_tables_state_backup); + close_system_tables(thd, &open_tables_state_backup); DBUG_RETURN(ret); } @@ -1126,7 +1076,7 @@ sp_routine_exists_in_table(THD *thd, int type, sp_name *name) { if ((ret= db_find_routine_aux(thd, type, name, table)) != SP_OK) ret= SP_KEY_NOT_FOUND; - close_proc_table(thd, &open_tables_state_backup); + close_system_tables(thd, &open_tables_state_backup); } return ret; } diff --git a/sql/sp.h b/sql/sp.h index 330360fc1aa..24c0756c426 100644 --- a/sql/sp.h +++ b/sql/sp.h @@ -100,7 +100,6 @@ extern "C" byte* sp_sroutine_key(const byte *ptr, uint *plen, my_bool first); we already have some tables open and locked. */ TABLE *open_proc_table_for_read(THD *thd, Open_tables_state *backup); -void close_proc_table(THD *thd, Open_tables_state *backup); /* diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 67e8d79b2e8..4a4fcfb0da3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6675,3 +6675,122 @@ has_two_write_locked_tables_with_auto_increment(TABLE_LIST *tables) } return 0; } + + +/* + Open and lock system tables for read. + + SYNOPSIS + open_system_tables_for_read() + thd Thread context. + table_list List of tables to open. + backup Pointer to Open_tables_state instance where + information about currently open tables will be + saved, and from which will be restored when we will + end work with system tables. + + NOTES + Thanks to restrictions which we put on opening and locking of + system tables for writing, we can open and lock them for reading + even when we already have some other tables open and locked. One + must call close_system_tables() to close systems tables opened + with this call. + + RETURN + FALSE Success + TRUE Error +*/ + +bool +open_system_tables_for_read(THD *thd, TABLE_LIST *table_list, + Open_tables_state *backup) +{ + DBUG_ENTER("open_system_tables_for_read"); + + thd->reset_n_backup_open_tables_state(backup); + + uint count= 0; + bool not_used; + for (TABLE_LIST *tables= table_list; tables; tables= tables->next_global) + { + TABLE *table= open_table(thd, tables, thd->mem_root, ¬_used, + MYSQL_LOCK_IGNORE_FLUSH); + if (!table) + goto error; + + DBUG_ASSERT(table->s->system_table); + + table->use_all_columns(); + table->reginfo.lock_type= tables->lock_type; + tables->table= table; + count++; + } + + { + TABLE **list= (TABLE**) thd->alloc(sizeof(TABLE*) * count); + TABLE **ptr= list; + for (TABLE_LIST *tables= table_list; tables; tables= tables->next_global) + *(ptr++)= tables->table; + + thd->lock= mysql_lock_tables(thd, list, count, + MYSQL_LOCK_IGNORE_FLUSH, ¬_used); + } + if (thd->lock) + DBUG_RETURN(FALSE); + +error: + close_system_tables(thd, backup); + + DBUG_RETURN(TRUE); +} + + +/* + Close system tables, opened with open_system_tables_for_read(). + + SYNOPSIS + close_system_tables() + thd Thread context + backup Pointer to Open_tables_state instance which holds + information about tables which were open before we + decided to access system tables. +*/ + +void +close_system_tables(THD *thd, Open_tables_state *backup) +{ + close_thread_tables(thd); + thd->restore_backup_open_tables_state(backup); +} + + +/* + Open and lock one system table for update. + + SYNOPSIS + open_system_table_for_update() + thd Thread context. + one_table Table to open. + + NOTES + Table opened with this call should closed using close_thread_tables(). + + RETURN + 0 Error + # Pointer to TABLE object of system table +*/ + +TABLE * +open_system_table_for_update(THD *thd, TABLE_LIST *one_table) +{ + DBUG_ENTER("open_system_table_for_update"); + + TABLE *table= open_ltable(thd, one_table, one_table->lock_type); + if (table) + { + DBUG_ASSERT(table->s->system_table); + table->use_all_columns(); + } + + DBUG_RETURN(table); +} diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 7b7f7602163..aebf0b0e0fe 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -655,8 +655,9 @@ bool mysqld_help(THD *thd, const char *mask) tables[3].lock_type= TL_READ; tables[0].db= tables[1].db= tables[2].db= tables[3].db= (char*) "mysql"; - if (open_and_lock_tables(thd, tables)) - goto error; + Open_tables_state open_tables_state_backup; + if (open_system_tables_for_read(thd, tables, &open_tables_state_backup)) + goto error2; /* Init tables and fields to be usable from items @@ -779,8 +780,13 @@ bool mysqld_help(THD *thd, const char *mask) } send_eof(thd); + close_system_tables(thd, &open_tables_state_backup); DBUG_RETURN(FALSE); + error: + close_system_tables(thd, &open_tables_state_backup); + +error2: DBUG_RETURN(TRUE); } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index fe6b5f547eb..74040811dc6 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -158,7 +158,6 @@ void lex_start(THD *thd, const uchar *buf, uint length) lex->lock_option= TL_READ; lex->found_semicolon= 0; lex->safe_to_cache_query= 1; - lex->time_zone_tables_used= 0; lex->leaf_tables_insert= 0; lex->parsing_options.reset(); lex->empty_field_list_on_rset= 0; @@ -2059,31 +2058,6 @@ void st_lex::first_lists_tables_same() } -/* - Add implicitly used time zone description tables to global table list - (if needed). - - SYNOPSYS - st_lex::add_time_zone_tables_to_query_tables() - thd - pointer to current thread context - - RETURN VALUE - TRUE - error - FALSE - success -*/ - -bool st_lex::add_time_zone_tables_to_query_tables(THD *thd_arg) -{ - /* We should not add these tables twice */ - if (!time_zone_tables_used) - { - time_zone_tables_used= my_tz_get_table_list(thd_arg, &query_tables_last); - if (time_zone_tables_used == &fake_time_zone_tables_list) - return TRUE; - } - return FALSE; -} - /* Link table back that was unlinked with unlink_first_table() @@ -2153,7 +2127,6 @@ void st_lex::cleanup_after_one_table_open() /* remove underlying units (units of VIEW) subtree */ select_lex.cut_subtree(); } - time_zone_tables_used= 0; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 68399b188a1..f797d08b034 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1086,11 +1086,6 @@ typedef struct st_lex : public Query_tables_list bool prepared_stmt_code_is_varref; /* Names of user variables holding parameters (in EXECUTE) */ List prepared_stmt_params; - /* - Points to part of global table list which contains time zone tables - implicitly used by the statement. - */ - TABLE_LIST *time_zone_tables_used; sp_head *sphead; sp_name *spname; bool sp_lex_in_use; /* Keep track on lex usage in SPs for error handling */ @@ -1177,7 +1172,6 @@ typedef struct st_lex : public Query_tables_list TABLE_LIST *unlink_first_table(bool *link_to_local); void link_first_table_back(TABLE_LIST *first, bool link_to_local); void first_lists_tables_same(); - bool add_time_zone_tables_to_query_tables(THD *thd); bool can_be_merged(); bool can_use_merged(); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index bfe71ce271c..e7a8a5aaa88 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2663,8 +2663,7 @@ mysql_execute_command(THD *thd) Don't reset warnings when executing a stored routine. */ if ((all_tables || &lex->select_lex != lex->all_selects_list || - lex->sroutines.records) && !thd->spcont || - lex->time_zone_tables_used) + lex->sroutines.records) && !thd->spcont) mysql_reset_errors(thd, 0); #ifdef HAVE_REPLICATION @@ -5687,9 +5686,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, */ tables->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL); if (tables->derived || tables->schema_table || - (tables->table && (int)tables->table->s->tmp_table) || - my_tz_check_n_skip_implicit_tables(&tables, - thd->lex->time_zone_tables_used)) + (tables->table && (int)tables->table->s->tmp_table)) continue; thd->security_ctx= sctx; if ((sctx->master_access & want_access) == @@ -7466,14 +7463,12 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables) /* Is there tables of subqueries? */ - if (&lex->select_lex != lex->all_selects_list || lex->time_zone_tables_used) + if (&lex->select_lex != lex->all_selects_list) { DBUG_PRINT("info",("Checking sub query list")); for (table= tables; table; table= table->next_global) { - if (!my_tz_check_n_skip_implicit_tables(&table, - lex->time_zone_tables_used) && - !table->table_in_first_from_clause) + if (!table->table_in_first_from_clause) { if (check_access(thd, SELECT_ACL, table->db, &table->grant.privilege, 0, 0, diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 99fb0fd4236..888d7951b87 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3514,7 +3514,7 @@ int fill_schema_proc(THD *thd, TABLE_LIST *tables, COND *cond) err: proc_table->file->ha_index_end(); - close_proc_table(thd, &open_tables_state_backup); + close_system_tables(thd, &open_tables_state_backup); DBUG_RETURN(res); } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 7675c854b81..7d534ba243f 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1302,8 +1302,6 @@ ok: (st_select_lex_node**)&old_lex->all_selects_list; ok2: - if (!old_lex->time_zone_tables_used && thd->lex->time_zone_tables_used) - old_lex->time_zone_tables_used= thd->lex->time_zone_tables_used; DBUG_ASSERT(lex == thd->lex); thd->lex= old_lex; // Needed for prepare_security result= !table->prelocking_placeholder && table->prepare_security(thd); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2b8747e6a25..26429177bd7 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -10272,14 +10272,7 @@ internal_variable_name: YYABORT; $$.var= tmp; $$.base_name= null_lex_str; - /* - If this is time_zone variable we should open time zone - describing tables - */ - if (tmp == &sys_time_zone && - lex->add_time_zone_tables_to_query_tables(YYTHD)) - YYABORT; - else if (spc && tmp == &sys_autocommit) + if (spc && tmp == &sys_autocommit) { /* We don't allow setting AUTOCOMMIT from a stored function diff --git a/sql/table.cc b/sql/table.cc index 0fe1f37e9b1..093d4b46143 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -245,6 +245,50 @@ void free_table_share(TABLE_SHARE *share) } +/** + Return TRUE if a table name matches one of the system table names. + Currently these are: + + help_category, help_keyword, help_relation, help_topic, + proc, + time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, + time_zone_transition_type + + This function trades accuracy for speed, so may return false + positives. Presumably mysql.* database is for internal purposes only + and should not contain user tables. +*/ + +inline bool is_system_table_name(const char *name, uint length) +{ + CHARSET_INFO *ci= system_charset_info; + + return ( + /* mysql.proc table */ + length == 4 && + my_tolower(ci, name[0]) == 'p' && + my_tolower(ci, name[1]) == 'r' && + my_tolower(ci, name[2]) == 'o' && + my_tolower(ci, name[3]) == 'c' || + + length > 4 && + ( + /* one of mysql.help* tables */ + my_tolower(ci, name[0]) == 'h' && + my_tolower(ci, name[1]) == 'e' && + my_tolower(ci, name[2]) == 'l' && + my_tolower(ci, name[3]) == 'p' || + + /* one of mysql.time_zone* tables */ + my_tolower(ci, name[0]) == 't' && + my_tolower(ci, name[1]) == 'i' && + my_tolower(ci, name[2]) == 'm' && + my_tolower(ci, name[3]) == 'e' + ) + ); +} + + /* Read table definition from a binary / text based .frm file @@ -365,11 +409,9 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags) allow to lock such tables for writing with any other tables (even with other system tables) and some privilege tables need this. */ - if (!(lower_case_table_names ? - my_strcasecmp(system_charset_info, share->table_name.str, "proc") : - strcmp(share->table_name.str, "proc"))) - share->system_table= 1; - else + share->system_table= is_system_table_name(share->table_name.str, + share->table_name.length); + if (!share->system_table) { share->log_table= check_if_log_table(share->db.length, share->db.str, share->table_name.length, diff --git a/sql/tztime.cc b/sql/tztime.cc index 2cdc863565a..c92d603461a 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1488,26 +1488,20 @@ extern "C" byte* my_offset_tzs_get_key(Time_zone_offset *entry, uint *length, /* - Prepare table list with time zone related tables from preallocated array - and add to global table list. + Prepare table list with time zone related tables from preallocated array. SYNOPSIS tz_init_table_list() tz_tabs - pointer to preallocated array of MY_TZ_TABLES_COUNT TABLE_LIST objects - global_next_ptr - pointer to variable which points to global_next member - of last element of global table list (or list root - then list is empty) (in/out). DESCRIPTION This function prepares list of TABLE_LIST objects which can be used - for opening of time zone tables from preallocated array. It also links - this list to the end of global table list (it will read and update - accordingly variable pointed by global_next_ptr for this). + for opening of time zone tables from preallocated array. */ static void -tz_init_table_list(TABLE_LIST *tz_tabs, TABLE_LIST ***global_next_ptr) +tz_init_table_list(TABLE_LIST *tz_tabs) { bzero(tz_tabs, sizeof(TABLE_LIST) * MY_TZ_TABLES_COUNT); @@ -1524,64 +1518,6 @@ tz_init_table_list(TABLE_LIST *tz_tabs, TABLE_LIST ***global_next_ptr) if (i != 0) tz_tabs[i].prev_global= &tz_tabs[i-1].next_global; } - - /* Link into global list */ - tz_tabs[0].prev_global= *global_next_ptr; - **global_next_ptr= tz_tabs; - /* Update last-global-pointer to point to pointer in last table */ - *global_next_ptr= &tz_tabs[MY_TZ_TABLES_COUNT-1].next_global; -} - - -/* - Fake table list object, pointer to which is returned by - my_tz_get_tables_list() as indication of error. -*/ -TABLE_LIST fake_time_zone_tables_list; - -/* - Create table list with time zone related tables and add it to the end - of global table list. - - SYNOPSIS - my_tz_get_table_list() - thd - current thread object - global_next_ptr - pointer to variable which points to global_next member - of last element of global table list (or list root - then list is empty) (in/out). - - DESCRIPTION - This function creates list of TABLE_LIST objects allocated in thd's - memroot, which can be used for opening of time zone tables. It will also - link this list to the end of global table list (it will read and update - accordingly variable pointed by global_next_ptr for this). - - NOTE - my_tz_check_n_skip_implicit_tables() function depends on fact that - elements of list created are allocated as TABLE_LIST[MY_TZ_TABLES_COUNT] - array. - - RETURN VALUES - Returns pointer to first TABLE_LIST object, (could be 0 if time zone - tables don't exist) and &fake_time_zone_tables_list in case of error. -*/ - -TABLE_LIST * -my_tz_get_table_list(THD *thd, TABLE_LIST ***global_next_ptr) -{ - TABLE_LIST *tz_tabs; - DBUG_ENTER("my_tz_get_table_list"); - - if (!time_zone_tables_exist) - DBUG_RETURN(0); - - if (!(tz_tabs= (TABLE_LIST *)thd->alloc(sizeof(TABLE_LIST) * - MY_TZ_TABLES_COUNT))) - DBUG_RETURN(&fake_time_zone_tables_list); - - tz_init_table_list(tz_tabs, global_next_ptr); - - DBUG_RETURN(tz_tabs); } @@ -1614,8 +1550,8 @@ my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) { THD *thd; - TABLE_LIST *tables= 0; - TABLE_LIST tables_buff[1+MY_TZ_TABLES_COUNT], **last_global_next_ptr; + TABLE_LIST tz_tables[1+MY_TZ_TABLES_COUNT]; + Open_tables_state open_tables_state_backup; TABLE *table; Tz_names_entry *tmp_tzname; my_bool return_val= 1; @@ -1677,19 +1613,23 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) */ thd->set_db(db, sizeof(db)-1); - bzero((char*) &tables_buff, sizeof(TABLE_LIST)); - tables_buff[0].alias= tables_buff[0].table_name= + bzero((char*) &tz_tables[0], sizeof(TABLE_LIST)); + tz_tables[0].alias= tz_tables[0].table_name= (char*)"time_zone_leap_second"; - tables_buff[0].lock_type= TL_READ; - tables_buff[0].db= db; - /* - Fill TABLE_LIST for the rest of the time zone describing tables - and link it to first one. - */ - last_global_next_ptr= &(tables_buff[0].next_global); - tz_init_table_list(tables_buff + 1, &last_global_next_ptr); + tz_tables[0].table_name_length= 21; + tz_tables[0].db= db; + tz_tables[0].db_length= sizeof(db)-1; + tz_tables[0].lock_type= TL_READ; - if (simple_open_n_lock_tables(thd, tables_buff)) + tz_init_table_list(tz_tables+1); + tz_tables[0].next_global= tz_tables[0].next_local= &tz_tables[1]; + tz_tables[1].prev_global= &tz_tables[0].next_global; + + /* + We need to open only mysql.time_zone_leap_second, but we try to + open all time zone tables to see if they exist. + */ + if (open_system_tables_for_read(thd, tz_tables, &open_tables_state_backup)) { sql_print_warning("Can't open and lock time zone table: %s " "trying to live without them", thd->net.last_error); @@ -1697,7 +1637,6 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) return_val= time_zone_tables_exist= 0; goto end_with_setting_default_tz; } - tables= tables_buff + 1; /* Now we are going to load leap seconds descriptions that are shared @@ -1713,7 +1652,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) goto end_with_close; } - table= tables_buff[0].table; + table= tz_tables[0].table; /* It is OK to ignore ha_index_init()/ha_index_end() return values since mysql.time_zone* tables are MyISAM and these operations always succeed @@ -1770,7 +1709,12 @@ end_with_setting_default_tz: if (default_tzname) { String tmp_tzname2(default_tzname, &my_charset_latin1); - if (!(global_system_variables.time_zone= my_tz_find(&tmp_tzname2, tables))) + /* + Time zone tables may be open here, and my_tz_find() may open + most of them once more, but this is OK for system tables open + for READ. + */ + if (!(global_system_variables.time_zone= my_tz_find(thd, &tmp_tzname2))) { sql_print_error("Fatal error: Illegal or unknown default time zone '%s'", default_tzname); @@ -1779,8 +1723,11 @@ end_with_setting_default_tz: } end_with_close: - thd->version--; /* Force close to free memory */ - close_thread_tables(thd); + if (time_zone_tables_exist) + { + thd->version--; /* Force close to free memory */ + close_system_tables(thd, &open_tables_state_backup); + } end_with_cleanup: @@ -1889,7 +1836,6 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) */ table= tz_tables->table; tz_tables= tz_tables->next_local; - table->use_all_columns(); table->field[0]->store(tz_name->ptr(), tz_name->length(), &my_charset_latin1); /* @@ -1922,7 +1868,6 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) using the only index in this table). */ table= tz_tables->table; - table->use_all_columns(); tz_tables= tz_tables->next_local; table->field[0]->store((longlong) tzid, TRUE); (void)table->file->ha_index_init(0, 1); @@ -1950,7 +1895,6 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) Right - using special index. */ table= tz_tables->table; - table->use_all_columns(); tz_tables= tz_tables->next_local; table->field[0]->store((longlong) tzid, TRUE); (void)table->file->ha_index_init(0, 1); @@ -2024,7 +1968,6 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) in ascending order by index scan also satisfies us. */ table= tz_tables->table; - table->use_all_columns(); table->field[0]->store((longlong) tzid, TRUE); (void)table->file->ha_index_init(0, 1); @@ -2234,8 +2177,8 @@ str_to_offset(const char *str, uint length, long *offset) SYNOPSIS my_tz_find() + thd - pointer to thread THD structure name - time zone specification - tz_tables - list of opened'n'locked time zone describing tables DESCRIPTION This function checks if name is one of time zones described in db, @@ -2257,11 +2200,10 @@ str_to_offset(const char *str, uint length, long *offset) values as parameter without additional external check and this property is used by @@time_zone variable handling code). - It will perform lookup in system tables (mysql.time_zone*) if needed - using tz_tables as list of already opened tables (for info about this - list look at tz_load_from_open_tables() description). It won't perform - such lookup if no time zone describing tables were found during server - start up. + It will perform lookup in system tables (mysql.time_zone*), + opening and locking them, and closing afterwards. It won't perform + such lookup if no time zone describing tables were found during + server start up. RETURN VALUE Pointer to corresponding Time_zone object. 0 - in case of bad time zone @@ -2269,7 +2211,7 @@ str_to_offset(const char *str, uint length, long *offset) */ Time_zone * -my_tz_find(const String * name, TABLE_LIST *tz_tables) +my_tz_find(THD *thd, const String *name) { Tz_names_entry *tmp_tzname; Time_zone *result_tz= 0; @@ -2277,8 +2219,6 @@ my_tz_find(const String * name, TABLE_LIST *tz_tables) DBUG_ENTER("my_tz_find"); DBUG_PRINT("enter", ("time zone name='%s'", name ? ((String *)name)->c_ptr_safe() : "NULL")); - DBUG_ASSERT(!time_zone_tables_exist || tz_tables || - current_thd->slave_thread); if (!name) DBUG_RETURN(0); @@ -2310,8 +2250,19 @@ my_tz_find(const String * name, TABLE_LIST *tz_tables) (const byte *)name->ptr(), name->length()))) result_tz= tmp_tzname->tz; - else if (time_zone_tables_exist && tz_tables) - result_tz= tz_load_from_open_tables(name, tz_tables); + else if (time_zone_tables_exist) + { + TABLE_LIST tz_tables[MY_TZ_TABLES_COUNT]; + Open_tables_state open_tables_state_backup; + + tz_init_table_list(tz_tables); + if (!open_system_tables_for_read(thd, tz_tables, + &open_tables_state_backup)) + { + result_tz= tz_load_from_open_tables(name, tz_tables); + close_system_tables(thd, &open_tables_state_backup); + } + } } VOID(pthread_mutex_unlock(&tz_LOCK)); @@ -2320,58 +2271,6 @@ my_tz_find(const String * name, TABLE_LIST *tz_tables) } -/* - A more standalone version of my_tz_find(): will open tz tables if needed. - This is so far only used by replication, where time zone setting does not - happen in the usual query context. - - SYNOPSIS - my_tz_find_with_opening_tz_tables() - thd - pointer to thread's THD structure - name - time zone specification - - DESCRIPTION - This function tries to find a time zone which matches the named passed in - argument. If it fails, it will open time zone tables and re-try the - search. - This function is needed for the slave SQL thread, which does not do the - addition of time zone tables which is usually done during query parsing - (as time zone setting by slave does not happen in mysql_parse() but - before). So it needs to open tz tables by itself if needed. - See notes of my_tz_find() as they also apply here. - - RETURN VALUE - Pointer to corresponding Time_zone object. 0 - in case of bad time zone - specification or other error. -*/ - -Time_zone *my_tz_find_with_opening_tz_tables(THD *thd, const String *name) -{ - Time_zone *tz; - DBUG_ENTER("my_tz_find_with_opening_tables"); - DBUG_ASSERT(thd); - DBUG_ASSERT(thd->slave_thread); // intended for use with slave thread only - - if (!(tz= my_tz_find(name, 0)) && time_zone_tables_exist) - { - /* - Probably we have not loaded this time zone yet so let us look it up in - our time zone tables. Note that if we don't have tz tables on this - slave, we don't even try. - */ - TABLE_LIST tables[MY_TZ_TABLES_COUNT]; - TABLE_LIST *dummy; - TABLE_LIST **dummyp= &dummy; - tz_init_table_list(tables, &dummyp); - if (simple_open_n_lock_tables(thd, tables)) - DBUG_RETURN(0); - tz= my_tz_find(name, tables); - /* We need to close tables _now_ to not pollute coming query */ - close_thread_tables(thd); - } - DBUG_RETURN(tz); -} - #endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */ diff --git a/sql/tztime.h b/sql/tztime.h index 248a638074b..b6af4b37468 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -59,15 +59,11 @@ public: extern Time_zone * my_tz_UTC; extern Time_zone * my_tz_SYSTEM; -extern TABLE_LIST * my_tz_get_table_list(THD *thd, TABLE_LIST ***global_next_ptr); -extern Time_zone * my_tz_find(const String *name, TABLE_LIST *tz_tables); -extern Time_zone * my_tz_find_with_opening_tz_tables(THD *thd, const String *name); +extern Time_zone * my_tz_find(THD *thd, const String *name); extern my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap); extern void my_tz_free(); extern my_time_t sec_since_epoch_TIME(TIME *t); -extern TABLE_LIST fake_time_zone_tables_list; - /* Number of elements in table list produced by my_tz_get_table_list() (this table list contains tables which are needed for dynamical loading @@ -77,34 +73,5 @@ extern TABLE_LIST fake_time_zone_tables_list; static const int MY_TZ_TABLES_COUNT= 4; -/* - Check if we have pointer to the begining of list of implicitly used time - zone tables, set SELECT_ACL for them and fast-forward to its end. - - SYNOPSIS - my_tz_check_n_skip_implicit_tables() - table - (in/out) pointer to element of table list to check - tz_tables - list of implicitly used time zone tables received - from my_tz_get_table_list() function. - - NOTE - This function relies on my_tz_get_table_list() implementation. - - RETURN VALUE - TRUE - if table points to the beggining of tz_tables list - FALSE - otherwise. -*/ -inline bool my_tz_check_n_skip_implicit_tables(TABLE_LIST **table, - TABLE_LIST *tz_tables) -{ - if (*table == tz_tables) - { - for (int i= 0; i < MY_TZ_TABLES_COUNT; i++) - (*table)[i].grant.privilege= SELECT_ACL; - (*table)+= MY_TZ_TABLES_COUNT - 1; - return TRUE; - } - return FALSE; -} #endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */ diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index afe8e5f1b27..07a4ffc65c5 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -787,7 +787,8 @@ void ha_tina::update_status() bool ha_tina::check_if_locking_is_allowed(uint sql_command, ulong type, TABLE *table, - uint count, + uint count, uint current, + uint *system_count, bool called_by_privileged_thread) { if (!called_by_privileged_thread) diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 0c667237c0f..c096f21fca2 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -128,7 +128,8 @@ public: virtual bool check_if_locking_is_allowed(uint sql_command, ulong type, TABLE *table, - uint count, + uint count, uint current, + uint *system_count, bool called_by_logger_thread); int open(const char *name, int mode, uint open_options); int close(void); diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 764c53d2f75..3c6e9f9b9a0 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -565,7 +565,8 @@ err: bool ha_myisam::check_if_locking_is_allowed(uint sql_command, ulong type, TABLE *table, - uint count, + uint count, uint current, + uint *system_count, bool called_by_privileged_thread) { /* @@ -574,11 +575,13 @@ bool ha_myisam::check_if_locking_is_allowed(uint sql_command, we have to disallow write-locking of these tables with any other tables. */ if (table->s->system_table && - table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE && - count != 1) + table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE) + (*system_count)++; + + /* 'current' is an index, that's why '<=' below. */ + if (*system_count > 0 && *system_count <= current) { - my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0), table->s->db.str, - table->s->table_name.str); + my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0)); return FALSE; } diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 882900bd35f..175a61bd97c 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -62,7 +62,8 @@ class ha_myisam: public handler virtual bool check_if_locking_is_allowed(uint sql_command, ulong type, TABLE *table, - uint count, + uint count, uint current, + uint *system_count, bool called_by_logger_thread); int open(const char *name, int mode, uint test_if_locked); int close(void); From 29b6d554028cd40459061b22d216c3b16cf6298e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 12:47:12 +0200 Subject: [PATCH 095/789] Bug #26281: Fixed boundry checks in the INSERT() function: were one off. mysql-test/r/func_str.result: Bug #26281: test case mysql-test/t/func_str.test: Bug #26281: test case sql/item_strfunc.cc: Bug #26281: fixed boundry checks --- mysql-test/r/func_str.result | 12 ++++++++++++ mysql-test/t/func_str.test | 8 ++++++++ sql/item_strfunc.cc | 10 +++++----- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d09d3aeb529..5e78e2572c1 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1946,4 +1946,16 @@ NULL SELECT UNHEX('G') IS NULL; UNHEX('G') IS NULL 1 +SELECT INSERT('abc', 3, 3, '1234'); +INSERT('abc', 3, 3, '1234') +ab1234 +SELECT INSERT('abc', 4, 3, '1234'); +INSERT('abc', 4, 3, '1234') +abc1234 +SELECT INSERT('abc', 5, 3, '1234'); +INSERT('abc', 5, 3, '1234') +abc +SELECT INSERT('abc', 6, 3, '1234'); +INSERT('abc', 6, 3, '1234') +abc End of 5.0 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 2e76dc2ca31..775e273b384 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1014,4 +1014,12 @@ select lpad('abc', cast(5 as unsigned integer), 'x'); SELECT UNHEX('G'); SELECT UNHEX('G') IS NULL; +# +# Bug #26281: INSERT() function mishandles NUL on boundary condition +# +SELECT INSERT('abc', 3, 3, '1234'); +SELECT INSERT('abc', 4, 3, '1234'); +SELECT INSERT('abc', 5, 3, '1234'); +SELECT INSERT('abc', 6, 3, '1234'); + --echo End of 5.0 tests diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 385f4ad9770..8a2574bd248 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -967,18 +967,18 @@ String *Item_func_insert::val_str(String *str) args[3]->null_value) goto null; /* purecov: inspected */ - if ((start < 0) || (start > res->length() + 1)) + if ((start < 0) || (start > res->length())) return res; // Wrong param; skip insert - if ((length < 0) || (length > res->length() + 1)) - length= res->length() + 1; + if ((length < 0) || (length > res->length())) + length= res->length(); /* start and length are now sufficiently valid to pass to charpos function */ start= res->charpos((int) start); length= res->charpos((int) length, (uint32) start); /* Re-testing with corrected params */ - if (start > res->length() + 1) - return res; // Wrong param; skip insert + if (start > res->length()) + return res; /* purecov: inspected */ // Wrong param; skip insert if (length > res->length() - start) length= res->length() - start; From f0640506d4f09260a5c6345a22d51b5294b360aa Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 18:12:46 +0700 Subject: [PATCH 096/789] manual merge --- mysql-test/r/ndb_single_user.result | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result index 711d343fffb..debb74a6a41 100644 --- a/mysql-test/r/ndb_single_user.result +++ b/mysql-test/r/ndb_single_user.result @@ -1,7 +1,7 @@ use test; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; create table t1 (a int key, b int unique, c int) engine ndb; -ERROR HY000: Can't create table './test/t1.frm' (errno: 155) +ERROR HY000: Can't create table './test/t1.frm' (errno: 299) create table t1 (a int key, b int unique, c int) engine ndb; insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); create table t2 as select * from t1; @@ -28,19 +28,19 @@ insert into t1 select * from t2; drop table t1; ERROR 42S02: Unknown table 't1' create index new_index on t1 (c); -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster select * from t1 where a = 1; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster select * from t1 where b = 4; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster update t1 set b=102 where a = 2; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster update t1 set b=103 where b = 3; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster update t1 set b=b+100; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster update t1 set b=b+100 where a > 7; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster drop table t1; From febb6b924e1f2a6d59963e7fa9ccbbcb5c6d96ad Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 15:52:50 +0300 Subject: [PATCH 097/789] Resolve one shift/reduce conflict introduced with the push of the fix for bug#16425: Events: no DEFINER clause. The problem was that there were two rules ALTER view_algorithm_opt definer ... VIEW ... ALTER definer EVENT ... so when there was 'ALTER definer' in the input it was unclear if empty view_algorithm_opt should be executed or not. We solve this by introducing three distinct rules ALTER view_algorithm definer ... VIEW ... ALTER definer ... VIEW ... ALTER definer EVENT ... that remove the ambiguity. mysql-test/r/view.result: Add result for the test of ALTER ALGORITHM= DEFINER= VIEW. mysql-test/t/view.test: Add test case for ALTER ALGORITHM= DEFINER= VIEW. --- mysql-test/r/view.result | 35 +++++++++++++++++++++++++++++++++ mysql-test/t/view.test | 27 ++++++++++++++++++++++++++ sql/sql_yacc.yy | 42 ++++++++++++++++++++-------------------- 3 files changed, 83 insertions(+), 21 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 30043e066db..05aeda80c85 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3283,3 +3283,38 @@ DROP TABLE `t-2`; DROP VIEW `v-2`; DROP DATABASE `d-1`; USE test; +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT); +CREATE VIEW v1 AS SELECT * FROM t1; +ALTER VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1; +Warnings: +Note 1449 There is no 'no_such'@'user_1' registered +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +Warnings: +Note 1449 There is no 'no_such'@'user_1' registered +ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; +Warnings: +Note 1449 There is no 'no_such'@'user_1' registered +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +Warnings: +Note 1449 There is no 'no_such'@'user_1' registered +ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; +Warnings: +Note 1449 There is no 'no_such'@'user_2' registered +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +Warnings: +Note 1449 There is no 'no_such'@'user_2' registered +DROP VIEW v1; +DROP TABLE t1; +End of 5.1 tests. diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 520babafb7e..0915fb01e6f 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3175,3 +3175,30 @@ DROP TABLE `t-2`; DROP VIEW `v-2`; DROP DATABASE `d-1`; USE test; + + +# +# Test that ALTER VIEW accepts DEFINER and ALGORITHM, see bug#16425. +# +--disable_warnings +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (i INT); +CREATE VIEW v1 AS SELECT * FROM t1; + +ALTER VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; + +DROP VIEW v1; +DROP TABLE t1; + + +--echo End of 5.1 tests. diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 5d24fb4fa65..1e666e475a0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -492,7 +492,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); Currently there is 287 shift/reduce conflict. We should not introduce new conflicts any more. */ -%expect 287 +%expect 286 /* Comments for TOKENS. @@ -1246,7 +1246,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); statement sp_suid sp_c_chistics sp_a_chistics sp_chistic sp_c_chistic xa load_data opt_field_or_var_spec fields_or_vars opt_load_data_set_spec - definer view_replace_or_algorithm view_replace view_algorithm_opt + definer view_replace_or_algorithm view_replace view_algorithm view_or_trigger_or_sp_or_event view_or_trigger_or_sp_or_event_tail view_suid view_tail view_list_opt view_list view_select @@ -5154,18 +5154,25 @@ alter: lex->sql_command= SQLCOM_ALTER_FUNCTION; lex->spname= $3; } - | ALTER view_algorithm_opt definer view_suid - VIEW_SYM table_ident - { - THD *thd= YYTHD; - LEX *lex= thd->lex; - lex->sql_command= SQLCOM_CREATE_VIEW; - lex->create_view_mode= VIEW_ALTER; - /* first table in list is target VIEW name */ - lex->select_lex.add_table_to_list(thd, $6, NULL, TL_OPTION_UPDATING); - } - view_list_opt AS view_select view_check_option - {} + | ALTER view_algorithm definer + { + Lex->create_view_mode= VIEW_ALTER; + } + view_tail + {} + | ALTER definer + /* + We have two separate rules for ALTER VIEW rather that + optional view_algorithm above, to resolve the ambiguity + with the ALTER EVENT below. + */ + { + LEX *lex= Lex; + lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; + lex->create_view_mode= VIEW_ALTER; + } + view_tail + {} | ALTER definer EVENT_SYM sp_name /* BE CAREFUL when you add a new rule to update the block where @@ -11298,13 +11305,6 @@ view_algorithm: { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; } ; -view_algorithm_opt: - /* empty */ - { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } - | view_algorithm - {} - ; - view_suid: /* empty */ { Lex->create_view_suid= VIEW_SUID_DEFAULT; } From ff79cd687090ec4afcdaaaf44c85849f057402c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 15:20:06 +0200 Subject: [PATCH 098/789] WL#3527: Extend IGNORE INDEX so places where index is ignored can be specified 5.0 part of the fix. Implements IGNORE INDEX FOR JOIN as a synonym of IGNORE INDEX for backward compatibility with the 5.1 fix. mysql-test/r/select.result: WL#3527: Extend IGNORE INDEX so places where index is ignored can be specified - test case mysql-test/t/select.test: WL#3527: Extend IGNORE INDEX so places where index is ignored can be specified - test case --- mysql-test/r/select.result | 9 +++++++++ mysql-test/t/select.test | 10 ++++++++++ sql/sql_yacc.yy | 17 +++++++++++++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 44063c1e890..6fbe0a3b9df 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3611,3 +3611,12 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range si,ai si 5 NULL 2 Using where 1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a INT, b INT, KEY (a)); +INSERT INTO t1 VALUES (1,1),(2,2); +EXPLAIN SELECT 1 FROM t1 WHERE a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where; Using index +EXPLAIN SELECT 1 FROM t1 IGNORE INDEX FOR JOIN (a) WHERE a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +DROP TABLE t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 0c82cef867f..033573304c7 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3092,3 +3092,13 @@ SELECT t3.a FROM t1,t2,t3 t3.c IN ('bb','ee'); DROP TABLE t1,t2,t3; + +# +# WL3527: Extend IGNORE INDEX so places where index is ignored can +# be specified +# +CREATE TABLE t1 (a INT, b INT, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,2); +EXPLAIN SELECT 1 FROM t1 WHERE a = 1; +EXPLAIN SELECT 1 FROM t1 IGNORE INDEX FOR JOIN (a) WHERE a = 1; +DROP TABLE t1; + diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 90dc6d54fe1..69052e5e0d6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -772,7 +772,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); key_alg opt_btree_or_rtree %type - key_usage_list using_list + key_usage_list key_usage_list_inner using_list %type key_part @@ -5553,6 +5553,10 @@ opt_outer: /* empty */ {} | OUTER {}; +opt_for_join: + /* empty */ + | FOR_SYM JOIN_SYM; + opt_key_definition: /* empty */ {} | USE_SYM key_usage_list @@ -5568,15 +5572,20 @@ opt_key_definition: sel->use_index_ptr= &sel->use_index; sel->table_join_options|= TL_OPTION_FORCE_INDEX; } - | IGNORE_SYM key_usage_list + | IGNORE_SYM key_or_index opt_for_join key_usage_list_inner { SELECT_LEX *sel= Select; - sel->ignore_index= *$2; + sel->ignore_index= *$4; sel->ignore_index_ptr= &sel->ignore_index; }; key_usage_list: - key_or_index { Select->interval_list.empty(); } + key_or_index key_usage_list_inner + { $$= $2; } + ; + +key_usage_list_inner: + { Select->interval_list.empty(); } '(' key_list_or_empty ')' { $$= &Select->interval_list; } ; From e85102684ef43868b1c648321c7a59ef2fb85dfd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 20:29:46 +0700 Subject: [PATCH 099/789] Bug #26825 MySQL Server Crashes in high load Bug #26997 mysqld segfault when in single user mode sql/ha_ndbcluster.cc: make sure error is always set even if no proper error code from ndb storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: add error code for failing send signal (typically single user mode) storage/ndb/src/ndbapi/ndberror.c: added error code for failing send signal and timeout waiting for node failure --- sql/ha_ndbcluster.cc | 7 +++++++ storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 ++ storage/ndb/src/ndbapi/ndberror.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0a7dc2ec32e..221d47a0da0 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6093,9 +6093,16 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db, { const NdbError err= dict->getNdbError(); if (err.code == 709 || err.code == 723) + { error= -1; + DBUG_PRINT("info", ("ndb_error.code: %u", ndb_error.code)); + } else + { + error= -1; ndb_error= err; + DBUG_PRINT("info", ("ndb_error.code: %u", ndb_error.code)); + } goto err; } DBUG_PRINT("info", ("Found table %s", tab->getName())); diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index ba2329888d2..c999c7ed919 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1753,6 +1753,7 @@ NdbDictInterface::dictSignal(NdbApiSignal* sig, m_transporter->sendSignal(sig, node)); if(res != 0){ DBUG_PRINT("info", ("dictSignal failed to send signal")); + m_error.code = 4007; continue; } @@ -1770,6 +1771,7 @@ NdbDictInterface::dictSignal(NdbApiSignal* sig, */ if(ret_val == -2) //WAIT_NODE_FAILURE { + m_error.code = 4013; continue; } if(m_waiter.m_state == WST_WAIT_TIMEOUT) diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c index 8ed8727dd9e..85ec0db50a5 100644 --- a/storage/ndb/src/ndbapi/ndberror.c +++ b/storage/ndb/src/ndbapi/ndberror.c @@ -149,10 +149,12 @@ ErrorBundle ErrorCodes[] = { /** * Unknown result */ + { 4007, DMEC, UR, "Send to ndbd failed" }, { 4008, DMEC, UR, "Receive from NDB failed" }, { 4009, DMEC, UR, "Cluster Failure" }, { 4012, DMEC, UR, "Request ndbd time-out, maybe due to high load or communication problems"}, + { 4013, DMEC, UR, "Request timed out in waiting for node faiulure"}, { 4024, DMEC, UR, "Time-out, most likely caused by simple read or cluster failure" }, From 7c143080586045daaa600ae6d5c2a15af0479cfc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 20:34:00 +0700 Subject: [PATCH 100/789] added error code for failing send signal and timeout waiting for node failure added error code for failing send signal and timeout waiting for node failure ndb/src/ndbapi/NdbDictionaryImpl.cpp: added error code for failing send signal and timeout waiting for node failure ndb/src/ndbapi/ndberror.c: added error code for failing send signal and timeout waiting for node failure --- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 4 ++++ ndb/src/ndbapi/ndberror.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index c622332f11f..b3258d4d143 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -880,6 +880,7 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal, r = m_transporter->sendSignal(signal, aNodeId); } if(r != 0){ + m_error.code= 4007; m_transporter->unlock_mutex(); continue; } @@ -903,7 +904,10 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal, * Handle error codes */ if(m_waiter.m_state == WAIT_NODE_FAILURE) + { + m_error.code = 4013; continue; + } if(m_waiter.m_state == WST_WAIT_TIMEOUT) { diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 15445620ce9..328b0688857 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -137,10 +137,12 @@ ErrorBundle ErrorCodes[] = { /** * Unknown result */ + { 4007, UR, "Send to ndbd node failed" }, { 4008, UR, "Receive from NDB failed" }, { 4009, UR, "Cluster Failure" }, { 4012, UR, "Request ndbd time-out, maybe due to high load or communication problems"}, + { 4013, UR, "Request timed out in waiting for node failure"}, { 4024, UR, "Time-out, most likely caused by simple read or cluster failure" }, From 0b9d0fef999e91dd96938b2bdaa0a48de3850d5f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 14:39:24 +0100 Subject: [PATCH 101/789] Fix for BUG#26971 "BUILD/check-cpu does not recognize Intel Core 2 Duo T7400". Treat such CPU as Xeon. Here's /proc/cpuinfo for T7400: model name : Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz BUILD/check-cpu: Fix for BUG#26971 "BUILD/check-cpu does not recognize Intel Core 2 Duo T7400". Treat such CPU as Xeon. --- BUILD/check-cpu | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 9edde51402f..ee897bec05d 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -64,10 +64,11 @@ check_cpu () { ;; # Intel ia32 - *X[eE][oO][nN]*) + *Intel*Core*|*X[eE][oO][nN]*) # a Xeon is just another pentium4 ... # ... unless it has the "lm" (long-mode) flag set, - # in that case it's a Xeon with EM64T support + # in that case it's a Xeon with EM64T support + # So is Intel Core. if [ -z "$cpu_flag_lm" ]; then cpu_arg="pentium4"; else From 435f37a5fb0f0a8ca6484b62168031d8ca8a66a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 21:01:19 +0700 Subject: [PATCH 102/789] corrected returned error code --- mysql-test/r/ndb_single_user.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result index 711d343fffb..771a02ecc84 100644 --- a/mysql-test/r/ndb_single_user.result +++ b/mysql-test/r/ndb_single_user.result @@ -1,7 +1,7 @@ use test; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; create table t1 (a int key, b int unique, c int) engine ndb; -ERROR HY000: Can't create table './test/t1.frm' (errno: 155) +ERROR HY000: Can't create table 'test.t1' (errno: 4007) create table t1 (a int key, b int unique, c int) engine ndb; insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); create table t2 as select * from t1; From 603a3981729f366fc0ce113ebdc2f485eff72a92 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 16:19:42 +0100 Subject: [PATCH 103/789] Bug#25673 - spatial index corruption, error 126 incorrect key file for table Fixed a compiler warning, deteced by pushbuild only. --- myisam/rt_index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/rt_index.c b/myisam/rt_index.c index fd988f320ff..238432006a4 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -978,7 +978,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) } if (res) { - int j; + ulong j; DBUG_PRINT("rtree", ("root has been split, adjust levels")); for (j= i; j < ReinsertList.n_pages; j++) { From dca006dfd2360b57340480cd19685322070327de Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 18:09:57 +0100 Subject: [PATCH 104/789] Fix for BUG#735 "Prepared Statements: there is no support for Query Cache". WL#1569 "Prepared Statements: implement support of Query Cache". Prepared SELECTs did not look up in the query cache, and their results were not stored in the query cache. This made them slower than non-prepared SELECTs in some cases. The fix is to re-use the expanded query (the prepared query where "?" placeholders are replaced by their values, at execution time) for searching/storing in the query cache. It works fine for statements prepared via mysql_stmt_prepare(), which are the most commonly used and were the scope of this bugfix and WL. It works less fine for statements prepared via the SQL command PREPARE...FROM, which are still not using the query cache if they have at least one parameter (because then the expanded query contains names of user variables, and user variables don't work with the query cache, even in non-prepared queries). Note that results from prepared SELECTs, which are in the binary protocol, and results from normal SELECTs, which are in the text protocol, ignore each other in the query cache, because a result in the binary protocol should never be served to a SELECT expecting the text protocol and vice-versa. Note, after this patch, bug 25843 starts applying to query cache ("changing default database between PREPARE and EXECUTE of statement breaks binlog"), we need to fix it. mysql-test/include/have_query_cache.inc: Now prepared statements work with the query cache, so don't disable prep stmts by default when doing a query cache test. All tests which include this file will now be really tested against prepared statements (in particular, query_cache.test). mysql-test/r/query_cache.result: result update mysql-test/t/grant_cache.test: Cannot enable this test in ps-protocol, because in normal protocol, a SELECT failing due to insufficient privileges increments Qcache_not_cached, while in ps-protocol, no. In detail: in normal protocol, the "access denied" errors on SELECT are issued at (stack trace): mysql_parse/mysql_execute_command/execute_sqlcom_select/handle_select/ mysql_select/JOIN::prepare/setup_wild/insert_fields/ check_grant_all_columns/my_error/my_message_sql, which then calls push_warning/query_cache_abort: at this moment, query_cache_store_query() has been called, so query exists in cache, so thd->net.query_cache_query!=NULL, so query_cache_abort() removes the query from cache, which causes a query_cache.refused++ (thus, a Qcache_not_cached++). While in ps-protocol, the error is issued at prepare time; for this mysql_test_select() is called, not execute_sqlcom_select() (and that also leads to JOIN::prepare/etc). Thus, as query_cache_store_query() has not been called, thd->net.query_cache_query==NULL, so query_cache_abort() does nothing: Qcache_not_cached is not incremented. As this test prints Qcache_not_cached after SELECT failures, we cannot enable this test in ps-protocol. mysql-test/t/ndb_cache_multi2.test: The principle of this test is: two mysqlds connected to one cluster, both using their query cache. Queries are cached in server1 ("select a!=3 from t1", "select * from t1"), table t1 is modified in server2, we want to see that this invalidates the query cache of server1. Invalidation with NDB works like this: when a query is found in the query cache, NDB is asked if the tables have changed. In this test, ha_ndbcluster calls NDB every millisecond to collect change information about tables. Due to this millisecond delay, there is need for a loop ("while...") in this test, which waits until a query1 ("select a!=3 from t1") is invalidated (which is equivalent to it returning up-to-date results), and then expects query2 ("select * from t1") to have been invalidated (see up-to-date results). But when enabling --ps-protocol in this test, the logic breaks, because query1 is still done via mysql_real_query() (see mysqltest.c: eval_expr() always uses mysql_real_query()). So, query1 returning up-to-date results is not a sign of it being invalidated in the cache, because it was NOT in the cache ("select a!=3 from t1" on line 39 was done with prep stmts, while `select a!=3 from t1` is not, thus the second does not see the first in the cache). Thus, we may run query2 when cache still has not been invalidated. The solution is to make the initial "select a!=3 from t1" run as a normal query, this repairs the broken logic. But note, "select * from t1" is still using prepared statements which was the goal of this test with --ps-protocol. mysql-test/t/query_cache.test: now that prepared statements work with the query cache, we check that results in binary protocol (prepared statements) and in text protocol (normal queries) don't mix in the query cache even though the text of the statement/query are identical. sql/mysql_priv.h: In class Query_cache_flags, we add a bit to say if the result is in binary or text format (because, a result in binary format should never be served to a query expecting text format, and vice- versa). A macro to emphasize that we read the size of the query cache without mutex ("maybe" word). A macro which gives a first indication of if a query is cache-able (first indication - it does not consider the query cache's state). sql/protocol.cc: indentation. sql/protocol.h: Children classes of Protocol report their type (currently, text or binary). Query cache needs to know that. sql/sql_cache.cc: When we store a result in the query cache, we need to remember if it's in binary or text format. And when we search for a result in the query cache, we need to select only those results which are in the format which the current statement expects (binary or text). sql/sql_prepare.cc: Enabling use of the query cache by prepared statements. 1) Prep stmts are of two types: a) prepared via the mysql_stmt_prepare() API call b) prepared via the SQL PREPARE...FROM statement. 2) We already, when executing a prepared statement, sometimes built an "expanded" statement. For a), "?" placeholders were replaced by their values. For b), by names of the user variables containing the values. We did that only when we needed to write the query to logs. We now use this expanded query also for storing/searching in the query cache. Assume a query "SELECT * FROM T WHERE c=?", and the parameter is 10. For a), the expanded query is "SELECT * FROM T WHERE c=10", we look for "SELECT * FROM T WHERE c=10" in the query cache, and store that query's result in the query cache. For b), the expanded query is "SELECT * FROM T WHERE c=@somevar", and user variables don't work with the query cache (even inside non- prepared queries), so we don't enable query caching for SQL PREPARE'd statements if they have at least one parameter (see "if (stmt->param_count > 0)" in the patch). 3) If query cache is enabled and this is a SELECT, we build the expanded query (as an optimisation, we don't want to build this expanded query if the query cache is disabled or this is not a SELECT). As the decision of building the expanded query or not is taken at prepare time (setup_set_params()), if query cache is disabled at prepare time, we won't build the expanded query at all next executions, thus shouldn't use this query for query cacheing. To ensure that we don't, we set safe_to_cache_query to FALSE. Note that we read the size of the query cache without mutex, which is ok: if we see it 0 but that cache has just been enlarged, no big deal, just our statement will not use the query cache; if we see it >0 but that cache has just been made destroyed, we'll build the expanded query at all executions, but query_cache_store_query() and query_cache_send_result_to_client() will read the size with a mutex and so properly decide to cache or not cache. 4) Some functions in this file were named "withlog", others "with_log", now using "with_log" for all. tests/mysql_client_test.c: Testing of how prepared statements enter and hit the query cache. test_ps_query_cache() is inspired from test_ps_conj_select(). It creates data, a prepared SELECT statement, executes it once, then a second time with the same parameter value, to see that cache is hit, then a 3rd time with another parameter value to see that cache is not hit. Then, same from another connection, expecting hits. Then, tests border cases (enables query cache at prepare and disables at execute and vice-versa). It checks all results of SELECTs, cache hits and misses. mysql-test/r/query_cache_sql_prepare.result: result of new test: we see hits when there is no parameter, no hit when there is a parameter. mysql-test/t/query_cache_sql_prepare.test: new test to see if SQL PREPARE'd statements enter/hit the query cache: - if having at least one parameter, they should not - if having zero parameters, they should. --- mysql-test/include/have_query_cache.inc | 3 - mysql-test/r/query_cache.result | 23 ++ mysql-test/r/query_cache_sql_prepare.result | 204 +++++++++++++++ mysql-test/t/grant_cache.test | 26 ++ mysql-test/t/ndb_cache_multi2.test | 31 +++ mysql-test/t/query_cache.test | 20 ++ mysql-test/t/query_cache_sql_prepare.test | 144 +++++++++++ sql/mysql_priv.h | 8 + sql/protocol.cc | 7 +- sql/protocol.h | 11 + sql/sql_cache.cc | 20 +- sql/sql_prepare.cc | 70 +++-- tests/mysql_client_test.c | 270 +++++++++++++++++++- 13 files changed, 808 insertions(+), 29 deletions(-) create mode 100644 mysql-test/r/query_cache_sql_prepare.result create mode 100644 mysql-test/t/query_cache_sql_prepare.test diff --git a/mysql-test/include/have_query_cache.inc b/mysql-test/include/have_query_cache.inc index 39549157849..e5e6052c9a7 100644 --- a/mysql-test/include/have_query_cache.inc +++ b/mysql-test/include/have_query_cache.inc @@ -1,7 +1,4 @@ -- require r/have_query_cache.require -# As PS are not cached we disable them to ensure the we get the right number -# of query cache hits --- disable_ps_protocol disable_query_log; show variables like "have_query_cache"; enable_query_log; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 54b35827cea..657f1387136 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1325,4 +1325,27 @@ start transaction; insert into t1(c1) select c1 from v1; drop table t1, t2, t3; drop view v1; +create table t1(c1 int); +insert into t1 values(1),(10),(100); +select * from t1; +c1 +1 +10 +100 +select * from t1; +c1 +1 +10 +100 +select * from t1; +c1 +1 +10 +100 +select * from t1; +c1 +1 +10 +100 +drop table t1; set global query_cache_size=0; diff --git a/mysql-test/r/query_cache_sql_prepare.result b/mysql-test/r/query_cache_sql_prepare.result new file mode 100644 index 00000000000..64af5bc4ec2 --- /dev/null +++ b/mysql-test/r/query_cache_sql_prepare.result @@ -0,0 +1,204 @@ +set global query_cache_size=100000; +flush status; +create table t1(c1 int); +insert into t1 values(1),(10),(100); +prepare stmt1 from "select * from t1 where c1=10"; +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 0 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 0 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 1 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 2 +prepare stmt2 from "select * from t1 where c1=10"; +execute stmt2; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 3 +execute stmt2; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 4 +execute stmt2; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 5 +prepare stmt3 from "select * from t1 where c1=10"; +execute stmt3; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 6 +execute stmt3; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 7 +execute stmt3; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 8 +select * from t1 where c1=10; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 9 +flush tables; +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 9 +select * from t1 where c1=10; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +prepare stmt1 from "select * from t1 where c1=?"; +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +set @a=1; +execute stmt1 using @a; +c1 +1 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +set @a=100; +execute stmt1 using @a; +c1 +100 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +set @a=10; +execute stmt1 using @a; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +prepare stmt1 from "select * from t1 where c1=10"; +set global query_cache_size=0; +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +set global query_cache_size=100000; +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 10 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 11 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +set global query_cache_size=0; +prepare stmt1 from "select * from t1 where c1=10"; +set global query_cache_size=100000; +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +execute stmt1; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +set global query_cache_size=0; +prepare stmt1 from "select * from t1 where c1=?"; +set global query_cache_size=100000; +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +set @a=1; +execute stmt1 using @a; +c1 +1 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +set @a=100; +execute stmt1 using @a; +c1 +100 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +set @a=10; +execute stmt1 using @a; +c1 +10 +show status like 'Qcache_hits'; +Variable_name Value +Qcache_hits 12 +drop table t1; +set global query_cache_size=0; +flush status; diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test index 7e17a03ec21..c28dd12cdee 100644 --- a/mysql-test/t/grant_cache.test +++ b/mysql-test/t/grant_cache.test @@ -1,6 +1,8 @@ # Grant tests not performed with embedded server -- source include/not_embedded.inc -- source include/have_query_cache.inc +# See at the end of the test why we disable the ps protocol (*) +-- disable_ps_protocol # # Test grants with query cache @@ -151,3 +153,27 @@ drop database mysqltest; set GLOBAL query_cache_size=default; # End of 4.1 tests + +# (*) Why we disable the ps protocol: because in normal protocol, +# a SELECT failing due to insufficient privileges increments +# Qcache_not_cached, while in ps-protocol, no. +# In detail: in normal protocol, +# the "access denied" errors on SELECT are issued at (stack trace): +# mysql_parse/mysql_execute_command/execute_sqlcom_select/handle_select/ +# mysql_select/JOIN::prepare/setup_wild/insert_fields/ +# check_grant_all_columns/my_error/my_message_sql, which then calls +# push_warning/query_cache_abort: at this moment, +# query_cache_store_query() has been called, so query exists in cache, +# so thd->net.query_cache_query!=NULL, so query_cache_abort() removes +# the query from cache, which causes a query_cache.refused++ (thus, +# a Qcache_not_cached++). +# While in ps-protocol, the error is issued at prepare time; +# for this mysql_test_select() is called, not execute_sqlcom_select() +# (and that also leads to JOIN::prepare/etc). Thus, as +# query_cache_store_query() has not been called, +# thd->net.query_cache_query==NULL, so query_cache_abort() does nothing: +# Qcache_not_cached is not incremented. +# As this test prints Qcache_not_cached after SELECT failures, +# we cannot enable this test in ps-protocol. + +--enable_ps_protocol diff --git a/mysql-test/t/ndb_cache_multi2.test b/mysql-test/t/ndb_cache_multi2.test index 4abb537624a..2afcf0c18f7 100644 --- a/mysql-test/t/ndb_cache_multi2.test +++ b/mysql-test/t/ndb_cache_multi2.test @@ -36,7 +36,11 @@ insert into t1 value (2); insert into t2 value (3); select * from t1; # Run the check query once to load it into qc on server1 +# See at the end of this test why we need to disable ps-protocol for +# this query (*) +--disable_ps_protocol select a != 3 from t1; +--enable_ps_protocol select * from t2; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; @@ -93,3 +97,30 @@ set GLOBAL query_cache_size=0; set GLOBAL ndb_cache_check_time=0; reset query cache; flush status; + +# (*) Why we need to execute the query in non-ps mode. +# The principle of this test is: two mysqlds connected to one cluster, +# both using their query cache. Queries are cached in server1 +# ("select a!=3 from t1", "select * from t1"), +# table t1 is modified in server2, we want to see that this invalidates +# the query cache of server1. Invalidation with NDB works like this: +# when a query is found in the query cache, NDB is asked if the tables +# have changed. In this test, ha_ndbcluster calls NDB every millisecond +# to collect change information about tables. +# Due to this millisecond delay, there is need for a loop ("while...") +# in this test, which waits until a query1 ("select a!=3 from t1") is +# invalidated (which is equivalent to it returning +# up-to-date results), and then expects query2 ("select * from t1") +# to have been invalidated (see up-to-date results). +# But when enabling --ps-protocol in this test, the logic breaks, +# because query1 is still done via mysql_real_query() (see mysqltest.c: +# eval_expr() always uses mysql_real_query()). So, query1 returning +# up-to-date results is not a sign of it being invalidated in the cache, +# because it was NOT in the cache ("select a!=3 from t1" on line 39 +# was done with prep stmts, while `select a!=3 from t1` is not, +# thus the second does not see the first in the cache). Thus, we may run +# query2 when cache still has not been invalidated. +# The solution is to make the initial "select a!=3 from t1" run +# as a normal query, this repairs the broken logic. +# But note, "select * from t1" is still using prepared statements +# which was the goal of this test with --ps-protocol. diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index ad7fd90ed63..d475fc65136 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -907,4 +907,24 @@ start transaction; insert into t1(c1) select c1 from v1; drop table t1, t2, t3; drop view v1; + + +# +# If running with --ps-protocol: +# see if a query from the text protocol is served with results cached +# from a query which used the binary (which would be wrong, results +# are in different formats); if that happens, the results will +# be incorrect and the test will fail. +# + +create table t1(c1 int); +insert into t1 values(1),(10),(100); +select * from t1; +-- disable_ps_protocol +select * from t1; +select * from t1; +-- enable_ps_protocol +select * from t1; +drop table t1; + set global query_cache_size=0; diff --git a/mysql-test/t/query_cache_sql_prepare.test b/mysql-test/t/query_cache_sql_prepare.test new file mode 100644 index 00000000000..69b504e2fd1 --- /dev/null +++ b/mysql-test/t/query_cache_sql_prepare.test @@ -0,0 +1,144 @@ +# This is to see how statements prepared via the PREPARE SQL command +# go into the query cache: if using parameters they cannot; if not +# using parameters they can. +# Query cache is abbreviated as "QC" + +-- source include/have_query_cache.inc + +connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,); +connection default; + +set global query_cache_size=100000; +flush status; +create table t1(c1 int); +insert into t1 values(1),(10),(100); + +# Prepared statements has no parameters, query caching should happen +prepare stmt1 from "select * from t1 where c1=10"; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +# Another prepared statement (same text, same connection), should hit the QC +prepare stmt2 from "select * from t1 where c1=10"; +execute stmt2; +show status like 'Qcache_hits'; +execute stmt2; +show status like 'Qcache_hits'; +execute stmt2; +show status like 'Qcache_hits'; +# Another prepared statement (same text, other connection), should hit the QC +connection con1; +prepare stmt3 from "select * from t1 where c1=10"; +execute stmt3; +show status like 'Qcache_hits'; +execute stmt3; +show status like 'Qcache_hits'; +execute stmt3; +show status like 'Qcache_hits'; +connection default; +# A non-prepared statement (same text, same connection), should hit +# the QC (as it uses the text protocol like SQL EXECUTE). +# But if it uses the binary protocol, it will not hit. So we make sure +# that it uses the text protocol: +-- disable_ps_protocol +select * from t1 where c1=10; +show status like 'Qcache_hits'; + # A non-prepared statement (same text, other connection), should hit +# the QC. To test that it hits the result of SQL EXECUTE, we need to +# empty/repopulate the QC (to remove the result from the non-prepared +# SELECT just above). +flush tables; +execute stmt1; +show status like 'Qcache_hits'; +connection con1; +select * from t1 where c1=10; +show status like 'Qcache_hits'; +-- enable_ps_protocol +connection default; + +# Prepared statement has parameters, query caching should not happen +prepare stmt1 from "select * from t1 where c1=?"; +show status like 'Qcache_hits'; +set @a=1; +execute stmt1 using @a; +show status like 'Qcache_hits'; +set @a=100; +execute stmt1 using @a; +show status like 'Qcache_hits'; +set @a=10; +execute stmt1 using @a; +show status like 'Qcache_hits'; + +# See if enabling/disabling the query cache between PREPARE and +# EXECUTE is an issue; the expected result is that the query cache +# will not be used. +# Indeed, decision to read/write the query cache is taken at PREPARE +# time, so if the query cache was disabled at PREPARE time then no +# execution of the statement will read/write the query cache. +# If the query cache was enabled at PREPARE time, but disabled at +# EXECUTE time, at EXECUTE time the query cache internal functions do +# nothing so again the query cache is not read/written. But if the +# query cache is re-enabled before another execution then that +# execution will read/write the query cache. + +# QC is enabled at PREPARE +prepare stmt1 from "select * from t1 where c1=10"; +# then QC is disabled at EXECUTE +set global query_cache_size=0; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +# then QC is re-enabled for more EXECUTE. +set global query_cache_size=100000; +# Note that this execution will not hit results from the +# beginning of the test (because QC has been emptied meanwhile by +# setting its size to 0). +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; + +# QC is disabled at PREPARE +set global query_cache_size=0; +prepare stmt1 from "select * from t1 where c1=10"; +# then QC is enabled at EXECUTE +set global query_cache_size=100000; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; +execute stmt1; +show status like 'Qcache_hits'; + +# QC is disabled at PREPARE +set global query_cache_size=0; +prepare stmt1 from "select * from t1 where c1=?"; +# then QC is enabled at EXECUTE +set global query_cache_size=100000; +show status like 'Qcache_hits'; +set @a=1; +execute stmt1 using @a; +show status like 'Qcache_hits'; +set @a=100; +execute stmt1 using @a; +show status like 'Qcache_hits'; +set @a=10; +execute stmt1 using @a; +show status like 'Qcache_hits'; + + +drop table t1; + +set global query_cache_size=0; +flush status; # reset Qcache status variables for next tests diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c812aa800c9..1bf032d1c82 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -647,6 +647,7 @@ struct Query_cache_query_flags { unsigned int client_long_flag:1; unsigned int client_protocol_41:1; + unsigned int result_in_binary_protocol:1; unsigned int more_results_exists:1; unsigned int pkt_nr; uint character_set_client_num; @@ -673,6 +674,11 @@ struct Query_cache_query_flags query_cache.send_result_to_client(A, B, C) #define query_cache_invalidate_by_MyISAM_filename_ref \ &query_cache_invalidate_by_MyISAM_filename +/* note the "maybe": it's a read without mutex */ +#define query_cache_maybe_disabled(T) \ + (T->variables.query_cache_type == 0 || query_cache.query_cache_size == 0) +#define query_cache_is_cacheable_query(L) \ + (((L)->sql_command == SQLCOM_SELECT) && (L)->safe_to_cache_query) #else #define QUERY_CACHE_FLAGS_SIZE 0 #define query_cache_store_query(A, B) @@ -689,6 +695,8 @@ struct Query_cache_query_flags #define query_cache_abort(A) #define query_cache_end_of_result(A) #define query_cache_invalidate_by_MyISAM_filename_ref NULL +#define query_cache_maybe_disabled(T) 1 +#define query_cache_is_cacheable_query(L) 0 #endif /*HAVE_QUERY_CACHE*/ /* diff --git a/sql/protocol.cc b/sql/protocol.cc index bc94eb238fd..5aa3b7b5055 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -818,7 +818,7 @@ bool Protocol_text::store(const char *from, uint length, bool Protocol_text::store(const char *from, uint length, - CHARSET_INFO *fromcs) + CHARSET_INFO *fromcs) { CHARSET_INFO *tocs= this->thd->variables.character_set_results; #ifndef DBUG_OFF @@ -1062,7 +1062,8 @@ void Protocol_binary::prepare_for_resend() } -bool Protocol_binary::store(const char *from, uint length, CHARSET_INFO *fromcs) +bool Protocol_binary::store(const char *from, uint length, + CHARSET_INFO *fromcs) { CHARSET_INFO *tocs= thd->variables.character_set_results; field_pos++; @@ -1070,7 +1071,7 @@ bool Protocol_binary::store(const char *from, uint length, CHARSET_INFO *fromcs) } bool Protocol_binary::store(const char *from,uint length, - CHARSET_INFO *fromcs, CHARSET_INFO *tocs) + CHARSET_INFO *fromcs, CHARSET_INFO *tocs) { field_pos++; return store_string_aux(from, length, fromcs, tocs); diff --git a/sql/protocol.h b/sql/protocol.h index 731caeb1a4c..da49cf769ae 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -98,6 +98,15 @@ public: #else void remove_last_row() {} #endif + enum enum_protocol_type + { + PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1 + /* + before adding here or change the values, consider that it is cast to a + bit in sql_cache.cc. + */ + }; + virtual enum enum_protocol_type type()= 0; }; @@ -127,6 +136,7 @@ public: #ifdef EMBEDDED_LIBRARY void remove_last_row(); #endif + virtual enum enum_protocol_type type() { return PROTOCOL_TEXT; }; }; @@ -158,6 +168,7 @@ public: virtual bool store(float nr, uint32 decimals, String *buffer); virtual bool store(double from, uint32 decimals, String *buffer); virtual bool store(Field *field); + virtual enum enum_protocol_type type() { return PROTOCOL_BINARY; }; }; void send_warning(THD *thd, uint sql_errno, const char *err=0); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index c06d7161ec1..89b7a25033f 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -844,6 +844,12 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags.client_long_flag= test(thd->client_capabilities & CLIENT_LONG_FLAG); flags.client_protocol_41= test(thd->client_capabilities & CLIENT_PROTOCOL_41); + /* + Protocol influences result format, so statement results in the binary + protocol (COM_EXECUTE) cannot be served to statements asking for results + in the text protocol (COM_QUERY) and vice-versa. + */ + flags.result_in_binary_protocol= (unsigned int) thd->protocol->type(); flags.more_results_exists= test(thd->server_status & SERVER_MORE_RESULTS_EXISTS); flags.pkt_nr= net->pkt_nr; @@ -861,11 +867,13 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags.max_sort_length= thd->variables.max_sort_length; flags.lc_time_names= thd->variables.lc_time_names; flags.group_concat_max_len= thd->variables.group_concat_max_len; - DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, pkt_nr: %d, \ + DBUG_PRINT("qcache", ("\ +long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \ sql mode: 0x%lx, sort len: %lu, conncat len: %lu", (int)flags.client_long_flag, (int)flags.client_protocol_41, + (int)flags.result_in_binary_protocol, (int)flags.more_results_exists, flags.pkt_nr, flags.character_set_client_num, @@ -1089,6 +1097,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) flags.client_long_flag= test(thd->client_capabilities & CLIENT_LONG_FLAG); flags.client_protocol_41= test(thd->client_capabilities & CLIENT_PROTOCOL_41); + flags.result_in_binary_protocol= (unsigned int)thd->protocol->type(); flags.more_results_exists= test(thd->server_status & SERVER_MORE_RESULTS_EXISTS); flags.pkt_nr= thd->net.pkt_nr; @@ -1104,11 +1113,13 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) flags.max_sort_length= thd->variables.max_sort_length; flags.group_concat_max_len= thd->variables.group_concat_max_len; flags.lc_time_names= thd->variables.lc_time_names; - DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, pkt_nr: %d, \ + DBUG_PRINT("qcache", ("\ +long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \ sql mode: 0x%lx, sort len: %lu, conncat len: %lu", (int)flags.client_long_flag, (int)flags.client_protocol_41, + (int)flags.result_in_binary_protocol, (int)flags.more_results_exists, flags.pkt_nr, flags.character_set_client_num, @@ -3048,11 +3059,10 @@ Query_cache::is_cacheable(THD *thd, uint32 query_len, char *query, LEX *lex, TABLE_COUNTER_TYPE table_count; DBUG_ENTER("Query_cache::is_cacheable"); - if (lex->sql_command == SQLCOM_SELECT && + if (query_cache_is_cacheable_query(lex) && (thd->variables.query_cache_type == 1 || (thd->variables.query_cache_type == 2 && (lex->select_lex.options & - OPTION_TO_QUERY_CACHE))) && - lex->safe_to_cache_query) + OPTION_TO_QUERY_CACHE)))) { DBUG_PRINT("qcache", ("options: %lx %lx type: %u", (long) OPTION_TO_QUERY_CACHE, diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index d4db2f536e5..91175eb1ca7 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -691,7 +691,7 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, and generate a valid query for logging. NOTES - This function, along with other _withlog functions is called when one of + This function, along with other _with_log functions is called when one of binary, slow or general logs is open. Logging of prepared statements in all cases is performed by means of conventional queries: if parameter data was supplied from C API, each placeholder in the query is @@ -715,9 +715,9 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, 0 if success, 1 otherwise */ -static bool insert_params_withlog(Prepared_statement *stmt, uchar *null_array, - uchar *read_pos, uchar *data_end, - String *query) +static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array, + uchar *read_pos, uchar *data_end, + String *query) { THD *thd= stmt->thd; Item_param **begin= stmt->param_array; @@ -725,7 +725,7 @@ static bool insert_params_withlog(Prepared_statement *stmt, uchar *null_array, uint32 length= 0; String str; const String *res; - DBUG_ENTER("insert_params_withlog"); + DBUG_ENTER("insert_params_with_log"); if (query->copy(stmt->query, stmt->query_length, default_charset_info)) DBUG_RETURN(1); @@ -869,7 +869,8 @@ static bool emb_insert_params(Prepared_statement *stmt, String *expanded_query) } -static bool emb_insert_params_withlog(Prepared_statement *stmt, String *query) +static bool emb_insert_params_with_log(Prepared_statement *stmt, + String *query) { THD *thd= stmt->thd; Item_param **it= stmt->param_array; @@ -880,7 +881,7 @@ static bool emb_insert_params_withlog(Prepared_statement *stmt, String *query) const String *res; uint32 length= 0; - DBUG_ENTER("emb_insert_params_withlog"); + DBUG_ENTER("emb_insert_params_with_log"); if (query->copy(stmt->query, stmt->query_length, default_charset_info)) DBUG_RETURN(1); @@ -2692,15 +2693,26 @@ Prepared_statement::Prepared_statement(THD *thd_arg, Protocol *protocol_arg) void Prepared_statement::setup_set_params() { - /* Setup binary logging */ + /* + Note: BUG#25843 applies here too (query cache lookup uses thd->db, not + db from "prepare" time). + */ + if (query_cache_maybe_disabled(thd)) // we won't expand the query + lex->safe_to_cache_query= FALSE; // so don't cache it at Execution + + /* + Decide if we have to expand the query (because we must write it to logs or + because we want to look it up in the query cache) or not. + */ if (mysql_bin_log.is_open() && is_update_query(lex->sql_command) || - opt_log || opt_slow_log) + opt_log || opt_slow_log || + query_cache_is_cacheable_query(lex)) { set_params_from_vars= insert_params_from_vars_with_log; #ifndef EMBEDDED_LIBRARY - set_params= insert_params_withlog; + set_params= insert_params_with_log; #else - set_params_data= emb_insert_params_withlog; + set_params_data= emb_insert_params_with_log; #endif } else @@ -2837,7 +2849,6 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) error= MYSQLparse((void *)thd) || thd->is_fatal_error || thd->net.report_error || init_param_array(this); - lex->safe_to_cache_query= FALSE; /* While doing context analysis of the query (in check_prepared_statement) we allocate a lot of additional memory: for open tables, JOINs, derived @@ -2880,6 +2891,18 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) thd->restore_backup_statement(this, &stmt_backup); thd->stmt_arena= old_stmt_arena; + if ((protocol->type() == Protocol::PROTOCOL_TEXT) && (param_count > 0)) + { + /* + This is a mysql_sql_stmt_prepare(); query expansion will insert user + variable references, and user variables are uncacheable, thus we have to + mark this statement as uncacheable. + This has to be done before setup_set_params(), as it may make expansion + unneeded. + */ + lex->safe_to_cache_query= FALSE; + } + if (error == 0) { setup_set_params(); @@ -2996,10 +3019,25 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) reinit_stmt_before_use(thd, lex); thd->protocol= protocol; /* activate stmt protocol */ - error= (open_cursor ? - mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR, - &result, &cursor) : - mysql_execute_command(thd)); + + if (open_cursor) + error= mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR, + &result, &cursor); + else + { + /* + Try to find it in the query cache, if not, execute it. + Note that multi-statements cannot exist here (they are not supported in + prepared statements). + */ + if (query_cache_send_result_to_client(thd, thd->query, + thd->query_length) <= 0) + { + error= mysql_execute_command(thd); + query_cache_end_of_result(thd); + } + } + thd->protocol= &thd->protocol_text; /* use normal protocol */ /* Assert that if an error, no cursor is open */ diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 841050a104e..b12d5fa1db0 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2354,6 +2354,271 @@ static void test_ps_conj_select() } +/* reads Qcache_hits from server and returns its value */ +static uint query_cache_hits(MYSQL *conn) +{ + MYSQL_RES *res; + MYSQL_ROW row; + int rc; + uint result; + + rc= mysql_query(conn, "show status like 'qcache_hits'"); + myquery(rc); + res= mysql_use_result(conn); + DIE_UNLESS(res); + + row= mysql_fetch_row(res); + DIE_UNLESS(row); + + result= atoi(row[1]); + mysql_free_result(res); + return result; +} + + +/* + utility for the next test; expects 3 rows in the result from a SELECT, + compares each row/field with an expected value. + */ +#define test_ps_query_cache_result(i1,s1,l1,i2,s2,l2,i3,s3,l3) \ + r_metadata= mysql_stmt_result_metadata(stmt); \ + DIE_UNLESS(r_metadata != NULL); \ + rc= mysql_stmt_fetch(stmt); \ + check_execute(stmt, rc); \ + if (!opt_silent) \ + fprintf(stdout, "\n row 1: %d, %s(%lu)", r_int_data, \ + r_str_data, r_str_length); \ + DIE_UNLESS((r_int_data == i1) && (r_str_length == l1) && \ + (strcmp(r_str_data, s1) == 0)); \ + rc= mysql_stmt_fetch(stmt); \ + check_execute(stmt, rc); \ + if (!opt_silent) \ + fprintf(stdout, "\n row 2: %d, %s(%lu)", r_int_data, \ + r_str_data, r_str_length); \ + DIE_UNLESS((r_int_data == i2) && (r_str_length == l2) && \ + (strcmp(r_str_data, s2) == 0)); \ + rc= mysql_stmt_fetch(stmt); \ + check_execute(stmt, rc); \ + if (!opt_silent) \ + fprintf(stdout, "\n row 3: %d, %s(%lu)", r_int_data, \ + r_str_data, r_str_length); \ + DIE_UNLESS((r_int_data == i3) && (r_str_length == l3) && \ + (strcmp(r_str_data, s3) == 0)); \ + rc= mysql_stmt_fetch(stmt); \ + DIE_UNLESS(rc == MYSQL_NO_DATA); \ + mysql_free_result(r_metadata); + + +/* + Test that prepared statements make use of the query cache just as normal + statements (BUG#735). +*/ +static void test_ps_query_cache() +{ + MYSQL *org_mysql= mysql, *lmysql; + MYSQL_STMT *stmt; + int rc; + MYSQL_BIND p_bind[2],r_bind[2]; /* p: param bind; r: result bind */ + int32 p_int_data, r_int_data; + char p_str_data[32], r_str_data[32]; + unsigned long p_str_length, r_str_length; + MYSQL_RES *r_metadata; + char query[MAX_TEST_QUERY_LENGTH]; + uint hits1, hits2; + enum enum_test_ps_query_cache + { + /* + We iterate the same prepare/executes block, but have iterations where + we vary the query cache conditions. + */ + /* the query cache is enabled for the duration of prep&execs: */ + TEST_QCACHE_ON= 0, + /* + same but using a new connection (to see if qcache serves results from + the previous connection as it should): + */ + TEST_QCACHE_ON_WITH_OTHER_CONN, + /* + First border case: disables the query cache before prepare and + re-enables it before execution (to test if we have no bug then): + */ + TEST_QCACHE_OFF_ON, + /* + Second border case: enables the query cache before prepare and + disables it before execution: + */ + TEST_QCACHE_ON_OFF + }; + enum enum_test_ps_query_cache iteration; + LINT_INIT(lmysql); + + myheader("test_ps_query_cache"); + + /* prepare the table */ + + rc= mysql_query(mysql, "drop table if exists t1"); + myquery(rc); + + rc= mysql_query(mysql, "create table t1 (id1 int(11) NOT NULL default '0', " + "value2 varchar(100), value1 varchar(100))"); + myquery(rc); + + rc= mysql_query(mysql, "insert into t1 values (1, 'hh', 'hh'), " + "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); + myquery(rc); + + for (iteration= TEST_QCACHE_ON; iteration < TEST_QCACHE_ON_OFF; iteration++) + { + + switch (iteration) + { + case TEST_QCACHE_ON: + case TEST_QCACHE_ON_OFF: + rc= mysql_query(mysql, "set global query_cache_size=1000000"); + myquery(rc); + break; + case TEST_QCACHE_OFF_ON: + rc= mysql_query(mysql, "set global query_cache_size=0"); + myquery(rc); + break; + case TEST_QCACHE_ON_WITH_OTHER_CONN: + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); + if (!(lmysql= mysql_init(NULL))) + { + myerror("mysql_init() failed"); + exit(1); + } + if (!(mysql_real_connect(lmysql, opt_host, opt_user, + opt_password, current_db, opt_port, + opt_unix_socket, 0))) + { + myerror("connection failed"); + mysql_close(lmysql); + exit(1); + } + if (!opt_silent) + fprintf(stdout, " OK"); + mysql= lmysql; + } + + strmov(query, "select id1, value1 from t1 where id1= ? or " + "CONVERT(value1 USING utf8)= ?"); + stmt= mysql_simple_prepare(mysql, query); + check_stmt(stmt); + + verify_param_count(stmt, 2); + + switch(iteration) + { + case TEST_QCACHE_OFF_ON: + rc= mysql_query(mysql, "set global query_cache_size=1000000"); + myquery(rc); + break; + case TEST_QCACHE_ON_OFF: + rc= mysql_query(mysql, "set global query_cache_size=0"); + myquery(rc); + default: + break; + } + + bzero((char*) p_bind, sizeof(p_bind)); + p_bind[0].buffer_type= MYSQL_TYPE_LONG; + p_bind[0].buffer= (void *)&p_int_data; + p_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; + p_bind[1].buffer= (void *)p_str_data; + p_bind[1].buffer_length= array_elements(p_str_data); + p_bind[1].length= &p_str_length; + + rc= mysql_stmt_bind_param(stmt, p_bind); + check_execute(stmt, rc); + + p_int_data= 1; + strmov(p_str_data, "hh"); + p_str_length= strlen(p_str_data); + + bzero((char*) r_bind, sizeof(r_bind)); + r_bind[0].buffer_type= MYSQL_TYPE_LONG; + r_bind[0].buffer= (void *)&r_int_data; + r_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; + r_bind[1].buffer= (void *)r_str_data; + r_bind[1].buffer_length= array_elements(r_str_data); + r_bind[1].length= &r_str_length; + + rc= mysql_stmt_bind_result(stmt, r_bind); + check_execute(stmt, rc); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + test_ps_query_cache_result(1, "hh", 2, 2, "hh", 2, 1, "ii", 2); + + /* now retry with the same parameter values and see qcache hits */ + hits1= query_cache_hits(mysql); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + test_ps_query_cache_result(1, "hh", 2, 2, "hh", 2, 1, "ii", 2); + hits2= query_cache_hits(mysql); + switch(iteration) + { + case TEST_QCACHE_ON_WITH_OTHER_CONN: + case TEST_QCACHE_ON: /* should have hit */ + DIE_UNLESS(hits2-hits1 == 1); + break; + case TEST_QCACHE_OFF_ON: + case TEST_QCACHE_ON_OFF: /* should not have hit */ + DIE_UNLESS(hits2-hits1 == 0); + } + + /* now modify parameter values and see qcache hits */ + strmov(p_str_data, "ii"); + p_str_length= strlen(p_str_data); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + test_ps_query_cache_result(1, "hh", 2, 1, "ii", 2, 2, "ii", 2); + hits1= query_cache_hits(mysql); + + switch(iteration) + { + case TEST_QCACHE_ON: + case TEST_QCACHE_OFF_ON: + case TEST_QCACHE_ON_OFF: /* should not have hit */ + DIE_UNLESS(hits2-hits1 == 0); + break; + case TEST_QCACHE_ON_WITH_OTHER_CONN: /* should have hit */ + DIE_UNLESS(hits1-hits2 == 1); + } + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + test_ps_query_cache_result(1, "hh", 2, 1, "ii", 2, 2, "ii", 2); + hits2= query_cache_hits(mysql); + + mysql_stmt_close(stmt); + + switch(iteration) + { + case TEST_QCACHE_ON: /* should have hit */ + DIE_UNLESS(hits2-hits1 == 1); + break; + case TEST_QCACHE_OFF_ON: + case TEST_QCACHE_ON_OFF: /* should not have hit */ + DIE_UNLESS(hits2-hits1 == 0); + break; + case TEST_QCACHE_ON_WITH_OTHER_CONN: + mysql_close(lmysql); + mysql= org_mysql; + } + + } /* for(iteration=...) */ + + rc= mysql_query(mysql, "set global query_cache_size=0"); + myquery(rc); + +} + + /* Test BUG#1115 (incorrect string parameter value allocation) */ static void test_bug1115() @@ -4722,7 +4987,7 @@ static void test_stmt_close() close statements by hand once mysql_close() had been called. Now mysql_close() doesn't free any statements, so this test doesn't serve its original designation any more. - Here we free stmt2 and stmt3 by hande to avoid memory leaks. + Here we free stmt2 and stmt3 by hand to avoid memory leaks. */ mysql_stmt_close(stmt2); mysql_stmt_close(stmt3); @@ -16067,8 +16332,9 @@ static struct my_tests_st my_tests[]= { { "test_bug15518", test_bug15518 }, { "test_bug23383", test_bug23383 }, { "test_bug21635", test_bug21635 }, - { "test_status", test_status}, + { "test_status", test_status }, { "test_bug24179", test_bug24179 }, + { "test_ps_query_cache", test_ps_query_cache }, { 0, 0 } }; From bcba75df423314a49da7436281eba1403e020897 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 12:18:28 -0500 Subject: [PATCH 105/789] Bug #25543 Replication of wrong values if using rand() in stored procedure When rand() is called multiple times inside a stored procedure, the server does not binlog the correct random seed values. This patch corrects the problem by resetting rand_used= 0 in THD::cleanup_after_query() allowing the system to save the random seeds if needed for each command in a stored procedure body. However, rand_used is not reset if executing in a stored function or trigger because these operations are binlogged by call and thus only the calling statement need detect the call to rand() made by its substatements. These substatements must not set rand_used to 0 because it would remove the detection of rand() by the calling statement. mysql-test/r/rpl_misc_functions.result: Bug #25543 Replication of wrong values if using rand() in stored procedure The result file was modified to include the correct processing of the new additions to the test. The results from execution are written to files on both the master and the slave. The files are compared to ensure the values from rand() generated on the master are correctly generated on the slave. mysql-test/t/rpl_misc_functions.test: Bug #25543 Replication of wrong values if using rand() in stored procedure The test was modified to include a test of a stored procedure that calls the rand() function multiple times. The results from execution are written to files on both the master and the slave. The files are compared to ensure the values from rand() generated on the master are correctly generated on the slave. sql/sql_class.cc: Bug #25543 Replication of wrong values if using rand() in stored procedure The code was modified to reset rand_used so that detection of calls to rand() will save random seeds if needed by the slave. --- mysql-test/r/rpl_misc_functions.result | 27 +++++++++- mysql-test/t/rpl_misc_functions.test | 68 +++++++++++++++++++++++++- sql/sql_class.cc | 12 +++++ 3 files changed, 103 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/rpl_misc_functions.result b/mysql-test/r/rpl_misc_functions.result index c11663b8ac8..526414cec9c 100644 --- a/mysql-test/r/rpl_misc_functions.result +++ b/mysql-test/r/rpl_misc_functions.result @@ -18,6 +18,29 @@ create table t2 like t1; load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2; select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); id i r1 r2 p id i r1 r2 p -stop slave; -drop table t1; drop table t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (col_a double default NULL); +CREATE PROCEDURE test_replication_sp1() +BEGIN +INSERT INTO t1 VALUES (rand()), (rand()); +INSERT INTO t1 VALUES (rand()); +END| +CREATE PROCEDURE test_replication_sp2() +BEGIN +CALL test_replication_sp1(); +CALL test_replication_sp1(); +END| +CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC +BEGIN +RETURN (rand() + rand()); +END| +CALL test_replication_sp1(); +CALL test_replication_sp2(); +INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 VALUES (test_replication_sf()); +DROP PROCEDURE IF EXISTS test_replication_sp1; +DROP PROCEDURE IF EXISTS test_replication_sp2; +DROP FUNCTION IF EXISTS test_replication_sf; +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test index 6e0bda90503..43ce3afc8ad 100644 --- a/mysql-test/t/rpl_misc_functions.test +++ b/mysql-test/t/rpl_misc_functions.test @@ -28,10 +28,74 @@ create table t2 like t1; eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2; # compare them with the replica; the SELECT below should return no row select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); -stop slave; -drop table t1; connection master; drop table t1; # End of 4.1 tests + +# +# BUG#25543 test calling rand() multiple times on the master in +# a stored procedure. +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (col_a double default NULL); + +DELIMITER |; + +# Use a SP that calls rand() multiple times +CREATE PROCEDURE test_replication_sp1() +BEGIN + INSERT INTO t1 VALUES (rand()), (rand()); + INSERT INTO t1 VALUES (rand()); +END| + +# Use a SP that calls another SP to call rand() multiple times +CREATE PROCEDURE test_replication_sp2() +BEGIN + CALL test_replication_sp1(); + CALL test_replication_sp1(); +END| + +# Use a SF that calls rand() multiple times +CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC +BEGIN + RETURN (rand() + rand()); +END| + +DELIMITER ;| + +# Exercise the functions and procedures then compare the results on +# the master to those on the slave. +CALL test_replication_sp1(); +CALL test_replication_sp2(); +INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 VALUES (test_replication_sf()); + +# Record the results of the query on the master +--exec $MYSQL --port=$MASTER_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql + +--sync_slave_with_master + +# Record the results of the query on the slave +--exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql + +# Compare the results from the master to the slave. +--exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql + +# Cleanup +--disable_warnings +DROP PROCEDURE IF EXISTS test_replication_sp1; +DROP PROCEDURE IF EXISTS test_replication_sp2; +DROP FUNCTION IF EXISTS test_replication_sf; +DROP TABLE IF EXISTS t1; +--enable_warnings + +# If all is good, when can cleanup our dump files. +--system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql +--system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 3c91e3e8fb7..adb7323c463 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -575,6 +575,18 @@ void THD::cleanup_after_query() clear_next_insert_id= 0; next_insert_id= 0; } + /* + Reset rand_used so that detection of calls to rand() will save random + seeds if needed by the slave. + + Do not reset rand_used if inside a stored function or trigger because + only the call to these operations is logged. Thus only the calling + statement needs to detect rand() calls made by its substatements. These + substatements must not set rand_used to 0 because it would remove the + detection of rand() by the calling statement. + */ + if (!in_sub_stmt) + rand_used= 0; /* Free Items that were created during this execution */ free_items(); /* Reset where. */ From 944030aef7828911a38ed69d89709f778ca64d46 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Mar 2007 00:29:02 +0300 Subject: [PATCH 106/789] Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Additional fix for bug#22331. Now Item_field prints its value in the case of the const field. mysql-test/r/varbinary.result: Corrected test case after fix for bug#22331. mysql-test/r/union.result: Corrected test case after fix for bug#22331. mysql-test/r/subselect.result: Corrected test case after fix for bug#22331. mysql-test/r/func_test.result: Corrected test case after fix for bug#22331. mysql-test/r/having.result: Corrected test case after fix for bug#22331. mysql-test/r/func_regexp.result: Corrected test case after fix for bug#22331. mysql-test/r/func_str.result: Corrected test case after fix for bug#22331. mysql-test/r/func_default.result: Corrected test case after fix for bug#22331. mysql-test/r/explain.result: Corrected test case after fix for bug#22331. sql/sql_union.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Cleanup of the SELECT_LEX::order_list list. sql/item.h: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Added the print() member function to the Item_field class. sql/item.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Added the print() member function to the Item_field class. --- mysql-test/r/explain.result | 6 +++--- mysql-test/r/func_default.result | 2 +- mysql-test/r/func_regexp.result | 2 +- mysql-test/r/func_str.result | 6 +++--- mysql-test/r/func_test.result | 2 +- mysql-test/r/having.result | 2 +- mysql-test/r/subselect.result | 22 +++++++++++----------- mysql-test/r/union.result | 2 +- mysql-test/r/varbinary.result | 2 +- sql/item.cc | 21 +++++++++++++++++++-- sql/item.h | 1 + sql/sql_union.cc | 6 ++++++ 12 files changed, 49 insertions(+), 25 deletions(-) diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index e0afaaef201..24ff44945bf 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -64,7 +64,7 @@ explain extended select * from v1 where f2=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 1 +Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1 explain extended select * from t1 where 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE @@ -74,7 +74,7 @@ explain extended select * from t1 where 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` where 1 +Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1 explain extended select * from t1 having 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING @@ -84,6 +84,6 @@ explain extended select * from t1 having 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` having 1 +Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1 drop view v1; drop table t1; diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result index 5742ddd102b..84ead3b73c7 100644 --- a/mysql-test/r/func_default.result +++ b/mysql-test/r/func_default.result @@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select default(`test`.`t1`.`str`) AS `default(str)`,default(`test`.`t1`.`strnull`) AS `default(strnull)`,default(`test`.`t1`.`intg`) AS `default(intg)`,default(`test`.`t1`.`rel`) AS `default(rel)` from `test`.`t1` +Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from `test`.`t1` select * from t1 where str <> default(str); str strnull intg rel 0 0 diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result index 787463c6aa3..584c8a9b820 100644 --- a/mysql-test/r/func_regexp.result +++ b/mysql-test/r/func_regexp.result @@ -40,7 +40,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select `test`.`t1`.`xxx` AS `xxx` from `test`.`t1` where (`test`.`t1`.`xxx` regexp _latin1'is a test of some long text to') +Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from `test`.`t1` where ('this is a test of some long text to see what happens' regexp _latin1'is a test of some long text to') select * from t1 where xxx regexp('is a test of some long text to '); xxx this is a test of some long text to see what happens diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d09d3aeb529..02f883d8b43 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1089,12 +1089,12 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select encode(`test`.`t1`.`f1`,'zxcv') AS `enc` from `test`.`t1` +Note 1003 select encode('','zxcv') AS `enc` from `test`.`t1` explain extended select decode(f1,'zxcv') as 'enc' from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select decode(`test`.`t1`.`f1`,'zxcv') AS `enc` from `test`.`t1` +Note 1003 select decode('','zxcv') AS `enc` from `test`.`t1` drop table t1; End of 4.1 tests create table t1 (d decimal default null); @@ -1158,7 +1158,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 12 const 1 Using index 1 SIMPLE t1 ref code code 13 const 3 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`code` AS `code`,`test`.`t2`.`id` AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5)) +Note 1003 select `test`.`t1`.`code` AS `code`,'a12' AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5)) DROP TABLE t1,t2; select locate('he','hello',-2); locate('he','hello',-2) diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index c3fbdb3b3bf..65293398155 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -87,7 +87,7 @@ explain extended select - a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select -(`test`.`t1`.`a`) AS `- a` from `test`.`t1` +Note 1003 select -('1') AS `- a` from `test`.`t1` drop table t1; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; 5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 68b13b5fc0a..9b131109809 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select count(`test`.`t1`.`a`) AS `b` from `test`.`t1` where 0 having (`b` >= 0) +Note 1003 select count('0') AS `b` from `test`.`t1` where 0 having (`b` >= 0) drop table t1; CREATE TABLE t1 ( raw_id int(10) NOT NULL default '0', diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 373d49c29d2..79d29a90b2b 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -50,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select `b`.`a` AS `a`) = 1) +Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select '1' AS `a`) = 1) SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -204,7 +204,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DERIVED t2 ALL NULL NULL NULL NULL 2 Using where 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where; Using filesort Warnings: -Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt` +Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt` select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a 2 @@ -315,7 +315,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select (select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 select (select '2' AS `a` from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -368,7 +368,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 3 SUBQUERY t8 const PRIMARY PRIMARY 37 1 Using index Warnings: -Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` AS `email` from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +Note 1003 select 'joce' AS `pseudo`,(select 'test' AS `email` from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR 21000: Operand should contain 1 column(s) @@ -547,7 +547,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = _latin1'1')) +Note 1003 select '3' AS `numreponse` from `test`.`t1` where (('1' = _latin1'1')) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -1430,7 +1430,7 @@ explain extended (select * from t1); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 (select `test`.`t1`.`s1` AS `s1` from `test`.`t1`) +Note 1003 (select 'tttt' AS `s1` from `test`.`t1`) (select * from t1); s1 tttt @@ -1497,7 +1497,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` < (select max(`test`.`t2`.`b`) from `test`.`t2`))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` < (select max('0') from `test`.`t2`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); @@ -1505,7 +1505,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` >= (select min(`test`.`t2`.`b`) from `test`.`t2`))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` >= (select min('0') from `test`.`t2`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 @@ -1516,7 +1516,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` < (select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` < (select '0' AS `b` from `test`.`t2` group by 1))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); @@ -1524,7 +1524,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` >= (select `test`.`t2`.`b` AS `b` from `test`.`t2` group by 1))) +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a` >= (select '0' AS `b` from `test`.`t2` group by 1))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); @@ -1618,7 +1618,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 UNION t1 system NULL NULL NULL NULL 1 NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1` from `test`.`t1` where 1 +Note 1003 select 'e' AS `s1` from `test`.`t1` where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index dc174e35c8f..602fc08e9fd 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -480,7 +480,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 UNION t2 const PRIMARY PRIMARY 4 const 1 NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` = 1)) union (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` = 1)) +Note 1003 (select '1' AS `a`,'1' AS `b` from `test`.`t1` where ('1' = 1)) union (select '1' AS `a`,'10' AS `b` from `test`.`t2` where ('1' = 1)) (select * from t1 where a=5) union (select * from t2 where a=1); a b 1 10 diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index 2b8a9c625a5..a41885a257d 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -15,7 +15,7 @@ explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const UNIQ UNIQ 8 const 1 Warnings: -Note 1003 select `test`.`t1`.`ID` AS `ID`,`test`.`t1`.`UNIQ` AS `UNIQ` from `test`.`t1` where 1 +Note 1003 select '00000001' AS `ID`,'004084688022709641610' AS `UNIQ` from `test`.`t1` where 1 drop table t1; select x'hello'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1 diff --git a/sql/item.cc b/sql/item.cc index c5d8a62761c..d7faa5f598e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1758,9 +1758,10 @@ void Item_ident::print(String *str) } } - if (!table_name || !field_name) + if (!table_name || !field_name || !field_name[0]) { - const char *nm= field_name ? field_name : name ? name : "tmp_field"; + const char *nm= (field_name && field_name[0]) ? + field_name : name ? name : "tmp_field"; append_identifier(thd, str, nm, (uint) strlen(nm)); return; } @@ -4900,6 +4901,22 @@ Item *Item_field::update_value_transformer(byte *select_arg) } +void Item_field::print(String *str) +{ + if (field && field->table->const_table) + { + char buff[MAX_FIELD_WIDTH]; + String tmp(buff,sizeof(buff),str->charset()); + field->val_str(&tmp); + str->append('\''); + str->append(tmp); + str->append('\''); + return; + } + Item_ident::print(str); +} + + Item_ref::Item_ref(Name_resolution_context *context_arg, Item **item, const char *table_name_arg, const char *field_name_arg, diff --git a/sql/item.h b/sql/item.h index 2a121523423..fb1a87d54fa 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1303,6 +1303,7 @@ public: Item *safe_charset_converter(CHARSET_INFO *tocs); int fix_outer_field(THD *thd, Field **field, Item **reference); virtual Item *update_value_transformer(byte *select_arg); + void print(String *str); friend class Item_default_value; friend class Item_insert_value; friend class st_select_lex_unit; diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 16df0059217..1ec724a6338 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -621,6 +621,12 @@ bool st_select_lex_unit::cleanup() join->tables= 0; } error|= fake_select_lex->cleanup(); + if (fake_select_lex->order_list.elements) + { + ORDER *ord; + for (ord= (ORDER*)fake_select_lex->order_list.first; ord; ord= ord->next) + (*ord->item)->cleanup(); + } } DBUG_RETURN(error); From f5c27523fcbb572c7a4936a2ab58c247e03f2ea4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2007 23:37:33 +0100 Subject: [PATCH 107/789] BUG#27018: Partial blob write inside blob clobbers data after the write. When doing partial blob update with NdbBlob::writeData(), zero-padding after the write was wrongly done, causing part of the old blob value to be overwritten with zeros (or spaces for text field). Fixed by only padding when needed (when writing at end of the blob). ndb/src/ndbapi/NdbBlob.cpp: Do not pad rest of blob part after the write, unless it is a write at the end of the blob. ndb/test/ndbapi/testBlobs.cpp: Add test case. --- ndb/src/ndbapi/NdbBlob.cpp | 4 ++- ndb/test/ndbapi/testBlobs.cpp | 54 ++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 00b7441a37c..f0e6bf2e720 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -800,7 +800,9 @@ NdbBlob::writeDataPrivate(const char* buf, Uint32 bytes) DBUG_RETURN(-1); Uint32 n = thePartSize - off; if (n > len) { - memset(thePartBuf.data + off + len, theFillChar, n - len); + /* If we are adding data at the end, fill rest of part. */ + if (pos + len >= theLength) + memset(thePartBuf.data + off + len, theFillChar, n - len); n = len; } memcpy(thePartBuf.data + off, buf, n); diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index 81072f6a12a..bc703d64f21 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -138,6 +138,7 @@ printusage() << " 2 readData / writeData" << endl << "bug tests (no blob test)" << endl << " -bug 4088 ndb api hang with mixed ops on index table" << endl + << " -bug 27018 middle partial part write clobbers rest of part" << endl << " -bug nnnn delete + write gives 626" << endl << " -bug nnnn acc crash on delete and long key" << endl ; @@ -1806,6 +1807,56 @@ bugtest_4088() return 0; } +static int +bugtest_27018() +{ + DBG("bug test 27018 - middle partial part write clobbers rest of part"); + + // insert rows + calcTups(false); + CHK(insertPk(false) == 0); + // new trans + for (unsigned k= 0; k < g_opt.m_rows; k++) + { + Tup& tup= g_tups[k]; + + CHK((g_con= g_ndb->startTransaction()) != 0); + CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->updateTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opr) == 0); + CHK(g_con->execute(NoCommit) == 0); + + /* Update one byte in random position. */ + Uint32 offset= urandom(tup.m_blob1.m_len); + tup.m_blob1.m_buf[0]= 0xff ^ tup.m_blob1.m_val[offset]; + CHK(g_bh1->setPos(offset) == 0); + CHK(g_bh1->writeData(&(tup.m_blob1.m_buf[0]), 1) == 0); + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + + CHK((g_con= g_ndb->startTransaction()) != 0); + CHK((g_opr= g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opr) == 0); + + CHK(g_bh1->getValue(tup.m_blob1.m_buf, tup.m_blob1.m_len) == 0); + CHK(g_con->execute(Commit) == 0); + Uint64 len= ~0; + CHK(g_bh1->getLength(len) == 0 && len == tup.m_blob1.m_len); + tup.m_blob1.m_buf[offset]^= 0xff; + CHK(memcmp(tup.m_blob1.m_buf, tup.m_blob1.m_val, tup.m_blob1.m_len) == 0); + g_ndb->closeTransaction(g_con); + } + + return 0; +} + static int bugtest_2222() { @@ -1822,7 +1873,8 @@ static struct { int m_bug; int (*m_test)(); } g_bugtest[] = { - { 4088, bugtest_4088 } + { 4088, bugtest_4088 }, + { 27018, bugtest_27018 } }; NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) From ff94fdda377450810326c8f5a4384415805ed168 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Mar 2007 11:46:20 +0700 Subject: [PATCH 108/789] disabling _new_ unstable test case --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index df56165950f..2116e9f51e0 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -12,3 +12,4 @@ ndb_load : Bug#17233 user_limits : Bug#23921 random failure of user_limits.test +ndb_single_user : Bug#27021 Error codes in mysqld in single user mode varies From 4d6ad7ac60a0b4b0c5f38f7d415430553f74279b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Mar 2007 02:47:47 -0800 Subject: [PATCH 109/789] Fixed bug #26830: a crash for the query with a subselect containing ROLLUP. Crash happened because the function get_best_group_min_max detected joins with ROLLUP incorrectly. mysql-test/r/olap.result: Added a test case for bug #26830. mysql-test/t/olap.test: Added a test case for bug #26830. --- mysql-test/r/olap.result | 9 +++++++++ mysql-test/t/olap.test | 15 +++++++++++++++ sql/opt_range.cc | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index a392de613f8..91cd15295c3 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -645,3 +645,12 @@ a LENGTH(a) COUNT(*) NULL NULL 2 DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 (a int, KEY (a)); +INSERT INTO t1 VALUES (3), (1), (4), (1), (3), (1), (1); +SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t; +a SUM(a) +1 4 +3 6 +4 4 +NULL 14 +DROP TABLE t1; diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 4e5e7b72fc8..e6cbfe3166c 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -327,3 +327,18 @@ SELECT * FROM v1; DROP VIEW v1; DROP TABLE t1; + +# +# Bug #26830: derived table with ROLLUP +# + +CREATE TABLE t1 (a int, KEY (a)); +INSERT INTO t1 VALUES (3), (1), (4), (1), (3), (1), (1); + +SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t; + +DROP TABLE t1; + + + + diff --git a/sql/opt_range.cc b/sql/opt_range.cc index dfb3af87c29..0e284850cbe 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7504,7 +7504,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) if ((join->tables != 1) || /* The query must reference one table. */ ((!join->group_list) && /* Neither GROUP BY nor a DISTINCT query. */ (!join->select_distinct)) || - (thd->lex->select_lex.olap == ROLLUP_TYPE)) /* Check (B3) for ROLLUP */ + (join->select_lex->olap == ROLLUP_TYPE)) /* Check (B3) for ROLLUP */ DBUG_RETURN(NULL); if (table->s->keys == 0) /* There are no indexes to use. */ DBUG_RETURN(NULL); From 67733ea5f813fc7a38303b3b99f370c656cf5227 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Mar 2007 17:44:25 +0400 Subject: [PATCH 110/789] bug #26833 (Compile error with embedded lib) org_tables declaration was mistakenly #ifdef-ed with the EMBEDDED_LIBRARY instead of ACCESS_CHECKS sql/sql_parse.cc: default condition fixed --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b503e147624..d22b511c630 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5402,7 +5402,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, { uint found=0; ulong found_access=0; -#ifndef EMBEDDED_LIBRARY +#ifndef NO_EMBEDDED_ACCESS_CHECKS TABLE_LIST *org_tables= tables; #endif TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table(); From 816ea8a379f38d4b38e46d61d23577733a222850 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Mar 2007 19:55:34 +0300 Subject: [PATCH 111/789] Bug#15757: Wrong SUBSTRING() result when a tmp table was employed. When the SUBSTRING() function was used over a LONGTEXT field the max_length of the SUBSTRING() result was wrongly calculated and set to 0. As the max_length parameter is used while tmp field creation it limits the length of the result field and leads to printing an empty string instead of the correct result. Now the Item_func_substr::fix_length_and_dec() function correctly calculates the max_length parameter. mysql-test/t/func_str.test: Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed. mysql-test/r/func_str.result: Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed. sql/item_strfunc.cc: Bug#15757: Wrong SUBSTRING() result when a tmp table was employed. Now the Item_func_substr::fix_length_and_dec() function correctly calculates the max_length parameter. --- mysql-test/r/func_str.result | 11 +++++++++++ mysql-test/t/func_str.test | 11 +++++++++++ sql/item_strfunc.cc | 7 +++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d09d3aeb529..1ecdea851ce 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1946,4 +1946,15 @@ NULL SELECT UNHEX('G') IS NULL; UNHEX('G') IS NULL 1 +create table t1(f1 longtext); +insert into t1 values ("123"),("456"); +select substring(f1,1,1) from t1 group by 1; +substring(f1,1,1) +1 +4 +create table t2(f1 varchar(3)); +insert into t1 values ("123"),("456"); +select substring(f1,4,1), substring(f1,-4,1) from t2; +substring(f1,4,1) substring(f1,-4,1) +drop table t1,t2; End of 5.0 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 2e76dc2ca31..4b44669cb91 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1014,4 +1014,15 @@ select lpad('abc', cast(5 as unsigned integer), 'x'); SELECT UNHEX('G'); SELECT UNHEX('G') IS NULL; +# +# Bug#15757: Wrong SUBSTRING() result when a tmp table was employed. +# +create table t1(f1 longtext); +insert into t1 values ("123"),("456"); +select substring(f1,1,1) from t1 group by 1; +create table t2(f1 varchar(3)); +insert into t1 values ("123"),("456"); +select substring(f1,4,1), substring(f1,-4,1) from t2; +drop table t1,t2; + --echo End of 5.0 tests diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 385f4ad9770..1d1f433789b 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1184,11 +1184,10 @@ void Item_func_substr::fix_length_and_dec() if (args[1]->const_item()) { int32 start= (int32) args[1]->val_int(); - start= (int32)((start < 0) ? max_length + start : start - 1); - if (start < 0 || start >= (int32) max_length) - max_length=0; /* purecov: inspected */ + if (start < 0) + max_length= ((uint)(-start) > max_length) ? 0 : (uint)(-start); else - max_length-= (uint) start; + max_length-= min((uint)(start - 1), max_length); } if (arg_count == 3 && args[2]->const_item()) { From 32a19db3804789a76c1981ec111af58908f1f1ec Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 11 Mar 2007 01:17:41 +0400 Subject: [PATCH 112/789] Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables" We have to ignore 'data directory' and 'index directory' parameters if NO_DIR_IN_CREATE set. mysql-test/r/partition.result: result fixed mysql-test/t/partition.test: testcase sql/partition_info.cc: clear data_field_name and index_field_name if NO_DIR_IN_CREATE set --- mysql-test/r/partition.result | 13 +++++++++++++ mysql-test/t/partition.test | 17 +++++++++++++++++ sql/partition_info.cc | 2 ++ 3 files changed, 32 insertions(+) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index f7eda649dd2..35b760cfc9d 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1219,4 +1219,17 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified' id 22589 drop table t1, t2; +set @org_mode=@@sql_mode; +set @@sql_mode='NO_DIR_IN_CREATE'; +select @@sql_mode; +@@sql_mode +NO_DIR_IN_CREATE +create table t1 (i int ) +partition by range (i) +( +partition p01 values less than (1000) +data directory='/not/existing' + index directory='/not/existing' +); +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 7d7ef95626a..814d96d087d 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1463,4 +1463,21 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified' drop table t1, t2; +# +# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables +# + +set @org_mode=@@sql_mode; +set @@sql_mode='NO_DIR_IN_CREATE'; +select @@sql_mode; +create table t1 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory='/not/existing' + index directory='/not/existing' +); + +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a7f9bd413c6..d1a5edc2ac6 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -776,6 +776,8 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, partition_element *part_elem= part_it++; if (part_elem->engine_type == NULL) part_elem->engine_type= default_engine_type; + if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) + part_elem->data_file_name= part_elem->index_file_name= 0; if (!is_sub_partitioned()) { if (check_table_name(part_elem->partition_name, From 0f79336948827a8338a427fa2b7559db0e4b073a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 11 Mar 2007 14:31:43 +0200 Subject: [PATCH 113/789] WL3527: post-merge updates sql_yacc.yy: WL3527: updated the diff to use correct parser words table.cc: WL3527: exteneded the fix for bug #20604 to fit the new variables sql_select.cc: WL3527: renamed used_keys to covering_keys sql/sql_select.cc: renamed used_keys to covering_keys sql/sql_yacc.yy: WL3527: updated the diff to use correct parser words sql/table.cc: WL3527: exteneded the fix for bug #20604 to fit the new variables --- sql/sql_select.cc | 2 +- sql/sql_yacc.yy | 2 +- sql/table.cc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d78b722632d..3a6cb754cbe 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -654,7 +654,7 @@ void JOIN::remove_subq_pushed_predicates(Item **where) static void save_index_subquery_explain_info(JOIN_TAB *join_tab, Item* where) { join_tab->packed_info= TAB_INFO_HAVE_VALUE; - if (join_tab->table->used_keys.is_set(join_tab->ref.key)) + if (join_tab->table->covering_keys.is_set(join_tab->ref.key)) join_tab->packed_info |= TAB_INFO_USING_INDEX; if (where) join_tab->packed_info |= TAB_INFO_USING_WHERE; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 01a813b4357..7da1ddc7cad 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7548,7 +7548,7 @@ index_hint_clause: } | FOR_SYM JOIN_SYM { $$= INDEX_HINT_MASK_JOIN; } | FOR_SYM ORDER_SYM BY { $$= INDEX_HINT_MASK_ORDER; } - | FOR_SYM GROUP BY { $$= INDEX_HINT_MASK_GROUP; } + | FOR_SYM GROUP_SYM BY { $$= INDEX_HINT_MASK_GROUP; } ; index_hint_type: diff --git a/sql/table.cc b/sql/table.cc index daec7492500..fd810ae7478 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4272,11 +4272,11 @@ bool st_table_list::process_index_hints(TABLE *table) /* apply USE INDEX */ if (!index_join[INDEX_HINT_USE].is_clear_all() || have_empty_use_join) - table->keys_in_use_for_query= index_join[INDEX_HINT_USE]; + table->keys_in_use_for_query.intersect(index_join[INDEX_HINT_USE]); if (!index_order[INDEX_HINT_USE].is_clear_all() || have_empty_use_order) - table->keys_in_use_for_order_by= index_order[INDEX_HINT_USE]; + table->keys_in_use_for_order_by.intersect (index_order[INDEX_HINT_USE]); if (!index_group[INDEX_HINT_USE].is_clear_all() || have_empty_use_group) - table->keys_in_use_for_group_by= index_group[INDEX_HINT_USE]; + table->keys_in_use_for_group_by.intersect (index_group[INDEX_HINT_USE]); /* apply IGNORE INDEX */ table->keys_in_use_for_query.subtract (index_join[INDEX_HINT_IGNORE]); From 13c05162f34451d19759230e24f81b34034e23b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 11 Mar 2007 23:34:40 -0700 Subject: [PATCH 114/789] Fixed bug #26963: invalid optimization of the pushdown conditions after single-row table substitution could lead to a wrong result set. The bug happened because the function Item_field::replace_equal_field erroniously assumed that any field included in a multiple equality with a constant has been already substituted for this constant. This not true for fields becoming constant after row substitutions for constant tables. mysql-test/r/select.result: Added a test case for bug #26963. mysql-test/t/select.test: Added a test case for bug #26963. sql/item.cc: Fixed bug #26963: invalid optimization of the pushdown conditions after single-row table substitution could lead to a wrong result set. The bug happened because the function Item_field::replace_equal_field erroneously assumed that any field included in a multiple equality with a constant has been already substituted for this constant. This not true for fields becoming constant after row substitutions for constant tables. --- mysql-test/r/select.result | 38 ++++++++++++++++++++++++++++++ mysql-test/t/select.test | 47 ++++++++++++++++++++++++++++++++++++++ sql/item.cc | 15 ++++++++++-- 3 files changed, 98 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index c3132a1b5f6..ae32607973a 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3933,4 +3933,42 @@ cc cc 7 aa aa 2 aa aa 2 DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +rank int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; End of 5.0 tests diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index ea5fadb2e1b..8442a073620 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3299,4 +3299,51 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; DROP TABLE t1,t2; + +# +# Bug #26963: join with predicates that contain fields from equalities evaluated +# to constants after constant table substitution +# + +CREATE TABLE t1 ( + access_id int NOT NULL default '0', + name varchar(20) default NULL, + rank int NOT NULL default '0', + KEY idx (access_id) +); + +CREATE TABLE t2 ( + faq_group_id int NOT NULL default '0', + faq_id int NOT NULL default '0', + access_id int default NULL, + UNIQUE KEY idx1 (faq_id), + KEY idx2 (faq_group_id,faq_id) +); + +INSERT INTO t1 VALUES + (1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES + (261,265,1),(490,494,1); + + +SELECT t2.faq_id + FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) + ON (t1.access_id = t2.access_id) + LEFT JOIN t2 t + ON (t.faq_group_id = t2.faq_group_id AND + find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) + WHERE + t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); + +SELECT t2.faq_id + FROM t1 INNER JOIN t2 + ON (t1.access_id = t2.access_id) + LEFT JOIN t2 t + ON (t.faq_group_id = t2.faq_group_id AND + find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) + WHERE + t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); + +DROP TABLE t1,t2; + --echo End of 5.0 tests diff --git a/sql/item.cc b/sql/item.cc index ec33bf1ddc7..11a5039ca19 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4075,7 +4075,9 @@ bool Item_field::set_no_const_sub(byte *arg) DESCRIPTION The function returns a pointer to an item that is taken from the very beginning of the item_equal list which the Item_field - object refers to (belongs to). + object refers to (belongs to) unless item_equal contains a constant + item. In this case the function returns this constant item, + (if the substitution does not require conversion). If the Item_field object does not refer any Item_equal object 'this' is returned @@ -4084,7 +4086,8 @@ bool Item_field::set_no_const_sub(byte *arg) of the thransformer method. RETURN VALUES - pointer to a replacement Item_field if there is a better equal item; + pointer to a replacement Item_field if there is a better equal item or + a pointer to a constant equal item; this - otherwise. */ @@ -4092,6 +4095,14 @@ Item *Item_field::replace_equal_field(byte *arg) { if (item_equal) { + Item *const_item= item_equal->get_const(); + if (const_item) + { + if (cmp_context != (Item_result)-1 && + const_item->cmp_context != cmp_context) + return this; + return const_item; + } Item_field *subst= item_equal->get_first(); if (subst && !field->eq(subst->field)) return subst; From 91abf15ed29a33fd6e02f00ad5088d7f8d041bc2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 01:39:57 -0700 Subject: [PATCH 115/789] Fixed bug #26738: incomplete string values in a result set column when the column is to be read from a derived table column which was specified as a concatenation of string literals. The bug happened because the Item_string::append did not adjust the value of Item_string::max_length. As a result of it the temporary table column defined to store the concatenation of literals was not wide enough to hold the whole value. mysql-test/r/subselect.result: Added a test case for bug #26738. mysql-test/t/subselect.test: Added a test case for bug #26738. --- mysql-test/r/subselect.result | 13 +++++++++++++ mysql-test/t/subselect.test | 13 +++++++++++++ sql/item.h | 6 +++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 71dbff65e7d..f2d41bd44ae 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3867,3 +3867,16 @@ id_1 DROP TABLE t1; DROP TABLE t2; DROP TABLE t1xt2; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (3), (1), (2); +SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1; +col1 col2 +this is a test. 3 +this is a test. 1 +this is a test. 2 +SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t; +col1 t2 +this is a test. 3 +this is a test. 1 +this is a test. 2 +DROP table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 1deda2a4382..1655422c51e 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2729,3 +2729,16 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t1xt2; +# +# Bug #26728: derived table with concatanation of literals in select list +# + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (3), (1), (2); + +SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1; +SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t; + +DROP table t1; + + diff --git a/sql/item.h b/sql/item.h index fb1a87d54fa..c2084fb727c 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1713,7 +1713,11 @@ public: str_value.length(), collation.collation); } Item *safe_charset_converter(CHARSET_INFO *tocs); - inline void append(char *str, uint length) { str_value.append(str, length); } + inline void append(char *str, uint length) + { + str_value.append(str, length); + max_length= str_value.numchars() * collation.collation->mbmaxlen; + } void print(String *str); // to prevent drop fixed flag (no need parent cleanup call) void cleanup() {} From 4ce3624ec48d16256b434c31324a8593b1c1c7e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 13:20:46 +0200 Subject: [PATCH 116/789] group_by.result: WL3527: disable wrong optimization. sql_select.cc: WL#3527: disable wrong optimization. sql/sql_select.cc: WL#3527: disable wrong optimization. mysql-test/r/group_by.result: WL3527: disable wrong optimization. --- mysql-test/r/group_by.result | 2 +- sql/sql_select.cc | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index ae61dfb252d..5cff5fec7ed 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1067,7 +1067,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index +1 SIMPLE t1 index NULL PRIMARY 4 NULL 256 Using index; Using filesort EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) IGNORE INDEX FOR GROUP BY (i2) GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3a6cb754cbe..5029ae2cf22 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -12393,24 +12393,12 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, DBUG_ENTER("test_if_skip_sort_order"); LINT_INIT(ref_key_parts); - /* Check which keys can be used to resolve ORDER BY. */ - usable_keys= table->keys_in_use_for_query; - /* Keys disabled by ALTER TABLE ... DISABLE KEYS should have already been taken into account. */ usable_keys= *map; - /* - If there is a covering index, and we have IGNORE INDEX FOR GROUP/ORDER - and this index is used for the JOIN part, then we have to ignore the - IGNORE INDEX FOR GROUP/ORDER - */ - if (table->key_read || - (table->covering_keys.is_set(tab->index) && !table->no_keyread)) - usable_keys.set_bit (tab->index); - for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next) { Item *item= (*tmp_order->item)->real_item(); From 32b370bb7f561a6623c1d0e028331250d6936b0a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 13:12:42 +0100 Subject: [PATCH 117/789] Makefile.am, configure.in, mysys.dsp: Removed unused files .del-my_winsem.c: Delete: mysys/my_winsem.c .del-my_semaphore.c: Delete: mysys/my_semaphore.c .del-my_semaphore.h: Delete: include/my_semaphore.h BitKeeper/deleted/.del-my_semaphore.c: Delete: mysys/my_semaphore.c BitKeeper/deleted/.del-my_semaphore.h: Delete: include/my_semaphore.h BitKeeper/deleted/.del-my_winsem.c: Delete: mysys/my_winsem.c VC++Files/mysys/mysys.dsp: Removed unused files configure.in: Removed unused files include/Makefile.am: Removed unused files mysys/Makefile.am: Removed unused files --- VC++Files/mysys/mysys.dsp | 4 - configure.in | 3 - include/Makefile.am | 2 +- include/my_semaphore.h | 64 ------ mysys/Makefile.am | 2 +- mysys/my_semaphore.c | 104 ---------- mysys/my_winsem.c | 406 -------------------------------------- 7 files changed, 2 insertions(+), 583 deletions(-) delete mode 100644 include/my_semaphore.h delete mode 100644 mysys/my_semaphore.c delete mode 100644 mysys/my_winsem.c diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp index c021adb8d9c..4ad4ca1c70b 100644 --- a/VC++Files/mysys/mysys.dsp +++ b/VC++Files/mysys/mysys.dsp @@ -508,10 +508,6 @@ SOURCE=.\my_wincond.c # End Source File # Begin Source File -SOURCE=.\my_winsem.c -# End Source File -# Begin Source File - SOURCE=.\my_winthread.c # End Source File # Begin Source File diff --git a/configure.in b/configure.in index f0307c7de2d..7b31057f6d3 100644 --- a/configure.in +++ b/configure.in @@ -772,9 +772,6 @@ AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind)) AC_CHECK_LIB(crypt, crypt) AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT)) -# For sem_xxx functions on Solaris 2.6 -AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init)) - # For compress in zlib case $SYSTEM_TYPE in *netware* | *modesto*) diff --git a/include/Makefile.am b/include/Makefile.am index bd1492766b1..2505eddb79b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -18,7 +18,7 @@ BUILT_SOURCES = mysql_version.h m_ctype.h my_config.h pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h \ mysql.h mysql_com.h mysqld_error.h mysql_embed.h \ - my_semaphore.h my_pthread.h my_no_pthread.h raid.h \ + my_pthread.h my_no_pthread.h raid.h \ errmsg.h my_global.h my_net.h my_alloc.h \ my_getopt.h sslopt-longopts.h my_dir.h \ sslopt-vars.h sslopt-case.h $(BUILT_SOURCES) diff --git a/include/my_semaphore.h b/include/my_semaphore.h deleted file mode 100644 index 7f182bea6bf..00000000000 --- a/include/my_semaphore.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Module: semaphore.h - * - * Purpose: - * Semaphores aren't actually part of the PThreads standard. - * They are defined by the POSIX Standard: - * - * POSIX 1003.1b-1993 (POSIX.1b) - * - * Pthreads-win32 - POSIX Threads Library for Win32 - * Copyright (C) 1998 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -/* This is hacked by Monty to be included in mysys library */ - -#ifndef _my_semaphore_h_ -#define _my_semaphore_h_ - -#ifdef THREAD - -C_MODE_START -#ifdef HAVE_SEMAPHORE_H -#include -#elif !defined(__bsdi__) -#ifdef __WIN__ -typedef HANDLE sem_t; -#else -typedef struct { - pthread_mutex_t mutex; - pthread_cond_t cond; - uint count; -} sem_t; -#endif /* __WIN__ */ - -int sem_init(sem_t * sem, int pshared, unsigned int value); -int sem_destroy(sem_t * sem); -int sem_trywait(sem_t * sem); -int sem_wait(sem_t * sem); -int sem_post(sem_t * sem); -int sem_post_multiple(sem_t * sem, unsigned int count); -int sem_getvalue(sem_t * sem, unsigned int * sval); - -#endif /* !__bsdi__ */ - -C_MODE_END - -#endif /* THREAD */ - -#endif /* !_my_semaphore_h_ */ diff --git a/mysys/Makefile.am b/mysys/Makefile.am index 5dc54817fd7..68d5da5afe8 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -49,7 +49,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\ my_quick.c my_lockmem.c my_static.c \ my_sync.c my_getopt.c my_mkdir.c \ default.c my_compress.c checksum.c raid.cc \ - my_net.c my_semaphore.c my_port.c my_sleep.c \ + my_net.c my_port.c my_sleep.c \ my_vsnprintf.c charset.c my_bitmap.c my_bit.c md5.c \ my_gethostbyname.c rijndael.c my_aes.c sha1.c \ my_netware.c diff --git a/mysys/my_semaphore.c b/mysys/my_semaphore.c deleted file mode 100644 index aa216cbc289..00000000000 --- a/mysys/my_semaphore.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - Simple implementation of semaphores, needed to compile MySQL on systems - that doesn't support semaphores. -*/ - -#include -#include -#include - -#if !defined(__WIN__) && !defined(HAVE_SEMAPHORE_H) && defined(THREAD) - -int sem_init(sem_t * sem, int pshared, uint value) -{ - sem->count=value; - pthread_cond_init(&sem->cond, 0); - pthread_mutex_init(&sem->mutex, 0); - return 0; -} - -int sem_destroy(sem_t * sem) -{ - int err1,err2; - err1=pthread_cond_destroy(&sem->cond); - err2=pthread_mutex_destroy(&sem->mutex); - if (err1 || err2) - { - errno=err1 ? err1 : err2; - return -1; - } - return 0; -} - -int sem_wait(sem_t * sem) -{ - if ((errno=pthread_mutex_lock(&sem->mutex))) - return -1; - while (!sem->count) - pthread_cond_wait(&sem->cond, &sem->mutex); - if (errno) - return -1; - sem->count--; /* mutex is locked here */ - pthread_mutex_unlock(&sem->mutex); - return 0; -} - -int sem_trywait(sem_t * sem) -{ - if ((errno=pthread_mutex_lock(&sem->mutex))) - return -1; - if (sem->count) - sem->count--; - else - errno=EAGAIN; - pthread_mutex_unlock(&sem->mutex); - return errno ? -1 : 0; -} - - -int sem_post(sem_t * sem) -{ - if ((errno=pthread_mutex_lock(&sem->mutex))) - return -1; - sem->count++; - pthread_mutex_unlock(&sem->mutex); /* does it really matter what to do */ - pthread_cond_signal(&sem->cond); /* first: x_unlock or x_signal ? */ - return 0; -} - -int sem_post_multiple(sem_t * sem, uint count) -{ - if ((errno=pthread_mutex_lock(&sem->mutex))) - return -1; - sem->count+=count; - pthread_mutex_unlock(&sem->mutex); /* does it really matter what to do */ - pthread_cond_broadcast(&sem->cond); /* first: x_unlock or x_broadcast ? */ - return 0; -} - -int sem_getvalue(sem_t * sem, uint *sval) -{ - if ((errno=pthread_mutex_lock(&sem->mutex))) - return -1; - *sval=sem->count; - pthread_mutex_unlock(&sem->mutex); - return 0; -} - -#endif /* !defined(__WIN__) && !defined(HAVE_SEMAPHORE_H) && defined(THREAD) */ diff --git a/mysys/my_winsem.c b/mysys/my_winsem.c deleted file mode 100644 index e2713d189b2..00000000000 --- a/mysys/my_winsem.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - * ------------------------------------------------------------- - * - * Module: my_semaphore.c (Original: semaphore.c from pthreads library) - * - * Purpose: - * Semaphores aren't actually part of the PThreads standard. - * They are defined by the POSIX Standard: - * - * POSIX 1003.1b-1993 (POSIX.1b) - * - * ------------------------------------------------------------- - * - * Pthreads-win32 - POSIX Threads Library for Win32 - * Copyright (C) 1998 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -/* - NEED_SEM is not used in MySQL and should only be needed under - Windows CE. - - The big changes compared to the original version was to not allocate - any additional memory in sem_init() but to instead store everthing - we need in sem_t. - - TODO: - To get HAVE_CREATESEMAPHORE we have to define the struct - in my_semaphore.h -*/ - -#include "mysys_priv.h" -#ifdef __WIN__ -#include "my_semaphore.h" -#include - -/* - DOCPUBLIC - This function initializes an unnamed semaphore. the - initial value of the semaphore is 'value' - - PARAMETERS - sem Pointer to an instance of sem_t - - pshared If zero, this semaphore may only be shared between - threads in the same process. - If nonzero, the semaphore can be shared between - processes - - value Initial value of the semaphore counter - - RESULTS - 0 Successfully created semaphore, - -1 Failed, error in errno - - ERRNO - EINVAL 'sem' is not a valid semaphore, - ENOSPC A required resource has been exhausted, - ENOSYS Semaphores are not supported, - EPERM The process lacks appropriate privilege - -*/ - -int -sem_init (sem_t *sem, int pshared, unsigned int value) -{ - int result = 0; - - if (pshared != 0) - { - /* - We don't support creating a semaphore that can be shared between - processes - */ - result = EPERM; - } - else - { -#ifndef HAVE_CREATESEMAPHORE - sem->value = value; - sem->event = CreateEvent(NULL, - FALSE, /* manual reset */ - FALSE, /* initial state */ - NULL); - if (!sem->event) - result = ENOSPC; - else - { - if (value) - SetEvent(sem->event); - InitializeCriticalSection(&sem->sem_lock_cs); - } -#else /* HAVE_CREATESEMAPHORE */ - *sem = CreateSemaphore (NULL, /* Always NULL */ - value, /* Initial value */ - 0x7FFFFFFFL, /* Maximum value */ - NULL); /* Name */ - if (!*sem) - result = ENOSPC; -#endif /* HAVE_CREATESEMAPHORE */ - } - if (result != 0) - { - errno = result; - return -1; - } - return 0; -} /* sem_init */ - - -/* - DOCPUBLIC - This function destroys an unnamed semaphore. - - PARAMETERS - sem Pointer to an instance of sem_t - - RESULTS - 0 Successfully destroyed semaphore, - -1 Failed, error in errno - ERRNO - EINVAL 'sem' is not a valid semaphore, - ENOSYS Semaphores are not supported, - EBUSY Threads (or processes) are currently blocked on 'sem' -*/ - -int -sem_destroy (sem_t * sem) -{ - int result = 0; - -#ifdef EXTRA_DEBUG - if (sem == NULL || *sem == NULL) - { - errno=EINVAL; - return; - } -#endif /* EXTRA_DEBUG */ - -#ifndef HAVE_CREATESEMAPHORE - if (! CloseHandle(sem->event)) - result = EINVAL; - else - DeleteCriticalSection(&sem->sem_lock_cs); -#else /* HAVE_CREATESEMAPHORE */ - if (!CloseHandle(*sem)) - result = EINVAL; -#endif /* HAVE_CREATESEMAPHORE */ - if (result) - { - errno = result; - return -1; - } - *sem=0; /* Safety */ - return 0; -} /* sem_destroy */ - - -/* - DOCPUBLIC - This function tries to wait on a semaphore. If the - semaphore value is greater than zero, it decreases - its value by one. If the semaphore value is zero, then - this function returns immediately with the error EAGAIN - - PARAMETERS - sem Pointer to an instance of sem_t - - RESULTS - 0 Successfully decreased semaphore, - -1 Failed, error in errno - - ERRNO - EAGAIN The semaphore was already locked, - EINVAL 'sem' is not a valid semaphore, - ENOSYS Semaphores are not supported, - EINTR The function was interrupted by a signal, - EDEADLK A deadlock condition was detected. -*/ - -int -sem_trywait(sem_t * sem) -{ -#ifndef HAVE_CREATESEMAPHORE - /* not yet implemented! */ - int errno = EINVAL; - return -1; -#else /* HAVE_CREATESEMAPHORE */ -#ifdef EXTRA_DEBUG - if (sem == NULL || *sem == NULL) - { - errno=EINVAL; - return -1; - } -#endif /* EXTRA_DEBUG */ - if (WaitForSingleObject (*sem, 0) == WAIT_TIMEOUT) - { - errno= EAGAIN; - return -1; - } - return 0; -#endif /* HAVE_CREATESEMAPHORE */ - -} /* sem_trywait */ - - -#ifndef HAVE_CREATESEMAPHORE - -static void -ptw32_decrease_semaphore(sem_t * sem) -{ - EnterCriticalSection(&sem->sem_lock_cs); - DBUG_ASSERT(sem->value != 0); - sem->value--; - if (sem->value != 0) - SetEvent(sem->event); - LeaveCriticalSection(&sem->sem_lock_cs); -} - -static BOOL -ptw32_increase_semaphore(sem_t * sem, unsigned int n) -{ - BOOL result=FALSE; - - EnterCriticalSection(&sem->sem_lock_cs); - if (sem->value + n > sem->value) - { - sem->value += n; - SetEvent(sem->event); - result = TRUE; - } - LeaveCriticalSection(&sem->sem_lock_cs); - return result; -} - -#endif /* HAVE_CREATESEMAPHORE */ - - -/* - ------------------------------------------------------ - DOCPUBLIC - This function waits on a semaphore. If the - semaphore value is greater than zero, it decreases - its value by one. If the semaphore value is zero, then - the calling thread (or process) is blocked until it can - successfully decrease the value or until interrupted by - a signal. - - PARAMETERS - sem Pointer to an instance of sem_t - - RESULTS - 0 Successfully decreased semaphore, - -1 Failed, error in errno - - ERRNO - EINVAL 'Sem' is not a valid semaphore, - ENOSYS Semaphores are not supported, - EINTR The function was interrupted by a signal, - EDEADLK A deadlock condition was detected. -*/ - -int -sem_wait(sem_t *sem) -{ - int result; - -#ifdef EXTRA_DEBUG - if (sem == NULL || *sem == NULL) - { - errno=EINVAL; - return -1; - } -#endif /* EXTRA_DEBUG */ - -#ifndef HAVE_CREATESEMAPHORE - result=WaitForSingleObject(sem->event, INFINITE); -#else - result=WaitForSingleObject(*sem, INFINITE); -#endif - if (result == WAIT_FAILED || result == WAIT_ABANDONED_0) - result = EINVAL; - else if (result == WAIT_TIMEOUT) - result = ETIMEDOUT; - else - result=0; - if (result) - { - errno = result; - return -1; - } -#ifndef HAVE_CREATESEMAPHORE - ptw32_decrease_semaphore(sem); -#endif /* HAVE_CREATESEMAPHORE */ - return 0; -} - - -/* - ------------------------------------------------------ - DOCPUBLIC - This function posts a wakeup to a semaphore. If there - are waiting threads (or processes), one is awakened; - otherwise, the semaphore value is incremented by one. - - PARAMETERS - sem Pointer to an instance of sem_t - - RESULTS - 0 Successfully posted semaphore, - -1 Failed, error in errno - - ERRNO - EINVAL 'sem' is not a valid semaphore, - ENOSYS Semaphores are not supported, - -*/ - -int -sem_post (sem_t * sem) -{ -#ifdef EXTRA_DEBUG - if (sem == NULL || *sem == NULL) - { - errno=EINVAL; - return -1; - } -#endif /* EXTRA_DEBUG */ - -#ifndef HAVE_CREATESEMAPHORE - if (! ptw32_increase_semaphore(sem, 1)) -#else /* HAVE_CREATESEMAPHORE */ - if (! ReleaseSemaphore(*sem, 1, 0)) -#endif /* HAVE_CREATESEMAPHORE */ - { - errno=EINVAL; - return -1; - } - return 0; -} - - -/* - ------------------------------------------------------ - DOCPUBLIC - This function posts multiple wakeups to a semaphore. If there - are waiting threads (or processes), n <= count are awakened; - the semaphore value is incremented by count - n. - - PARAMETERS - sem Pointer to an instance of sem_t - count Counter, must be greater than zero. - - RESULTS - 0 Successfully posted semaphore, - -1 Failed, error in errno - - ERRNO - EINVAL 'sem' is not a valid semaphore or count is less - than or equal to zero. -*/ - -int -sem_post_multiple (sem_t * sem, unsigned int count) -{ -#ifdef EXTRA_DEBUG - if (sem == NULL || *sem == NULL || count <= 0) - { - errno=EINVAL; - return -1; - } -#endif /* EXTRA_DEBUG */ -#ifndef HAVE_CREATESEMAPHORE - if (! ptw32_increase_semaphore (sem, count)) -#else /* HAVE_CREATESEMAPHORE */ - if (! ReleaseSemaphore(*sem, count, 0)) -#endif /* HAVE_CREATESEMAPHORE */ - { - errno = EINVAL; - return -1; - } - return 0; -} - -int -sem_getvalue (sem_t *sem, unsigned int *sval) -{ - errno = ENOSYS; - return -1; -} /* sem_getvalue */ - -#endif /* __WIN__ */ From 150496613cb9fc79ee3205dd3fc052f933942ba9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 13:15:43 +0100 Subject: [PATCH 118/789] add missing test cases to windows binary distribution --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 211eea8a265..ffd3712715a 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -291,6 +291,7 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ +cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ From d429f590111698d88cfece92c1f3e059af2be306 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 13:18:48 +0100 Subject: [PATCH 119/789] mysys_ia64.dsp, mysys.vcproj: Removed references to unused files VC++Files/mysys/mysys.vcproj: Removed unused files VC++Files/mysys/mysys_ia64.dsp: Removed unused files --- VC++Files/mysys/mysys.vcproj | 43 ---------------------------------- VC++Files/mysys/mysys_ia64.dsp | 4 ---- 2 files changed, 47 deletions(-) diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj index f728c47fb40..a7550b0b4bd 100644 --- a/VC++Files/mysys/mysys.vcproj +++ b/VC++Files/mysys/mysys.vcproj @@ -4094,49 +4094,6 @@ PreprocessorDefinitions=""/> - - - - - - - - - - - - - - - - - Date: Mon, 12 Mar 2007 14:52:37 +0100 Subject: [PATCH 120/789] Makefile.am, CMakeLists.txt: Removed references to my_winsem.c mysys/CMakeLists.txt: Removed references to my_winsem.c mysys/Makefile.am: Removed references to my_winsem.c --- mysys/CMakeLists.txt | 2 +- mysys/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 77933d57d21..f529b559fb0 100755 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -39,7 +39,7 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c - my_windac.c my_winsem.c my_winthread.c my_write.c ptr_cmp.c queues.c + my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c thr_rwlock.c tree.c typelib.c base64.c my_memmem.c my_getpagesize.c) diff --git a/mysys/Makefile.am b/mysys/Makefile.am index d145b7faf86..a835492e670 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -58,7 +58,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ my_windac.c my_access.c base64.c my_libwrap.c EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ thr_mutex.c thr_rwlock.c mf_soundex.c my_conio.c \ - my_wincond.c my_winsem.c my_winthread.c CMakeLists.txt + my_wincond.c my_winthread.c CMakeLists.txt libmysys_a_LIBADD = @THREAD_LOBJECTS@ # test_dir_DEPENDENCIES= $(LIBRARIES) # testhash_DEPENDENCIES= $(LIBRARIES) From 428a7f66cc20c08421ba1c5960844ad4f24360c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 14:55:45 +0100 Subject: [PATCH 121/789] CMakeLists.txt: Removed references to my_winsem.c mysys/CMakeLists.txt: Removed references to my_winsem.c --- mysys/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index c4d67f1e552..1ae625c4c03 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -39,6 +39,6 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c - my_windac.c my_winsem.c my_winthread.c my_write.c ptr_cmp.c queues.c + my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c) From bd6aecf3f3c2cab2108cc0f75defea6cf17b97c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 16:57:00 +0200 Subject: [PATCH 122/789] Bug #26794: Different set of conditions is used to verify the validity of index definitions over a GEOMETRY column in ALTER TABLE and CREATE TABLE. The difference was on how sub-keys notion validity is checked. Fixed by extending the CREATE TABLE condition to support the cases allowed in ALTER TABLE. Made the SHOW CREATE TABLE not to display spatial indexes using the sub-key notion. mysql-test/r/alter_table.result: Bug #26794: test case mysql-test/r/gis-rtree.result: Bug #26794: fixed SHOW CREATE TABLE output. mysql-test/t/alter_table.test: Bug #26794: test case sql/field.cc: Bug #26794: Allow sub-keys for GEOMETRY sql/sql_show.cc: Bug #26794: Don't show sub-key notion in SHOW CREATE TABLE for SPATIAL indexes. sql/sql_table.cc: Bug #26794: Allow sub-keys for GEOMETRY --- mysql-test/r/alter_table.result | 34 +++++++++++++++++++++++++++++++++ mysql-test/r/gis-rtree.result | 4 ++-- mysql-test/t/alter_table.test | 23 ++++++++++++++++++++++ sql/field.cc | 1 + sql/sql_show.cc | 2 +- sql/sql_table.cc | 4 +++- 6 files changed, 64 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index d8de2655c6c..82c35ff963a 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -826,3 +826,37 @@ create table t1 (t varchar(255) default null, key t (t(80))) engine=myisam default charset=latin1; alter table t1 change t t text; drop table t1; +CREATE TABLE t1 (a varchar(500)); +ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(500) default NULL, + `b` geometry NOT NULL, + SPATIAL KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ADD KEY(b(50)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(500) default NULL, + `b` geometry NOT NULL, + SPATIAL KEY `b` (`b`), + KEY `b_2` (`b`(50)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ADD c POINT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(500) default NULL, + `b` geometry NOT NULL, + `c` point default NULL, + SPATIAL KEY `b` (`b`), + KEY `b_2` (`b`(50)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t2 (a INT, KEY (a(20))); +ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys +ALTER TABLE t1 ADD d INT; +ALTER TABLE t1 ADD KEY (d(20)); +ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys +DROP TABLE t1; diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 05d0d5634e6..4ca2bc98d82 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -10,7 +10,7 @@ t1 CREATE TABLE `t1` ( `fid` int(11) NOT NULL auto_increment, `g` geometry NOT NULL, PRIMARY KEY (`fid`), - SPATIAL KEY `g` (`g`(32)) + SPATIAL KEY `g` (`g`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)')); INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)')); @@ -293,7 +293,7 @@ t2 CREATE TABLE `t2` ( `fid` int(11) NOT NULL auto_increment, `g` geometry NOT NULL, PRIMARY KEY (`fid`), - SPATIAL KEY `g` (`g`(32)) + SPATIAL KEY `g` (`g`) ) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 SELECT count(*) FROM t2; count(*) diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 01f55931ca4..307138added 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -613,3 +613,26 @@ create table t1 (t varchar(255) default null, key t (t(80))) engine=myisam default charset=latin1; alter table t1 change t t text; drop table t1; + +# +# Bug #26794: Adding an index with a prefix on a SPATIAL type breaks ALTER +# TABLE +# +CREATE TABLE t1 (a varchar(500)); + +ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); +SHOW CREATE TABLE t1; +ALTER TABLE t1 ADD KEY(b(50)); +SHOW CREATE TABLE t1; + +ALTER TABLE t1 ADD c POINT; +SHOW CREATE TABLE t1; + +--error ER_WRONG_SUB_KEY +CREATE TABLE t2 (a INT, KEY (a(20))); + +ALTER TABLE t1 ADD d INT; +--error ER_WRONG_SUB_KEY +ALTER TABLE t1 ADD KEY (d(20)); + +DROP TABLE t1; diff --git a/sql/field.cc b/sql/field.cc index 981a877783f..0f8103b4046 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1011,6 +1011,7 @@ bool Field::type_can_have_key_part(enum enum_field_types type) case MYSQL_TYPE_BLOB: case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_STRING: + case MYSQL_TYPE_GEOMETRY: return TRUE; default: return FALSE; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c4b06934fc3..24aef80626f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -992,7 +992,7 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet) if (key_part->field && (key_part->length != table->field[key_part->fieldnr-1]->key_length() && - !(key_info->flags & HA_FULLTEXT))) + !(key_info->flags & (HA_FULLTEXT | HA_SPATIAL)))) { buff[0] = '('; char* end=int10_to_str((long) key_part->length / diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 512d990347f..38a22c47f12 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1344,6 +1344,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, } else if (!f_is_geom(sql_field->pack_flag) && (column->length > length || + !Field::type_can_have_key_part (sql_field->sql_type) || ((f_is_packed(sql_field->pack_flag) || ((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) && (key_info->flags & HA_NOSAME))) && @@ -3470,7 +3471,8 @@ view_err: checking whether cfield->length < key_part_length (in chars). */ if (!Field::type_can_have_key_part(cfield->field->type()) || - !Field::type_can_have_key_part(cfield->sql_type) || + (!Field::type_can_have_key_part(cfield->sql_type) && + !f_is_geom (cfield->pack_flag)) || (cfield->field->field_length == key_part_length && !f_is_blob(key_part->key_type)) || (cfield->length && (cfield->length < key_part_length / From 465a31bc5933563f9398ea60ce6096cef740d0ca Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 10:25:11 -0700 Subject: [PATCH 123/789] Cleaned up memory allocation so that in all cases of malloc failure the application ends execution. Default values for auto-generate have been made available for adjusting. Key test for rights now works with either type of keys. client/client_priv.h: Adding options for execution defines client/mysqlslap.c: Cleaning up memory allocation so that malloc failures die. Fixed execution so that defaults are not adjustable. mysql-test/t/mysqlslap.test: Adding a test for defaults. --- client/client_priv.h | 3 + client/mysqlslap.c | 420 +++++++++++++++++++++++++----------- mysql-test/t/mysqlslap.test | 4 + 3 files changed, 298 insertions(+), 129 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index c8cf68bfd13..00ef1a79d96 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -60,6 +60,9 @@ enum options_client OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, OPT_SLAP_AUTO_GENERATE_WRITE_NUM, OPT_SLAP_AUTO_GENERATE_ADD_AUTO, OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY, + OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES, + OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM, + OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_DEBUG_INFO, OPT_COLUMN_TYPES diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 047193495d2..1ec8d124a48 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -78,8 +78,9 @@ TODO: #define SELECT_TYPE 0 #define UPDATE_TYPE 1 #define INSERT_TYPE 2 -#define UPDATE_TYPE_REQUERIES_PREFIX 3 +#define UPDATE_TYPE_REQUIRES_PREFIX 3 #define CREATE_TABLE_TYPE 4 +#define SELECT_TYPE_REQUIRES_PREFIX 5 #include "client_priv.h" #ifdef HAVE_LIBPTHREAD @@ -114,7 +115,7 @@ static char *shared_memory_base_name=0; static char **defaults_argv; -char *primary_keys; +char **primary_keys; unsigned long long primary_keys_number_of; static char *host= NULL, *opt_password= NULL, *user= NULL, @@ -145,9 +146,12 @@ const char *auto_generate_sql_type= "mixed"; static unsigned long connect_flags= CLIENT_MULTI_RESULTS; static int verbose, num_int_cols, num_char_cols, delimiter_length; -static int iterations; +static unsigned int iterations; static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; static ulonglong actual_queries= 0; +static ulonglong auto_actual_queries; +static ulonglong auto_generate_sql_unique_write_number; +static ulonglong auto_generate_sql_unique_query_number; static ulonglong num_of_query; static ulonglong auto_generate_sql_number; const char *concurrency_str= NULL; @@ -162,7 +166,7 @@ static uint opt_protocol= 0; static int get_options(int *argc,char ***argv); static uint opt_mysql_port= 0; -static uint opt_use_threads; +static my_bool opt_use_threads; static const char *load_default_groups[]= { "mysqlslap","client",0 }; @@ -220,8 +224,8 @@ uint get_random_string(char *buf); static statement *build_table_string(void); static statement *build_insert_string(void); static statement *build_update_string(void); -static statement *build_query_string(void); -static int generate_primary_key_list(MYSQL *mysql); +static statement * build_select_string(my_bool key); +static int generate_primary_key_list(MYSQL *mysql, statement *engine_stmt); static int drop_primary_key_list(void); static int create_schema(MYSQL *mysql, const char *db, statement *stmt, statement *engine_stmt); @@ -262,7 +266,7 @@ static int gettimeofday(struct timeval *tp, void *tzp) int main(int argc, char **argv) { MYSQL mysql; - int x; + unsigned int x; unsigned long long client_limit; statement *eptr; @@ -333,16 +337,22 @@ int main(int argc, char **argv) uint *current; conclusions conclusion; + if (verbose >= 2) + printf("Starting Concurrency Test\n"); + for (current= concurrency; current && *current; current++) { stats *head_sptr; stats *sptr; - head_sptr= (stats *)my_malloc(sizeof(stats) * iterations, MYF(MY_ZEROFILL)); + head_sptr= (stats *)my_malloc(sizeof(stats) * iterations, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); bzero(&conclusion, sizeof(conclusions)); - if (num_of_query) + if (auto_actual_queries) + client_limit= auto_actual_queries; + else if (num_of_query) client_limit= num_of_query / *current; else client_limit= actual_queries; @@ -356,6 +366,7 @@ int main(int argc, char **argv) */ if (!opt_preserve) drop_schema(&mysql, create_schema_string); + /* First we create */ if (create_statements) create_schema(&mysql, create_schema_string, create_statements, eptr); @@ -364,12 +375,21 @@ int main(int argc, char **argv) If we generated GUID we need to build a list of them from creation that we can later use. */ - if (auto_generate_sql_guid_primary) - generate_primary_key_list(&mysql); + if (verbose >= 2) + printf("Generating primary key list\n"); + if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) + generate_primary_key_list(&mysql, eptr); run_scheduler(sptr, query_statements, *current, client_limit); + + /* We are finished with this run */ + if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) + drop_primary_key_list(); } + if (verbose >= 2) + printf("Generating stats\n"); + generate_stats(&conclusion, eptr, head_sptr); if (!opt_silent) @@ -377,15 +397,12 @@ int main(int argc, char **argv) if (opt_csv_str) print_conclusions_csv(&conclusion); - my_free((byte *)head_sptr, MYF(0)); + my_free((gptr)head_sptr, MYF(0)); } if (!opt_preserve) drop_schema(&mysql, create_schema_string); - if (auto_generate_sql_guid_primary) - drop_primary_key_list(); - } while (eptr ? (eptr= eptr->next) : 0); if (!opt_only_print) @@ -397,9 +414,9 @@ int main(int argc, char **argv) /* now free all the strings we created */ if (opt_password) - my_free(opt_password, MYF(0)); + my_free((gptr)opt_password, MYF(0)); - my_free((byte *)concurrency, MYF(0)); + my_free((gptr)concurrency, MYF(0)); statement_cleanup(create_statements); statement_cleanup(engine_statements); @@ -407,7 +424,7 @@ int main(int argc, char **argv) #ifdef HAVE_SMEM if (shared_memory_base_name) - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free((gptr)shared_memory_base_name, MYF(MY_ALLOW_ZERO_PTR)); #endif free_defaults(defaults_argv); my_end(0); @@ -429,6 +446,10 @@ static struct my_option my_long_options[] = (gptr*) &auto_generate_sql_autoincrement, (gptr*) &auto_generate_sql_autoincrement, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES, + "Set this number to generate a set number of queries to run.\n", + (gptr*) &auto_actual_queries, (gptr*) &auto_actual_queries, + 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY, "Add GUID based primary keys to auto-generated tables.", (gptr*) &auto_generate_sql_guid_primary, @@ -438,6 +459,18 @@ static struct my_option my_long_options[] = "Load types are mixed, update, write, or read. Default is mixed\n", (gptr*) &auto_generate_sql_type, (gptr*) &auto_generate_sql_type, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"auto-generate-sql-unique-query-number", + OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM, + "Number of unique queries auto tests", + (gptr*) &auto_generate_sql_unique_query_number, + (gptr*) &auto_generate_sql_unique_query_number, + 0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0}, + {"auto-generate-sql-unique-write-number", + OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM, + "Number of unique queries for auto-generate-sql-write-number", + (gptr*) &auto_generate_sql_unique_write_number, + (gptr*) &auto_generate_sql_unique_write_number, + 0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0}, {"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM, "Number of rows to insert to used in read and write loads (default is 100).\n", (gptr*) &auto_generate_sql_number, (gptr*) &auto_generate_sql_number, @@ -532,7 +565,7 @@ static struct my_option my_long_options[] = {"use-threads", OPT_USE_THREADS, "Use pthread calls instead of fork() calls (default on Windows)", (gptr*) &opt_use_threads, (gptr*) &opt_use_threads, 0, - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE {"user", 'u', "User for login if not current user.", (gptr*) &user, (gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -589,7 +622,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start= argument; - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); + my_free((gptr)opt_password, MYF(MY_ALLOW_ZERO_PTR)); opt_password= my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) @@ -721,8 +754,10 @@ build_table_string(void) } dynstr_append(&table_string, ")"); - ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); - ptr->string = (char *)my_malloc(table_string.length+1, MYF(MY_WME)); + ptr= (statement *)my_malloc(sizeof(statement), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + ptr->string = (char *)my_malloc(table_string.length+1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= table_string.length+1; strmov(ptr->string, table_string.str); dynstr_free(&table_string); @@ -782,19 +817,7 @@ build_update_string(void) dynstr_append_mem(&update_string, ",", 1); } - if (auto_generate_sql_autoincrement) - { - if (snprintf(buf, HUGE_STRING_LENGTH, " WHERE id = %ld", - (long int)(random() % auto_generate_sql_number) ) - > HUGE_STRING_LENGTH) - { - fprintf(stderr, "Memory Allocation error in creating update_string\n"); - exit(1); - } - dynstr_append(&update_string, buf); - } - - if (auto_generate_sql_guid_primary) + if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) { if (snprintf(buf, HUGE_STRING_LENGTH, " WHERE id = ") > HUGE_STRING_LENGTH) { @@ -805,11 +828,14 @@ build_update_string(void) } - ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); - ptr->string= (char *)my_malloc(update_string.length+1, MYF(MY_WME)); + ptr= (statement *)my_malloc(sizeof(statement), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + + ptr->string= (char *)my_malloc(update_string.length + 1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= update_string.length+1; - if (auto_generate_sql_guid_primary) - ptr->type= UPDATE_TYPE_REQUERIES_PREFIX ; + if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) + ptr->type= UPDATE_TYPE_REQUIRES_PREFIX ; else ptr->type= UPDATE_TYPE; strmov(ptr->string, update_string.str); @@ -891,8 +917,10 @@ build_insert_string(void) dynstr_append_mem(&insert_string, ")", 1); - ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); - ptr->string= (char *)my_malloc(insert_string.length+1, MYF(MY_WME)); + ptr= (statement *)my_malloc(sizeof(statement), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + ptr->string= (char *)my_malloc(insert_string.length + 1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= insert_string.length+1; ptr->type= INSERT_TYPE; strmov(ptr->string, insert_string.str); @@ -902,19 +930,19 @@ build_insert_string(void) /* - build_query_string() + build_select_string() This function builds a query if the user opts to not supply a query statement or file containing a query statement */ static statement * -build_query_string(void) +build_select_string(my_bool key) { char buf[HUGE_STRING_LENGTH]; int col_count; statement *ptr; static DYNAMIC_STRING query_string; - DBUG_ENTER("build_query_string"); + DBUG_ENTER("build_select_string"); init_dynamic_string(&query_string, "", 1024, 1024); @@ -947,11 +975,22 @@ build_query_string(void) dynstr_append_mem(&query_string, ",", 1); } - dynstr_append_mem(&query_string, " FROM t1", 8); - ptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); - ptr->string= (char *)my_malloc(query_string.length+1, MYF(MY_WME)); + dynstr_append(&query_string, " FROM t1"); + + if ((key) && + (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)) + dynstr_append(&query_string, " WHERE id = "); + + ptr= (statement *)my_malloc(sizeof(statement), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + ptr->string= (char *)my_malloc(query_string.length + 1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= query_string.length+1; - ptr->type= SELECT_TYPE; + if ((key) && + (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)) + ptr->type= SELECT_TYPE_REQUIRES_PREFIX; + else + ptr->type= SELECT_TYPE; strmov(ptr->string, query_string.str); dynstr_free(&query_string); DBUG_RETURN(ptr); @@ -986,7 +1025,8 @@ get_options(int *argc,char ***argv) exit(1); } - if (auto_generate_sql && auto_generate_sql_guid_primary && auto_generate_sql_autoincrement) + if (auto_generate_sql && auto_generate_sql_guid_primary && + auto_generate_sql_autoincrement) { fprintf(stderr, "%s: Either auto-generate-sql-guid-primary or auto-generate-sql-add-autoincrement can be used!\n", @@ -994,6 +1034,27 @@ get_options(int *argc,char ***argv) exit(1); } + if (auto_generate_sql && + ((auto_generate_sql_autoincrement == FALSE) || + (auto_generate_sql_guid_primary == FALSE)) && + auto_generate_sql_type == 'k') + { + fprintf(stderr, + "%s: Can't perform key test without a primary key!\n", + my_progname); + exit(1); + } + + + + if (auto_generate_sql && num_of_query && auto_actual_queries) + { + fprintf(stderr, + "%s: Either auto-generate-sql-execute-number or number-of-queries can be used!\n", + my_progname); + exit(1); + } + parse_comma(concurrency_str ? concurrency_str : "1", &concurrency); if (lock_directory) @@ -1029,18 +1090,48 @@ get_options(int *argc,char ***argv) unsigned long long x= 0; statement *ptr_statement; + if (verbose >= 2) + printf("Building Create Statements for Auto\n"); + create_statements= build_table_string(); + /* + Pre-populate table + */ + for (ptr_statement= create_statements, x= 0; + x < auto_generate_sql_unique_write_number; + x++, ptr_statement= ptr_statement->next) + { + ptr_statement->next= build_insert_string(); + } + + if (verbose >= 2) + printf("Building Query Statements for Auto\n"); if (auto_generate_sql_type[0] == 'r') { - for (ptr_statement= create_statements, x= 0; - x < auto_generate_sql_number; + if (verbose >= 2) + printf("Generating SELECT Statements for Auto\n"); + + query_statements= build_select_string(FALSE); + for (ptr_statement= query_statements, x= 0; + x < auto_generate_sql_unique_query_number; x++, ptr_statement= ptr_statement->next) { - ptr_statement->next= build_insert_string(); + ptr_statement->next= build_select_string(FALSE); } + } + else if (auto_generate_sql_type[0] == 'k') + { + if (verbose >= 2) + printf("Generating SELECT for keys Statements for Auto\n"); - query_statements= build_query_string(); + query_statements= build_select_string(TRUE); + for (ptr_statement= query_statements, x= 0; + x < auto_generate_sql_unique_query_number; + x++, ptr_statement= ptr_statement->next) + { + ptr_statement->next= build_select_string(TRUE); + } } else if (auto_generate_sql_type[0] == 'w') { @@ -1049,9 +1140,11 @@ get_options(int *argc,char ***argv) Archive (since strings which were identical one after another would be too easily optimized). */ + if (verbose >= 2) + printf("Generating INSERT Statements for Auto\n"); query_statements= build_insert_string(); for (ptr_statement= query_statements, x= 0; - x < auto_generate_sql_number; + x < auto_generate_sql_unique_query_number; x++, ptr_statement= ptr_statement->next) { ptr_statement->next= build_insert_string(); @@ -1059,16 +1152,9 @@ get_options(int *argc,char ***argv) } else if (auto_generate_sql_type[0] == 'u') { - for (ptr_statement= create_statements, x= 0; - x < auto_generate_sql_number; - x++, ptr_statement= ptr_statement->next) - { - ptr_statement->next= build_insert_string(); - } - query_statements= build_update_string(); for (ptr_statement= query_statements, x= 0; - x < auto_generate_sql_number; + x < auto_generate_sql_unique_query_number; x++, ptr_statement= ptr_statement->next) { ptr_statement->next= build_update_string(); @@ -1084,7 +1170,7 @@ get_options(int *argc,char ***argv) at the moment it results in "every other". */ for (ptr_statement= query_statements, x= 0; - x < 4; + x < auto_generate_sql_unique_query_number; x++, ptr_statement= ptr_statement->next) { if (coin) @@ -1094,7 +1180,7 @@ get_options(int *argc,char ***argv) } else { - ptr_statement->next= build_query_string(); + ptr_statement->next= build_select_string(TRUE); coin= 1; } } @@ -1116,12 +1202,13 @@ get_options(int *argc,char ***argv) fprintf(stderr,"%s: Could not open create file\n", my_progname); exit(1); } - tmp_string= (char *)my_malloc(sbuf.st_size+1, MYF(MY_WME)); + tmp_string= (char *)my_malloc(sbuf.st_size + 1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); my_read(data_file, tmp_string, sbuf.st_size, MYF(0)); tmp_string[sbuf.st_size]= '\0'; my_close(data_file,MYF(0)); parse_delimiter(tmp_string, &create_statements, delimiter[0]); - my_free(tmp_string, MYF(0)); + my_free((gptr)tmp_string, MYF(0)); } else if (create_string) { @@ -1142,14 +1229,15 @@ get_options(int *argc,char ***argv) fprintf(stderr,"%s: Could not open query supplied file\n", my_progname); exit(1); } - tmp_string= (char *)my_malloc(sbuf.st_size+1, MYF(MY_WME)); + tmp_string= (char *)my_malloc(sbuf.st_size + 1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); my_read(data_file, tmp_string, sbuf.st_size, MYF(0)); tmp_string[sbuf.st_size]= '\0'; my_close(data_file,MYF(0)); if (user_supplied_query) actual_queries= parse_delimiter(tmp_string, &query_statements, delimiter[0]); - my_free(tmp_string, MYF(0)); + my_free((gptr)tmp_string, MYF(0)); } else if (user_supplied_query) { @@ -1158,6 +1246,9 @@ get_options(int *argc,char ***argv) } } + if (verbose >= 2) + printf("Parsing engines to use.\n"); + if (default_engine) parse_delimiter(default_engine, &engine_statements, ','); @@ -1175,55 +1266,65 @@ static int run_query(MYSQL *mysql, const char *query, int len) return 0; } - if (verbose >= 2) + if (verbose >= 3) printf("%.*s;\n", len, query); return mysql_real_query(mysql, query, len); } static int -generate_primary_key_list(MYSQL *mysql) +generate_primary_key_list(MYSQL *mysql, statement *engine_stmt) { char query[HUGE_STRING_LENGTH]; int len; MYSQL_RES *result; MYSQL_ROW row; - char *ptr; + unsigned long long counter; DBUG_ENTER("create_schema"); - len= snprintf(query, HUGE_STRING_LENGTH, "SELECT id from t1"); - - if (run_query(mysql, query, len)) - { - fprintf(stderr,"%s: Cannot select GUID primary keys. (%s)\n", my_progname, - mysql_error(mysql)); - exit(1); - } - - if (opt_only_print) + /* + Blackhole is a special case, this allows us to test the upper end + of the server during load runs. + */ + if (opt_only_print || (engine_stmt && + strstr(engine_stmt->string, "blackhole"))) { primary_keys_number_of= 1; - primary_keys= (char *)my_malloc(sizeof(char) * primary_keys_number_of * 32, - MYF(MY_ZEROFILL)); - memcpy(primary_keys, "796c4422-1d94-102a-9d6d-00e0812d", 32); - DBUG_RETURN(0); + primary_keys= (char **)my_malloc(sizeof(char *) * primary_keys_number_of, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + /* Yes, we strdup a const string to simplify the interface */ + primary_keys[0]= my_strdup("796c4422-1d94-102a-9d6d-00e0812d", MYF(0)); } - result= mysql_store_result(mysql); - DBUG_ASSERT(result); - primary_keys_number_of= mysql_num_rows(result); - /* - We know the GUID are 32 characters in length, so we preallocate. - */ - primary_keys= (char *)my_malloc(sizeof(char) * primary_keys_number_of * 32, - MYF(MY_ZEROFILL)); - ptr= primary_keys; - while ((row = mysql_fetch_row(result))) + else { - memcpy(ptr, row[0], 32); - ptr+= 32; + len= snprintf(query, HUGE_STRING_LENGTH, "SELECT id from t1"); + + if (run_query(mysql, query, len)) + { + fprintf(stderr,"%s: Cannot select GUID primary keys. (%s)\n", my_progname, + mysql_error(mysql)); + exit(1); + } + + result= mysql_store_result(mysql); + primary_keys_number_of= mysql_num_rows(result); + + /* So why check this? Blackhole :) */ + if (primary_keys_number_of) + { + /* + We create the structure and loop and create the items. + */ + primary_keys= (char **)my_malloc(sizeof(char *) * primary_keys_number_of, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + row= mysql_fetch_row(result); + for (counter= 0; counter < primary_keys_number_of; + counter++, row= mysql_fetch_row(result)) + primary_keys[counter]= my_strdup(row[0], MYF(0)); + } + + mysql_free_result(result); } - DBUG_ASSERT(ptr == primary_keys + (primary_keys_number_of * 32)); - mysql_free_result(result); DBUG_RETURN(0); } @@ -1231,7 +1332,16 @@ generate_primary_key_list(MYSQL *mysql) static int drop_primary_key_list(void) { - my_free(primary_keys, MYF(0)); + unsigned long long counter; + + if (primary_keys_number_of) + { + for (counter= 0; counter < primary_keys_number_of; counter++) + my_free((gptr)primary_keys[counter], MYF(0)); + + my_free((gptr)primary_keys, MYF(0)); + } + return 0; } @@ -1241,11 +1351,16 @@ create_schema(MYSQL *mysql, const char *db, statement *stmt, { char query[HUGE_STRING_LENGTH]; statement *ptr; + statement *after_create; int len; + ulonglong count; DBUG_ENTER("create_schema"); len= snprintf(query, HUGE_STRING_LENGTH, "CREATE SCHEMA `%s`", db); + if (verbose >= 2) + printf("Loading Pre-data\n"); + if (run_query(mysql, query, len)) { fprintf(stderr,"%s: Cannot create schema %s : %s\n", my_progname, db, @@ -1259,8 +1374,9 @@ create_schema(MYSQL *mysql, const char *db, statement *stmt, } else { - if (verbose >= 2) + if (verbose >= 3) printf("%s;\n", query); + if (mysql_select_db(mysql, db)) { fprintf(stderr,"%s: Cannot select schema '%s': %s\n",my_progname, db, @@ -1281,8 +1397,15 @@ create_schema(MYSQL *mysql, const char *db, statement *stmt, } } - for (ptr= stmt; ptr && ptr->length; ptr= ptr->next) + count= 0; + after_create= stmt; + +limit_not_met: + for (ptr= after_create; ptr && ptr->length; ptr= ptr->next, count++) { + if (auto_generate_sql && ( auto_generate_sql_number == count)) + break; + if (run_query(mysql, ptr->string, ptr->length)) { fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", @@ -1291,6 +1414,13 @@ create_schema(MYSQL *mysql, const char *db, statement *stmt, } } + if (auto_generate_sql && (auto_generate_sql_number > count )) + { + /* Special case for auto create, we don't want to create tables twice */ + after_create= stmt->next; + goto limit_not_met; + } + DBUG_RETURN(0); } @@ -1379,10 +1509,9 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) /* child */ DBUG_PRINT("info", ("fork returned 0, calling task(\"%s\"), pid %d gid %d", stmts ? stmts->string : "", pid, getgid())); - if (verbose >= 2) - fprintf(stderr, - "%s: fork returned 0, calling task pid %d gid %d\n", - my_progname, pid, getgid()); + if (verbose >= 3) + printf("%s: fork returned 0, calling task pid %d gid %d\n", + my_progname, pid, getgid()); run_task(&con); exit(0); break; @@ -1398,9 +1527,9 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) default: /* parent, forked */ DBUG_PRINT("info", ("default, break: pid %d gid %d", pid, getgid())); - if (verbose >= 2) - fprintf(stderr,"%s: fork returned %d, gid %d\n", - my_progname, pid, getgid()); + if (verbose >= 3) + printf("%s: fork returned %d, gid %d\n", + my_progname, pid, getgid()); break; } } @@ -1437,8 +1566,11 @@ WAIT: pid= wait(&status); DBUG_PRINT("info", ("Parent: child %d status %d", pid, status)); if (status != 0) + { printf("%s: Child %d died with the status %d\n", my_progname, pid, status); + exit(0); + } } } #endif @@ -1468,10 +1600,18 @@ run_task(thread_context *con) DBUG_PRINT("info", ("task script \"%s\"", con->stmt ? con->stmt->string : "")); if (!(mysql= mysql_init(NULL))) - goto end; + { + fprintf(stderr,"%s: mysql_init() failed ERROR : %s\n", + my_progname, mysql_error(mysql)); + exit(0); + } if (con->thread && mysql_thread_init()) - goto end; + { + fprintf(stderr,"%s: mysql_thread_init() failed ERROR : %s\n", + my_progname, mysql_error(mysql)); + exit(0); + } DBUG_PRINT("info", ("trying to connect to host %s as user %s", host, user)); lock_file= my_open(lock_file_str, O_RDWR, MYF(0)); @@ -1504,7 +1644,7 @@ run_task(thread_context *con) } DBUG_PRINT("info", ("connected.")); if (verbose >= 3) - fprintf(stderr, "connected!\n"); + printf("connected!\n"); queries= 0; limit_not_met: @@ -1513,20 +1653,38 @@ limit_not_met: /* We have to execute differently based on query type. This should become a function. */ - if (ptr->type == UPDATE_TYPE_REQUERIES_PREFIX) + if ((ptr->type == UPDATE_TYPE_REQUIRES_PREFIX) || + (ptr->type == SELECT_TYPE_REQUIRES_PREFIX)) { - char buffer[HUGE_STRING_LENGTH]; - char *key= primary_keys + (random() % primary_keys_number_of); int length; + long int key_val; + char *key; + char buffer[HUGE_STRING_LENGTH]; - length= snprintf(buffer, HUGE_STRING_LENGTH, "%.*s '%.*s'", - (int)ptr->length, ptr->string, 32, key); - - if (run_query(mysql, buffer, length)) + /* + This should only happen if some sort of new engine was + implemented that didn't properly handle UPDATEs. + + Just in case someone runs this under an experimental engine we don't + want a crash so the if() is placed here. + */ + DBUG_ASSERT(primary_keys_number_of); + if (primary_keys_number_of) { - fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", - my_progname, (uint)length, buffer, mysql_error(mysql)); - goto end; + key_val= random() % primary_keys_number_of; + key= primary_keys[key_val]; + + DBUG_ASSERT(key); + + length= snprintf(buffer, HUGE_STRING_LENGTH, "%.*s '%s'", + (int)ptr->length, ptr->string, key); + + if (run_query(mysql, buffer, length)) + { + fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", + my_progname, (uint)length, buffer, mysql_error(mysql)); + exit(0); + } } } else @@ -1535,9 +1693,10 @@ limit_not_met: { fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); - goto end; + exit(0); } } + if (mysql_field_count(mysql)) { result= mysql_store_result(mysql); @@ -1581,9 +1740,11 @@ parse_delimiter(const char *script, statement **stmt, char delm) uint length= strlen(script); uint count= 0; /* We know that there is always one */ - for (tmp= *sptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)); + for (tmp= *sptr= (statement *)my_malloc(sizeof(statement), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); (retstr= strchr(ptr, delm)); - tmp->next= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)), + tmp->next= (statement *)my_malloc(sizeof(statement), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)), tmp= tmp->next) { count++; @@ -1619,7 +1780,8 @@ parse_comma(const char *string, uint **range) if (*ptr == ',') count++; /* One extra spot for the NULL */ - nptr= *range= (uint *)my_malloc(sizeof(uint) * (count + 1), MYF(MY_ZEROFILL)); + nptr= *range= (uint *)my_malloc(sizeof(uint) * (count + 1), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr= (char *)string; x= 0; @@ -1670,7 +1832,7 @@ void generate_stats(conclusions *con, statement *eng, stats *sptr) { stats *ptr; - int x; + unsigned int x; con->min_timing= sptr->timing; con->max_timing= sptr->timing; @@ -1710,7 +1872,7 @@ statement_cleanup(statement *stmt) { nptr= ptr->next; if (ptr->string) - my_free(ptr->string, MYF(0)); - my_free((byte *)ptr, MYF(0)); + my_free((gptr)ptr->string, MYF(0)); + my_free((gptr)(byte *)ptr, MYF(0)); } } diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test index c98da4b4a0f..5d98dac03ea 100644 --- a/mysql-test/t/mysqlslap.test +++ b/mysql-test/t/mysqlslap.test @@ -28,3 +28,7 @@ --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=update + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=5 + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5 From 6f83533440f3ceacda2265ac0e0d45fb879330dc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Mar 2007 21:27:07 +0100 Subject: [PATCH 124/789] configure.in: Restored accidently removed line to check for zlib configure.in: Restored accidently removed line to check for zlib --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 34da88c33a7..6c239e3a1e7 100644 --- a/configure.in +++ b/configure.in @@ -845,6 +845,8 @@ AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind)) # Check if crypt() exists in libc or libcrypt, sets LIBS if needed AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt])) +MYSQL_CHECK_ZLIB_WITH_COMPRESS + #-------------------------------------------------------------------- # Check for TCP wrapper support #-------------------------------------------------------------------- From c573f816b7a5ae1b21310e490a4fd6ceacdf6b58 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 00:56:30 -0700 Subject: [PATCH 125/789] Cleaning up 4 pushbuild warnings caught by Windows. client/mysqlslap.c: Cleanup of pushbuild warnings. --- client/mysqlslap.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 1ec8d124a48..1976c54c393 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1037,7 +1037,7 @@ get_options(int *argc,char ***argv) if (auto_generate_sql && ((auto_generate_sql_autoincrement == FALSE) || (auto_generate_sql_guid_primary == FALSE)) && - auto_generate_sql_type == 'k') + auto_generate_sql_type[0] == 'k') { fprintf(stderr, "%s: Can't perform key test without a primary key!\n", @@ -1290,7 +1290,8 @@ generate_primary_key_list(MYSQL *mysql, statement *engine_stmt) strstr(engine_stmt->string, "blackhole"))) { primary_keys_number_of= 1; - primary_keys= (char **)my_malloc(sizeof(char *) * primary_keys_number_of, + primary_keys= (char **)my_malloc((uint)(sizeof(char *) * + primary_keys_number_of), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); /* Yes, we strdup a const string to simplify the interface */ primary_keys[0]= my_strdup("796c4422-1d94-102a-9d6d-00e0812d", MYF(0)); @@ -1315,7 +1316,8 @@ generate_primary_key_list(MYSQL *mysql, statement *engine_stmt) /* We create the structure and loop and create the items. */ - primary_keys= (char **)my_malloc(sizeof(char *) * primary_keys_number_of, + primary_keys= (char **)my_malloc((uint)(sizeof(char *) * + primary_keys_number_of), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); row= mysql_fetch_row(result); for (counter= 0; counter < primary_keys_number_of; @@ -1657,7 +1659,7 @@ limit_not_met: (ptr->type == SELECT_TYPE_REQUIRES_PREFIX)) { int length; - long int key_val; + unsigned int key_val; char *key; char buffer[HUGE_STRING_LENGTH]; @@ -1671,7 +1673,7 @@ limit_not_met: DBUG_ASSERT(primary_keys_number_of); if (primary_keys_number_of) { - key_val= random() % primary_keys_number_of; + key_val= (unsigned int)(random() % primary_keys_number_of); key= primary_keys[key_val]; DBUG_ASSERT(key); From 8b46825627808a4e6bfba09565a08f5f03d95421 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 18:13:06 +0800 Subject: [PATCH 126/789] BUG#25880, Adding new column to ndb_dd table moves data for non_indexed fields in memory correct the inconsistency between columns' storage type with table's storage_media & tablespace sql/ha_ndbcluster.cc: move something to proper location, then columns' storage type are consistent with table's storage_media & tablespace --- sql/ha_ndbcluster.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 86a2f9d8544..aa3de5311cf 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4831,7 +4831,8 @@ int ha_ndbcluster::create(const char *name, if ((my_errno= create_ndb_column(col, field, create_info))) DBUG_RETURN(my_errno); - if (create_info->storage_media == HA_SM_DISK) + if (create_info->storage_media == HA_SM_DISK || + create_info->tablespace) col.setStorageType(NdbDictionary::Column::StorageTypeDisk); else col.setStorageType(NdbDictionary::Column::StorageTypeMemory); From ba234148927efb3b226e6814bb36a9e6139762c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 18:13:10 +0800 Subject: [PATCH 127/789] Bug#25295, ALTER TABLE operations for NDB tables require inclusion of ENGINE=ndbcluster. this patch of bug25295 depends on the patches of bug25877 and bug25880 sql/ha_ndbcluster.cc: add check for storage media changes between old and new table when do 'alter table ...' --- sql/ha_ndbcluster.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 4aa6d4d3167..1580bfb8b6f 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -10641,6 +10641,36 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info, if (field->flags & FIELD_IN_ADD_INDEX) ai=1; } + + char tablespace_name[FN_LEN]; + if (get_tablespace_name(current_thd, tablespace_name, FN_LEN)) + { + if (create_info->tablespace) + { + if (strcmp(create_info->tablespace, tablespace_name)) + { + DBUG_PRINT("info", ("storage media is changed, old tablespace=%s, new tablespace=%s", + tablespace_name, create_info->tablespace)); + DBUG_RETURN(COMPATIBLE_DATA_NO); + } + } + else + { + DBUG_PRINT("info", ("storage media is changed, old is DISK and tablespace=%s, new is MEM", + tablespace_name)); + DBUG_RETURN(COMPATIBLE_DATA_NO); + } + } + else + { + if (create_info->storage_media != HA_SM_MEMORY) + { + DBUG_PRINT("info", ("storage media is changed, old is MEM, new is DISK and tablespace=%s", + create_info->tablespace)); + DBUG_RETURN(COMPATIBLE_DATA_NO); + } + } + if (table_changes != IS_EQUAL_YES) DBUG_RETURN(COMPATIBLE_DATA_NO); From a609410829b434e287fcd136b13ca0ddf06282f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 11:29:14 +0100 Subject: [PATCH 128/789] ndb - bug#27003 Handle random(not in order) LQHKEYREQ failures during node-restart ndb/src/kernel/blocks/ERROR_codes.txt: Document new error codes ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Handle random(not in order) LQHKEYREQ failures during node-restart ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: Error codes for various oom problems ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: move CLEAR_ERROR_INSERT_VALUE to constructor so that it's reasonable to use it for restart testing ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Add error insert for CopyFragRef ndb/test/ndbapi/testNodeRestart.cpp: Testprg for bug#27003 ndb/test/run-test/daily-basic-tests.txt: add testprg --- ndb/src/kernel/blocks/ERROR_codes.txt | 12 ++++ ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 19 ++++++- .../kernel/blocks/dbtup/DbtupExecQuery.cpp | 24 ++++++++ ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 2 +- ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 1 + ndb/test/ndbapi/testNodeRestart.cpp | 56 +++++++++++++++++++ ndb/test/run-test/daily-basic-tests.txt | 4 ++ 7 files changed, 114 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index f7cb49014cb..ed35db91738 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -489,3 +489,15 @@ Dbdict: 6003 Crash in participant @ CreateTabReq::Prepare 6004 Crash in participant @ CreateTabReq::Commit 6005 Crash in participant @ CreateTabReq::CreateDrop + +TUP: +---- + +4025: Fail all inserts with out of memory +4026: Fail one insert with oom +4027: Fail inserts randomly with oom +4028: Fail one random insert with oom + +NDBCNTR: + +1000: Crash insertion on SystemError::CopyFragRef diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 698e5ac292c..5847e1063aa 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -9641,6 +9641,15 @@ void Dblqh::copyCompletedLab(Signal* signal) closeCopyLab(signal); return; }//if + + if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY && + scanptr.p->scanErrorCounter) + { + jam(); + closeCopyLab(signal); + return; + } + if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY) { jam(); /*---------------------------------------------------------------------------*/ @@ -9717,13 +9726,16 @@ void Dblqh::continueCopyAfterBlockedLab(Signal* signal) void Dblqh::copyLqhKeyRefLab(Signal* signal) { ndbrequire(tcConnectptr.p->transid[1] == signal->theData[4]); - tcConnectptr.p->copyCountWords -= signal->theData[3]; + Uint32 copyWords = signal->theData[3]; scanptr.i = tcConnectptr.p->tcScanRec; c_scanRecordPool.getPtr(scanptr); scanptr.p->scanErrorCounter++; tcConnectptr.p->errorCode = terrorCode; - closeCopyLab(signal); - return; + + LqhKeyConf* conf = (LqhKeyConf*)signal->getDataPtrSend(); + conf->transId1 = copyWords; + conf->transId2 = tcConnectptr.p->transid[1]; + copyCompletedLab(signal); }//Dblqh::copyLqhKeyRefLab() void Dblqh::closeCopyLab(Signal* signal) @@ -9734,6 +9746,7 @@ void Dblqh::closeCopyLab(Signal* signal) // Wait until all of those have arrived until we start the // close process. /*---------------------------------------------------------------------------*/ + scanptr.p->scanState = ScanRecord::WAIT_LQHKEY_COPY; jam(); return; }//if diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 9917ac4e340..15ce54e594c 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -213,6 +213,30 @@ void Dbtup::execTUP_ALLOCREQ(Signal* signal) //--------------------------------------------------- PagePtr pagePtr; Uint32 pageOffset; + + if (ERROR_INSERTED(4025)) + { + signal->theData[0] = 827; + return; + } + if (ERROR_INSERTED(4026)) + { + CLEAR_ERROR_INSERT_VALUE; + signal->theData[0] = 827; + return; + } + if (ERROR_INSERTED(4027) && (rand() % 100) > 25) + { + signal->theData[0] = 827; + return; + } + if (ERROR_INSERTED(4028) && (rand() % 100) > 25) + { + CLEAR_ERROR_INSERT_VALUE; + signal->theData[0] = 827; + return; + } + if (!allocTh(regFragPtr.p, regTabPtr.p, NORMAL_PAGE, diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 6b1056fdeac..f5b4e1fb944 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -66,6 +66,7 @@ void Dbtup::initData() undoPage = 0; totNoOfPagesAllocated = 0; cnoOfAllocatedPages = 0; + CLEAR_ERROR_INSERT_VALUE; // Records with constant sizes }//Dbtup::initData() @@ -570,7 +571,6 @@ void Dbtup::execSTTOR(Signal* signal) switch (startPhase) { case ZSTARTPHASE1: ljam(); - CLEAR_ERROR_INSERT_VALUE; cownref = calcTupBlockRef(0); break; default: diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index a9039385805..c05f04d700c 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -180,6 +180,7 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal) break; case SystemError::CopyFragRefError: + CRASH_INSERTION(1000); BaseString::snprintf(buf, sizeof(buf), "Killed by node %d as " "copyfrag failed, error: %u", diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index c8c8ddd88d6..e8f8ac66f74 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -1125,6 +1125,59 @@ runBug26481(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runBug27003(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + NdbRestarter res; + + static const int errnos[] = { 4025, 4026, 4027, 4028, 0 }; + + int node = res.getRandomNotMasterNodeId(rand()); + ndbout_c("node: %d", node); + if (res.restartOneDbNode(node, false, true, true)) + return NDBT_FAILED; + + Uint32 pos = 0; + for (Uint32 i = 0; i Date: Tue, 13 Mar 2007 12:38:47 +0100 Subject: [PATCH 129/789] ndb - bug#27003 merge to 5.1, adopt testprg to optimized node recovery storage/ndb/include/kernel/signaldata/LqhKey.hpp: Add Restore as friend storage/ndb/src/kernel/blocks/restore.cpp: Give proper error message on LQHKEYREF storage/ndb/test/ndbapi/testNodeRestart.cpp: post merge fix, adopt to optimized node recovery... --- .../ndb/include/kernel/signaldata/LqhKey.hpp | 1 + storage/ndb/src/kernel/blocks/restore.cpp | 17 ++++++++++++++++- storage/ndb/test/ndbapi/testNodeRestart.cpp | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/storage/ndb/include/kernel/signaldata/LqhKey.hpp b/storage/ndb/include/kernel/signaldata/LqhKey.hpp index 15ed7c25395..c85a4d4a796 100644 --- a/storage/ndb/include/kernel/signaldata/LqhKey.hpp +++ b/storage/ndb/include/kernel/signaldata/LqhKey.hpp @@ -582,6 +582,7 @@ class LqhKeyRef { * Reciver(s) */ friend class Dbtc; + friend class Restore; /** * Sender(s) diff --git a/storage/ndb/src/kernel/blocks/restore.cpp b/storage/ndb/src/kernel/blocks/restore.cpp index 214cddeeda5..51644ef0712 100644 --- a/storage/ndb/src/kernel/blocks/restore.cpp +++ b/storage/ndb/src/kernel/blocks/restore.cpp @@ -1154,8 +1154,23 @@ Restore::calulate_hash(Uint32 tableId, const Uint32 *src) } void -Restore::execLQHKEYREF(Signal*) +Restore::execLQHKEYREF(Signal* signal) { + FilePtr file_ptr; + LqhKeyRef* ref = (LqhKeyRef*)signal->getDataPtr(); + m_file_pool.getPtr(file_ptr, ref->connectPtr); + + char buf[255], name[100]; + BaseString::snprintf(name, sizeof(name), "%u/T%dF%d", + file_ptr.p->m_lcp_no, + file_ptr.p->m_table_id, + file_ptr.p->m_fragment_id); + + BaseString::snprintf(buf, sizeof(buf), + "Error %d during restore of %s", + ref->errorCode, name); + + progError(__LINE__, NDBD_EXIT_INVALID_LCP_FILE, buf); ndbrequire(false); } diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp index 35873bdf7d0..39b80611731 100644 --- a/storage/ndb/test/ndbapi/testNodeRestart.cpp +++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp @@ -1332,7 +1332,7 @@ runBug27003(NDBT_Context* ctx, NDBT_Step* step) int node = res.getRandomNotMasterNodeId(rand()); ndbout_c("node: %d", node); - if (res.restartOneDbNode(node, false, true, true)) + if (res.restartOneDbNode(node, true, true, true)) return NDBT_FAILED; Uint32 pos = 0; @@ -1351,7 +1351,7 @@ runBug27003(NDBT_Context* ctx, NDBT_Step* step) if (res.insertErrorInNode(node, errnos[pos])) return NDBT_FAILED; - int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 3 }; if (res.dumpStateOneNode(node, val2, 2)) return NDBT_FAILED; From 105310c8d5b5ecd20c6dde386f0e36fc2ba24e57 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 06:06:09 -0700 Subject: [PATCH 130/789] BUG#26952: mysql.server needs to be able to not timeout in certain situations For systems running MySQL through heartbeat, it is imperitive that the startup scripts not only return correct return values, but do not return until success or failure has been determined. This is a different behavior than is typically wanted for the startup of a normal machine. This patch adds support for a timeout variable for mysql.server. Read from my.cnf, this variable defaults to 900 (the current default). A value of 0 means not to wait at all for startup confirmation. A negative value means to wait forever. support-files/mysql.server.sh: Added support for a timeout variable to control timing out our wait for server startup. BUG#26952 --- support-files/mysql.server.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 9258fcf10c2..65b56443eea 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -46,6 +46,13 @@ basedir= datadir= +# Default value, in seconds, afterwhich the script should timeout waiting +# for server start. +# Value here is overriden by value in my.cnf. +# 0 means don't wait at all +# Negative numbers mean to wait indefinitely +service_startup_timeout=900 + # The following variables are only set for letting mysql.server find things. # Set some defaults @@ -126,6 +133,7 @@ parse_server_arguments() { ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --use-mysqld_safe) use_mysqld_safe=1;; --use-manager) use_mysqld_safe=0;; esac @@ -143,7 +151,7 @@ parse_manager_arguments() { wait_for_pid () { i=0 - while test $i -lt 900 ; do + while test $i -ne $service_startup_timeout ; do sleep 1 case "$1" in 'created') From 969b71653d434ce1d3447f6c99c331a22ba4f846 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 18:02:06 +0400 Subject: [PATCH 131/789] BUG#26881 - Large MERGE tables report incorrect specification when no differences in tables Certain merge tables were wrongly reported as having incorrect definition: - Some fields that are 1 byte long (e.g. TINYINT, CHAR(1)), might be internally casted (in certain cases) to a different type on a storage engine layer. (affects 4.1 and up) - If tables in a merge (and a MERGE table itself) had short VARCHAR column (less than 4 bytes) and at least one (but not all) tables were ALTER'ed (even to an identical table: ALTER TABLE xxx ENGINE=yyy), table definitions went ouf of sync. (affects 4.1 only) This is fixed by relaxing a check for underlying conformance and setting field type to FIELD_TYPE_STRING in case varchar is shorter than 4 when a table is created. myisam/mi_create.c: Added a comment. mysql-test/r/merge.result: A test case for bug#26881. mysql-test/t/merge.test: A test case for bug#26881. sql/ha_myisam.cc: Relaxed some checks performed by check_definition(): As comparing of fulltext keys (and key segments) is not yet implemented, only return an error in case one of keys is fulltext and other is not. Otherwise, if both keys are fulltext, accept them as is. As comparing of spatial keys (and key segments) is not yet implemented, only return an error in case one of keys is spatial and other is not. Otherwise, if both keys are spatial, accept them as is. A workaround to handle situation when field is casted from FIELD_SKIP_ZERO to FIELD_NORMAL. This could happen only in case field length is 1 and row format is fixed. sql/sql_parse.cc: When a table that has varchar field shorter than 4 is created, field type is set to FIELD_TYPE_VAR_STRING. Later, when a table is modified using alter table, field type is changed to FIELD_TYPE_STRING (see Field_string::type). That means HA_OPTION_PACK_RECORD flag might be lost and thus null_bit might be shifted by alter table, in other words alter table doesn't create 100% equal table definition. This is usually not a problem, since when a table is created/altered, definition on a storage engine layer is based on one that is passed from sql layer. But it is a problem for merge engine - null_bit is shifted when a table (merge or underlying) is altered. Set field type to FIELD_TYPE_STRING in case FIELD_TYPE_VAR_STRING is shorter than 4 when a table is created as it is done in Field::type. --- myisam/mi_create.c | 4 ++++ mysql-test/r/merge.result | 13 +++++++++++++ mysql-test/t/merge.test | 17 +++++++++++++++++ sql/ha_myisam.cc | 37 ++++++++++++++++++++++++++++++++++++- sql/sql_parse.cc | 8 +++++++- 5 files changed, 77 insertions(+), 2 deletions(-) diff --git a/myisam/mi_create.c b/myisam/mi_create.c index da9e0887b00..5e363a4e670 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -158,6 +158,10 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, rec--; if (rec->type == (int) FIELD_SKIP_ZERO && rec->length == 1) { + /* + NOTE1: here we change a field type FIELD_SKIP_ZERO -> + FIELD_NORMAL + */ rec->type=(int) FIELD_NORMAL; packed--; min_pack_length++; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 33de735d714..00d8aa3d586 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -806,3 +806,16 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); INSERT DELAYED INTO t2 VALUES(1); ERROR HY000: Table storage engine for 't2' doesn't have this option DROP TABLE t1, t2; +CREATE TABLE t1(c1 VARCHAR(1)); +CREATE TABLE m1 LIKE t1; +ALTER TABLE m1 ENGINE=MERGE UNION=(t1); +SELECT * FROM m1; +c1 +DROP TABLE t1, m1; +CREATE TABLE t1(c1 VARCHAR(4), c2 TINYINT, c3 TINYINT, c4 TINYINT, +c5 TINYINT, c6 TINYINT, c7 TINYINT, c8 TINYINT, c9 TINYINT); +CREATE TABLE m1 LIKE t1; +ALTER TABLE m1 ENGINE=MERGE UNION=(t1); +SELECT * FROM m1; +c1 c2 c3 c4 c5 c6 c7 c8 c9 +DROP TABLE t1, m1; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index f759d20dd80..032e80ecc93 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -437,4 +437,21 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); INSERT DELAYED INTO t2 VALUES(1); DROP TABLE t1, t2; +# +# BUG#26881 - Large MERGE tables report incorrect specification when no +# differences in tables +# +CREATE TABLE t1(c1 VARCHAR(1)); +CREATE TABLE m1 LIKE t1; +ALTER TABLE m1 ENGINE=MERGE UNION=(t1); +SELECT * FROM m1; +DROP TABLE t1, m1; + +CREATE TABLE t1(c1 VARCHAR(4), c2 TINYINT, c3 TINYINT, c4 TINYINT, + c5 TINYINT, c6 TINYINT, c7 TINYINT, c8 TINYINT, c9 TINYINT); +CREATE TABLE m1 LIKE t1; +ALTER TABLE m1 ENGINE=MERGE UNION=(t1); +SELECT * FROM m1; +DROP TABLE t1, m1; + # End of 4.1 tests diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 2cec03a51db..c6802ffe53c 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -304,6 +304,12 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out, RETURN VALUE 0 - Equal definitions. 1 - Different definitions. + + TODO + - compare FULLTEXT keys; + - compare SPATIAL keys; + - compare FIELD_SKIP_ZERO which is converted to FIELD_NORMAL correctly + (should be corretly detected in table2myisam). */ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, @@ -329,6 +335,28 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, { HA_KEYSEG *t1_keysegs= t1_keyinfo[i].seg; HA_KEYSEG *t2_keysegs= t2_keyinfo[i].seg; + if (t1_keyinfo[i].flag & HA_FULLTEXT && t2_keyinfo[i].flag & HA_FULLTEXT) + continue; + else if (t1_keyinfo[i].flag & HA_FULLTEXT || + t2_keyinfo[i].flag & HA_FULLTEXT) + { + DBUG_PRINT("error", ("Key %d has different definition", i)); + DBUG_PRINT("error", ("t1_fulltext= %d, t2_fulltext=%d", + test(t1_keyinfo[i].flag & HA_FULLTEXT), + test(t2_keyinfo[i].flag & HA_FULLTEXT))); + DBUG_RETURN(1); + } + if (t1_keyinfo[i].flag & HA_SPATIAL && t2_keyinfo[i].flag & HA_SPATIAL) + continue; + else if (t1_keyinfo[i].flag & HA_SPATIAL || + t2_keyinfo[i].flag & HA_SPATIAL) + { + DBUG_PRINT("error", ("Key %d has different definition", i)); + DBUG_PRINT("error", ("t1_spatial= %d, t2_spatial=%d", + test(t1_keyinfo[i].flag & HA_SPATIAL), + test(t2_keyinfo[i].flag & HA_SPATIAL))); + DBUG_RETURN(1); + } if (t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs || t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg) { @@ -365,7 +393,14 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, { MI_COLUMNDEF *t1_rec= &t1_recinfo[i]; MI_COLUMNDEF *t2_rec= &t2_recinfo[i]; - if (t1_rec->type != t2_rec->type || + /* + FIELD_SKIP_ZERO can be changed to FIELD_NORMAL in mi_create, + see NOTE1 in mi_create.c + */ + if ((t1_rec->type != t2_rec->type && + !(t1_rec->type == (int) FIELD_SKIP_ZERO && + t1_rec->length == 1 && + t2_rec->type == (int) FIELD_NORMAL)) || t1_rec->length != t2_rec->length || t1_rec->null_bit != t2_rec->null_bit) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d537da7080b..66b68cfc2f1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4653,8 +4653,14 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, new_field->length++; } break; - case FIELD_TYPE_STRING: case FIELD_TYPE_VAR_STRING: + if (new_field->length < 4) + { + new_field->sql_type= FIELD_TYPE_STRING; + break; + } + /* fall through */ + case FIELD_TYPE_STRING: if (new_field->length <= MAX_FIELD_CHARLENGTH || default_value) break; /* Convert long CHAR() and VARCHAR columns to TEXT or BLOB */ From cc9f55767f22848396591ff7eaa4453799be9347 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 16:43:45 +0100 Subject: [PATCH 132/789] Bug#25460 - High concurrency MyISAM access causes severe mysqld crash. The previous two patches for this bug worked together so that no permanent table was memory mapped. The first patch tried to avoid mapping while a table is in use. It allowed mapping only if there was exactly one lock on the table, assuming that the calling thread owned it. During mi_open(), a different call to memory mapping was coded, which did not have this limitation. The second patch tried to remove the code duplication and just called mi_extra() from mi_open() an thus inherited the limitation. But on open, a thread does not have a lock on the table... A possible solution would be to check for zero or one lock. But since I learned that it is safe to memory map a file while normal file I/O is done on it, I removed the restriction altogether and allow to memory map while a table is in use. No test case. I do not see a chance to verify with the test suite which kind of I/O is used on a table. storage/myisam/mi_extra.c: Bug#25460 - High concurrency MyISAM access causes severe mysqld crash. Allow to memory map while table is in use. --- storage/myisam/mi_extra.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index ae584b06173..729174b6f88 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -350,11 +350,13 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) #ifdef HAVE_MMAP pthread_mutex_lock(&share->intern_lock); /* - Memory map the data file if it is not already mapped and if there - are no other threads using this table. intern_lock prevents other - threads from starting to use the table while we are mapping it. + Memory map the data file if it is not already mapped. It is safe + to memory map a file while other threads are using file I/O on it. + Assigning a new address to a function pointer is an atomic + operation. intern_lock prevents that two or more mappings are done + at the same time. */ - if (!share->file_map && (share->tot_locks == 1)) + if (!share->file_map) { if (mi_dynmap_file(info, share->state.state.data_file_length)) { From b1af9693e0f5561142ae6ab1c55ac93de9abf6e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 10:27:59 -0700 Subject: [PATCH 133/789] Added comment, and fixed test. client/mysqlslap.c: Comment added (and extended if() so that I didn't have to keep looking at it to make sure it was right). --- client/mysqlslap.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 1976c54c393..1dc49aa06f3 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1034,16 +1034,19 @@ get_options(int *argc,char ***argv) exit(1); } - if (auto_generate_sql && - ((auto_generate_sql_autoincrement == FALSE) || - (auto_generate_sql_guid_primary == FALSE)) && - auto_generate_sql_type[0] == 'k') - { + /* + We are testing to make sure that if someone specified a key search + that we actually added a key! + */ + if (auto_generate_sql && auto_generate_sql_type[0] == 'k') + if ( auto_generate_sql_autoincrement == FALSE && + auto_generate_sql_guid_primary == FALSE) + { fprintf(stderr, "%s: Can't perform key test without a primary key!\n", my_progname); exit(1); - } + } From fa57a563ce66f4b024da4b50ea4109bf0d45e202 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 21:15:29 +0300 Subject: [PATCH 134/789] Fix the bug introduced with the push of the fix for bug#18326: Do not lock table for writing during prepare of statement. When single call open_normal_and_derived_tables() was used, we never set table_count to the right value. This patch reverts the part of the old code that does open_tables() (and sets table_count), then checks if table_list->multitable_view is set (and returns if so, using table_count value), and only then it does mysql_handle_derived(). --- sql/sql_prepare.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 109c03742d1..292f9ebd344 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1142,7 +1142,7 @@ static int mysql_test_update(Prepared_statement *stmt, DBUG_ENTER("mysql_test_update"); if (update_precheck(thd, table_list) || - open_normal_and_derived_tables(thd, table_list, 0)) + open_tables(thd, &table_list, &table_count, 0)) goto error; if (table_list->multitable_view) @@ -1155,6 +1155,13 @@ static int mysql_test_update(Prepared_statement *stmt, DBUG_RETURN(2); } + /* + thd->fill_derived_tables() is false here for sure (because it is + preparation of PS, so we even do not check it). + */ + if (mysql_handle_derived(thd->lex, &mysql_derived_prepare)) + goto error; + #ifndef NO_EMBEDDED_ACCESS_CHECKS /* TABLE_LIST contain right privilages request */ want_privilege= table_list->grant.want_privilege; From 6d98913be66c402b19e5827e2a69711cef68c66e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 11:58:24 -0700 Subject: [PATCH 135/789] Bug#25671 "CREATE/DROP/ALTER SERVER should require privileges" Add check for SUPER privilege when executing CREATE/DROP/ALTER SERVER. Previously, any user even with only USAGE priv can execute those commands. mysql-test/r/federated_server.result: Bug25671 - CREATE/DROP/ALTER SERVER should require privileges mysql-test/t/federated_server.test: Bug25671 - CREATE/DROP/ALTER SERVER should require privileges sql/sql_parse.cc: Bug25671 - CREATE/DROP/ALTER SERVER should require privileges Add check for SUPER privilege when executing CREATE/DROP/ALTER SERVER --- mysql-test/r/federated_server.result | 85 ++++++++++++++++++ mysql-test/t/federated_server.test | 127 +++++++++++++++++++++++++++ sql/sql_parse.cc | 12 +++ 3 files changed, 224 insertions(+) diff --git a/mysql-test/r/federated_server.result b/mysql-test/r/federated_server.result index 7a1a6e0970d..3682c0c793f 100644 --- a/mysql-test/r/federated_server.result +++ b/mysql-test/r/federated_server.result @@ -104,6 +104,91 @@ drop table first_db.t1; drop table second_db.t1; drop database first_db; drop database second_db; +create database db_legitimate; +create database db_bogus; +use db_legitimate; +CREATE TABLE db_legitimate.t1 ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ); +INSERT INTO db_legitimate.t1 VALUES ('1','this is legitimate'); +use db_bogus; +CREATE TABLE db_bogus.t1 ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ) +; +INSERT INTO db_bogus.t1 VALUES ('2','this is bogus'); +create server 's1' foreign data wrapper 'mysql' options +(HOST '127.0.0.1', +DATABASE 'db_legitimate', +USER 'root', +PASSWORD '', +PORT SLAVE_PORT, +SOCKET '', +OWNER 'root'); +create user guest_select@localhost; +grant select on federated.* to guest_select@localhost; +create user guest_super@localhost; +grant select,SUPER,RELOAD on *.* to guest_super@localhost; +create user guest_usage@localhost; +grant usage on *.* to guest_usage@localhost; +CREATE TABLE federated.t1 ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ) ENGINE = FEDERATED CONNECTION = 's1'; +select * from federated.t1; +id name +1 this is legitimate +alter server s1 options (database 'db_bogus'); +ERROR 42000: Access denied; you need the SUPER privilege for this operation +flush tables; +select * from federated.t1; +id name +1 this is legitimate +alter server s1 options (database 'db_bogus'); +ERROR 42000: Access denied; you need the SUPER privilege for this operation +flush tables; +select * from federated.t1; +id name +1 this is legitimate +alter server s1 options (database 'db_bogus'); +flush tables; +select * from federated.t1; +id name +2 this is bogus +drop server if exists 's1'; +ERROR 42000: Access denied; you need the SUPER privilege for this operation +create server 's1' foreign data wrapper 'mysql' options +(HOST '127.0.0.1', +DATABASE 'db_legitimate', +USER 'root', +PASSWORD '', +PORT SLAVE_PORT, +SOCKET '', +OWNER 'root'); +ERROR 42000: Access denied; you need the SUPER privilege for this operation +drop server 's1'; +create server 's1' foreign data wrapper 'mysql' options +(HOST '127.0.0.1', +DATABASE 'db_legitimate', +USER 'root', +PASSWORD '', +PORT SLAVE_PORT, +SOCKET '', +OWNER 'root'); +flush tables; +select * from federated.t1; +id name +1 this is legitimate +drop database db_legitimate; +drop database db_bogus; +drop user guest_super@localhost; +drop user guest_usage@localhost; +drop user guest_select@localhost; +drop table federated.t1; +drop server 's1'; +# End of 5.1 tests DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated_server.test b/mysql-test/t/federated_server.test index 3e47d9bc95d..e65f319f98d 100644 --- a/mysql-test/t/federated_server.test +++ b/mysql-test/t/federated_server.test @@ -107,4 +107,131 @@ drop table second_db.t1; drop database first_db; drop database second_db; +# +# Bug#25671 - CREATE/DROP/ALTER SERVER should require privileges +# +# Changes to SERVER declarations should require SUPER privilege. +# Based upon test case by Giuseppe Maxia + +create database db_legitimate; +create database db_bogus; + +use db_legitimate; +CREATE TABLE db_legitimate.t1 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ); +INSERT INTO db_legitimate.t1 VALUES ('1','this is legitimate'); + +use db_bogus; +CREATE TABLE db_bogus.t1 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) + ; +INSERT INTO db_bogus.t1 VALUES ('2','this is bogus'); + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create server 's1' foreign data wrapper 'mysql' options + (HOST '127.0.0.1', + DATABASE 'db_legitimate', + USER 'root', + PASSWORD '', + PORT $SLAVE_MYPORT, + SOCKET '', + OWNER 'root'); + +create user guest_select@localhost; +grant select on federated.* to guest_select@localhost; + +create user guest_super@localhost; +grant select,SUPER,RELOAD on *.* to guest_super@localhost; + +create user guest_usage@localhost; +grant usage on *.* to guest_usage@localhost; + +CREATE TABLE federated.t1 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) ENGINE = FEDERATED CONNECTION = 's1'; + +select * from federated.t1; + +connect (conn_select,127.0.0.1,guest_select,,federated,$MASTER_MYPORT); +connect (conn_usage,127.0.0.1,guest_usage,,,$MASTER_MYPORT); +connect (conn_super,127.0.0.1,guest_super,,,$MASTER_MYPORT); + +connection conn_select; +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +alter server s1 options (database 'db_bogus'); + +connection master; +flush tables; +select * from federated.t1; + +connection conn_usage; +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +alter server s1 options (database 'db_bogus'); + +connection master; +flush tables; +select * from federated.t1; + +connection conn_super; +alter server s1 options (database 'db_bogus'); + +connection master; +flush tables; +select * from federated.t1; + +connection conn_select; +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +drop server if exists 's1'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +eval create server 's1' foreign data wrapper 'mysql' options + (HOST '127.0.0.1', + DATABASE 'db_legitimate', + USER 'root', + PASSWORD '', + PORT $SLAVE_MYPORT, + SOCKET '', + OWNER 'root'); + +connection conn_super; +drop server 's1'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create server 's1' foreign data wrapper 'mysql' options + (HOST '127.0.0.1', + DATABASE 'db_legitimate', + USER 'root', + PASSWORD '', + PORT $SLAVE_MYPORT, + SOCKET '', + OWNER 'root'); + +connection master; +flush tables; +select * from federated.t1; + +# clean up test +connection slave; +drop database db_legitimate; +drop database db_bogus; + +disconnect conn_select; +disconnect conn_usage; +disconnect conn_super; + +connection master; +drop user guest_super@localhost; +drop user guest_usage@localhost; +drop user guest_select@localhost; +drop table federated.t1; +drop server 's1'; + + +--echo # End of 5.1 tests + source include/federated_cleanup.inc; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index bfcbd4663b4..6684b741464 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4273,6 +4273,10 @@ create_sp_error: int error; LEX *lex= thd->lex; DBUG_PRINT("info", ("case SQLCOM_CREATE_SERVER")); + + if (check_global_access(thd, SUPER_ACL)) + break; + if ((error= create_server(thd, &lex->server_options))) { DBUG_PRINT("info", ("problem creating server <%s>", @@ -4288,6 +4292,10 @@ create_sp_error: int error; LEX *lex= thd->lex; DBUG_PRINT("info", ("case SQLCOM_ALTER_SERVER")); + + if (check_global_access(thd, SUPER_ACL)) + break; + if ((error= alter_server(thd, &lex->server_options))) { DBUG_PRINT("info", ("problem altering server <%s>", @@ -4303,6 +4311,10 @@ create_sp_error: int err_code; LEX *lex= thd->lex; DBUG_PRINT("info", ("case SQLCOM_DROP_SERVER")); + + if (check_global_access(thd, SUPER_ACL)) + break; + if ((err_code= drop_server(thd, &lex->server_options))) { if (! lex->drop_if_exists && err_code == ER_FOREIGN_SERVER_EXISTS) From 2e1aac8a3990a7e152a652720649a12dd91c03f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Mar 2007 21:03:34 +0100 Subject: [PATCH 136/789] ndb - bug#27102 Make sure head after undo execute does not point to last page of file As this will confuse next write to group storage/ndb/src/kernel/blocks/lgman.cpp: Make sure head after undo execute does not point to last page of file As this will confuse next write to group --- storage/ndb/src/kernel/blocks/lgman.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp index d61dc422556..59b95f4e97f 100644 --- a/storage/ndb/src/kernel/blocks/lgman.cpp +++ b/storage/ndb/src/kernel/blocks/lgman.cpp @@ -2924,6 +2924,25 @@ Lgman::stop_run_undo_log(Signal* signal) ptr.p->m_file_pos[TAIL] = tail; init_logbuffer_pointers(ptr); + + { + Buffer_idx head= ptr.p->m_file_pos[HEAD]; + Ptr file; + m_file_pool.getPtr(file, head.m_ptr_i); + if (head.m_idx == file.p->m_file_size - 1) + { + Local_undofile_list files(m_file_pool, ptr.p->m_files); + if(!files.next(file)) + { + jam(); + files.first(file); + } + head.m_idx = 0; + head.m_ptr_i = file.i; + ptr.p->m_file_pos[HEAD] = head; + } + } + ptr.p->m_free_file_words = (Uint64)File_formats::UNDO_PAGE_WORDS * (Uint64)compute_free_file_pages(ptr); ptr.p->m_next_reply_ptr_i = ptr.p->m_file_pos[HEAD].m_ptr_i; From 8205e16c89135583a62e14a37579f7724151713a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 02:30:05 +0400 Subject: [PATCH 137/789] Removed tabs. --- myisam/mi_open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index f7edaf34494..274933679ef 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -1199,7 +1199,7 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup __attr int mi_open_keyfile(MYISAM_SHARE *share) { if ((share->kfile=my_open(share->unique_file_name, share->mode | O_SHARE, - MYF(MY_WME))) < 0) + MYF(MY_WME))) < 0) return 1; return 0; } From a22f257e042d3c88a3014eab77aee6a83b88642e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 11:54:20 +0200 Subject: [PATCH 138/789] Bug #26794: Different set of conditions is used to verify the validity of index definitions over a GEOMETRY column in ALTER TABLE and CREATE TABLE. The difference was on how sub-keys notion validity is checked. Fixed by extending the CREATE TABLE condition to support the cases allowed in ALTER TABLE. Made the SHOW CREATE TABLE not to display spatial indexes using the sub-key notion. mysql-test/r/alter_table.result: Bug #26794: test case mysql-test/r/gis-rtree.result: Bug #26794: fixed SHOW CREATE TABLE output. mysql-test/t/alter_table.test: Bug #26794: test case sql/field.cc: Bug #26794: Allow sub-keys for GEOMETRY sql/sql_show.cc: Bug #26794: Don't show sub-key notion in SHOW CREATE TABLE for SPATIAL indexes. sql/sql_table.cc: Bug #26794: Allow sub-keys for GEOMETRY --- mysql-test/r/alter_table.result | 34 +++++++++++++++++++++++++++++++++ mysql-test/r/gis-rtree.result | 4 ++-- mysql-test/t/alter_table.test | 23 ++++++++++++++++++++++ sql/field.cc | 1 + sql/sql_show.cc | 2 +- sql/sql_table.cc | 4 +++- 6 files changed, 64 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index d8de2655c6c..82c35ff963a 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -826,3 +826,37 @@ create table t1 (t varchar(255) default null, key t (t(80))) engine=myisam default charset=latin1; alter table t1 change t t text; drop table t1; +CREATE TABLE t1 (a varchar(500)); +ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(500) default NULL, + `b` geometry NOT NULL, + SPATIAL KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ADD KEY(b(50)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(500) default NULL, + `b` geometry NOT NULL, + SPATIAL KEY `b` (`b`), + KEY `b_2` (`b`(50)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ADD c POINT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(500) default NULL, + `b` geometry NOT NULL, + `c` point default NULL, + SPATIAL KEY `b` (`b`), + KEY `b_2` (`b`(50)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t2 (a INT, KEY (a(20))); +ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys +ALTER TABLE t1 ADD d INT; +ALTER TABLE t1 ADD KEY (d(20)); +ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys +DROP TABLE t1; diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 05d0d5634e6..4ca2bc98d82 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -10,7 +10,7 @@ t1 CREATE TABLE `t1` ( `fid` int(11) NOT NULL auto_increment, `g` geometry NOT NULL, PRIMARY KEY (`fid`), - SPATIAL KEY `g` (`g`(32)) + SPATIAL KEY `g` (`g`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)')); INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)')); @@ -293,7 +293,7 @@ t2 CREATE TABLE `t2` ( `fid` int(11) NOT NULL auto_increment, `g` geometry NOT NULL, PRIMARY KEY (`fid`), - SPATIAL KEY `g` (`g`(32)) + SPATIAL KEY `g` (`g`) ) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 SELECT count(*) FROM t2; count(*) diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 01f55931ca4..307138added 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -613,3 +613,26 @@ create table t1 (t varchar(255) default null, key t (t(80))) engine=myisam default charset=latin1; alter table t1 change t t text; drop table t1; + +# +# Bug #26794: Adding an index with a prefix on a SPATIAL type breaks ALTER +# TABLE +# +CREATE TABLE t1 (a varchar(500)); + +ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); +SHOW CREATE TABLE t1; +ALTER TABLE t1 ADD KEY(b(50)); +SHOW CREATE TABLE t1; + +ALTER TABLE t1 ADD c POINT; +SHOW CREATE TABLE t1; + +--error ER_WRONG_SUB_KEY +CREATE TABLE t2 (a INT, KEY (a(20))); + +ALTER TABLE t1 ADD d INT; +--error ER_WRONG_SUB_KEY +ALTER TABLE t1 ADD KEY (d(20)); + +DROP TABLE t1; diff --git a/sql/field.cc b/sql/field.cc index 981a877783f..0f8103b4046 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1011,6 +1011,7 @@ bool Field::type_can_have_key_part(enum enum_field_types type) case MYSQL_TYPE_BLOB: case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_STRING: + case MYSQL_TYPE_GEOMETRY: return TRUE; default: return FALSE; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c4b06934fc3..24aef80626f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -992,7 +992,7 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet) if (key_part->field && (key_part->length != table->field[key_part->fieldnr-1]->key_length() && - !(key_info->flags & HA_FULLTEXT))) + !(key_info->flags & (HA_FULLTEXT | HA_SPATIAL)))) { buff[0] = '('; char* end=int10_to_str((long) key_part->length / diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 512d990347f..38a22c47f12 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1344,6 +1344,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, } else if (!f_is_geom(sql_field->pack_flag) && (column->length > length || + !Field::type_can_have_key_part (sql_field->sql_type) || ((f_is_packed(sql_field->pack_flag) || ((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) && (key_info->flags & HA_NOSAME))) && @@ -3470,7 +3471,8 @@ view_err: checking whether cfield->length < key_part_length (in chars). */ if (!Field::type_can_have_key_part(cfield->field->type()) || - !Field::type_can_have_key_part(cfield->sql_type) || + (!Field::type_can_have_key_part(cfield->sql_type) && + !f_is_geom (cfield->pack_flag)) || (cfield->field->field_length == key_part_length && !f_is_blob(key_part->key_type)) || (cfield->length && (cfield->length < key_part_length / From 6e10a2048d6f022e0aaa65944c6cdd986977ba54 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 12:20:34 +0200 Subject: [PATCH 139/789] Bug #26794: 5.1 part It was syntactically correct to define spatial keys over parts of columns (e.g. ALTER TABLE t1 ADD x GEOMETRY NOT NULL, ADD SPATIAL KEY (x(32))). This may lead to undefined results and/or interpretation. Fixed by not allowing partial column specification in a SPATIAL index definition. mysql-test/r/alter_table.result: Bug #26794: 5.1 part test case mysql-test/r/gis-rtree.result: Bug #26794: 5.1 part updated the tests to the new syntax mysql-test/t/alter_table.test: Bug #26794: 5.1 part test case mysql-test/t/gis-rtree.test: Bug #26794: 5.1 part updated the tests to the new syntax sql/sql_table.cc: Bug #26794: 5.1 part Disable defining SPATIAL KEYS with sub-key parts --- mysql-test/r/alter_table.result | 10 ++++++---- mysql-test/r/gis-rtree.result | 6 +++--- mysql-test/t/alter_table.test | 4 ++++ mysql-test/t/gis-rtree.test | 6 +++--- sql/sql_table.cc | 8 ++++++++ 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index f90827929e5..fa18b58a927 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -886,7 +886,7 @@ ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(500) default NULL, + `a` varchar(500) DEFAULT NULL, `b` geometry NOT NULL, SPATIAL KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -894,7 +894,7 @@ ALTER TABLE t1 ADD KEY(b(50)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(500) default NULL, + `a` varchar(500) DEFAULT NULL, `b` geometry NOT NULL, SPATIAL KEY `b` (`b`), KEY `b_2` (`b`(50)) @@ -903,9 +903,9 @@ ALTER TABLE t1 ADD c POINT; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(500) default NULL, + `a` varchar(500) DEFAULT NULL, `b` geometry NOT NULL, - `c` point default NULL, + `c` point DEFAULT NULL, SPATIAL KEY `b` (`b`), KEY `b_2` (`b`(50)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -914,6 +914,8 @@ ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used ALTER TABLE t1 ADD d INT; ALTER TABLE t1 ADD KEY (d(20)); ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys +ALTER TABLE t1 ADD e GEOMETRY NOT NULL, ADD SPATIAL KEY (e(30)); +ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys DROP TABLE t1; CREATE TABLE t1 (s CHAR(8) BINARY); INSERT INTO t1 VALUES ('test'); diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 4a0f5d9b2eb..a1fd657b361 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -803,7 +803,7 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1, t2; -CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; Warnings: Warning 1101 BLOB/TEXT column 'geometry' can't have a default value INSERT INTO t1 (geometry) VALUES @@ -820,7 +820,7 @@ test.t1 check status OK drop table t1; CREATE TABLE t1 ( c1 geometry NOT NULL default '', -SPATIAL KEY i1 (c1(32)) +SPATIAL KEY i1 (c1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Warnings: Warning 1101 BLOB/TEXT column 'c1' can't have a default value @@ -836,7 +836,7 @@ test.t1 check status OK DROP TABLE t1; CREATE TABLE t1 ( c1 geometry NOT NULL default '', -SPATIAL KEY i1 (c1(32)) +SPATIAL KEY i1 (c1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Warnings: Warning 1101 BLOB/TEXT column 'c1' can't have a default value diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 5844119ac92..b8ba35b78ca 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -662,6 +662,10 @@ ALTER TABLE t1 ADD d INT; --error ER_WRONG_SUB_KEY ALTER TABLE t1 ADD KEY (d(20)); +# the 5.1 part of the test +--error ER_WRONG_SUB_KEY +ALTER TABLE t1 ADD e GEOMETRY NOT NULL, ADD SPATIAL KEY (e(30)); + DROP TABLE t1; # diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 1704fe7dc80..90af71929ca 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -172,7 +172,7 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); INSERT INTO t2 SELECT GeomFromText(st) FROM t1; drop table t1, t2; -CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO t1 (geometry) VALUES (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 @@ -192,7 +192,7 @@ drop table t1; # CREATE TABLE t1 ( c1 geometry NOT NULL default '', - SPATIAL KEY i1 (c1(32)) + SPATIAL KEY i1 (c1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, @@ -206,7 +206,7 @@ DROP TABLE t1; # CREATE TABLE t1 ( c1 geometry NOT NULL default '', - SPATIAL KEY i1 (c1(32)) + SPATIAL KEY i1 (c1) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 177b568746a..328830f5db2 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2791,6 +2791,12 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, { column->length*= sql_field->charset->mbmaxlen; + if (key->type == Key::SPATIAL && column->length) + { + my_error(ER_WRONG_SUB_KEY, MYF(0)); + DBUG_RETURN(-1); + } + if (f_is_blob(sql_field->pack_flag) || (f_is_geom(sql_field->pack_flag) && key->type != Key::SPATIAL)) { @@ -5861,6 +5867,8 @@ view_err: if (!Field::type_can_have_key_part(cfield->field->type()) || (!Field::type_can_have_key_part(cfield->sql_type) && !f_is_geom (cfield->pack_flag)) || + /* spatial keys can't have sub-key length */ + (key_info->flags & HA_SPATIAL) || (cfield->field->field_length == key_part_length && !f_is_blob(key_part->key_type)) || (cfield->length && (cfield->length < key_part_length / From 7e4252809c19e76c382dbb45e6419e590622a9f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 11:22:11 +0100 Subject: [PATCH 140/789] ndb - bug#27087 Make sure not to handle API_FAILREQ if it's already handled storage/ndb/src/kernel/blocks/suma/Suma.cpp: Make sure not to handle API_FAILREQ if it's already handled --- storage/ndb/src/kernel/blocks/suma/Suma.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index b201d05726d..9ad530b6591 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -578,6 +578,18 @@ void Suma::execAPI_FAILREQ(Signal* signal) return; } + if (c_failedApiNodes.get(failedApiNode)) + { + jam(); + return; + } + + if (!c_subscriber_nodes.get(failedApiNode)) + { + jam(); + return; + } + c_failedApiNodes.set(failedApiNode); c_connected_nodes.clear(failedApiNode); bool found = removeSubscribersOnNode(signal, failedApiNode); @@ -591,9 +603,12 @@ void Suma::execAPI_FAILREQ(Signal* signal) Ptr gcp; for(c_gcp_list.first(gcp); !gcp.isNull(); c_gcp_list.next(gcp)) { + jam(); ack->rep.gci = gcp.p->m_gci; if(gcp.p->m_subscribers.get(failedApiNode)) { + jam(); + gcp.p->m_subscribers.clear(failedApiNode); ack->rep.senderRef = numberToRef(0, failedApiNode); sendSignal(SUMA_REF, GSN_SUB_GCP_COMPLETE_ACK, signal, SubGcpCompleteAck::SignalLength, JBB); From 7a3148a7aa6891751be66572c1de9534b3a299fc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 12:15:14 +0100 Subject: [PATCH 141/789] Bug #24778: Innodb: No result when using ORDER BY This bug was intruduced by the fix for bug#17212 (in 4.1). It is not ok to call test_if_skip_sort_order since this function will alter the execution plan. By contract it is not ok to call test_if_skip_sort_order in this context. This bug appears only in the case when the optimizer has chosen an index for accessing a particular table but finds a covering index that enables it to skip ORDER BY. This happens in test_if_skip_sort_order. mysql-test/r/key.result: Bug#24778 test case. The bug causes the result to be the empty set. mysql-test/t/key.test: Bug#24778 The minimal test case that reveals the bug. The reason for such a complicated schema is that we have to convince the optimizer to pick one index, then discard it in order to be able to skip ORDER BY. sql/sql_select.cc: bug#24778 Removed the call to test_if_skip_sort_order that constituted the bug. --- mysql-test/r/key.result | 41 +++++++++++++++++++++++++++++++++++ mysql-test/t/key.test | 48 +++++++++++++++++++++++++++++++++++++++++ sql/sql_select.cc | 5 +---- 3 files changed, 90 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 853b837c46e..e348a387252 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -489,3 +489,44 @@ EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 drop table t1; +CREATE TABLE t1 ( +a INTEGER auto_increment PRIMARY KEY, +b INTEGER NOT NULL, +c INTEGER NOT NULL, +d CHAR(64) +); +CREATE TABLE t2 ( +a INTEGER auto_increment PRIMARY KEY, +b INTEGER NOT NULL, +c SMALLINT NOT NULL, +d DATETIME NOT NULL, +e SMALLINT NOT NULL, +f INTEGER NOT NULL, +g INTEGER NOT NULL, +h SMALLINT NOT NULL, +i INTEGER NOT NULL, +j INTEGER NOT NULL, +UNIQUE INDEX (b), +INDEX (b, d, e, f, g, h, i, j, c), +INDEX (c) +); +INSERT INTO t2 VALUES +(NULL, 1, 254, '1000-01-01 00:00:00', 257, 0, 0, 0, 0, 0), +(NULL, 2, 1, '2004-11-30 12:00:00', 1, 0, 0, 0, 0, 0), +(NULL, 3, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -21600, 0), +(NULL, 4, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -10800, 0), +(NULL, 5, 1, '2004-11-30 12:00:00', 1, 0, 0, 5, -10800, 0), +(NULL, 6, 1, '2004-11-30 12:00:00', 102, 0, 0, 0, 0, 0), +(NULL, 7, 1, '2004-11-30 12:00:00', 105, 2, 0, 0, 0, 0), +(NULL, 8, 1, '2004-11-30 12:00:00', 105, 10, 0, 0, 0, 0); +INSERT INTO t1 (b, c, d) VALUES +(3388000, -553000, NULL), +(3388000, -553000, NULL); +SELECT * +FROM t2 c JOIN t1 pa ON c.b = pa.a +WHERE c.c = 1 +ORDER BY c.b, c.d +; +a b c d e f g h i j a b c d +2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL +DROP TABLE t1, t2; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 1a53344c8ef..99736e0f11f 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -453,3 +453,51 @@ ALTER TABLE t1 DISABLE KEYS; EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a); drop table t1; + +# +# Bug #24778: Innodb: No result when using ORDER BY +# +CREATE TABLE t1 ( + a INTEGER auto_increment PRIMARY KEY, + b INTEGER NOT NULL, + c INTEGER NOT NULL, + d CHAR(64) +); + +CREATE TABLE t2 ( + a INTEGER auto_increment PRIMARY KEY, + b INTEGER NOT NULL, + c SMALLINT NOT NULL, + d DATETIME NOT NULL, + e SMALLINT NOT NULL, + f INTEGER NOT NULL, + g INTEGER NOT NULL, + h SMALLINT NOT NULL, + i INTEGER NOT NULL, + j INTEGER NOT NULL, + UNIQUE INDEX (b), + INDEX (b, d, e, f, g, h, i, j, c), + INDEX (c) +); + +INSERT INTO t2 VALUES + (NULL, 1, 254, '1000-01-01 00:00:00', 257, 0, 0, 0, 0, 0), + (NULL, 2, 1, '2004-11-30 12:00:00', 1, 0, 0, 0, 0, 0), + (NULL, 3, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -21600, 0), + (NULL, 4, 1, '2004-11-30 12:00:00', 1, 0, 0, 2, -10800, 0), + (NULL, 5, 1, '2004-11-30 12:00:00', 1, 0, 0, 5, -10800, 0), + (NULL, 6, 1, '2004-11-30 12:00:00', 102, 0, 0, 0, 0, 0), + (NULL, 7, 1, '2004-11-30 12:00:00', 105, 2, 0, 0, 0, 0), + (NULL, 8, 1, '2004-11-30 12:00:00', 105, 10, 0, 0, 0, 0); + +INSERT INTO t1 (b, c, d) VALUES + (3388000, -553000, NULL), + (3388000, -553000, NULL); + +SELECT * +FROM t2 c JOIN t1 pa ON c.b = pa.a +WHERE c.c = 1 +ORDER BY c.b, c.d +; + +DROP TABLE t1, t2; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5029ae2cf22..efdedcc5e84 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6106,10 +6106,7 @@ make_join_readinfo(JOIN *join, ulonglong options) */ if (!ordered_set && (table == join->sort_by_table && - (!join->order || join->skip_sort_order || - test_if_skip_sort_order(tab, join->order, join->select_limit, - 1, &table->keys_in_use_for_order_by)) - ) || + (!join->order || join->skip_sort_order)) || (join->sort_by_table == (TABLE *) 1 && i != join->const_tables)) ordered_set= 1; From f0c50440966778b8e084f2ab6f9119dc177a4da7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 13:32:12 +0200 Subject: [PATCH 142/789] WL#3527 : inspected a 5.1 covarage report sql/item.cc: WL#3527 : inspected a covarage report --- sql/item.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/item.cc b/sql/item.cc index dcedfcb6d84..5c032e3356f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3907,7 +3907,9 @@ bool Item_field::fix_fields(THD *thd, Item **reference) { /* First usage of column */ table->used_fields++; // Used to optimize loops + /* purecov: begin inspected */ table->covering_keys.intersect(field->part_of_key); + /* purecov: end */ } } } From 0f7f7ff84574b49bf89d7427333bfa14523479df Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 14:27:46 +0100 Subject: [PATCH 143/789] configure.in: Added test for sched_yield() possibly in -lposix4 on Solaris configure.in: Added test for sched_yield() possibly in -lposix4 on Solaris --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index 7b31057f6d3..7e7431465a8 100644 --- a/configure.in +++ b/configure.in @@ -772,6 +772,9 @@ AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind)) AC_CHECK_LIB(crypt, crypt) AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT)) +# For the sched_yield() function on Solaris +AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield)) + # For compress in zlib case $SYSTEM_TYPE in *netware* | *modesto*) From ff810fb952f5f104337ea2614c96387e4c44918c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 15:58:14 +0200 Subject: [PATCH 144/789] Bug #26794: fixed valgrind warning --- sql/sql_table.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 38a22c47f12..14b9e0aa25d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3471,8 +3471,7 @@ view_err: checking whether cfield->length < key_part_length (in chars). */ if (!Field::type_can_have_key_part(cfield->field->type()) || - (!Field::type_can_have_key_part(cfield->sql_type) && - !f_is_geom (cfield->pack_flag)) || + !Field::type_can_have_key_part(cfield->sql_type) || (cfield->field->field_length == key_part_length && !f_is_blob(key_part->key_type)) || (cfield->length && (cfield->length < key_part_length / From ee05abd661c57f300ff283c3be92af063521361d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 15:37:47 +0100 Subject: [PATCH 145/789] ndb - bug#27005 Handle API failure during resend API failure could cause release of table object, which will make resend crash when dereferencing table object Solution, use table_id+hash+schemaversion instead of *raw* pointer in resend storage/ndb/src/kernel/blocks/suma/Suma.cpp: Handle API failure during resend API failure could cause release of table object, which will make resend crash when dereferencing table object Solution, use table_id+hash+schemaversion instead of *raw* pointer in resend storage/ndb/test/tools/listen.cpp: add new events --- storage/ndb/src/kernel/blocks/suma/Suma.cpp | 78 +++++++++++++-------- storage/ndb/test/tools/listen.cpp | 8 ++- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index 9ad530b6591..407280638d9 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -756,6 +756,17 @@ Suma::execNODE_FAILREP(Signal* signal){ Restart.resetRestart(signal); } + if (ERROR_INSERTED(13032)) + { + Uint32 node = c_subscriber_nodes.find(0); + if (node != NodeBitmask::NotFound) + { + ndbout_c("Inserting API_FAILREQ node: %u", node); + signal->theData[0] = node; + EXECUTE_DIRECT(QMGR, GSN_API_FAILREQ, signal, 1); + } + } + signal->theData[0] = SumaContinueB::RESEND_BUCKET; NdbNodeBitmask tmp; @@ -3460,7 +3471,10 @@ Suma::execFIRE_TRIG_ORD(Signal* signal) */ f_bufferLock = 0; b_bufferLock = 0; - + + ndbrequire((tabPtr.p = c_tablePool.getPtr(tabPtr.i)) != 0); + Uint32 tableId = tabPtr.p->m_tableId; + Uint32 bucket= hashValue % c_no_of_buckets; m_max_seen_gci = (gci > m_max_seen_gci ? gci : m_max_seen_gci); if(m_active_buckets.get(bucket) || @@ -3483,7 +3497,7 @@ Suma::execFIRE_TRIG_ORD(Signal* signal) SubTableData * data = (SubTableData*)signal->getDataPtrSend();//trg; data->gci = gci; - data->tableId = tabPtr.p->m_tableId; + data->tableId = tableId; data->requestInfo = 0; SubTableData::setOperation(data->requestInfo, event); data->logType = 0; @@ -3506,10 +3520,11 @@ Suma::execFIRE_TRIG_ORD(Signal* signal) else { Uint32* dst; - Uint32 sz = f_trigBufferSize + b_trigBufferSize + 2; + Uint32 sz = f_trigBufferSize + b_trigBufferSize + 3; if((dst = get_buffer_ptr(signal, bucket, gci, sz))) { - * dst++ = tabPtr.i; + * dst++ = tableId; + * dst++ = tabPtr.p->m_schemaVersion; * dst++ = (event << 16) | f_trigBufferSize; memcpy(dst, f_buffer, f_trigBufferSize << 2); dst += f_trigBufferSize; @@ -3641,7 +3656,7 @@ Suma::execSUB_GCP_COMPLETE_REP(Signal* signal) if(c_buckets[i].m_buffer_tail != RNIL) { - Uint32* dst; + //Uint32* dst; get_buffer_ptr(signal, i, gci, 0); } } @@ -3986,8 +4001,8 @@ void Suma::completeSubRemove(SubscriptionPtr subPtr) { DBUG_ENTER("Suma::completeSubRemove"); - Uint32 subscriptionId = subPtr.p->m_subscriptionId; - Uint32 subscriptionKey = subPtr.p->m_subscriptionKey; + //Uint32 subscriptionId = subPtr.p->m_subscriptionId; + //Uint32 subscriptionKey = subPtr.p->m_subscriptionKey; c_subscriptions.release(subPtr); DBUG_PRINT("info",("c_subscriptionPool size: %d free: %d", @@ -5003,43 +5018,48 @@ Suma::resend_bucket(Signal* signal, Uint32 buck, Uint32 min_gci, { g_cnt++; Uint32 table = * src++ ; + Uint32 schemaVersion = * src++; Uint32 event = * src >> 16; Uint32 sz_1 = (* src ++) & 0xFFFF; - - ndbassert(sz - 2 >= sz_1); + + ndbassert(sz - 3 >= sz_1); LinearSectionPtr ptr[3]; const Uint32 nptr= reformat(signal, ptr, src, sz_1, - src + sz_1, sz - 2 - sz_1); + src + sz_1, sz - 3 - sz_1); Uint32 ptrLen= 0; for(Uint32 i =0; i < nptr; i++) ptrLen+= ptr[i].sz; + /** * Signal to subscriber(s) */ Ptr tabPtr; - ndbrequire((tabPtr.p = c_tablePool.getPtr(table)) != 0); - - SubTableData * data = (SubTableData*)signal->getDataPtrSend();//trg; - data->gci = last_gci; - data->tableId = tabPtr.p->m_tableId; - data->requestInfo = 0; - SubTableData::setOperation(data->requestInfo, event); - data->logType = 0; - data->changeMask = 0; - data->totalLen = ptrLen; - + if (c_tables.find(tabPtr, table) && + tabPtr.p->m_schemaVersion == schemaVersion) { - LocalDLList list(c_subscriberPool,tabPtr.p->c_subscribers); - SubscriberPtr subbPtr; - for(list.first(subbPtr); !subbPtr.isNull(); list.next(subbPtr)) + SubTableData * data = (SubTableData*)signal->getDataPtrSend();//trg; + data->gci = last_gci; + data->tableId = table; + data->requestInfo = 0; + SubTableData::setOperation(data->requestInfo, event); + data->logType = 0; + data->changeMask = 0; + data->totalLen = ptrLen; + { - DBUG_PRINT("info",("GSN_SUB_TABLE_DATA to node %d", - refToNode(subbPtr.p->m_senderRef))); - data->senderData = subbPtr.p->m_senderData; - sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal, - SubTableData::SignalLength, JBB, ptr, nptr); + LocalDLList + list(c_subscriberPool,tabPtr.p->c_subscribers); + SubscriberPtr subbPtr; + for(list.first(subbPtr); !subbPtr.isNull(); list.next(subbPtr)) + { + DBUG_PRINT("info",("GSN_SUB_TABLE_DATA to node %d", + refToNode(subbPtr.p->m_senderRef))); + data->senderData = subbPtr.p->m_senderData; + sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal, + SubTableData::SignalLength, JBB, ptr, nptr); + } } } } diff --git a/storage/ndb/test/tools/listen.cpp b/storage/ndb/test/tools/listen.cpp index 3e2bc03857a..661193bf4b8 100644 --- a/storage/ndb/test/tools/listen.cpp +++ b/storage/ndb/test/tools/listen.cpp @@ -168,9 +168,15 @@ main(int argc, const char** argv){ break; case NdbDictionary::Event::TE_DROP: break; + case NdbDictionary::Event::TE_NODE_FAILURE: + break; + case NdbDictionary::Event::TE_SUBSCRIBE: + case NdbDictionary::Event::TE_UNSUBSCRIBE: + break; default: /* We should REALLY never get here. */ - ndbout_c("Error: unknown event type"); + ndbout_c("Error: unknown event type: %u", + (Uint32)pOp->getEventType()); abort(); } } while ((pOp= MyNdb.nextEvent()) && gci == pOp->getGCI()); From 7e237e4f356e0970671b5d2db1e3bbaf689f0542 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 17:07:48 +0200 Subject: [PATCH 146/789] Bug #26794: fixed valgrind warning --- sql/sql_table.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 328830f5db2..1af76ad1086 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5865,8 +5865,7 @@ view_err: checking whether cfield->length < key_part_length (in chars). */ if (!Field::type_can_have_key_part(cfield->field->type()) || - (!Field::type_can_have_key_part(cfield->sql_type) && - !f_is_geom (cfield->pack_flag)) || + !Field::type_can_have_key_part(cfield->sql_type) || /* spatial keys can't have sub-key length */ (key_info->flags & HA_SPATIAL) || (cfield->field->field_length == key_part_length && From 3c89dd7966e727d7ded902b195d8f133de94b565 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 16:27:37 +0100 Subject: [PATCH 147/789] Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" In difficult optimize/repair situations the server could crash. Under some circumstances the server retries an optimize/repair with more elaborate options. But it did not check if the first attempt failed so badly that a second one must not be tried. This could happen when a new data file has been created but it was not possible to open it. In this case the repair leaves behind a table with closed data file. This must not be used for another repair attempt. We do now detect the closed data file and do not try another repair attempt in this situation. No test case. The required table corruption can not be repeated easily. There is a test program attached to bug 25433. sql/ha_myisam.cc: Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" Added code to detect a closed data file. It could be closed by a preceeding repair attempt. We must not try another repair then. --- sql/ha_myisam.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 2cec03a51db..42be008de9e 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -867,6 +867,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) ha_rows rows= file->state->records; DBUG_ENTER("ha_myisam::repair"); + /* + Normally this method is entered with a properly opened table. If the + repair fails, it can be repeated with more elaborate options. Under + special circumstances it can happen that a repair fails so that it + closed the data file and cannot re-open it. In this case file->dfile + is set to -1. We must not try another repair without an open data + file. (Bug #25289) + */ + if (file->dfile == -1) + { + sql_print_information("Retrying repair of: '%s' failed. " + "Please try REPAIR EXTENDED or myisamchk", + table->path); + DBUG_RETURN(HA_ADMIN_FAILED); + } + param.db_name = table->table_cache_key; param.table_name = table->table_name; param.tmpfile_createflag = O_RDWR | O_TRUNC; From 480a4ef94c1525f1f87f4ef683684434f6ffb531 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 18:18:30 +0200 Subject: [PATCH 148/789] merge 5.0->5.1 --- mysql-test/r/alter_table.result | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index f2317961e99..fa18b58a927 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -886,7 +886,7 @@ ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(500) default NULL, + `a` varchar(500) DEFAULT NULL, `b` geometry NOT NULL, SPATIAL KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -894,7 +894,7 @@ ALTER TABLE t1 ADD KEY(b(50)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(500) default NULL, + `a` varchar(500) DEFAULT NULL, `b` geometry NOT NULL, SPATIAL KEY `b` (`b`), KEY `b_2` (`b`(50)) @@ -903,9 +903,9 @@ ALTER TABLE t1 ADD c POINT; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(500) default NULL, + `a` varchar(500) DEFAULT NULL, `b` geometry NOT NULL, - `c` point default NULL, + `c` point DEFAULT NULL, SPATIAL KEY `b` (`b`), KEY `b_2` (`b`(50)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 From 377853e24f82472c7a0a8806b9f1fd3841b25050 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 18:28:16 +0100 Subject: [PATCH 149/789] EXCEPTIONS-CLIENT: Updated to version 0.6 of the text EXCEPTIONS-CLIENT: Updated to version 0.6 of the text --- EXCEPTIONS-CLIENT | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/EXCEPTIONS-CLIENT b/EXCEPTIONS-CLIENT index 19b86cab32b..c570ff7ba24 100644 --- a/EXCEPTIONS-CLIENT +++ b/EXCEPTIONS-CLIENT @@ -4,7 +4,7 @@ The MySQL AB Exception for Free/Libre and Open Source Software-only Applications Using MySQL Client Libraries (the "FLOSS Exception"). -Version 0.5, 30 August 2006 +Version 0.6, 7 March 2007 Exception Intent @@ -59,10 +59,12 @@ Apache Software License 1.0/1.1/2.0 Apple Public Source License 2.0 Artistic license From Perl 5.8.0 BSD license "July 22 1999" +Common Development and Distribution License (CDDL) 1.0 Common Public License 1.0 +Eclipse Public License 1.0 GNU Library or "Lesser" General Public License (LGPL) 2.0/2.1 Jabber Open Source License 1.0 -MIT license --- +MIT license (As listed in file MIT-License.txt) --- Mozilla Public License (MPL) 1.0/1.1 Open Software License 2.0 OpenSSL license (with original SSLeay license) "2003" ("1998") From 79344c7b673883bcde941c9c9fc9cc66c7114a39 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 12:02:32 -0600 Subject: [PATCH 150/789] Bug#26503 (Illegal SQL exception handler code causes the server to crash) Before this fix, the parser would accept illegal code in SQL exceptions handlers, that later causes the runtime to crash when executing the code, due to memory violations in the exception handler stack. The root cause of the problem is instructions within an exception handler that jumps to code located outside of the handler. This is illegal according to the SQL 2003 standard, since labels located outside the handler are not supposed to be visible (they are "out of scope"), so any instruction that jumps to these labels, like ITERATE or LEAVE, should not parse. The section of the standard that is relevant for this is : SQL:2003 SQL/PSM (ISO/IEC 9075-4:2003) section 13.1 , syntax rule 4 The scope of the is CS excluding every contained in CS and excluding every contained in CS. shall not be equivalent to any other s within that scope. With this fix, the C++ class sp_pcontext, which represent the "parsing context" tree (a.k.a symbol table) of a stored procedure, has been changed as follows: - constructors have been cleaned up, so that only building a root node for the tree is public; building nodes inside a tree is not public. - a new member, m_label_scope, indicates if a given syntactic context belongs to a DECLARE HANDLER block, - label resolution, in the method find_label(), has been changed to implement the restriction of scope regarding labels used in a compound statement. The actions in the parser, when parsing the body of a SQL exception handler, have been changed as follows: - the implementation of an exception handler (DECLARE HANDLER) now creates explicitly a new sp_pcontext, to isolate the code inside the handler from the containing compound statement context. - registering exception handlers as a result occurs in the parent context, see the rule sp_hcond_element - the code in sp_hcond_list has been cleaned up, to avoid code duplication In addition, the flags IN_SIMPLE_CASE and IN_HANDLER, declared in sp_head.h have been removed, since they are unused and broken by design (as seen with Bug 19194 (Right recursion in parser for CASE causes excessive stack usage, limitation), representing a stack in a single flag is not possible. Tests in sp-error have been added to show that illegal constructs are now rejected. Tests in sp have been added for code coverage, to show that ITERATE or LEAVE statements are legal when jumping to a label in scope, inside the body of an exception handler. mysql-test/r/sp-error.result: SQL Exception handlers define a parsing context for label resolution. mysql-test/r/sp.result: SQL Exception handlers define a parsing context for label resolution. mysql-test/t/sp-error.test: SQL Exception handlers define a parsing context for label resolution. mysql-test/t/sp.test: SQL Exception handlers define a parsing context for label resolution. sql/sp_head.cc: Minor cleanup sql/sp_head.h: Minor cleanup sql/sp_pcontext.cc: SQL Exception handlers define a parsing context for label resolution. sql/sp_pcontext.h: SQL Exception handlers define a parsing context for label resolution. sql/sql_yacc.yy: SQL Exception handlers define a parsing context for label resolution. --- mysql-test/r/sp-error.result | 52 +++++++++++ mysql-test/r/sp.result | 165 +++++++++++++++++++++++++++++++++++ mysql-test/t/sp-error.test | 68 +++++++++++++++ mysql-test/t/sp.test | 135 ++++++++++++++++++++++++++++ sql/sp_head.cc | 2 +- sql/sp_head.h | 2 - sql/sp_pcontext.cc | 90 ++++++++++++++----- sql/sp_pcontext.h | 61 ++++++++++--- sql/sql_yacc.yy | 43 ++++----- 9 files changed, 556 insertions(+), 62 deletions(-) diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 332d4fa4519..bdcb51c4db8 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1400,3 +1400,55 @@ drop table table_25345_b; drop procedure proc_25345; drop function func_25345; drop function func_25345_b; +create procedure proc_26503_error_1() +begin +retry: +repeat +begin +declare continue handler for sqlexception +begin +iterate retry; +end +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: ITERATE with no matching label: retry +create procedure proc_26503_error_2() +begin +retry: +repeat +begin +declare continue handler for sqlexception +iterate retry; +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: ITERATE with no matching label: retry +create procedure proc_26503_error_3() +begin +retry: +repeat +begin +declare continue handler for sqlexception +begin +leave retry; +end +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: LEAVE with no matching label: retry +create procedure proc_26503_error_4() +begin +retry: +repeat +begin +declare continue handler for sqlexception +leave retry; +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: LEAVE with no matching label: retry diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index afc3b95eb5f..fb8b7467746 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5805,4 +5805,169 @@ func_8407_b() 1500 drop function func_8407_a| drop function func_8407_b| +drop table if exists table_26503| +drop procedure if exists proc_26503_ok_1| +drop procedure if exists proc_26503_ok_2| +drop procedure if exists proc_26503_ok_3| +drop procedure if exists proc_26503_ok_4| +create table table_26503(a int unique)| +create procedure proc_26503_ok_1(v int) +begin +declare i int default 5; +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +iterate retry; +select 'dead code'; +end; +end while retry; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end| +create procedure proc_26503_ok_2(v int) +begin +declare i int default 5; +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +leave retry; +select 'dead code'; +end; +end while; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end| +create procedure proc_26503_ok_3(v int) +begin +declare i int default 5; +retry: +begin +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +iterate retry; +select 'dead code'; +end; +end while retry; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end; +end| +create procedure proc_26503_ok_4(v int) +begin +declare i int default 5; +retry: +begin +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +leave retry; +select 'dead code'; +end; +end while; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end; +end| +call proc_26503_ok_1(1)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +looping i +looping 3 +looping i +looping 2 +looping i +looping 1 +looping i +looping 0 +leaving handler +leaving handler +call proc_26503_ok_2(2)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +leaving handler +leaving handler +call proc_26503_ok_3(3)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +looping i +looping 3 +looping i +looping 2 +looping i +looping 1 +looping i +looping 0 +leaving handler +leaving handler +call proc_26503_ok_4(4)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +leaving handler +leaving handler +drop table table_26503| +drop procedure proc_26503_ok_1| +drop procedure proc_26503_ok_2| +drop procedure proc_26503_ok_3| +drop procedure proc_26503_ok_4| drop table t1,t2; diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 396c1552e37..9e5c795d586 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -2021,6 +2021,74 @@ drop procedure proc_25345; drop function func_25345; drop function func_25345_b; +# +# Bug#26503 (Illegal SQL exception handler code causes the server to crash) +# + +delimiter //; + +--error ER_SP_LILABEL_MISMATCH +create procedure proc_26503_error_1() +begin +retry: + repeat + begin + declare continue handler for sqlexception + begin + iterate retry; + end + + select "do something"; + end + until true end repeat retry; +end// + +--error ER_SP_LILABEL_MISMATCH +create procedure proc_26503_error_2() +begin +retry: + repeat + begin + declare continue handler for sqlexception + iterate retry; + + select "do something"; + end + until true end repeat retry; +end// + +--error ER_SP_LILABEL_MISMATCH +create procedure proc_26503_error_3() +begin +retry: + repeat + begin + declare continue handler for sqlexception + begin + leave retry; + end + + select "do something"; + end + until true end repeat retry; +end// + +--error ER_SP_LILABEL_MISMATCH +create procedure proc_26503_error_4() +begin +retry: + repeat + begin + declare continue handler for sqlexception + leave retry; + + select "do something"; + end + until true end repeat retry; +end// + +delimiter ;// + # # BUG#NNNN: New bug synopsis # diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 80fb1354b16..48e266bfbf6 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6800,6 +6800,141 @@ select func_8407_b()| drop function func_8407_a| drop function func_8407_b| +# +# Bug#26503 (Illegal SQL exception handler code causes the server to crash) +# + +--disable_warnings +drop table if exists table_26503| +drop procedure if exists proc_26503_ok_1| +drop procedure if exists proc_26503_ok_2| +drop procedure if exists proc_26503_ok_3| +drop procedure if exists proc_26503_ok_4| +--enable_warnings + +create table table_26503(a int unique)| + +create procedure proc_26503_ok_1(v int) +begin + declare i int default 5; + + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + iterate retry; + select 'dead code'; + end; + end while retry; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); +end| + +create procedure proc_26503_ok_2(v int) +begin + declare i int default 5; + + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + leave retry; + select 'dead code'; + end; + end while; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); +end| + +## The outer retry label should not prevent using the inner label. + +create procedure proc_26503_ok_3(v int) +begin + declare i int default 5; + +retry: + begin + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + iterate retry; + select 'dead code'; + end; + end while retry; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); + end; +end| + +## The outer retry label should not prevent using the inner label. + +create procedure proc_26503_ok_4(v int) +begin + declare i int default 5; + +retry: + begin + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + leave retry; + select 'dead code'; + end; + end while; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); + end; +end| + +call proc_26503_ok_1(1)| +call proc_26503_ok_2(2)| +call proc_26503_ok_3(3)| +call proc_26503_ok_4(4)| + +drop table table_26503| +drop procedure proc_26503_ok_1| +drop procedure proc_26503_ok_2| +drop procedure proc_26503_ok_3| +drop procedure proc_26503_ok_4| + # # NOTE: The delimiter is `|`, and not `;`. It is changed to `;` # at the end of the file! diff --git a/sql/sp_head.cc b/sql/sp_head.cc index c1643f0f82e..63ee37e1135 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -470,7 +470,7 @@ sp_head::init(LEX *lex) { DBUG_ENTER("sp_head::init"); - lex->spcont= m_pcont= new sp_pcontext(NULL); + lex->spcont= m_pcont= new sp_pcontext(); /* Altough trg_table_fields list is used only in triggers we init for all diff --git a/sql/sp_head.h b/sql/sp_head.h index 4ef4077cc79..901b7a19c39 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -107,8 +107,6 @@ public: /* Possible values of m_flags */ enum { HAS_RETURN= 1, // For FUNCTIONs only: is set if has RETURN - IN_SIMPLE_CASE= 2, // Is set if parsing a simple CASE - IN_HANDLER= 4, // Is set if the parser is in a handler body MULTI_RESULTS= 8, // Is set if a procedure with SELECT(s) CONTAINS_DYNAMIC_SQL= 16, // Is set if a procedure with PREPARE/EXECUTE IS_INVOKED= 32, // Is set if this sp_head is being used diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index 6229cf14604..780243cc79f 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -25,6 +25,11 @@ #include "sp_pcontext.h" #include "sp_head.h" +/* Initial size for the dynamic arrays in sp_pcontext */ +#define PCONTEXT_ARRAY_INIT_ALLOC 16 +/* Increment size for the dynamic arrays in sp_pcontext */ +#define PCONTEXT_ARRAY_INCREMENT_ALLOC 8 + /* Sanity check for SQLSTATEs. Will not check if it's really an existing state (there are just too many), but will check length and bad characters. @@ -49,28 +54,61 @@ sp_cond_check(LEX_STRING *sqlstate) return TRUE; } -sp_pcontext::sp_pcontext(sp_pcontext *prev) - :Sql_alloc(), m_max_var_index(0), m_max_cursor_index(0), m_max_handler_index(0), - m_context_handlers(0), m_parent(prev), m_pboundary(0) +sp_pcontext::sp_pcontext() + : Sql_alloc(), + m_max_var_index(0), m_max_cursor_index(0), m_max_handler_index(0), + m_context_handlers(0), m_parent(NULL), m_pboundary(0), + m_label_scope(LABEL_DEFAULT_SCOPE) { - VOID(my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *), 16, 8)); - VOID(my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int), 16, 8)); - VOID(my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *), 16, 8)); - VOID(my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING), 16, 8)); - VOID(my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *), 16, 8)); + VOID(my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); m_label.empty(); m_children.empty(); - if (!prev) - { - m_var_offset= m_cursor_offset= 0; - m_num_case_exprs= 0; - } - else - { - m_var_offset= prev->m_var_offset + prev->m_max_var_index; - m_cursor_offset= prev->current_cursor_count(); - m_num_case_exprs= prev->get_num_case_exprs(); - } + + m_var_offset= m_cursor_offset= 0; + m_num_case_exprs= 0; +} + +sp_pcontext::sp_pcontext(sp_pcontext *prev, label_scope_type label_scope) + : Sql_alloc(), + m_max_var_index(0), m_max_cursor_index(0), m_max_handler_index(0), + m_context_handlers(0), m_parent(prev), m_pboundary(0), + m_label_scope(label_scope) +{ + VOID(my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + VOID(my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *), + PCONTEXT_ARRAY_INIT_ALLOC, + PCONTEXT_ARRAY_INCREMENT_ALLOC)); + m_label.empty(); + m_children.empty(); + + m_var_offset= prev->m_var_offset + prev->m_max_var_index; + m_cursor_offset= prev->current_cursor_count(); + m_num_case_exprs= prev->get_num_case_exprs(); } void @@ -92,9 +130,9 @@ sp_pcontext::destroy() } sp_pcontext * -sp_pcontext::push_context() +sp_pcontext::push_context(label_scope_type label_scope) { - sp_pcontext *child= new sp_pcontext(this); + sp_pcontext *child= new sp_pcontext(this, label_scope); if (child) m_children.push_back(child); @@ -257,7 +295,15 @@ sp_pcontext::find_label(char *name) if (my_strcasecmp(system_charset_info, name, lab->name) == 0) return lab; - if (m_parent) + /* + Note about exception handlers. + See SQL:2003 SQL/PSM (ISO/IEC 9075-4:2003), + section 13.1 , + syntax rule 4. + In short, a DECLARE HANDLER block can not refer + to labels from the parent context, as they are out of scope. + */ + if (m_parent && (m_label_scope == LABEL_DEFAULT_SCOPE)) return m_parent->find_label(name); return NULL; } diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h index b2cdd5e689c..5bffda79f98 100644 --- a/sql/sp_pcontext.h +++ b/sql/sp_pcontext.h @@ -88,16 +88,33 @@ typedef struct sp_cond sp_cond_type_t *val; } sp_cond_t; +/** + The scope of a label in Stored Procedures, + for name resolution of labels in a parsing context. +*/ +enum label_scope_type +{ + /** + The labels declared in a parent context are in scope. + */ + LABEL_DEFAULT_SCOPE, + /** + The labels declared in a parent context are not in scope. + */ + LABEL_HANDLER_SCOPE +}; -/* - The parse-time context, used to keep track on declared variables/parameters, +/** + The parse-time context, used to keep track of declared variables/parameters, conditions, handlers, cursors and labels, during parsing. sp_contexts are organized as a tree, with one object for each begin-end - block, plus a root-context for the parameters. + block, one object for each exception handler, + plus a root-context for the parameters. This is used during parsing for looking up defined names (e.g. declared variables and visible labels), for error checking, and to calculate offsets to be used at runtime. (During execution variable values, active handlers and cursors, etc, are referred to by an index in a stack.) + Parsing contexts for exception handlers limit the visibility of labels. The pcontext tree is also kept during execution and is used for error checking (e.g. correct number of parameters), and in the future, used by the debugger. @@ -105,21 +122,30 @@ typedef struct sp_cond class sp_pcontext : public Sql_alloc { - sp_pcontext(const sp_pcontext &); /* Prevent use of these */ - void operator=(sp_pcontext &); +public: - public: - - sp_pcontext(sp_pcontext *prev); + /** + Constructor. + Builds a parsing context root node. + */ + sp_pcontext(); // Free memory void destroy(); + /** + Create and push a new context in the tree. + @param label_scope label scope for the new parsing context + @return the node created + */ sp_pcontext * - push_context(); + push_context(label_scope_type label_scope); - // Returns the previous context, not the one we pop + /** + Pop a node from the parsing context tree. + @return the parent node + */ sp_pcontext * pop_context(); @@ -363,6 +389,13 @@ class sp_pcontext : public Sql_alloc protected: + /** + Constructor for a tree node. + @param prev the parent parsing context + @param label_scope label_scope for this parsing context + */ + sp_pcontext(sp_pcontext *prev, label_scope_type label_scope); + /* m_max_var_index -- number of variables (including all types of arguments) in this context including all children contexts. @@ -416,6 +449,14 @@ private: List m_children; // Children contexts, used for destruction + /** + Scope of labels for this parsing context. + */ + label_scope_type m_label_scope; + +private: + sp_pcontext(const sp_pcontext &); /* Prevent use of these */ + void operator=(sp_pcontext &); }; // class sp_pcontext : public Sql_alloc diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d07234ff2bd..812482e8ffb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2006,6 +2006,9 @@ sp_decl: { LEX *lex= Lex; sp_head *sp= lex->sphead; + + lex->spcont= lex->spcont->push_context(LABEL_HANDLER_SCOPE); + sp_pcontext *ctx= lex->spcont; sp_instr_hpush_jump *i= new sp_instr_hpush_jump(sp->instructions(), ctx, $2, @@ -2013,7 +2016,6 @@ sp_decl: sp->add_instr(i); sp->push_backpatch(i, ctx->push_label((char *)"", 0)); - sp->m_flags|= sp_head::IN_HANDLER; } sp_hcond_list sp_proc_stmt { @@ -2037,10 +2039,12 @@ sp_decl: sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */ } lex->sphead->backpatch(hlab); - sp->m_flags&= ~sp_head::IN_HANDLER; + + lex->spcont= ctx->pop_context(); + $$.vars= $$.conds= $$.curs= 0; $$.hndlrs= $6; - ctx->add_handlers($6); + lex->spcont->add_handlers($6); } | DECLARE_SYM ident CURSOR_SYM FOR_SYM sp_cursor_stmt { @@ -2103,11 +2107,18 @@ sp_handler_type: ; sp_hcond_list: + sp_hcond_element + { $$= 1; } + | sp_hcond_list ',' sp_hcond_element + { $$+= 1; } + ; + +sp_hcond_element: sp_hcond { LEX *lex= Lex; sp_head *sp= lex->sphead; - sp_pcontext *ctx= lex->spcont; + sp_pcontext *ctx= lex->spcont->parent_context(); if (ctx->find_handler($1)) { @@ -2121,28 +2132,6 @@ sp_hcond_list: i->add_condition($1); ctx->push_handler($1); - $$= 1; - } - } - | sp_hcond_list ',' sp_hcond - { - LEX *lex= Lex; - sp_head *sp= lex->sphead; - sp_pcontext *ctx= lex->spcont; - - if (ctx->find_handler($3)) - { - my_message(ER_SP_DUP_HANDLER, ER(ER_SP_DUP_HANDLER), MYF(0)); - MYSQL_YYABORT; - } - else - { - sp_instr_hpush_jump *i= - (sp_instr_hpush_jump *)sp->last_instruction(); - - i->add_condition($3); - ctx->push_handler($3); - $$= $1 + 1; } } ; @@ -2687,7 +2676,7 @@ sp_unlabeled_control: sp_label_t *lab= lex->spcont->last_label(); lab->type= SP_LAB_BEGIN; - lex->spcont= lex->spcont->push_context(); + lex->spcont= lex->spcont->push_context(LABEL_DEFAULT_SCOPE); } sp_decls sp_proc_stmts From 2fad8ac2fce2f5d3645c676374f47aa2aa12d86a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2007 17:38:06 -0600 Subject: [PATCH 151/789] Manual merge from 5.0-runtime to 5.1-runtime --- include/my_global.h | 6 ++ mysql-test/r/sp-error.result | 52 +++++++++++ mysql-test/r/sp.result | 165 +++++++++++++++++++++++++++++++++++ mysql-test/t/sp.test | 135 ++++++++++++++++++++++++++++ sql/field.cc | 6 +- sql/sql_select.cc | 6 +- 6 files changed, 364 insertions(+), 6 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index c41ac8f915f..5661f77f9c2 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1486,4 +1486,10 @@ do { doubleget_union _tmp; \ #include #endif +/* Length of decimal number represented by INT32. */ +#define MY_INT32_NUM_DECIMAL_DIGITS 11 + +/* Length of decimal number represented by INT64. */ +#define MY_INT64_NUM_DECIMAL_DIGITS 21 + #endif /* my_global_h */ diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index a66bdfd2862..3dcdc46de2b 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1414,3 +1414,55 @@ ERROR 42000: This version of MySQL doesn't yet support 'return value collation' create function bug20701() returns varchar(25) return "test"; drop function bug20701; End of 5.1 tests +create procedure proc_26503_error_1() +begin +retry: +repeat +begin +declare continue handler for sqlexception +begin +iterate retry; +end +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: ITERATE with no matching label: retry +create procedure proc_26503_error_2() +begin +retry: +repeat +begin +declare continue handler for sqlexception +iterate retry; +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: ITERATE with no matching label: retry +create procedure proc_26503_error_3() +begin +retry: +repeat +begin +declare continue handler for sqlexception +begin +leave retry; +end +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: LEAVE with no matching label: retry +create procedure proc_26503_error_4() +begin +retry: +repeat +begin +declare continue handler for sqlexception +leave retry; +select "do something"; +end +until true end repeat retry; +end// +ERROR 42000: LEAVE with no matching label: retry diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 6c39b708e46..ce555b987cd 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5896,4 +5896,169 @@ func_8407_b() 1500 drop function func_8407_a| drop function func_8407_b| +drop table if exists table_26503| +drop procedure if exists proc_26503_ok_1| +drop procedure if exists proc_26503_ok_2| +drop procedure if exists proc_26503_ok_3| +drop procedure if exists proc_26503_ok_4| +create table table_26503(a int unique)| +create procedure proc_26503_ok_1(v int) +begin +declare i int default 5; +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +iterate retry; +select 'dead code'; +end; +end while retry; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end| +create procedure proc_26503_ok_2(v int) +begin +declare i int default 5; +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +leave retry; +select 'dead code'; +end; +end while; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end| +create procedure proc_26503_ok_3(v int) +begin +declare i int default 5; +retry: +begin +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +iterate retry; +select 'dead code'; +end; +end while retry; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end; +end| +create procedure proc_26503_ok_4(v int) +begin +declare i int default 5; +retry: +begin +declare continue handler for sqlexception +begin +select 'caught something'; +retry: +while i > 0 do +begin +set i = i - 1; +select 'looping', i; +leave retry; +select 'dead code'; +end; +end while; +select 'leaving handler'; +end; +select 'do something'; +insert into table_26503 values (v); +select 'do something again'; +insert into table_26503 values (v); +end; +end| +call proc_26503_ok_1(1)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +looping i +looping 3 +looping i +looping 2 +looping i +looping 1 +looping i +looping 0 +leaving handler +leaving handler +call proc_26503_ok_2(2)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +leaving handler +leaving handler +call proc_26503_ok_3(3)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +looping i +looping 3 +looping i +looping 2 +looping i +looping 1 +looping i +looping 0 +leaving handler +leaving handler +call proc_26503_ok_4(4)| +do something +do something +do something again +do something again +caught something +caught something +looping i +looping 4 +leaving handler +leaving handler +drop table table_26503| +drop procedure proc_26503_ok_1| +drop procedure proc_26503_ok_2| +drop procedure proc_26503_ok_3| +drop procedure proc_26503_ok_4| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 0ca1df8ff2b..d65bec48cc4 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6887,6 +6887,141 @@ select func_8407_b()| drop function func_8407_a| drop function func_8407_b| +# +# Bug#26503 (Illegal SQL exception handler code causes the server to crash) +# + +--disable_warnings +drop table if exists table_26503| +drop procedure if exists proc_26503_ok_1| +drop procedure if exists proc_26503_ok_2| +drop procedure if exists proc_26503_ok_3| +drop procedure if exists proc_26503_ok_4| +--enable_warnings + +create table table_26503(a int unique)| + +create procedure proc_26503_ok_1(v int) +begin + declare i int default 5; + + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + iterate retry; + select 'dead code'; + end; + end while retry; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); +end| + +create procedure proc_26503_ok_2(v int) +begin + declare i int default 5; + + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + leave retry; + select 'dead code'; + end; + end while; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); +end| + +## The outer retry label should not prevent using the inner label. + +create procedure proc_26503_ok_3(v int) +begin + declare i int default 5; + +retry: + begin + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + iterate retry; + select 'dead code'; + end; + end while retry; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); + end; +end| + +## The outer retry label should not prevent using the inner label. + +create procedure proc_26503_ok_4(v int) +begin + declare i int default 5; + +retry: + begin + declare continue handler for sqlexception + begin + select 'caught something'; + retry: + while i > 0 do + begin + set i = i - 1; + select 'looping', i; + leave retry; + select 'dead code'; + end; + end while; + select 'leaving handler'; + end; + + select 'do something'; + insert into table_26503 values (v); + select 'do something again'; + insert into table_26503 values (v); + end; +end| + +call proc_26503_ok_1(1)| +call proc_26503_ok_2(2)| +call proc_26503_ok_3(3)| +call proc_26503_ok_4(4)| + +drop table table_26503| +drop procedure proc_26503_ok_1| +drop procedure proc_26503_ok_2| +drop procedure proc_26503_ok_3| +drop procedure proc_26503_ok_4| + # # NOTE: The delimiter is `|`, and not `;`. It is changed to `;` # at the end of the file! diff --git a/sql/field.cc b/sql/field.cc index d406459b6c7..1d36b984653 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1207,13 +1207,13 @@ String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_val) { ASSERT_COLUMN_MARKED_FOR_READ; CHARSET_INFO *cs= &my_charset_bin; - uint length= 21; + uint length; longlong value= val_int(); - if (val_buffer->alloc(length)) + if (val_buffer->alloc(MY_INT64_NUM_DECIMAL_DIGITS)) return 0; length= (uint) (*cs->cset->longlong10_to_str)(cs, (char*) val_buffer->ptr(), - length, + MY_INT64_NUM_DECIMAL_DIGITS, unsigned_val ? 10 : -10, value); val_buffer->length(length); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2da2261d3e1..b07fa185939 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8675,7 +8675,7 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) if ((new_cond= new Item_func_eq(args[0], new Item_int("last_insert_id()", thd->read_first_successful_insert_id_in_prev_stmt(), - 21)))) + MY_INT64_NUM_DECIMAL_DIGITS)))) { cond=new_cond; /* @@ -8940,7 +8940,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, break; case INT_RESULT: /* Select an integer type with the minimal fit precision */ - if (item->max_length > 11) + if (item->max_length > MY_INT32_NUM_DECIMAL_DIGITS) new_field=new Field_longlong(item->max_length, maybe_null, item->name, item->unsigned_flag); else @@ -15255,7 +15255,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, examined_rows=(ha_rows)join->best_positions[i].records_read; item_list.push_back(new Item_int((longlong) (ulonglong) examined_rows, - 21)); + MY_INT64_NUM_DECIMAL_DIGITS)); /* Add "filtered" field to item_list. */ if (join->thd->lex->describe & DESCRIBE_EXTENDED) From 44e5052f7693ed38f1ced976157cff7d61b3779f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 07:08:15 +0100 Subject: [PATCH 152/789] ndb - fix test_event -n EventOperationApplier storage/ndb/test/ndbapi/test_event.cpp: fix potential race storage/ndb/test/src/HugoCalculator.cpp: genrate longer varsize keys --- storage/ndb/test/ndbapi/test_event.cpp | 14 +++++++++++--- storage/ndb/test/src/HugoCalculator.cpp | 25 +++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/storage/ndb/test/ndbapi/test_event.cpp b/storage/ndb/test/ndbapi/test_event.cpp index 5af3ff77df8..54ea88d143c 100644 --- a/storage/ndb/test/ndbapi/test_event.cpp +++ b/storage/ndb/test/ndbapi/test_event.cpp @@ -500,6 +500,12 @@ int runEventMixedLoad(NDBT_Context* ctx, NDBT_Step* step) int records = ctx->getNumRecords(); HugoTransactions hugoTrans(*ctx->getTab()); + if(ctx->getPropertyWait("LastGCI", ~(Uint32)0)) + { + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + while(loops -- && !ctx->isTestStopped()) { hugoTrans.clearTable(GETNDB(step), 0); @@ -606,9 +612,11 @@ int runEventApplier(NDBT_Context* ctx, NDBT_Step* step) goto end; } + ctx->setProperty("LastGCI", ~(Uint32)0); + ctx->broadcast(); + while(!ctx->isTestStopped()) { - int r; int count= 0; Uint32 stop_gci= ~0; Uint64 curr_gci = 0; @@ -778,7 +786,7 @@ int runEventApplier(NDBT_Context* ctx, NDBT_Step* step) if (trans->getNdbError().status == NdbError::PermanentError) { - g_err << "Ignoring execute " << r << " failed " + g_err << "Ignoring execute failed " << trans->getNdbError().code << " " << trans->getNdbError().message << endl; @@ -788,7 +796,7 @@ int runEventApplier(NDBT_Context* ctx, NDBT_Step* step) } else if (noRetries++ == 10) { - g_err << "execute " << r << " failed " + g_err << "execute failed " << trans->getNdbError().code << " " << trans->getNdbError().message << endl; trans->close(); diff --git a/storage/ndb/test/src/HugoCalculator.cpp b/storage/ndb/test/src/HugoCalculator.cpp index 4d05c99738f..1589d4a9eb0 100644 --- a/storage/ndb/test/src/HugoCalculator.cpp +++ b/storage/ndb/test/src/HugoCalculator.cpp @@ -89,6 +89,27 @@ HugoCalculator::float calcValue(int record, int attrib, int updates) const; HugoCalculator::double calcValue(int record, int attrib, int updates) const; #endif +static +Uint32 +calc_len(Uint32 rvalue, int maxlen) +{ + Uint32 minlen = 25; + + if ((rvalue >> 16) < 4096) + minlen = 15; + else if ((rvalue >> 16) < 8192) + minlen = 25; + else if ((rvalue >> 16) < 16384) + minlen = 35; + else + minlen = 64; + + if (maxlen <= minlen) + return maxlen; + + return minlen + (rvalue % (maxlen - minlen)); +} + const char* HugoCalculator::calcValue(int record, int attrib, @@ -178,7 +199,7 @@ HugoCalculator::calcValue(int record, break; case NdbDictionary::Column::Varbinary: case NdbDictionary::Column::Varchar: - len = 1 + (myRand(&seed) % (len - 1)); + len = calc_len(myRand(&seed), len - 1); assert(len < 256); * outlen = len + 1; * buf = len; @@ -186,7 +207,7 @@ HugoCalculator::calcValue(int record, goto write_char; case NdbDictionary::Column::Longvarchar: case NdbDictionary::Column::Longvarbinary: - len = 1 + (myRand(&seed) % (len - 2)); + len = calc_len(myRand(&seed), len - 2); assert(len < 65536); * outlen = len + 2; int2store(buf, len); From 9e5691cb331b98188ab3ffc324f9c3e3fa87cb0c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 12:06:06 +0400 Subject: [PATCH 153/789] Fix for bug #24558: Increasing decimal column length causes data loss Altering to a decimal field we get double value then store it that may cause data loss. Fix: use store_decimal() instead. mysql-test/r/type_newdecimal.result: Fix for bug #24558: Increasing decimal column length causes data loss - test result. mysql-test/t/type_newdecimal.test: Fix for bug #24558: Increasing decimal column length causes data loss - test case. sql/field_conv.cc: Fix for bug #24558: Increasing decimal column length causes data loss - if target field's result type is DECIMAL_RESULT use store_decimal(val_decimal()) in order not to loss data. --- mysql-test/r/type_newdecimal.result | 8 ++++++++ mysql-test/t/type_newdecimal.test | 11 +++++++++++ sql/field_conv.cc | 9 +++++++++ 3 files changed, 28 insertions(+) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index e65e76ded3f..359a929d9a3 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1423,3 +1423,11 @@ cast(19999999999999999999 as unsigned) 18446744073709551615 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' +create table t1(a decimal(18)); +insert into t1 values(123456789012345678); +alter table t1 modify column a decimal(19); +select * from t1; +a +123456789012345678 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index f315e88fd0e..4c6098d2121 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1120,3 +1120,14 @@ drop table t1; # select cast(19999999999999999999 as unsigned); +# +# Bug #24558: Increasing decimal column length causes data loss +# + +create table t1(a decimal(18)); +insert into t1 values(123456789012345678); +alter table t1 modify column a decimal(19); +select * from t1; +drop table t1; + +--echo End of 5.0 tests diff --git a/sql/field_conv.cc b/sql/field_conv.cc index dbe58d804ad..32180f0a93e 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -337,6 +337,13 @@ static void do_field_real(Copy_field *copy) } +static void do_field_decimal(Copy_field *copy) +{ + my_decimal value; + copy->to_field->store_decimal(copy->from_field->val_decimal(&value)); +} + + /* string copy for single byte characters set when to string is shorter than from string @@ -581,6 +588,8 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*) if (to->real_type() == FIELD_TYPE_BIT || from->real_type() == FIELD_TYPE_BIT) return do_field_int; + if (to->result_type() == DECIMAL_RESULT) + return do_field_decimal; // Check if identical fields if (from->result_type() == STRING_RESULT) { From db1d2f64d1b7f54b652a9c0b7778716a46599ec9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 11:30:17 +0300 Subject: [PATCH 154/789] Fix for bug #25966 "2MB per second endless memory consumption after LOCK TABLE ... WRITE". CPU hogging occured when connection which had to wait for table lock was serviced by thread which previously serviced connection that was killed (note that connections can reuse threads if thread cache is enabled). One possible scenario which exposed this problem was when thread which provided binlog dump to replication slave was implicitly/automatically killed when the same slave reconnected and started pulling data through different thread/connection. In 5.* versions memory hogging was added to CPU hogging. Moreover in those versions the problem also occured when one killed particular query in connection (using KILL QUERY) and later this connection had to wait for some table lock. This problem was caused by the fact that thread-specific mysys_var::abort variable, which indicates that waiting operations on mysys layer should be aborted (this includes waiting for table locks), was set by kill operation but was never reset back. So this value was "inherited" by the following statements or even other connections (which reused the same physical thread). Such discrepancy between this variable and THD::killed flag broke logic on SQL-layer and caused CPU and memory hogging. This patch tries to fix this problem by properly resetting this member. There is no test-case associated with this patch since it is hard to test for memory/CPU hogging conditions in our test-suite. sql/mysqld.cc: We should not forget to reset THD::mysys_var::abort after kill operation if we are going to use thread to which this operation was applied for handling of other connections. --- sql/mysqld.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0efc1339467..20f20a0a86b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1572,6 +1572,12 @@ void end_thread(THD *thd, bool put_in_cache) thd=thread_cache.get(); thd->real_id=pthread_self(); (void) thd->store_globals(); + /* + THD::mysys_var::abort is associated with physical thread rather + than with THD object. So we need to reset this flag before using + this thread for handling of new THD object/connection. + */ + thd->mysys_var->abort= 0; thd->thr_create_time= time(NULL); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); From cdd2a2e40d32a2ee4fc0f5be12092a90512e0618 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 11:51:35 +0300 Subject: [PATCH 155/789] Fix for bug #25966 "2MB per second endless memory consumption after LOCK TABLE ... WRITE". Memory and CPU hogging occured when connection which had to wait for table lock was serviced by thread which previously serviced connection that was killed (note that connections can reuse threads if thread cache is enabled). One possible scenario which exposed this problem was when thread which provided binlog dump to replication slave was implicitly/automatically killed when the same slave reconnected and started pulling data through different thread/connection. The problem also occured when one killed particular query in connection (using KILL QUERY) and later this connection had to wait for some table lock. This problem was caused by the fact that thread-specific mysys_var::abort variable, which indicates that waiting operations on mysys layer should be aborted (this includes waiting for table locks), was set by kill operation but was never reset back. So this value was "inherited" by the following statements or even other connections (which reused the same physical thread). Such discrepancy between this variable and THD::killed flag broke logic on SQL-layer and caused CPU and memory hogging. This patch tries to fix this problem by properly resetting this member. There is no test-case associated with this patch since it is hard to test for memory/CPU hogging conditions in our test-suite. sql/mysqld.cc: We should not forget to reset THD::mysys_var::abort after kill operation if we are going to use thread to which this operation was applied for handling of other connections. sql/sp_head.cc: We should not forget to reset THD::mysys_var::abort after kill operation if we are going to use thread to which this operation was applied for handling of further statements. sql/sql_parse.cc: We should not forget to reset THD::mysys_var::abort after kill operation if we are going to use thread to which this operation was applied for handling of further statements. --- sql/mysqld.cc | 6 ++++++ sql/sp_head.cc | 1 + sql/sql_parse.cc | 3 +++ 3 files changed, 10 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9a7928b214f..99d66134405 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1681,6 +1681,12 @@ void end_thread(THD *thd, bool put_in_cache) thd->real_id=pthread_self(); thd->thread_stack= (char*) &thd; // For store_globals (void) thd->store_globals(); + /* + THD::mysys_var::abort is associated with physical thread rather + than with THD object. So we need to reset this flag before using + this thread for handling of new THD object/connection. + */ + thd->mysys_var->abort= 0; thd->thr_create_time= time(NULL); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index baeedc1c9b3..4cb56e003ee 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1087,6 +1087,7 @@ sp_head::execute(THD *thd) ctx->enter_handler(hip); thd->clear_error(); thd->killed= THD::NOT_KILLED; + thd->mysys_var->abort= 0; continue; } } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b503e147624..6500def76f7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1604,7 +1604,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd, DBUG_ENTER("dispatch_command"); if (thd->killed == THD::KILL_QUERY || thd->killed == THD::KILL_BAD_DATA) + { thd->killed= THD::NOT_KILLED; + thd->mysys_var->abort= 0; + } thd->command=command; /* From 88755cc80e0b43fd1cf8e9b98b3a3a0269d8d533 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 09:58:39 +0100 Subject: [PATCH 156/789] Pass pointer to current mysqld to mysqld_arguments in order to make the code eaiser and more extensible --- mysql-test/mysql-test-run.pl | 138 ++++++++++++++--------------------- 1 file changed, 55 insertions(+), 83 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 565c55b14fd..87d2da9bece 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -353,7 +353,7 @@ sub do_before_start_slave ($); sub ndbd_start ($$$); sub ndb_mgmd_start ($); sub mysqld_start ($$$); -sub mysqld_arguments ($$$$$); +sub mysqld_arguments ($$$$); sub stop_all_servers (); sub run_mysqltest ($); sub usage ($); @@ -3606,21 +3606,20 @@ sub do_before_start_slave ($) { } -sub mysqld_arguments ($$$$$) { +sub mysqld_arguments ($$$$) { my $args= shift; - my $type= shift; - my $idx= shift; + my $mysqld= shift; my $extra_opt= shift; my $slave_master_info= shift; + my $idx= $mysqld->{'idx'}; my $sidx= ""; # Index as string, 0 is empty string - if ( $idx > 0 ) + if ( $idx> 0 ) { - $sidx= "$idx"; + $sidx= $idx; } my $prefix= ""; # If mysqltest server arg - if ( $glob_use_embedded_server ) { $prefix= "--server-arg="; @@ -3657,36 +3656,53 @@ sub mysqld_arguments ($$$$$) { } } + mtr_add_arg($args, "%s--pid-file=%s", $prefix, + $mysqld->{'path_pid'}); + + mtr_add_arg($args, "%s--port=%d", $prefix, + $mysqld->{'port'}); + + mtr_add_arg($args, "%s--socket=%s", $prefix, + $mysqld->{'path_sock'}); + + mtr_add_arg($args, "%s--datadir=%s", $prefix, + $mysqld->{'path_myddir'}); + + + if ( $mysql_version_id >= 50106 ) + { + # Turn on logging to bothe tables and file + mtr_add_arg($args, "%s--log-output=table,file", $prefix); + } + + mtr_add_arg($args, "%s--log=%s", $prefix, $mysqld->{'path_mylog'}); + + # Check if "extra_opt" contains --skip-log-bin my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt); - if ( $type eq 'master' ) + if ( $mysqld->{'type'} eq 'master' ) { - my $id= $idx > 0 ? $idx + 101 : 1; - if (! ($opt_skip_master_binlog || $skip_binlog) ) { mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix, $opt_vardir, $sidx); } - mtr_add_arg($args, "%s--pid-file=%s", $prefix, - $master->[$idx]->{'path_pid'}); - mtr_add_arg($args, "%s--port=%d", $prefix, - $master->[$idx]->{'port'}); - mtr_add_arg($args, "%s--server-id=%d", $prefix, $id); - mtr_add_arg($args, "%s--socket=%s", $prefix, - $master->[$idx]->{'path_sock'}); - mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:10M:autoextend", $prefix); + + mtr_add_arg($args, "%s--server-id=%d", $prefix, + $idx > 0 ? $idx + 101 : 1); + + mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:10M:autoextend", + $prefix); + mtr_add_arg($args, "%s--local-infile", $prefix); - mtr_add_arg($args, "%s--datadir=%s", $prefix, - $master->[$idx]->{'path_myddir'}); if ( $idx > 0 or !$use_innodb) { mtr_add_arg($args, "%s--skip-innodb", $prefix); } - my $cluster= $clusters->[$master->[$idx]->{'cluster'}]; + my $cluster= $clusters->[$mysqld->{'cluster'}]; if ( $opt_skip_ndbcluster || !$cluster->{'pid'}) { @@ -3702,26 +3718,12 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--ndb-extra-logging", $prefix); } } - - if ( $mysql_version_id <= 50106 ) - { - # Force mysqld to use log files up until 5.1.6 - mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); - } - else - { - # Turn on logging, will be sent to tables - mtr_add_arg($args, "%s--log=", $prefix); - } } - - if ( $type eq 'slave' ) + else { - my $slave_server_id= 2 + $idx; - my $slave_rpl_rank= $slave_server_id; + mtr_error("unknown mysqld type") + unless $mysqld->{'type'} eq 'slave'; - mtr_add_arg($args, "%s--datadir=%s", $prefix, - $slave->[$idx]->{'path_myddir'}); mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix); if (! ( $opt_skip_slave_binlog || $skip_binlog )) { @@ -3731,18 +3733,14 @@ sub mysqld_arguments ($$$$$) { } mtr_add_arg($args, "%s--master-retry-count=10", $prefix); - mtr_add_arg($args, "%s--pid-file=%s", $prefix, - $slave->[$idx]->{'path_pid'}); - mtr_add_arg($args, "%s--port=%d", $prefix, - $slave->[$idx]->{'port'}); + mtr_add_arg($args, "%s--relay-log=%s/log/slave%s-relay-bin", $prefix, $opt_vardir, $sidx); mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix); mtr_add_arg($args, "%s--report-port=%d", $prefix, - $slave->[$idx]->{'port'}); + $mysqld->{'port'}); mtr_add_arg($args, "%s--report-user=root", $prefix); mtr_add_arg($args, "%s--skip-innodb", $prefix); - mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); mtr_add_arg($args, "%s--skip-slave-start", $prefix); # Directory where slaves find the dumps generated by "load data" @@ -3751,8 +3749,6 @@ sub mysqld_arguments ($$$$$) { my $slave_load_path= "../tmp"; mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix, $slave_load_path); - mtr_add_arg($args, "%s--socket=%s", $prefix, - $slave->[$idx]->{'path_sock'}); mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix); if ( @$slave_master_info ) @@ -3770,13 +3766,16 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--master-password=", $prefix); mtr_add_arg($args, "%s--master-port=%d", $prefix, $master->[0]->{'port'}); # First master + + my $slave_server_id= 2 + $idx; + my $slave_rpl_rank= $slave_server_id; mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id); mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank); } if ( $opt_skip_ndbcluster_slave || - $slave->[$idx]->{'cluster'} == -1 || - !$clusters->[$slave->[$idx]->{'cluster'}]->{'pid'} ) + $mysqld->{'cluster'} == -1 || + !$clusters->[$mysqld->{'cluster'}]->{'pid'} ) { mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); } @@ -3784,41 +3783,22 @@ sub mysqld_arguments ($$$$$) { { mtr_add_arg($args, "%s--ndbcluster", $prefix); mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix, - $clusters->[$slave->[$idx]->{'cluster'}]->{'connect_string'}); + $clusters->[$mysqld->{'cluster'}]->{'connect_string'}); + if ( $mysql_version_id >= 50100 ) { mtr_add_arg($args, "%s--ndb-extra-logging", $prefix); } } - if ( $mysql_version_id <= 50106 ) - { - # Force mysqld to use log files up until 5.1.6 - mtr_add_arg($args, "%s--log=%s", $prefix, $slave->[0]->{'path_mylog'}); - } - else - { - # Turn on logging, will be sent to tables - mtr_add_arg($args, "%s--log=", $prefix); - } - } # end slave if ( $opt_debug ) { - if ( $type eq 'master' ) - { - mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/master%s.trace", - $prefix, $path_vardir_trace, $sidx); - } - if ( $type eq 'slave' ) - { - mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/slave%s.trace", - $prefix, $path_vardir_trace, $sidx); - } + mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/%s%s.trace", + $prefix, $path_vardir_trace, $mysqld->{'type'}, $sidx); } - # FIXME always set nowdays??? SMALL_SERVER mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix); mtr_add_arg($args, "%s--sort_buffer=256K", $prefix); mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); @@ -3844,18 +3824,10 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--gdb", $prefix); } - # If we should run all tests cases, we will use a local server for that - - if ( -w "/" ) - { - # We are running as root; We need to add the --root argument - mtr_add_arg($args, "%s--user=root", $prefix); - } - my $found_skip_core= 0; foreach my $arg ( @opt_extra_mysqld_opt, @$extra_opt ) { - # Allow --skip-core-file to be set in master.opt file + # Allow --skip-core-file to be set in -[master|slave].opt file if ($arg eq "--skip-core-file") { $found_skip_core= 1; @@ -3879,7 +3851,7 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix); mtr_add_arg($args, "%s--init-rpl-role=master", $prefix); } - elsif ( $type eq 'master' ) + elsif ( $mysqld->{'type'} eq 'master' ) { mtr_add_arg($args, "%s--open-files-limit=1024", $prefix); } @@ -3930,7 +3902,7 @@ sub mysqld_start ($$$) { valgrind_arguments($args, \$exe); } - mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info); + mysqld_arguments($args,$mysqld,$extra_opt,$slave_master_info); if ( $opt_gdb || $opt_manual_gdb) { @@ -4674,7 +4646,7 @@ sub run_mysqltest ($) { if ( $glob_use_embedded_server ) { - mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]); + mysqld_arguments($args,$master->[0],$tinfo->{'master_opt'},[]); } # ---------------------------------------------------------------------- From 970d515ccea212825acdd53e35ce6c6bf320a238 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 11:05:12 +0100 Subject: [PATCH 157/789] ndb - fix bug in UtilTransactions::compare reset rowcount on temporary error during scan of base table --- ndb/test/src/UtilTransactions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/test/src/UtilTransactions.cpp b/ndb/test/src/UtilTransactions.cpp index 31c323045ed..c3941bda5dd 100644 --- a/ndb/test/src/UtilTransactions.cpp +++ b/ndb/test/src/UtilTransactions.cpp @@ -1382,6 +1382,7 @@ UtilTransactions::compare(Ndb* pNdb, const char* tab_name2, int flags){ goto error; } + row_count= 0; { int eof; while((eof = pOp->nextResult(true)) == 0) From c0f28669cb2a58fdc100fc54faab2a57e3a716b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 13:30:42 +0100 Subject: [PATCH 158/789] ndb - bug#27169 Fix bug in SUMA::resend_bucket which could cause mysqld to crash storage/ndb/src/kernel/blocks/suma/Suma.cpp: Remove *len* part from sz, or an extra word will be sent (sometimes) which will cause event-api barf storage/ndb/test/ndbapi/test_event.cpp: test prg for bug#27169 storage/ndb/test/run-test/daily-basic-tests.txt: test prg for bug#27169 --- storage/ndb/src/kernel/blocks/suma/Suma.cpp | 5 +- storage/ndb/test/ndbapi/test_event.cpp | 150 ++++++++++++++++++ .../ndb/test/run-test/daily-basic-tests.txt | 4 + 3 files changed, 158 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index 407280638d9..5ebb075d636 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -4997,8 +4997,11 @@ Suma::resend_bucket(Signal* signal, Uint32 buck, Uint32 min_gci, { continue; } + + ndbrequire(sz); + sz --; // remove *len* part of sz - if(sz == 1) + if(sz == 0) { SubGcpCompleteRep * rep = (SubGcpCompleteRep*)signal->getDataPtrSend(); rep->gci = last_gci; diff --git a/storage/ndb/test/ndbapi/test_event.cpp b/storage/ndb/test/ndbapi/test_event.cpp index 54ea88d143c..563819689a8 100644 --- a/storage/ndb/test/ndbapi/test_event.cpp +++ b/storage/ndb/test/ndbapi/test_event.cpp @@ -836,6 +836,67 @@ end: DBUG_RETURN(result); } +int runEventListenerUntilStopped(NDBT_Context* ctx, NDBT_Step* step) +{ + + int result = NDBT_OK; + const NdbDictionary::Table * table= ctx->getTab(); + HugoTransactions hugoTrans(* table); + + char buf[1024]; + sprintf(buf, "%s_EVENT", table->getName()); + NdbEventOperation *pOp, *pCreate = 0; + pCreate = pOp = GETNDB(step)->createEventOperation(buf); + if ( pOp == NULL ) { + g_err << "Event operation creation failed on %s" << buf << endl; + return NDBT_FAILED; + } + + int i; + int n_columns= table->getNoOfColumns(); + NdbRecAttr* recAttr[1024]; + NdbRecAttr* recAttrPre[1024]; + for (i = 0; i < n_columns; i++) { + recAttr[i] = pOp->getValue(table->getColumn(i)->getName()); + recAttrPre[i] = pOp->getPreValue(table->getColumn(i)->getName()); + } + + if (pOp->execute()) + { // This starts changes to "start flowing" + g_err << "execute operation execution failed: \n"; + g_err << pOp->getNdbError().code << " " + << pOp->getNdbError().message << endl; + result = NDBT_FAILED; + goto end; + } + + Ndb* ndb= GETNDB(step); + while(!ctx->isTestStopped()) + { + Uint64 curr_gci = 0; + while(!ctx->isTestStopped()) + { + ndb->pollEvents(100, &curr_gci); + while ((pOp= ndb->nextEvent()) != 0) + { + assert(pOp == pCreate); + } + } + } + +end: + if(pCreate) + { + if (GETNDB(step)->dropEventOperation(pCreate)) { + g_err << "dropEventOperation execution failed " + << GETNDB(step)->getNdbError().code << " " + << GETNDB(step)->getNdbError().message << endl; + result = NDBT_FAILED; + } + } + return result; +} + int runRestarter(NDBT_Context* ctx, NDBT_Step* step){ int result = NDBT_OK; int loops = ctx->getNumLoops(); @@ -877,6 +938,51 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){ return result; } +int runRestarterLoop(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + int loops = ctx->getNumLoops(); + NdbRestarter restarter; + int i = 0; + int lastId = 0; + + if (restarter.getNumDbNodes() < 2){ + ctx->stopTest(); + return NDBT_OK; + } + + if(restarter.waitClusterStarted(60) != 0){ + g_err << "Cluster failed to start" << endl; + return NDBT_FAILED; + } + + while(result != NDBT_FAILED + && !ctx->isTestStopped() + && i < loops) + { + int id = lastId % restarter.getNumDbNodes(); + int nodeId = restarter.getDbNodeId(id); + ndbout << "Restart node " << nodeId << endl; + if(restarter.restartOneDbNode(nodeId, false, false, true) != 0){ + g_err << "Failed to restartNextDbNode" << endl; + result = NDBT_FAILED; + break; + } + + if(restarter.waitClusterStarted(60) != 0){ + g_err << "Cluster failed to start" << endl; + result = NDBT_FAILED; + break; + } + + lastId++; + i++; + } + + ctx->stopTest(); + return result; +} + Vector pTabs; Vector pShadowTabs; @@ -1616,6 +1722,42 @@ runSubscribeUnsubscribe(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){ + int records = ctx->getNumRecords(); + int parallelism = ctx->getProperty("Parallelism", (Uint32)0); + int abort = ctx->getProperty("AbortProb", (Uint32)0); + HugoTransactions hugoTrans(*ctx->getTab()); + while (ctx->isTestStopped() == false) + { + if (hugoTrans.scanUpdateRecords(GETNDB(step), records, abort, + parallelism) == NDBT_FAILED){ + return NDBT_FAILED; + } + } + return NDBT_OK; +} + +int +runInsertDeleteUntilStopped(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + int records = ctx->getNumRecords(); + HugoTransactions hugoTrans(*ctx->getTab()); + UtilTransactions utilTrans(*ctx->getTab()); + while (ctx->isTestStopped() == false) + { + if (hugoTrans.loadTable(GETNDB(step), records, 1) != 0){ + return NDBT_FAILED; + } + if (utilTrans.clearTable(GETNDB(step), records) != 0){ + return NDBT_FAILED; + } + } + + return NDBT_OK; +} + NDBT_TESTSUITE(test_event); TESTCASE("BasicEventOperation", "Verify that we can listen to Events" @@ -1737,6 +1879,14 @@ TESTCASE("SubscribeUnsubscribe", STEPS(runSubscribeUnsubscribe, 16); FINALIZER(runDropEvent); } +TESTCASE("Bug27169", ""){ + INITIALIZER(runCreateEvent); + STEP(runEventListenerUntilStopped); + STEP(runInsertDeleteUntilStopped); + STEP(runScanUpdateUntilStopped); + STEP(runRestarterLoop); + FINALIZER(runDropEvent); +} NDBT_TESTSUITE_END(test_event); int main(int argc, const char** argv){ diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index c0f1ff4db48..ad33a1d52d7 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -788,6 +788,10 @@ max-time: 1000 cmd: testNodeRestart args: -n Bug25468 T1 +max-time: 1000 +cmd: test_event +args: -l 10 -n Bug27169 T1 + # OLD FLEX max-time: 500 cmd: flexBench From d9cf47f9259c0ed6e26922cb08c2f2e6833e1b1c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 13:35:49 +0100 Subject: [PATCH 159/789] added missing prototype implementations (bug #25933) --- storage/ndb/src/ndbapi/NdbOperation.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/storage/ndb/src/ndbapi/NdbOperation.cpp b/storage/ndb/src/ndbapi/NdbOperation.cpp index ff9c50da77c..9b3d20a1c33 100644 --- a/storage/ndb/src/ndbapi/NdbOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbOperation.cpp @@ -368,12 +368,24 @@ NdbOperation::subValue( const char* anAttrName, Uint32 aValue) return subValue(m_currentTable->getColumn(anAttrName), aValue); } +int +NdbOperation::subValue( const char* anAttrName, Uint64 aValue) +{ + return subValue(m_currentTable->getColumn(anAttrName), aValue); +} + int NdbOperation::subValue(Uint32 anAttrId, Uint32 aValue) { return subValue(m_currentTable->getColumn(anAttrId), aValue); } +int +NdbOperation::subValue(Uint32 anAttrId, Uint64 aValue) +{ + return subValue(m_currentTable->getColumn(anAttrId), aValue); +} + int NdbOperation::read_attr(const char* anAttrName, Uint32 RegDest) { From b42da2dd01b718766d8b0339f68399935de6dd9f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 17:35:31 +0400 Subject: [PATCH 160/789] merging --- mysql-test/r/gis-rtree.result | 2 +- mysql-test/t/gis-rtree.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index b92601e7b5c..a3955e8c008 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -879,7 +879,7 @@ c1 varchar(15) collate utf8_bin default NULL, c3 varchar(10) collate utf8_bin default NULL, spatial_point point NOT NULL, PRIMARY KEY(id), -SPATIAL KEY (spatial_point(32)) +SPATIAL KEY (spatial_point) )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES ('y', 's', 'j', GeomFromText('POINT(167 74)')), diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 348b79be6c2..579ec65f149 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -251,7 +251,7 @@ CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment, c3 varchar(10) collate utf8_bin default NULL, spatial_point point NOT NULL, PRIMARY KEY(id), - SPATIAL KEY (spatial_point(32)) + SPATIAL KEY (spatial_point) )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; # INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES From d8dd784ff4ce92ddbe60c412434d08e019c1a611 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 15:52:04 +0100 Subject: [PATCH 161/789] Remove test/udf_test and test/udf_test.res, since udf's are nowadays tested by mysql-test-run.pl BitKeeper/deleted/.del-udf_test: Delete: tests/udf_test BitKeeper/deleted/.del-udf_test.res: Delete: tests/udf_test.res --- tests/Makefile.am | 2 +- tests/udf_test | 33 --------- tests/udf_test.res | 175 --------------------------------------------- 3 files changed, 1 insertion(+), 209 deletions(-) delete mode 100644 tests/udf_test delete mode 100644 tests/udf_test.res diff --git a/tests/Makefile.am b/tests/Makefile.am index a19ffecbd14..bd56570d8d4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,7 +24,7 @@ EXTRA_DIST = auto_increment.res auto_increment.tst \ insert_and_repair.pl \ grant.pl grant.res test_delayed_insert.pl \ pmail.pl mail_to_db.pl table_types.pl \ - udf_test udf_test.res myisam-big-rows.tst \ + myisam-big-rows.tst \ CMakeLists.txt bin_PROGRAMS = mysql_client_test diff --git a/tests/udf_test b/tests/udf_test deleted file mode 100644 index 15ad640f984..00000000000 --- a/tests/udf_test +++ /dev/null @@ -1,33 +0,0 @@ -# -# For this script to work, you need to compile and install the -# udf_example script ! -# - -CREATE FUNCTION metaphon RETURNS STRING SONAME "udf_example.so"; -CREATE FUNCTION myfunc_double RETURNS REAL SONAME "udf_example.so"; -CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "udf_example.so"; -CREATE FUNCTION lookup RETURNS STRING SONAME "udf_example.so"; -CREATE FUNCTION reverse_lookup RETURNS STRING SONAME "udf_example.so"; -CREATE AGGREGATE FUNCTION avgcost RETURNS REAL SONAME "udf_example.so"; -CREATE FUNCTION myfunc_argument_name RETURNS STRING SONAME "udf_example.so"; - -select metaphon("hello"); -select myfunc_double("hello","world"); -select myfunc_int(1,2,3),myfunc_int("1","11","111"); -select lookup("localhost"); -select reverse_lookup("127.0.0.1"); - -create temporary table t1 (a int,b double); -insert into t1 values (1,5),(1,4),(2,8),(3,9),(4,11); -select avgcost(a,b) from t1; -select avgcost(a,b) from t1 group by a; -select a, myfunc_argument_name(a), myfunc_argument_name(a as b) from t1; -drop table t1; - -DROP FUNCTION metaphon; -DROP FUNCTION myfunc_double; -DROP FUNCTION myfunc_int; -DROP FUNCTION lookup; -DROP FUNCTION reverse_lookup; -DROP FUNCTION avgcost; -DROP FUNCTION myfunc_argument_name; diff --git a/tests/udf_test.res b/tests/udf_test.res deleted file mode 100644 index de9e9969f3a..00000000000 --- a/tests/udf_test.res +++ /dev/null @@ -1,175 +0,0 @@ --------------- -CREATE FUNCTION metaphon RETURNS STRING SONAME "udf_example.so" --------------- - -Query OK, 0 rows affected - --------------- -CREATE FUNCTION myfunc_double RETURNS REAL SONAME "udf_example.so" --------------- - -Query OK, 0 rows affected - --------------- -CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "udf_example.so" --------------- - -Query OK, 0 rows affected - --------------- -CREATE FUNCTION lookup RETURNS STRING SONAME "udf_example.so" --------------- - -Query OK, 0 rows affected - --------------- -CREATE FUNCTION reverse_lookup RETURNS STRING SONAME "udf_example.so" --------------- - -Query OK, 0 rows affected - --------------- -CREATE AGGREGATE FUNCTION avgcost RETURNS REAL SONAME "udf_example.so" --------------- - -Query OK, 0 rows affected - --------------- -CREATE FUNCTION myfunc_argument_name RETURNS STRING SONAME "udf_example.so" --------------- - -Query OK, 0 rows affected - --------------- -select metaphon("hello") --------------- - -metaphon("hello") -HL -1 row in set - --------------- -select myfunc_double("hello","world") --------------- - -myfunc_double("hello","world") -108.40 -1 row in set - --------------- -select myfunc_int(1,2,3),myfunc_int("1","11","111") --------------- - -myfunc_int(1,2,3) myfunc_int("1","11","111") -6 6 -1 row in set - --------------- -select lookup("localhost") --------------- - -lookup("localhost") -127.0.0.1 -1 row in set - --------------- -select reverse_lookup("127.0.0.1") --------------- - -reverse_lookup("127.0.0.1") -localhost -1 row in set - --------------- -create temporary table t1 (a int,b double) --------------- - -Query OK, 0 rows affected - --------------- -insert into t1 values (1,5),(1,4),(2,8),(3,9),(4,11) --------------- - -Query OK, 5 rows affected -Records: 0 Duplicates: 5 Warnings: 0 - --------------- -select avgcost(a,b) from t1 --------------- - -avgcost(a,b) -8.7273 -1 row in set - --------------- -select avgcost(a,b) from t1 group by a --------------- - -avgcost(a,b) -4.5000 -8.0000 -9.0000 -11.0000 -4 rows in set - --------------- -select a, myfunc_argument_name(a) from t1; --------------- - -a myfunc_argument_name(a) myfunc_argument_name(a as b) -1 a b -1 a b -2 a b -3 a b -4 a b -5 rows in set - --------------- -drop table t1 --------------- - -Query OK, 0 rows affected - --------------- -DROP FUNCTION metaphon --------------- - -Query OK, 0 rows affected - --------------- -DROP FUNCTION myfunc_double --------------- - -Query OK, 0 rows affected - --------------- -DROP FUNCTION myfunc_int --------------- - -Query OK, 0 rows affected - --------------- -DROP FUNCTION lookup --------------- - -Query OK, 0 rows affected - --------------- -DROP FUNCTION reverse_lookup --------------- - -Query OK, 0 rows affected - --------------- -DROP FUNCTION avgcost --------------- - -Query OK, 0 rows affected - --------------- -DROP FUNCTION myfunc_argument_name; --------------- - -Query OK, 0 rows affected - -Bye From 44137aa35904f83048611e09b78a4c18236dd518 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 23:17:44 +0300 Subject: [PATCH 162/789] Bug#26765 "typo when running mysql-test-run" Fix a typo (togheter -> together) mysql-test/mysql-test-run.pl: Fix a typo (togheter -> together) storage/ndb/test/include/NDBT_Error.hpp: Fix a typo (togheter -> together) storage/ndb/test/include/NDBT_ReturnCodes.h: Fix a typo (togheter -> together) --- mysql-test/mysql-test-run.pl | 2 +- storage/ndb/test/include/NDBT_Error.hpp | 4 ++-- storage/ndb/test/include/NDBT_ReturnCodes.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2017da8a9c1..10483d93427 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -899,7 +899,7 @@ sub command_line_setup () { # -------------------------------------------------------------------------- if ( $opt_with_ndbcluster and !$opt_bench) { - mtr_error("Can only use --with-ndbcluster togheter with --bench"); + mtr_error("Can only use --with-ndbcluster together with --bench"); } if ( $opt_ndbconnectstring ) diff --git a/storage/ndb/test/include/NDBT_Error.hpp b/storage/ndb/test/include/NDBT_Error.hpp index 352f5926eeb..faec0cdadfc 100644 --- a/storage/ndb/test/include/NDBT_Error.hpp +++ b/storage/ndb/test/include/NDBT_Error.hpp @@ -77,8 +77,8 @@ private: }; // -// ERR prints an NdbError object togheter with a description of where -// the error occured +// ERR prints an NdbError object together with a description of where the +// error occured // #define ERR_OUT(where, error) \ { where << "ERROR: " << error.code << " " \ diff --git a/storage/ndb/test/include/NDBT_ReturnCodes.h b/storage/ndb/test/include/NDBT_ReturnCodes.h index 8660c0828f4..b48fccdb12d 100644 --- a/storage/ndb/test/include/NDBT_ReturnCodes.h +++ b/storage/ndb/test/include/NDBT_ReturnCodes.h @@ -26,7 +26,7 @@ extern "C" { #define NDBT_TEMPORARY 3 /** * NDBT_ProgramExit - * This function will print the returncode togheter with a prefix on + * This function will print the returncode together with a prefix on * the screen and then exit the test program. * Call this function when exiting the main function in your test programs * Returns the return code From 542f18a31ab261c0b36ffddf6372e8c1e3de4294 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 23:21:29 +0300 Subject: [PATCH 163/789] Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were touched but not actually changed. The LAST_INSERT_ID() is reset to 0 if no rows were inserted or changed. This is the case when an INSERT ... ON DUPLICATE KEY UPDATE updates a row with the same values as the row contains. Now the LAST_INSERT_ID() values is reset to 0 only if there were no rows successfully inserted or touched. The new 'touched' field is added to the COPY_INFO structure. It holds the number of rows that were touched no matter whether they were actually changed or not. sql/sql_class.h: Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were touched but not actually changed. The new 'touched' field is added to the COPY_INFO structure. It holds the number of rows that were touched no matter whether they were actually changed or not. mysql-test/r/insert_update.result: Added a test case for the bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were touched but not actually changed. mysql-test/t/insert_update.test: Added a test case for the bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were touched but not actually changed. sql/sql_insert.cc: Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were touched but not actually changed. Now the LAST_INSERT_ID() values is reset to 0 only if there were no rows successfully inserted or touched. --- mysql-test/r/insert_update.result | 11 +++++++++++ mysql-test/t/insert_update.test | 12 ++++++++++++ sql/sql_class.h | 22 +++++++++++++++++----- sql/sql_insert.cc | 16 +++++++++------- 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index f658ff06624..b1dee844515 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -236,3 +236,14 @@ INSERT INTO t2 VALUES (1), (3); INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a; ERROR 42S22: Unknown column 'a' in 'field list' DROP TABLE t1,t2; +CREATE TABLE t1 (f1 INT AUTO_INCREMENT PRIMARY KEY, +f2 VARCHAR(5) NOT NULL UNIQUE); +INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +DROP TABLE t1; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 4581cc7a875..2ef378aa478 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -162,3 +162,15 @@ INSERT INTO t2 VALUES (1), (3); --error ER_BAD_FIELD_ERROR INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a; DROP TABLE t1,t2; + +# +# Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were +# touched but not actually changed. +# +CREATE TABLE t1 (f1 INT AUTO_INCREMENT PRIMARY KEY, + f2 VARCHAR(5) NOT NULL UNIQUE); +INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1); +SELECT LAST_INSERT_ID(); +INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1); +SELECT LAST_INSERT_ID(); +DROP TABLE t1; diff --git a/sql/sql_class.h b/sql/sql_class.h index 995b5ac0bde..99803802001 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -356,13 +356,25 @@ public: inline uint32 get_open_count() { return open_count; } }; - +/* + The COPY_INFO structure is used by INSERT/REPLACE code. + The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY + UPDATE code: + If a row is inserted then the copied variable is incremented. + If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the + new data differs from the old one then the copied and the updated + variables are incremented. + The touched variable is incremented if a row was touched by the update part + of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row + was actually changed or not. +*/ typedef struct st_copy_info { - ha_rows records; - ha_rows deleted; - ha_rows updated; - ha_rows copied; + ha_rows records; /* Number of processed records */ + ha_rows deleted; /* Number of deleted records */ + ha_rows updated; /* Number of updated records */ + ha_rows copied; /* Number of copied records */ ha_rows error_count; + ha_rows touched; /* Number of touched records */ enum enum_duplicates handle_duplicates; int escape_char, last_errno; bool ignore; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index a5f6f08973d..629d1e68d4e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -522,7 +522,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, /* Fill in the given fields and dump it to the table file */ - info.records= info.deleted= info.copied= info.updated= 0; + info.records= info.deleted= info.copied= info.updated= info.touched= 0; info.ignore= ignore; info.handle_duplicates=duplic; info.update_fields= &update_fields; @@ -767,8 +767,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, (!table->triggers || !table->triggers->has_delete_triggers())) table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); - /* Reset value of LAST_INSERT_ID if no rows where inserted */ - if (!info.copied && thd->insert_id_used) + /* Reset value of LAST_INSERT_ID if no rows were inserted or touched */ + if (!info.copied && !info.touched && thd->insert_id_used) { thd->insert_id(0); id=0; @@ -1221,15 +1221,17 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) } goto err; } + + if (table->next_number_field) + table->file->adjust_next_insert_id_after_explicit_value( + table->next_number_field->val_int()); + info->touched++; + if ((table->file->table_flags() & HA_PARTIAL_COLUMN_READ) || compare_record(table, thd->query_id)) { info->updated++; - if (table->next_number_field) - table->file->adjust_next_insert_id_after_explicit_value( - table->next_number_field->val_int()); - trg_error= (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, TRG_ACTION_AFTER, From 0d31e0f3cfab1f90b24fc0fa716ce590dd60cd91 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 22:28:31 +0100 Subject: [PATCH 164/789] Raise version number after cloning 5.0.38 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 53f666bad00..7867bf444ad 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.38) +AM_INIT_AUTOMAKE(mysql, 5.0.40) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=38 +NDB_VERSION_BUILD=40 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From d60833fe729f52509bb270dcbe34d1d9db3daade Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 14:28:32 -0700 Subject: [PATCH 165/789] Added test options to Makefile.am including - test suites developed by QA - additional 'fast' test options Makefile.am: Added test options to cover - test suites developed by QA - additional 'fast' test options --- Makefile.am | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 04d50ccfbaf..3a1bfc0e32a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -112,7 +112,9 @@ tags: .PHONY: init-db bin-dist \ test test-force test-full test-force-full test-force-mem \ test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \ - test-ps test-ns + test-ps test-ns test-ext-funcs test-ext \ + test-fast test-fast-cursor test-fast-view test-fast-prepare \ + test-full-qa # Target 'test' will run the regression test suite using the built server. # @@ -124,11 +126,11 @@ tags: test-ps: cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) --ps-protocol + @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol test-ns: cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) + @PERL@ ./mysql-test-run.pl $(force) $(mem) test: test-ns test-ps @@ -143,7 +145,7 @@ test-force-full: #used by autopush.pl to run memory based tests test-force-mem: - $(MAKE) 'force=--force --mem' test + $(MAKE) force=--force mem=--mem test # Keep these for a while test-pl: test @@ -152,5 +154,31 @@ test-force-pl: test-force test-force-pl-mem: test-force-mem test-force-full-pl: test-force-full +test-ext-funcs: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl --force --suite=funcs_1 ; \ + @PERL@ ./mysql-test-run.pl --force --suite=funcs_2 + +test-ext: test-ext-funcs + +test-fast: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \ + @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam + +test-fast-view: + $(MAKE) subset=--view-protocol test-fast + +test-fast-cursor: + $(MAKE) subset=--cursor-protocol test-fast + +test-fast-prepare: + $(MAKE) subset=--ps-protocol test-fast + +test-full-qa: + $(MAKE) force=--force test-pl \ + test-ext test-fast-view \ + test-fast-cursor + # Don't update the files from bitkeeper %::SCCS/s.% From 260e43e75dee8a261ab5dd0ab8a595f9acc9f814 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Mar 2007 23:39:07 -0700 Subject: [PATCH 166/789] Correctly report load type. Updated engine to also handle create options Secondary indexes can now be generated (aka the test PeterZ thoughts!) client/client_priv.h: Option for generating secondary indexes client/mysqlslap.c: Option for generating secondary index operations. Cleaned up memory allocation that was wasteful. Engine options are now possible Correctly report test type. mysql-test/t/mysqlslap.test: Additional test for secondary indexes sql/authors.h: Updated for Patrick --- client/client_priv.h | 1 + client/mysqlslap.c | 331 +++++++++++++++++++++++++++++------- mysql-test/t/mysqlslap.test | 2 + sql/authors.h | 1 + 4 files changed, 269 insertions(+), 66 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 00ef1a79d96..b6543870528 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -61,6 +61,7 @@ enum options_client OPT_SLAP_AUTO_GENERATE_ADD_AUTO, OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY, OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES, + OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES, OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM, OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 1dc49aa06f3..0010d8e46ae 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -145,13 +145,22 @@ const char *auto_generate_sql_type= "mixed"; static unsigned long connect_flags= CLIENT_MULTI_RESULTS; -static int verbose, num_int_cols, num_char_cols, delimiter_length; +static int verbose, delimiter_length; +const char *num_int_cols_opt; +const char *num_char_cols_opt; +/* Yes, we do set defaults here */ +static unsigned int num_int_cols= 1; +static unsigned int num_char_cols= 1; +static unsigned int num_int_cols_index= 0; +static unsigned int num_char_cols_index= 0; + static unsigned int iterations; static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; static ulonglong actual_queries= 0; static ulonglong auto_actual_queries; static ulonglong auto_generate_sql_unique_write_number; static ulonglong auto_generate_sql_unique_query_number; +static unsigned int auto_generate_sql_secondary_indexes; static ulonglong num_of_query; static ulonglong auto_generate_sql_number; const char *concurrency_str= NULL; @@ -176,9 +185,21 @@ struct statement { char *string; size_t length; unsigned char type; + char *option; + size_t option_length; statement *next; }; +typedef struct option_string option_string; + +struct option_string { + char *string; + size_t length; + char *option; + size_t option_length; + option_string *next; +}; + typedef struct stats stats; struct stats { @@ -209,30 +230,32 @@ struct conclusions { unsigned long long min_rows; }; +static option_string *engine_options= NULL; static statement *create_statements= NULL, - *engine_statements= NULL, *query_statements= NULL; /* Prototypes */ void print_conclusions(conclusions *con); void print_conclusions_csv(conclusions *con); -void generate_stats(conclusions *con, statement *eng, stats *sptr); +void generate_stats(conclusions *con, option_string *eng, stats *sptr); uint parse_comma(const char *string, uint **range); uint parse_delimiter(const char *script, statement **stmt, char delm); +uint parse_option(const char *origin, option_string **stmt, char delm); static int drop_schema(MYSQL *mysql, const char *db); uint get_random_string(char *buf); static statement *build_table_string(void); static statement *build_insert_string(void); static statement *build_update_string(void); static statement * build_select_string(my_bool key); -static int generate_primary_key_list(MYSQL *mysql, statement *engine_stmt); +static int generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt); static int drop_primary_key_list(void); static int create_schema(MYSQL *mysql, const char *db, statement *stmt, - statement *engine_stmt); + option_string *engine_stmt); static int run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit); int run_task(thread_context *con); void statement_cleanup(statement *stmt); +void option_cleanup(option_string *stmt); static const char ALPHANUMERICS[]= "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz"; @@ -268,7 +291,7 @@ int main(int argc, char **argv) MYSQL mysql; unsigned int x; unsigned long long client_limit; - statement *eptr; + option_string *eptr; #ifdef __WIN__ opt_use_threads= 1; @@ -330,7 +353,7 @@ int main(int argc, char **argv) } /* Main iterations loop */ - eptr= engine_statements; + eptr= engine_options; do { /* For the final stage we run whatever queries we were asked to run */ @@ -419,8 +442,8 @@ int main(int argc, char **argv) my_free((gptr)concurrency, MYF(0)); statement_cleanup(create_statements); - statement_cleanup(engine_statements); statement_cleanup(query_statements); + option_cleanup(engine_options); #ifdef HAVE_SMEM if (shared_memory_base_name) @@ -456,9 +479,15 @@ static struct my_option my_long_options[] = (gptr*) &auto_generate_sql_guid_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, - "Load types are mixed, update, write, or read. Default is mixed\n", + "Load types are mixed, update, write, key, or read. Default is mixed\n", (gptr*) &auto_generate_sql_type, (gptr*) &auto_generate_sql_type, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"auto-generate-sql-secondary-indexes", + OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES, + "Number of secondary indexes to add auto-generated tables.", + (gptr*) &auto_generate_sql_secondary_indexes, + (gptr*) &auto_generate_sql_secondary_indexes, 0, + GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"auto-generate-sql-unique-query-number", OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM, "Number of unique queries auto tests", @@ -510,12 +539,12 @@ static struct my_option my_long_options[] = REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"number-char-cols", 'x', "Number of VARCHAR columns to create table with if specifying --auto-generate-sql ", - (gptr*) &num_char_cols, (gptr*) &num_char_cols, 0, GET_UINT, REQUIRED_ARG, - 1, 0, 0, 0, 0, 0}, + (gptr*) &num_char_cols_opt, (gptr*) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, {"number-int-cols", 'y', "Number of INT columns to create table with if specifying --auto-generate-sql.", - (gptr*) &num_int_cols, (gptr*) &num_int_cols, 0, GET_UINT, REQUIRED_ARG, - 1, 0, 0, 0, 0, 0}, + (gptr*) &num_int_cols_opt, (gptr*) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, {"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY, "Limit each client to this number of queries (this is not exact).", (gptr*) &num_of_query, (gptr*) &num_of_query, 0, @@ -685,12 +714,12 @@ static statement * build_table_string(void) { char buf[HUGE_STRING_LENGTH]; - int col_count; + unsigned int col_count; statement *ptr; DYNAMIC_STRING table_string; DBUG_ENTER("build_table_string"); - DBUG_PRINT("info", ("num int cols %d num char cols %d", + DBUG_PRINT("info", ("num int cols %u num char cols %u", num_int_cols, num_char_cols)); init_dynamic_string(&table_string, "", 1024, 1024); @@ -699,12 +728,7 @@ build_table_string(void) if (auto_generate_sql_autoincrement) { - if (snprintf(buf, HUGE_STRING_LENGTH, "id serial") > HUGE_STRING_LENGTH) - { - fprintf(stderr, "Memory Allocation error in create table\n"); - exit(1); - } - dynstr_append(&table_string, buf); + dynstr_append(&table_string, "id serial"); if (num_int_cols || num_char_cols) dynstr_append(&table_string, ","); @@ -712,12 +736,29 @@ build_table_string(void) if (auto_generate_sql_guid_primary) { - if (snprintf(buf, HUGE_STRING_LENGTH, "id varchar(32) primary key") > HUGE_STRING_LENGTH) + dynstr_append(&table_string, "id varchar(32) primary key"); + + if (num_int_cols || num_char_cols || auto_generate_sql_guid_primary) + dynstr_append(&table_string, ","); + } + + if (auto_generate_sql_secondary_indexes) + { + unsigned int count; + + for (count= 0; count < auto_generate_sql_secondary_indexes; count++) { + if (count) /* Except for the first pass we add a comma */ + dynstr_append(&table_string, ","); + + if (snprintf(buf, HUGE_STRING_LENGTH, "id%d varchar(32) unique key", count) + > HUGE_STRING_LENGTH) + { fprintf(stderr, "Memory Allocation error in create table\n"); exit(1); + } + dynstr_append(&table_string, buf); } - dynstr_append(&table_string, buf); if (num_int_cols || num_char_cols) dynstr_append(&table_string, ","); @@ -726,11 +767,23 @@ build_table_string(void) if (num_int_cols) for (col_count= 1; col_count <= num_int_cols; col_count++) { - if (snprintf(buf, HUGE_STRING_LENGTH, "intcol%d INT(32)", col_count) - > HUGE_STRING_LENGTH) + if (num_int_cols_index) { - fprintf(stderr, "Memory Allocation error in create table\n"); - exit(1); + if (snprintf(buf, HUGE_STRING_LENGTH, "intcol%d INT(32), INDEX(intcol%d)", + col_count, col_count) > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in create table\n"); + exit(1); + } + } + else + { + if (snprintf(buf, HUGE_STRING_LENGTH, "intcol%d INT(32) ", col_count) + > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in create table\n"); + exit(1); + } } dynstr_append(&table_string, buf); @@ -741,11 +794,24 @@ build_table_string(void) if (num_char_cols) for (col_count= 1; col_count <= num_char_cols; col_count++) { - if (snprintf(buf, HUGE_STRING_LENGTH, "charcol%d VARCHAR(128)", col_count) - > HUGE_STRING_LENGTH) + if (num_char_cols_index) { - fprintf(stderr, "Memory Allocation error in creating table\n"); - exit(1); + if (snprintf(buf, HUGE_STRING_LENGTH, + "charcol%d VARCHAR(128), INDEX(charcol%d) ", + col_count, col_count) > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating table\n"); + exit(1); + } + } + else + { + if (snprintf(buf, HUGE_STRING_LENGTH, "charcol%d VARCHAR(128)", + col_count) > HUGE_STRING_LENGTH) + { + fprintf(stderr, "Memory Allocation error in creating table\n"); + exit(1); + } } dynstr_append(&table_string, buf); @@ -759,6 +825,7 @@ build_table_string(void) ptr->string = (char *)my_malloc(table_string.length+1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= table_string.length+1; + ptr->type= CREATE_TABLE_TYPE; strmov(ptr->string, table_string.str); dynstr_free(&table_string); DBUG_RETURN(ptr); @@ -774,7 +841,7 @@ static statement * build_update_string(void) { char buf[HUGE_STRING_LENGTH]; - int col_count; + unsigned int col_count; statement *ptr; DYNAMIC_STRING update_string; DBUG_ENTER("build_update_string"); @@ -818,14 +885,7 @@ build_update_string(void) } if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) - { - if (snprintf(buf, HUGE_STRING_LENGTH, " WHERE id = ") > HUGE_STRING_LENGTH) - { - fprintf(stderr, "Memory Allocation error in creating update_string\n"); - exit(1); - } - dynstr_append(&update_string, buf); - } + dynstr_append(&update_string, " WHERE id = "); ptr= (statement *)my_malloc(sizeof(statement), @@ -854,7 +914,7 @@ static statement * build_insert_string(void) { char buf[HUGE_STRING_LENGTH]; - int col_count; + unsigned int col_count; statement *ptr; DYNAMIC_STRING insert_string; DBUG_ENTER("build_insert_string"); @@ -865,12 +925,7 @@ build_insert_string(void) if (auto_generate_sql_autoincrement) { - if (snprintf(buf, HUGE_STRING_LENGTH, "NULL") > HUGE_STRING_LENGTH) - { - fprintf(stderr, "Memory Allocation error in creating insert\n"); - exit(1); - } - dynstr_append(&insert_string, buf); + dynstr_append(&insert_string, "NULL"); if (num_int_cols || num_char_cols) dynstr_append(&insert_string, ","); @@ -878,12 +933,23 @@ build_insert_string(void) if (auto_generate_sql_guid_primary) { - if (snprintf(buf, HUGE_STRING_LENGTH, "uuid()") > HUGE_STRING_LENGTH) + dynstr_append(&insert_string, "uuid()"); + + if (num_int_cols || num_char_cols) + dynstr_append(&insert_string, ","); + } + + if (auto_generate_sql_secondary_indexes) + { + unsigned int count; + + for (count= 0; count < auto_generate_sql_secondary_indexes; count++) { - fprintf(stderr, "Memory Allocation error in create table\n"); - exit(1); + if (count) /* Except for the first pass we add a comma */ + dynstr_append(&insert_string, ","); + + dynstr_append(&insert_string, "uuid()"); } - dynstr_append(&insert_string, buf); if (num_int_cols || num_char_cols) dynstr_append(&insert_string, ","); @@ -939,7 +1005,7 @@ static statement * build_select_string(my_bool key) { char buf[HUGE_STRING_LENGTH]; - int col_count; + unsigned int col_count; statement *ptr; static DYNAMIC_STRING query_string; DBUG_ENTER("build_select_string"); @@ -1088,6 +1154,29 @@ get_options(int *argc,char ***argv) if (opt_only_print) opt_silent= TRUE; + if (num_int_cols_opt) + { + option_string *str; + parse_option(num_int_cols_opt, &str, ','); + num_int_cols= atoi(str->string); + if (str->option) + num_int_cols_index= atoi(str->option); + option_cleanup(str); + } + + if (num_char_cols_opt) + { + option_string *str; + parse_option(num_char_cols_opt, &str, ','); + num_char_cols= atoi(str->string); + if (str->option) + num_char_cols_index= atoi(str->option); + else + num_char_cols_index= 0; + option_cleanup(str); + } + + if (auto_generate_sql) { unsigned long long x= 0; @@ -1253,7 +1342,7 @@ get_options(int *argc,char ***argv) printf("Parsing engines to use.\n"); if (default_engine) - parse_delimiter(default_engine, &engine_statements, ','); + parse_option(default_engine, &engine_options, ','); if (tty_password) opt_password= get_tty_password(NullS); @@ -1276,10 +1365,8 @@ static int run_query(MYSQL *mysql, const char *query, int len) static int -generate_primary_key_list(MYSQL *mysql, statement *engine_stmt) +generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt) { - char query[HUGE_STRING_LENGTH]; - int len; MYSQL_RES *result; MYSQL_ROW row; unsigned long long counter; @@ -1301,9 +1388,7 @@ generate_primary_key_list(MYSQL *mysql, statement *engine_stmt) } else { - len= snprintf(query, HUGE_STRING_LENGTH, "SELECT id from t1"); - - if (run_query(mysql, query, len)) + if (run_query(mysql, "SELECT id from t1", strlen("SELECT id from t1"))) { fprintf(stderr,"%s: Cannot select GUID primary keys. (%s)\n", my_progname, mysql_error(mysql)); @@ -1352,7 +1437,7 @@ drop_primary_key_list(void) static int create_schema(MYSQL *mysql, const char *db, statement *stmt, - statement *engine_stmt) + option_string *engine_stmt) { char query[HUGE_STRING_LENGTH]; statement *ptr; @@ -1411,11 +1496,27 @@ limit_not_met: if (auto_generate_sql && ( auto_generate_sql_number == count)) break; - if (run_query(mysql, ptr->string, ptr->length)) + if (engine_stmt && engine_stmt->option && ptr->type == CREATE_TABLE_TYPE) { - fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", - my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); - exit(1); + char buffer[HUGE_STRING_LENGTH]; + + snprintf(buffer, HUGE_STRING_LENGTH, "%s %s", ptr->string, + engine_stmt->option); + if (run_query(mysql, buffer, strlen(buffer))) + { + fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", + my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); + exit(1); + } + } + else + { + if (run_query(mysql, ptr->string, ptr->length)) + { + fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", + my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); + exit(1); + } } } @@ -1734,6 +1835,84 @@ end: DBUG_RETURN(0); } +uint +parse_option(const char *origin, option_string **stmt, char delm) +{ + char *retstr; + char *ptr= (char *)origin; + option_string **sptr= stmt; + option_string *tmp; + uint length= strlen(origin); + uint count= 0; /* We know that there is always one */ + + for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + (retstr= strchr(ptr, delm)); + tmp->next= (option_string *)my_malloc(sizeof(option_string), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)), + tmp= tmp->next) + { + char buffer[HUGE_STRING_LENGTH]; + char *buffer_ptr; + + count++; + strncpy(buffer, ptr, (size_t)(retstr - ptr)); + if ((buffer_ptr= strchr(buffer, ':'))) + { + char *option_ptr; + + tmp->length= (size_t)(buffer_ptr - buffer); + tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE)); + + option_ptr= ptr + 1 + tmp->length; + + /* Move past the : and the first string */ + tmp->option_length= (size_t)(retstr - option_ptr); + tmp->option= my_strndup(option_ptr, tmp->option_length, + MYF(MY_FAE)); + } + else + { + tmp->string= my_strndup(ptr, (size_t)(retstr - ptr), MYF(MY_FAE)); + tmp->length= (size_t)(retstr - ptr); + } + + ptr+= retstr - ptr + 1; + if (isspace(*ptr)) + ptr++; + count++; + } + + if (ptr != origin+length) + { + char *origin_ptr; + + if ((origin_ptr= strchr(ptr, ':'))) + { + char *option_ptr; + + tmp->length= (size_t)(origin_ptr - ptr); + tmp->string= my_strndup(origin, tmp->length, MYF(MY_FAE)); + + option_ptr= (char *)ptr + 1 + tmp->length; + + /* Move past the : and the first string */ + tmp->option_length= (size_t)((ptr + length) - option_ptr); + tmp->option= my_strndup(option_ptr, tmp->option_length, + MYF(MY_FAE)); + } + else + { + tmp->length= (size_t)((ptr + length) - ptr); + tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE)); + } + + count++; + } + + return count; +} + uint parse_delimiter(const char *script, statement **stmt, char delm) @@ -1821,9 +2000,11 @@ void print_conclusions_csv(conclusions *con) { char buffer[HUGE_STRING_LENGTH]; + const char *ptr= auto_generate_sql_type ? auto_generate_sql_type : "query"; snprintf(buffer, HUGE_STRING_LENGTH, - "%s,query,%ld.%03ld,%ld.%03ld,%ld.%03ld,%d,%llu\n", + "%s,%s,%ld.%03ld,%ld.%03ld,%ld.%03ld,%d,%llu\n", con->engine ? con->engine : "", /* Storage engine we ran against */ + ptr, /* Load type */ con->avg_timing / 1000, con->avg_timing % 1000, /* Time to load */ con->min_timing / 1000, con->min_timing % 1000, /* Min time */ con->max_timing / 1000, con->max_timing % 1000, /* Max time */ @@ -1834,7 +2015,7 @@ print_conclusions_csv(conclusions *con) } void -generate_stats(conclusions *con, statement *eng, stats *sptr) +generate_stats(conclusions *con, option_string *eng, stats *sptr) { stats *ptr; unsigned int x; @@ -1866,6 +2047,24 @@ generate_stats(conclusions *con, statement *eng, stats *sptr) con->engine= NULL; } +void +option_cleanup(option_string *stmt) +{ + option_string *ptr, *nptr; + if (!stmt) + return; + + for (ptr= stmt; ptr; ptr= nptr) + { + nptr= ptr->next; + if (ptr->string) + my_free((gptr)ptr->string, MYF(0)); + if (ptr->option) + my_free((gptr)ptr->option, MYF(0)); + my_free((gptr)(byte *)ptr, MYF(0)); + } +} + void statement_cleanup(statement *stmt) { diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test index 5d98dac03ea..f2bb9a72ecf 100644 --- a/mysql-test/t/mysqlslap.test +++ b/mysql-test/t/mysqlslap.test @@ -32,3 +32,5 @@ --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=5 --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5 + +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5 --auto-generate-sql-secondary-indexes=3 diff --git a/sql/authors.h b/sql/authors.h index 48b807c7884..dfe3b143e2f 100644 --- a/sql/authors.h +++ b/sql/authors.h @@ -66,6 +66,7 @@ struct show_table_authors_st show_table_authors[]= { "Parser, port to OS/2, storage engines and some random stuff" }, { "Yuri Dario", "", "OS/2 port" }, { "Andrei Elkin", "Espoo, Finland", "Replication" }, + { "Patrick Galbraith", "Sharon, NH", "Federated Engine, mysqlslap" }, { "Sergei Golubchik", "Kerpen, Germany", "Full-text search, precision math" }, { "Lenz Grimmer", "Hamburg, Germany", From bb5b81769adc7b2535e0b7515e4921ee58350e11 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 08:51:29 +0100 Subject: [PATCH 167/789] bug #26591 Cluster handler does not set bits in null bytes correctly: Set filler bits and unmark the ones with values by calling field->set_notnull() --- sql/ha_ndbcluster.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index dfdcffc4e71..f3ab435beb7 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3109,11 +3109,15 @@ void ndb_unpack_record(TABLE *table, NdbValue *value, my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set); DBUG_ENTER("ndb_unpack_record"); + // Set filler bits + if (table->s->null_bytes > 0) + buf[table->s->null_bytes - 1]|= 256U - (1U << + table->s->last_null_bit_pos); // Set null flag(s) - bzero(buf, table->s->null_bytes); for ( ; field; p_field++, value++, field= *p_field) { + field->set_notnull(row_offset); if ((*value).ptr) { if (!(field->flags & BLOB_FLAG)) @@ -3123,7 +3127,7 @@ void ndb_unpack_record(TABLE *table, NdbValue *value, { if (is_null > 0) { - DBUG_PRINT("info",("[%u] NULL", + DBUG_PRINT("info",("[%u] NULL", (*value).rec->getColumn()->getColumnNo())); field->set_null(row_offset); } From a51b7686000d01d488617b59f543b0cff5e223bb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 12:15:51 +0400 Subject: [PATCH 168/789] Bug#26285 selecting information_schema crahes server The crash happens when 'skip-grant-tables' is enabled. We skip the filling of I_S privilege tables if acl_cache is not initialized. mysql-test/r/skip_grants.result: test result mysql-test/t/skip_grants.test: test case sql/sql_acl.cc: skip filling of I_S privilege tables if acl_cache is not initialized --- mysql-test/r/skip_grants.result | 12 ++++++++++++ mysql-test/t/skip_grants.test | 8 ++++++++ sql/sql_acl.cc | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result index 58ced16acac..3052bae8e97 100644 --- a/mysql-test/r/skip_grants.result +++ b/mysql-test/r/skip_grants.result @@ -58,3 +58,15 @@ DROP PROCEDURE p3; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; +select count(*) from information_schema.COLUMN_PRIVILEGES; +count(*) +0 +select count(*) from information_schema.SCHEMA_PRIVILEGES; +count(*) +0 +select count(*) from information_schema.TABLE_PRIVILEGES; +count(*) +0 +select count(*) from information_schema.USER_PRIVILEGES; +count(*) +0 diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test index 6dda97fcf8a..75694672a17 100644 --- a/mysql-test/t/skip_grants.test +++ b/mysql-test/t/skip_grants.test @@ -108,3 +108,11 @@ DROP PROCEDURE p3; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; + +# +# Bug#26285 Selecting information_schema crahes server +# +select count(*) from information_schema.COLUMN_PRIVILEGES; +select count(*) from information_schema.SCHEMA_PRIVILEGES; +select count(*) from information_schema.TABLE_PRIVILEGES; +select count(*) from information_schema.USER_PRIVILEGES; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 298fb61d5f0..ee15f95f305 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -5882,6 +5882,8 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_user_privileges"); + if (!initialized) + DBUG_RETURN(0); pthread_mutex_lock(&acl_cache->lock); for (counter=0 ; counter < acl_users.elements ; counter++) @@ -5941,6 +5943,8 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_schema_privileges"); + if (!initialized) + DBUG_RETURN(0); pthread_mutex_lock(&acl_cache->lock); for (counter=0 ; counter < acl_dbs.elements ; counter++) From 2e8e78a42cbe49d2e74381c9229d2e93c8df6f0d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 10:35:39 +0200 Subject: [PATCH 169/789] Bug #26261: INSERT uses query_id to verify what fields are mentioned in the fields list of the INSERT command. However the check for that is made after the ON DUPLICATE KEY is processed. This causes all the fields mentioned in ON DUPLICATE KEY to be considered as mentioned in the fields list of INSERT. Moved the check up, right after processing the fields list. mysql-test/r/insert_update.result: Bug #26261: test case mysql-test/t/insert_update.test: Bug #26261: test case sql/mysql_priv.h: Bug #26261: moved the check inside mysql_prepare_insert sql/sql_insert.cc: Bug #26261: move the check inside mysql_prepare_insert before setting up the ON DUPLICATE KEY part sql/sql_prepare.cc: Bug #26261: moved the check inside mysql_prepare_insert --- mysql-test/r/insert_update.result | 11 +++++ mysql-test/t/insert_update.test | 21 ++++++++++ sql/mysql_priv.h | 3 +- sql/sql_insert.cc | 68 ++++++++++++++++++++----------- sql/sql_prepare.cc | 2 +- 5 files changed, 80 insertions(+), 25 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index f658ff06624..2403de5f7a9 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -236,3 +236,14 @@ INSERT INTO t2 VALUES (1), (3); INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a; ERROR 42S22: Unknown column 'a' in 'field list' DROP TABLE t1,t2; +SET SQL_MODE = 'TRADITIONAL'; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); +INSERT INTO t1 (a) VALUES (1); +ERROR HY000: Field 'b' doesn't have a default value +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b; +ERROR HY000: Field 'b' doesn't have a default value +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b; +ERROR HY000: Field 'b' doesn't have a default value +SELECT * FROM t1; +a b +DROP TABLE t1; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 4581cc7a875..3ebcf7d8ff3 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -162,3 +162,24 @@ INSERT INTO t2 VALUES (1), (3); --error ER_BAD_FIELD_ERROR INSERT INTO t1 SELECT 1, COUNT(*) FROM t2 ON DUPLICATE KEY UPDATE j= a; DROP TABLE t1,t2; + +# +# Bug #26261: Missing default value isn't noticed in +# insert ... on duplicate key update +# +SET SQL_MODE = 'TRADITIONAL'; + +CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); + +--error 1364 +INSERT INTO t1 (a) VALUES (1); + +--error 1364 +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b; + +--error 1364 +INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b; + +SELECT * FROM t1; + +DROP TABLE t1; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f90ea5587fa..e5877e8ed1f 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -823,7 +823,8 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table, List &fields, List_item *values, List &update_fields, List &update_values, enum_duplicates duplic, - COND **where, bool select_insert); + COND **where, bool select_insert, + bool check_fields, bool abort_on_warning); bool mysql_insert(THD *thd,TABLE_LIST *table,List &fields, List &values, List &update_fields, List &update_values, enum_duplicates flag, diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 332c4c82ba1..dfff70e858e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -451,10 +451,15 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, thd->proc_info="init"; thd->used_tables=0; values= its++; + value_count= values->elements; if (mysql_prepare_insert(thd, table_list, table, fields, values, update_fields, update_values, duplic, &unused_conds, - FALSE)) + FALSE, + (fields.elements || !value_count), + !ignore && (thd->variables.sql_mode & + (MODE_STRICT_TRANS_TABLES | + MODE_STRICT_ALL_TABLES)))) goto abort; /* mysql_prepare_insert set table_list->table if it was not set */ @@ -480,7 +485,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, table_list->next_local= 0; context->resolve_in_table_list_only(table_list); - value_count= values->elements; while ((values= its++)) { counter++; @@ -551,17 +555,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, table->file->start_bulk_insert(values_list.elements); thd->no_trans_update= 0; - thd->abort_on_warning= (!ignore && - (thd->variables.sql_mode & - (MODE_STRICT_TRANS_TABLES | - MODE_STRICT_ALL_TABLES))); - - if ((fields.elements || !value_count) && - check_that_all_fields_are_given_values(thd, table, table_list)) - { - /* thd->net.report_error is now set, which will abort the next loop */ - error= 1; - } + thd->abort_on_warning= (!ignore && (thd->variables.sql_mode & + (MODE_STRICT_TRANS_TABLES | + MODE_STRICT_ALL_TABLES))); mark_fields_used_by_triggers_for_insert_stmt(thd, table, duplic); @@ -934,6 +930,10 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list, be taken from table_list->table) where Where clause (for insert ... select) select_insert TRUE if INSERT ... SELECT statement + check_fields TRUE if need to check that all INSERT fields are + given values. + abort_on_warning whether to report if some INSERT field is not + assigned as an error (TRUE) or as a warning (FALSE). TODO (in far future) In cases of: @@ -954,7 +954,8 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table, List &fields, List_item *values, List &update_fields, List &update_values, enum_duplicates duplic, - COND **where, bool select_insert) + COND **where, bool select_insert, + bool check_fields, bool abort_on_warning) { SELECT_LEX *select_lex= &thd->lex->select_lex; Name_resolution_context *context= &select_lex->context; @@ -1017,10 +1018,22 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, table_list->next_local= 0; context->resolve_in_table_list_only(table_list); - if (!(res= check_insert_fields(thd, context->table_list, fields, *values, - !insert_into_view, &map) || - setup_fields(thd, 0, *values, 0, 0, 0)) - && duplic == DUP_UPDATE) + res= check_insert_fields(thd, context->table_list, fields, *values, + !insert_into_view, &map) || + setup_fields(thd, 0, *values, 0, 0, 0); + + if (!res && check_fields) + { + bool saved_abort_on_warning= thd->abort_on_warning; + thd->abort_on_warning= abort_on_warning; + res= check_that_all_fields_are_given_values(thd, + table ? table : + context->table_list->table, + context->table_list); + thd->abort_on_warning= saved_abort_on_warning; + } + + if (!res && duplic == DUP_UPDATE) { select_lex->no_wrap_view_item= TRUE; res= check_update_fields(thd, context->table_list, update_fields, &map); @@ -2295,7 +2308,7 @@ bool mysql_insert_select_prepare(THD *thd) lex->query_tables->table, lex->field_list, 0, lex->update_list, lex->value_list, lex->duplicates, - &select_lex->where, TRUE)) + &select_lex->where, TRUE, FALSE, FALSE)) DBUG_RETURN(TRUE); /* @@ -2357,7 +2370,18 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) !insert_into_view, &map) || setup_fields(thd, 0, values, 0, 0, 0); - if (info.handle_duplicates == DUP_UPDATE) + if (!res && fields->elements) + { + bool saved_abort_on_warning= thd->abort_on_warning; + thd->abort_on_warning= !info.ignore && (thd->variables.sql_mode & + (MODE_STRICT_TRANS_TABLES | + MODE_STRICT_ALL_TABLES)); + res= check_that_all_fields_are_given_values(thd, table_list->table, + table_list); + thd->abort_on_warning= saved_abort_on_warning; + } + + if (info.handle_duplicates == DUP_UPDATE && !res) { Name_resolution_context *context= &lex->select_lex.context; Name_resolution_context_state ctx_state; @@ -2459,9 +2483,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))); - res= ((fields->elements && - check_that_all_fields_are_given_values(thd, table, table_list)) || - table_list->prepare_where(thd, 0, TRUE) || + res= (table_list->prepare_where(thd, 0, TRUE) || table_list->prepare_check_option(thd)); if (!res) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ad2b0be4eb8..8e807ca0ada 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1058,7 +1058,7 @@ static bool mysql_test_insert(Prepared_statement *stmt, if (mysql_prepare_insert(thd, table_list, table_list->table, fields, values, update_fields, update_values, - duplic, &unused_conds, FALSE)) + duplic, &unused_conds, FALSE, FALSE, FALSE)) goto error; value_count= values->elements; From 396f84aa82d371bb0341e7c0c4c37235cca5c9a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 10:28:48 +0100 Subject: [PATCH 170/789] Bug#26231 - select count(*) on myisam table returns wrong value when index is used When the table contained TEXT columns with empty contents ('', zero length, but not NULL) _and_ strings starting with control characters like tabulator or newline, the empty values were not found in a "records in range" estimate. Hence count(*) missed these records. The reason was a different set of search flags used for key insert and key range estimation. I decided to fix the set of flags used in range estimation. Otherwise millions of databases around the world would require a repair after an upgrade. The consequence is that the manual must be fixed, which claims that TEXT columns are compared with "end space padding". This is true for CHAR/VARCHAR but wrong for TEXT. See also bug 21335. myisam/mi_range.c: Bug#26231 - select count(*) on myisam table returns wrong value when index is used Added SEARCH_UPDATE to the search flags so that it compares like write/update/delete operations do. Only so it expects the keys at the place where they have been inserted. myisam/mi_search.c: Bug#26231 - select count(*) on myisam table returns wrong value when index is used Added some comments to explain how _mi_get_binary_pack_key() works. mysql-test/r/myisam.result: Bug#26231 - select count(*) on myisam table returns wrong value when index is used Added a test. mysql-test/t/myisam.test: Bug#26231 - select count(*) on myisam table returns wrong value when index is used Added test result. --- myisam/mi_range.c | 36 ++++++++- myisam/mi_search.c | 42 +++++++++-- mysql-test/r/myisam.result | 150 +++++++++++++++++++++++++++++++++++++ mysql-test/t/myisam.test | 144 +++++++++++++++++++++++++++++++++++ 4 files changed, 364 insertions(+), 8 deletions(-) diff --git a/myisam/mi_range.c b/myisam/mi_range.c index 4248fa7f04b..e9bec50f971 100644 --- a/myisam/mi_range.c +++ b/myisam/mi_range.c @@ -145,8 +145,42 @@ static ha_rows _mi_record_pos(MI_INFO *info, const byte *key, uint key_len, if (!(nextflag & (SEARCH_FIND | SEARCH_NO_FIND | SEARCH_LAST))) key_len=USE_WHOLE_KEY; + /* + my_handler.c:mi_compare_text() has a flag 'skip_end_space'. + This is set in my_handler.c:ha_key_cmp() in dependence on the + compare flags 'nextflag' and the column type. + + TEXT columns are of type HA_KEYTYPE_VARTEXT. In this case the + condition is skip_end_space= ((nextflag & (SEARCH_FIND | + SEARCH_UPDATE)) == SEARCH_FIND). + + SEARCH_FIND is used for an exact key search. The combination + SEARCH_FIND | SEARCH_UPDATE is used in write/update/delete + operations with a comment like "Not real duplicates", whatever this + means. From the condition above we can see that 'skip_end_space' is + always false for these operations. The result is that trailing space + counts in key comparison and hence, emtpy strings ('', string length + zero, but not NULL) compare less that strings starting with control + characters and these in turn compare less than strings starting with + blanks. + + When estimating the number of records in a key range, we request an + exact search for the minimum key. This translates into a plain + SEARCH_FIND flag. Using this alone would lead to a 'skip_end_space' + compare. Empty strings would be expected above control characters. + Their keys would not be found because they are located below control + characters. + + This is the reason that we add the SEARCH_UPDATE flag here. It makes + the key estimation compare in the same way like key write operations + do. Olny so we will find the keys where they have been inserted. + + Adding the flag unconditionally does not hurt as it is used in the + above mentioned condition only. So it can safely be used together + with other flags. + */ pos=_mi_search_pos(info,keyinfo,key_buff,key_len, - nextflag | SEARCH_SAVE_BUFF, + nextflag | SEARCH_SAVE_BUFF | SEARCH_UPDATE, info->s->state.key_root[inx]); if (pos >= 0.0) { diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 517fc9c25ff..34cd1ec96fd 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -918,11 +918,16 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, /* Keys are compressed the following way: - prefix length Packed length of prefix for the prev key. (1 or 3 bytes) + prefix length Packed length of prefix common with prev key (1 or 3 bytes) for each key segment: [is null] Null indicator if can be null (1 byte, zero means null) [length] Packed length if varlength (1 or 3 bytes) + key segment 'length' bytes of key segment value pointer Reference to the data file (last_keyseg->length). + + get_key_length() is a macro. It gets the prefix length from 'page' + and puts it into 'length'. It increments 'page' by 1 or 3, depending + on the packed length of the prefix length. */ get_key_length(length,page); if (length) @@ -935,34 +940,44 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); /* Wrong key */ } - from=key; from_end=key+length; + /* Key is packed against prev key, take prefix from prev key. */ + from= key; + from_end= key + length; } else { - from=page; from_end=page_end; /* Not packed key */ + /* Key is not packed against prev key, take all from page buffer. */ + from= page; + from_end= page_end; } /* - The trouble is that key is split in two parts: - The first part is in from ...from_end-1. - The second part starts at page + The trouble is that key can be split in two parts: + The first part (prefix) is in from .. from_end - 1. + The second part starts at page. + The split can be at every byte position. So we need to check for + the end of the first part before using every byte. */ for (keyseg=keyinfo->seg ; keyseg->type ;keyseg++) { if (keyseg->flag & HA_NULL_PART) { + /* If prefix is used up, switch to rest. */ if (from == from_end) { from=page; from_end=page_end; } if (!(*key++ = *from++)) continue; /* Null part */ } if (keyseg->flag & (HA_VAR_LENGTH | HA_BLOB_PART | HA_SPACE_PACK)) { - /* Get length of dynamic length key part */ + /* If prefix is used up, switch to rest. */ if (from == from_end) { from=page; from_end=page_end; } + /* Get length of dynamic length key part */ if ((length= (*key++ = *from++)) == 255) { + /* If prefix is used up, switch to rest. */ if (from == from_end) { from=page; from_end=page_end; } length= (uint) ((*key++ = *from++)) << 8; + /* If prefix is used up, switch to rest. */ if (from == from_end) { from=page; from_end=page_end; } length+= (uint) ((*key++ = *from++)); } @@ -982,20 +997,33 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, key+=length; from+=length; } + /* + Last segment (type == 0) contains length of data pointer. + If we have mixed key blocks with data pointer and key block pointer, + we have to copy both. + */ length=keyseg->length+nod_flag; if ((tmp=(uint) (from_end-from)) <= length) { + /* Remaining length is less or equal max possible length. */ memcpy(key+tmp,page,length-tmp); /* Get last part of key */ *page_pos= page+length-tmp; } else { + /* + Remaining length is greater than max possible length. + This can happen only if we switched to the new key bytes already. + 'page_end' is calculated with MI_MAX_KEY_BUFF. So it can be far + behind the real end of the key. + */ if (from_end != page_end) { DBUG_PRINT("error",("Error when unpacking key")); my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); /* Error */ } + /* Copy data pointer and, if appropriate, key block pointer. */ memcpy((byte*) key,(byte*) from,(size_t) length); *page_pos= from+length; } diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 4b17e8c9840..4aae100695a 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -944,4 +944,154 @@ SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 MyISAM 9 Dynamic X X X 72057594037927935 X X X X X X latin1_swedish_ci X max_rows=4100100100 avg_row_length=70100 DROP TABLE t1; +CREATE TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM; +INSERT INTO t1 VALUES +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), +(''), (''), (''), (''), +(' B'), (' B'), (' B'), (' B'); +SELECT DISTINCT COUNT(*) FROM t1 WHERE c1 = ''; +COUNT(*) +4 +SELECT DISTINCT length(c1), c1 FROM t1 WHERE c1 = ''; +length(c1) c1 +0 +SELECT DISTINCT COUNT(*) FROM t1 IGNORE INDEX (c1) WHERE c1 = ''; +COUNT(*) +4 +SELECT DISTINCT length(c1), c1 FROM t1 IGNORE INDEX (c1) WHERE c1 = ''; +length(c1) c1 +0 +SELECT DISTINCT length(c1), c1 FROM t1 ORDER BY c1; +length(c1) c1 +0 +2 A +2 B +DROP TABLE t1; End of 4.1 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 68c7b55c501..f882a393621 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -882,4 +882,148 @@ CREATE TABLE t1 (c1 TEXT) AVG_ROW_LENGTH=70100 MAX_ROWS=4100100100; SHOW TABLE STATUS LIKE 't1'; DROP TABLE t1; +# +# Bug#26231 - select count(*) on myisam table returns wrong value +# when index is used +# +CREATE TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM; +# Fill at least two key blocks. "Tab, A" must be in both blocks. +INSERT INTO t1 VALUES + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), (CHAR(9,65)), + (''), (''), (''), (''), + (' B'), (' B'), (' B'), (' B'); +SELECT DISTINCT COUNT(*) FROM t1 WHERE c1 = ''; +SELECT DISTINCT length(c1), c1 FROM t1 WHERE c1 = ''; +SELECT DISTINCT COUNT(*) FROM t1 IGNORE INDEX (c1) WHERE c1 = ''; +SELECT DISTINCT length(c1), c1 FROM t1 IGNORE INDEX (c1) WHERE c1 = ''; +SELECT DISTINCT length(c1), c1 FROM t1 ORDER BY c1; +DROP TABLE t1; + --echo End of 4.1 tests From 5df4ea9a3f629023751bccb0033613441ab4a3ba Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 10:58:24 +0100 Subject: [PATCH 171/789] ndb - bug#27203 Allow readTablePk to stumble on scan+deleted tuple, reporting no-match instead of crash (in case scan is lock-owner) storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp: Allow readTablePk to stumble on scan+deleted tuple, reporting no-match instead of crash storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Allow readTablePk to stumble on scan+deleted tuple, reporting no-match instead of crash --- storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp | 2 +- .../ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp index 6337e252c0b..e75e88d95fa 100644 --- a/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp +++ b/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp @@ -760,7 +760,7 @@ private: void increaselistcont(Signal* signal); void seizeLeftlist(Signal* signal); void seizeRightlist(Signal* signal); - Uint32 readTablePk(Uint32 localkey1, Uint32 eh, const Operationrec*); + Uint32 readTablePk(Uint32 localkey1, Uint32 eh, OperationrecPtr); Uint32 getElement(Signal* signal, OperationrecPtr& lockOwner); void getdirindex(Signal* signal); void commitdelete(Signal* signal); diff --git a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index bf2fa5b7584..58032c92d5f 100644 --- a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -46,6 +46,7 @@ ndbrequire(false); } } while(0) #else #define vlqrequire(x) ndbrequire(x) +#define dump_lock_queue(x) #endif @@ -3184,7 +3185,7 @@ void Dbacc::getdirindex(Signal* signal) }//Dbacc::getdirindex() Uint32 -Dbacc::readTablePk(Uint32 localkey1, Uint32 eh, const Operationrec* op) +Dbacc::readTablePk(Uint32 localkey1, Uint32 eh, Ptr opPtr) { int ret; Uint32 tableId = fragrecptr.p->myTableId; @@ -3205,8 +3206,17 @@ Dbacc::readTablePk(Uint32 localkey1, Uint32 eh, const Operationrec* op) else { ndbrequire(ElementHeader::getLocked(eh)); - ndbrequire((op->m_op_bits & Operationrec::OP_MASK) != ZSCAN_OP); - ret = c_lqh->readPrimaryKeys(op->userptr, ckeys, xfrm); + if (unlikely((opPtr.p->m_op_bits & Operationrec::OP_MASK) == ZSCAN_OP)) + { + dump_lock_queue(opPtr); + ndbrequire(opPtr.p->nextParallelQue == RNIL); + ndbrequire(opPtr.p->nextSerialQue == RNIL); + ndbrequire(opPtr.p->m_op_bits & Operationrec::OP_ELEMENT_DISAPPEARED); + ndbrequire(opPtr.p->m_op_bits & Operationrec::OP_COMMIT_DELETE_CHECK); + ndbrequire((opPtr.p->m_op_bits & Operationrec::OP_STATE_MASK) == Operationrec::OP_STATE_RUNNING); + return 0; + } + ret = c_lqh->readPrimaryKeys(opPtr.p->userptr, ckeys, xfrm); } jamEntry(); ndbrequire(ret >= 0); @@ -3351,7 +3361,7 @@ Dbacc::getElement(Signal* signal, OperationrecPtr& lockOwnerPtr) if (! searchLocalKey) { Uint32 len = readTablePk(localkey1, tgeElementHeader, - lockOwnerPtr.p); + lockOwnerPtr); found = (len == operationRecPtr.p->xfrmtupkeylen) && (memcmp(Tkeydata, ckeys, len << 2) == 0); } else { @@ -6866,6 +6876,7 @@ void Dbacc::execACC_TO_REQ(Signal* signal) { tatrOpPtr.p->transId1 = signal->theData[2]; tatrOpPtr.p->transId2 = signal->theData[3]; + validate_lock_queue(tatrOpPtr); } else { jam(); signal->theData[0] = cminusOne; From 189398b359c1eb512a417c10b99f10fb2614d098 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 11:52:30 +0100 Subject: [PATCH 172/789] Bug#27022 Install fails with Duplicate entry '%-test-' for key 'PRIMARY' - Bail out with error if MySQL System tables already exist scripts/mysql_install_db.sh: Bail out with error if the MySQL system tables already exist in the location where we want to install --- scripts/mysql_install_db.sh | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5dd5d86c666..c1a27eb0bc8 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -135,6 +135,17 @@ else fi fi +# Check that no previous MySQL installation exist +if test -f "$ldata/mysql/db.frm" +then + echo "FATAL ERROR: Found already existing MySQL system tables" + echo "in $ldata." + echo "If you are upgrading from a previous MySQL version you" + echo "should run '$bindir/mysql_upgrade', " + echo "to upgrade all tables for this version of MySQL" + exit 1; +fi + # Find SQL scripts needed for bootstrap fill_help_tables="fill_help_tables.sql" create_system_tables="mysql_system_tables.sql" @@ -181,7 +192,6 @@ then fi # Find executables and paths -mdata=$ldata/mysql mysqld=$execdir/mysqld mysqld_opt="" scriptdir=$bindir @@ -264,12 +274,6 @@ if test -w / -a ! -z "$user"; then chown $user $ldata $ldata/mysql $ldata/test; fi -# Check is "db" table already exist -if test ! -f $mdata/db.frm -then - db_table_already_exist="yes" -fi - if test -n "$user"; then args="$args --user=$user" fi @@ -322,16 +326,6 @@ then echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." - # Print message about upgrading unless we have created a new db table. - if test -z "$db_table_already_exist" - then - echo - echo "NOTE: If you are upgrading from a previous MySQL verision you " - echo "should run '$bindir/mysql_upgrade', to make sure all tables have " - echo "been upgraded for this version of MySQL" - fi - echo - if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" From ffc605aad563c7634ea6b5ac8cb480793fcb9258 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 14:25:11 +0100 Subject: [PATCH 173/789] Bug#20777 Function w BIGINT UNSIGNED shows diff. behaviour with and without --ps-protocol - Stored procedures returning unsinged values returns signed values if text protocol is used. The reason is that the stored proceedure item Item_func_sp wasn't initializing the member variables properly based on the information contained in the associated result field. - The patch is to upon field-item association, ::fix_fields, initialize the member variables in appropriate order. - Field type of an Item_func_sp was hard coded to MYSQL_TYPE_VARCHAR. This is changed to return the type of the actual result field. - Member function name sp_result_field was refactored to the more appropriate init_result_field. - Member function name find_and_check_access was refactored to sp_check_access. mysql-test/r/sp.result: - Added test mysql-test/t/sp.test: - Added test sql/item_func.cc: Bug#20777 Function w BIGINT UNSIGNED shows diff. behaviour with and without --ps-protocol - Stored procedures returning unsinged values returns signed values if text protocol is used. The reason is that the stored proceedure item Item_func_sp wasn't initializing the member variables properly based on the information contained in the associated result field. - The patch is to upon field-item association, ::fix_fields, initialize the member variables in appropriate order. - Field type of an Item_func_sp was hard coded to MYSQL_TYPE_VARCHAR. This is changed to to return the type of the actual result field. - Member function name sp_result_field was refactored to the more appropriate init_result_field. - Member function name find_and_check_access was refactored to sp_check_access. sql/item_func.h: Bug#20777 Function w BIGINT UNSIGNED shows diff. behaviour with and without --ps-protocol - Stored procedures returning unsinged values returns signed values if text protocol is used. The reason is that the stored proceedure item Item_func_sp wasn't initializing the member variables properly based on the information contained in the associated result field. - The patch is to upon field-item association, ::fix_fields, initialize the member variables in appropriate order. - Field type of an Item_func_sp was hard coded to MYSQL_TYPE_VARCHAR. This is changed to to return the type of the actual result field. - Member function name sp_result_field was refactored to the more appropriate init_result_field. - Member function name find_and_check_access was refactored to sp_check_access. --- mysql-test/r/sp.result | 88 +++++++++++ mysql-test/t/sp.test | 60 +++++++- sql/item_func.cc | 325 ++++++++++++++++++++--------------------- sql/item_func.h | 31 ++-- 4 files changed, 319 insertions(+), 185 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 8e3c057cc62..248df2c38d0 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5741,4 +5741,92 @@ END| CALL bug24117()| DROP PROCEDURE bug24117| DROP TABLE t3| +drop function if exists bug20777| +drop table if exists examplebug20777| +create function bug20777(f1 bigint unsigned) returns bigint unsigned +begin +set f1 = (f1 - 10); set f1 = (f1 + 10); +return f1; +end| +select bug20777(9223372036854775803) as '9223372036854775803 2**63-5'; +9223372036854775803 2**63-5 +9223372036854775803 +select bug20777(9223372036854775804) as '9223372036854775804 2**63-4'; +9223372036854775804 2**63-4 +9223372036854775804 +select bug20777(9223372036854775805) as '9223372036854775805 2**63-3'; +9223372036854775805 2**63-3 +9223372036854775805 +select bug20777(9223372036854775806) as '9223372036854775806 2**63-2'; +9223372036854775806 2**63-2 +9223372036854775806 +select bug20777(9223372036854775807) as '9223372036854775807 2**63-1'; +9223372036854775807 2**63-1 +9223372036854775807 +select bug20777(9223372036854775808) as '9223372036854775808 2**63+0'; +9223372036854775808 2**63+0 +9223372036854775808 +select bug20777(9223372036854775809) as '9223372036854775809 2**63+1'; +9223372036854775809 2**63+1 +9223372036854775809 +select bug20777(9223372036854775810) as '9223372036854775810 2**63+2'; +9223372036854775810 2**63+2 +9223372036854775810 +select bug20777(-9223372036854775808) as 'lower bounds signed bigint'; +lower bounds signed bigint +0 +select bug20777(9223372036854775807) as 'upper bounds signed bigint'; +upper bounds signed bigint +9223372036854775807 +select bug20777(0) as 'lower bounds unsigned bigint'; +lower bounds unsigned bigint +0 +select bug20777(18446744073709551615) as 'upper bounds unsigned bigint'; +upper bounds unsigned bigint +18446744073709551615 +select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1'; +upper bounds unsigned bigint + 1 +18446744073709551615 +select bug20777(-1) as 'lower bounds unsigned bigint - 1'; +lower bounds unsigned bigint - 1 +0 +select bug20777(1.84e+19) as 'submitter value, 1.84e19'; +submitter value, 1.84e19 +9223372036854775808 +create table examplebug20777 as select +0 as 'i', +bug20777(9223372036854775806) as '2**63-2', +bug20777(9223372036854775807) as '2**63-1', +bug20777(9223372036854775808) as '2**63', +bug20777(9223372036854775809) as '2**63+1', +bug20777(18446744073709551614) as '2**64-2', +bug20777(18446744073709551615) as '2**64-1', +bug20777(18446744073709551616) as '2**64', +bug20777(0) as '0', +bug20777(-1) as '-1'; +insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1); +show create table examplebug20777; +Table Create Table +examplebug20777 CREATE TABLE `examplebug20777` ( + `i` int(1) NOT NULL default '0', + `2**63-2` bigint(20) unsigned default NULL, + `2**63-1` bigint(20) unsigned default NULL, + `2**63` bigint(20) unsigned default NULL, + `2**63+1` bigint(20) unsigned default NULL, + `2**64-2` bigint(20) unsigned default NULL, + `2**64-1` bigint(20) unsigned default NULL, + `2**64` bigint(20) unsigned default NULL, + `0` bigint(20) unsigned default NULL, + `-1` bigint(20) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from examplebug20777 order by i; +i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 0 -1 +0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 18446744073709551615 0 0 +1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616 0 0 +drop table examplebug20777; +select bug20777(18446744073709551613)+1; +bug20777(18446744073709551613)+1 +18446744073709551614 +drop function bug20777; +End of 5.0 tests. drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index cfa4937e050..1945d5daf4d 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6715,9 +6715,56 @@ DROP PROCEDURE bug24117| DROP TABLE t3| # -# NOTE: The delimiter is `|`, and not `;`. It is changed to `;` -# at the end of the file! +# Bug#20777: Function w BIGINT UNSIGNED shows diff. behaviour --ps-protocol # +--disable_warnings +drop function if exists bug20777| +drop table if exists examplebug20777| +--enabled_warnings +create function bug20777(f1 bigint unsigned) returns bigint unsigned +begin + set f1 = (f1 - 10); set f1 = (f1 + 10); +return f1; +end| +delimiter ;| +select bug20777(9223372036854775803) as '9223372036854775803 2**63-5'; +select bug20777(9223372036854775804) as '9223372036854775804 2**63-4'; +select bug20777(9223372036854775805) as '9223372036854775805 2**63-3'; +select bug20777(9223372036854775806) as '9223372036854775806 2**63-2'; +select bug20777(9223372036854775807) as '9223372036854775807 2**63-1'; +select bug20777(9223372036854775808) as '9223372036854775808 2**63+0'; +select bug20777(9223372036854775809) as '9223372036854775809 2**63+1'; +select bug20777(9223372036854775810) as '9223372036854775810 2**63+2'; +select bug20777(-9223372036854775808) as 'lower bounds signed bigint'; +select bug20777(9223372036854775807) as 'upper bounds signed bigint'; +select bug20777(0) as 'lower bounds unsigned bigint'; +select bug20777(18446744073709551615) as 'upper bounds unsigned bigint'; +select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1'; +select bug20777(-1) as 'lower bounds unsigned bigint - 1'; +select bug20777(1.84e+19) as 'submitter value, 1.84e19'; + +create table examplebug20777 as select + 0 as 'i', + bug20777(9223372036854775806) as '2**63-2', + bug20777(9223372036854775807) as '2**63-1', + bug20777(9223372036854775808) as '2**63', + bug20777(9223372036854775809) as '2**63+1', + bug20777(18446744073709551614) as '2**64-2', + bug20777(18446744073709551615) as '2**64-1', + bug20777(18446744073709551616) as '2**64', + bug20777(0) as '0', + bug20777(-1) as '-1'; +insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1); +show create table examplebug20777; +select * from examplebug20777 order by i; + +drop table examplebug20777; +select bug20777(18446744073709551613)+1; +drop function bug20777; +delimiter |; + +### +--echo End of 5.0 tests. # # BUG#NNNN: New bug synopsis @@ -6726,8 +6773,13 @@ DROP TABLE t3| #drop procedure if exists bugNNNN| #--enable_warnings #create procedure bugNNNN... - +# # Add bugs above this line. Use existing tables t1 and t2 when -# practical, or create table t3, t4 etc temporarily (and drop them). +# practical, or create table t3,t4 etc temporarily (and drop them). +# NOTE: The delimiter is `|`, and not `;`. It is changed to `;` +# at the end of the file! +# + delimiter ;| drop table t1,t2; + diff --git a/sql/item_func.cc b/sql/item_func.cc index 32cc90b96d6..a27b7b6bcc2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4979,8 +4979,7 @@ longlong Item_func_row_count::val_int() Item_func_sp::Item_func_sp(Name_resolution_context *context_arg, sp_name *name) - :Item_func(), context(context_arg), m_name(name), m_sp(NULL), - result_field(NULL) + :Item_func(), context(context_arg), m_name(name), m_sp(NULL), sp_result_field(NULL) { maybe_null= 1; m_name->init_qname(current_thd); @@ -4990,21 +4989,21 @@ Item_func_sp::Item_func_sp(Name_resolution_context *context_arg, sp_name *name) Item_func_sp::Item_func_sp(Name_resolution_context *context_arg, sp_name *name, List &list) - :Item_func(list), context(context_arg), m_name(name), m_sp(NULL), - result_field(NULL) + :Item_func(list), context(context_arg), m_name(name), m_sp(NULL),sp_result_field(NULL) { maybe_null= 1; m_name->init_qname(current_thd); dummy_table= (TABLE*) sql_calloc(sizeof(TABLE)); } + void Item_func_sp::cleanup() { - if (result_field) + if (sp_result_field) { - delete result_field; - result_field= NULL; + delete sp_result_field; + sp_result_field= NULL; } m_sp= NULL; dummy_table->s= NULL; @@ -5033,82 +5032,117 @@ Item_func_sp::func_name() const } -Field * -Item_func_sp::sp_result_field(void) const + +/** + @brief Initialize the result field by creating a temporary dummy table + and assign it to a newly created field object. Meta data used to + create the field is fetched from the sp_head belonging to the stored + proceedure found in the stored procedure functon cache. + + @note This function should be called from fix_fields to init the result + field. It is some what related to Item_field. + + @see Item_field + + @param thd A pointer to the session and thread context. + + @return Function return error status. + @retval TRUE is returned on an error + @retval FALSE is returned on success. +*/ +bool +Item_func_sp::init_result_field(THD *thd) { - Field *field; - DBUG_ENTER("Item_func_sp::sp_result_field"); - DBUG_PRINT("info", ("sp: %s, flags: %x, level: %lu", - (m_sp ? "YES" : "NO"), - (m_sp ? m_sp->m_flags : (uint)0), - (m_sp ? m_sp->m_recursion_level : (ulong)0))); + DBUG_ENTER("Item_func_sp::init_result_field"); + + char *empty_name= (char *) ""; + TABLE_SHARE *share; - if (!m_sp) - { - THD *thd= current_thd; - if (!(m_sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, m_name, - &thd->sp_func_cache, TRUE))) - { - my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str); - DBUG_RETURN(0); - } - } - if (!dummy_table->s) - { - char *empty_name= (char *) ""; - TABLE_SHARE *share; - dummy_table->s= share= &dummy_table->share_not_to_be_used; - dummy_table->alias = empty_name; - dummy_table->maybe_null = maybe_null; - dummy_table->in_use= current_thd; - dummy_table->copy_blobs= TRUE; - share->table_cache_key = empty_name; - share->table_name = empty_name; - } - if (!(field= m_sp->create_result_field(max_length, name, dummy_table))) - my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); + DBUG_ASSERT(m_sp == NULL); + DBUG_ASSERT(sp_result_field == NULL); + DBUG_ASSERT(dummy_table->s == NULL); - DBUG_RETURN(field); + if (!(m_sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, m_name, + &thd->sp_func_cache, TRUE))) + { + my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str); + context->process_error(thd); + DBUG_RETURN(TRUE); + } + + /* + A Field need to be attached to a Table. + Below we "create" a dummy table by initializing + the needed pointers. + */ + dummy_table->s= share= &dummy_table->share_not_to_be_used; + dummy_table->alias = empty_name; + dummy_table->maybe_null = maybe_null; + dummy_table->in_use= thd; + dummy_table->copy_blobs= TRUE; + share->table_cache_key = empty_name; + share->table_name = empty_name; + + if (!(sp_result_field= m_sp->create_result_field(max_length, name, dummy_table))) + { + DBUG_RETURN(TRUE); + } + + if (sp_result_field->pack_length() > sizeof(result_buf)) + { + sp_result_field->move_field(sql_alloc(sp_result_field->pack_length())); + } else { + sp_result_field->move_field(result_buf); + } + + sp_result_field->null_ptr= (uchar *) &null_value; + sp_result_field->null_bit= 1; + + + DBUG_RETURN(FALSE); } +/** + @brief Initialize local members with values from the Field interface. -/* - Execute function & store value in field + @note called from Item::fix_fields. +*/ +void Item_func_sp::fix_length_and_dec() +{ + DBUG_ENTER("Item_func_sp::fix_length_and_dec"); - RETURN - 0 value <> NULL - 1 value = NULL or error + DBUG_ASSERT(sp_result_field); + decimals= sp_result_field->decimals(); + max_length= sp_result_field->field_length; + collation.set(sp_result_field->charset()); + maybe_null= 1; + unsigned_flag= test(sp_result_field->flags & UNSIGNED_FLAG); + + DBUG_VOID_RETURN; +} + +/** + @brief Execute function & store value in field. + + @return Function returns error status. + @retval FALSE on success. + @retval TRUE if an error occurred. */ bool -Item_func_sp::execute(Field **flp) +Item_func_sp::execute() { THD *thd= current_thd; - Field *f; - + /* Get field in virtual tmp table to store result. Create the field if invoked first time. */ - - if (!(f= *flp)) - { - if (!(*flp= f= sp_result_field())) - { - /* Error set by sp_result_field() */ - null_value= 1; - return TRUE; - } - f->move_field((f->pack_length() > sizeof(result_buf)) ? - sql_alloc(f->pack_length()) : result_buf); - f->null_ptr= (uchar *)&null_value; - f->null_bit= 1; - } /* Execute function and store the return value in the field. */ - if (execute_impl(thd, f)) + if (execute_impl(thd)) { null_value= 1; context->process_error(thd); @@ -5117,14 +5151,24 @@ Item_func_sp::execute(Field **flp) /* Check that the field (the value) is not NULL. */ - null_value= f->is_null(); + null_value= sp_result_field->is_null(); return null_value; } +/** + @brief Execute function and store the return value in the field. + + @note This function was intended to be the concrete implementation of + the interface function execute. This was never realized. + + @return The error state. + @retval FALSE on success + @retval TRUE if an error occurred. +*/ bool -Item_func_sp::execute_impl(THD *thd, Field *return_value_fld) +Item_func_sp::execute_impl(THD *thd) { bool err_status= TRUE; Sub_statement_state statement_state; @@ -5141,7 +5185,7 @@ Item_func_sp::execute_impl(THD *thd, Field *return_value_fld) thd->security_ctx= context->security_ctx; } #endif - if (find_and_check_access(thd)) + if (sp_check_access(thd)) goto error; /* @@ -5150,7 +5194,7 @@ Item_func_sp::execute_impl(THD *thd, Field *return_value_fld) function call into binlog. */ thd->reset_sub_statement_state(&statement_state, SUB_STMT_FUNCTION); - err_status= m_sp->execute_function(thd, args, arg_count, return_value_fld); + err_status= m_sp->execute_function(thd, args, arg_count, sp_result_field); thd->restore_sub_statement_state(&statement_state); error: @@ -5165,15 +5209,9 @@ error: void Item_func_sp::make_field(Send_field *tmp_field) { - Field *field; DBUG_ENTER("Item_func_sp::make_field"); - if ((field= sp_result_field())) - { - field->make_field(tmp_field); - delete field; - DBUG_VOID_RETURN; - } - init_make_field(tmp_field, MYSQL_TYPE_VARCHAR); + DBUG_ASSERT(sp_result_field); + sp_result_field->make_field(tmp_field); DBUG_VOID_RETURN; } @@ -5181,67 +5219,20 @@ Item_func_sp::make_field(Send_field *tmp_field) enum enum_field_types Item_func_sp::field_type() const { - Field *field; DBUG_ENTER("Item_func_sp::field_type"); - - if (result_field) - DBUG_RETURN(result_field->type()); - if ((field= sp_result_field())) - { - enum_field_types result= field->type(); - delete field; - DBUG_RETURN(result); - } - DBUG_RETURN(MYSQL_TYPE_VARCHAR); + DBUG_ASSERT(sp_result_field); + DBUG_RETURN(sp_result_field->type()); } - Item_result Item_func_sp::result_type() const { - Field *field; DBUG_ENTER("Item_func_sp::result_type"); DBUG_PRINT("info", ("m_sp = %p", m_sp)); - - if (result_field) - DBUG_RETURN(result_field->result_type()); - if ((field= sp_result_field())) - { - Item_result result= field->result_type(); - delete field; - DBUG_RETURN(result); - } - DBUG_RETURN(STRING_RESULT); + DBUG_ASSERT(sp_result_field); + DBUG_RETURN(sp_result_field->result_type()); } -void -Item_func_sp::fix_length_and_dec() -{ - Field *field; - DBUG_ENTER("Item_func_sp::fix_length_and_dec"); - - if (result_field) - { - decimals= result_field->decimals(); - max_length= result_field->field_length; - collation.set(result_field->charset()); - DBUG_VOID_RETURN; - } - - if (!(field= sp_result_field())) - { - context->process_error(current_thd); - DBUG_VOID_RETURN; - } - decimals= field->decimals(); - max_length= field->field_length; - collation.set(field->charset()); - maybe_null= 1; - delete field; - DBUG_VOID_RETURN; -} - - longlong Item_func_found_rows::val_int() { DBUG_ASSERT(fixed == 1); @@ -5252,57 +5243,39 @@ longlong Item_func_found_rows::val_int() Field * Item_func_sp::tmp_table_field(TABLE *t_arg) { - Field *field= 0; DBUG_ENTER("Item_func_sp::tmp_table_field"); - if (m_sp) - field= m_sp->create_result_field(max_length, (const char*) name, t_arg); - - if (!field) - field= Item_func::tmp_table_field(t_arg); - - if (!field) - my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); - - DBUG_RETURN(field); + DBUG_ASSERT(sp_result_field); + DBUG_RETURN(sp_result_field); } -/* - Find the function and check access rights to the function - - SYNOPSIS - find_and_check_access() - thd thread handler - - RETURN - FALSE Access granted - TRUE Requested access can't be granted or function doesn't exists - - NOTES - Checks if requested access to function can be granted to user. +/** + @brief Checks if requested access to function can be granted to user. If function isn't found yet, it searches function first. If function can't be found or user don't have requested access error is raised. + + @param thd thread handler + + @return Indication if the access was granted or not. + @retval FALSE Access is granted. + @retval TRUE Requested access can't be granted or function doesn't exists. + */ bool -Item_func_sp::find_and_check_access(THD *thd) +Item_func_sp::sp_check_access(THD *thd) { - if (! m_sp && ! (m_sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, m_name, - &thd->sp_func_cache, TRUE))) - { - my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str); - return TRUE; - } - + DBUG_ENTER("Item_func_sp::sp_check_access"); + DBUG_ASSERT(m_sp); #ifndef NO_EMBEDDED_ACCESS_CHECKS if (check_routine_access(thd, EXECUTE_ACL, m_sp->m_db.str, m_sp->m_name.str, 0, FALSE)) - return TRUE; + DBUG_RETURN(TRUE); #endif - return FALSE; + DBUG_RETURN(FALSE); } @@ -5310,9 +5283,25 @@ bool Item_func_sp::fix_fields(THD *thd, Item **ref) { bool res; + DBUG_ENTER("Item_func_sp::fix_fields"); DBUG_ASSERT(fixed == 0); + + /* + We must call init_result_field before Item_func::fix_fields() + to make m_sp and result_field members available to fix_length_and_dec(), + which is called from Item_func::fix_fields(). + */ + res= init_result_field(thd); + + if (res) + DBUG_RETURN(res); + res= Item_func::fix_fields(thd, ref); - if (!res && thd->lex->view_prepare_mode) + + if (res) + DBUG_RETURN(res); + + if (thd->lex->view_prepare_mode) { /* Here we check privileges of the stored routine only during view @@ -5324,15 +5313,17 @@ Item_func_sp::fix_fields(THD *thd, Item **ref) good idea especially if the view has SQL SECURITY DEFINER and the used stored procedure has SQL SECURITY DEFINER. */ - res= find_and_check_access(thd); + res= sp_check_access(thd); #ifndef NO_EMBEDDED_ACCESS_CHECKS + /* + Try to set and restore the security context to see whether it's valid + */ Security_context *save_secutiry_ctx; - if (!res && !(res= set_routine_security_ctx(thd, m_sp, false, - &save_secutiry_ctx))) - { + res= set_routine_security_ctx(thd, m_sp, false, &save_secutiry_ctx); + if (!res) sp_restore_security_context(thd, save_secutiry_ctx); - } + #endif /* ! NO_EMBEDDED_ACCESS_CHECKS */ } - return res; + DBUG_RETURN(res); } diff --git a/sql/item_func.h b/sql/item_func.h index 68591f9c6f5..6a619327590 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1405,12 +1405,15 @@ private: sp_name *m_name; mutable sp_head *m_sp; TABLE *dummy_table; - Field *result_field; char result_buf[64]; + /* + The result field of the concrete stored function. + */ + Field *sp_result_field; - bool execute(Field **flp); - bool execute_impl(THD *thd, Field *return_value_fld); - Field *sp_result_field(void) const; + bool execute(); + bool execute_impl(THD *thd); + bool init_result_field(THD *thd); public: @@ -1436,23 +1439,23 @@ public: longlong val_int() { - if (execute(&result_field)) + if (execute()) return (longlong) 0; - return result_field->val_int(); + return sp_result_field->val_int(); } double val_real() { - if (execute(&result_field)) + if (execute()) return 0.0; - return result_field->val_real(); + return sp_result_field->val_real(); } my_decimal *val_decimal(my_decimal *dec_buf) { - if (execute(&result_field)) + if (execute()) return NULL; - return result_field->val_decimal(dec_buf); + return sp_result_field->val_decimal(dec_buf); } String *val_str(String *str) @@ -1461,7 +1464,7 @@ public: char buff[20]; buf.set(buff, 20, str->charset()); buf.length(0); - if (execute(&result_field)) + if (execute()) return NULL; /* result_field will set buf pointing to internal buffer @@ -1469,7 +1472,7 @@ public: when SP is executed. In order to prevent occasional corruption of returned value, we make here a copy. */ - result_field->val_str(&buf); + sp_result_field->val_str(&buf); str->copy(buf); return str; } @@ -1477,11 +1480,11 @@ public: virtual bool change_context_processor(byte *cntx) { context= (Name_resolution_context *)cntx; return FALSE; } - void fix_length_and_dec(); - bool find_and_check_access(THD * thd); + bool sp_check_access(THD * thd); virtual enum Functype functype() const { return FUNC_SP; } bool fix_fields(THD *thd, Item **ref); + void fix_length_and_dec(void); bool is_expensive() { return 1; } }; From 62b41b5fbcf3fe8bd680e28e0064d3194daf4157 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 09:56:57 -0400 Subject: [PATCH 174/789] WL#3629 - Replication of Invocation and Invoked Features This changeset adds replication of events and user-defined functions. There are several bug reports involved in this change: BUG#16421, BUG#17857, BUG#20384: This patch modifies the mysql.events table to permit the addition of another enum value for the status column. The column now has values of ('DISABLED','SLAVESIDE_DISABLED','ENABLED'). A status of SLAVESIDE_DISABLED is set on the slave during replication of events. This enables users to determine which events werereplicated from the master and to later enable them if they promote the slave to a master. The CREATE, ALTER, and DROP statements are binlogged. A new test was added for replication of events (rpl_events). BUG#17671: This patch modifies the code to permit logging of user-defined functions. Note: this is the CREATE FUNCTION ... SONAME variety. A more friendly error message to be displayed should a replicated user-defined function not be found in the loadable library or if the library is missing from the slave.The CREATE andDROP statements are binlogged. A new test was added for replication of user-defined functions (rpl_udf). The patch also adds a new column to the mysql.event table named 'originator' that is used to store the server_id of the server that the event originated on. This enables users to promote a slave to a master and later return the promoted slave to a slave and disable the replicated events. mysql-test/lib/init_db.sql: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. mysql-test/r/events.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/events_grant.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_grant test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/events_restart_phase1.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_restart_phase1 test results. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/r/system_mysql_db.result: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. These changes to the result file were necessary to ensure correct test results. mysql-test/t/events.test: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events test. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. mysql-test/t/events_restart_phase1.test: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the 'originator' column to the events_restart_phase1 test. This was necessary to ensure the manual insert into mysql.event table succeeds because the originator column is set to NOT NULL. scripts/mysql_create_system_tables.sh: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. scripts/mysql_fix_privilege_tables.sql: WL#3629 - Replication of Invocation and Invoked Feature This patch adds the SLAVESIDE_DISABLED to the list of enumerated values for the mysql.event table. This patch adds the column 'originator' to the mysql.event table. sql/event_data_objects.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. This patch uses the new Event_basic:: enumerated values. sql/event_data_objects.h: WL#3629 - Replication of Invocation and Invoked Features This patch moves the duplicated enumeration values for ENABLED, SLAVESIDE_DISABLED, and DISABLED to the Event_basic class removing them from the other Event_* classes. sql/event_db_repository.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. The patch also adds a new column to the mysql.event table named 'originator' that is used to store the server_id of the server that the event originated on. This enables users to promote a slave to a master and later return the promoted slave to a slave and disable the replicated events. sql/event_db_repository.h: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add a new field named 'originator' to the enum_event_table_field and associated structure. sql/event_queue.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. sql/events.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. sql/lex.h: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add the new SLAVESIDE_DISABLE symbol to the lexical parser. sql/slave.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit the capture of the error on the slave when a UDF from a loadable library is not loaded on the server when replicated from the master. sql/sql_parse.cc: WL#3629 - Replication of Invocation and Invoked Features This patch removes the comment because drop functions commands are replicated. sql/sql_show.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to permit processing of the new enum SLAVESIDE_DISABLED which is set on the slave during replication of events. The code also adds changes the display width of the status column for the schema table for the show events command and also adds the new column 'originator' to the events_field_info structure. sql/sql_udf.cc: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to add the binlogging of the create and drop function events. sql/sql_yacc.yy: WL#3629 - Replication of Invocation and Invoked Features This patch modifies the code to change the enumeration of the status column for the events in the parser. The code uses the Event_basic:: enumerations allowing the enums to be defined in one place. mysql-test/t/rpl_events.test: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new test for testing replication of events. The test uses include files so that the test can test under both RBR and SBR. mysql-test/r/rpl_events.result: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new result file for testing replication of events. mysql-test/r/rpl_udf.result: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new result file for testing replication of UDFs. mysql-test/t/rpl_udf.test: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new test for testing replication of UDFs. The test uses include files so that the test can test under both RBR and SBR. mysql-test/include/rpl_events.inc: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new include file for testing replication of events. This file contains the core test procedures. mysql-test/include/rpl_udf.inc: WL#3629 - Replication of Invocation and Invoked Features This patch adds a new include file for testing replication of UDFs. This file contains the core test procedures. --- mysql-test/include/rpl_events.inc | 101 +++++++ mysql-test/include/rpl_udf.inc | 187 +++++++++++++ mysql-test/lib/init_db.sql | 3 +- mysql-test/r/events.result | 29 +- mysql-test/r/events_grant.result | 24 +- mysql-test/r/events_restart_phase1.result | 4 +- mysql-test/r/rpl_events.result | 133 ++++++++++ mysql-test/r/rpl_udf.result | 310 ++++++++++++++++++++++ mysql-test/r/system_mysql_db.result | 3 +- mysql-test/t/events.test | 2 +- mysql-test/t/events_restart_phase1.test | 4 +- mysql-test/t/rpl_events.test | 24 ++ mysql-test/t/rpl_udf.test | 22 ++ scripts/mysql_create_system_tables.sh | 3 +- scripts/mysql_fix_privilege_tables.sql | 5 +- sql/event_data_objects.cc | 52 +++- sql/event_data_objects.h | 53 ++-- sql/event_db_repository.cc | 13 +- sql/event_db_repository.h | 3 +- sql/event_queue.cc | 6 +- sql/events.cc | 49 ++++ sql/lex.h | 1 + sql/slave.cc | 19 +- sql/sql_parse.cc | 1 - sql/sql_show.cc | 31 ++- sql/sql_udf.cc | 34 +++ sql/sql_yacc.yy | 15 +- 27 files changed, 1041 insertions(+), 90 deletions(-) create mode 100644 mysql-test/include/rpl_events.inc create mode 100644 mysql-test/include/rpl_udf.inc create mode 100644 mysql-test/r/rpl_events.result create mode 100644 mysql-test/r/rpl_udf.result create mode 100644 mysql-test/t/rpl_events.test create mode 100644 mysql-test/t/rpl_udf.test diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc new file mode 100644 index 00000000000..5f4cc3c6985 --- /dev/null +++ b/mysql-test/include/rpl_events.inc @@ -0,0 +1,101 @@ +################################################################## +# Author: Giuseppe, Chuck Bell # +# Date: 17-January-2007 # +# Purpose: To test that event effects are replicated # +# in both row based and statement based format # +################################################################## + +--disable_warnings +DROP EVENT IF EXISTS justonce; +drop table if exists t1,t2; +--enable_warnings + +# first, we need a table to record something from an event + +eval CREATE TABLE `t1` ( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `c` VARCHAR(50) NOT NULL, + `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE +CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=$engine_type DEFAULT CHARSET=utf8; + +INSERT INTO t1 (c) VALUES ('manually'); + +# then, we create the event +CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1 +(c) VALUES ('from justonce'); + +# wait 3 seconds, so the event can trigger +--real_sleep 3 + +# check that table t1 contains something +--echo "in the master" +--enable_info +--replace_column 3 TIMESTAMP +SELECT * FROM t1; +--disable_info + +sync_slave_with_master; +connection slave; + +--echo "in the slave" +--enable_info +--replace_column 3 TIMESTAMP +SELECT * FROM t1; +--disable_info + +# Create an event on the slave and check to see what the originator is. +--disable_warnings +DROP EVENT IF EXISTS test.slave_once; +--enable_warnings + +CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO +INSERT INTO t1(c) VALUES ('from slave_once'); +SELECT db, name, status, originator FROM mysql.event; + +--disable_warnings +DROP EVENT IF EXISTS test.slave_once; +--enable_warnings + +connection master; + +# BUG#20384 - disable events on slave +DROP EVENT IF EXISTS test.justonce; +CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO +INSERT INTO t1(c) VALUES ('from er'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; + +sync_slave_with_master; +connection slave; +--echo "in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; + +connection master; +--echo "in the master" +ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; + +sync_slave_with_master; +connection slave; +--echo "in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; + +connection master; +--echo "in the master" +DROP EVENT test.er; +--replace column 8 DATETIME +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; + +--disable_info + +sync_slave_with_master; +connection slave; +--echo "in the slave" +--replace column 8 DATETIME +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; + +--echo "in the master" +connection master; +DROP TABLE t1; + diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc new file mode 100644 index 00000000000..ef20327078e --- /dev/null +++ b/mysql-test/include/rpl_udf.inc @@ -0,0 +1,187 @@ +##################################################################### +# Author: Chuck Bell # +# Date: 2006-12-21 # +# Purpose: To test that UDFs are replicated in both row based and # +# statement based format. This tests work completed in WL#3629. # +# # +# This test is designed to exercise two of the three types of UDFs: # +# 1) UDFs via loadable libraries, and 2) UDFs with a SQL body. # +##################################################################### + +--source include/have_udf.inc + +# +# To run this tests the "sql/udf_example.c" need to be compiled into +# udf_example.so and LD_LIBRARY_PATH should be setup to point out where +# the library are. +# + +connection master; +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Test 1) Test UDFs via loadable libraries +# +--echo "*** Test 1) Test UDFs via loadable libraries *** +--echo "Running on the master" +--enable_info +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_LIB"; +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +--error ER_CANT_FIND_DL_ENTRY +eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; +SELECT * FROM mysql.func; +--disable_info + +save_master_pos; +connection slave; +sync_with_master; + +# Check to see that UDF CREATE statements were replicated +--echo "Running on the slave" +--enable_info +SELECT * FROM mysql.func; +--disable_info + +connection master; + +# Use the UDFs to do something +--echo "Running on the master" +--enable_info +eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type; +INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00)); +INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00)); +INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00)); +INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00)); +SELECT * FROM t1 ORDER BY sum; +--disable_info + +sync_slave_with_master; + +# Check to see if data was replicated +--echo "Running on the slave" +--enable_info +SELECT * FROM t1 ORDER BY sum; + +# Check to see that the functions are available for execution on the slave +SELECT myfunc_int(25); +SELECT myfunc_double(75.00); +--disable_info + +connection master; + +# Drop the functions +--echo "Running on the master" +--enable_info +DROP FUNCTION myfunc_double; +DROP FUNCTION myfunc_int; +SELECT * FROM mysql.func; +--disable_info + +sync_slave_with_master; + +# Check to see if the UDFs were dropped on the slave +--echo "Running on the slave" +--enable_info +SELECT * FROM mysql.func; +--disable_info + +connection master; + +# Cleanup +--echo "Running on the master" +--enable_info +DROP TABLE t1; +--disable_info + +# +# Test 2) Test UDFs with SQL body +# +--echo "*** Test 2) Test UDFs with SQL body *** +--echo "Running on the master" +--enable_info +CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i; +CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 0.95; +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +--disable_info + +sync_slave_with_master; + +# Check to see that UDF CREATE statements were replicated +--echo "Running on the slave" +--enable_info +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +--disable_info + +connection master; + +# Use the UDFs to do something +--echo "Running on the master" +--enable_info +eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type; +INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00)); +INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00)); +INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00)); +INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00)); +SELECT * FROM t1 ORDER BY sum; +--disable_info + +sync_slave_with_master; + +# Check to see if data was replicated +--echo "Running on the slave" +--enable_info +SELECT * FROM t1 ORDER BY sum; +--disable_info + +connection master; + +# Modify the UDFs to add a comment +--echo "Running on the master" +--enable_info +ALTER FUNCTION myfuncsql_int COMMENT "This was altered."; +ALTER FUNCTION myfuncsql_double COMMENT "This was altered."; +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +--disable_info + +sync_slave_with_master; + +# Check to see if data was replicated +--echo "Running on the slave" +--enable_info +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; + +# Check to see that the functions are available for execution on the slave +SELECT myfuncsql_int(25); +SELECT myfuncsql_double(75.00); +--disable_info + +connection master; + +# Drop the functions +--echo "Running on the master" +--enable_info +DROP FUNCTION myfuncsql_double; +DROP FUNCTION myfuncsql_int; +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +--disable_info + +sync_slave_with_master; + +# Check to see if the UDFs were dropped on the slave +--echo "Running on the slave" +--enable_info +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +--disable_info + +connection master; + +# Cleanup +--echo "Running on the master" +--enable_info +DROP TABLE t1; +--disable_info diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index c6c0f1d81dd..14ff2603a84 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -610,7 +610,7 @@ CREATE TABLE event ( last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, - status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', + status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set( 'REAL_AS_FLOAT', @@ -645,6 +645,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + originator int(10) NOT NULL, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index af864c57efa..3193f45d554 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -193,7 +193,7 @@ create event SHOW CREATE EVENT ðóóò21; Event sql_mode Create Event ðóóò21 CREATE EVENT `ðóóò21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND ON COMPLETION NOT PRESERVE ENABLE COMMENT 'òîâà å 1251 êîìåíòàð' DO select 1 -insert into mysql.event (db, name, body, definer, interval_value, interval_field) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND"); +insert into mysql.event (db, name, body, definer, interval_value, interval_field, originator) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND", 1); show create event root22; ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' SHOW EVENTS; @@ -225,18 +225,18 @@ drop event set names latin1; CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED 1 ALTER TABLE mysql.event ADD dummy INT FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 16, found 17. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 16, found 17. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted ALTER TABLE mysql.event DROP dummy2; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED 1 CREATE TABLE event_like LIKE mysql.event; INSERT INTO event_like SELECT * FROM mysql.event; ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; @@ -258,10 +258,11 @@ event CREATE TABLE `event` ( `last_executed` datetime DEFAULT NULL, `starts` datetime DEFAULT NULL, `ends` datetime DEFAULT NULL, - `status` enum('ENABLED','DISABLED') NOT NULL DEFAULT 'ENABLED', + `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `originator` int(10) NOT NULL, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; @@ -269,8 +270,8 @@ ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error l ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin default ''; "This should work" SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED 1 ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. @@ -279,14 +280,14 @@ SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. ALTER TABLE mysql.event DROP comment, DROP starts; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 16, found 14. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. Table probably corrupted DROP TABLE mysql.event; CREATE TABLE mysql.event like event_like; INSERT INTO mysql.event SELECT * FROM event_like; DROP TABLE event_like; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED 1 DROP EVENT intact_check; create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; @@ -399,5 +400,5 @@ ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SHOW EVENTS FROM ``; ERROR 42000: Incorrect database name '' SHOW EVENTS FROM `events\\test`; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator drop database events_test; diff --git a/mysql-test/r/events_grant.result b/mysql-test/r/events_grant.result index a28c30a9345..87906216e40 100644 --- a/mysql-test/r/events_grant.result +++ b/mysql-test/r/events_grant.result @@ -2,8 +2,8 @@ CREATE DATABASE IF NOT EXISTS events_test; use events_test; CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED 1 SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME; EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE @@ -29,8 +29,8 @@ ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_te USE events_test; "We should see one event"; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED 1 SELECT CONCAT("Let's create some new events from the name of ", USER()); CONCAT("Let's create some new events from the name of ", USER()) Let's create some new events from the name of ev_test@localhost @@ -40,18 +40,18 @@ CREATE EVENT two_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION NOT PRESERVE CO CREATE EVENT three_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION PRESERVE COMMENT "three event" DO SELECT 123; "Now we should see 3 events:"; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED -events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED -events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED 1 +events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED 1 +events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED 1 "This should show us only 2 events:"; SHOW EVENTS LIKE 't%event'; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED -events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator +events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED 1 +events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED 1 "This should show us no events:"; SHOW EVENTS FROM test LIKE '%'; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Type Execute at Interval value Interval field Starts Ends Status Originator GRANT EVENT ON events_test2.* TO ev_test@localhost; USE events_test2; CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42; diff --git a/mysql-test/r/events_restart_phase1.result b/mysql-test/r/events_restart_phase1.result index a7a46fa0ab1..2b0f4141c7c 100644 --- a/mysql-test/r/events_restart_phase1.result +++ b/mysql-test/r/events_restart_phase1.result @@ -7,6 +7,6 @@ create event abc2 on schedule every 1 second do insert into execution_log value( create event abc3 on schedule every 1 second do insert into execution_log value('abc3'); select name from execution_log; name -insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1'); -insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2'); +insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1',1); +insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2',1); "Now we restart the server" diff --git a/mysql-test/r/rpl_events.result b/mysql-test/r/rpl_events.result new file mode 100644 index 00000000000..59bd16adbf6 --- /dev/null +++ b/mysql-test/r/rpl_events.result @@ -0,0 +1,133 @@ +set global event_scheduler=1; +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set binlog_format=row; +DROP EVENT IF EXISTS justonce; +drop table if exists t1,t2; +CREATE TABLE `t1` ( +`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +`c` VARCHAR(50) NOT NULL, +`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE +CURRENT_TIMESTAMP, +PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 (c) VALUES ('manually'); +CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1 +(c) VALUES ('from justonce'); +"in the master" +SELECT * FROM t1; +id c ts +1 manually TIMESTAMP +2 from justonce TIMESTAMP +affected rows: 2 +"in the slave" +SELECT * FROM t1; +id c ts +1 manually TIMESTAMP +2 from justonce TIMESTAMP +affected rows: 2 +DROP EVENT IF EXISTS test.slave_once; +CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO +INSERT INTO t1(c) VALUES ('from slave_once'); +SELECT db, name, status, originator FROM mysql.event; +db name status originator +test justonce SLAVESIDE_DISABLED 1 +test slave_once ENABLED 2 +DROP EVENT IF EXISTS test.slave_once; +DROP EVENT IF EXISTS test.justonce; +Warnings: +Note 1305 Event justonce does not exist +CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO +INSERT INTO t1(c) VALUES ('from er'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er ENABLED 1 +"in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er SLAVESIDE_DISABLED 1 +"in the master" +ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er ENABLED 1 +"in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er SLAVESIDE_DISABLED 1 +"in the master" +DROP EVENT test.er; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +"in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +"in the master" +DROP TABLE t1; +set binlog_format=statement; +DROP EVENT IF EXISTS justonce; +drop table if exists t1,t2; +CREATE TABLE `t1` ( +`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +`c` VARCHAR(50) NOT NULL, +`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE +CURRENT_TIMESTAMP, +PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 (c) VALUES ('manually'); +CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1 +(c) VALUES ('from justonce'); +"in the master" +SELECT * FROM t1; +id c ts +1 manually TIMESTAMP +2 from justonce TIMESTAMP +affected rows: 2 +"in the slave" +SELECT * FROM t1; +id c ts +1 manually TIMESTAMP +2 from justonce TIMESTAMP +affected rows: 2 +DROP EVENT IF EXISTS test.slave_once; +CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO +INSERT INTO t1(c) VALUES ('from slave_once'); +SELECT db, name, status, originator FROM mysql.event; +db name status originator +test justonce SLAVESIDE_DISABLED 1 +test slave_once ENABLED 2 +DROP EVENT IF EXISTS test.slave_once; +DROP EVENT IF EXISTS test.justonce; +Warnings: +Note 1305 Event justonce does not exist +CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO +INSERT INTO t1(c) VALUES ('from er'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er ENABLED 1 +"in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er SLAVESIDE_DISABLED 1 +"in the master" +ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er ENABLED 1 +"in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +test er SLAVESIDE_DISABLED 1 +"in the master" +DROP EVENT test.er; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +"in the slave" +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator +"in the master" +DROP TABLE t1; diff --git a/mysql-test/r/rpl_udf.result b/mysql-test/r/rpl_udf.result new file mode 100644 index 00000000000..156876d07de --- /dev/null +++ b/mysql-test/r/rpl_udf.result @@ -0,0 +1,310 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set binlog_format=row; +drop table if exists t1; +"*** Test 1) Test UDFs via loadable libraries *** +"Running on the master" +CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB"; +affected rows: 0 +CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; +affected rows: 0 +CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; +ERROR HY000: Can't find symbol 'myfunc_nonexist' in library +SELECT * FROM mysql.func; +name ret dl type +myfunc_double 1 udf_example.dll function +myfunc_int 2 udf_example.dll function +affected rows: 2 +"Running on the slave" +SELECT * FROM mysql.func; +name ret dl type +myfunc_double 1 udf_example.dll function +myfunc_int 2 udf_example.dll function +affected rows: 2 +"Running on the master" +CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; +affected rows: 0 +INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00)); +affected rows: 1 +SELECT * FROM t1 ORDER BY sum; +sum price +1 48.5 +10 48.75 +100 48.6 +200 49 +affected rows: 4 +"Running on the slave" +SELECT * FROM t1 ORDER BY sum; +sum price +1 48.5 +10 48.75 +100 48.6 +200 49 +affected rows: 4 +SELECT myfunc_int(25); +myfunc_int(25) +25 +affected rows: 1 +SELECT myfunc_double(75.00); +myfunc_double(75.00) +50.00 +affected rows: 1 +"Running on the master" +DROP FUNCTION myfunc_double; +affected rows: 0 +DROP FUNCTION myfunc_int; +affected rows: 0 +SELECT * FROM mysql.func; +name ret dl type +affected rows: 0 +"Running on the slave" +SELECT * FROM mysql.func; +name ret dl type +affected rows: 0 +"Running on the master" +DROP TABLE t1; +affected rows: 0 +"*** Test 2) Test UDFs with SQL body *** +"Running on the master" +CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i; +affected rows: 0 +CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 0.95; +affected rows: 0 +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_int FUNCTION i INT RETURN i +affected rows: 2 +"Running on the slave" +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_int FUNCTION i INT RETURN i +affected rows: 2 +"Running on the master" +CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; +affected rows: 0 +INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00)); +affected rows: 1 +SELECT * FROM t1 ORDER BY sum; +sum price +1 475 +10 5 +100 47 +200 24 +affected rows: 4 +"Running on the slave" +SELECT * FROM t1 ORDER BY sum; +sum price +1 475 +10 5 +100 47 +200 24 +affected rows: 4 +"Running on the master" +ALTER FUNCTION myfuncsql_int COMMENT "This was altered."; +affected rows: 0 +ALTER FUNCTION myfuncsql_double COMMENT "This was altered."; +affected rows: 0 +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_int FUNCTION i INT RETURN i This was altered. +affected rows: 2 +"Running on the slave" +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_int FUNCTION i INT RETURN i This was altered. +affected rows: 2 +SELECT myfuncsql_int(25); +myfuncsql_int(25) +25 +affected rows: 1 +SELECT myfuncsql_double(75.00); +myfuncsql_double(75.00) +71 +affected rows: 1 +"Running on the master" +DROP FUNCTION myfuncsql_double; +affected rows: 0 +DROP FUNCTION myfuncsql_int; +affected rows: 0 +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +affected rows: 0 +"Running on the slave" +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +affected rows: 0 +"Running on the master" +DROP TABLE t1; +affected rows: 0 +set binlog_format=statement; +drop table if exists t1; +"*** Test 1) Test UDFs via loadable libraries *** +"Running on the master" +CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB"; +affected rows: 0 +CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; +affected rows: 0 +CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; +ERROR HY000: Can't find symbol 'myfunc_nonexist' in library +SELECT * FROM mysql.func; +name ret dl type +myfunc_int 2 udf_example.dll function +myfunc_double 1 udf_example.dll function +affected rows: 2 +"Running on the slave" +SELECT * FROM mysql.func; +name ret dl type +myfunc_int 2 udf_example.dll function +myfunc_double 1 udf_example.dll function +affected rows: 2 +"Running on the master" +CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; +affected rows: 0 +INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00)); +affected rows: 1 +SELECT * FROM t1 ORDER BY sum; +sum price +1 48.5 +10 48.75 +100 48.6 +200 49 +affected rows: 4 +"Running on the slave" +SELECT * FROM t1 ORDER BY sum; +sum price +1 48.5 +10 48.75 +100 48.6 +200 49 +affected rows: 4 +SELECT myfunc_int(25); +myfunc_int(25) +25 +affected rows: 1 +SELECT myfunc_double(75.00); +myfunc_double(75.00) +50.00 +affected rows: 1 +"Running on the master" +DROP FUNCTION myfunc_double; +affected rows: 0 +DROP FUNCTION myfunc_int; +affected rows: 0 +SELECT * FROM mysql.func; +name ret dl type +affected rows: 0 +"Running on the slave" +SELECT * FROM mysql.func; +name ret dl type +affected rows: 0 +"Running on the master" +DROP TABLE t1; +affected rows: 0 +"*** Test 2) Test UDFs with SQL body *** +"Running on the master" +CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i; +affected rows: 0 +CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 0.95; +affected rows: 0 +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_int FUNCTION i INT RETURN i +affected rows: 2 +"Running on the slave" +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_int FUNCTION i INT RETURN i +affected rows: 2 +"Running on the master" +CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; +affected rows: 0 +INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00)); +affected rows: 1 +INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00)); +affected rows: 1 +SELECT * FROM t1 ORDER BY sum; +sum price +1 475 +10 5 +100 47 +200 24 +affected rows: 4 +"Running on the slave" +SELECT * FROM t1 ORDER BY sum; +sum price +1 475 +10 5 +100 47 +200 24 +affected rows: 4 +"Running on the master" +ALTER FUNCTION myfuncsql_int COMMENT "This was altered."; +affected rows: 0 +ALTER FUNCTION myfuncsql_double COMMENT "This was altered."; +affected rows: 0 +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_int FUNCTION i INT RETURN i This was altered. +affected rows: 2 +"Running on the slave" +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_int FUNCTION i INT RETURN i This was altered. +affected rows: 2 +SELECT myfuncsql_int(25); +myfuncsql_int(25) +25 +affected rows: 1 +SELECT myfuncsql_double(75.00); +myfuncsql_double(75.00) +71 +affected rows: 1 +"Running on the master" +DROP FUNCTION myfuncsql_double; +affected rows: 0 +DROP FUNCTION myfuncsql_int; +affected rows: 0 +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +affected rows: 0 +"Running on the slave" +SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; +db name type param_list body comment +affected rows: 0 +"Running on the master" +DROP TABLE t1; +affected rows: 0 diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index c93fbfba6e2..a8ea6ffa19f 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -220,10 +220,11 @@ event CREATE TABLE `event` ( `last_executed` datetime DEFAULT NULL, `starts` datetime DEFAULT NULL, `ends` datetime DEFAULT NULL, - `status` enum('ENABLED','DISABLED') NOT NULL DEFAULT 'ENABLED', + `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `originator` int(10) NOT NULL, PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' show create table general_log; diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index 6eb514fc13c..d2444bbea68 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -160,7 +160,7 @@ SHOW CREATE EVENT root20; set names cp1251; create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1; SHOW CREATE EVENT ðóóò21; -insert into mysql.event (db, name, body, definer, interval_value, interval_field) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND"); +insert into mysql.event (db, name, body, definer, interval_value, interval_field, originator) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND", 1); --error ER_NOT_SUPPORTED_YET show create event root22; --error ER_NOT_SUPPORTED_YET diff --git a/mysql-test/t/events_restart_phase1.test b/mysql-test/t/events_restart_phase1.test index 92783ddaef7..ce9b77d4ff0 100644 --- a/mysql-test/t/events_restart_phase1.test +++ b/mysql-test/t/events_restart_phase1.test @@ -14,6 +14,6 @@ create event abc3 on schedule every 1 second do insert into execution_log value( --sleep 1.5 select name from execution_log; -insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1'); -insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2'); +insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1',1); +insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2',1); --echo "Now we restart the server" diff --git a/mysql-test/t/rpl_events.test b/mysql-test/t/rpl_events.test new file mode 100644 index 00000000000..895e94c438b --- /dev/null +++ b/mysql-test/t/rpl_events.test @@ -0,0 +1,24 @@ +################################################################## +# Author: Giuseppe # +# Date: 2006-12-20 # +# Purpose: To test that event effects are replicated # +# in both row based and statement based format # +################################################################## + +set global event_scheduler=1; + +--source include/not_embedded.inc +--source include/master-slave.inc + +let $engine_type= MyISAM; + +set binlog_format=row; + +# Embedded server doesn't support binlogging +--source include/rpl_events.inc + +set binlog_format=statement; + +# Embedded server doesn't support binlogging +--source include/rpl_events.inc + diff --git a/mysql-test/t/rpl_udf.test b/mysql-test/t/rpl_udf.test new file mode 100644 index 00000000000..262ad04630c --- /dev/null +++ b/mysql-test/t/rpl_udf.test @@ -0,0 +1,22 @@ +################################################################### +# Author: Chuck Bell # +# Date: 2006-12-21 # +# Purpose: To test that UDFs are replicated in both row based and # +# statement based format. This tests work completed in WL#3629. # +################################################################### + +--source include/not_embedded.inc +--source include/master-slave.inc + +let $engine_type= MyISAM; + +set binlog_format=row; + +# Embedded server doesn't support binlogging +--source include/rpl_udf.inc + +set binlog_format=statement; + +# Embedded server doesn't support binlogging +--source include/rpl_udf.inc + diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index cc86def1a5c..ddb90b55633 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -832,7 +832,7 @@ then c_ev="$c_ev last_executed DATETIME default NULL," c_ev="$c_ev starts DATETIME default NULL," c_ev="$c_ev ends DATETIME default NULL," - c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," + c_ev="$c_ev status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'," c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," c_ev="$c_ev sql_mode set(" c_ev="$c_ev 'REAL_AS_FLOAT'," @@ -867,6 +867,7 @@ then c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev originator int(10) NOT NULL, c_ev="$c_ev PRIMARY KEY (db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9cdea507493..4d661dd8146 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -648,7 +648,7 @@ CREATE TABLE event ( last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, - status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', + status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set( 'REAL_AS_FLOAT', @@ -683,6 +683,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + originator int(10) NOT NULL, PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; @@ -737,6 +738,8 @@ ALTER TABLE event ADD sql_mode UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; +ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL; +ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; # # TRIGGER privilege diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 07575a6d33a..4c3524f47ac 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -58,7 +58,8 @@ Event_parse_data::new_instance(THD *thd) */ Event_parse_data::Event_parse_data() - :on_completion(ON_COMPLETION_DROP), status(ENABLED), + :on_completion(Event_basic::ON_COMPLETION_DROP), + status(Event_basic::ENABLED), item_starts(NULL), item_ends(NULL), item_execute_at(NULL), starts_null(TRUE), ends_null(TRUE), execute_at_null(TRUE), item_expression(NULL), expression(0) @@ -550,9 +551,9 @@ Event_parse_data::check_parse_data(THD *thd) init_name(thd, identifier); init_definer(thd); - ret= init_execute_at(thd) || init_interval(thd) || init_starts(thd) || init_ends(thd); + check_originator_id(thd); DBUG_RETURN(ret); } @@ -598,6 +599,30 @@ Event_parse_data::init_definer(THD *thd) } +/* + Set the originator id of the event to the server_id if executing on + the master or set to the server_id of the master if executing on + the slave. If executing on slave, also set status to SLAVESIDE_DISABLED. + + SYNOPSIS + Event_parse_data::check_originator_id() +*/ +void Event_parse_data::check_originator_id(THD *thd) +{ + /* Disable replicated events on slave. */ + if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL) || + (thd->system_thread == SYSTEM_THREAD_SLAVE_IO)) + { + DBUG_PRINT("info", ("Invoked object status set to SLAVESIDE_DISABLED.")); + if (status == Event_basic::ENABLED) + status = Event_basic::SLAVESIDE_DISABLED; + originator = thd->server_id; + } + else + originator = server_id; +} + + /* Constructor @@ -927,8 +952,23 @@ Event_queue_element::load_from_row(TABLE *table) goto error; DBUG_PRINT("load_from_row", ("Event [%s] is [%s]", name.str, ptr)); - status= (ptr[0]=='E'? Event_queue_element::ENABLED: - Event_queue_element::DISABLED); + + /* Set event status (ENABLED | SLAVESIDE_DISABLED | DISABLED) */ + switch (ptr[0]) + { + case 'E' : + status = Event_queue_element::ENABLED; + break; + case 'S' : + status = Event_queue_element::SLAVESIDE_DISABLED; + break; + case 'D' : + status = Event_queue_element::DISABLED; + break; + } + if ((ptr= get_field(&mem_root, table->field[ET_FIELD_ORIGINATOR])) == NullS) + goto error; + originator = table->field[ET_FIELD_ORIGINATOR]->val_int(); /* ToDo : Andrey . Find a way not to allocate ptr on event_mem_root */ if ((ptr= get_field(&mem_root, @@ -1199,7 +1239,7 @@ Event_queue_element::compute_next_execution_time() (long) TIME_to_ulonglong_datetime(&last_executed), (long) this)); - if (status == Event_queue_element::DISABLED) + if (status != Event_queue_element::ENABLED) { DBUG_PRINT("compute_next_execution_time", ("Event %s is DISABLED", name.str)); @@ -1601,6 +1641,8 @@ Event_timed::get_create_event(THD *thd, String *buf) if (status == Event_timed::ENABLED) buf->append(STRING_WITH_LEN("ENABLE")); + else if (status == Event_timed::SLAVESIDE_DISABLED) + buf->append(STRING_WITH_LEN("SLAVESIDE_DISABLE")); else buf->append(STRING_WITH_LEN("DISABLE")); diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index e00b0b94eaf..a63340e67c8 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -22,17 +22,33 @@ #define EVEX_BAD_PARAMS -5 #define EVEX_MICROSECOND_UNSUP -6 - class sp_head; class Sql_alloc; - class Event_basic { protected: MEM_ROOT mem_root; public: + /* + ENABLED = feature can function normally (is turned on) + SLAVESIDE_DISABLED = feature is turned off on slave + DISABLED = feature is turned off + */ + enum enum_status + { + ENABLED = 1, + DISABLED, + SLAVESIDE_DISABLED + }; + + enum enum_on_completion + { + ON_COMPLETION_DROP = 1, + ON_COMPLETION_PRESERVE + }; + LEX_STRING dbname; LEX_STRING name; LEX_STRING definer;// combination of user and host @@ -57,20 +73,9 @@ protected: bool last_executed_changed; public: - enum enum_status - { - ENABLED = 1, - DISABLED - }; - - enum enum_on_completion - { - ON_COMPLETION_DROP = 1, - ON_COMPLETION_PRESERVE - }; - - enum enum_on_completion on_completion; - enum enum_status status; + int on_completion; + int status; + longlong originator; TIME last_executed; TIME execute_at; @@ -194,19 +199,10 @@ private: class Event_parse_data : public Sql_alloc { public: - enum enum_status - { - ENABLED = 1, - DISABLED - }; - enum enum_on_completion - { - ON_COMPLETION_DROP = 1, - ON_COMPLETION_PRESERVE - }; - enum enum_on_completion on_completion; - enum enum_status status; + int on_completion; + int status; + longlong originator; const uchar *body_begin; @@ -268,6 +264,7 @@ private: report_bad_value(const char *item_name, Item *bad_item); Event_parse_data(const Event_parse_data &); /* Prevent use of these */ + void Event_parse_data::check_originator_id(THD *thd); void operator=(Event_parse_data &); }; diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 940930ec4c6..1b001db984c 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -94,7 +94,7 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] = }, { { C_STRING_WITH_LEN("status") }, - { C_STRING_WITH_LEN("enum('ENABLED','DISABLED')") }, + { C_STRING_WITH_LEN("enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')") }, {NULL, 0} }, { @@ -118,6 +118,11 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] = { C_STRING_WITH_LEN("comment") }, { C_STRING_WITH_LEN("char(64)") }, { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("originator") }, + { C_STRING_WITH_LEN("int(10)") }, + {NULL, 0} } }; @@ -170,6 +175,9 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, fields[ET_FIELD_STATUS]->store((longlong)et->status, TRUE); + fields[ET_FIELD_ORIGINATOR]->store((longlong)et->originator, TRUE); + + /* Change the SQL_MODE only if body was present in an ALTER EVENT and of course always during CREATE EVENT. @@ -535,7 +543,6 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, goto err; } - DBUG_PRINT("info", ("name: %.*s", parse_data->name.length, parse_data->name.str)); @@ -603,6 +610,8 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, if ((ret= mysql_event_fill_row(thd, table, parse_data, FALSE))) goto err; + table->field[ET_FIELD_STATUS]->store((longlong)parse_data->status, TRUE); + /* Close active transaction only if We are going to modify disk */ if (end_active_trans(thd)) goto err; diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h index 1457fb64e2e..ff23b1f5c85 100644 --- a/sql/event_db_repository.h +++ b/sql/event_db_repository.h @@ -19,7 +19,7 @@ enum enum_events_table_field { - ET_FIELD_DB = 0, + ET_FIELD_DB = 0, ET_FIELD_NAME, ET_FIELD_BODY, ET_FIELD_DEFINER, @@ -35,6 +35,7 @@ enum enum_events_table_field ET_FIELD_ON_COMPLETION, ET_FIELD_SQL_MODE, ET_FIELD_COMMENT, + ET_FIELD_ORIGINATOR, ET_FIELD_COUNT /* a cool trick to count the number of fields :) */ }; diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 068abbe3408..d951e926901 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -218,7 +218,8 @@ Event_queue::create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) new_element= new Event_queue_element(); res= db_repository->load_named_event(thd, dbname, name, new_element); - if (res || new_element->status == Event_queue_element::DISABLED) + if (res || new_element->status == Event_queue_element::DISABLED + || new_element->status == Event_queue_element::SLAVESIDE_DISABLED) delete new_element; else { @@ -231,7 +232,6 @@ Event_queue::create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) pthread_cond_broadcast(&COND_queue_state); UNLOCK_QUEUE_DATA(); } - DBUG_RETURN(res); } @@ -271,7 +271,7 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name, delete new_element; goto end; } - else if (new_element->status == Event_queue_element::DISABLED) + else if (new_element->status != Event_queue_element::ENABLED) { DBUG_PRINT("info", ("The event is disabled.")); /* diff --git a/sql/events.cc b/sql/events.cc index e6224915d6b..80ee613a6b9 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -347,7 +347,15 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) DBUG_RETURN(TRUE); } + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for CREATE EVENT command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + pthread_mutex_lock(&LOCK_event_metadata); + /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists))) { @@ -357,6 +365,15 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) DBUG_ASSERT(ret == OP_LOAD_ERROR); my_error(ER_EVENT_MODIFY_QUEUE_ERROR, MYF(0)); } + else /* Binlog the create event. */ + { + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + } } pthread_mutex_unlock(&LOCK_event_metadata); @@ -396,7 +413,15 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) DBUG_RETURN(TRUE); } + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for UPDATE EVENT command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + pthread_mutex_lock(&LOCK_event_metadata); + /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->update_event(thd, parse_data, new_dbname, new_name))) { @@ -406,6 +431,15 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) DBUG_ASSERT(ret == OP_LOAD_ERROR); my_error(ER_EVENT_MODIFY_QUEUE_ERROR, MYF(0)); } + else /* Binlog the alter event. */ + { + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + } } pthread_mutex_unlock(&LOCK_event_metadata); @@ -445,12 +479,27 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists, DBUG_RETURN(TRUE); } + /* + Turn off row binlogging of this statement and use statement-based so + that all supporting tables are updated for DROP EVENT command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + pthread_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists))) { if (!only_from_disk) event_queue->drop_event(thd, dbname, name); + + /* Binlog the drop event. */ + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } } pthread_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); diff --git a/sql/lex.h b/sql/lex.h index 45155da7692..6e0f1c711f2 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -467,6 +467,7 @@ static SYMBOL symbols[] = { { "SIGNED", SYM(SIGNED_SYM)}, { "SIMPLE", SYM(SIMPLE_SYM)}, { "SLAVE", SYM(SLAVE)}, + { "SLAVESIDE_DISABLE", SYM(SLAVESIDE_DISABLE_SYM)}, { "SNAPSHOT", SYM(SNAPSHOT_SYM)}, { "SMALLINT", SYM(SMALLINT)}, { "SOCKET", SYM(SOCKET_SYM)}, diff --git a/sql/slave.cc b/sql/slave.cc index 3a9cde42059..aa018f560ed 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2387,10 +2387,25 @@ Slave SQL thread aborted. Can't execute init_slave query"); /* Print any warnings issued */ List_iterator_fast it(thd->warn_list); MYSQL_ERROR *err; + /* + Added controlled slave thread cancel for replication + of user-defined variables. + */ + bool udf_error = false; while ((err= it++)) + { + if (err->code == ER_CANT_OPEN_LIBRARY) + udf_error = true; sql_print_warning("Slave: %s Error_code: %d",err->msg, err->code); - - sql_print_error("\ + } + if (udf_error) + sql_print_error("Error loading user-defined library, slave SQL " + "thread aborted. Install the missing library, and restart the " + "slave SQL thread with \"SLAVE START\". We stopped at log '%s' " + "position %s", RPL_LOG_NAME, llstr(rli->group_master_log_pos, + llbuff)); + else + sql_print_error("\ Error running query, slave SQL thread aborted. Fix the problem, and restart \ the slave SQL thread with \"SLAVE START\". We stopped at log \ '%s' position %s", RPL_LOG_NAME, llstr(rli->group_master_log_pos, llbuff)); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ce7f34e3a06..de304976c0d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3866,7 +3866,6 @@ create_sp_error: if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 0, 0)) goto error; - /* Does NOT write to binlog */ if (!(res = mysql_drop_function(thd, &lex->spname->m_name))) { send_ok(thd); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 881cf7dc6c4..6a6e7ce3225 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -52,7 +52,8 @@ enum enum_i_s_events_fields ISE_CREATED, ISE_LAST_ALTERED, ISE_LAST_EXECUTED, - ISE_EVENT_COMMENT + ISE_EVENT_COMMENT, + ISE_ORIGINATOR }; @@ -4393,10 +4394,23 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) } /* status */ - if (et.status == Event_timed::ENABLED) - sch_table->field[ISE_STATUS]->store(STRING_WITH_LEN("ENABLED"), scs); - else - sch_table->field[ISE_STATUS]->store(STRING_WITH_LEN("DISABLED"), scs); + + switch (et.status) + { + case Event_timed::ENABLED: + sch_table->field[ISE_STATUS]->store(STRING_WITH_LEN("ENABLED"), scs); + break; + case Event_timed::SLAVESIDE_DISABLED: + sch_table->field[ISE_STATUS]->store(STRING_WITH_LEN("SLAVESIDE_DISABLED"), + scs); + break; + case Event_timed::DISABLED: + sch_table->field[ISE_STATUS]->store(STRING_WITH_LEN("DISABLED"), scs); + break; + default: + DBUG_ASSERT(0); + } + sch_table->field[ISE_ORIGINATOR]->store(et.originator, TRUE); /* on_completion */ if (et.on_completion == Event_timed::ON_COMPLETION_DROP) @@ -4935,9 +4949,7 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) TABLE *table; DBUG_ENTER("mysql_schema_table"); if (!(table= table_list->schema_table->create_table(thd, table_list))) - { DBUG_RETURN(1); - } table->s->tmp_table= SYSTEM_TMP_TABLE; table->grant.privilege= SELECT_ACL; /* @@ -5429,13 +5441,14 @@ ST_FIELD_INFO events_fields_info[]= {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0}, {"STARTS", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Starts"}, {"ENDS", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Ends"}, - {"STATUS", 8, MYSQL_TYPE_STRING, 0, 0, "Status"}, + {"STATUS", 18, MYSQL_TYPE_STRING, 0, 0, "Status"}, {"ON_COMPLETION", 12, MYSQL_TYPE_STRING, 0, 0, 0}, {"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0}, {"LAST_ALTERED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0}, {"LAST_EXECUTED", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, 0}, + {"ORIGINATOR", 10, MYSQL_TYPE_LONG, 0, 0, "Originator"}, {"EVENT_COMMENT", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 7dec58d9b6e..3ab161bb04f 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -403,6 +403,13 @@ int mysql_create_function(THD *thd,udf_func *udf) DBUG_RETURN(1); } + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for CREATE FUNCTION command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + rw_wrlock(&THR_LOCK_udf); if ((hash_search(&udf_hash,(byte*) udf->name.str, udf->name.length))) { @@ -466,6 +473,15 @@ int mysql_create_function(THD *thd,udf_func *udf) goto err; } rw_unlock(&THR_LOCK_udf); + + /* Binlog the create function. */ + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + DBUG_RETURN(0); err: @@ -484,11 +500,20 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) char *exact_name_str; uint exact_name_len; DBUG_ENTER("mysql_drop_function"); + if (!initialized) { my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); DBUG_RETURN(1); } + + /* + Turn off row binlogging of this statement and use statement-based + so that all supporting tables are updated for DROP FUNCTION command. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + rw_wrlock(&THR_LOCK_udf); if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name->str, (uint) udf_name->length))) @@ -525,6 +550,15 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) close_thread_tables(thd); rw_unlock(&THR_LOCK_udf); + + /* Binlog the drop function. */ + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->query, thd->query_length, FALSE, FALSE); + } + DBUG_RETURN(0); err: rw_unlock(&THR_LOCK_udf); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 9c062407921..67251159327 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -813,6 +813,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token SIGNED_SYM %token SIMPLE_SYM /* SQL-2003-N */ %token SLAVE +%token SLAVESIDE_DISABLE_SYM %token SMALLINT /* SQL-2003-R */ %token SNAPSHOT_SYM %token SOCKET_SYM @@ -1632,12 +1633,17 @@ ev_schedule_time: EVERY_SYM expr interval opt_ev_status: /* empty */ { $$= 0; } | ENABLE_SYM { - Lex->event_parse_data->status= Event_parse_data::ENABLED; + Lex->event_parse_data->status= Event_basic::ENABLED; + $$= 1; + } + | SLAVESIDE_DISABLE_SYM + { + Lex->event_parse_data->status= Event_basic::SLAVESIDE_DISABLED; $$= 1; } | DISABLE_SYM { - Lex->event_parse_data->status= Event_parse_data::DISABLED; + Lex->event_parse_data->status= Event_basic::DISABLED; $$= 1; } ; @@ -1667,13 +1673,13 @@ ev_on_completion: ON COMPLETION_SYM PRESERVE_SYM { Lex->event_parse_data->on_completion= - Event_parse_data::ON_COMPLETION_PRESERVE; + Event_basic::ON_COMPLETION_PRESERVE; $$= 1; } | ON COMPLETION_SYM NOT_SYM PRESERVE_SYM { Lex->event_parse_data->on_completion= - Event_parse_data::ON_COMPLETION_DROP; + Event_basic::ON_COMPLETION_DROP; $$= 1; } ; @@ -9832,6 +9838,7 @@ keyword_sp: | SIMPLE_SYM {} | SHARE_SYM {} | SHUTDOWN {} + | SLAVESIDE_DISABLE_SYM {} | SNAPSHOT_SYM {} | SOUNDS_SYM {} | SQL_CACHE_SYM {} From 2b2fb67460475e60652730520d0a69675565f706 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 14:57:02 +0100 Subject: [PATCH 175/789] Bug#26807 "set global event_scheduler=1" and --skip-grant-tables crashes server - Crash occured because Event engine is only initialized if ACLs are used but not properly marked as disabled. - The patch is to mark the Event engine as DISABLED if no ACLs are used to avoid access of uninitialized variables. mysql-test/r/skip_grants.result: Added test case mysql-test/t/skip_grants.test: Added test case --- mysql-test/r/skip_grants.result | 2 ++ mysql-test/t/skip_grants.test | 7 +++++++ sql/mysqld.cc | 5 +++++ sql/set_var.cc | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result index 58ced16acac..9efeb56a837 100644 --- a/mysql-test/r/skip_grants.result +++ b/mysql-test/r/skip_grants.result @@ -58,3 +58,5 @@ DROP PROCEDURE p3; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; +set global event_scheduler=1; +ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED or --skip-grant-tables option so it cannot execute this statement diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test index 6dda97fcf8a..c8ee3490552 100644 --- a/mysql-test/t/skip_grants.test +++ b/mysql-test/t/skip_grants.test @@ -108,3 +108,10 @@ DROP PROCEDURE p3; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; + +# +# Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server +# +--error ER_OPTION_PREVENTS_STATEMENT +set global event_scheduler=1; + diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d9fab73a23c..560bd569c14 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3691,6 +3691,7 @@ we force server id to 2, but this MySQL server will not act as a slave."); udf_init(); #endif } + init_status_vars(); if (opt_bootstrap) /* If running with bootstrap, do not start replication. */ opt_skip_slave_start= 1; @@ -3737,6 +3738,10 @@ we force server id to 2, but this MySQL server will not act as a slave."); if (Events::get_instance()->init()) unireg_abort(1); } + else + { + Events::opt_event_scheduler = Events::EVENTS_DISABLED; + } /* Signal threads waiting for server to be started */ pthread_mutex_lock(&LOCK_server_started); diff --git a/sql/set_var.cc b/sql/set_var.cc index 667abc0af18..a77698221ee 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3990,7 +3990,7 @@ sys_var_event_scheduler::update(THD *thd, set_var *var) DBUG_ENTER("sys_var_event_scheduler::update"); if (Events::opt_event_scheduler == Events::EVENTS_DISABLED) { - my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--event-scheduler=DISABLED"); + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--event-scheduler=DISABLED or --skip-grant-tables"); DBUG_RETURN(TRUE); } From 6d93f15039d551f291232c1b60527b00cd9c6bc9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 17:23:26 +0300 Subject: [PATCH 176/789] Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY UPDATE if the row wasn't actually changed. This bug was caused by fix for bug#19978. It causes AFTER UPDATE triggers not firing if a row wasn't actually changed by the update part of the INSERT .. ON DUPLICATE KEY UPDATE. Now triggers are always fired if a row is touched by the INSERT ... ON DUPLICATE KEY UPDATE. sql/sql_insert.cc: Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY UPDATE if the row wasn't actually changed. Now triggers are always fired if a row is touched by the INSERT ... ON DUPLICATE KEY UPDATE. mysql-test/r/trigger.result: Added a test case for the bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY UPDATE if the row wasn't actually changed. mysql-test/t/trigger.test: Added a test case for the bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY UPDATE if the row wasn't actually changed. --- mysql-test/r/trigger.result | 41 +++++++++++++++++++++++++++++++++++++ mysql-test/t/trigger.test | 38 ++++++++++++++++++++++++++++++++++ sql/sql_insert.cc | 12 +++++------ 3 files changed, 85 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index aa511ca27a7..da72973dc52 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1372,4 +1372,45 @@ INSERT INTO bug22580_t1 VALUES (1,1); DROP TABLE bug22580_t1; DROP PROCEDURE bug22580_proc_1; DROP PROCEDURE bug22580_proc_2; +DROP TRIGGER IF EXISTS trg27006_a_update; +DROP TRIGGER IF EXISTS trg27006_a_insert; +CREATE TABLE t1 ( +`id` int(10) unsigned NOT NULL auto_increment, +`val` varchar(10) NOT NULL, +PRIMARY KEY (`id`) +); +CREATE TABLE t2 like t1; +CREATE TRIGGER trg27006_a_insert AFTER INSERT ON t1 FOR EACH ROW +BEGIN +insert into t2 values (NULL,new.val); +END | +CREATE TRIGGER trg27006_a_update AFTER UPDATE ON t1 FOR EACH ROW +BEGIN +insert into t2 values (NULL,new.val); +END | +INSERT INTO t1(val) VALUES ('test1'),('test2'); +SELECT * FROM t1; +id val +1 test1 +2 test2 +SELECT * FROM t2; +id val +1 test1 +2 test2 +INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val); +INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val); +SELECT * FROM t1; +id val +1 test1 +2 test2 +3 test3 +SELECT * FROM t2; +id val +1 test1 +2 test2 +3 test2 +4 test3 +DROP TRIGGER trg27006_a_insert; +DROP TRIGGER trg27006_a_update; +drop table t1,t2; End of 5.0 tests diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 5c95004c901..49b7b527bd9 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -1699,4 +1699,42 @@ DROP TABLE bug22580_t1; DROP PROCEDURE bug22580_proc_1; DROP PROCEDURE bug22580_proc_2; +# +# Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY +# UPDATE if the row wasn't actually changed. +# +--disable_warnings +DROP TRIGGER IF EXISTS trg27006_a_update; +DROP TRIGGER IF EXISTS trg27006_a_insert; +--enable_warnings + +CREATE TABLE t1 ( + `id` int(10) unsigned NOT NULL auto_increment, + `val` varchar(10) NOT NULL, + PRIMARY KEY (`id`) +); +CREATE TABLE t2 like t1; +DELIMITER |; + +CREATE TRIGGER trg27006_a_insert AFTER INSERT ON t1 FOR EACH ROW +BEGIN + insert into t2 values (NULL,new.val); +END | +CREATE TRIGGER trg27006_a_update AFTER UPDATE ON t1 FOR EACH ROW +BEGIN + insert into t2 values (NULL,new.val); +END | +DELIMITER ;| + +INSERT INTO t1(val) VALUES ('test1'),('test2'); +SELECT * FROM t1; +SELECT * FROM t2; +INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val); +INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val); +SELECT * FROM t1; +SELECT * FROM t2; +DROP TRIGGER trg27006_a_insert; +DROP TRIGGER trg27006_a_update; +drop table t1,t2; + --echo End of 5.0 tests diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 35e724beec8..dd08ccef462 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1238,19 +1238,19 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) if (table->next_number_field) table->file->adjust_next_insert_id_after_explicit_value( table->next_number_field->val_int()); - info->touched++; + info->touched++; if ((table->file->table_flags() & HA_PARTIAL_COLUMN_READ) || compare_record(table, thd->query_id)) { info->updated++; - - trg_error= (table->triggers && - table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, - TRG_ACTION_AFTER, - TRUE)); info->copied++; } + + trg_error= (table->triggers && + table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, + TRG_ACTION_AFTER, + TRUE)); goto ok_or_after_trg_err; } else /* DUP_REPLACE */ From f7aa1930f4b2a3e0c7a5ded6010c9bffabd7b181 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 17:25:20 +0300 Subject: [PATCH 177/789] Fix for bug #23775 "Replicated event larger that max_allowed_packet infinitely re-transmits". Problem: to handle a situation when the size of event on the master is greater than max_allowed_packet on slave, we checked for the wrong constant (ER_NET_PACKET_TOO_LARGE instead of CR_NET_PACKET_TOO_LARGE). Solution: test for the client "packet too large" error code instead of the server one in slave I/O thread. mysql-test/r/rpl_packet.result: Added test case for bug #23775 "Replicated event larger that max_allowed_packet infinitely re-transmits" mysql-test/t/rpl_packet.test: Added test case for bug #23775 "Replicated event larger that max_allowed_packet infinitely re-transmits" sql/slave.cc: Test for the client "packet too large" error code instead of the server one in slave I/O thread. --- mysql-test/r/rpl_packet.result | 9 +++++++++ mysql-test/t/rpl_packet.test | 33 +++++++++++++++++++++++++++++++++ sql/slave.cc | 3 ++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/r/rpl_packet.result index a5c9b43cabb..894bc81b08d 100644 --- a/mysql-test/r/rpl_packet.result +++ b/mysql-test/r/rpl_packet.result @@ -15,3 +15,12 @@ select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_______________ count(*) 1 drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; +SET @@global.max_allowed_packet=4096; +SET @@global.net_buffer_length=4096; +STOP SLAVE; +START SLAVE; +CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM; +INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); +SHOW STATUS LIKE 'Slave_running'; +Variable_name Value +Slave_running OFF diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/t/rpl_packet.test index d01979a4731..db6f475dc94 100644 --- a/mysql-test/t/rpl_packet.test +++ b/mysql-test/t/rpl_packet.test @@ -36,4 +36,37 @@ save_master_pos; connection slave; sync_with_master; +# +# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits +# +# Check that a situation when the size of event on the master is greater than +# max_allowed_packet on the slave does not lead to infinite re-transmits. + +connection master; + +# Change the max packet size on master + +SET @@global.max_allowed_packet=4096; +SET @@global.net_buffer_length=4096; + +# Restart slave for new setting to take effect +connection slave; +STOP SLAVE; +START SLAVE; + +# Reconnect to master for new setting to take effect +disconnect master; +connect (master, localhost, root) +connection master; + +CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM; + +INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); + +# The slave I/O thread must stop after trying to read the above event +connection slave; +sleep 2; +SHOW STATUS LIKE 'Slave_running'; + + # End of tests diff --git a/sql/slave.cc b/sql/slave.cc index 8805f950d50..3c21bf657a0 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -25,6 +25,7 @@ #include #include #include +#include #define MAX_SLAVE_RETRY_PAUSE 5 bool use_slave_mask = 0; @@ -3606,7 +3607,7 @@ after reconnect"); if (event_len == packet_error) { uint mysql_error_number= mysql_errno(mysql); - if (mysql_error_number == ER_NET_PACKET_TOO_LARGE) + if (mysql_error_number == CR_NET_PACKET_TOO_LARGE) { sql_print_error("\ Log entry on master is longer than max_allowed_packet (%ld) on \ From 086fba76272c2350b71c93e4343ab5fb3ea5d7da Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 17:31:07 +0300 Subject: [PATCH 178/789] BUG#16420: Events: timestamps become UTC BUG#26429: SHOW CREATE EVENT is incorrect for an event that STARTS NOW() BUG#26431: Impossible to re-create an event from backup if its STARTS clause is in the past WL#3698: Events: execution in local time zone The problem was that local times specified by the user in AT, STARTS and ENDS of CREATE EVENT/ALTER EVENT statement were converted to UTC, and the original time zone was forgotten. This way, event scheduler couldn't honor Daylight Saving Time shifts, and times shown to the user were also in UTC. Additionally, CREATE EVENT didn't allow times in the past, thus preventing straightforward event restoration from old backups. This patch reworks event scheduler time computations, performing them in the time zone associated with the event. Also it allows times to be in the past. The patch adds time_zone column to mysql.event table. NOTE: The patch is almost final, but the bug#9953 should be pushed first. client/mysqldump.c: Before every CREATE EVENT, output its time zone. mysql-test/include/wait_condition.inc: Add optional $wait_timeout parameter. mysql-test/lib/init_db.sql: Add time_zone column. mysql-test/r/events.result: Update result. mysql-test/r/events_bugs.result: Update result. mysql-test/r/events_grant.result: Update result. mysql-test/r/events_restart_phase1.result: Update result. mysql-test/r/events_scheduling.result: Update result. mysql-test/r/mysqldump.result: Update result. mysql-test/r/ps.result: Update result. mysql-test/r/system_mysql_db.result: Update result. mysql-test/t/events.test: Remove STARTS from the result, as it depends on current time. mysql-test/t/events_bugs.test: Time in the past is no longer an error. mysql-test/t/events_restart_phase1.test: Fill new column 'time_zone' in mysql.event. mysql-test/t/events_scheduling.test: Cleanup: disable event scheduler. scripts/mysql_create_system_tables.sh: Add new column 'time_zone' to mysql.event. scripts/mysql_fix_privilege_tables.sql: Add new column 'time_zone' to mysql.event. sql/event_data_objects.cc: The essence of the change is the following: - for internal times use my_time_t instead of TIME. Assignment and comparison is done now on plain numbers. - in init_execute_at(), init_starts(), init_ends() convert given time to number of seconds since Epoch (aka Unix time, in UTC). - handle time_zone field loading and storing. - in get_next_time(), Unix time is converted back to event time zone, interval is added, and the result is converted to UTC again. - fix Event_timed::get_create_event() to report STARTS and ENDS. - before executing the event body we set thread time zone to the event time zone. sql/event_data_objects.h: Add time_zone member to Event_basic class. Store internal times in my_time_t (number of seconds since Epoch), rather than in broken down TIME structure. sql/event_db_repository.cc: Add time_zone column handling. Give a warning and do not create an event if its execution time is in the past, and ON COMPLETION NOT PRESERVE is set, because such an event should be dropped by that time. Also, do not allow ALTER EVENT to set execution time in the past when ON COMPLETION NOT PRESERVE is set. sql/event_db_repository.h: Add enum member for new time zone column. sql/event_queue.cc: Replace handling of broken down times with simple handling of my_time_t. sql/event_queue.h: Store internal times in my_time_t (number of seconds since Epoch), rather than in broken down TIME structure. sql/event_scheduler.cc: Add TODO comment. sql/events.cc: Send time_zone column for SHOW CREATE EVENT. sql/share/errmsg.txt: Update error message, and add two more errors. sql/sql_show.cc: Add TIME_ZONE column to the output of SHOW EVENTS. mysql-test/r/events_time_zone.result: BitKeeper file /home/tomash/src/mysql_ab/mysql-5.1-wl3698/mysql-test/r/events_time_zone.result mysql-test/t/events_time_zone.test: BitKeeper file /home/tomash/src/mysql_ab/mysql-5.1-wl3698/mysql-test/t/events_time_zone.test --- client/mysqldump.c | 12 +- mysql-test/include/wait_condition.inc | 17 +- mysql-test/lib/init_db.sql | 1 + mysql-test/r/events.result | 101 ++-- mysql-test/r/events_bugs.result | 7 +- mysql-test/r/events_grant.result | 24 +- mysql-test/r/events_restart_phase1.result | 4 +- mysql-test/r/events_scheduling.result | 1 + mysql-test/r/events_time_zone.result | 291 +++++++++++ mysql-test/r/mysqldump.result | 32 +- mysql-test/r/ps.result | 12 +- mysql-test/r/system_mysql_db.result | 1 + mysql-test/t/events.test | 19 + mysql-test/t/events_bugs.test | 11 +- mysql-test/t/events_restart_phase1.test | 4 +- mysql-test/t/events_scheduling.test | 1 + mysql-test/t/events_time_zone.test | 463 +++++++++++++++++ scripts/mysql_create_system_tables.sh | 1 + scripts/mysql_fix_privilege_tables.sql | 5 +- sql/event_data_objects.cc | 581 +++++++++++++--------- sql/event_data_objects.h | 35 +- sql/event_db_repository.cc | 43 +- sql/event_db_repository.h | 1 + sql/event_queue.cc | 43 +- sql/event_queue.h | 2 +- sql/event_scheduler.cc | 8 + sql/events.cc | 13 +- sql/share/errmsg.txt | 7 +- sql/sql_show.cc | 24 +- 29 files changed, 1382 insertions(+), 382 deletions(-) create mode 100644 mysql-test/r/events_time_zone.result create mode 100644 mysql-test/t/events_time_zone.test diff --git a/client/mysqldump.c b/client/mysqldump.c index 5f2749eef77..c86a2fc385f 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1431,6 +1431,8 @@ static uint dump_events_for_db(char *db) strcpy(delimiter, ";"); if (mysql_num_rows(event_list_res) > 0) { + fprintf(sql_file, "/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;\n"); + while ((event_list_row= mysql_fetch_row(event_list_res)) != NULL) { event_name= quote_name(event_list_row[1], name_buff, 0); @@ -1447,13 +1449,13 @@ static uint dump_events_for_db(char *db) if the user has EXECUTE privilege he can see event names, but not the event body! */ - if (strlen(row[2]) != 0) + if (strlen(row[3]) != 0) { if (opt_drop) fprintf(sql_file, "/*!50106 DROP EVENT IF EXISTS %s */%s\n", event_name, delimiter); - delimit_test= create_delimiter(row[2], delimiter, sizeof(delimiter)); + delimit_test= create_delimiter(row[3], delimiter, sizeof(delimiter)); if (delimit_test == NULL) { fprintf(stderr, "%s: Warning: Can't dump event '%s'\n", event_name, my_progname); @@ -1461,11 +1463,15 @@ static uint dump_events_for_db(char *db) } fprintf(sql_file, "DELIMITER %s\n", delimiter); - fprintf(sql_file, "/*!50106 %s */ %s\n", row[2], delimiter); + fprintf(sql_file, "/*!50106 SET TIME_ZONE= '%s' */ %s\n", + row[2], delimiter); + fprintf(sql_file, "/*!50106 %s */ %s\n", row[3], delimiter); } } /* end of event printing */ } /* end of list of events */ fprintf(sql_file, "DELIMITER ;\n"); + fprintf(sql_file, "/*!50106 SET TIME_ZONE= @save_time_zone */ ;\n"); + mysql_free_result(event_res); } mysql_free_result(event_list_res); diff --git a/mysql-test/include/wait_condition.inc b/mysql-test/include/wait_condition.inc index cd80b58d44e..2e6bd276aac 100644 --- a/mysql-test/include/wait_condition.inc +++ b/mysql-test/include/wait_condition.inc @@ -11,13 +11,28 @@ # SELECT c = 3 FROM t; # --source include/wait_condition.inc # +# OR +# +# let $wait_timeout= 60; # Override default 30 seconds with 60. +# let $wait_condition= +# SELECT c = 3 FROM t; +# --source include/wait_condition.inc +# # EXAMPLE -# events_bugs.test +# events_bugs.test, events_time_zone.test # --disable_query_log let $wait_counter= 300; +if ($wait_timeout) +{ + let $wait_counter= `SELECT $wait_timeout * 10`; +} +# Reset $wait_timeout so that its value won't be used on subsequent +# calls, and default will be used instead. +let $wait_timeout= 0; + while ($wait_counter) { let $success= `$wait_condition`; diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index c6c0f1d81dd..e689db94e9f 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -645,6 +645,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index af864c57efa..cab5762012c 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -118,81 +118,81 @@ drop table t_event3; set names utf8; CREATE EVENT root6 ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1; SHOW CREATE EVENT root6; -Event sql_mode Create Event -root6 CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 +Event sql_mode time_zone Create Event +root6 SYSTEM CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 create event root7 on schedule every 2 year do select 1; SHOW CREATE EVENT root7; -Event sql_mode Create Event -root7 CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root7 SYSTEM CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root8 on schedule every '2:5' year_month do select 1; SHOW CREATE EVENT root8; -Event sql_mode Create Event -root8 CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root8 SYSTEM CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root8_1 on schedule every '2:15' year_month do select 1; SHOW CREATE EVENT root8_1; -Event sql_mode Create Event -root8_1 CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root8_1 SYSTEM CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root9 on schedule every 2 week ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' do select 1; SHOW CREATE EVENT root9; -Event sql_mode Create Event -root9 CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 +Event sql_mode time_zone Create Event +root9 SYSTEM CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 create event root10 on schedule every '20:5' day_hour do select 1; SHOW CREATE EVENT root10; -Event sql_mode Create Event -root10 CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root10 SYSTEM CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root11 on schedule every '20:25' day_hour do select 1; SHOW CREATE EVENT root11; -Event sql_mode Create Event -root11 CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root11 SYSTEM CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root12 on schedule every '20:25' hour_minute do select 1; SHOW CREATE EVENT root12; -Event sql_mode Create Event -root12 CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root12 SYSTEM CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root13 on schedule every '25:25' hour_minute do select 1; SHOW CREATE EVENT root13; -Event sql_mode Create Event -root13 CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root13 SYSTEM CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root13_1 on schedule every '11:65' hour_minute do select 1; SHOW CREATE EVENT root13_1; -Event sql_mode Create Event -root13_1 CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root13_1 SYSTEM CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root14 on schedule every '35:35' minute_second do select 1; SHOW CREATE EVENT root14; -Event sql_mode Create Event -root14 CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root14 SYSTEM CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root15 on schedule every '35:66' minute_second do select 1; SHOW CREATE EVENT root15; -Event sql_mode Create Event -root15 CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root15 SYSTEM CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root16 on schedule every '35:56' day_minute do select 1; SHOW CREATE EVENT root16; -Event sql_mode Create Event -root16 CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root16 SYSTEM CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root17 on schedule every '35:12:45' day_minute do select 1; SHOW CREATE EVENT root17; -Event sql_mode Create Event -root17 CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root17 SYSTEM CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root17_1 on schedule every '35:25:65' day_minute do select 1; SHOW CREATE EVENT root17_1; -Event sql_mode Create Event -root17_1 CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root17_1 SYSTEM CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root18 on schedule every '35:12:45' hour_second do select 1; SHOW CREATE EVENT root18; -Event sql_mode Create Event -root18 CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root18 SYSTEM CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root19 on schedule every '15:59:85' hour_second do select 1; SHOW CREATE EVENT root19; -Event sql_mode Create Event -root19 CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root19 SYSTEM CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 create event root20 on schedule every '50:20:12:45' day_second do select 1; SHOW CREATE EVENT root20; -Event sql_mode Create Event -root20 CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +Event sql_mode time_zone Create Event +root20 SYSTEM CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 set names cp1251; create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1; SHOW CREATE EVENT ðóóò21; -Event sql_mode Create Event -ðóóò21 CREATE EVENT `ðóóò21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND ON COMPLETION NOT PRESERVE ENABLE COMMENT 'òîâà å 1251 êîìåíòàð' DO select 1 +Event sql_mode time_zone Create Event +ðóóò21 SYSTEM CREATE EVENT `ðóóò21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'òîâà å 1251 êîìåíòàð' DO select 1 insert into mysql.event (db, name, body, definer, interval_value, interval_field) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND"); show create event root22; ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' @@ -225,18 +225,18 @@ drop event set names latin1; CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED ALTER TABLE mysql.event ADD dummy INT FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 16, found 17. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 16, found 17. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted ALTER TABLE mysql.event DROP dummy2; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED CREATE TABLE event_like LIKE mysql.event; INSERT INTO event_like SELECT * FROM mysql.event; ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; @@ -262,6 +262,7 @@ event CREATE TABLE `event` ( `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; @@ -269,8 +270,8 @@ ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error l ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin default ''; "This should work" SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. @@ -279,14 +280,14 @@ SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. ALTER TABLE mysql.event DROP comment, DROP starts; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 16, found 14. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. Table probably corrupted DROP TABLE mysql.event; CREATE TABLE mysql.event like event_like; INSERT INTO mysql.event SELECT * FROM event_like; DROP TABLE event_like; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED DROP EVENT intact_check; create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; @@ -399,5 +400,5 @@ ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SHOW EVENTS FROM ``; ERROR 42000: Incorrect database name '' SHOW EVENTS FROM `events\\test`; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status drop database events_test; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index a7f0594588d..1a34f098b12 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -25,9 +25,12 @@ ERROR HY000: Incorrect STARTS value: '99990101000000' create event e_55 on schedule every 10 minute ends 99990101000000 do drop table t; ERROR HY000: ENDS is either invalid or before STARTS create event e_55 on schedule at 10000101000000 do drop table t; -ERROR HY000: Activation (AT) time is in the past +ERROR HY000: Incorrect AT value: '10000101000000' create event e_55 on schedule at 20000101000000 do drop table t; -ERROR HY000: Activation (AT) time is in the past +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +show events; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starts 10000101000000 do drop table t' at line 1 create event e_55 on schedule at 20200101000000 ends 10000101000000 do drop table t; diff --git a/mysql-test/r/events_grant.result b/mysql-test/r/events_grant.result index a28c30a9345..8bcf40b5167 100644 --- a/mysql-test/r/events_grant.result +++ b/mysql-test/r/events_grant.result @@ -2,8 +2,8 @@ CREATE DATABASE IF NOT EXISTS events_test; use events_test; CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME; EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE @@ -29,8 +29,8 @@ ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_te USE events_test; "We should see one event"; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED SELECT CONCAT("Let's create some new events from the name of ", USER()); CONCAT("Let's create some new events from the name of ", USER()) Let's create some new events from the name of ev_test@localhost @@ -40,18 +40,18 @@ CREATE EVENT two_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION NOT PRESERVE CO CREATE EVENT three_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION PRESERVE COMMENT "three event" DO SELECT 123; "Now we should see 3 events:"; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED -events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED -events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED +events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED +events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED "This should show us only 2 events:"; SHOW EVENTS LIKE 't%event'; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED -events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test three_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED +events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLED "This should show us no events:"; SHOW EVENTS FROM test LIKE '%'; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status GRANT EVENT ON events_test2.* TO ev_test@localhost; USE events_test2; CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42; diff --git a/mysql-test/r/events_restart_phase1.result b/mysql-test/r/events_restart_phase1.result index a7a46fa0ab1..0c032884dc4 100644 --- a/mysql-test/r/events_restart_phase1.result +++ b/mysql-test/r/events_restart_phase1.result @@ -7,6 +7,6 @@ create event abc2 on schedule every 1 second do insert into execution_log value( create event abc3 on schedule every 1 second do insert into execution_log value('abc3'); select name from execution_log; name -insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1'); -insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2'); +insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1','SYSTEM'); +insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2','SYSTEM'); "Now we restart the server" diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result index 180c2e4883d..d885dc3a048 100644 --- a/mysql-test/r/events_scheduling.result +++ b/mysql-test/r/events_scheduling.result @@ -83,3 +83,4 @@ DROP TABLE table_2; DROP TABLE table_3; DROP TABLE table_4; DROP DATABASE events_test; +SET GLOBAL event_scheduler=OFF; diff --git a/mysql-test/r/events_time_zone.result b/mysql-test/r/events_time_zone.result new file mode 100644 index 00000000000..3d5ff794848 --- /dev/null +++ b/mysql-test/r/events_time_zone.result @@ -0,0 +1,291 @@ +DROP DATABASE IF EXISTS mysqltest_db1; +CREATE DATABASE mysqltest_db1; +USE mysqltest_db1; +SET GLOBAL EVENT_SCHEDULER= OFF; +SET @save_time_zone= @@TIME_ZONE; +SET TIME_ZONE= '+00:00'; +SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED +SET TIME_ZONE= '-01:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED +SET TIME_ZONE= '+02:00'; +ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED +SET TIME_ZONE= '-03:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED +SET TIME_ZONE= '+04:00'; +ALTER EVENT e1 DO SELECT 2; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED +DROP EVENT e1; +SET TIME_ZONE='+05:00'; +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO +SELECT 1; +SET TIMESTAMP= @@TIMESTAMP + 1; +SET TIME_ZONE='-05:00'; +CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO +SELECT 1; +SET TIMESTAMP= @@TIMESTAMP + 1; +SET TIME_ZONE='+00:00'; +CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO +SELECT 1; +SELECT * FROM INFORMATION_SCHEMA.EVENTS; +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT +NULL mysqltest_db1 e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL +NULL mysqltest_db1 e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL +NULL mysqltest_db1 e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +SHOW CREATE EVENT e1; +Event sql_mode time_zone Create Event +e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +SHOW CREATE EVENT e2; +Event sql_mode time_zone Create Event +e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +SHOW CREATE EVENT e3; +Event sql_mode time_zone Create Event +e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +The following should fail, and nothing should be altered. +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00'; +ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE; +ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered +The following should give warnings, and nothing should be created. +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' +DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE +DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE +DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +The following should succeed giving a warning. +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; +Warnings: +Note 1533 Event execution time is in the past. Event has been disabled +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE +DO +SELECT 1; +Warnings: +Note 1533 Event execution time is in the past. Event has been disabled +CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE +DO +SELECT 1; +Warnings: +Note 1533 Event execution time is in the past. Event has been disabled +The following should succeed without warnings. +ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'; +ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; +CREATE EVENT e6 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO +SELECT 1; +CREATE EVENT e7 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE +DO +SELECT 1; +CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE DISABLE +DO +SELECT 1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +mysqltest_db1 e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED +mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +mysqltest_db1 e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +mysqltest_db1 e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED +mysqltest_db1 e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED +mysqltest_db1 e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +mysqltest_db1 e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED +DROP EVENT e8; +DROP EVENT e7; +DROP EVENT e6; +DROP EVENT e5; +DROP EVENT e4; +DROP EVENT e3; +DROP EVENT e2; +DROP EVENT e1; +CREATE TABLE t_step (step INT); +INSERT INTO t_step VALUES (@step); +CREATE FUNCTION round_to_step(i INT, n INT) RETURNS INT +BEGIN +DECLARE step INT; +SELECT * INTO step FROM t_step; +# We add 0.1 as a protection from inexact division. +RETURN FLOOR((i % (step * n) + 0.1) / step); +END// +SET @step3= @step * 3; +SET @step6= @step * 6; +SET @unix_time= @unix_time - @unix_time % @step6; +INSERT INTO mysql.time_zone VALUES (NULL, 'N'); +SET @tzid= LAST_INSERT_ID(); +INSERT INTO mysql.time_zone_transition_type +VALUES (@tzid, 0, 0, 0, 'b16420_0'); +INSERT INTO mysql.time_zone_transition_type +VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1'); +INSERT INTO mysql.time_zone_name VALUES ('bug16420', @tzid); +CREATE TABLE t1 (count INT, unix_time INT, local_time INT, comment CHAR(80)); +CREATE TABLE t2 (count INT); +INSERT INTO t2 VALUES (1); +CREATE FUNCTION f1(comment CHAR(80)) RETURNS INT +BEGIN +DECLARE orig_tz CHAR(64); +DECLARE unix_time INT; +DECLARE local_now DATETIME; +DECLARE utc_now DATETIME; +DECLARE local_time INT; +SET unix_time= UNIX_TIMESTAMP(); +SET local_now= FROM_UNIXTIME(unix_time); +SET orig_tz= @@TIME_ZONE; +SET TIME_ZONE = '+00:00'; +SET utc_now= FROM_UNIXTIME(unix_time); +SET TIME_ZONE= orig_tz; +SET local_time = unix_time + TIMESTAMPDIFF(SECOND, utc_now, local_now); +SET unix_time= round_to_step(unix_time, 6); +SET local_time= round_to_step(local_time, 6); +INSERT INTO t1 VALUES ((SELECT count FROM t2), +unix_time, local_time, comment); +RETURN 0; +END// +SET TIME_ZONE= '+00:00'; +CREATE EVENT e1 ON SCHEDULE EVERY @step SECOND +STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1(""); +SET TIME_ZONE= 'bug16420'; +CREATE EVENT e2 ON SCHEDULE EVERY @step SECOND +STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1(""); +SET GLOBAL EVENT_SCHEDULER= ON; +SELECT SLEEP(@step / 2); +SLEEP(@step / 2) +0 +SET GLOBAL EVENT_SCHEDULER= OFF; +SELECT * FROM t1 ORDER BY count, comment; +count unix_time local_time comment +1 1 1 +1 1 3 +1 1 3 e2 should be executed +2 2 2 +2 2 4 +2 2 4 e2 should be executed +3 3 3 +3 3 3 Second pass after backward -2 step shift, e2 should not be executed +4 4 4 +4 4 4 Second pass after backward -2 step shift, e2 should not be executed +5 5 5 +5 5 5 +5 5 5 e2 should be executed +6 0 0 +6 0 2 +6 0 2 Forward +2 step shift, local 0, 1 are skipped, e2 should be executed +7 1 1 +7 1 3 +7 1 3 e2 should be executed +SET TIME_ZONE= @save_time_zone; +DROP EVENT e2; +DROP EVENT e1; +DROP FUNCTION f1; +DROP TABLE t1, t2; +DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid; +SET TIME_ZONE= '+00:00'; +CREATE TABLE t1 (event CHAR(2), dt DATE, offset INT); +INSERT INTO mysql.time_zone VALUES (NULL, 'N'); +SET @tzid= LAST_INSERT_ID(); +SET @now= UNIX_TIMESTAMP(); +SET @offset_month_01= UNIX_TIMESTAMP('2030-01-31 12:00:00') - @now; +SET @offset_month_02= UNIX_TIMESTAMP('2030-02-28 12:00:00') - @now - 5*@step; +SET @offset_month_03= UNIX_TIMESTAMP('2030-03-31 12:00:00') - @now - 5*@step; +SET @offset_month_04= UNIX_TIMESTAMP('2030-04-30 12:00:00') - @now - 13*@step; +INSERT INTO mysql.time_zone_transition_type +VALUES (@tzid, 0, @offset_month_01, 0, 'b16420_0'); +INSERT INTO mysql.time_zone_transition_type +VALUES (@tzid, 1, @offset_month_02, 1, 'b16420_1'); +INSERT INTO mysql.time_zone_transition_type +VALUES (@tzid, 2, @offset_month_03, 1, 'b16420_2'); +INSERT INTO mysql.time_zone_transition_type +VALUES (@tzid, 3, @offset_month_04, 1, 'b16420_3'); +INSERT INTO mysql.time_zone_transition +VALUES (@tzid, @now, 0); +INSERT INTO mysql.time_zone_transition +VALUES (@tzid, @now + 3 * @step, 1); +INSERT INTO mysql.time_zone_transition +VALUES (@tzid, @now + 7 * @step, 2); +INSERT INTO mysql.time_zone_transition +VALUES (@tzid, @now + 12 * @step, 3); +INSERT INTO mysql.time_zone_name VALUES ('bug16420_2', @tzid); +SET TIME_ZONE= 'bug16420_2'; +SET GLOBAL EVENT_SCHEDULER= ON; +SET GLOBAL EVENT_SCHEDULER= OFF; +Below we should see the following: +- On Jan 31 only e2 is executed, because we started later than +e1 should have been executed. Offset of e2 is 0 because of +the late start, not 1. +- The next execution is on Feb 28 (last day of Feb). Both events +are executed in their times, offsets are -1 and 1. +- The next time is Mar 31. Because the time of event +execution was skipped over, events are executed right away, +offsets are 2 and 2. +- The next time is Apr 30. Events are again executed in their +appointed times, offsets are -1 and 1. +SELECT * FROM t1 ORDER BY dt, event; +event dt offset +e2 2030-01-31 0 +e1 2030-02-28 -1 +e2 2030-02-28 1 +e1 2030-03-31 2 +e2 2030-03-31 2 +e1 2030-04-30 -1 +e2 2030-04-30 1 +DROP EVENT e2; +DROP EVENT e1; +DROP TABLE t1; +SET TIME_ZONE= @save_time_zone; +DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid; +DROP FUNCTION round_to_step; +DROP TABLE t_step; +DROP DATABASE mysqltest_db1; +End of 5.1 tests. diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 0190094f0ba..da90ff2cf6b 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3440,35 +3440,35 @@ use first; set time_zone = 'UTC'; create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5; show events; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -first ee1 root@localhost ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED show create event ee1; -Event sql_mode Create Event -ee1 CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 +Event sql_mode time_zone Create Event +ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 drop database first; create database second; use second; show events; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -second ee1 root@localhost ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED show create event ee1; -Event sql_mode Create Event -ee1 NO_AUTO_VALUE_ON_ZERO CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 +Event sql_mode time_zone Create Event +ee1 NO_AUTO_VALUE_ON_ZERO UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5; create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5; show events; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -second ee1 root@localhost ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED -second ee2 root@localhost ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED -second ee3 root@localhost ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED +second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED +second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED drop database second; create database third; use third; show events; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -third ee1 root@localhost ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED -third ee2 root@localhost ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED -third ee3 root@localhost ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED +third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED +third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED drop database third; set time_zone = 'SYSTEM'; use test; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 7790de570b0..c4e44945ec4 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1968,11 +1968,11 @@ prepare abc from "show master logs"; deallocate prepare abc; create procedure proc_1() show events; call proc_1(); -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status call proc_1(); -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status call proc_1(); -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status drop procedure proc_1; create function func_1() returns int begin show events; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -1982,11 +1982,11 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show events"; execute abc; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status execute abc; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status execute abc; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status deallocate prepare abc; drop procedure if exists a; create procedure a() select 42; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index c93fbfba6e2..29223cd3061 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -224,6 +224,7 @@ event CREATE TABLE `event` ( `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' show create table general_log; diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index 6eb514fc13c..24f4b4eccab 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -122,43 +122,62 @@ set names utf8; # SHOW CREATE EVENT test begin # CREATE EVENT root6 ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root6; create event root7 on schedule every 2 year do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root7; create event root8 on schedule every '2:5' year_month do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root8; create event root8_1 on schedule every '2:15' year_month do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root8_1; create event root9 on schedule every 2 week ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root9; create event root10 on schedule every '20:5' day_hour do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root10; create event root11 on schedule every '20:25' day_hour do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root11; create event root12 on schedule every '20:25' hour_minute do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root12; create event root13 on schedule every '25:25' hour_minute do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root13; create event root13_1 on schedule every '11:65' hour_minute do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root13_1; create event root14 on schedule every '35:35' minute_second do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root14; create event root15 on schedule every '35:66' minute_second do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root15; create event root16 on schedule every '35:56' day_minute do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root16; create event root17 on schedule every '35:12:45' day_minute do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root17; create event root17_1 on schedule every '35:25:65' day_minute do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root17_1; create event root18 on schedule every '35:12:45' hour_second do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root18; create event root19 on schedule every '15:59:85' hour_second do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root19; create event root20 on schedule every '50:20:12:45' day_second do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT root20; set names cp1251; create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1; +--replace_regex /STARTS '[^']+'/STARTS '#'/ SHOW CREATE EVENT ðóóò21; insert into mysql.event (db, name, body, definer, interval_value, interval_field) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND"); --error ER_NOT_SUPPORTED_YET diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 0790999d720..c1016f1752b 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -45,10 +45,17 @@ create event e_55 on schedule at 99990101000000 do drop table t; create event e_55 on schedule every 10 hour starts 99990101000000 do drop table t; --error ER_EVENT_ENDS_BEFORE_STARTS create event e_55 on schedule every 10 minute ends 99990101000000 do drop table t; ---error ER_EVENT_EXEC_TIME_IN_THE_PAST +--error ER_WRONG_VALUE create event e_55 on schedule at 10000101000000 do drop table t; ---error ER_EVENT_EXEC_TIME_IN_THE_PAST + +# For the purpose of backup we allow times in the past. Here, no +# error will be given, but the event won't be created. One may think +# of that as if the event was created, then it turned out it's in the +# past, so it was dropped because of implicit ON COMPLETION NOT +# PRESERVE. create event e_55 on schedule at 20000101000000 do drop table t; +show events; + --error ER_PARSE_ERROR create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t; --error ER_PARSE_ERROR diff --git a/mysql-test/t/events_restart_phase1.test b/mysql-test/t/events_restart_phase1.test index 92783ddaef7..0a84f6c4966 100644 --- a/mysql-test/t/events_restart_phase1.test +++ b/mysql-test/t/events_restart_phase1.test @@ -14,6 +14,6 @@ create event abc3 on schedule every 1 second do insert into execution_log value( --sleep 1.5 select name from execution_log; -insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1'); -insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2'); +insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1','SYSTEM'); +insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2','SYSTEM'); --echo "Now we restart the server" diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index 0002cf9f29f..e3b55685e65 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -63,3 +63,4 @@ DROP TABLE table_2; DROP TABLE table_3; DROP TABLE table_4; DROP DATABASE events_test; +SET GLOBAL event_scheduler=OFF; diff --git a/mysql-test/t/events_time_zone.test b/mysql-test/t/events_time_zone.test new file mode 100644 index 00000000000..fff84c7a995 --- /dev/null +++ b/mysql-test/t/events_time_zone.test @@ -0,0 +1,463 @@ +# This test case is sensitive to execution timing. You may control +# this sensitivity by the parameter below. Small values will result +# in fast but more unstable execution, large values will improve +# stability at the cost of speed. Basically, N is a number of seconds +# to wait for operation to complete. Should be positive. Test runs +# about 25*N seconds (it sleeps most of the time, so CPU speed is not +# relevant). +let $N = 5; + +--source include/big_test.inc + + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest_db1; +--enable_warnings + +CREATE DATABASE mysqltest_db1; + +let $old_db= `SELECT DATABASE()`; +USE mysqltest_db1; + +SET GLOBAL EVENT_SCHEDULER= OFF; + + +# +# BUG#16420: Events: timestamps become UTC +# BUG#26429: SHOW CREATE EVENT is incorrect for an event that +# STARTS NOW() +# BUG#26431: Impossible to re-create an event from backup if its +# STARTS clause is in the past +# WL#3698: Events: execution in local time zone +# + +SET @save_time_zone= @@TIME_ZONE; + +#---------------------------------------------------------------------- + +# We will use a separate connection because SET TIMESTAMP will stop +# the clock in that connection. + +connect (conn1, localhost, root, , mysqltest_db1); + +SET TIME_ZONE= '+00:00'; +SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); + + +# Test when event time zone is updated on ALTER EVENT. +# + +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +SHOW EVENTS; + +# Test storing and updating of the event time zone. +# +SET TIME_ZONE= '-01:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; +SHOW EVENTS; + +# This will update event time zone. +SET TIME_ZONE= '+02:00'; +ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; + +# This will update event time zone. +SET TIME_ZONE= '-03:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; + +# This will not update event time zone, as no time is being adjusted. +SET TIME_ZONE= '+04:00'; +ALTER EVENT e1 DO SELECT 2; +SHOW EVENTS; + +DROP EVENT e1; + +#---------------------------------------------------------------------- + +# Create some events. +SET TIME_ZONE='+05:00'; +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO + SELECT 1; + +SET TIMESTAMP= @@TIMESTAMP + 1; + +SET TIME_ZONE='-05:00'; +CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO + SELECT 1; + +SET TIMESTAMP= @@TIMESTAMP + 1; + +SET TIME_ZONE='+00:00'; +CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO + SELECT 1; + + +# Test INFORMATION_SCHEMA.EVENTS. +# + +SELECT * FROM INFORMATION_SCHEMA.EVENTS; + + +# Test SHOW EVENTS. +# + +SHOW EVENTS; + + +# Test SHOW CREATE EVENT. +# + +SHOW CREATE EVENT e1; +SHOW CREATE EVENT e2; +SHOW CREATE EVENT e3; + +#---------------------------------------------------------------------- + +# Test times in the past. +# + +--echo The following should fail, and nothing should be altered. + +--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00'; + +--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE; + +--echo The following should give warnings, and nothing should be created. + +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' +DO + SELECT 1; + +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE +DO + SELECT 1; + +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO + SELECT 1; + +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE +DO + SELECT 1; + +SHOW EVENTS; + +--echo The following should succeed giving a warning. + +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; + +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE +DO + SELECT 1; + +CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE +DO + SELECT 1; + +--echo The following should succeed without warnings. + +ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'; + +ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; + +CREATE EVENT e6 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO + SELECT 1; + +CREATE EVENT e7 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE +DO + SELECT 1; + +CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE DISABLE +DO + SELECT 1; + +SHOW EVENTS; + + +DROP EVENT e8; +DROP EVENT e7; +DROP EVENT e6; +DROP EVENT e5; +DROP EVENT e4; +DROP EVENT e3; +DROP EVENT e2; +DROP EVENT e1; + + +disconnect conn1; +connection default; + +#---------------------------------------------------------------------- + +# Create rounding function. + +# Disable query log to hide actual value of $N. +--disable_query_log +eval SET @step= $N; +--enable_query_log + +# Since we are working in a separate database, we may use any names we +# like. +CREATE TABLE t_step (step INT); +INSERT INTO t_step VALUES (@step); + +# We can't use @variables in function, because it will be called from +# the event thread, and 'eval' doesn't work for multi-statements, so +# we can't interpolate $variables either, hence we fetch the step +# value from the table. +delimiter //; +CREATE FUNCTION round_to_step(i INT, n INT) RETURNS INT +BEGIN + DECLARE step INT; + + SELECT * INTO step FROM t_step; + + # We add 0.1 as a protection from inexact division. + RETURN FLOOR((i % (step * n) + 0.1) / step); +END// +delimiter ;// + + +# Test time computations wrt Daylight Saving Time shifts. We also +# test here that the event operates in its time zone (see what NOW() +# returns). +# + +# Create a fake time zone with time transitions every 3*$N second. + +SET @step3= @step * 3; +SET @step6= @step * 6; + +# Disable query log to hide current time. +--disable_query_log +SET @unix_time= UNIX_TIMESTAMP() - 1; +--enable_query_log + +SET @unix_time= @unix_time - @unix_time % @step6; + +INSERT INTO mysql.time_zone VALUES (NULL, 'N'); +SET @tzid= LAST_INSERT_ID(); +INSERT INTO mysql.time_zone_transition_type + VALUES (@tzid, 0, 0, 0, 'b16420_0'); +INSERT INTO mysql.time_zone_transition_type + VALUES (@tzid, 1, @step3 - @step, 1, 'b16420_1'); + +let $transition_unix_time= `SELECT @unix_time`; +let $count= 30; +--disable_query_log +while ($count) +{ + eval INSERT INTO mysql.time_zone_transition + VALUES (@tzid, $transition_unix_time, + $transition_unix_time % @step6 = 0); + let $transition_unix_time= `SELECT $transition_unix_time + @step3`; + dec $count; +} +--enable_query_log +INSERT INTO mysql.time_zone_name VALUES ('bug16420', @tzid); + +CREATE TABLE t1 (count INT, unix_time INT, local_time INT, comment CHAR(80)); +CREATE TABLE t2 (count INT); +INSERT INTO t2 VALUES (1); + +delimiter //; +CREATE FUNCTION f1(comment CHAR(80)) RETURNS INT +BEGIN + DECLARE orig_tz CHAR(64); + DECLARE unix_time INT; + DECLARE local_now DATETIME; + DECLARE utc_now DATETIME; + DECLARE local_time INT; + + SET unix_time= UNIX_TIMESTAMP(); + SET local_now= FROM_UNIXTIME(unix_time); + SET orig_tz= @@TIME_ZONE; + SET TIME_ZONE = '+00:00'; + SET utc_now= FROM_UNIXTIME(unix_time); + SET TIME_ZONE= orig_tz; + SET local_time = unix_time + TIMESTAMPDIFF(SECOND, utc_now, local_now); + + SET unix_time= round_to_step(unix_time, 6); + SET local_time= round_to_step(local_time, 6); + + INSERT INTO t1 VALUES ((SELECT count FROM t2), + unix_time, local_time, comment); + RETURN 0; +END// +delimiter ;// + +SET TIME_ZONE= '+00:00'; +CREATE EVENT e1 ON SCHEDULE EVERY @step SECOND + STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1(""); + +SET TIME_ZONE= 'bug16420'; +CREATE EVENT e2 ON SCHEDULE EVERY @step SECOND + STARTS FROM_UNIXTIME(@unix_time) DO SELECT f1(""); + +# We want to start at the beginning of the DST cycle, so we wait +# untill current time divides by @step6. +let $wait_timeout= `SELECT @step6 + 1`; +let $wait_condition= SELECT UNIX_TIMESTAMP() % @step6 = @step6 - 1; +--source include/wait_condition.inc +# The second wait is needed because after the first wait we may end up +# on the ending edge of a second. Second wait will bring us to the +# beginning edge. +let $wait_timeout= `SELECT @step + 1`; +let $wait_condition= SELECT UNIX_TIMESTAMP() % @step6 = 0; +--source include/wait_condition.inc + +# Note that after the scheduler is enabled, the event will be +# scheduled only for the next second. +SET GLOBAL EVENT_SCHEDULER= ON; + +# We want to run after the events are executed. +SELECT SLEEP(@step / 2); + +let $count= 7; +--disable_query_log +--disable_result_log +while ($count) +{ + SELECT SLEEP(@step); + + eval SELECT CASE $count + WHEN 5 THEN f1(CONCAT("Second pass after backward -2 step shift,", + " e2 should not be executed")) + WHEN 4 THEN f1(CONCAT("Second pass after backward -2 step shift,", + " e2 should not be executed")) + WHEN 2 THEN f1(CONCAT("Forward +2 step shift, local 0, 1 are skipped,", + " e2 should be executed")) + ELSE f1("e2 should be executed") + END; + UPDATE t2 SET count= count + 1; + + dec $count; +} +--enable_result_log +--enable_query_log + +SET GLOBAL EVENT_SCHEDULER= OFF; + +SELECT * FROM t1 ORDER BY count, comment; + +SET TIME_ZONE= @save_time_zone; + +DROP EVENT e2; +DROP EVENT e1; +DROP FUNCTION f1; +DROP TABLE t1, t2; + +DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid; + +#---------------------------------------------------------------------- + +# Test MONTH interval. +# + +SET TIME_ZONE= '+00:00'; + +CREATE TABLE t1 (event CHAR(2), dt DATE, offset INT); + +INSERT INTO mysql.time_zone VALUES (NULL, 'N'); +SET @tzid= LAST_INSERT_ID(); + +SET @now= UNIX_TIMESTAMP(); +SET @offset_month_01= UNIX_TIMESTAMP('2030-01-31 12:00:00') - @now; +SET @offset_month_02= UNIX_TIMESTAMP('2030-02-28 12:00:00') - @now - 5*@step; +SET @offset_month_03= UNIX_TIMESTAMP('2030-03-31 12:00:00') - @now - 5*@step; +SET @offset_month_04= UNIX_TIMESTAMP('2030-04-30 12:00:00') - @now - 13*@step; + +INSERT INTO mysql.time_zone_transition_type + VALUES (@tzid, 0, @offset_month_01, 0, 'b16420_0'); +INSERT INTO mysql.time_zone_transition_type + VALUES (@tzid, 1, @offset_month_02, 1, 'b16420_1'); +INSERT INTO mysql.time_zone_transition_type + VALUES (@tzid, 2, @offset_month_03, 1, 'b16420_2'); +INSERT INTO mysql.time_zone_transition_type + VALUES (@tzid, 3, @offset_month_04, 1, 'b16420_3'); +INSERT INTO mysql.time_zone_transition + VALUES (@tzid, @now, 0); +INSERT INTO mysql.time_zone_transition + VALUES (@tzid, @now + 3 * @step, 1); +INSERT INTO mysql.time_zone_transition + VALUES (@tzid, @now + 7 * @step, 2); +INSERT INTO mysql.time_zone_transition + VALUES (@tzid, @now + 12 * @step, 3); +# We have to user a new time zone name, because 'bug16420' has been +# cached already. +INSERT INTO mysql.time_zone_name VALUES ('bug16420_2', @tzid); + +SET TIME_ZONE= 'bug16420_2'; + +SET GLOBAL EVENT_SCHEDULER= ON; + +let $now= `SELECT @now`; +--disable_query_log +eval CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH + STARTS FROM_UNIXTIME($now - @step) DO + INSERT INTO t1 VALUES + ("e1", NOW(), round_to_step(UNIX_TIMESTAMP() - $now, 4) - 1); +eval CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH + STARTS FROM_UNIXTIME($now + @step) DO + INSERT INTO t1 VALUES + ("e2", NOW(), round_to_step(UNIX_TIMESTAMP() - $now, 4) - 1); +--enable_query_log + +let $wait_timeout= `SELECT 16 * @step`; +let $wait_condition= SELECT COUNT(*) = 7 FROM t1; +--source include/wait_condition.inc + +SET GLOBAL EVENT_SCHEDULER= OFF; + +--echo Below we should see the following: +--echo - On Jan 31 only e2 is executed, because we started later than +--echo e1 should have been executed. Offset of e2 is 0 because of +--echo the late start, not 1. +--echo - The next execution is on Feb 28 (last day of Feb). Both events +--echo are executed in their times, offsets are -1 and 1. +--echo - The next time is Mar 31. Because the time of event +--echo execution was skipped over, events are executed right away, +--echo offsets are 2 and 2. +--echo - The next time is Apr 30. Events are again executed in their +--echo appointed times, offsets are -1 and 1. +SELECT * FROM t1 ORDER BY dt, event; + +DROP EVENT e2; +DROP EVENT e1; +DROP TABLE t1; + +SET TIME_ZONE= @save_time_zone; + +DELETE FROM mysql.time_zone_name WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition_type WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone_transition WHERE time_zone_id = @tzid; +DELETE FROM mysql.time_zone WHERE time_zone_id = @tzid; + +DROP FUNCTION round_to_step; +DROP TABLE t_step; + + +DROP DATABASE mysqltest_db1; +--disable_query_log +eval USE $old_db; +--enable_query_log + + +--echo End of 5.1 tests. diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index cc86def1a5c..808f4adc222 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -867,6 +867,7 @@ then c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM'," c_ev="$c_ev PRIMARY KEY (db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9cdea507493..9a966c653f2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -683,6 +683,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; @@ -734,10 +735,12 @@ ALTER TABLE event ADD sql_mode 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; - UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; +ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 + NOT NULL DEFAULT 'SYSTEM' AFTER comment; + # # TRIGGER privilege # diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index dad8aeb2e20..36f20c34200 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -101,7 +101,7 @@ Event_parse_data::new_instance(THD *thd) */ Event_parse_data::Event_parse_data() - :on_completion(ON_COMPLETION_DROP), status(ENABLED), + :on_completion(ON_COMPLETION_DROP), status(ENABLED), do_not_create(FALSE), item_starts(NULL), item_ends(NULL), item_execute_at(NULL), starts_null(TRUE), ends_null(TRUE), execute_at_null(TRUE), item_expression(NULL), expression(0) @@ -109,9 +109,7 @@ Event_parse_data::Event_parse_data() DBUG_ENTER("Event_parse_data::Event_parse_data"); /* Actually in the parser STARTS is always set */ - set_zero_time(&starts, MYSQL_TIMESTAMP_DATETIME); - set_zero_time(&ends, MYSQL_TIMESTAMP_DATETIME); - set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME); + starts= ends= execute_at= 0; body.str= comment.str= NULL; body.length= comment.length= 0; @@ -223,6 +221,55 @@ Event_parse_data::init_body(THD *thd) } +/* + This function is called on CREATE EVENT or ALTER EVENT. When either + ENDS or AT is in the past, we are trying to create an event that + will never be executed. If it has ON COMPLETION NOT PRESERVE + (default), then it would normally be dropped already, so on CREATE + EVENT we give a warning, and do not create anyting. On ALTER EVENT + we give a error, and do not change the event. + + If the event has ON COMPLETION PRESERVE, then we see if the event is + created or altered to the ENABLED (default) state. If so, then we + give a warning, and change the state to DISABLED. + + Otherwise it is a valid event in ON COMPLETION PRESERVE DISABLE + state. +*/ + +void +Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc) +{ + if (ltime_utc >= (my_time_t) thd->query_start()) + return; + + if (on_completion == ON_COMPLETION_DROP) + { + switch (thd->lex->sql_command) { + case SQLCOM_CREATE_EVENT: + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_EVENT_CANNOT_CREATE_IN_THE_PAST, + ER(ER_EVENT_CANNOT_CREATE_IN_THE_PAST)); + break; + case SQLCOM_ALTER_EVENT: + my_error(ER_EVENT_CANNOT_ALTER_IN_THE_PAST, MYF(0)); + break; + default: + DBUG_ASSERT(0); + } + + do_not_create= TRUE; + } + else if (status == ENABLED) + { + status= DISABLED; + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_EVENT_EXEC_TIME_IN_THE_PAST, + ER(ER_EVENT_EXEC_TIME_IN_THE_PAST)); + } +} + + /* Sets time for execution for one-time event. @@ -240,8 +287,7 @@ Event_parse_data::init_execute_at(THD *thd) { my_bool not_used; TIME ltime; - my_time_t t; - TIME time_tmp; + my_time_t ltime_utc; DBUG_ENTER("Event_parse_data::init_execute_at"); @@ -256,35 +302,20 @@ Event_parse_data::init_execute_at(THD *thd) (starts_null && ends_null))); DBUG_ASSERT(starts_null && ends_null); - /* let's check whether time is in the past */ - thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, - (my_time_t) thd->query_start()); - if ((not_used= item_execute_at->get_date(<ime, TIME_NO_ZERO_DATE))) goto wrong_value; - if (TIME_to_ulonglong_datetime(<ime) < - TIME_to_ulonglong_datetime(&time_tmp)) - { - my_error(ER_EVENT_EXEC_TIME_IN_THE_PAST, MYF(0)); - DBUG_RETURN(ER_WRONG_VALUE); - } - - /* - This may result in a 1970-01-01 date if ltime is > 2037-xx-xx. - CONVERT_TZ has similar problem. - mysql_priv.h currently lists - #define TIMESTAMP_MAX_YEAR 2038 (see TIME_to_timestamp()) - */ - my_tz_UTC->gmt_sec_to_TIME(<ime,t=TIME_to_timestamp(thd,<ime,¬_used)); - if (!t) + ltime_utc= TIME_to_timestamp(thd,<ime,¬_used); + if (!ltime_utc) { DBUG_PRINT("error", ("Execute AT after year 2037")); goto wrong_value; } + check_if_in_the_past(thd, ltime_utc); + execute_at_null= FALSE; - execute_at= ltime; + execute_at= ltime_utc; DBUG_RETURN(0); wrong_value: @@ -424,8 +455,8 @@ int Event_parse_data::init_starts(THD *thd) { my_bool not_used; - TIME ltime, time_tmp; - my_time_t t; + TIME ltime; + my_time_t ltime_utc; DBUG_ENTER("Event_parse_data::init_starts"); if (!item_starts) @@ -437,36 +468,15 @@ Event_parse_data::init_starts(THD *thd) if ((not_used= item_starts->get_date(<ime, TIME_NO_ZERO_DATE))) goto wrong_value; - /* - Let's check whether time is in the past. - Note: This call is not post year 2038 safe. That's because - thd->query_start() is of time_t, while gmt_sec_to_TIME() - wants my_time_t. In the case time_t is larger than my_time_t - an overflow might happen and events subsystem will not work as - expected. - */ - thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, - (my_time_t) thd->query_start()); + ltime_utc= TIME_to_timestamp(thd, <ime, ¬_used); + if (!ltime_utc) + goto wrong_value; DBUG_PRINT("info",("now: %ld starts: %ld", - (long) TIME_to_ulonglong_datetime(&time_tmp), - (long) TIME_to_ulonglong_datetime(<ime))); - if (TIME_to_ulonglong_datetime(<ime) < - TIME_to_ulonglong_datetime(&time_tmp)) - goto wrong_value; + (long) thd->query_start(), (long) ltime_utc)); - /* - Again, after 2038 this code won't work. As - mysql_priv.h currently lists - #define TIMESTAMP_MAX_YEAR 2038 (see TIME_to_timestamp()) - */ - my_tz_UTC->gmt_sec_to_TIME(<ime,t=TIME_to_timestamp(thd, <ime, - ¬_used)); - if (!t) - goto wrong_value; - - starts= ltime; starts_null= FALSE; + starts= ltime_utc; DBUG_RETURN(0); wrong_value: @@ -498,9 +508,9 @@ wrong_value: int Event_parse_data::init_ends(THD *thd) { - TIME ltime, ltime_now; my_bool not_used; - my_time_t t; + TIME ltime; + my_time_t ltime_utc; DBUG_ENTER("Event_parse_data::init_ends"); if (!item_ends) @@ -513,34 +523,19 @@ Event_parse_data::init_ends(THD *thd) if ((not_used= item_ends->get_date(<ime, TIME_NO_ZERO_DATE))) goto error_bad_params; - /* - Again, after 2038 this code won't work. As - mysql_priv.h currently lists - #define TIMESTAMP_MAX_YEAR 2038 (see TIME_to_timestamp()) - */ - DBUG_PRINT("info", ("get the UTC time")); - my_tz_UTC->gmt_sec_to_TIME(<ime,t=TIME_to_timestamp(thd, <ime, - ¬_used)); - if (!t) + ltime_utc= TIME_to_timestamp(thd, <ime, ¬_used); + if (!ltime_utc) goto error_bad_params; /* Check whether ends is after starts */ DBUG_PRINT("info", ("ENDS after STARTS?")); - if (!starts_null && my_time_compare(&starts, <ime) != -1) + if (!starts_null && starts >= ltime_utc) goto error_bad_params; - /* - The parser forces starts to be provided but one day STARTS could be - set before NOW() and in this case the following check should be done. - Check whether ENDS is not in the past. - */ - DBUG_PRINT("info", ("ENDS after NOW?")); - my_tz_UTC->gmt_sec_to_TIME(<ime_now, thd->query_start()); - if (my_time_compare(<ime_now, <ime) == 1) - goto error_bad_params; + check_if_in_the_past(thd, ltime_utc); - ends= ltime; ends_null= FALSE; + ends= ltime_utc; DBUG_RETURN(0); error_bad_params: @@ -656,6 +651,7 @@ Event_basic::Event_basic() init_alloc_root(&mem_root, 256, 512); dbname.str= name.str= NULL; dbname.length= name.length= 0; + time_zone= NULL; DBUG_VOID_RETURN; } @@ -716,6 +712,16 @@ Event_basic::load_string_fields(Field **fields, ...) } +bool +Event_basic::load_time_zone(THD *thd, const LEX_STRING tz_name) +{ + String str(tz_name.str, &my_charset_latin1); + time_zone= my_tz_find(thd, &str); + + return (time_zone == NULL); +} + + /* Constructor @@ -730,10 +736,7 @@ Event_queue_element::Event_queue_element(): { DBUG_ENTER("Event_queue_element::Event_queue_element"); - set_zero_time(&starts, MYSQL_TIMESTAMP_DATETIME); - set_zero_time(&ends, MYSQL_TIMESTAMP_DATETIME); - set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME); - set_zero_time(&last_executed, MYSQL_TIMESTAMP_DATETIME); + starts= ends= execute_at= last_executed= 0; starts_null= ends_null= execute_at_null= TRUE; DBUG_VOID_RETURN; @@ -833,7 +836,7 @@ Event_timed::init() Loads an event's body from a row from mysql.event SYNOPSIS - Event_job_data::load_from_row(MEM_ROOT *mem_root, TABLE *table) + Event_job_data::load_from_row(THD *thd, TABLE *table) RETURN VALUE 0 OK @@ -846,7 +849,7 @@ Event_timed::init() */ int -Event_job_data::load_from_row(TABLE *table) +Event_job_data::load_from_row(THD *thd, TABLE *table) { char *ptr; uint len; @@ -858,9 +861,12 @@ Event_job_data::load_from_row(TABLE *table) if (table->s->fields != ET_FIELD_COUNT) goto error; + LEX_STRING tz_name; load_string_fields(table->field, ET_FIELD_DB, &dbname, ET_FIELD_NAME, &name, ET_FIELD_BODY, &body, ET_FIELD_DEFINER, &definer, - ET_FIELD_COUNT); + ET_FIELD_TIME_ZONE, &tz_name, ET_FIELD_COUNT); + if (load_time_zone(thd, tz_name)) + goto error; ptr= strchr(definer.str, '@'); @@ -887,7 +893,7 @@ error: Loads an event from a row from mysql.event SYNOPSIS - Event_queue_element::load_from_row(MEM_ROOT *mem_root, TABLE *table) + Event_queue_element::load_from_row(THD *thd, TABLE *table) RETURN VALUE 0 OK @@ -900,10 +906,10 @@ error: */ int -Event_queue_element::load_from_row(TABLE *table) +Event_queue_element::load_from_row(THD *thd, TABLE *table) { char *ptr; - bool res1, res2; + TIME time; DBUG_ENTER("Event_queue_element::load_from_row"); @@ -913,29 +919,44 @@ Event_queue_element::load_from_row(TABLE *table) if (table->s->fields != ET_FIELD_COUNT) goto error; + LEX_STRING tz_name; load_string_fields(table->field, ET_FIELD_DB, &dbname, ET_FIELD_NAME, &name, - ET_FIELD_DEFINER, &definer, ET_FIELD_COUNT); + ET_FIELD_DEFINER, &definer, + ET_FIELD_TIME_ZONE, &tz_name, ET_FIELD_COUNT); + if (load_time_zone(thd, tz_name)) + goto error; starts_null= table->field[ET_FIELD_STARTS]->is_null(); - res1= table->field[ET_FIELD_STARTS]->get_date(&starts, TIME_NO_ZERO_DATE); + if (!starts_null) + { + table->field[ET_FIELD_STARTS]->get_date(&time, TIME_NO_ZERO_DATE); + starts= sec_since_epoch_TIME(&time); + } ends_null= table->field[ET_FIELD_ENDS]->is_null(); - res2= table->field[ET_FIELD_ENDS]->get_date(&ends, TIME_NO_ZERO_DATE); + if (!ends_null) + { + table->field[ET_FIELD_ENDS]->get_date(&time, TIME_NO_ZERO_DATE); + ends= sec_since_epoch_TIME(&time); + } if (!table->field[ET_FIELD_INTERVAL_EXPR]->is_null()) expression= table->field[ET_FIELD_INTERVAL_EXPR]->val_int(); else expression= 0; /* - If res1 and res2 are TRUE then both fields are empty. + If neigher STARTS and ENDS is set, then both fields are empty. Hence, if ET_FIELD_EXECUTE_AT is empty there is an error. */ execute_at_null= table->field[ET_FIELD_EXECUTE_AT]->is_null(); DBUG_ASSERT(!(starts_null && ends_null && !expression && execute_at_null)); - if (!expression && - table->field[ET_FIELD_EXECUTE_AT]->get_date(&execute_at, - TIME_NO_ZERO_DATE)) - goto error; + if (!expression && !execute_at_null) + { + if (table->field[ET_FIELD_EXECUTE_AT]->get_date(&time, + TIME_NO_ZERO_DATE)) + goto error; + execute_at= sec_since_epoch_TIME(&time); + } /* We load the interval type from disk as string and then map it to @@ -962,11 +983,14 @@ Event_queue_element::load_from_row(TABLE *table) interval= (interval_type) i; } - table->field[ET_FIELD_LAST_EXECUTED]->get_date(&last_executed, - TIME_NO_ZERO_DATE); + if (!table->field[ET_FIELD_LAST_EXECUTED]->is_null()) + { + table->field[ET_FIELD_LAST_EXECUTED]->get_date(&time, + TIME_NO_ZERO_DATE); + last_executed= sec_since_epoch_TIME(&time); + } last_executed_changed= FALSE; - if ((ptr= get_field(&mem_root, table->field[ET_FIELD_STATUS])) == NullS) goto error; @@ -992,7 +1016,7 @@ error: Loads an event from a row from mysql.event SYNOPSIS - Event_timed::load_from_row(MEM_ROOT *mem_root, TABLE *table) + Event_timed::load_from_row(THD *thd, TABLE *table) RETURN VALUE 0 OK @@ -1005,14 +1029,14 @@ error: */ int -Event_timed::load_from_row(TABLE *table) +Event_timed::load_from_row(THD *thd, TABLE *table) { char *ptr; uint len; DBUG_ENTER("Event_timed::load_from_row"); - if (Event_queue_element::load_from_row(table)) + if (Event_queue_element::load_from_row(thd, table)) goto error; load_string_fields(table->field, ET_FIELD_BODY, &body, ET_FIELD_COUNT); @@ -1048,11 +1072,30 @@ error: /* - Computes the sum of a timestamp plus interval. Presumed is that at least one - previous execution has occured. + add_interval() adds a specified interval to time 'ltime' in time + zone 'time_zone', and returns the result converted to the number of + seconds since epoch (aka Unix time; in UTC time zone). Zero result + means an error. +*/ +static +my_time_t +add_interval(TIME *ltime, const Time_zone *time_zone, + interval_type scale, INTERVAL interval) +{ + if (date_add_interval(ltime, scale, interval)) + return 0; + + my_bool not_used; + return time_zone->TIME_to_gmt_sec(ltime, ¬_used); +} + + +/* + Computes the sum of a timestamp plus interval. SYNOPSIS - get_next_time(TIME *start, int interval_value, interval_type interval) + get_next_time() + time_zone event time zone next the sum start add interval_value to this time time_now current time @@ -1069,26 +1112,19 @@ error: seconds as resolution for computation. 2) In all other cases - MONTH, QUARTER, YEAR we use MONTH as resolution and PERIOD_DIFF()'s implementation - 3) We get the difference between time_now and `start`, then divide it - by the months, respectively seconds and round up. Then we multiply - monts/seconds by the rounded value and add it to `start` -> we get - the next execution time. */ static -bool get_next_time(TIME *next, TIME *start, TIME *time_now, TIME *last_exec, +bool get_next_time(const Time_zone *time_zone, my_time_t *next, + my_time_t start, my_time_t time_now, int i_value, interval_type i_type) { - bool ret; - INTERVAL interval; - TIME tmp; - longlong months=0, seconds=0; DBUG_ENTER("get_next_time"); - DBUG_PRINT("enter", ("start: %lu now: %lu", - (long) TIME_to_ulonglong_datetime(start), - (long) TIME_to_ulonglong_datetime(time_now))); + DBUG_PRINT("enter", ("start: %lu now: %lu", (long) start, (long) time_now)); - bzero(&interval, sizeof(interval)); + DBUG_ASSERT(start <= time_now); + + longlong months=0, seconds=0; switch (i_type) { case INTERVAL_YEAR: @@ -1135,84 +1171,151 @@ bool get_next_time(TIME *next, TIME *start, TIME *time_now, TIME *last_exec, DBUG_ASSERT(0); } DBUG_PRINT("info", ("seconds: %ld months: %ld", (long) seconds, (long) months)); + + TIME local_start; + TIME local_now; + + /* Convert times from UTC to local. */ + { + time_zone->gmt_sec_to_TIME(&local_start, start); + time_zone->gmt_sec_to_TIME(&local_now, time_now); + } + + INTERVAL interval; + bzero(&interval, sizeof(interval)); + my_time_t next_time= 0; + if (seconds) { longlong seconds_diff; long microsec_diff; - - if (calc_time_diff(time_now, start, 1, &seconds_diff, µsec_diff)) + bool negative= calc_time_diff(&local_now, &local_start, 1, + &seconds_diff, µsec_diff); + if (!negative) { - DBUG_PRINT("error", ("negative difference")); - DBUG_ASSERT(0); + /* + The formula below returns the interval that, when added to + local_start, will always give the time in the future. + */ + interval.second= seconds_diff - seconds_diff % seconds + seconds; + next_time= add_interval(&local_start, time_zone, + INTERVAL_SECOND, interval); + if (next_time == 0) + goto done; + } + + if (next_time <= time_now) + { + /* + If 'negative' is true above, then 'next_time == 0', and + 'next_time <= time_now' is also true. If negative is false, + then next_time was set, but perhaps to the value that is less + then time_now. See below for elaboration. + */ + DBUG_ASSERT(negative || next_time > 0); + + /* + If local_now < local_start, i.e. STARTS time is in the future + according to the local time (it always in the past according + to UTC---this is a prerequisite of this function), then + STARTS is almost always in the past according to the local + time too. However, in the time zone that has backward + Daylight Saving Time shift, the following may happen: suppose + we have a backward DST shift at certain date after 2:59:59, + i.e. local time goes 1:59:59, 2:00:00, ... , 2:59:59, (shift + here) 2:00:00 (again), ... , 2:59:59 (again), 3:00:00, ... . + Now suppose the time has passed the first 2:59:59, has been + shifted backward, and now is (the second) 2:20:00. The user + does CREATE EVENT with STARTS 'current-date 2:40:00'. Local + time 2:40:00 from create statement is treated by time + functions as the first such time, so according to UTC it comes + before the second 2:20:00. But according to local time it is + obviously in the future, so we end up in this branch. + + Since we are in the second pass through 2:00:00--2:59:59, and + any local time form this interval is treated by system + functions as the time from the first pass, we have to find the + time for the next execution that is past the DST-affected + interval (past the second 2:59:59 for our example, + i.e. starting from 3:00:00). We do this in the loop until the + local time is mapped onto future UTC time. 'start' time is in + the past, so we may use 'do { } while' here, and add the first + interval right away. + + Alternatively, it could be that local_now >= local_start. Now + for the example above imagine we do CREATE EVENT with STARTS + 'current-date 2:10:00'. Local start 2:10 is in the past (now + is local 2:20), so we add an interval, and get next execution + time, say, 2:40. It is in the future according to local time, + but, again, since we are in the second pass through + 2:00:00--2:59:59, 2:40 will be converted into UTC time in the + past. So we will end up in this branch again, and may add + intervals in a 'do { } while' loop. + + Note that for any given event we may end up here only if event + next execution time will map to the time interval that is + passed twice, and only if the server was started during the + second pass, or the event is being created during the second + pass. After that, we never will get here (unless we again + start the server during the second pass). In other words, + such a condition is extremely rare. + */ + interval.second= seconds; + do + { + next_time= add_interval(&local_start, time_zone, + INTERVAL_SECOND, interval); + if (next_time == 0) + goto done; + } + while (next_time <= time_now); } - uint multiplier= (uint) (seconds_diff / seconds); - /* - Increase the multiplier is the modulus is not zero to make round up. - Or if time_now==start then we should not execute the same - event two times for the same time - get the next exec if the modulus is not - */ - DBUG_PRINT("info", ("multiplier: %d", multiplier)); - if (seconds_diff % seconds || (!seconds_diff && last_exec->year) || - TIME_to_ulonglong_datetime(time_now) == - TIME_to_ulonglong_datetime(last_exec)) - ++multiplier; - interval.second= seconds * multiplier; - DBUG_PRINT("info", ("multiplier: %lu interval.second: %lu", (ulong) multiplier, - (ulong) interval.second)); - tmp= *start; - if (!(ret= date_add_interval(&tmp, INTERVAL_SECOND, interval))) - *next= tmp; } else { - /* PRESUMED is that at least one execution took already place */ - int diff_months= (time_now->year - start->year)*12 + - (time_now->month - start->month); + long diff_months= (long) (local_now.year - local_start.year)*12 + + (local_now.month - local_start.month); /* - Note: If diff_months is 0 that means we are in the same month as the - last execution which is also the first execution. - */ - /* - First we try with the smaller if not then + 1, because if we try with - directly with +1 we will be after the current date but it could be that - we will be 1 month ahead, so 2 steps are necessary. - */ - interval.month= (ulong) ((diff_months / months)*months); - /* - Check if the same month as last_exec (always set - prerequisite) - An event happens at most once per month so there is no way to - schedule it two times for the current month. This saves us from two - calls to date_add_interval() if the event was just executed. But if - the scheduler is started and there was at least 1 scheduled date - skipped this one does not help and two calls to date_add_interval() - will be done, which is a bit more expensive but compared to the - rareness of the case is neglectable. - */ - if (time_now->year == last_exec->year && - time_now->month == last_exec->month) - interval.month+= (ulong) months; + Unlike for seconds above, the formula below returns the interval + that, when added to the local_start, will give the time in the + past, or somewhere in the current month. We are interested in + the latter case, to see if this time has already passed, or is + yet to come this month. - tmp= *start; - if ((ret= date_add_interval(&tmp, INTERVAL_MONTH, interval))) + Note that the time is guaranteed to be in the past unless + (diff_months % months == 0), but no good optimization is + possible here, because (diff_months % months == 0) is what will + happen most of the time, as get_next_time() will be called right + after the execution of the event. We could pass last_executed + time to this function, and see if the execution has already + happened this month, but for that we will have to convert + last_executed from seconds since epoch to local broken-down + time, and this will greatly reduce the effect of the + optimization. So instead we keep the code simple and clean. + */ + interval.month= diff_months - diff_months % months; + next_time= add_interval(&local_start, time_zone, + INTERVAL_MONTH, interval); + if (next_time == 0) goto done; - /* If `tmp` is still before time_now just add one more time the interval */ - if (my_time_compare(&tmp, time_now) == -1) - { - interval.month+= (ulong) months; - tmp= *start; - if ((ret= date_add_interval(&tmp, INTERVAL_MONTH, interval))) + if (next_time <= time_now) + { + interval.month= months; + next_time= add_interval(&local_start, time_zone, + INTERVAL_MONTH, interval); + if (next_time == 0) goto done; } - *next= tmp; - /* assert on that the next is after now */ - DBUG_ASSERT(1==my_time_compare(next, time_now)); } + DBUG_ASSERT(time_now < next_time); + + *next= next_time; + done: - DBUG_PRINT("info", ("next: %lu", (long) TIME_to_ulonglong_datetime(next))); - DBUG_RETURN(ret); + DBUG_PRINT("info", ("next_time: %ld", (long) next_time)); + DBUG_RETURN(next_time == 0); } @@ -1227,20 +1330,17 @@ done: TRUE Error NOTES - The time is set in execute_at, if no more executions the latter is set to - 0000-00-00. + The time is set in execute_at, if no more executions the latter is + set to 0. */ bool Event_queue_element::compute_next_execution_time() { - TIME time_now; - int tmp; + my_time_t time_now; DBUG_ENTER("Event_queue_element::compute_next_execution_time"); DBUG_PRINT("enter", ("starts: %lu ends: %lu last_executed: %lu this: 0x%lx", - (long) TIME_to_ulonglong_datetime(&starts), - (long) TIME_to_ulonglong_datetime(&ends), - (long) TIME_to_ulonglong_datetime(&last_executed), + (long) starts, (long) ends, (long) last_executed, (long) this)); if (status == Event_queue_element::DISABLED) @@ -1253,7 +1353,7 @@ Event_queue_element::compute_next_execution_time() if (!expression) { /* Let's check whether it was executed */ - if (last_executed.year) + if (last_executed) { DBUG_PRINT("info",("One-time event %s.%s of was already executed", dbname.str, name.str)); @@ -1266,17 +1366,16 @@ Event_queue_element::compute_next_execution_time() goto ret; } - my_tz_UTC->gmt_sec_to_TIME(&time_now, current_thd->query_start()); + time_now= current_thd->query_start(); - DBUG_PRINT("info",("NOW: [%lu]", - (ulong) TIME_to_ulonglong_datetime(&time_now))); + DBUG_PRINT("info",("NOW: [%lu]", (ulong) time_now)); /* if time_now is after ends don't execute anymore */ - if (!ends_null && (tmp= my_time_compare(&ends, &time_now)) == -1) + if (!ends_null && ends < time_now) { DBUG_PRINT("info", ("NOW after ENDS, don't execute anymore")); /* time_now is after ends. don't execute anymore */ - set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME); + execute_at= 0; execute_at_null= TRUE; if (on_completion == Event_queue_element::ON_COMPLETION_DROP) dropped= TRUE; @@ -1293,12 +1392,11 @@ Event_queue_element::compute_next_execution_time() Let's check whether time_now is before starts. If so schedule for starts. */ - if (!starts_null && (tmp= my_time_compare(&time_now, &starts)) < 1) + if (!starts_null && time_now <= starts) { - if (tmp == 0 && my_time_compare(&starts, &last_executed) == 0) + if (time_now == starts && starts == last_executed) { /* - time_now = starts = last_executed do nothing or we will schedule for second time execution at starts. */ } @@ -1324,26 +1422,25 @@ Event_queue_element::compute_next_execution_time() If not set then schedule for now. */ DBUG_PRINT("info", ("Both STARTS & ENDS are set")); - if (!last_executed.year) + if (!last_executed) { DBUG_PRINT("info", ("Not executed so far.")); } { - TIME next_exec; + my_time_t next_exec; - if (get_next_time(&next_exec, &starts, &time_now, - last_executed.year? &last_executed:&starts, + if (get_next_time(time_zone, &next_exec, starts, time_now, (int) expression, interval)) goto err; /* There was previous execution */ - if (my_time_compare(&ends, &next_exec) == -1) + if (ends < next_exec) { DBUG_PRINT("info", ("Next execution of %s after ENDS. Stop executing.", name.str)); /* Next execution after ends. No more executions */ - set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME); + execute_at= 0; execute_at_null= TRUE; if (on_completion == Event_queue_element::ON_COMPLETION_DROP) dropped= TRUE; @@ -1352,8 +1449,7 @@ Event_queue_element::compute_next_execution_time() } else { - DBUG_PRINT("info",("Next[%lu]", - (ulong) TIME_to_ulonglong_datetime(&next_exec))); + DBUG_PRINT("info",("Next[%lu]", (ulong) next_exec)); execute_at= next_exec; execute_at_null= FALSE; } @@ -1368,15 +1464,14 @@ Event_queue_element::compute_next_execution_time() Both starts and m_ends are not set, so we schedule for the next based on last_executed. */ - if (last_executed.year) + if (last_executed) { - TIME next_exec; - if (get_next_time(&next_exec, &starts, &time_now, &last_executed, + my_time_t next_exec; + if (get_next_time(time_zone, &next_exec, starts, time_now, (int) expression, interval)) goto err; execute_at= next_exec; - DBUG_PRINT("info",("Next[%lu]", - (ulong) TIME_to_ulonglong_datetime(&next_exec))); + DBUG_PRINT("info",("Next[%lu]", (ulong) next_exec)); } else { @@ -1398,20 +1493,18 @@ Event_queue_element::compute_next_execution_time() Hence schedule for starts + m_expression in case last_executed is not set, otherwise to last_executed + m_expression */ - if (!last_executed.year) + if (!last_executed) { DBUG_PRINT("info", ("Not executed so far.")); } { - TIME next_exec; - if (get_next_time(&next_exec, &starts, &time_now, - last_executed.year? &last_executed:&starts, + my_time_t next_exec; + if (get_next_time(time_zone, &next_exec, starts, time_now, (int) expression, interval)) goto err; execute_at= next_exec; - DBUG_PRINT("info",("Next[%lu]", - (ulong) TIME_to_ulonglong_datetime(&next_exec))); + DBUG_PRINT("info",("Next[%lu]", (ulong) next_exec)); } execute_at_null= FALSE; } @@ -1426,20 +1519,20 @@ Event_queue_element::compute_next_execution_time() If last_executed is not set then schedule for now */ - if (!last_executed.year) + if (!last_executed) execute_at= time_now; else { - TIME next_exec; + my_time_t next_exec; - if (get_next_time(&next_exec, &starts, &time_now, &last_executed, + if (get_next_time(time_zone, &next_exec, starts, time_now, (int) expression, interval)) goto err; - if (my_time_compare(&ends, &next_exec) == -1) + if (ends < next_exec) { DBUG_PRINT("info", ("Next execution after ENDS. Stop executing.")); - set_zero_time(&execute_at, MYSQL_TIMESTAMP_DATETIME); + execute_at= 0; execute_at_null= TRUE; status= Event_queue_element::DISABLED; status_changed= TRUE; @@ -1448,8 +1541,7 @@ Event_queue_element::compute_next_execution_time() } else { - DBUG_PRINT("info", ("Next[%lu]", - (ulong) TIME_to_ulonglong_datetime(&next_exec))); + DBUG_PRINT("info", ("Next[%lu]", (ulong) next_exec)); execute_at= next_exec; execute_at_null= FALSE; } @@ -1458,8 +1550,7 @@ Event_queue_element::compute_next_execution_time() goto ret; } ret: - DBUG_PRINT("info", ("ret: 0 execute_at: %lu", - (long) TIME_to_ulonglong_datetime(&execute_at))); + DBUG_PRINT("info", ("ret: 0 execute_at: %lu", (long) execute_at)); DBUG_RETURN(FALSE); err: DBUG_PRINT("info", ("ret=1")); @@ -1479,12 +1570,9 @@ err: void Event_queue_element::mark_last_executed(THD *thd) { - TIME time_now; - thd->end_time(); - my_tz_UTC->gmt_sec_to_TIME(&time_now, (my_time_t) thd->query_start()); - last_executed= time_now; /* was execute_at */ + last_executed= thd->query_start(); last_executed_changed= TRUE; execution_count++; @@ -1538,8 +1626,11 @@ Event_queue_element::update_timing_fields(THD *thd) if (last_executed_changed) { + TIME time; + my_tz_UTC->gmt_sec_to_TIME(&time, last_executed); + fields[ET_FIELD_LAST_EXECUTED]->set_notnull(); - fields[ET_FIELD_LAST_EXECUTED]->store_time(&last_executed, + fields[ET_FIELD_LAST_EXECUTED]->store_time(&time, MYSQL_TIMESTAMP_DATETIME); last_executed_changed= FALSE; } @@ -1561,6 +1652,26 @@ done: } +static +void +append_datetime(String *buf, Time_zone *time_zone, my_time_t secs, + const char *name, uint len) +{ + char dtime_buff[20*2+32];/* +32 to make my_snprintf_{8bit|ucs2} happy */ + buf->append(STRING_WITH_LEN(" ")); + buf->append(name, len); + buf->append(STRING_WITH_LEN(" '")); + /* + Pass the buffer and the second param tells fills the buffer and + returns the number of chars to copy. + */ + TIME time; + time_zone->gmt_sec_to_TIME(&time, secs); + buf->append(dtime_buff, my_datetime_to_str(&time, dtime_buff)); + buf->append(STRING_WITH_LEN("'")); +} + + /* Get SHOW CREATE EVENT as string @@ -1600,17 +1711,17 @@ Event_timed::get_create_event(THD *thd, String *buf) buf->append(' '); LEX_STRING *ival= &interval_type_to_name[interval]; buf->append(ival->str, ival->length); + + if (!starts_null) + append_datetime(buf, time_zone, starts, STRING_WITH_LEN("STARTS")); + + if (!ends_null) + append_datetime(buf, time_zone, ends, STRING_WITH_LEN("ENDS")); } else { - char dtime_buff[20*2+32];/* +32 to make my_snprintf_{8bit|ucs2} happy */ - buf->append(STRING_WITH_LEN(" ON SCHEDULE AT '")); - /* - Pass the buffer and the second param tells fills the buffer and - returns the number of chars to copy. - */ - buf->append(dtime_buff, my_datetime_to_str(&execute_at, dtime_buff)); - buf->append(STRING_WITH_LEN("'")); + append_datetime(buf, time_zone, execute_at, + STRING_WITH_LEN("ON SCHEDULE AT")); } if (on_completion == Event_timed::ON_COMPLETION_DROP) @@ -1654,6 +1765,7 @@ int Event_job_data::get_fake_create_event(THD *thd, String *buf) { DBUG_ENTER("Event_job_data::get_create_event"); + /* FIXME: "EVERY 3337 HOUR" is asking for trouble. */ buf->append(STRING_WITH_LEN("CREATE EVENT anonymous ON SCHEDULE " "EVERY 3337 HOUR DO ")); buf->append(body.str, body.length); @@ -1705,6 +1817,9 @@ Event_job_data::execute(THD *thd) sphead->m_flags|= sp_head::LOG_SLOW_STATEMENTS; sphead->m_flags|= sp_head::LOG_GENERAL_LOG; + /* Execute the event in its time zone. */ + thd->variables.time_zone= time_zone; + ret= sphead->execute_procedure(thd, &empty_item_list); } else diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index 4346b0eb5b8..8e013e40400 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -58,15 +58,20 @@ public: LEX_STRING name; LEX_STRING definer;// combination of user and host + Time_zone *time_zone; + Event_basic(); virtual ~Event_basic(); virtual int - load_from_row(TABLE *table) = 0; + load_from_row(THD *thd, TABLE *table) = 0; protected: bool load_string_fields(Field **fields, ...); + + bool + load_time_zone(THD *thd, const LEX_STRING tz_name); }; @@ -92,11 +97,11 @@ public: enum enum_on_completion on_completion; enum enum_status status; - TIME last_executed; - TIME execute_at; - TIME starts; - TIME ends; + my_time_t last_executed; + my_time_t execute_at; + my_time_t starts; + my_time_t ends; my_bool starts_null; my_bool ends_null; my_bool execute_at_null; @@ -112,7 +117,7 @@ public: virtual ~Event_queue_element(); virtual int - load_from_row(TABLE *table); + load_from_row(THD *thd, TABLE *table); bool compute_next_execution_time(); @@ -168,7 +173,7 @@ public: init(); virtual int - load_from_row(TABLE *table); + load_from_row(THD *thd, TABLE *table); int get_create_event(THD *thd, String *buf); @@ -192,7 +197,7 @@ public: virtual ~Event_job_data(); virtual int - load_from_row(TABLE *table); + load_from_row(THD *thd, TABLE *table); int execute(THD *thd); @@ -224,6 +229,11 @@ public: }; enum enum_on_completion on_completion; enum enum_status status; + /* + do_not_create will be set if STARTS time is in the past and + on_completion == ON_COMPLETION_DROP. + */ + bool do_not_create; const uchar *body_begin; @@ -237,9 +247,9 @@ public: Item* item_ends; Item* item_execute_at; - TIME starts; - TIME ends; - TIME execute_at; + my_time_t starts; + my_time_t ends; + my_time_t execute_at; my_bool starts_null; my_bool ends_null; my_bool execute_at_null; @@ -284,6 +294,9 @@ private: void report_bad_value(const char *item_name, Item *bad_item); + void + check_if_in_the_past(THD *thd, my_time_t ltime_utc); + Event_parse_data(const Event_parse_data &); /* Prevent use of these */ void operator=(Event_parse_data &); }; diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 940930ec4c6..6be7411af7b 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -118,6 +118,11 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] = { C_STRING_WITH_LEN("comment") }, { C_STRING_WITH_LEN("char(64)") }, { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("time_zone") }, + { C_STRING_WITH_LEN("char(64)") }, + { C_STRING_WITH_LEN("latin1") } } }; @@ -183,6 +188,14 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, if (et->expression) { + const String *tz_name= thd->variables.time_zone->get_name(); + if (!is_update || !et->starts_null) + { + fields[ET_FIELD_TIME_ZONE]->set_notnull(); + fields[ET_FIELD_TIME_ZONE]->store(tz_name->ptr(), tz_name->length(), + tz_name->charset()); + } + fields[ET_FIELD_INTERVAL_EXPR]->set_notnull(); fields[ET_FIELD_INTERVAL_EXPR]->store((longlong)et->expression, TRUE); @@ -197,26 +210,40 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, if (!et->starts_null) { + TIME time; + my_tz_UTC->gmt_sec_to_TIME(&time, et->starts); + fields[ET_FIELD_STARTS]->set_notnull(); - fields[ET_FIELD_STARTS]->store_time(&et->starts, MYSQL_TIMESTAMP_DATETIME); + fields[ET_FIELD_STARTS]->store_time(&time, MYSQL_TIMESTAMP_DATETIME); } if (!et->ends_null) { + TIME time; + my_tz_UTC->gmt_sec_to_TIME(&time, et->ends); + fields[ET_FIELD_ENDS]->set_notnull(); - fields[ET_FIELD_ENDS]->store_time(&et->ends, MYSQL_TIMESTAMP_DATETIME); + fields[ET_FIELD_ENDS]->store_time(&time, MYSQL_TIMESTAMP_DATETIME); } } - else if (et->execute_at.year) + else if (et->execute_at) { + const String *tz_name= thd->variables.time_zone->get_name(); + fields[ET_FIELD_TIME_ZONE]->set_notnull(); + fields[ET_FIELD_TIME_ZONE]->store(tz_name->ptr(), tz_name->length(), + tz_name->charset()); + fields[ET_FIELD_INTERVAL_EXPR]->set_null(); fields[ET_FIELD_TRANSIENT_INTERVAL]->set_null(); fields[ET_FIELD_STARTS]->set_null(); fields[ET_FIELD_ENDS]->set_null(); + TIME time; + my_tz_UTC->gmt_sec_to_TIME(&time, et->execute_at); + fields[ET_FIELD_EXECUTE_AT]->set_notnull(); fields[ET_FIELD_EXECUTE_AT]-> - store_time(&et->execute_at, MYSQL_TIMESTAMP_DATETIME); + store_time(&time, MYSQL_TIMESTAMP_DATETIME); } else { @@ -527,6 +554,8 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, if (check_parse_params(thd, parse_data)) goto err; + if (parse_data->do_not_create) + goto ok; DBUG_PRINT("info", ("open mysql.event for update")); if (open_event_table(thd, TL_WRITE, &table)) @@ -587,7 +616,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, goto err; } - if (!(parse_data->expression) && !(parse_data->execute_at.year)) + if (!(parse_data->expression) && !(parse_data->execute_at)) { DBUG_PRINT("error", ("neither expression nor execute_at are set!")); my_error(ER_EVENT_NEITHER_M_EXPR_NOR_M_AT, MYF(0)); @@ -664,7 +693,7 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data, goto err; } - if (check_parse_params(thd, parse_data)) + if (check_parse_params(thd, parse_data) || parse_data->do_not_create) goto err; DBUG_PRINT("info", ("dbname: %s", parse_data->dbname.str)); @@ -964,7 +993,7 @@ Event_db_repository::load_named_event(THD *thd, LEX_STRING dbname, my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0)); else if ((ret= find_named_event(thd, dbname, name, table))) my_error(ER_EVENT_DOES_NOT_EXIST, MYF(0), name.str); - else if ((ret= etn->load_from_row(table))) + else if ((ret= etn->load_from_row(thd, table))) my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0), "event"); if (table) diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h index 1457fb64e2e..4991e2d0aa2 100644 --- a/sql/event_db_repository.h +++ b/sql/event_db_repository.h @@ -35,6 +35,7 @@ enum enum_events_table_field ET_FIELD_ON_COMPLETION, ET_FIELD_SQL_MODE, ET_FIELD_COMMENT, + ET_FIELD_TIME_ZONE, ET_FIELD_COUNT /* a cool trick to count the number of fields :) */ }; diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 296c30506f6..bcfe0a222f1 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -65,8 +65,13 @@ struct event_queue_param static int event_queue_element_compare_q(void *vptr, byte* a, byte *b) { - return my_time_compare(&((Event_queue_element *)a)->execute_at, - &((Event_queue_element *)b)->execute_at); + /* + Note that no overflow is possible here because both values are + non-negative, and subtraction is done in the signed my_time_t + type. + */ + return (((Event_queue_element *)a)->execute_at + - ((Event_queue_element *)b)->execute_at); } @@ -84,7 +89,7 @@ Event_queue::Event_queue() { mutex_last_unlocked_in_func= mutex_last_locked_in_func= mutex_last_attempted_lock_in_func= ""; - set_zero_time(&next_activation_at, MYSQL_TIMESTAMP_DATETIME); + next_activation_at= 0; } @@ -504,15 +509,11 @@ Event_queue::dbug_dump_queue(time_t now) DBUG_PRINT("info", ("exec_at: %lu starts: %lu ends: %lu execs_so_far: %u " "expr: %ld et.exec_at: %ld now: %ld " "(et.exec_at - now): %d if: %d", - (long) TIME_to_ulonglong_datetime(&et->execute_at), - (long) TIME_to_ulonglong_datetime(&et->starts), - (long) TIME_to_ulonglong_datetime(&et->ends), - et->execution_count, - (long) et->expression, - (long) (sec_since_epoch_TIME(&et->execute_at)), - (long) now, - (int) (sec_since_epoch_TIME(&et->execute_at) - now), - sec_since_epoch_TIME(&et->execute_at) <= now)); + (long) et->execute_at, (long) et->starts, + (long) et->ends, et->execution_count, + (long) et->expression, (long) et->execute_at, + (long) now, (int) (et->execute_at - now), + et->execute_at <= now)); } DBUG_VOID_RETURN; #endif @@ -541,7 +542,6 @@ Event_queue::get_top_for_execution_if_time(THD *thd, Event_queue_element_for_exec **event_name) { bool ret= FALSE; - struct timespec top_time; *event_name= NULL; DBUG_ENTER("Event_queue::get_top_for_execution_if_time"); @@ -560,7 +560,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd, if (!queue.elements) { /* There are no events in the queue */ - set_zero_time(&next_activation_at, MYSQL_TIMESTAMP_DATETIME); + next_activation_at= 0; /* Wait on condition until signaled. Release LOCK_queue while waiting. */ cond_wait(thd, NULL, queue_empty_msg, SCHED_FUNC, __LINE__); @@ -572,16 +572,16 @@ Event_queue::get_top_for_execution_if_time(THD *thd, thd->end_time(); /* Get current time */ - time_t seconds_to_next_event= - sec_since_epoch_TIME(&top->execute_at) - thd->query_start(); next_activation_at= top->execute_at; - if (seconds_to_next_event > 0) + if (next_activation_at > thd->query_start()) { /* Not yet time for top event, wait on condition with time or until signaled. Release LOCK_queue while waiting. */ - set_timespec(top_time, seconds_to_next_event); + struct timespec top_time; + top_time.tv_sec= next_activation_at; + top_time.tv_nsec= 0; cond_wait(thd, &top_time, queue_wait_msg, SCHED_FUNC, __LINE__); continue; @@ -759,10 +759,11 @@ Event_queue::dump_internal_status() printf("Last lock attempt at: %s:%u\n", mutex_last_attempted_lock_in_func, mutex_last_attempted_lock_at_line); printf("WOC : %s\n", waiting_on_cond? "YES":"NO"); + + TIME time; + my_tz_UTC->gmt_sec_to_TIME(&time, next_activation_at); printf("Next activation : %04d-%02d-%02d %02d:%02d:%02d\n", - next_activation_at.year, next_activation_at.month, - next_activation_at.day, next_activation_at.hour, - next_activation_at.minute, next_activation_at.second); + time.year, time.month, time.day, time.hour, time.minute, time.second); DBUG_VOID_RETURN; } diff --git a/sql/event_queue.h b/sql/event_queue.h index a1237e1b52c..338a6c8f903 100644 --- a/sql/event_queue.h +++ b/sql/event_queue.h @@ -86,7 +86,7 @@ protected: /* The sorted queue with the Event_queue_element objects */ QUEUE queue; - TIME next_activation_at; + my_time_t next_activation_at; uint mutex_last_locked_at_line; uint mutex_last_unlocked_at_line; diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 64bba756be9..3c8ecf6ca3a 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -574,6 +574,14 @@ Event_scheduler::execute_top(THD *thd, Event_queue_element_for_exec *event_name) DBUG_PRINT("info", ("Event %s@%s ready for start", event_name->dbname.str, event_name->name.str)); + /* + TODO: should use thread pool here, preferably with an upper limit + on number of threads: if too many events are scheduled for the + same time, starting all of them at once won't help them run truly + in parallel (because of the great amount of synchronization), so + we may as well execute them in sequence, keeping concurrency at a + reasonable level. + */ /* Major failure */ if ((res= pthread_create(&th, &connection_attrib, event_worker_thread, event_name))) diff --git a/sql/events.cc b/sql/events.cc index f73dc97e7c2..88014ee34af 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -326,7 +326,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) pthread_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ - if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists))) + if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists)) && + !parse_data->do_not_create) { Event_queue_element *new_element; @@ -527,6 +528,10 @@ Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); + const String *tz_name= et->time_zone->get_name(); + field_list.push_back(new Item_empty_string("time_zone", + tz_name->length())); + field_list.push_back(new Item_empty_string("Create Event", show_str.length())); @@ -539,6 +544,8 @@ Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) protocol->store((char*) sql_mode_str, sql_mode_len, scs); + protocol->store((char*) tz_name->ptr(), tz_name->length(), scs); + protocol->store(show_str.c_ptr(), show_str.length(), scs); ret= protocol->write(); send_eof(thd); @@ -942,7 +949,7 @@ Events::load_events_from_db(THD *thd) } DBUG_PRINT("info", ("Loading event from row.")); - if ((ret= et->load_from_row(table))) + if ((ret= et->load_from_row(thd, table))) { sql_print_error("SCHEDULER: Error while loading from mysql.event. " "Table probably corrupted"); @@ -967,7 +974,7 @@ Events::load_events_from_db(THD *thd) Event_job_data temp_job_data; DBUG_PRINT("info", ("Event %s loaded from row. ", et->name.str)); - temp_job_data.load_from_row(table); + temp_job_data.load_from_row(thd, table); /* We load only on scheduler root just to check whether the body diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index c5bda4ac7a6..f7ffad697b0 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5873,8 +5873,7 @@ ER_EVENT_ENDS_BEFORE_STARTS eng "ENDS is either invalid or before STARTS" ger "ENDS ist entweder ungültig oder liegt vor STARTS" ER_EVENT_EXEC_TIME_IN_THE_PAST - eng "Activation (AT) time is in the past" - ger "Aktivierungszeit (AT) liegt in der Vergangenheit" + eng "Event execution time is in the past. Event has been disabled" ER_EVENT_OPEN_TABLE_FAILED eng "Failed to open mysql.event" ger "Öffnen von mysql.event fehlgeschlagen" @@ -6052,3 +6051,7 @@ ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009 ER_BINLOG_PURGE_EMFILE eng "Too many files opened, please execute the command again" ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus" +ER_EVENT_CANNOT_CREATE_IN_THE_PAST + eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created" +ER_EVENT_CANNOT_ALTER_IN_THE_PAST + eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered" diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bdfb7512979..0c56abbdfc8 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -38,6 +38,7 @@ enum enum_i_s_events_fields ISE_EVENT_SCHEMA, ISE_EVENT_NAME, ISE_DEFINER, + ISE_TIME_ZONE, ISE_EVENT_BODY, ISE_EVENT_DEFINITION, ISE_EVENT_TYPE, @@ -4310,7 +4311,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) restore_record(sch_table, s->default_values); - if (et.load_from_row(event_table)) + if (et.load_from_row(thd, event_table)) { my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0)); DBUG_RETURN(1); @@ -4337,6 +4338,9 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) store(et.name.str, et.name.length, scs); sch_table->field[ISE_DEFINER]-> store(et.definer.str, et.definer.length, scs); + const String *tz_name= et.time_zone->get_name(); + sch_table->field[ISE_TIME_ZONE]-> + store(tz_name->ptr(), tz_name->length(), scs); sch_table->field[ISE_EVENT_BODY]-> store(STRING_WITH_LEN("SQL"), scs); sch_table->field[ISE_EVENT_DEFINITION]-> @@ -4353,6 +4357,8 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) store((const char*)sql_mode_str, sql_mode_len, scs); } + int not_used=0; + if (et.expression) { String show_str; @@ -4372,15 +4378,17 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) sch_table->field[ISE_INTERVAL_FIELD]->store(ival->str, ival->length, scs); /* starts & ends . STARTS is always set - see sql_yacc.yy */ + et.time_zone->gmt_sec_to_TIME(&time, et.starts); sch_table->field[ISE_STARTS]->set_notnull(); sch_table->field[ISE_STARTS]-> - store_time(&et.starts, MYSQL_TIMESTAMP_DATETIME); + store_time(&time, MYSQL_TIMESTAMP_DATETIME); if (!et.ends_null) { + et.time_zone->gmt_sec_to_TIME(&time, et.ends); sch_table->field[ISE_ENDS]->set_notnull(); sch_table->field[ISE_ENDS]-> - store_time(&et.ends, MYSQL_TIMESTAMP_DATETIME); + store_time(&time, MYSQL_TIMESTAMP_DATETIME); } } else @@ -4388,9 +4396,10 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) /* type */ sch_table->field[ISE_EVENT_TYPE]->store(STRING_WITH_LEN("ONE TIME"), scs); + et.time_zone->gmt_sec_to_TIME(&time, et.execute_at); sch_table->field[ISE_EXECUTE_AT]->set_notnull(); sch_table->field[ISE_EXECUTE_AT]-> - store_time(&et.execute_at, MYSQL_TIMESTAMP_DATETIME); + store_time(&time, MYSQL_TIMESTAMP_DATETIME); } /* status */ @@ -4407,7 +4416,6 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) sch_table->field[ISE_ON_COMPLETION]-> store(STRING_WITH_LEN("PRESERVE"), scs); - int not_used=0; number_to_datetime(et.created, &time, 0, ¬_used); DBUG_ASSERT(not_used==0); sch_table->field[ISE_CREATED]->store_time(&time, MYSQL_TIMESTAMP_DATETIME); @@ -4417,11 +4425,12 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) sch_table->field[ISE_LAST_ALTERED]-> store_time(&time, MYSQL_TIMESTAMP_DATETIME); - if (et.last_executed.year) + if (et.last_executed) { + et.time_zone->gmt_sec_to_TIME(&time, et.last_executed); sch_table->field[ISE_LAST_EXECUTED]->set_notnull(); sch_table->field[ISE_LAST_EXECUTED]-> - store_time(&et.last_executed, MYSQL_TIMESTAMP_DATETIME); + store_time(&time, MYSQL_TIMESTAMP_DATETIME); } sch_table->field[ISE_EVENT_COMMENT]-> @@ -5427,6 +5436,7 @@ ST_FIELD_INFO events_fields_info[]= {"EVENT_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Db"}, {"EVENT_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer"}, + {"TIME_ZONE", 64, MYSQL_TYPE_STRING, 0, 0, "Time zone"}, {"EVENT_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0}, {"EVENT_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0}, {"EVENT_TYPE", 9, MYSQL_TYPE_STRING, 0, 0, "Type"}, From d9dcc57e5cb58886a0d3671016db64a955b9445f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 09:21:25 -0700 Subject: [PATCH 179/789] Modifications to Makefile.am to include new test options - for including qa developed suites - for options to run 'fast' tests Makefile.am: Modifications to include new test options - for including qa developed suites - for options to run 'fast' tests --- Makefile.am | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6d435bff85a..1aa6c48755f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -97,7 +97,10 @@ tags: .PHONY: init-db bin-dist \ test test-force test-full test-force-full test-force-mem \ test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \ - test-unit test-ps test-nr test-pr test-ns test-binlog-statement + test-unit test-ps test-nr test-pr test-ns test-binlog-statement \ + test-ext-funcs test-ext-rpl test-ext-partitions test-ext \ + test-fast test-fast-cursor test-fast-view test-fast-prepare \ + test-full-qa # Target 'test' will run the regression test suite using the built server. # @@ -120,11 +123,11 @@ test-nr: test-pr: cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=row + @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol --mysqld=--binlog-format=row test-ns: cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=mixed + @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed test-binlog-statement: cd mysql-test ; \ @@ -142,7 +145,7 @@ test-force-full: #used by autopush.pl to run memory based tests test-force-mem: - $(MAKE) 'force=--force --mem' test + $(MAKE) force=--force mem=--mem test # Keep these for a while test-pl: test @@ -151,5 +154,43 @@ test-force-pl: test-force test-force-pl-mem: test-force-mem test-force-full-pl: test-force-full +test-ext-funcs: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl --force --suite=funcs_1 ; \ + @PERL@ ./mysql-test-run.pl --force --suite=funcs_2 + +test-ext-rpl: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl --force --suite=rpl + +test-ext-partitions: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl --force --suite=partitions + +test-ext-jp: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl --force --suite=jp + +test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp + +test-fast: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \ + @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam + +test-fast-view: + $(MAKE) subset=--view-protocol test-fast + +test-fast-cursor: + $(MAKE) subset=--cursor-protocol test-fast + +test-fast-prepare: + $(MAKE) subset=--ps-protocol test-fast + +test-full-qa: + $(MAKE) force=--force test-pr \ + test-binlog-statement test-ext test-fast-view \ + test-fast-cursor test-unit + # Don't update the files from bitkeeper %::SCCS/s.% From 0eec6c133a164eb2b0c19f0241054edb4a52825f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 17:28:32 +0100 Subject: [PATCH 180/789] Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Build sql files for netware from the mysql_system_tables*.sq files - Fix comments about mysql_create_system_tables.sh - Use mysql_install_db.sh to create system tables for mysql_test-run-shell - Fix mysql-test-run.pl to also look in share/mysql for the msyql_system*.sql files BitKeeper/deleted/.del-init_db.sql~e2b8d0c8390e8023: Rename: netware/init_db.sql -> BitKeeper/deleted/.del-init_db.sql~e2b8d0c8390e8023 BitKeeper/deleted/.del-test_db.sql: Rename: netware/test_db.sql -> BitKeeper/deleted/.del-test_db.sql BitKeeper/etc/ignore: Added netware/init_db.sql netware/test_db.sql to the ignore list mysql-test/install_test_db.sh: Use mysql_install_db from install_test_db(which is used bu mysql-test-run-shell) to install the system tables mysql-test/mysql-test-run.pl: Look for the mysql_system_tables*.sql also in share/mysql netware/Makefile.am: Build netware/init_db.sql and netware/test_db.sql from the sources in scripts/msyql_system_tables*.sql scripts/make_binary_distribution.sh: netware/init_db.sql and netware/test_db.sql are now built by the Makefiles from the scripts/mysql_system_tables*.sql files sql/mysql_priv.h: Update comment remindging to update the MySQL system table definitions when adding a new SQL_MODE sql/sql_acl.h: Update comment reminding to update the MySQL System tables when changing the ACL defines --- .bzrignore | 2 ++ mysql-test/install_test_db.sh | 20 ++++++-------- mysql-test/mysql-test-run.pl | 14 ++++++++-- netware/Makefile.am | 28 ++++++++++++++++--- netware/init_db.sql | 38 ------------------------- netware/test_db.sql | 43 ----------------------------- scripts/make_binary_distribution.sh | 6 ---- sql/mysql_priv.h | 5 ++-- sql/sql_acl.h | 2 +- 9 files changed, 49 insertions(+), 109 deletions(-) delete mode 100644 netware/init_db.sql delete mode 100644 netware/test_db.sql diff --git a/.bzrignore b/.bzrignore index 8e65ec6d6b8..f156bb656a4 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1337,3 +1337,5 @@ win/vs71cache.txt win/vs8cache.txt zlib/*.ds? zlib/*.vcproj +netware/init_db.sql +netware/test_db.sql diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index 75388769808..716f7f31383 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -22,7 +22,7 @@ if [ x$1 = x"--bin" ]; then BINARY_DIST=1 bindir=../bin - scriptdir=../bin + scriptdir=bin libexecdir=../libexec # Check if it's a binary distribution or a 'make install' @@ -33,7 +33,7 @@ if [ x$1 = x"--bin" ]; then then execdir=../../sbin bindir=../../bin - scriptdir=../../bin + scriptdir=../bin libexecdir=../../libexec else execdir=../bin @@ -43,7 +43,7 @@ else execdir=../sql bindir=../client fix_bin=. - scriptdir=../scripts + scriptdir=scripts libexecdir=../libexec fi @@ -100,18 +100,14 @@ if [ x$BINARY_DIST = x1 ] ; then basedir=.. else basedir=. -EXTRA_ARG="--language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/" +EXTRA_ARG="--windows" fi -mysqld_boot="${MYSQLD_BOOTSTRAP-$mysqld}" +INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=." +echo "running $INSTALL_CMD" -mysqld_boot="$mysqld_boot --no-defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata \ - --skip-innodb --skip-ndbcluster --skip-bdb \ - $EXTRA_ARG" -echo "running $mysqld_boot" - -if $scriptdir/mysql_create_system_tables test $mdata $hostname | $mysqld_boot +cd .. +if $INSTALL_CMD then exit 0 else diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 87d2da9bece..fbe5a643fe7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1495,9 +1495,17 @@ sub executable_setup () { if (!$opt_extern) { - # Look for SQL scripts directory - $path_sql_dir= mtr_path_exists("$glob_basedir/share", - "$glob_basedir/scripts"); + # Look for SQL scripts directory + if ( mtr_file_exists("$path_share/mysql_system_tables.sql") ne "") + { + # The SQL scripts are in path_share + $path_sql_dir= $path_share; + } + else + { + $path_sql_dir= mtr_path_exists("$glob_basedir/share", + "$glob_basedir/scripts"); + } if ( $mysql_version_id >= 50100 ) { $exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap"); diff --git a/netware/Makefile.am b/netware/Makefile.am index de39376f6a1..8a9945fc6a4 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -49,8 +49,8 @@ link_sources: done else -BUILT_SOURCES = libmysql.imp -DISTCLEANFILES = $(BUILT_SOURCES) +BUILT_SOURCES = libmysql.imp init_db.sql test_db.sql +CLEANFILES = $(BUILT_SOURCES) # Create the libmysql.imp from libmysql/libmysql.def libmysql.imp: $(top_srcdir)/libmysql/libmysql.def @@ -60,7 +60,7 @@ libmysql.imp: $(top_srcdir)/libmysql/libmysql.def x>1 {printf(",\n %s", $$1); next} \ /EXPORTS/{x=1}' $(top_srcdir)/libmysql/libmysql.def > libmysql.imp -EXTRA_DIST= $(BUILT_SOURCES) comp_err.def init_db.sql install_test_db.ncf \ +EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \ libmysql.def \ libmysqlmain.c my_manage.c my_manage.h \ my_print_defaults.def myisam_ftdump.def myisamchk.def \ @@ -73,7 +73,7 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def init_db.sql install_test_db.ncf \ mysqld_safe.c mysqld_safe.def mysqldump.def mysqlimport.def \ mysqlshow.def mysqltest.def mysql_upgrade.def perror.def \ mysql_client_test.def \ - replace.def resolve_stack_dump.def resolveip.def test_db.sql \ + replace.def resolve_stack_dump.def resolveip.def \ static_init_db.sql \ BUILD/apply-patch BUILD/compile-AUTOTOOLS \ BUILD/compile-linux-tools BUILD/compile-netware-END \ @@ -84,6 +84,26 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def init_db.sql install_test_db.ncf \ BUILD/cron-build BUILD/crontab BUILD/knetware.imp \ BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \ BUILD/nwbootstrap BUILD/openssl.imp BUILD/save-patch + + +# Build init_db.sql from the files that contain +# the system tables for this version of MySQL plus any commands +init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \ + $(top_srcdir)/scripts/mysql_system_tables_data.sql + @echo "Building $@"; + @echo "CREATE DATABASE mysql;" > $@; + @echo "CREATE DATABASE test;" >> $@; + @echo "use mysql;" >> $@; + @cat $(top_srcdir)/scripts/mysql_system_tables.sql \ + $(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@; + +# Build test_db.sql from init_db.sql plus +# some test data +test_db.sql: init_db.sql $(top_srcdir)/scripts/mysql_test_data_timezone.sql + @echo "Building $@"; + @cat init_db.sql \ + $(top_srcdir)/scripts/mysql_test_data_timezone.sql >> $@; + endif # Don't update the files from bitkeeper diff --git a/netware/init_db.sql b/netware/init_db.sql deleted file mode 100644 index c5810b50e8e..00000000000 --- a/netware/init_db.sql +++ /dev/null @@ -1,38 +0,0 @@ -CREATE DATABASE mysql; -CREATE DATABASE test; - -USE mysql; - -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; - -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; - -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; - -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - -INSERT INTO user (host,user) values ('localhost',''); -INSERT INTO user (host,user) values ('',''); - -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; - -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; - -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; - -CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help topics'; -CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='keyword-topic relation'; - -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone names'; - -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zones'; -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transitions'; - -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transition types'; -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Leap seconds information for time zones'; diff --git a/netware/test_db.sql b/netware/test_db.sql deleted file mode 100644 index 0f58c242278..00000000000 --- a/netware/test_db.sql +++ /dev/null @@ -1,43 +0,0 @@ -CREATE DATABASE mysql; -CREATE DATABASE test; - -USE mysql; - -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; - -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; - -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; - -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - -INSERT INTO user (host,user) values ('localhost',''); -INSERT INTO user (host,user) values ('',''); - -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; - -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; - -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; - -CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics'; -CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; - -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names'; -INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4),('Japan', 5); - -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones'; -INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'); -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; -INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES(1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3) ,(1, 733280400, 2) ,(1, 749005200, 3) ,(1, 764730000, 2) ,(1, 780454800, 3) ,(1, 796179600, 2) ,(1, 811904400, 3) ,(1, 828234000, 2) ,(1, 846378000, 3) ,(1, 859683600, 2) ,(1, 877827600, 3) ,(1, 891133200, 2) ,(1, 909277200, 3) ,(1, 922582800, 2) ,(1, 941331600, 3) ,(1, 954032400, 2) ,(1, 972781200, 3) ,(1, 985482000, 2) ,(1, 1004230800, 3) ,(1, 1017536400, 2) ,(1, 1035680400, 3) ,(1, 1048986000, 2) ,(1, 1067130000, 3) ,(1, 1080435600, 2) ,(1, 1099184400, 3) ,(1, 1111885200, 2) ,(1, 1130634000, 3) ,(1, 1143334800, 2) ,(1, 1162083600, 3) ,(1, 1174784400, 2) ,(1, 1193533200, 3) ,(1, 1206838800, 2) ,(1, 1224982800, 3) ,(1, 1238288400, 2) ,(1, 1256432400, 3) ,(1, 1269738000, 2) ,(1, 1288486800, 3) ,(1, 1301187600, 2) ,(1, 1319936400, 3) ,(1, 1332637200, 2) ,(1, 1351386000, 3) ,(1, 1364691600, 2) ,(1, 1382835600, 3) ,(1, 1396141200, 2) ,(1, 1414285200, 3) ,(1, 1427590800, 2) ,(1, 1445734800, 3) ,(1, 1459040400, 2) ,(1, 1477789200, 3) ,(1, 1490490000, 2) ,(1, 1509238800, 3) ,(1, 1521939600, 2) ,(1, 1540688400, 3) ,(1, 1553994000, 2) ,(1, 1572138000, 3) ,(1, 1585443600, 2) ,(1, 1603587600, 3) ,(1, 1616893200, 2) ,(1, 1635642000, 3) ,(1, 1648342800, 2) ,(1, 1667091600, 3) ,(1, 1679792400, 2) ,(1, 1698541200, 3) ,(1, 1711846800, 2) ,(1, 1729990800, 3) ,(1, 1743296400, 2) ,(1, 1761440400, 3) ,(1, 1774746000, 2) ,(1, 1792890000, 3) ,(1, 1806195600, 2) ,(1, 1824944400, 3) ,(1, 1837645200, 2) ,(1, 1856394000, 3) ,(1, 1869094800, 2) ,(1, 1887843600, 3) ,(1, 1901149200, 2) ,(1, 1919293200, 3) ,(1, 1932598800, 2) ,(1, 1950742800, 3) ,(1, 1964048400, 2) ,(1, 1982797200, 3) ,(1, 1995498000, 2) ,(1, 2014246800, 3) ,(1, 2026947600, 2) ,(1, 2045696400, 3) ,(1, 2058397200, 2) ,(1, 2077146000, 3) ,(1, 2090451600, 2) ,(1, 2108595600, 3) ,(1, 2121901200, 2) ,(1, 2140045200, 3) ,(3, -1688265000, 2) ,(3, -1656819048, 1) ,(3, -1641353448, 2) ,(3, -1627965048, 3) ,(3, -1618716648, 1) ,(3, -1596429048, 3) ,(3, -1593829848, 5) ,(3, -1589860800, 4) ,(3, -1542427200, 5) ,(3, -1539493200, 6) ,(3, -1525323600, 5) ,(3, -1522728000, 4) ,(3, -1491188400, 7) ,(3, -1247536800, 4) ,(3, 354920400, 5) ,(3, 370728000, 4) ,(3, 386456400, 5) ,(3, 402264000, 4) ,(3, 417992400, 5) ,(3, 433800000, 4) ,(3, 449614800, 5) ,(3, 465346800, 8) ,(3, 481071600, 9) ,(3, 496796400, 8) ,(3, 512521200, 9) ,(3, 528246000, 8) ,(3, 543970800, 9) ,(3, 559695600, 8) ,(3, 575420400, 9) ,(3, 591145200, 8) ,(3, 606870000, 9) ,(3, 622594800, 8) ,(3, 638319600, 9) ,(3, 654649200, 8) ,(3, 670374000, 10) ,(3, 686102400, 11) ,(3, 695779200, 8) ,(3, 701812800, 5) ,(3, 717534000, 4) ,(3, 733273200, 9) ,(3, 748998000, 8) ,(3, 764722800, 9) ,(3, 780447600, 8) ,(3, 796172400, 9) ,(3, 811897200, 8) ,(3, 828226800, 9) ,(3, 846370800, 8) ,(3, 859676400, 9) ,(3, 877820400, 8) ,(3, 891126000, 9) ,(3, 909270000, 8) ,(3, 922575600, 9) ,(3, 941324400, 8) ,(3, 954025200, 9) ,(3, 972774000, 8) ,(3, 985474800, 9) ,(3, 1004223600, 8) ,(3, 1017529200, 9) ,(3, 1035673200, 8) ,(3, 1048978800, 9) ,(3, 1067122800, 8) ,(3, 1080428400, 9) ,(3, 1099177200, 8) ,(3, 1111878000, 9) ,(3, 1130626800, 8) ,(3, 1143327600, 9) ,(3, 1162076400, 8) ,(3, 1174777200, 9) ,(3, 1193526000, 8) ,(3, 1206831600, 9) ,(3, 1224975600, 8) ,(3, 1238281200, 9) ,(3, 1256425200, 8) ,(3, 1269730800, 9) ,(3, 1288479600, 8) ,(3, 1301180400, 9) ,(3, 1319929200, 8) ,(3, 1332630000, 9) ,(3, 1351378800, 8) ,(3, 1364684400, 9) ,(3, 1382828400, 8) ,(3, 1396134000, 9) ,(3, 1414278000, 8) ,(3, 1427583600, 9) ,(3, 1445727600, 8) ,(3, 1459033200, 9) ,(3, 1477782000, 8) ,(3, 1490482800, 9) ,(3, 1509231600, 8) ,(3, 1521932400, 9) ,(3, 1540681200, 8) ,(3, 1553986800, 9) ,(3, 1572130800, 8) ,(3, 1585436400, 9) ,(3, 1603580400, 8) ,(3, 1616886000, 9) ,(3, 1635634800, 8) ,(3, 1648335600, 9) ,(3, 1667084400, 8) ,(3, 1679785200, 9) ,(3, 1698534000, 8) ,(3, 1711839600, 9) ,(3, 1729983600, 8) ,(3, 1743289200, 9) ,(3, 1761433200, 8) ,(3, 1774738800, 9) ,(3, 1792882800, 8) ,(3, 1806188400, 9) ,(3, 1824937200, 8) ,(3, 1837638000, 9) ,(3, 1856386800, 8) ,(3, 1869087600, 9) ,(3, 1887836400, 8) ,(3, 1901142000, 9) ,(3, 1919286000, 8) ,(3, 1932591600, 9) ,(3, 1950735600, 8) ,(3, 1964041200, 9) ,(3, 1982790000, 8) ,(3, 1995490800, 9) ,(3, 2014239600, 8) ,(3, 2026940400, 9) ,(3, 2045689200, 8) ,(3, 2058390000, 9) ,(3, 2077138800, 8) ,(3, 2090444400, 9) ,(3, 2108588400, 8) ,(3, 2121894000, 9) ,(3, 2140038000, 8) ,(4, -1688265000, 2) ,(4, -1656819048, 1) ,(4, -1641353448, 2) ,(4, -1627965048, 3) ,(4, -1618716648, 1) ,(4, -1596429048, 3) ,(4, -1593829848, 5) ,(4, -1589860800, 4) ,(4, -1542427200, 5) ,(4, -1539493200, 6) ,(4, -1525323600, 5) ,(4, -1522728000, 4) ,(4, -1491188400, 7) ,(4, -1247536800, 4) ,(4, 354920409, 5) ,(4, 370728010, 4) ,(4, 386456410, 5) ,(4, 402264011, 4) ,(4, 417992411, 5) ,(4, 433800012, 4) ,(4, 449614812, 5) ,(4, 465346812, 8) ,(4, 481071612, 9) ,(4, 496796413, 8) ,(4, 512521213, 9) ,(4, 528246013, 8) ,(4, 543970813, 9) ,(4, 559695613, 8) ,(4, 575420414, 9) ,(4, 591145214, 8) ,(4, 606870014, 9) ,(4, 622594814, 8) ,(4, 638319615, 9) ,(4, 654649215, 8) ,(4, 670374016, 10) ,(4, 686102416, 11) ,(4, 695779216, 8) ,(4, 701812816, 5) ,(4, 717534017, 4) ,(4, 733273217, 9) ,(4, 748998018, 8) ,(4, 764722818, 9) ,(4, 780447619, 8) ,(4, 796172419, 9) ,(4, 811897219, 8) ,(4, 828226820, 9) ,(4, 846370820, 8) ,(4, 859676420, 9) ,(4, 877820421, 8) ,(4, 891126021, 9) ,(4, 909270021, 8) ,(4, 922575622, 9) ,(4, 941324422, 8) ,(4, 954025222, 9) ,(4, 972774022, 8) ,(4, 985474822, 9) ,(4, 1004223622, 8) ,(4, 1017529222, 9) ,(4, 1035673222, 8) ,(4, 1048978822, 9) ,(4, 1067122822, 8) ,(4, 1080428422, 9) ,(4, 1099177222, 8) ,(4, 1111878022, 9) ,(4, 1130626822, 8) ,(4, 1143327622, 9) ,(4, 1162076422, 8) ,(4, 1174777222, 9) ,(4, 1193526022, 8) ,(4, 1206831622, 9) ,(4, 1224975622, 8) ,(4, 1238281222, 9) ,(4, 1256425222, 8) ,(4, 1269730822, 9) ,(4, 1288479622, 8) ,(4, 1301180422, 9) ,(4, 1319929222, 8) ,(4, 1332630022, 9) ,(4, 1351378822, 8) ,(4, 1364684422, 9) ,(4, 1382828422, 8) ,(4, 1396134022, 9) ,(4, 1414278022, 8) ,(4, 1427583622, 9) ,(4, 1445727622, 8) ,(4, 1459033222, 9) ,(4, 1477782022, 8) ,(4, 1490482822, 9) ,(4, 1509231622, 8) ,(4, 1521932422, 9) ,(4, 1540681222, 8) ,(4, 1553986822, 9) ,(4, 1572130822, 8) ,(4, 1585436422, 9) ,(4, 1603580422, 8) ,(4, 1616886022, 9) ,(4, 1635634822, 8) ,(4, 1648335622, 9) ,(4, 1667084422, 8) ,(4, 1679785222, 9) ,(4, 1698534022, 8) ,(4, 1711839622, 9) ,(4, 1729983622, 8) ,(4, 1743289222, 9) ,(4, 1761433222, 8) ,(4, 1774738822, 9) ,(4, 1792882822, 8) ,(4, 1806188422, 9) ,(4, 1824937222, 8) ,(4, 1837638022, 9) ,(4, 1856386822, 8) ,(4, 1869087622, 9) ,(4, 1887836422, 8) ,(4, 1901142022, 9) ,(4, 1919286022, 8) ,(4, 1932591622, 9) ,(4, 1950735622, 8) ,(4, 1964041222, 9) ,(4, 1982790022, 8) ,(4, 1995490822, 9) ,(4, 2014239622, 8) ,(4, 2026940422, 9) ,(4, 2045689222, 8) ,(4, 2058390022, 9) ,(4, 2077138822, 8) ,(4, 2090444422, 9) ,(4, 2108588422, 8) ,(4, 2121894022, 9) ,(4, 2140038022, 8); - -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; -INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET'),(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET'),(2, 0, 0, 0, 'UTC'),(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST'),(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST'),(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD'),(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET'),(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD'),(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET'),(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST'),(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST'),(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD'),(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET'),(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD'),(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET'); -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; -INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3),(157766403, 4) ,(189302404, 5) ,(220924805, 6),(252460806, 7) ,(283996807, 8) ,(315532808, 9),(362793609, 10) ,(394329610, 11) ,(425865611, 12),(489024012, 13) ,(567993613, 14) ,(631152014, 15),(662688015, 16) ,(709948816, 17) ,(741484817, 18),(773020818, 19) ,(820454419, 20) ,(867715220, 21),(915148821, 22); diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4e95c51a829..7d7918975f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -298,12 +298,6 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql - echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ - >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ - > $BASE/bin/test_db.sql ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1ffbc1243e9..995f5554a2b 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -417,8 +417,9 @@ MY_LOCALE *my_locale_by_number(uint number); updated (to store more bytes on disk). NOTE: When adding new SQL_MODE types, make sure to also add them to - ../scripts/mysql_create_system_tables.sh and - ../scripts/mysql_fix_privilege_tables.sql + the scripts used for creating the MySQL system tables + in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql + */ #define RAID_BLOCK_SIZE 1024 diff --git a/sql/sql_acl.h b/sql/sql_acl.h index cf2b9ce66a9..d08f2663af5 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -43,7 +43,7 @@ don't forget to update 1. static struct show_privileges_st sys_privileges[] 2. static const char *command_array[] and static uint command_lengths[] - 3. mysql_create_system_tables.sh, mysql_fix_privilege_tables.sql + 3. mysql_system_tables.sql and mysql_system_tables_fix.sql 4. acl_init() or whatever - to define behaviour for old privilege tables 5. sql_yacc.yy - for GRANT/REVOKE to work */ From 998260ae5abba5dd07c170548b0aa0b7a2713809 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 20:50:37 +0300 Subject: [PATCH 181/789] Fix compilation on Windows broken with the push of bug#16420. Fix three compilation warnings. sql/event_data_objects.cc: Fix compilation warnings. sql/event_queue.cc: Fix compilation warning: reimplement event_queue_element_compare_q() properly. Use set_timespec() to initialize struct timespec. --- sql/event_data_objects.cc | 4 ++-- sql/event_queue.cc | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 36f20c34200..4a78c1affb0 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1293,7 +1293,7 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next, time, and this will greatly reduce the effect of the optimization. So instead we keep the code simple and clean. */ - interval.month= diff_months - diff_months % months; + interval.month= (ulong) (diff_months - diff_months % months); next_time= add_interval(&local_start, time_zone, INTERVAL_MONTH, interval); if (next_time == 0) @@ -1301,7 +1301,7 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next, if (next_time <= time_now) { - interval.month= months; + interval.month= (ulong) months; next_time= add_interval(&local_start, time_zone, INTERVAL_MONTH, interval); if (next_time == 0) diff --git a/sql/event_queue.cc b/sql/event_queue.cc index bcfe0a222f1..0efd9bb85d1 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -65,13 +65,10 @@ struct event_queue_param static int event_queue_element_compare_q(void *vptr, byte* a, byte *b) { - /* - Note that no overflow is possible here because both values are - non-negative, and subtraction is done in the signed my_time_t - type. - */ - return (((Event_queue_element *)a)->execute_at - - ((Event_queue_element *)b)->execute_at); + my_time_t lhs = ((Event_queue_element *)a)->execute_at; + my_time_t rhs = ((Event_queue_element *)b)->execute_at; + + return (lhs < rhs ? -1 : (lhs > rhs ? 1 : 0)); } @@ -580,8 +577,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd, time or until signaled. Release LOCK_queue while waiting. */ struct timespec top_time; - top_time.tv_sec= next_activation_at; - top_time.tv_nsec= 0; + set_timespec(top_time, next_activation_at - thd->query_start()); cond_wait(thd, &top_time, queue_wait_msg, SCHED_FUNC, __LINE__); continue; From 68f09e779291c0f48bcc79d7699dd708fda32c32 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 22:23:37 +0400 Subject: [PATCH 182/789] merging --- sql/sql_insert.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index a9652fe9717..06a1ebdc89b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1039,7 +1039,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, res= check_insert_fields(thd, context->table_list, fields, *values, !insert_into_view, &map) || - setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, 0) + setup_fields(thd, 0, *values, MARK_COLUMNS_READ, 0, 0); if (!res && check_fields) { From a2630174940dfe4be437503eb82d07838b54cda2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 19:44:00 +0100 Subject: [PATCH 183/789] remove unnecessary line --- unittest/mysys/my_atomic-t.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c index c4ba7850ae1..8280aff5422 100644 --- a/unittest/mysys/my_atomic-t.c +++ b/unittest/mysys/my_atomic-t.c @@ -182,9 +182,6 @@ int main() test_atomic("my_atomic_add32", test_atomic_add_handler, THREADS, CYCLES); test_atomic("my_atomic_swap32", test_atomic_swap_handler, THREADS, CYCLES); test_atomic("my_atomic_cas32", test_atomic_cas_handler, THREADS, CYCLES); - - /* workaround until we know why this includes dbug but not safemalloc */ - if(err) { my_thread_global_init(); my_free(my_malloc(0, MYF(0)), MYF(0)); } /* workaround until we know why it crashes randomly on some machine (BUG#22320). From 92384c67442d0e45065093ce2d48d4d5161c3e51 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 19:56:16 +0100 Subject: [PATCH 184/789] Fix bug#27212, test case "loaddata": Take the file to read from the binary package. mysql-test/r/loaddata.result: Fix bug#27212: Do not try to read a file which is not contained in a binary distribution, because it will be missing when the tests are run during release build or by a customer. mysql-test/t/loaddata.test: Fix bug#27212: Do not try to read a file which is not contained in a binary distribution, because it will be missing when the tests are run during release build or by a customer. --- mysql-test/r/loaddata.result | 6 +++--- mysql-test/t/loaddata.test | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 83c7b37d914..bef483569d4 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -148,11 +148,11 @@ MYSQLTEST_VARDIR/ set @@secure_file_priv= 0; ERROR HY000: Variable 'secure_file_priv' is a read only variable truncate table t1; -load data infile 'MYSQL_TEST_DIR/Makefile' into table t1; +load data infile 'MYSQL_TEST_DIR/t/loaddata.test' into table t1; ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement select * from t1; a b c -select load_file("MYSQL_TEST_DIR/Makefile"); -load_file("MYSQL_TEST_DIR/Makefile") +select load_file("MYSQL_TEST_DIR/t/loaddata.test"); +load_file("MYSQL_TEST_DIR/t/loaddata.test") NULL drop table t1, t2; diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 0dc91c36a09..125a65826ca 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -126,12 +126,12 @@ set @@secure_file_priv= 0; truncate table t1; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --error 1290 -eval load data infile '$MYSQL_TEST_DIR/Makefile' into table t1; +eval load data infile '$MYSQL_TEST_DIR/t/loaddata.test' into table t1; select * from t1; # Test "load_file" returns NULL --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval select load_file("$MYSQL_TEST_DIR/Makefile"); +eval select load_file("$MYSQL_TEST_DIR/t/loaddata.test"); # cleanup drop table t1, t2; From 77fccd038f7b6e177c7dd6d5ff28d0490589598f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 20:56:16 +0100 Subject: [PATCH 185/789] Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Build sql files for netware from the mysql_system_tables*.sq files - Fix comments about mysql_create_system_tables.sh - Use mysql_install_db.sh to create system tables for mysql_test-run-shell - Fix mysql-test-run.pl to also look in share/mysql for the msyql_system*.sql files Changeset coded today by Magnus Svensson, just the application to 5.0.38 is by Joerg Bruehe. BitKeeper/deleted/.del-init_db.sql~e2b8d0c8390e8023: Delete: netware/init_db.sql BitKeeper/deleted/.del-test_db.sql: Delete: netware/test_db.sql BitKeeper/etc/ignore: Added netware/init_db.sql netware/test_db.sql to the ignore list mysql-test/install_test_db.sh: Use mysql_install_db from install_test_db(which is used by mysql-test-run-shell) to install the system tables mysql-test/mysql-test-run.pl: Look for the mysql_system_tables*.sql also in share/mysql netware/Makefile.am: Build netware/init_db.sql and netware/test_db.sql from the sources in scripts/msyql_system_tables*.sql scripts/make_binary_distribution.sh: netware/init_db.sql and netware/test_db.sql are now built by the Makefiles from the scripts/mysql_system_tables*.sql files sql/mysql_priv.h: Update comment remindging to update the MySQL system table definitions when adding a new SQL_MODE sql/sql_acl.h: Update comment reminding to update the MySQL System tables when changing the ACL defines --- .bzrignore | 2 ++ mysql-test/install_test_db.sh | 20 ++++++-------- mysql-test/mysql-test-run.pl | 14 ++++++++-- netware/Makefile.am | 28 ++++++++++++++++--- netware/init_db.sql | 38 ------------------------- netware/test_db.sql | 43 ----------------------------- scripts/make_binary_distribution.sh | 6 ---- sql/mysql_priv.h | 5 ++-- sql/sql_acl.h | 2 +- 9 files changed, 49 insertions(+), 109 deletions(-) delete mode 100644 netware/init_db.sql delete mode 100644 netware/test_db.sql diff --git a/.bzrignore b/.bzrignore index 8e65ec6d6b8..f156bb656a4 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1337,3 +1337,5 @@ win/vs71cache.txt win/vs8cache.txt zlib/*.ds? zlib/*.vcproj +netware/init_db.sql +netware/test_db.sql diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index 75388769808..716f7f31383 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -22,7 +22,7 @@ if [ x$1 = x"--bin" ]; then BINARY_DIST=1 bindir=../bin - scriptdir=../bin + scriptdir=bin libexecdir=../libexec # Check if it's a binary distribution or a 'make install' @@ -33,7 +33,7 @@ if [ x$1 = x"--bin" ]; then then execdir=../../sbin bindir=../../bin - scriptdir=../../bin + scriptdir=../bin libexecdir=../../libexec else execdir=../bin @@ -43,7 +43,7 @@ else execdir=../sql bindir=../client fix_bin=. - scriptdir=../scripts + scriptdir=scripts libexecdir=../libexec fi @@ -100,18 +100,14 @@ if [ x$BINARY_DIST = x1 ] ; then basedir=.. else basedir=. -EXTRA_ARG="--language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/" +EXTRA_ARG="--windows" fi -mysqld_boot="${MYSQLD_BOOTSTRAP-$mysqld}" +INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=." +echo "running $INSTALL_CMD" -mysqld_boot="$mysqld_boot --no-defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata \ - --skip-innodb --skip-ndbcluster --skip-bdb \ - $EXTRA_ARG" -echo "running $mysqld_boot" - -if $scriptdir/mysql_create_system_tables test $mdata $hostname | $mysqld_boot +cd .. +if $INSTALL_CMD then exit 0 else diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 565c55b14fd..fadb7c5f0e0 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1495,9 +1495,17 @@ sub executable_setup () { if (!$opt_extern) { - # Look for SQL scripts directory - $path_sql_dir= mtr_path_exists("$glob_basedir/share", - "$glob_basedir/scripts"); + # Look for SQL scripts directory + if ( mtr_file_exists("$path_share/mysql_system_tables.sql") ne "") + { + # The SQL scripts are in path_share + $path_sql_dir= $path_share; + } + else + { + $path_sql_dir= mtr_path_exists("$glob_basedir/share", + "$glob_basedir/scripts"); + } if ( $mysql_version_id >= 50100 ) { $exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap"); diff --git a/netware/Makefile.am b/netware/Makefile.am index de39376f6a1..8a9945fc6a4 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -49,8 +49,8 @@ link_sources: done else -BUILT_SOURCES = libmysql.imp -DISTCLEANFILES = $(BUILT_SOURCES) +BUILT_SOURCES = libmysql.imp init_db.sql test_db.sql +CLEANFILES = $(BUILT_SOURCES) # Create the libmysql.imp from libmysql/libmysql.def libmysql.imp: $(top_srcdir)/libmysql/libmysql.def @@ -60,7 +60,7 @@ libmysql.imp: $(top_srcdir)/libmysql/libmysql.def x>1 {printf(",\n %s", $$1); next} \ /EXPORTS/{x=1}' $(top_srcdir)/libmysql/libmysql.def > libmysql.imp -EXTRA_DIST= $(BUILT_SOURCES) comp_err.def init_db.sql install_test_db.ncf \ +EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \ libmysql.def \ libmysqlmain.c my_manage.c my_manage.h \ my_print_defaults.def myisam_ftdump.def myisamchk.def \ @@ -73,7 +73,7 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def init_db.sql install_test_db.ncf \ mysqld_safe.c mysqld_safe.def mysqldump.def mysqlimport.def \ mysqlshow.def mysqltest.def mysql_upgrade.def perror.def \ mysql_client_test.def \ - replace.def resolve_stack_dump.def resolveip.def test_db.sql \ + replace.def resolve_stack_dump.def resolveip.def \ static_init_db.sql \ BUILD/apply-patch BUILD/compile-AUTOTOOLS \ BUILD/compile-linux-tools BUILD/compile-netware-END \ @@ -84,6 +84,26 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def init_db.sql install_test_db.ncf \ BUILD/cron-build BUILD/crontab BUILD/knetware.imp \ BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \ BUILD/nwbootstrap BUILD/openssl.imp BUILD/save-patch + + +# Build init_db.sql from the files that contain +# the system tables for this version of MySQL plus any commands +init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \ + $(top_srcdir)/scripts/mysql_system_tables_data.sql + @echo "Building $@"; + @echo "CREATE DATABASE mysql;" > $@; + @echo "CREATE DATABASE test;" >> $@; + @echo "use mysql;" >> $@; + @cat $(top_srcdir)/scripts/mysql_system_tables.sql \ + $(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@; + +# Build test_db.sql from init_db.sql plus +# some test data +test_db.sql: init_db.sql $(top_srcdir)/scripts/mysql_test_data_timezone.sql + @echo "Building $@"; + @cat init_db.sql \ + $(top_srcdir)/scripts/mysql_test_data_timezone.sql >> $@; + endif # Don't update the files from bitkeeper diff --git a/netware/init_db.sql b/netware/init_db.sql deleted file mode 100644 index c5810b50e8e..00000000000 --- a/netware/init_db.sql +++ /dev/null @@ -1,38 +0,0 @@ -CREATE DATABASE mysql; -CREATE DATABASE test; - -USE mysql; - -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; - -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; - -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; - -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - -INSERT INTO user (host,user) values ('localhost',''); -INSERT INTO user (host,user) values ('',''); - -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; - -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; - -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; - -CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help topics'; -CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='keyword-topic relation'; - -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone names'; - -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zones'; -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transitions'; - -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transition types'; -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Leap seconds information for time zones'; diff --git a/netware/test_db.sql b/netware/test_db.sql deleted file mode 100644 index 0f58c242278..00000000000 --- a/netware/test_db.sql +++ /dev/null @@ -1,43 +0,0 @@ -CREATE DATABASE mysql; -CREATE DATABASE test; - -USE mysql; - -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; - -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; - -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; - -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - -INSERT INTO user (host,user) values ('localhost',''); -INSERT INTO user (host,user) values ('',''); - -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; - -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; - -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; - -CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics'; -CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; - -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names'; -INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4),('Japan', 5); - -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones'; -INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'); -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; -INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES(1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3) ,(1, 733280400, 2) ,(1, 749005200, 3) ,(1, 764730000, 2) ,(1, 780454800, 3) ,(1, 796179600, 2) ,(1, 811904400, 3) ,(1, 828234000, 2) ,(1, 846378000, 3) ,(1, 859683600, 2) ,(1, 877827600, 3) ,(1, 891133200, 2) ,(1, 909277200, 3) ,(1, 922582800, 2) ,(1, 941331600, 3) ,(1, 954032400, 2) ,(1, 972781200, 3) ,(1, 985482000, 2) ,(1, 1004230800, 3) ,(1, 1017536400, 2) ,(1, 1035680400, 3) ,(1, 1048986000, 2) ,(1, 1067130000, 3) ,(1, 1080435600, 2) ,(1, 1099184400, 3) ,(1, 1111885200, 2) ,(1, 1130634000, 3) ,(1, 1143334800, 2) ,(1, 1162083600, 3) ,(1, 1174784400, 2) ,(1, 1193533200, 3) ,(1, 1206838800, 2) ,(1, 1224982800, 3) ,(1, 1238288400, 2) ,(1, 1256432400, 3) ,(1, 1269738000, 2) ,(1, 1288486800, 3) ,(1, 1301187600, 2) ,(1, 1319936400, 3) ,(1, 1332637200, 2) ,(1, 1351386000, 3) ,(1, 1364691600, 2) ,(1, 1382835600, 3) ,(1, 1396141200, 2) ,(1, 1414285200, 3) ,(1, 1427590800, 2) ,(1, 1445734800, 3) ,(1, 1459040400, 2) ,(1, 1477789200, 3) ,(1, 1490490000, 2) ,(1, 1509238800, 3) ,(1, 1521939600, 2) ,(1, 1540688400, 3) ,(1, 1553994000, 2) ,(1, 1572138000, 3) ,(1, 1585443600, 2) ,(1, 1603587600, 3) ,(1, 1616893200, 2) ,(1, 1635642000, 3) ,(1, 1648342800, 2) ,(1, 1667091600, 3) ,(1, 1679792400, 2) ,(1, 1698541200, 3) ,(1, 1711846800, 2) ,(1, 1729990800, 3) ,(1, 1743296400, 2) ,(1, 1761440400, 3) ,(1, 1774746000, 2) ,(1, 1792890000, 3) ,(1, 1806195600, 2) ,(1, 1824944400, 3) ,(1, 1837645200, 2) ,(1, 1856394000, 3) ,(1, 1869094800, 2) ,(1, 1887843600, 3) ,(1, 1901149200, 2) ,(1, 1919293200, 3) ,(1, 1932598800, 2) ,(1, 1950742800, 3) ,(1, 1964048400, 2) ,(1, 1982797200, 3) ,(1, 1995498000, 2) ,(1, 2014246800, 3) ,(1, 2026947600, 2) ,(1, 2045696400, 3) ,(1, 2058397200, 2) ,(1, 2077146000, 3) ,(1, 2090451600, 2) ,(1, 2108595600, 3) ,(1, 2121901200, 2) ,(1, 2140045200, 3) ,(3, -1688265000, 2) ,(3, -1656819048, 1) ,(3, -1641353448, 2) ,(3, -1627965048, 3) ,(3, -1618716648, 1) ,(3, -1596429048, 3) ,(3, -1593829848, 5) ,(3, -1589860800, 4) ,(3, -1542427200, 5) ,(3, -1539493200, 6) ,(3, -1525323600, 5) ,(3, -1522728000, 4) ,(3, -1491188400, 7) ,(3, -1247536800, 4) ,(3, 354920400, 5) ,(3, 370728000, 4) ,(3, 386456400, 5) ,(3, 402264000, 4) ,(3, 417992400, 5) ,(3, 433800000, 4) ,(3, 449614800, 5) ,(3, 465346800, 8) ,(3, 481071600, 9) ,(3, 496796400, 8) ,(3, 512521200, 9) ,(3, 528246000, 8) ,(3, 543970800, 9) ,(3, 559695600, 8) ,(3, 575420400, 9) ,(3, 591145200, 8) ,(3, 606870000, 9) ,(3, 622594800, 8) ,(3, 638319600, 9) ,(3, 654649200, 8) ,(3, 670374000, 10) ,(3, 686102400, 11) ,(3, 695779200, 8) ,(3, 701812800, 5) ,(3, 717534000, 4) ,(3, 733273200, 9) ,(3, 748998000, 8) ,(3, 764722800, 9) ,(3, 780447600, 8) ,(3, 796172400, 9) ,(3, 811897200, 8) ,(3, 828226800, 9) ,(3, 846370800, 8) ,(3, 859676400, 9) ,(3, 877820400, 8) ,(3, 891126000, 9) ,(3, 909270000, 8) ,(3, 922575600, 9) ,(3, 941324400, 8) ,(3, 954025200, 9) ,(3, 972774000, 8) ,(3, 985474800, 9) ,(3, 1004223600, 8) ,(3, 1017529200, 9) ,(3, 1035673200, 8) ,(3, 1048978800, 9) ,(3, 1067122800, 8) ,(3, 1080428400, 9) ,(3, 1099177200, 8) ,(3, 1111878000, 9) ,(3, 1130626800, 8) ,(3, 1143327600, 9) ,(3, 1162076400, 8) ,(3, 1174777200, 9) ,(3, 1193526000, 8) ,(3, 1206831600, 9) ,(3, 1224975600, 8) ,(3, 1238281200, 9) ,(3, 1256425200, 8) ,(3, 1269730800, 9) ,(3, 1288479600, 8) ,(3, 1301180400, 9) ,(3, 1319929200, 8) ,(3, 1332630000, 9) ,(3, 1351378800, 8) ,(3, 1364684400, 9) ,(3, 1382828400, 8) ,(3, 1396134000, 9) ,(3, 1414278000, 8) ,(3, 1427583600, 9) ,(3, 1445727600, 8) ,(3, 1459033200, 9) ,(3, 1477782000, 8) ,(3, 1490482800, 9) ,(3, 1509231600, 8) ,(3, 1521932400, 9) ,(3, 1540681200, 8) ,(3, 1553986800, 9) ,(3, 1572130800, 8) ,(3, 1585436400, 9) ,(3, 1603580400, 8) ,(3, 1616886000, 9) ,(3, 1635634800, 8) ,(3, 1648335600, 9) ,(3, 1667084400, 8) ,(3, 1679785200, 9) ,(3, 1698534000, 8) ,(3, 1711839600, 9) ,(3, 1729983600, 8) ,(3, 1743289200, 9) ,(3, 1761433200, 8) ,(3, 1774738800, 9) ,(3, 1792882800, 8) ,(3, 1806188400, 9) ,(3, 1824937200, 8) ,(3, 1837638000, 9) ,(3, 1856386800, 8) ,(3, 1869087600, 9) ,(3, 1887836400, 8) ,(3, 1901142000, 9) ,(3, 1919286000, 8) ,(3, 1932591600, 9) ,(3, 1950735600, 8) ,(3, 1964041200, 9) ,(3, 1982790000, 8) ,(3, 1995490800, 9) ,(3, 2014239600, 8) ,(3, 2026940400, 9) ,(3, 2045689200, 8) ,(3, 2058390000, 9) ,(3, 2077138800, 8) ,(3, 2090444400, 9) ,(3, 2108588400, 8) ,(3, 2121894000, 9) ,(3, 2140038000, 8) ,(4, -1688265000, 2) ,(4, -1656819048, 1) ,(4, -1641353448, 2) ,(4, -1627965048, 3) ,(4, -1618716648, 1) ,(4, -1596429048, 3) ,(4, -1593829848, 5) ,(4, -1589860800, 4) ,(4, -1542427200, 5) ,(4, -1539493200, 6) ,(4, -1525323600, 5) ,(4, -1522728000, 4) ,(4, -1491188400, 7) ,(4, -1247536800, 4) ,(4, 354920409, 5) ,(4, 370728010, 4) ,(4, 386456410, 5) ,(4, 402264011, 4) ,(4, 417992411, 5) ,(4, 433800012, 4) ,(4, 449614812, 5) ,(4, 465346812, 8) ,(4, 481071612, 9) ,(4, 496796413, 8) ,(4, 512521213, 9) ,(4, 528246013, 8) ,(4, 543970813, 9) ,(4, 559695613, 8) ,(4, 575420414, 9) ,(4, 591145214, 8) ,(4, 606870014, 9) ,(4, 622594814, 8) ,(4, 638319615, 9) ,(4, 654649215, 8) ,(4, 670374016, 10) ,(4, 686102416, 11) ,(4, 695779216, 8) ,(4, 701812816, 5) ,(4, 717534017, 4) ,(4, 733273217, 9) ,(4, 748998018, 8) ,(4, 764722818, 9) ,(4, 780447619, 8) ,(4, 796172419, 9) ,(4, 811897219, 8) ,(4, 828226820, 9) ,(4, 846370820, 8) ,(4, 859676420, 9) ,(4, 877820421, 8) ,(4, 891126021, 9) ,(4, 909270021, 8) ,(4, 922575622, 9) ,(4, 941324422, 8) ,(4, 954025222, 9) ,(4, 972774022, 8) ,(4, 985474822, 9) ,(4, 1004223622, 8) ,(4, 1017529222, 9) ,(4, 1035673222, 8) ,(4, 1048978822, 9) ,(4, 1067122822, 8) ,(4, 1080428422, 9) ,(4, 1099177222, 8) ,(4, 1111878022, 9) ,(4, 1130626822, 8) ,(4, 1143327622, 9) ,(4, 1162076422, 8) ,(4, 1174777222, 9) ,(4, 1193526022, 8) ,(4, 1206831622, 9) ,(4, 1224975622, 8) ,(4, 1238281222, 9) ,(4, 1256425222, 8) ,(4, 1269730822, 9) ,(4, 1288479622, 8) ,(4, 1301180422, 9) ,(4, 1319929222, 8) ,(4, 1332630022, 9) ,(4, 1351378822, 8) ,(4, 1364684422, 9) ,(4, 1382828422, 8) ,(4, 1396134022, 9) ,(4, 1414278022, 8) ,(4, 1427583622, 9) ,(4, 1445727622, 8) ,(4, 1459033222, 9) ,(4, 1477782022, 8) ,(4, 1490482822, 9) ,(4, 1509231622, 8) ,(4, 1521932422, 9) ,(4, 1540681222, 8) ,(4, 1553986822, 9) ,(4, 1572130822, 8) ,(4, 1585436422, 9) ,(4, 1603580422, 8) ,(4, 1616886022, 9) ,(4, 1635634822, 8) ,(4, 1648335622, 9) ,(4, 1667084422, 8) ,(4, 1679785222, 9) ,(4, 1698534022, 8) ,(4, 1711839622, 9) ,(4, 1729983622, 8) ,(4, 1743289222, 9) ,(4, 1761433222, 8) ,(4, 1774738822, 9) ,(4, 1792882822, 8) ,(4, 1806188422, 9) ,(4, 1824937222, 8) ,(4, 1837638022, 9) ,(4, 1856386822, 8) ,(4, 1869087622, 9) ,(4, 1887836422, 8) ,(4, 1901142022, 9) ,(4, 1919286022, 8) ,(4, 1932591622, 9) ,(4, 1950735622, 8) ,(4, 1964041222, 9) ,(4, 1982790022, 8) ,(4, 1995490822, 9) ,(4, 2014239622, 8) ,(4, 2026940422, 9) ,(4, 2045689222, 8) ,(4, 2058390022, 9) ,(4, 2077138822, 8) ,(4, 2090444422, 9) ,(4, 2108588422, 8) ,(4, 2121894022, 9) ,(4, 2140038022, 8); - -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; -INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET'),(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET'),(2, 0, 0, 0, 'UTC'),(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST'),(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST'),(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD'),(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET'),(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD'),(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET'),(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST'),(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST'),(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD'),(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET'),(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD'),(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET'); -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; -INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3),(157766403, 4) ,(189302404, 5) ,(220924805, 6),(252460806, 7) ,(283996807, 8) ,(315532808, 9),(362793609, 10) ,(394329610, 11) ,(425865611, 12),(489024012, 13) ,(567993613, 14) ,(631152014, 15),(662688015, 16) ,(709948816, 17) ,(741484817, 18),(773020818, 19) ,(820454419, 20) ,(867715220, 21),(915148821, 22); diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4e95c51a829..7d7918975f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -298,12 +298,6 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql - echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ - >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ - > $BASE/bin/test_db.sql ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c590429047f..8d6ca4318e3 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -417,8 +417,9 @@ MY_LOCALE *my_locale_by_number(uint number); updated (to store more bytes on disk). NOTE: When adding new SQL_MODE types, make sure to also add them to - ../scripts/mysql_create_system_tables.sh and - ../scripts/mysql_fix_privilege_tables.sql + the scripts used for creating the MySQL system tables + in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql + */ #define RAID_BLOCK_SIZE 1024 diff --git a/sql/sql_acl.h b/sql/sql_acl.h index cf2b9ce66a9..d08f2663af5 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -43,7 +43,7 @@ don't forget to update 1. static struct show_privileges_st sys_privileges[] 2. static const char *command_array[] and static uint command_lengths[] - 3. mysql_create_system_tables.sh, mysql_fix_privilege_tables.sql + 3. mysql_system_tables.sql and mysql_system_tables_fix.sql 4. acl_init() or whatever - to define behaviour for old privilege tables 5. sql_yacc.yy - for GRANT/REVOKE to work */ From 84d24679b955ede6ad0194100355fe4b9139301a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 23:10:12 +0300 Subject: [PATCH 186/789] sql_insert.cc: Post-merge fix. sql/sql_insert.cc: Post-merge fix. --- sql/sql_insert.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 06a1ebdc89b..52f3fd507e4 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1262,21 +1262,22 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) compare_record(table)) { info->updated++; - /* - If ON DUP KEY UPDATE updates a row instead of inserting one, it's - like a regular UPDATE statement: it should not affect the value of a - next SELECT LAST_INSERT_ID() or mysql_insert_id(). - Except if LAST_INSERT_ID(#) was in the INSERT query, which is - handled separately by THD::arg_of_last_insert_id_function. - */ - insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0; - if (table->next_number_field) - table->file->adjust_next_insert_id_after_explicit_value(table->next_number_field->val_int()); - trg_error= (table->triggers && - table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, - TRG_ACTION_AFTER, TRUE)); info->copied++; } + /* + If ON DUP KEY UPDATE updates a row instead of inserting one, it's + like a regular UPDATE statement: it should not affect the value of a + next SELECT LAST_INSERT_ID() or mysql_insert_id(). + Except if LAST_INSERT_ID(#) was in the INSERT query, which is + handled separately by THD::arg_of_last_insert_id_function. + */ + insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0; + if (table->next_number_field) + table->file->adjust_next_insert_id_after_explicit_value( + table->next_number_field->val_int()); + trg_error= (table->triggers && + table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, + TRG_ACTION_AFTER, TRUE)); goto ok_or_after_trg_err; } else /* DUP_REPLACE */ From 9055eaa1ebe515530902968e28c404a9a6122cab Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 15:20:22 -0700 Subject: [PATCH 187/789] The pthread() support was not working. Once I fixed use-thread in a previous push I realized that the pthread/windows code was not working. I've replaced the fork/thread design with a pure pthread design using condition timers and broadcast. Ramification, UNIX now uses thread, support for slaves had to be dropped and there is no need for the --use-threads flag. Added --concurrency=0 option so that it will start at 1 and keep going up until something bad happens :) client/client_priv.h: Dead option removed client/mysqlslap.c: Removed lock code, replaced with posix thread code. mysql-test/mysql-test-run.pl: Removed dead option mysql-test/t/mysqlslap.test: Removed dead option --- client/client_priv.h | 1 - client/mysqlslap.c | 355 ++++++++++++++--------------------- mysql-test/mysql-test-run.pl | 3 +- mysql-test/t/mysqlslap.test | 2 +- 4 files changed, 144 insertions(+), 217 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index b6543870528..6227dcdee44 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -49,7 +49,6 @@ enum options_client OPT_TRIGGERS, OPT_MYSQL_ONLY_PRINT, OPT_MYSQL_LOCK_DIRECTORY, - OPT_MYSQL_SLAP_SLAVE, OPT_USE_THREADS, OPT_IMPORT_USE_THREADS, OPT_MYSQL_NUMBER_OF_QUERY, diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 0010d8e46ae..1b4692848b9 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -62,7 +62,6 @@ TODO: Add language for better tests String length for files and those put on the command line are not setup to handle binary data. - Report results of each thread into the lock file we use. More stats Break up tests and run them on multiple hosts at once. Allow output to be fed into a database directly. @@ -83,9 +82,7 @@ TODO: #define SELECT_TYPE_REQUIRES_PREFIX 5 #include "client_priv.h" -#ifdef HAVE_LIBPTHREAD #include -#endif #include #include #include @@ -100,9 +97,6 @@ TODO: #endif #include -#define MYSLAPLOCK "/myslaplock.lck" -#define MYSLAPLOCK_DIR "/tmp" - #ifdef __WIN__ #define srandom srand #define random rand @@ -113,6 +107,14 @@ TODO: static char *shared_memory_base_name=0; #endif +/* Global Thread counter */ +uint thread_counter; +pthread_mutex_t counter_mutex; +pthread_cond_t count_threshhold; +uint master_wakeup; +pthread_mutex_t sleeper_mutex; +pthread_cond_t sleep_threshhold; + static char **defaults_argv; char **primary_keys; @@ -127,15 +129,10 @@ const char *delimiter= "\n"; const char *create_schema_string= "mysqlslap"; -const char *lock_directory; -char lock_file_str[FN_REFLEN]; - static my_bool opt_preserve; static my_bool opt_only_print= FALSE; -static my_bool opt_slave; - static my_bool opt_compress= FALSE, tty_password= FALSE, opt_silent= FALSE, auto_generate_sql_autoincrement= FALSE, @@ -175,7 +172,6 @@ static uint opt_protocol= 0; static int get_options(int *argc,char ***argv); static uint opt_mysql_port= 0; -static my_bool opt_use_threads; static const char *load_default_groups[]= { "mysqlslap","client",0 }; @@ -213,7 +209,6 @@ typedef struct thread_context thread_context; struct thread_context { statement *stmt; ulonglong limit; - bool thread; }; typedef struct conclusions conclusions; @@ -256,6 +251,7 @@ static int run_scheduler(stats *sptr, statement *stmts, uint concur, int run_task(thread_context *con); void statement_cleanup(statement *stmt); void option_cleanup(option_string *stmt); +void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr); static const char ALPHANUMERICS[]= "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz"; @@ -289,14 +285,8 @@ static int gettimeofday(struct timeval *tp, void *tzp) int main(int argc, char **argv) { MYSQL mysql; - unsigned int x; - unsigned long long client_limit; option_string *eptr; -#ifdef __WIN__ - opt_use_threads= 1; -#endif - MY_INIT(argv[0]); load_defaults("my",load_default_groups,&argc,&argv); @@ -352,75 +342,33 @@ int main(int argc, char **argv) } } + VOID(pthread_mutex_init(&counter_mutex, NULL)); + VOID(pthread_cond_init(&count_threshhold, NULL)); + VOID(pthread_mutex_init(&sleeper_mutex, NULL)); + VOID(pthread_cond_init(&sleep_threshhold, NULL)); + /* Main iterations loop */ eptr= engine_options; do { /* For the final stage we run whatever queries we were asked to run */ uint *current; - conclusions conclusion; if (verbose >= 2) printf("Starting Concurrency Test\n"); - for (current= concurrency; current && *current; current++) + if (*concurrency) { - stats *head_sptr; - stats *sptr; - - head_sptr= (stats *)my_malloc(sizeof(stats) * iterations, - MYF(MY_ZEROFILL|MY_FAE|MY_WME)); - - bzero(&conclusion, sizeof(conclusions)); - - if (auto_actual_queries) - client_limit= auto_actual_queries; - else if (num_of_query) - client_limit= num_of_query / *current; - else - client_limit= actual_queries; - - for (x= 0, sptr= head_sptr; x < iterations; x++, sptr++) - { - /* - We might not want to load any data, such as when we are calling - a stored_procedure that doesn't use data, or we know we already have - data in the table. - */ - if (!opt_preserve) - drop_schema(&mysql, create_schema_string); - - /* First we create */ - if (create_statements) - create_schema(&mysql, create_schema_string, create_statements, eptr); - - /* - If we generated GUID we need to build a list of them from creation that - we can later use. - */ - if (verbose >= 2) - printf("Generating primary key list\n"); - if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) - generate_primary_key_list(&mysql, eptr); - - run_scheduler(sptr, query_statements, *current, client_limit); - - /* We are finished with this run */ - if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) - drop_primary_key_list(); + for (current= concurrency; current && *current; current++) + concurrency_loop(&mysql, *current, eptr); + } + else + { + uint infinite= 1; + do { + concurrency_loop(&mysql, infinite, eptr); } - - if (verbose >= 2) - printf("Generating stats\n"); - - generate_stats(&conclusion, eptr, head_sptr); - - if (!opt_silent) - print_conclusions(&conclusion); - if (opt_csv_str) - print_conclusions_csv(&conclusion); - - my_free((gptr)head_sptr, MYF(0)); + while (infinite++); } if (!opt_preserve) @@ -428,13 +376,14 @@ int main(int argc, char **argv) } while (eptr ? (eptr= eptr->next) : 0); + VOID(pthread_mutex_destroy(&counter_mutex)); + VOID(pthread_cond_destroy(&count_threshhold)); + VOID(pthread_mutex_destroy(&sleeper_mutex)); + VOID(pthread_cond_destroy(&sleep_threshhold)); + if (!opt_only_print) mysql_close(&mysql); /* Close & free connection */ - - /* Remove lock file */ - my_delete(lock_file_str, MYF(0)); - /* now free all the strings we created */ if (opt_password) my_free((gptr)opt_password, MYF(0)); @@ -455,6 +404,70 @@ int main(int argc, char **argv) return 0; } +void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr) +{ + unsigned int x; + stats *head_sptr; + stats *sptr; + conclusions conclusion; + unsigned long long client_limit; + + head_sptr= (stats *)my_malloc(sizeof(stats) * iterations, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + + bzero(&conclusion, sizeof(conclusions)); + + if (auto_actual_queries) + client_limit= auto_actual_queries; + else if (num_of_query) + client_limit= num_of_query / current; + else + client_limit= actual_queries; + + for (x= 0, sptr= head_sptr; x < iterations; x++, sptr++) + { + /* + We might not want to load any data, such as when we are calling + a stored_procedure that doesn't use data, or we know we already have + data in the table. + */ + if (!opt_preserve) + drop_schema(mysql, create_schema_string); + + /* First we create */ + if (create_statements) + create_schema(mysql, create_schema_string, create_statements, eptr); + + /* + If we generated GUID we need to build a list of them from creation that + we can later use. + */ + if (verbose >= 2) + printf("Generating primary key list\n"); + if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) + generate_primary_key_list(mysql, eptr); + + run_scheduler(sptr, query_statements, current, client_limit); + + /* We are finished with this run */ + if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) + drop_primary_key_list(); + } + + if (verbose >= 2) + printf("Generating stats\n"); + + generate_stats(&conclusion, eptr, head_sptr); + + if (!opt_silent) + print_conclusions(&conclusion); + if (opt_csv_str) + print_conclusions_csv(&conclusion); + + my_free((gptr)head_sptr, MYF(0)); + +} + static struct my_option my_long_options[] = { @@ -534,9 +547,6 @@ static struct my_option my_long_options[] = REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"iterations", 'i', "Number of times too run the tests.", (gptr*) &iterations, (gptr*) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, - {"lock-directory", OPT_MYSQL_LOCK_DIRECTORY, "Directory to use to keep locks.", - (gptr*) &lock_directory, (gptr*) &lock_directory, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"number-char-cols", 'x', "Number of VARCHAR columns to create table with if specifying --auto-generate-sql ", (gptr*) &num_char_cols_opt, (gptr*) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, @@ -584,17 +594,10 @@ static struct my_option my_long_options[] = {"silent", 's', "Run program in silent mode - no output.", (gptr*) &opt_silent, (gptr*) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"slave", OPT_MYSQL_SLAP_SLAVE, "Follow master locks for other slap clients", - (gptr*) &opt_slave, (gptr*) &opt_slave, 0, GET_BOOL, NO_ARG, - 0, 0, 0, 0, 0, 0}, {"socket", 'S', "Socket file to use for connection.", (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include - {"use-threads", OPT_USE_THREADS, - "Use pthread calls instead of fork() calls (default on Windows)", - (gptr*) &opt_use_threads, (gptr*) &opt_use_threads, 0, - GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE {"user", 'u', "User for login if not current user.", (gptr*) &user, (gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -1126,11 +1129,6 @@ get_options(int *argc,char ***argv) parse_comma(concurrency_str ? concurrency_str : "1", &concurrency); - if (lock_directory) - snprintf(lock_file_str, FN_REFLEN, "%s/%s", lock_directory, MYSLAPLOCK); - else - snprintf(lock_file_str, FN_REFLEN, "%s/%s", MYSLAPLOCK_DIR, MYSLAPLOCK); - if (opt_csv_str) { opt_silent= TRUE; @@ -1553,136 +1551,63 @@ drop_schema(MYSQL *mysql, const char *db) static int run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) { -#ifndef __WIN__ uint x; -#endif - File lock_file; struct timeval start_time, end_time; thread_context con; DBUG_ENTER("run_scheduler"); con.stmt= stmts; con.limit= limit; - con.thread= opt_use_threads ? 1 :0; - lock_file= my_open(lock_file_str, O_CREAT|O_WRONLY|O_TRUNC, MYF(0)); + pthread_t mainthread; /* Thread descriptor */ + pthread_attr_t attr; /* Thread attributes */ - if (!opt_slave) - if (my_lock(lock_file, F_WRLCK, 0, F_TO_EOF, MYF(0))) + pthread_mutex_lock(&counter_mutex); + thread_counter= 0; + + pthread_mutex_lock(&sleeper_mutex); + master_wakeup= 1; + pthread_mutex_unlock(&sleeper_mutex); + for (x= 0; x < concur; x++) + { + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, + PTHREAD_CREATE_DETACHED); + + /* now create the thread */ + if (pthread_create(&mainthread, &attr, (void *)run_task, + (void *)&con) != 0) { - fprintf(stderr,"%s: Could not get lockfile\n", + fprintf(stderr,"%s: Could not create thread\n", my_progname); exit(0); } - -#ifdef HAVE_LIBPTHREAD - if (opt_use_threads) - { - pthread_t mainthread; /* Thread descriptor */ - pthread_attr_t attr; /* Thread attributes */ - - for (x= 0; x < concur; x++) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, - PTHREAD_CREATE_DETACHED); - - /* now create the thread */ - if (pthread_create(&mainthread, &attr, (void *)run_task, - (void *)&con) != 0) - { - fprintf(stderr,"%s: Could not create thread\n", - my_progname); - exit(0); - } - } + thread_counter++; } -#endif -#if !(defined(__WIN__) || defined(__NETWARE__)) -#ifdef HAVE_LIBPTHREAD - else -#endif - { - fflush(NULL); - for (x= 0; x < concur; x++) - { - int pid; - DBUG_PRINT("info", ("x: %d concurrency: %u", x, *concurrency)); - pid= fork(); - switch(pid) - { - case 0: - /* child */ - DBUG_PRINT("info", ("fork returned 0, calling task(\"%s\"), pid %d gid %d", - stmts ? stmts->string : "", pid, getgid())); - if (verbose >= 3) - printf("%s: fork returned 0, calling task pid %d gid %d\n", - my_progname, pid, getgid()); - run_task(&con); - exit(0); - break; - case -1: - /* error */ - DBUG_PRINT("info", - ("fork returned -1, failing pid %d gid %d", pid, getgid())); - fprintf(stderr, - "%s: Failed on fork: -1, max procs per parent exceeded.\n", - my_progname); - /*exit(1);*/ - goto WAIT; - default: - /* parent, forked */ - DBUG_PRINT("info", ("default, break: pid %d gid %d", pid, getgid())); - if (verbose >= 3) - printf("%s: fork returned %d, gid %d\n", - my_progname, pid, getgid()); - break; - } - } - } -#endif + pthread_mutex_unlock(&counter_mutex); - /* Lets release use some clients! */ - if (!opt_slave) - my_lock(lock_file, F_UNLCK, 0, F_TO_EOF, MYF(0)); + pthread_mutex_lock(&sleeper_mutex); + master_wakeup= 0; + pthread_mutex_unlock(&sleeper_mutex); + pthread_cond_broadcast(&sleep_threshhold); gettimeofday(&start_time, NULL); /* - We look to grab a write lock at this point. Once we get it we know that - all clients have completed their work. + We loop until we know that all children have cleaned up. */ - if (opt_use_threads) + pthread_mutex_lock(&counter_mutex); + while (thread_counter) { - if (my_lock(lock_file, F_WRLCK, 0, F_TO_EOF, MYF(0))) - { - fprintf(stderr,"%s: Could not get lockfile\n", - my_progname); - exit(0); - } - my_lock(lock_file, F_UNLCK, 0, F_TO_EOF, MYF(0)); + struct timespec abstime; + + set_timespec(abstime, 3); + pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime); } -#ifndef __WIN__ - else - { -WAIT: - while (x--) - { - int status, pid; - pid= wait(&status); - DBUG_PRINT("info", ("Parent: child %d status %d", pid, status)); - if (status != 0) - { - printf("%s: Child %d died with the status %d\n", - my_progname, pid, status); - exit(0); - } - } - } -#endif + pthread_mutex_unlock(&counter_mutex); + gettimeofday(&end_time, NULL); - my_close(lock_file, MYF(0)); sptr->timing= timedif(end_time, start_time); sptr->users= concur; @@ -1696,7 +1621,6 @@ int run_task(thread_context *con) { ulonglong counter= 0, queries; - File lock_file= -1; MYSQL *mysql; MYSQL_RES *result; MYSQL_ROW row; @@ -1705,6 +1629,13 @@ run_task(thread_context *con) DBUG_ENTER("run_task"); DBUG_PRINT("info", ("task script \"%s\"", con->stmt ? con->stmt->string : "")); + pthread_mutex_lock(&sleeper_mutex); + while (master_wakeup) + { + pthread_cond_wait(&sleep_threshhold, &sleeper_mutex); + } + pthread_mutex_unlock(&sleeper_mutex); + if (!(mysql= mysql_init(NULL))) { fprintf(stderr,"%s: mysql_init() failed ERROR : %s\n", @@ -1712,7 +1643,7 @@ run_task(thread_context *con) exit(0); } - if (con->thread && mysql_thread_init()) + if (mysql_thread_init()) { fprintf(stderr,"%s: mysql_thread_init() failed ERROR : %s\n", my_progname, mysql_error(mysql)); @@ -1720,8 +1651,7 @@ run_task(thread_context *con) } DBUG_PRINT("info", ("trying to connect to host %s as user %s", host, user)); - lock_file= my_open(lock_file_str, O_RDWR, MYF(0)); - my_lock(lock_file, F_RDLCK, 0, F_TO_EOF, MYF(0)); + if (!opt_only_print) { /* Connect to server */ @@ -1821,17 +1751,16 @@ limit_not_met: end: - if (lock_file != -1) - { - my_lock(lock_file, F_UNLCK, 0, F_TO_EOF, MYF(0)); - my_close(lock_file, MYF(0)); - } - if (!opt_only_print) mysql_close(mysql); - if (con->thread) - my_thread_end(); + my_thread_end(); + + pthread_mutex_lock(&counter_mutex); + thread_counter--; + pthread_cond_signal(&count_threshhold); + pthread_mutex_unlock(&counter_mutex); + DBUG_RETURN(0); } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3e51bee7c8a..ab40f050aa7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1877,8 +1877,7 @@ sub environment_setup () { mtr_native_path($exe_mysqlslap) . " -uroot " . "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'} --password= " . - "--lock-directory=$opt_tmpdir"; + "--socket=$master->[0]->{'path_sock'} --password= "; if ( $opt_debug ) { diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test index f2bb9a72ecf..a40a01f1f25 100644 --- a/mysql-test/t/mysqlslap.test +++ b/mysql-test/t/mysqlslap.test @@ -4,7 +4,7 @@ --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql ---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --use-threads +--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --exec $MYSQL_SLAP --only-print --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";" --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";" From 7d383909db64d10283c1e37a7b45026d5b3b2e3c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Mar 2007 00:13:25 +0100 Subject: [PATCH 188/789] wl#3700 - post-review fixes: s/ulonglong/key_part_map/, comments include/heap.h: wl#3700 - post-review fixes: s/ulonglong/key_part_map/ include/my_base.h: wl#3700 - post-review fixes: s/ulonglong/key_part_map/ include/myisam.h: wl#3700 - post-review fixes: s/ulonglong/key_part_map/ include/myisammrg.h: wl#3700 - post-review fixes: s/ulonglong/key_part_map/ sql/event_db_repository.cc: wl#3700 - post-review fixes: s/ulonglong/key_part_map/ sql/ha_partition.cc: wl#3700 - post-review fixes: s/ulonglong/key_part_map/ sql/ha_partition.h: wl#3700 - post-review fixes: s/ulonglong/key_part_map/ sql/sql_select.h: wl#3700 - post-review fixes: remove tab_to_keypart_map() --- include/heap.h | 4 +- include/my_base.h | 7 ++- include/myisam.h | 2 +- include/myisammrg.h | 2 +- sql/event_db_repository.cc | 4 +- sql/ha_partition.cc | 6 +-- sql/ha_partition.h | 9 ++-- sql/handler.cc | 4 +- sql/handler.h | 29 ++++++++--- sql/item_subselect.cc | 4 +- sql/log_event.cc | 6 +-- sql/mysql_priv.h | 1 - sql/opt_range.cc | 70 +++++++++++---------------- sql/opt_range.h | 29 ++++++----- sql/sp.cc | 4 +- sql/sql_acl.cc | 20 ++++---- sql/sql_handler.cc | 2 +- sql/sql_help.cc | 4 +- sql/sql_insert.cc | 2 +- sql/sql_plugin.cc | 2 +- sql/sql_select.cc | 13 +++-- sql/sql_select.h | 7 +-- sql/sql_servers.cc | 6 +-- sql/sql_udf.cc | 4 +- sql/table.cc | 2 +- sql/table.h | 6 +-- sql/tztime.cc | 8 +-- storage/blackhole/ha_blackhole.cc | 6 +-- storage/blackhole/ha_blackhole.h | 9 ++-- storage/example/ha_example.cc | 2 +- storage/example/ha_example.h | 2 +- storage/heap/ha_heap.cc | 6 +-- storage/heap/ha_heap.h | 6 +-- storage/heap/heapdef.h | 6 +-- storage/heap/hp_hash.c | 14 +++--- storage/heap/hp_rkey.c | 2 +- storage/innobase/handler/ha_innodb.cc | 16 +++--- storage/myisam/ha_myisam.cc | 6 +-- storage/myisam/ha_myisam.h | 6 +-- storage/myisam/mi_check.c | 2 +- storage/myisam/mi_key.c | 4 +- storage/myisam/mi_range.c | 8 +-- storage/myisam/mi_rkey.c | 2 +- storage/myisam/myisamdef.h | 2 +- storage/myisammrg/ha_myisammrg.cc | 6 +-- storage/myisammrg/ha_myisammrg.h | 6 +-- storage/myisammrg/myrg_rkey.c | 2 +- 47 files changed, 187 insertions(+), 183 deletions(-) diff --git a/include/heap.h b/include/heap.h index 33bbd2f0b3f..6cacb7fc529 100644 --- a/include/heap.h +++ b/include/heap.h @@ -225,8 +225,8 @@ extern void heap_update_auto_increment(HP_INFO *info, const byte *record); ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, key_range *max_key); int hp_panic(enum ha_panic_function flag); -int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, - ulonglong keypart_map, enum ha_rkey_function find_flag); +int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, + key_part_map keypart_map, enum ha_rkey_function find_flag); extern gptr heap_find(HP_INFO *info,int inx,const byte *key); extern int heap_check_heap(HP_INFO *info, my_bool print_status); extern byte *heap_position(HP_INFO *info); diff --git a/include/my_base.h b/include/my_base.h index 3aa280d825a..dd21362e8f7 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -395,7 +395,10 @@ enum ha_base_keytype { /* Other constants */ #define HA_NAMELEN 64 /* Max length of saved filename */ -#define NO_SUCH_KEY ((uint)~0) /* used as a key no. */ +#define NO_SUCH_KEY (~(uint)0) /* used as a key no. */ + +typedef ulong key_part_map; +#define HA_WHOLE_KEY (~(key_part_map)0) /* Intern constants in databases */ @@ -469,7 +472,7 @@ typedef struct st_key_range { const byte *key; uint length; - ulonglong keypart_map; + key_part_map keypart_map; enum ha_rkey_function flag; } key_range; diff --git a/include/myisam.h b/include/myisam.h index 1dd8f6f7ec4..b05440e5ae4 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -275,7 +275,7 @@ extern struct st_myisam_info *mi_open(const char *name,int mode, extern int mi_panic(enum ha_panic_function function); extern int mi_rfirst(struct st_myisam_info *file,byte *buf,int inx); extern int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, - ulonglong keypart_map, enum ha_rkey_function search_flag); + key_part_map keypart_map, enum ha_rkey_function search_flag); extern int mi_rlast(struct st_myisam_info *file,byte *buf,int inx); extern int mi_rnext(struct st_myisam_info *file,byte *buf,int inx); extern int mi_rnext_same(struct st_myisam_info *info, byte *buf); diff --git a/include/myisammrg.h b/include/myisammrg.h index 149b72dc7e1..02e81cf806d 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -87,7 +87,7 @@ extern int myrg_rnext(MYRG_INFO *file,byte *buf,int inx); extern int myrg_rprev(MYRG_INFO *file,byte *buf,int inx); extern int myrg_rnext_same(MYRG_INFO *file,byte *buf); extern int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, - ulonglong keypart_map, enum ha_rkey_function search_flag); + key_part_map keypart_map, enum ha_rkey_function search_flag); extern int myrg_rrnd(MYRG_INFO *file,byte *buf,ulonglong pos); extern int myrg_rsame(MYRG_INFO *file,byte *record,int inx); extern int myrg_update(MYRG_INFO *file,const byte *old,byte *new_rec); diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 860cb54e27f..c5d015cdea7 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -288,7 +288,7 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, { key_copy(key_buf, event_table->record[0], key_info, key_len); if (!(ret= event_table->file->index_read(event_table->record[0], key_buf, - (ulonglong)1, HA_READ_PREFIX))) + (key_part_map)1, HA_READ_PREFIX))) { DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret)); do @@ -843,7 +843,7 @@ Event_db_repository::find_named_event(THD *thd, LEX_STRING db, LEX_STRING name, key_copy(key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, key, ~ULL(0), + if (table->file->index_read_idx(table->record[0], 0, key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { DBUG_PRINT("info", ("Row not found")); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 4ed602be54d..d3979fa0718 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3336,7 +3336,7 @@ int ha_partition::index_end() */ int ha_partition::index_read(byte * buf, const byte * key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function find_flag) { DBUG_ENTER("ha_partition::index_read"); @@ -3357,7 +3357,7 @@ int ha_partition::index_read(byte * buf, const byte * key, */ int ha_partition::common_index_read(byte *buf, const byte *key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function find_flag) { int error; @@ -3513,7 +3513,7 @@ int ha_partition::common_first_last(byte *buf) */ int ha_partition::index_read_last(byte *buf, const byte *key, - ulonglong keypart_map) + key_part_map keypart_map) { DBUG_ENTER("ha_partition::index_read_last"); diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 2d43e2b0df2..a081e4bb472 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -384,8 +384,8 @@ public: any end processing needed. */ virtual int index_read(byte * buf, const byte * key, - ulonglong keypart_map, - enum ha_rkey_function find_flag); + key_part_map keypart_map, + enum ha_rkey_function find_flag); virtual int index_init(uint idx, bool sorted); virtual int index_end(); @@ -399,7 +399,7 @@ public: virtual int index_last(byte * buf); virtual int index_next_same(byte * buf, const byte * key, uint keylen); virtual int index_read_last(byte * buf, const byte * key, - ulonglong keypart_map); + key_part_map keypart_map); /* read_first_row is virtual method but is only implemented by @@ -425,7 +425,8 @@ public: private: int common_index_read(byte * buf, const byte * key, - ulonglong keypart_map, enum ha_rkey_function find_flag); + key_part_map keypart_map, + enum ha_rkey_function find_flag); int common_first_last(byte * buf); int partition_scan_set_up(byte * buf, bool idx_read_flag); int handle_unordered_next(byte * buf, bool next_same); diff --git a/sql/handler.cc b/sql/handler.cc index 7d3edf36162..6df8a4a5021 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3282,8 +3282,8 @@ int handler::compare_key(key_range *range) int handler::index_read_idx(byte * buf, uint index, const byte * key, - ulonglong keypart_map, - enum ha_rkey_function find_flag) + key_part_map keypart_map, + enum ha_rkey_function find_flag) { int error, error1; error= index_init(index, 0); diff --git a/sql/handler.h b/sql/handler.h index 1d02d6a7ee3..0158cbad515 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -867,17 +867,17 @@ public: {} }; -uint calculate_key_len(TABLE *, uint, const byte *, ulonglong); +uint calculate_key_len(TABLE *, uint, const byte *, key_part_map); /* bitmap with first N+1 bits set (keypart_map for a key prefix of [0..N] keyparts) */ -#define make_keypart_map(N) (((ulonglong)2 << (N)) - 1) +#define make_keypart_map(N) (((key_part_map)2 << (N)) - 1) /* bitmap with first N bits set (keypart_map for a key prefix of [0..N-1] keyparts) */ -#define make_prev_keypart_map(N) (((ulonglong)1 << (N)) - 1) +#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1) /* The handler class is the interface for dynamically loadable @@ -1219,14 +1219,26 @@ public: enum ha_rkey_function find_flag) { return HA_ERR_WRONG_COMMAND; } public: - virtual int index_read(byte * buf, const byte * key, ulonglong keypart_map, +/** + @brief + Positions an index cursor to the index specified in the handle. Fetches the + row if available. If the key value is null, begin at the first key of the + index. +*/ + virtual int index_read(byte * buf, const byte * key, key_part_map keypart_map, enum ha_rkey_function find_flag) { uint key_len= calculate_key_len(table, active_index, key, keypart_map); return index_read(buf, key, key_len, find_flag); } +/** + @brief + Positions an index cursor to the index specified in the handle. Fetches the + row if available. If the key value is null, begin at the first key of the + index. +*/ virtual int index_read_idx(byte * buf, uint index, const byte * key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function find_flag); virtual int index_next(byte * buf) { return HA_ERR_WRONG_COMMAND; } @@ -1241,8 +1253,13 @@ public: virtual int index_read_last(byte * buf, const byte * key, uint key_len) { return (my_errno=HA_ERR_WRONG_COMMAND); } public: +/** + @brief + The following functions works like index_read, but it find the last + row with the current key value or prefix. +*/ virtual int index_read_last(byte * buf, const byte * key, - ulonglong keypart_map) + key_part_map keypart_map) { uint key_len= calculate_key_len(table, active_index, key, keypart_map); return index_read_last(buf, key, key_len); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index d9141cc0740..e1abda2f612 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -2045,7 +2045,7 @@ int subselect_uniquesubquery_engine::exec() table->file->ha_index_init(tab->ref.key, 0); error= table->file->index_read(table->record[0], tab->ref.key_buff, - tab_to_keypart_map(tab), + make_prev_keypart_map(tab->ref.key_parts), HA_READ_KEY_EXACT); if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) @@ -2155,7 +2155,7 @@ int subselect_indexsubquery_engine::exec() table->file->ha_index_init(tab->ref.key, 1); error= table->file->index_read(table->record[0], tab->ref.key_buff, - tab_to_keypart_map(tab), + make_prev_keypart_map(tab->ref.key_parts), HA_READ_KEY_EXACT); if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) diff --git a/sql/log_event.cc b/sql/log_event.cc index 5ff23a49252..0448aacd4f3 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6855,7 +6855,7 @@ replace_record(THD *thd, TABLE *table, key_copy((byte*)key.get(), table->record[0], table->key_info + keynum, 0); error= table->file->index_read_idx(table->record[1], keynum, - (const byte*)key.get(), ~ULL(0), + (const byte*)key.get(), HA_WHOLE_KEY, HA_READ_KEY_EXACT); if (error) DBUG_RETURN(error); @@ -7039,8 +7039,8 @@ static int find_and_fetch_row(TABLE *table, byte *key) my_ptrdiff_t const pos= table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; table->record[1][pos]= 0xFF; - if ((error= table->file->index_read(table->record[1], key, - ~(ulonglong)0, HA_READ_KEY_EXACT))) + if ((error= table->file->index_read(table->record[1], key, HA_WHOLE_KEY, + HA_READ_KEY_EXACT))) { table->file->print_error(error, MYF(0)); table->file->ha_index_end(); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1852e74a333..099c9b98c1f 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -47,7 +47,6 @@ typedef Bitmap<64> key_map; /* Used for finding keys */ #else typedef Bitmap<((MAX_INDEXES+7)/8*8)> key_map; /* Used for finding keys */ #endif -typedef ulong key_part_map; /* Used for finding key parts */ typedef ulong nesting_map; /* Used for flags of nesting constructs */ /* Used to identify NESTED_JOIN structures within a join (applicable only to diff --git a/sql/opt_range.cc b/sql/opt_range.cc index d95eb1c3553..52faaf25b42 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -312,6 +312,7 @@ public: min_value=arg->max_value; min_flag=arg->max_flag & NEAR_MAX ? 0 : NEAR_MIN; } + /* returns a number of keypart values (0 or 1) appended to the key buffer */ int store_min(uint length,char **min_key,uint min_key_flag) { if ((min_flag & GEOM_FLAG) || @@ -330,6 +331,7 @@ public: } return 0; } + /* returns a number of keypart values (0 or 1) appended to the key buffer */ int store_max(uint length,char **max_key, uint max_key_flag) { if (!(max_flag & NO_MAX_RANGE) && @@ -347,13 +349,8 @@ public: } return 0; } - /*void store(uint length,char **min_key,uint min_key_flag, - char **max_key, uint max_key_flag) - { - store_min(length, min_key, min_key_flag); - store_max(length, max_key, max_key_flag); - }*/ + /* returns a number of keypart values appended to the key buffer */ int store_min_key(KEY_PART *key,char **range_key, uint *range_key_flag) { SEL_ARG *key_tree= first(); @@ -369,6 +366,7 @@ public: return res; } + /* returns a number of keypart values appended to the key buffer */ int store_max_key(KEY_PART *key,char **range_key, uint *range_key_flag) { SEL_ARG *key_tree= last(); @@ -595,7 +593,7 @@ static SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param,COND *cond_func,Field *field, static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond); static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts); -static ha_rows check_quick_select(PARAM *param,uint index,SEL_ARG *key_tree, +static ha_rows check_quick_select(PARAM *param,uint index,SEL_ARG *key_tree, bool update_tbl_stats); static ha_rows check_quick_keys(PARAM *param,uint index,SEL_ARG *key_tree, char *min_key, uint min_key_flag, int, @@ -4075,7 +4073,7 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info, byte key_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH]; /* key values tuple */ char *key_ptr= (char*) key_val; SEL_ARG *sel_arg, *tuple_arg= NULL; - ulonglong keypart_map= 0; + key_part_map keypart_map= 0; bool cur_covered; bool prev_covered= test(bitmap_is_set(&info->covered_fields, key_part->fieldnr-1)); @@ -7457,7 +7455,8 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, { QUICK_RANGE *range; uint flag; - int min_part= key_tree->part-1, max_part=key_tree->part-1; + int min_part= key_tree->part-1, // # of keypart values in min_key buffer + max_part= key_tree->part-1; // # of keypart values in max_key buffer if (key_tree->left != &null_element) { @@ -7488,15 +7487,11 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, { uint tmp_min_flag=key_tree->min_flag,tmp_max_flag=key_tree->max_flag; if (!tmp_min_flag) - { min_part+= key_tree->next_key_part->store_min_key(key, &tmp_min_key, &tmp_min_flag); - } if (!tmp_max_flag) - { max_part+= key_tree->next_key_part->store_max_key(key, &tmp_max_key, &tmp_max_flag); - } flag=tmp_min_flag | tmp_max_flag; } } @@ -7652,13 +7647,13 @@ bool QUICK_ROR_UNION_SELECT::is_keys_used(const MY_BITMAP *fields) thd Thread handle table Table to access ref ref[_or_null] scan parameters - records Estimate of number of records (needed only to construct + records Estimate of number of records (needed only to construct quick select) NOTES This allocates things in a new memory root, as this may be called many times during a query. - - RETURN + + RETURN Quick select that retrieves the same rows as passed ref scan NULL on error. */ @@ -7694,9 +7689,10 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, !(range= new(alloc) QUICK_RANGE())) goto err; // out of memory - range->min_key=range->max_key=(char*) ref->key_buff; - range->min_length=range->max_length=ref->key_length; - range->min_keypart_map= range->max_keypart_map= (1 << ref->key_parts) - 1; + range->min_key= range->max_key= (char*) ref->key_buff; + range->min_length= range->max_length= ref->key_length; + range->min_keypart_map= range->max_keypart_map= + make_prev_keypart_map(ref->key_parts); range->flag= ((ref->key_length == key_info->key_length && (key_info->flags & (HA_NOSAME | HA_END_SPACE_KEY)) == HA_NOSAME) ? EQ_RANGE : 0); @@ -7709,7 +7705,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, { key_part->part=part; key_part->field= key_info->key_part[part].field; - key_part->length= key_info->key_part[part].length; + key_part->length= key_info->key_part[part].length; key_part->store_length= key_info->key_part[part].store_length; key_part->null_bit= key_info->key_part[part].null_bit; key_part->flag= (uint8) key_info->key_part[part].key_part_flag; @@ -7728,13 +7724,11 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, QUICK_RANGE *null_range; *ref->null_ref_key= 1; // Set null byte then create a range - if (!(null_range= new (alloc) QUICK_RANGE((char*)ref->key_buff, - ref->key_length, - (1 << ref->key_parts) - 1, - (char*)ref->key_buff, - ref->key_length, - (1 << ref->key_parts) - 1, - EQ_RANGE))) + if (!(null_range= new (alloc) + QUICK_RANGE((char*)ref->key_buff, ref->key_length, + make_prev_keypart_map(ref->key_parts), + (char*)ref->key_buff, ref->key_length, + make_prev_keypart_map(ref->key_parts), EQ_RANGE))) goto err; *ref->null_ref_key= 0; // Clear null byte if (insert_dynamic(&quick->ranges,(gptr)&null_range)) @@ -8246,7 +8240,7 @@ end: */ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, - ulonglong keypart_map, + key_part_map keypart_map, byte *cur_prefix) { DBUG_ENTER("QUICK_RANGE_SELECT::get_next_prefix"); @@ -10502,7 +10496,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix() { byte *cur_prefix= seen_first_key ? group_prefix : NULL; if ((result= quick_prefix_select->get_next_prefix(group_prefix_len, - (ULL(1) << group_key_parts) - 1, cur_prefix))) + make_prev_keypart_map(group_key_parts), cur_prefix))) DBUG_RETURN(result); seen_first_key= TRUE; } @@ -10561,8 +10555,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix() int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() { ha_rkey_function find_flag; - uint search_prefix_len; - ulonglong keypart_map; + key_part_map keypart_map; QUICK_RANGE *cur_range; bool found_null= FALSE; int result= HA_ERR_KEY_NOT_FOUND; @@ -10584,8 +10577,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() if (cur_range->flag & NO_MIN_RANGE) { - search_prefix_len= real_prefix_len; - keypart_map= (ULL(1) << real_key_parts) - 1; + keypart_map= make_prev_keypart_map(real_key_parts); find_flag= HA_READ_KEY_EXACT; } else @@ -10593,8 +10585,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() /* Extend the search key with the lower boundary for this range. */ memcpy(group_prefix + real_prefix_len, cur_range->min_key, cur_range->min_length); - search_prefix_len= real_prefix_len + min_max_arg_len; - keypart_map= (ULL(2) << real_key_parts) - 1; + keypart_map= make_keypart_map(real_key_parts); find_flag= (cur_range->flag & (EQ_RANGE | NULL_RANGE)) ? HA_READ_KEY_EXACT : (cur_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : HA_READ_KEY_OR_NEXT; @@ -10697,8 +10688,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range() int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range() { ha_rkey_function find_flag; - uint search_prefix_len; - ulonglong keypart_map; + key_part_map keypart_map; QUICK_RANGE *cur_range; int result; @@ -10720,8 +10710,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range() if (cur_range->flag & NO_MAX_RANGE) { - search_prefix_len= real_prefix_len; - keypart_map= (ULL(1) << real_key_parts) - 1; + keypart_map= make_prev_keypart_map(real_key_parts); find_flag= HA_READ_PREFIX_LAST; } else @@ -10729,8 +10718,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range() /* Extend the search key with the upper boundary for this range. */ memcpy(group_prefix + real_prefix_len, cur_range->max_key, cur_range->max_length); - search_prefix_len= real_prefix_len + min_max_arg_len; - keypart_map= (ULL(2) << real_key_parts) - 1; + keypart_map= make_keypart_map(real_key_parts); find_flag= (cur_range->flag & EQ_RANGE) ? HA_READ_KEY_EXACT : (cur_range->flag & NEAR_MAX) ? HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV; diff --git a/sql/opt_range.h b/sql/opt_range.h index ce98b4609d1..1ad9567cddd 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -37,15 +37,16 @@ class QUICK_RANGE :public Sql_alloc { public: char *min_key,*max_key; uint16 min_length,max_length,flag; - ulonglong min_keypart_map, max_keypart_map; + key_part_map min_keypart_map, // bitmap of used keyparts in min_key + max_keypart_map; // bitmap of used keyparts in max_key #ifdef HAVE_purify uint16 dummy; /* Avoid warnings on 'flag' */ #endif QUICK_RANGE(); /* Full range */ QUICK_RANGE(const char *min_key_arg, uint min_length_arg, - ulonglong min_keypart_map_arg, + key_part_map min_keypart_map_arg, const char *max_key_arg, uint max_length_arg, - ulonglong max_keypart_map_arg, + key_part_map max_keypart_map_arg, uint flag_arg) : min_key((char*) sql_memdup(min_key_arg,min_length_arg+1)), max_key((char*) sql_memdup(max_key_arg,max_length_arg+1)), @@ -65,11 +66,11 @@ class QUICK_RANGE :public Sql_alloc { /* Quick select interface. This class is a parent for all QUICK_*_SELECT and FT_SELECT classes. - + The usage scenario is as follows: 1. Create quick select quick= new QUICK_XXX_SELECT(...); - + 2. Perform lightweight initialization. This can be done in 2 ways: 2.a: Regular initialization if (quick->init()) @@ -80,29 +81,29 @@ class QUICK_RANGE :public Sql_alloc { 2.b: Special initialization for quick selects merged by QUICK_ROR_*_SELECT if (quick->init_ror_merged_scan()) delete quick; - + 3. Perform zero, one, or more scans. while (...) { // initialize quick select for scan. This may allocate - // buffers and/or prefetch rows. + // buffers and/or prefetch rows. if (quick->reset()) { //the only valid action after failed reset() call is delete delete quick; //abort query } - + // perform the scan do { res= quick->get_next(); } while (res && ...) } - + 4. Delete the select: delete quick; - + */ class QUICK_SELECT_I @@ -128,6 +129,8 @@ public: Max. number of (first) key parts this quick select uses for retrieval. eg. for "(key1p1=c1 AND key1p2=c2) OR key1p1=c2" used_key_parts == 2. Applicable if index!= MAX_KEY. + + For QUICK_GROUP_MIN_MAX_SELECT it includes MIN/MAX argument keyparts. */ uint used_key_parts; @@ -323,7 +326,7 @@ public: int reset(void); int get_next(); void range_end(); - int get_next_prefix(uint prefix_length, ulonglong keypart_map, + int get_next_prefix(uint prefix_length, key_part_map keypart_map, byte *cur_prefix); bool reverse_sorted() { return 0; } bool unique_key_range(); @@ -611,7 +614,7 @@ private: byte *tmp_record; /* Temporary storage for next_min(), next_max(). */ byte *group_prefix; /* Key prefix consisting of the GROUP fields. */ uint group_prefix_len; /* Length of the group prefix. */ - uint group_key_parts; + uint group_key_parts; /* A number of keyparts in the group prefix */ byte *last_prefix; /* Prefix of the last group for detecting EOF. */ bool have_min; /* Specify whether we are computing */ bool have_max; /* a MIN, a MAX, or both. */ @@ -623,7 +626,7 @@ private: uint key_infix_len; DYNAMIC_ARRAY min_max_ranges; /* Array of range ptrs for the MIN/MAX field. */ uint real_prefix_len; /* Length of key prefix extended with key_infix. */ - uint real_key_parts; + uint real_key_parts; /* A number of keyparts in the above value. */ List *min_functions; List *max_functions; List_iterator *min_functions_it; diff --git a/sql/sp.cc b/sql/sp.cc index 27b3b2532c3..eef5dc01912 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -218,7 +218,7 @@ db_find_routine_aux(THD *thd, int type, sp_name *name, TABLE *table) key_copy(key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, key, ~ULL(0), + if (table->file->index_read_idx(table->record[0], 0, key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) DBUG_RETURN(SP_KEY_NOT_FOUND); @@ -924,7 +924,7 @@ sp_drop_db_routines(THD *thd, char *db) table->file->ha_index_init(0, 1); if (! table->file->index_read(table->record[0], (byte *)table->field[MYSQL_PROC_FIELD_DB]->ptr, - (ulonglong)1, HA_READ_KEY_EXACT)) + (key_part_map)1, HA_READ_KEY_EXACT)) { int nxtres; bool deleted= FALSE; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 2b642689281..aaa88071173 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1813,7 +1813,7 @@ static bool update_user_table(THD *thd, TABLE *table, table->key_info->key_length); if (table->file->index_read_idx(table->record[0], 0, - (byte *) user_key, ~ULL(0), + (byte *) user_key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { my_message(ER_PASSWORD_NO_MATCH, ER(ER_PASSWORD_NO_MATCH), @@ -1904,7 +1904,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, user_key, ~ULL(0), + if (table->file->index_read_idx(table->record[0], 0, user_key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { /* what == 'N' means revoke */ @@ -2121,7 +2121,7 @@ static int replace_db_table(TABLE *table, const char *db, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0],0, user_key, ~ULL(0), + if (table->file->index_read_idx(table->record[0],0, user_key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { if (what == 'N') @@ -2339,7 +2339,7 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs) col_privs->file->ha_index_init(0, 1); if (col_privs->file->index_read(col_privs->record[0], (byte*) key, - (ulonglong)15, HA_READ_KEY_EXACT)) + (key_part_map)15, HA_READ_KEY_EXACT)) { cols = 0; /* purecov: deadcode */ col_privs->file->ha_index_end(); @@ -2501,7 +2501,7 @@ static int replace_column_table(GRANT_TABLE *g_t, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read(table->record[0], user_key, ~(ulonglong)0, + if (table->file->index_read(table->record[0], user_key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { if (revoke_grant) @@ -2577,7 +2577,7 @@ static int replace_column_table(GRANT_TABLE *g_t, key_copy(user_key, table->record[0], table->key_info, key_prefix_length); - if (table->file->index_read(table->record[0], user_key, (ulonglong)15, + if (table->file->index_read(table->record[0], user_key, (key_part_map)15, HA_READ_KEY_EXACT)) goto end; @@ -2678,7 +2678,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, key_copy(user_key, table->record[0], table->key_info, table->key_info->key_length); - if (table->file->index_read_idx(table->record[0], 0, user_key, ~ULL(0), + if (table->file->index_read_idx(table->record[0], 0, user_key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { /* @@ -2796,13 +2796,13 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name, table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); table->field[3]->store(routine_name,(uint) strlen(routine_name), &my_charset_latin1); - table->field[4]->store((longlong)(is_proc ? + table->field[4]->store((longlong)(is_proc ? TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION), TRUE); store_record(table,record[1]); // store at pos 1 if (table->file->index_read_idx(table->record[0], 0, - (byte*) table->field[0]->ptr, ~ULL(0), + (byte*) table->field[0]->ptr, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { /* @@ -5001,7 +5001,7 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop, key_copy(user_key, table->record[0], table->key_info, key_prefix_length); if ((error= table->file->index_read_idx(table->record[0], 0, - user_key, ULL(3), + user_key, (key_part_map)3, HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 9c6c98cb151..cd87330cedb 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -515,7 +515,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, } List_iterator it_ke(*key_expr); Item *item; - ulonglong keypart_map; + key_part_map keypart_map; for (keypart_map= key_len=0 ; (item=it_ke++) ; key_part++) { my_bitmap_map *old_map; diff --git a/sql/sql_help.cc b/sql/sql_help.cc index aacfd8f8245..b677111c019 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -295,7 +295,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, rkey_id->store((longlong) key_id, TRUE); rkey_id->get_key_image(buff, rkey_id->pack_length(), Field::itRAW); int key_res= relations->file->index_read(relations->record[0], - (byte *) buff, (ulonglong)1, + (byte *) buff, (key_part_map)1, HA_READ_KEY_EXACT); for ( ; @@ -309,7 +309,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, field->get_key_image(topic_id_buff, field->pack_length(), Field::itRAW); if (!topics->file->index_read(topics->record[0], (byte *)topic_id_buff, - (ulonglong)1, HA_READ_KEY_EXACT)) + (key_part_map)1, HA_READ_KEY_EXACT)) { memorize_variant_topic(thd,topics,count,find_fields, names,name,description,example); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 62c4e32409b..e973180eef7 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1214,7 +1214,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) } key_copy((byte*) key,table->record[0],table->key_info+key_nr,0); if ((error=(table->file->index_read_idx(table->record[1],key_nr, - (byte*) key, ~ULL(0), + (byte*) key, HA_WHOLE_KEY, HA_READ_KEY_EXACT)))) goto err; } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index d7ced748394..70bc9ef23d5 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -943,7 +943,7 @@ my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) table->use_all_columns(); table->field[0]->store(name->str, name->length, system_charset_info); if (! table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, ~ULL(0), + (byte *)table->field[0]->ptr, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { int error; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8661503df8e..8184b2a732e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -10980,7 +10980,7 @@ int safe_index_read(JOIN_TAB *tab) TABLE *table= tab->table; if ((error=table->file->index_read(table->record[0], tab->ref.key_buff, - tab_to_keypart_map(tab), + make_prev_keypart_map(tab->ref.key_parts), HA_READ_KEY_EXACT))) return report_error(table, error); return 0; @@ -11119,7 +11119,7 @@ join_read_const(JOIN_TAB *tab) { error=table->file->index_read_idx(table->record[0],tab->ref.key, (byte*) tab->ref.key_buff, - tab_to_keypart_map(tab), + make_prev_keypart_map(tab->ref.key_parts), HA_READ_KEY_EXACT); } if (error) @@ -11163,7 +11163,7 @@ join_read_key(JOIN_TAB *tab) } error=table->file->index_read(table->record[0], tab->ref.key_buff, - tab_to_keypart_map(tab), + make_prev_keypart_map(tab->ref.key_parts), HA_READ_KEY_EXACT); if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) return report_error(table, error); @@ -11192,7 +11192,7 @@ join_read_always_key(JOIN_TAB *tab) return -1; if ((error=table->file->index_read(table->record[0], tab->ref.key_buff, - tab_to_keypart_map(tab), + make_prev_keypart_map(tab->ref.key_parts), HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) @@ -11219,8 +11219,7 @@ join_read_last_key(JOIN_TAB *tab) if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref)) return -1; if ((error=table->file->index_read_last(table->record[0], - tab->ref.key_buff, - tab_to_keypart_map(tab)))) + tab->ref.key_buff, make_prev_keypart_map(tab->ref.key_parts)))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) return report_error(table, error); @@ -11761,7 +11760,7 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), group->buff[-1]= (char) group->field->is_null(); } if (!table->file->index_read(table->record[1], - join->tmp_table_param.group_buff, ~(ulonglong)0, + join->tmp_table_param.group_buff, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { /* Update old record */ restore_record(table,record[1]); diff --git a/sql/sql_select.h b/sql/sql_select.h index e31fe143573..ca93179f9d9 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -192,7 +192,7 @@ typedef struct st_join_table { JOIN *join; /* Bitmap of nested joins this table is part of */ nested_join_map embedding_map; - + void cleanup(); inline bool is_using_loose_index_scan() { @@ -202,11 +202,6 @@ typedef struct st_join_table { } } JOIN_TAB; -static inline ulonglong tab_to_keypart_map(JOIN_TAB *tab) -{ - return (ULL(1) << tab->ref.key_parts) - 1; -} - enum_nested_loop_state sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool end_of_records); enum_nested_loop_state sub_select(JOIN *join,JOIN_TAB *join_tab, bool diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 1d7c8d5272d..7b3b71cdd9a 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -354,7 +354,7 @@ my_bool server_exists_in_table(THD *thd, LEX_SERVER_OPTIONS *server_options) system_charset_info); if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, ~(ulonglong)0, + (byte *)table->field[0]->ptr, HA_WHOLE_KEY, HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) @@ -554,7 +554,7 @@ int insert_server_record(TABLE *table, FOREIGN_SERVER *server) /* read index until record is that specified in server_name */ if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, ~(longlong)0, + (byte *)table->field[0]->ptr, HA_WHOLE_KEY, HA_READ_KEY_EXACT))) { /* if not found, err */ @@ -926,7 +926,7 @@ int delete_server_record(TABLE *table, table->field[0]->store(server_name, server_name_length, system_charset_info); if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, ~(ulonglong)0, + (byte *)table->field[0]->ptr, HA_WHOLE_KEY, HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index b0e7831465a..4c584bff72a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -514,7 +514,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) table->use_all_columns(); table->field[0]->store(exact_name_str, exact_name_len, &my_charset_bin); if (!table->file->index_read_idx(table->record[0], 0, - (byte*) table->field[0]->ptr, ~ULL(0), + (byte*) table->field[0]->ptr, HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { int error; @@ -523,7 +523,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) } close_thread_tables(thd); - rw_unlock(&THR_LOCK_udf); + rw_unlock(&THR_LOCK_udf); DBUG_RETURN(0); err: rw_unlock(&THR_LOCK_udf); diff --git a/sql/table.cc b/sql/table.cc index e4b3be5dbe0..f2bf25e6a75 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2250,7 +2250,7 @@ char *get_field(MEM_ROOT *mem, Field *field) that are present in this value, returns the length of the value */ uint calculate_key_len(TABLE *table, uint key, const byte *buf, - ulonglong keypart_map) + key_part_map keypart_map) { /* works only with key prefixes */ DBUG_ASSERT(((keypart_map + 1) & keypart_map) == 0); diff --git a/sql/table.h b/sql/table.h index d15929e8cba..aa053f207b3 100644 --- a/sql/table.h +++ b/sql/table.h @@ -197,9 +197,9 @@ typedef struct st_table_share uint rowid_field_offset; /* Field_nr +1 to rowid field */ /* Index of auto-updated TIMESTAMP field in field array */ uint primary_key; - uint next_number_index; - uint next_number_key_offset; - uint next_number_keypart; + uint next_number_index; /* autoincrement key number */ + uint next_number_key_offset; /* autoinc keypart offset in a key */ + uint next_number_keypart; /* autoinc keypart number in a key */ uint error, open_errno, errarg; /* error from open_table_def() */ uint column_bitmap_size; uchar frm_version; diff --git a/sql/tztime.cc b/sql/tztime.cc index b9f757faeb8..18161022dc3 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1917,7 +1917,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) (void)table->file->ha_index_init(0, 1); if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - ~(ulonglong)0, HA_READ_KEY_EXACT)) + HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { #ifdef EXTRA_DEBUG /* @@ -1945,7 +1945,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) (void)table->file->ha_index_init(0, 1); if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - ~(ulonglong)0, HA_READ_KEY_EXACT)) + HA_WHOLE_KEY, HA_READ_KEY_EXACT)) { sql_print_error("Can't find description of time zone '%u'", tzid); goto end; @@ -1973,7 +1973,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) (void)table->file->ha_index_init(0, 1); res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - (ulonglong)1, HA_READ_KEY_EXACT); + (key_part_map)1, HA_READ_KEY_EXACT); while (!res) { ttid= (uint)table->field[1]->val_int(); @@ -2045,7 +2045,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) (void)table->file->ha_index_init(0, 1); res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, - (ulonglong)1, HA_READ_KEY_EXACT); + (key_part_map)1, HA_READ_KEY_EXACT); while (!res) { ttime= (my_time_t)table->field[1]->val_int(); diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc index d7e56f91af4..6f07c4183f1 100644 --- a/storage/blackhole/ha_blackhole.cc +++ b/storage/blackhole/ha_blackhole.cc @@ -152,7 +152,7 @@ THR_LOCK_DATA **ha_blackhole::store_lock(THD *thd, int ha_blackhole::index_read(byte * buf, const byte * key, - ulonglong keypart_map, uint key_len, + key_part_map keypart_map, enum ha_rkey_function find_flag) { DBUG_ENTER("ha_blackhole::index_read"); @@ -161,7 +161,7 @@ int ha_blackhole::index_read(byte * buf, const byte * key, int ha_blackhole::index_read_idx(byte * buf, uint idx, const byte * key, - ulonglong keypart_map, uint key_len, + key_part_map keypart_map, enum ha_rkey_function find_flag) { DBUG_ENTER("ha_blackhole::index_read_idx"); @@ -170,7 +170,7 @@ int ha_blackhole::index_read_idx(byte * buf, uint idx, const byte * key, int ha_blackhole::index_read_last(byte * buf, const byte * key, - ulonglong keypart_map) + key_part_map keypart_map) { DBUG_ENTER("ha_blackhole::index_read_last"); DBUG_RETURN(HA_ERR_END_OF_FILE); diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h index cd8b6491dba..2af12b33077 100644 --- a/storage/blackhole/ha_blackhole.h +++ b/storage/blackhole/ha_blackhole.h @@ -64,12 +64,11 @@ public: int rnd_init(bool scan); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); - int index_read(byte * buf, const byte * key, ulonglong keypart_map, - uint key_len, enum ha_rkey_function find_flag); + int index_read(byte * buf, const byte * key, key_part_map keypart_map, + enum ha_rkey_function find_flag); int index_read_idx(byte * buf, uint idx, const byte * key, - ulonglong keypart_map, uint key_len, - enum ha_rkey_function find_flag); - int index_read_last(byte * buf, const byte * key, ulonglong keypart_map); + key_part_map keypart_map, enum ha_rkey_function find_flag); + int index_read_last(byte * buf, const byte * key, key_part_map keypart_map); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 01d508e3290..999e36a4242 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -415,7 +415,7 @@ int ha_example::delete_row(const byte * buf) */ int ha_example::index_read(byte * buf, const byte * key, - ulonglong keypart_map __attribute__((unused)), + key_part_map keypart_map __attribute__((unused)), enum ha_rkey_function find_flag __attribute__((unused))) { diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index ee60b412974..9777a478209 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -191,7 +191,7 @@ public: skip it and and MySQL will treat it as not implemented. */ int index_read(byte * buf, const byte * key, - ulonglong keypart_map, enum ha_rkey_function find_flag); + key_part_map keypart_map, enum ha_rkey_function find_flag); /** @brief We implement this in ha_example.cc. It's not an obligatory method; diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 9e6a7aea6c3..5831ec6167a 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -238,7 +238,7 @@ int ha_heap::delete_row(const byte * buf) return res; } -int ha_heap::index_read(byte * buf, const byte * key, ulonglong keypart_map, +int ha_heap::index_read(byte * buf, const byte * key, key_part_map keypart_map, enum ha_rkey_function find_flag) { DBUG_ASSERT(inited==INDEX); @@ -249,7 +249,7 @@ int ha_heap::index_read(byte * buf, const byte * key, ulonglong keypart_map, return error; } -int ha_heap::index_read_last(byte *buf, const byte *key, ulonglong keypart_map) +int ha_heap::index_read_last(byte *buf, const byte *key, key_part_map keypart_map) { DBUG_ASSERT(inited==INDEX); statistic_increment(table->in_use->status_var.ha_read_key_count, @@ -261,7 +261,7 @@ int ha_heap::index_read_last(byte *buf, const byte *key, ulonglong keypart_map) } int ha_heap::index_read_idx(byte * buf, uint index, const byte * key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index b49ded6e33d..a2d531fc515 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -75,11 +75,11 @@ public: ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values); - int index_read(byte * buf, const byte * key, ulonglong keypart_map, + int index_read(byte * buf, const byte * key, key_part_map keypart_map, enum ha_rkey_function find_flag); - int index_read_last(byte *buf, const byte *key, ulonglong keypart_map); + int index_read_last(byte *buf, const byte *key, key_part_map keypart_map); int index_read_idx(byte * buf, uint index, const byte * key, - ulonglong keypart_map, enum ha_rkey_function find_flag); + key_part_map keypart_map, enum ha_rkey_function find_flag); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h index d9c3ff147b4..b52a6c60ac6 100644 --- a/storage/heap/heapdef.h +++ b/storage/heap/heapdef.h @@ -90,7 +90,7 @@ extern int hp_rec_key_cmp(HP_KEYDEF *keydef,const byte *rec1, extern int hp_key_cmp(HP_KEYDEF *keydef,const byte *rec, const byte *key); extern void hp_make_key(HP_KEYDEF *keydef,byte *key,const byte *rec); -extern uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key, +extern uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec, byte *recpos); extern uint hp_rb_key_length(HP_KEYDEF *keydef, const byte *key); extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key); @@ -99,8 +99,8 @@ extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const byte *record); extern int hp_close(register HP_INFO *info); extern void hp_clear(HP_SHARE *info); extern void hp_clear_keys(HP_SHARE *info); -extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, - ulonglong keypart_map); +extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, + key_part_map keypart_map); #ifdef THREAD extern pthread_mutex_t THR_LOCK_heap; #else diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c index 326f6adea45..fbf3e541372 100644 --- a/storage/heap/hp_hash.c +++ b/storage/heap/hp_hash.c @@ -35,7 +35,7 @@ HA_READ_KEY_EXACT Include the key in the range HA_READ_AFTER_KEY Don't include key in range - max_key.flag can have one of the following values: + max_key.flag can have one of the following values: HA_READ_BEFORE_KEY Don't include key in range HA_READ_AFTER_KEY Include all 'end_key' values in the range @@ -62,7 +62,7 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, { custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, (uchar*) min_key->key, - min_key->length); + min_key->keypart_map); start_pos= tree_record_pos(rb_tree, info->recbuf, min_key->flag, &custom_arg); } @@ -70,12 +70,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, { start_pos= 0; } - + if (max_key) { custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, (uchar*) max_key->key, - max_key->length); + max_key->keypart_map); end_pos= tree_record_pos(rb_tree, info->recbuf, max_key->flag, &custom_arg); } @@ -772,7 +772,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key, char_length / seg->charset->mbmaxlen); set_if_smaller(char_length, seg->length); /* QQ: ok to remove? */ if (char_length < seg->length) - seg->charset->cset->fill(seg->charset, (char*) key + char_length, + seg->charset->cset->fill(seg->charset, (char*) key + char_length, seg->length - char_length, ' '); } memcpy(key, rec + seg->start, (size_t) char_length); @@ -784,11 +784,11 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key, uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, - ulonglong keypart_map) + key_part_map keypart_map) { HA_KEYSEG *seg, *endseg; uchar *start_key= key; - + for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg && keypart_map; old+= seg->length, seg++) { diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c index 98714bf875f..ced81985f99 100644 --- a/storage/heap/hp_rkey.c +++ b/storage/heap/hp_rkey.c @@ -16,7 +16,7 @@ #include "heapdef.h" int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, - ulonglong keypart_map, enum ha_rkey_function find_flag) + key_part_map keypart_map, enum ha_rkey_function find_flag) { byte *pos; HP_SHARE *share= info->s; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 6feb8e0146d..e9309f4f8b8 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3927,14 +3927,14 @@ statement issued by the user. We also increment trx->n_mysql_tables_in_use. 2) If prebuilt->sql_stat_start == TRUE we 'pre-compile' the MySQL search instructions to prebuilt->template of the table handle instance in -::index_read_old. The template is used to save CPU time in large joins. +::index_read. The template is used to save CPU time in large joins. 3) In row_search_for_mysql, if prebuilt->sql_stat_start is true, we allocate a new consistent read view for the trx if it does not yet have one, or in the case of a locking read, set an InnoDB 'intention' table level lock on the table. - 4) We do the SELECT. MySQL may repeatedly call ::index_read_old for the + 4) We do the SELECT. MySQL may repeatedly call ::index_read for the same table handle instance, if it is a join. 5) When the SELECT ends, MySQL removes its intention table level locks @@ -3948,7 +3948,7 @@ table handler in that case has to execute the COMMIT in ::external_lock. B) If the user has explicitly set MySQL table level locks, then MySQL does NOT call ::external_lock at the start of the statement. To determine when we are at the start of a new SQL statement we at the start of -::index_read_old also compare the query id to the latest query id where the +::index_read also compare the query id to the latest query id where the table handle instance was used. If it has changed, we know we are at the start of a new SQL statement. Since the query id can theoretically overwrap, we use this test only as a secondary way of determining the @@ -3985,7 +3985,7 @@ ha_innobase::index_read( int error; ulint ret; - DBUG_ENTER("index_read_old"); + DBUG_ENTER("index_read"); ut_a(prebuilt->trx == (trx_t*) current_thd->ha_data[ht->slot]); @@ -4067,7 +4067,7 @@ ha_innobase::index_read( } /*********************************************************************** -The following functions works like index_read_old, but it find the last +The following functions works like index_read, but it find the last row with the current key value or prefix. */ int @@ -4173,7 +4173,7 @@ ha_innobase::index_read_idx( /*************************************************************************** Reads the next or previous row from a cursor, which must have previously been -positioned using index_read_old. */ +positioned using index_read. */ int ha_innobase::general_fetch( @@ -4222,7 +4222,7 @@ ha_innobase::general_fetch( /*************************************************************************** Reads the next row from a cursor, which must have previously been -positioned using index_read_old. */ +positioned using index_read. */ int ha_innobase::index_next( @@ -4258,7 +4258,7 @@ ha_innobase::index_next_same( /*************************************************************************** Reads the previous row from a cursor, which must have previously been -positioned using index_read_old. */ +positioned using index_read. */ int ha_innobase::index_prev( diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index fb0c3eebc4d..48f1d9b2395 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1555,7 +1555,7 @@ int ha_myisam::delete_row(const byte * buf) return mi_delete(file,buf); } -int ha_myisam::index_read(byte *buf, const byte *key, ulonglong keypart_map, +int ha_myisam::index_read(byte *buf, const byte *key, key_part_map keypart_map, enum ha_rkey_function find_flag) { DBUG_ASSERT(inited==INDEX); @@ -1567,7 +1567,7 @@ int ha_myisam::index_read(byte *buf, const byte *key, ulonglong keypart_map, } int ha_myisam::index_read_idx(byte *buf, uint index, const byte *key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, @@ -1578,7 +1578,7 @@ int ha_myisam::index_read_idx(byte *buf, uint index, const byte *key, } int ha_myisam::index_read_last(byte *buf, const byte *key, - ulonglong keypart_map) + key_part_map keypart_map) { DBUG_ENTER("ha_myisam::index_read_last"); DBUG_ASSERT(inited==INDEX); diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index b66a9e5cca4..647e72d53eb 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -69,11 +69,11 @@ class ha_myisam: public handler int write_row(byte * buf); int update_row(const byte * old_data, byte * new_data); int delete_row(const byte * buf); - int index_read(byte *buf, const byte *key, ulonglong keypart_map, + int index_read(byte *buf, const byte *key, key_part_map keypart_map, enum ha_rkey_function find_flag); int index_read_idx(byte *buf, uint index, const byte *key, - ulonglong keypart_map, enum ha_rkey_function find_flag); - int index_read_last(byte *buf, const byte *key, ulonglong keypart_map); + key_part_map keypart_map, enum ha_rkey_function find_flag); + int index_read_last(byte *buf, const byte *key, key_part_map keypart_map); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 5c67404559e..7a4d47954a5 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -532,7 +532,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) mi_extra(info,HA_EXTRA_KEYREAD,0); bzero(info->lastkey,keyinfo->seg->length); if (!mi_rkey(info, info->rec_buff, key, (const byte*) info->lastkey, - ULL(1), HA_READ_KEY_EXACT)) + (key_part_map)1, HA_READ_KEY_EXACT)) { /* Don't count this as a real warning, as myisamchk can't correct it */ uint save=param->warning_printed; diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index 1b7ba676139..2f4915dec39 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -216,7 +216,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, */ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, - ulonglong keypart_map, HA_KEYSEG **last_used_keyseg) + key_part_map keypart_map, HA_KEYSEG **last_used_keyseg) { uchar *start_key=key; HA_KEYSEG *keyseg; @@ -225,7 +225,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, /* "one part" rtree key is 2*SPDIMS part key in MyISAM */ if (info->s->keyinfo[keynr].key_alg == HA_KEY_ALG_RTREE) - keypart_map= (ULL(1) << (2*SPDIMS)) - 1; + keypart_map= (((key_part_map)1) << (2*SPDIMS)) - 1; /* only key prefixes are supported */ DBUG_ASSERT(((keypart_map+1) & keypart_map) == 0); diff --git a/storage/myisam/mi_range.c b/storage/myisam/mi_range.c index 5e5fe3c6b22..2cdb02b2c80 100644 --- a/storage/myisam/mi_range.c +++ b/storage/myisam/mi_range.c @@ -21,7 +21,7 @@ #include "myisamdef.h" #include "rt_index.h" -static ha_rows _mi_record_pos(MI_INFO *, const byte *, ulonglong, +static ha_rows _mi_record_pos(MI_INFO *, const byte *, key_part_map, enum ha_rkey_function); static double _mi_search_pos(MI_INFO *,MI_KEYDEF *,uchar *, uint,uint,my_off_t); static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *,uchar *, uchar *,uint *); @@ -104,11 +104,11 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR) res=HA_POS_ERROR; } - + if (info->s->concurrent_insert) rw_unlock(&info->s->key_root_lock[inx]); fast_mi_writeinfo(info); - + DBUG_PRINT("info",("records: %ld",(ulong) (res))); DBUG_RETURN(res); } @@ -117,7 +117,7 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, /* Find relative position (in records) for key in index-tree */ static ha_rows _mi_record_pos(MI_INFO *info, const byte *key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function search_flag) { uint inx=(uint) info->lastinx, nextflag, key_len; diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c index 2ff24d565b9..373ab303bf0 100644 --- a/storage/myisam/mi_rkey.c +++ b/storage/myisam/mi_rkey.c @@ -22,7 +22,7 @@ /* Ordinary search_flag is 0 ; Give error if no record with key */ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, - ulonglong keypart_map, enum ha_rkey_function search_flag) + key_part_map keypart_map, enum ha_rkey_function search_flag) { uchar *key_buff; MYISAM_SHARE *share=info->s; diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index f1ca1754696..7325340b970 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -605,7 +605,7 @@ extern my_off_t _mi_new(MI_INFO *info,MI_KEYDEF *keyinfo,int level); extern uint _mi_make_key(MI_INFO *info,uint keynr,uchar *key, const byte *record,my_off_t filepos); extern uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, - uchar *old, ulonglong keypart_map, + uchar *old, key_part_map keypart_map, HA_KEYSEG **last_used_keyseg); extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,byte *buf); extern int _mi_read_cache(IO_CACHE *info,byte *buff,my_off_t pos, diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index df77931ddb5..96f7db6e633 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -179,7 +179,7 @@ int ha_myisammrg::delete_row(const byte * buf) } int ha_myisammrg::index_read(byte * buf, const byte * key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, @@ -190,7 +190,7 @@ int ha_myisammrg::index_read(byte * buf, const byte * key, } int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key, - ulonglong keypart_map, + key_part_map keypart_map, enum ha_rkey_function find_flag) { statistic_increment(table->in_use->status_var.ha_read_key_count, @@ -201,7 +201,7 @@ int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key, } int ha_myisammrg::index_read_last(byte * buf, const byte * key, - ulonglong keypart_map) + key_part_map keypart_map) { statistic_increment(table->in_use->status_var.ha_read_key_count, &LOCK_status); diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index 805a2cb04b6..7bbe659d4b7 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -56,11 +56,11 @@ class ha_myisammrg: public handler int write_row(byte * buf); int update_row(const byte * old_data, byte * new_data); int delete_row(const byte * buf); - int index_read(byte * buf, const byte * key, ulonglong keypart_map, + int index_read(byte * buf, const byte * key, key_part_map keypart_map, enum ha_rkey_function find_flag); int index_read_idx(byte * buf, uint index, const byte * key, - ulonglong keypart_map, enum ha_rkey_function find_flag); - int index_read_last(byte * buf, const byte * key, ulonglong keypart_map); + key_part_map keypart_map, enum ha_rkey_function find_flag); + int index_read_last(byte * buf, const byte * key, key_part_map keypart_map); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); diff --git a/storage/myisammrg/myrg_rkey.c b/storage/myisammrg/myrg_rkey.c index 2273f7d62b8..0eefe7eb173 100644 --- a/storage/myisammrg/myrg_rkey.c +++ b/storage/myisammrg/myrg_rkey.c @@ -36,7 +36,7 @@ */ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, - ulonglong keypart_map, enum ha_rkey_function search_flag) + key_part_map keypart_map, enum ha_rkey_function search_flag) { byte *key_buff; uint pack_key_length; From c554f58ca15e61cf23a5854d6c653426b29f5961 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 19:05:11 -0700 Subject: [PATCH 189/789] Cleanup of prototype for windows. client/mysqlslap.c: Fixed a prototype for windows. Corrected the call the attr --- client/mysqlslap.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 1b4692848b9..62ee2b03359 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -248,7 +248,7 @@ static int create_schema(MYSQL *mysql, const char *db, statement *stmt, option_string *engine_stmt); static int run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit); -int run_task(thread_context *con); +pthread_handler_t run_task(void *p); void statement_cleanup(statement *stmt); void option_cleanup(option_string *stmt); void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr); @@ -1562,6 +1562,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) pthread_t mainthread; /* Thread descriptor */ pthread_attr_t attr; /* Thread attributes */ + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, + PTHREAD_CREATE_DETACHED); + + pthread_mutex_lock(&counter_mutex); thread_counter= 0; @@ -1570,12 +1575,8 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) pthread_mutex_unlock(&sleeper_mutex); for (x= 0; x < concur; x++) { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, - PTHREAD_CREATE_DETACHED); - - /* now create the thread */ - if (pthread_create(&mainthread, &attr, (void *)run_task, + /* nowucreate the thread */ + if (pthread_create(&mainthread, &attr, run_task, (void *)&con) != 0) { fprintf(stderr,"%s: Could not create thread\n", @@ -1605,6 +1606,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime); } pthread_mutex_unlock(&counter_mutex); + pthread_attr_destroy(&attr); gettimeofday(&end_time, NULL); @@ -1617,14 +1619,14 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) } -int -run_task(thread_context *con) +pthread_handler_t run_task(void *p) { ulonglong counter= 0, queries; MYSQL *mysql; MYSQL_RES *result; MYSQL_ROW row; statement *ptr; + thread_context *con= (thread_context *)p; DBUG_ENTER("run_task"); DBUG_PRINT("info", ("task script \"%s\"", con->stmt ? con->stmt->string : "")); From d5915675f67ce5beb4f6118ff8d121da36d19b52 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Mar 2007 23:50:48 -0700 Subject: [PATCH 190/789] Bug in windows where attr was not working. Removed. client/mysqlslap.c: attr issue on windows --- client/mysqlslap.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 62ee2b03359..de7a726747e 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1560,12 +1560,6 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) con.limit= limit; pthread_t mainthread; /* Thread descriptor */ - pthread_attr_t attr; /* Thread attributes */ - - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, - PTHREAD_CREATE_DETACHED); - pthread_mutex_lock(&counter_mutex); thread_counter= 0; @@ -1576,7 +1570,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) for (x= 0; x < concur; x++) { /* nowucreate the thread */ - if (pthread_create(&mainthread, &attr, run_task, + if (pthread_create(&mainthread, NULL, run_task, (void *)&con) != 0) { fprintf(stderr,"%s: Could not create thread\n", @@ -1606,7 +1600,6 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime); } pthread_mutex_unlock(&counter_mutex); - pthread_attr_destroy(&attr); gettimeofday(&end_time, NULL); @@ -1793,13 +1786,13 @@ parse_option(const char *origin, option_string **stmt, char delm) char *option_ptr; tmp->length= (size_t)(buffer_ptr - buffer); - tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE)); + tmp->string= my_strndup(ptr, (uint)tmp->length, MYF(MY_FAE)); option_ptr= ptr + 1 + tmp->length; /* Move past the : and the first string */ tmp->option_length= (size_t)(retstr - option_ptr); - tmp->option= my_strndup(option_ptr, tmp->option_length, + tmp->option= my_strndup(option_ptr, (uint)tmp->option_length, MYF(MY_FAE)); } else @@ -1863,7 +1856,7 @@ parse_delimiter(const char *script, statement **stmt, char delm) tmp= tmp->next) { count++; - tmp->string= my_strndup(ptr, (size_t)(retstr - ptr), MYF(MY_FAE)); + tmp->string= my_strndup(ptr, (uint)(retstr - ptr), MYF(MY_FAE)); tmp->length= (size_t)(retstr - ptr); ptr+= retstr - ptr + 1; if (isspace(*ptr)) @@ -1873,7 +1866,7 @@ parse_delimiter(const char *script, statement **stmt, char delm) if (ptr != script+length) { - tmp->string= my_strndup(ptr, (size_t)((script + length) - ptr), + tmp->string= my_strndup(ptr, (uint)((script + length) - ptr), MYF(MY_FAE)); tmp->length= (size_t)((script + length) - ptr); count++; @@ -1942,7 +1935,7 @@ print_conclusions_csv(conclusions *con) con->users, /* Children used */ con->avg_rows /* Queries run */ ); - my_write(csv_file, buffer, strlen(buffer), MYF(0)); + my_write(csv_file, buffer, (uint)strlen(buffer), MYF(0)); } void From 6bb4208084654c0e7c1218ff1d70cb6298514ab8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Mar 2007 11:19:21 +0100 Subject: [PATCH 191/789] dbug/dbug.c: unused variable removed include/config-win.h: SIZEOF_INT include/my_global.h: win64 fix support-files/Makefile.am: automake magic dbug/dbug.c: unused variable removed include/config-win.h: SIZEOF_INT include/my_global.h: win64 fix support-files/Makefile.am: automake magic --- dbug/dbug.c | 1 - include/config-win.h | 1 + include/my_global.h | 4 +++- support-files/Makefile.am | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dbug/dbug.c b/dbug/dbug.c index c4ae89f837f..e482fd95073 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -2000,7 +2000,6 @@ static char *DbugMalloc(size_t size) static const char *DbugStrTok(const char *s) { - const char *start=s; while (s[0] && (s[0] != ':' || (s[1] == '\\' || s[1] == '/' || (s[1] == ':' && s++)))) s++; diff --git a/include/config-win.h b/include/config-win.h index 6735ae1aba1..fadf24c732f 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -172,6 +172,7 @@ typedef uint rf_SetTimer; #endif #define VOID_SIGHANDLER #define SIZEOF_CHAR 1 +#define SIZEOF_INT 4 #define SIZEOF_LONG 4 #define SIZEOF_LONG_LONG 8 #define SIZEOF_OFF_T 8 diff --git a/include/my_global.h b/include/my_global.h index addc2f24e7f..b6c6ff13405 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1020,8 +1020,10 @@ typedef unsigned long long my_ulonglong; typedef int intptr; #elif SIZEOF_CHARP == SIZEOF_LONG typedef long intptr; +#elif SIZEOF_CHARP == SIZEOF_LONG_LONG +typedef long long intptr; #else -#error sizeof(void *) is neither sizeof(int) nor sizeof(long) +#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long) #endif #ifdef USE_RAID diff --git a/support-files/Makefile.am b/support-files/Makefile.am index b3ef3b77b76..b3581d65eb0 100644 --- a/support-files/Makefile.am +++ b/support-files/Makefile.am @@ -26,7 +26,7 @@ EXTRA_DIST = mysql.spec.sh \ mysql-log-rotate.sh \ mysql.server.sh \ binary-configure.sh \ - magic \ + magic mysql.m4 \ MySQL-shared-compat.spec.sh \ ndb-config-2-node.ini.sh \ compiler_warnings.supp From ccb75090c3f1011bf384651e719c8c696a5137cb Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Mar 2007 19:45:01 +0100 Subject: [PATCH 192/789] Fix a failure in test "func_in" on some 64-bit big-endian hosts in first 5.0.38 builds. sql/item_cmpfunc.cc: Ensure both operands of a comparison are cast to "ulonglong", not just one only. Without this, some 64-bit big-endian hosts failed test "func_in" when 5.0.38 builds were started. Patch provided by Timothy. --- sql/item_cmpfunc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index e032974fdea..3fb19927404 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2236,8 +2236,8 @@ int cmp_longlong(void *cmp_arg, One of the args is unsigned and is too big to fit into the positive signed range. Report no match. */ - if (a->unsigned_flag && ((ulonglong) a->val) > LONGLONG_MAX || - b->unsigned_flag && ((ulonglong) b->val) > LONGLONG_MAX) + if (a->unsigned_flag && ((ulonglong) a->val) > (ulonglong) LONGLONG_MAX || + b->unsigned_flag && ((ulonglong) b->val) > (ulonglong) LONGLONG_MAX) return a->unsigned_flag ? 1 : -1; /* Although the signedness differs both args can fit into the signed From 6f4a4d8a7d2b4e422a2e76e9f572fce32550b868 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 18 Mar 2007 10:47:15 +0100 Subject: [PATCH 193/789] make_win_bin_dist: - Support both "release" and "relwithdebinfo" targets - Copy ".pdb" and ".pdb" files for the server and instance manager - Removed the examples directory, unsupported - Handle both old and new builds in the same script, "-debug" and "-nt" extensions, directory "data" and "share" in different location scripts/make_win_bin_dist: - Support both "release" and "relwithdebinfo" targets - Copy ".pdb" and ".pdb" files for the server and instance manager - Removed the examples directory, unsupported - Handle both old and new builds in the same script, "-debug" and "-nt" extensions, directory "data" and "share" in different location --- scripts/make_win_bin_dist | 88 ++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 34 deletions(-) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 9e2df23fe51..b1ef199375f 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,11 +126,20 @@ if [ -e $DESTDIR ] ; then usage fi +trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR + # ---------------------------------------------------------------------- -# Copy executables, and client DLL (FIXME why?) +# Adjust target name if needed, release with debug info has another name # ---------------------------------------------------------------------- -trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR +if [ x"$TARGET" = x"release" -a "client/relwithdebinfo/mysql.exe" ] +then + TARGET="relwithdebinfo" +fi + +# ---------------------------------------------------------------------- +# Copy executables, and client DLL +# ---------------------------------------------------------------------- mkdir $DESTDIR mkdir $DESTDIR/bin @@ -138,20 +147,36 @@ cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ cp myisam/$TARGET/*.exe $DESTDIR/bin/ cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ || true +cp server-tools/instance-manager/$TARGET/*.map $DESTDIR/bin/ || true cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe -cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe +if [ -f "sql/$TARGET/mysqld-nt.exe" ] ; then + BASENAME="mysqld-nt" # Old style non CMake build +else + BASENAME="mysqld" # New style CMake build +fi -if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ +# Depending on Visual Studio target, the optimized server has symbols +cp sql/$TARGET/$BASENAME.exe $DESTDIR/bin/$BASENAME$EXE_SUFFIX.exe +cp sql/$TARGET/$BASENAME.pdb $DESTDIR/bin/$BASENAME$EXE_SUFFIX.pdb || true +cp sql/$TARGET/$BASENAME.map $DESTDIR/bin/$BASENAME$EXE_SUFFIX.map || true + +if [ -f "sql/debug/mysqld-debug.exe" ] ; then + BASENAME="mysqld-debug" # Old style non CMake build +else + BASENAME="mysqld" # New style CMake build +fi + +if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/$BASENAME.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then - cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe - cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb - cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map + cp sql/debug/$BASENAME.exe $DESTDIR/bin/mysqld-debug.exe + cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb + cp sql/debug/$BASENAME.map $DESTDIR/bin/mysqld-debug.map || true fi # ---------------------------------------------------------------------- @@ -160,7 +185,9 @@ fi # FIXME is there ever a data directory to copy? if [ -d win/data ] ; then - cp -pR win/data $DESTDIR/data + cp -pR win/data $DESTDIR/ +elif [ -d data ] ; then + cp -pR data $DESTDIR/ fi # FIXME maybe a flag to define "release build", or do the @@ -210,27 +237,6 @@ if [ x"$PACK_EMBEDDED" = "" -a \ copy_embedded fi -# ---------------------------------------------------------------------- -# FIXME test stuff that is useless garbage? -# ---------------------------------------------------------------------- - -mkdir -p $DESTDIR/examples/libmysqltest/release -cp libmysql/mytest.c libmysql/myTest.vcproj libmysql/$TARGET/myTest.exe \ - $DESTDIR/examples/libmysqltest/ -cp libmysql/$TARGET/myTest.exe $DESTDIR/examples/libmysqltest/release/ - -if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/myTest.exe" -o \ - x"$PACK_DEBUG" = "yes" ] ; then - mkdir -p $DESTDIR/examples/libmysqltest/debug - cp libmysql/debug/myTest.exe $DESTDIR/examples/libmysqltest/debug/ -fi - -mkdir -p $DESTDIR/examples/tests -cp tests/*.res tests/*.tst tests/*.pl tests/*.c $DESTDIR/examples/tests/ - -mkdir -p $DESTDIR/examples/udf_example -cp sql/udf_example.def sql/udf_example.vcproj sql/udf_example.c $DESTDIR/examples/udf_example/ - # ---------------------------------------------------------------------- # FIXME why not copy it all in "include"?! # ---------------------------------------------------------------------- @@ -271,14 +277,23 @@ if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/libmysql.lib" -o \ cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ client/debug/mysqlclient.lib \ - mysys/debug/mysys.lib \ regex/debug/regex.lib \ strings/debug/strings.lib \ zlib/debug/zlib.lib $DESTDIR/lib/debug/ + + if [ -f "mysys/debug/mysys-nt.lib" ] ; then + cp mysys/debug/mysys-nt.lib $DESTDIR/lib/debug/ + else + cp mysys/debug/mysys.lib $DESTDIR/lib/debug/mysys-nt.lib + fi + fi -# FIXME sort this out... -cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys_tls.lib +if [ -f "mysys/$TARGET/mysys-nt.lib" ] ; then + cp mysys/$TARGET/mysys-nt.lib $DESTDIR/lib/opt/ +else + cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys-nt.lib +fi # ---------------------------------------------------------------------- # Copy the test directory @@ -292,6 +307,7 @@ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ +cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ # Need this trick, or we get "argument list too long". ABS_DST=`pwd`/$DESTDIR @@ -335,7 +351,11 @@ for i in `cd scripts && ls`; do \ fi; \ done -cp -pR sql/share $DESTDIR/ +if [ -d "share" ] ; then + cp -pR share $DESTDIR/ +else + cp -pR sql/share $DESTDIR/ +fi cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* From caa6ddd9a436d3adaf3429f0664c486ec88aa9cd Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 18 Mar 2007 10:06:28 -0700 Subject: [PATCH 194/789] Restoring attr (aka poking around Windows did not work). client/mysqlslap.c: Restorinng attr --- client/mysqlslap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index de7a726747e..6fb810b6a23 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1560,6 +1560,10 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) con.limit= limit; pthread_t mainthread; /* Thread descriptor */ + pthread_attr_t attr; /* Thread attributes */ + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, + PTHREAD_CREATE_DETACHED); pthread_mutex_lock(&counter_mutex); thread_counter= 0; @@ -1570,7 +1574,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) for (x= 0; x < concur; x++) { /* nowucreate the thread */ - if (pthread_create(&mainthread, NULL, run_task, + if (pthread_create(&mainthread, &attr, run_task, (void *)&con) != 0) { fprintf(stderr,"%s: Could not create thread\n", @@ -1580,6 +1584,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) thread_counter++; } pthread_mutex_unlock(&counter_mutex); + pthread_attr_destroy(&attr); pthread_mutex_lock(&sleeper_mutex); master_wakeup= 0; From 3615debeb1377b1ddf51b546ed7342186c18db59 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 11:19:51 +0200 Subject: [PATCH 195/789] Added find_type_or_exit and find_bit_type_or_exit as wrappers around the original functions. These will ensure that error message is always in unique form, reduce code and print the right alternatives automatically in an error case. client/mysql.cc: Changed find_type to find_type_or_exit client/mysqladmin.cc: Changed find_type to find_type_or_exit client/mysqlbinlog.cc: Changed find_type to find_type_or_exit client/mysqlcheck.c: Changed find_type to find_type_or_exit client/mysqldump.c: Changed find_type to find_type_or_exit client/mysqlimport.c: Changed find_type to find_type_or_exit client/mysqlshow.c: Changed find_type to find_type_or_exit client/mysqlslap.c: Changed find_type to find_type_or_exit include/typelib.h: Added find_type_or_exit mysql-test/r/mysql_protocols.result: Fixed result. mysys/typelib.c: Added find_type_or_exit sql/mysqld.cc: Added use of find_type_or_exit and find_bit_type_or_exit Fixed a missing break; from an option handling. (Bug in --tc-heuristic-recover) --- client/mysql.cc | 9 +-- client/mysqladmin.cc | 9 +-- client/mysqlbinlog.cc | 9 +-- client/mysqlcheck.c | 9 +-- client/mysqldump.c | 11 +-- client/mysqlimport.c | 9 +-- client/mysqlshow.c | 9 +-- client/mysqlslap.c | 11 +-- include/typelib.h | 2 + mysql-test/r/mysql_protocols.result | 1 + mysys/typelib.c | 22 ++++++ sql/mysqld.cc | 118 +++++++++++----------------- 12 files changed, 89 insertions(+), 130 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 48172d97f56..c13fb958a1a 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -885,14 +885,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_nopager= 1; break; case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; - } break; case 'A': opt_rehash= 0; diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index ccfff4d7a03..4670cb98caf 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -284,15 +284,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), #endif break; case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; } - } if (error) { usage(); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 940fac6da38..a0a7572d92e 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -948,14 +948,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), remote_opt= 1; break; case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; - } case OPT_START_DATETIME: start_datetime= convert_str_to_timestamp(start_datetime_str); break; diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 1a9d07804b4..41c5cde4023 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -310,15 +310,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case 'V': print_version(); exit(0); case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; } - } return 0; } diff --git a/client/mysqldump.c b/client/mysqldump.c index 5f2749eef77..4a6c9e64151 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -790,14 +790,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; } case (int) OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } - break; - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); + break; } return 0; } diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 3e054fba308..c037da9c0b9 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -231,14 +231,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; #endif case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; - } case '#': DBUG_PUSH(argument ? argument : "d:t:o"); break; diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 1c714cc640f..0c6a6229964 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -287,14 +287,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), #endif break; case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; - } case '#': DBUG_PUSH(argument ? argument : "d:t:o"); break; diff --git a/client/mysqlslap.c b/client/mysqlslap.c index ad2c8685ba1..d673f8f6f81 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -568,14 +568,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), #endif break; case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } - break; - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); + break; case '#': DBUG_PUSH(argument ? argument : default_dbug_option); break; diff --git a/include/typelib.h b/include/typelib.h index 75d170e59d3..c973d1747fd 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -26,6 +26,8 @@ typedef struct st_typelib { /* Different types saved here */ unsigned int *type_lengths; } TYPELIB; +extern int find_type_or_exit(const char *x, TYPELIB *typelib, + const char *option); extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); diff --git a/mysql-test/r/mysql_protocols.result b/mysql-test/r/mysql_protocols.result index cbead9254a2..c6207c4f4f5 100644 --- a/mysql-test/r/mysql_protocols.result +++ b/mysql-test/r/mysql_protocols.result @@ -7,3 +7,4 @@ SOCKET ERROR 2047 (HY000): Wrong or unknown protocol ERROR 2047 (HY000): Wrong or unknown protocol Unknown option to protocol: NullS +Alternatives are: 'TCP','SOCKET','PIPE','MEMORY' diff --git a/mysys/typelib.c b/mysys/typelib.c index 4fab6f20493..780e63b4b04 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -20,6 +20,28 @@ #include +int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) +{ + int res; + const char **ptr; + + if ((res= find_type((my_string) x, typelib, 2)) <= 0) + { + ptr= typelib->type_names; + if (!*x) + fprintf(stderr, "No option given to %s\n", option); + else + fprintf(stderr, "Unknown option to %s: %s\n", option, x); + fprintf(stderr, "Alternatives are: '%s'", *ptr); + while (*++ptr) + fprintf(stderr, ",'%s'", *ptr); + fprintf(stderr, "\n"); + exit(1); + } + return res; +} + + /* Search after a string in a list of strings. Endspace in x is not compared. diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 758dc54316e..0457dbb8c69 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -737,6 +737,8 @@ pthread_handler_t handle_connections_shared_memory(void *arg); #endif pthread_handler_t handle_slave(void *arg); static ulong find_bit_type(const char *x, TYPELIB *bit_lib); +static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib, + const char *option); static void clean_up(bool print_message); static int test_if_case_insensitive(const char *dir_name); @@ -7411,11 +7413,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_INIT_RPL_ROLE: { int role; - if ((role=find_type(argument, &rpl_role_typelib, 2)) <= 0) - { - fprintf(stderr, "Unknown replication role: %s\n", argument); - exit(1); - } + role= find_type_or_exit(argument, &rpl_role_typelib, opt->name); rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE; break; } @@ -7471,17 +7469,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case OPT_BINLOG_FORMAT: { int id; - if ((id= find_type(argument, &binlog_format_typelib, 2)) <= 0) - { - fprintf(stderr, - "Unknown binary log format: '%s' " - "(should be one of '%s', '%s', '%s')\n", - argument, - binlog_format_names[BINLOG_FORMAT_STMT], - binlog_format_names[BINLOG_FORMAT_ROW], - binlog_format_names[BINLOG_FORMAT_MIXED]); - exit(1); - } + id= find_type_or_exit(argument, &binlog_format_typelib, opt->name); global_system_variables.binlog_format= opt_binlog_format_id= id - 1; break; } @@ -7541,13 +7529,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else { log_output_str= argument; - if ((log_output_options= - find_bit_type(argument, &log_output_typelib)) == ~(ulong) 0) - { - fprintf(stderr, "Unknown option to log-output: %s\n", argument); - exit(1); - } - } + log_output_options= + find_bit_type_or_exit(argument, &log_output_typelib, opt->name); + } break; } #endif @@ -7561,10 +7545,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), type= 5 1 2 3 4 (DISABLE ) - (OFF | ON) - (0 | 1) */ - switch ((type=find_type(argument, &Events::opt_typelib, 1))) { - case 0: - fprintf(stderr, "Unknown option to event-scheduler: %s\n",argument); - exit(1); + type= find_type_or_exit(argument, &Events::opt_typelib, opt->name); + switch (type) { case 5: /* OPT_DISABLED */ Events::opt_event_scheduler= Events::EVENTS_DISABLED; break; @@ -7714,11 +7696,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else { int type; - if ((type=find_type(argument, &delay_key_write_typelib, 2)) <= 0) - { - fprintf(stderr,"Unknown delay_key_write type: %s\n",argument); - exit(1); - } + type= find_type_or_exit(argument, &delay_key_write_typelib, opt->name); delay_key_write_options= (uint) type-1; } break; @@ -7729,11 +7707,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case OPT_TX_ISOLATION: { int type; - if ((type=find_type(argument, &tx_isolation_typelib, 2)) <= 0) - { - fprintf(stderr,"Unknown transaction isolation type: %s\n",argument); - exit(1); - } + type= find_type_or_exit(argument, &tx_isolation_typelib, opt->name); global_system_variables.tx_isolation= (type-1); break; } @@ -7774,16 +7748,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case OPT_NDB_DISTRIBUTION: int id; - if ((id= find_type(argument, &ndb_distribution_typelib, 2)) <= 0) - { - fprintf(stderr, - "Unknown ndb distribution type: '%s' " - "(should be '%s' or '%s')\n", - argument, - ndb_distribution_names[ND_KEYHASH], - ndb_distribution_names[ND_LINHASH]); - exit(1); - } + id= find_type_or_exit(argument, &ndb_distribution_typelib, opt->name); opt_ndb_distribution_id= (enum ndb_distribution)(id-1); break; case OPT_NDB_EXTRA_LOGGING: @@ -7823,12 +7788,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else { myisam_recover_options_str=argument; - if ((myisam_recover_options= - find_bit_type(argument, &myisam_recover_typelib)) == ~(ulong) 0) - { - fprintf(stderr, "Unknown option to myisam-recover: %s\n",argument); - exit(1); - } + myisam_recover_options= + find_bit_type_or_exit(argument, &myisam_recover_typelib, opt->name); } ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; break; @@ -7841,14 +7802,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), myisam_concurrent_insert= 0; /* --skip-concurrent-insert */ break; case OPT_TC_HEURISTIC_RECOVER: - { - if ((tc_heuristic_recover=find_type(argument, - &tc_heuristic_recover_typelib, 2)) <=0) - { - fprintf(stderr, "Unknown option to tc-heuristic-recover: %s\n",argument); - exit(1); - } - } + tc_heuristic_recover= find_type_or_exit(argument, + &tc_heuristic_recover_typelib, + opt->name); + break; case OPT_MYISAM_STATS_METHOD: { ulong method_conv; @@ -7856,11 +7813,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), LINT_INIT(method_conv); myisam_stats_method_str= argument; - if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) - { - fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument); - exit(1); - } + method= find_type_or_exit(argument, &myisam_stats_method_typelib, + opt->name); switch (method-1) { case 2: method_conv= MI_STATS_METHOD_IGNORE_NULLS; @@ -7879,12 +7833,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case OPT_SQL_MODE: { sql_mode_str= argument; - if ((global_system_variables.sql_mode= - find_bit_type(argument, &sql_mode_typelib)) == ~(ulong) 0) - { - fprintf(stderr, "Unknown option to sql-mode: %s\n", argument); - exit(1); - } + global_system_variables.sql_mode= + find_bit_type_or_exit(argument, &sql_mode_typelib, opt->name); global_system_variables.sql_mode= fix_sql_mode(global_system_variables. sql_mode); break; @@ -8192,6 +8142,30 @@ static void fix_paths(void) } +static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib, + const char *option) +{ + ulong res; + + const char **ptr; + + if ((res= find_bit_type(x, bit_lib)) == ~(ulong) 0) + { + ptr= bit_lib->type_names; + if (!*x) + fprintf(stderr, "No option given to %s\n", option); + else + fprintf(stderr, "Wrong option to %s. Option(s) given: %s\n", option, x); + fprintf(stderr, "Alternatives are: '%s'", *ptr); + while (*++ptr) + fprintf(stderr, ",'%s'", *ptr); + fprintf(stderr, "\n"); + exit(1); + } + return res; +} + + /* Return a bitfield from a string of substrings separated by ',' returns ~(ulong) 0 on error. From fbb955d7250ae745327156bd14b4e8ade3bfe650 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 11:13:10 +0100 Subject: [PATCH 196/789] ndb - autotest increase some timeouts... storage/ndb/test/run-test/daily-devel-tests.txt: increase timeouts... --- storage/ndb/test/run-test/daily-devel-tests.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ndb/test/run-test/daily-devel-tests.txt b/storage/ndb/test/run-test/daily-devel-tests.txt index 8c1fa491cb9..f73bd021440 100644 --- a/storage/ndb/test/run-test/daily-devel-tests.txt +++ b/storage/ndb/test/run-test/daily-devel-tests.txt @@ -204,17 +204,17 @@ cmd: testSystemRestart args: -l 1 -n SR9 T1 # -max-time: 2500 +max-time: 3600 cmd: test_event args: -n EventOperationApplier -l 2 # -max-time: 2500 +max-time: 3600 cmd: test_event args: -n EventOperationApplier_NR -l 2 # -max-time: 2500 +max-time: 3600 cmd: test_event args: -n MergeEventOperationApplier_NR -l 2 @@ -224,9 +224,9 @@ cmd: test_event args: -n Multi # -max-time: 2500 +max-time: 3600 cmd: test_event -args: -n CreateDropNR -l 2 +args: -n CreateDropNR -l 1 # max-time: 600 From 75bd09a6652ed3ef9dad764a94a91324cfaa66de Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 12:31:23 +0100 Subject: [PATCH 197/789] ndb - bug#20185 Fix race in testprg...causing random TC crashes storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: remove incorrect work-around storage/ndb/test/ndbapi/testNodeRestart.cpp: Fix race in testprg...causing random TC crashes --- storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 15 +++++---------- storage/ndb/test/ndbapi/testNodeRestart.cpp | 14 +++++++++++--- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 44f7954f00d..ff8f32bf085 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -7099,20 +7099,15 @@ Dbtc::nodeFailCheckTransactions(Signal* signal, for (transPtr.i = transPtrI; transPtr.i < capiConnectFilesize; transPtr.i++) { ptrCheckGuard(transPtr, capiConnectFilesize, apiConnectRecord); - Uint32 state = transPtr.p->apiConnectstate; if (transPtr.p->m_transaction_nodes.get(failedNodeId)) { jam(); - // avoid assertion in timeoutfoundlab - if (state != CS_PREPARE_TO_COMMIT) - { - // Force timeout regardless of state - c_appl_timeout_value = 1; - setApiConTimer(transPtr.i, TtcTimer - 2, __LINE__); - timeOutFoundLab(signal, transPtr.i, ZNODEFAIL_BEFORE_COMMIT); - c_appl_timeout_value = TapplTimeout; - } + // Force timeout regardless of state + c_appl_timeout_value = 1; + setApiConTimer(transPtr.i, TtcTimer - 2, __LINE__); + timeOutFoundLab(signal, transPtr.i, ZNODEFAIL_BEFORE_COMMIT); + c_appl_timeout_value = TapplTimeout; } // Send CONTINUEB to continue later diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp index 39b80611731..8d48d78c581 100644 --- a/storage/ndb/test/ndbapi/testNodeRestart.cpp +++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp @@ -887,6 +887,9 @@ int runBug20185(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_FAILED; NdbSleep_MilliSleep(3000); + Vector nodes; + for (Uint32 i = 0; i Date: Mon, 19 Mar 2007 14:51:17 +0100 Subject: [PATCH 198/789] ndb - test_event Fix compile error with gcc4 storage/ndb/test/ndbapi/test_event.cpp: Fix compile error with gcc4 --- storage/ndb/test/ndbapi/test_event.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ndb/test/ndbapi/test_event.cpp b/storage/ndb/test/ndbapi/test_event.cpp index 563819689a8..e1e0012d0d8 100644 --- a/storage/ndb/test/ndbapi/test_event.cpp +++ b/storage/ndb/test/ndbapi/test_event.cpp @@ -842,11 +842,12 @@ int runEventListenerUntilStopped(NDBT_Context* ctx, NDBT_Step* step) int result = NDBT_OK; const NdbDictionary::Table * table= ctx->getTab(); HugoTransactions hugoTrans(* table); + Ndb* ndb= GETNDB(step); char buf[1024]; sprintf(buf, "%s_EVENT", table->getName()); NdbEventOperation *pOp, *pCreate = 0; - pCreate = pOp = GETNDB(step)->createEventOperation(buf); + pCreate = pOp = ndb->createEventOperation(buf); if ( pOp == NULL ) { g_err << "Event operation creation failed on %s" << buf << endl; return NDBT_FAILED; @@ -870,7 +871,6 @@ int runEventListenerUntilStopped(NDBT_Context* ctx, NDBT_Step* step) goto end; } - Ndb* ndb= GETNDB(step); while(!ctx->isTestStopped()) { Uint64 curr_gci = 0; @@ -887,10 +887,10 @@ int runEventListenerUntilStopped(NDBT_Context* ctx, NDBT_Step* step) end: if(pCreate) { - if (GETNDB(step)->dropEventOperation(pCreate)) { + if (ndb->dropEventOperation(pCreate)) { g_err << "dropEventOperation execution failed " - << GETNDB(step)->getNdbError().code << " " - << GETNDB(step)->getNdbError().message << endl; + << ndb->getNdbError().code << " " + << ndb->getNdbError().message << endl; result = NDBT_FAILED; } } From 9357dae8c2788642b7969c749ab3e32a10d3c124 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 15:24:07 +0100 Subject: [PATCH 199/789] netware/Makefile.am : "libmysql.imp" must survive a "make clean" for the NetWare builds. netware/Makefile.am: "libmysql.imp" must survive a "make clean" for the NetWare builds. --- netware/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netware/Makefile.am b/netware/Makefile.am index 8a9945fc6a4..59ebd624ed2 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -50,7 +50,8 @@ link_sources: else BUILT_SOURCES = libmysql.imp init_db.sql test_db.sql -CLEANFILES = $(BUILT_SOURCES) +DISTCLEANFILES = libmysql.imp +CLEANFILES = init_db.sql test_db.sql # Create the libmysql.imp from libmysql/libmysql.def libmysql.imp: $(top_srcdir)/libmysql/libmysql.def From db573e637c2ba66f214f7e1e2172ce9efeca0db0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 15:56:53 +0100 Subject: [PATCH 200/789] Bug#26996 - Update of a Field in a Memory Table ends with wrong result Using a MEMORY table BTREE index for scanning for updatable rows could lead to an infinite loop. Everytime a key was inserted into a btree index, the position in the index scan was cleared. The search started from the beginning and found the same key again. Now we do not clear the position on key insert an more. heap/hp_write.c: Bug#26996 - Update of a Field in a Memory Table ends with wrong result Removed the index-scan-breaking nulling of last_pos. The comment behind this line ("For heap_rnext/heap_rprev") was misleading. It should have been "Breaks heap_rnext/heap_rprev". mysql-test/r/heap_btree.result: Bug#26996 - Update of a Field in a Memory Table ends with wrong result Added test result. mysql-test/t/heap_btree.test: Bug#26996 - Update of a Field in a Memory Table ends with wrong result Added test. --- heap/hp_write.c | 1 - mysql-test/r/heap_btree.result | 15 +++++++++++++++ mysql-test/t/heap_btree.test | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/heap/hp_write.c b/heap/hp_write.c index 841dda6264e..59dfca31fd9 100644 --- a/heap/hp_write.c +++ b/heap/hp_write.c @@ -106,7 +106,6 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record, heap_rb_param custom_arg; uint old_allocated; - info->last_pos= NULL; /* For heap_rnext/heap_rprev */ custom_arg.keyseg= keyinfo->seg; custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos); if (keyinfo->flag & HA_NOSAME) diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result index e6492e90b80..1a0666514be 100644 --- a/mysql-test/r/heap_btree.result +++ b/mysql-test/r/heap_btree.result @@ -280,4 +280,19 @@ a 1 1 drop table t1; +CREATE TABLE t1 ( +c1 CHAR(3), +c2 INTEGER, +KEY USING BTREE(c1), +KEY USING BTREE(c2) +) ENGINE= MEMORY; +INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0); +UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A'; +SELECT * FROM t1; +c1 c2 +ABC 0 +A 1 +B 0 +C 0 +DROP TABLE t1; End of 4.1 tests diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 9aa820becd9..63baa968981 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -182,4 +182,18 @@ delete from t1 where a >= 2; select a from t1 order by a; drop table t1; +# +# Bug#26996 - Update of a Field in a Memory Table ends with wrong result +# +CREATE TABLE t1 ( + c1 CHAR(3), + c2 INTEGER, + KEY USING BTREE(c1), + KEY USING BTREE(c2) +) ENGINE= MEMORY; +INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0); +UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A'; +SELECT * FROM t1; +DROP TABLE t1; + --echo End of 4.1 tests From f52dcd1a85c41540df3957c78f975e40e57cd731 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 16:15:47 +0100 Subject: [PATCH 201/789] Modify BUG#26701 patch and a different location to also use the correct arguments for GCC 5 and 6. BUILD/check-cpu: case -> if ... -lt --- BUILD/check-cpu | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 8c41b79a126..f1c9bc51dc5 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -166,27 +166,23 @@ check_cpu () { # different gcc backends (and versions) have different CPU flags case `gcc -dumpmachine` in i?86-*) - case "$cc_verno" in - 3.4*|3.5*|4.*) - check_cpu_args='-mtune=$cpu_arg -march=$cpu_arg' - ;; - *) - check_cpu_args='-mcpu=$cpu_arg -march=$cpu_arg' - ;; - esac + if test "$cc_verno" -lt "3.4" + then + check_cpu_args='-mcpu=$cpu_arg' + else + check_cpu_args='-mtune=$cpu_arg' + fi ;; ppc-*) check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg' ;; x86_64-*) - case "$cc_verno" in - 3.4*|3.5*|4.*) - check_cpu_args='-mtune=$cpu_arg' - ;; - *) + if test "$cc_verno" -lt "3.4" + then check_cpu_args='-mcpu=$cpu_arg' - ;; - esac + else + check_cpu_args='-mtune=$cpu_arg' + fi ;; *) check_cpu_cflags="" From 3ff229b41817aa8b99c7112d1f54adf5abbeace5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 16:18:10 +0100 Subject: [PATCH 202/789] Many files: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/bdb/bdb.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysql.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysql_upgrade.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqladmin.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqlclient.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqldump.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqlimport.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqlshow.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/client/mysqltest.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/comp_err/comp_err.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/dbug/dbug.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/heap/heap.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/innobase/innobase.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysql/libmysql.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysqld/examples/test_libmysqld.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysqld/libmysqld.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/libmysqltest/myTest.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/my_print_defaults/my_print_defaults.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisam/myisam.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisam_ftdump/myisam_ftdump.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisamchk/myisamchk.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisamlog/myisamlog.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisammrg/myisammrg.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/myisampack/myisampack.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysql.sln: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqlbinlog/mysqlbinlog.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqlcheck/mysqlcheck.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqldemb/mysqldemb.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysqlserver/mysqlserver.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/mysys/mysys.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/perror/perror.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/regex/regex.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/replace/replace.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/sql/gen_lex_hash.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/sql/mysqld.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/strings/strings.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/test1/test1.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/tests/mysql_client_test.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/thr_test/thr_test.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/vio/vio.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc VC++Files/zlib/zlib.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc extra/yassl/taocrypt/taocrypt.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc extra/yassl/yassl.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc scripts/make_win_bin_dist: Major cleanup of old Visual Studio project files, aligning engines etc server-tools/instance-manager/mysqlmanager.vcproj: Major cleanup of old Visual Studio project files, aligning engines etc --- VC++Files/bdb/bdb.vcproj | 2638 +---- VC++Files/client/mysql.vcproj | 196 +- VC++Files/client/mysql_upgrade.vcproj | 122 +- VC++Files/client/mysqladmin.vcproj | 122 +- VC++Files/client/mysqlclient.vcproj | 2856 +----- VC++Files/client/mysqldump.vcproj | 154 +- VC++Files/client/mysqlimport.vcproj | 122 +- VC++Files/client/mysqlshow.vcproj | 122 +- VC++Files/client/mysqltest.vcproj | 147 +- VC++Files/comp_err/comp_err.vcproj | 91 +- VC++Files/dbug/dbug.vcproj | 204 +- VC++Files/heap/heap.vcproj | 910 +- VC++Files/innobase/innobase.vcproj | 2628 +---- VC++Files/libmysql/libmysql.vcproj | 1836 +--- .../libmysqld/examples/test_libmysqld.vcproj | 114 +- VC++Files/libmysqld/libmysqld.vcproj | 4484 +-------- VC++Files/libmysqltest/myTest.vcproj | 162 +- .../my_print_defaults.vcproj | 235 +- VC++Files/myisam/myisam.vcproj | 1840 +--- VC++Files/myisam_ftdump/myisam_ftdump.vcproj | 57 +- VC++Files/myisamchk/myisamchk.vcproj | 228 +- VC++Files/myisamlog/myisamlog.vcproj | 126 +- VC++Files/myisammrg/myisammrg.vcproj | 818 +- VC++Files/myisampack/myisampack.vcproj | 124 +- VC++Files/mysql.sln | 2381 ++--- VC++Files/mysqlbinlog/mysqlbinlog.vcproj | 138 +- VC++Files/mysqlcheck/mysqlcheck.vcproj | 128 +- VC++Files/mysqldemb/mysqldemb.vcproj | 3101 +----- VC++Files/mysqlserver/mysqlserver.vcproj | 38 +- VC++Files/mysys/mysys.vcproj | 4510 +-------- VC++Files/perror/perror.vcproj | 131 +- VC++Files/regex/regex.vcproj | 140 +- VC++Files/replace/replace.vcproj | 123 +- VC++Files/sql/gen_lex_hash.vcproj | 49 +- VC++Files/sql/mysqld.vcproj | 8921 +---------------- VC++Files/strings/strings.vcproj | 796 +- VC++Files/test1/test1.vcproj | 57 +- VC++Files/tests/mysql_client_test.vcproj | 60 +- VC++Files/thr_test/thr_test.vcproj | 54 +- VC++Files/vio/vio.vcproj | 92 +- VC++Files/zlib/zlib.vcproj | 331 +- extra/yassl/taocrypt/taocrypt.vcproj | 390 +- extra/yassl/yassl.vcproj | 246 +- ndb/src/cw/cpcc-win32/C++/CPC_GUI.vcproj | 38 +- scripts/make_win_bin_dist | 1 - .../instance-manager/mysqlmanager.vcproj | 25 +- 46 files changed, 4004 insertions(+), 38082 deletions(-) diff --git a/VC++Files/bdb/bdb.vcproj b/VC++Files/bdb/bdb.vcproj index 56c4da94084..194914acde3 100644 --- a/VC++Files/bdb/bdb.vcproj +++ b/VC++Files/bdb/bdb.vcproj @@ -11,9 +11,9 @@ @@ -27,10 +27,10 @@ StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\max/bdb.pch" - AssemblerListingLocation=".\max/" - ObjectFile="max/" - ProgramDataBaseFileName="max/" + PrecompiledHeaderFile=".\release_obj/bdb.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -38,7 +38,7 @@ Name="VCCustomBuildTool"/> @@ -63,8 +63,8 @@ @@ -76,10 +76,10 @@ PreprocessorDefinitions="__WIN32__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\Debug/bdb.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" + PrecompiledHeaderFile=".\debug_obj/bdb.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -88,7 +88,7 @@ Name="VCCustomBuildTool"/> @@ -120,3100 +120,492 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -139,8 +76,8 @@ @@ -204,113 +142,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysql_upgrade.vcproj b/VC++Files/client/mysql_upgrade.vcproj index 38cae600a75..c01e302f7fa 100644 --- a/VC++Files/client/mysql_upgrade.vcproj +++ b/VC++Files/client/mysql_upgrade.vcproj @@ -12,8 +12,8 @@ @@ -73,8 +74,8 @@ - - - - - - - - - - - - - - - @@ -201,30 +141,6 @@ - - - - - - - - - diff --git a/VC++Files/client/mysqladmin.vcproj b/VC++Files/client/mysqladmin.vcproj index 188bf61dff7..9ef6531529b 100644 --- a/VC++Files/client/mysqladmin.vcproj +++ b/VC++Files/client/mysqladmin.vcproj @@ -10,72 +10,10 @@ Name="Win32"/> - - - - - - - - - - - - - - - @@ -136,8 +75,8 @@ @@ -201,30 +141,6 @@ - - - - - - - - - diff --git a/VC++Files/client/mysqlclient.vcproj b/VC++Files/client/mysqlclient.vcproj index eebba9ebe0e..a3fb0aa9a47 100644 --- a/VC++Files/client/mysqlclient.vcproj +++ b/VC++Files/client/mysqlclient.vcproj @@ -12,8 +12,8 @@ @@ -22,15 +22,15 @@ Optimization="2" InlineFunctionExpansion="1" OptimizeForProcessor="2" - AdditionalIncludeDirectories="../include,../,../extra/yassl/include" + AdditionalIncludeDirectories="../include,../,../extra/yassl/include,../zlib" PreprocessorDefinitions="DBUG_OFF;_WINDOWS;USE_TLS;MYSQL_CLIENT;NDEBUG" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/mysqlclient.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/mysqlclient.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -38,7 +38,7 @@ Name="VCCustomBuildTool"/> @@ -62,8 +62,8 @@ @@ -72,15 +72,15 @@ Optimization="2" InlineFunctionExpansion="1" OptimizeForProcessor="2" - AdditionalIncludeDirectories="../include,../,../extra/yassl/include" + AdditionalIncludeDirectories="../include,../,../extra/yassl/include,../zlib" PreprocessorDefinitions="DBUG_OFF;_WINDOWS;USE_TLS;MYSQL_CLIENT;NDEBUG;CHECK_LICENSE;LICENSE=Commercial" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\authent/mysqlclient.pch" - AssemblerListingLocation=".\authent/" - ObjectFile=".\authent/" - ProgramDataBaseFileName=".\authent/" + PrecompiledHeaderFile=".\authent_obj/mysqlclient.pch" + AssemblerListingLocation=".\authent_obj/" + ObjectFile=".\authent_obj/" + ProgramDataBaseFileName=".\authent_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -88,7 +88,7 @@ Name="VCCustomBuildTool"/> @@ -112,8 +112,8 @@ @@ -121,13 +121,13 @@ Name="VCCLCompilerTool" Optimization="0" OptimizeForProcessor="2" - AdditionalIncludeDirectories="../include,../,../extra/yassl/include" + AdditionalIncludeDirectories="../include,../,../extra/yassl/include,../zlib" PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS;MYSQL_CLIENT" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/mysqlclient.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj/mysqlclient.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -136,7 +136,7 @@ Name="VCCustomBuildTool"/> @@ -164,3168 +164,360 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysqldump.vcproj b/VC++Files/client/mysqldump.vcproj index 39b83fd46f3..4a895f925fe 100644 --- a/VC++Files/client/mysqldump.vcproj +++ b/VC++Files/client/mysqldump.vcproj @@ -12,8 +12,8 @@ @@ -73,8 +74,8 @@ - - - - - - - - - - - - - - - @@ -200,58 +140,10 @@ - - - - - - - - - + RelativePath="my_user.c"> - - - - - - - - - + RelativePath="mysqldump.c"> diff --git a/VC++Files/client/mysqlimport.vcproj b/VC++Files/client/mysqlimport.vcproj index ef440c2fe5a..41d81a8ffae 100644 --- a/VC++Files/client/mysqlimport.vcproj +++ b/VC++Files/client/mysqlimport.vcproj @@ -12,8 +12,8 @@ @@ -73,8 +74,8 @@ - - - - - - - - - - - - - - - @@ -201,30 +141,6 @@ - - - - - - - - - diff --git a/VC++Files/client/mysqlshow.vcproj b/VC++Files/client/mysqlshow.vcproj index a0707680728..b8468286a92 100644 --- a/VC++Files/client/mysqlshow.vcproj +++ b/VC++Files/client/mysqlshow.vcproj @@ -12,8 +12,8 @@ - - - - - - - - - - - - - - - @@ -136,8 +75,8 @@ @@ -201,30 +141,6 @@ - - - - - - - - - diff --git a/VC++Files/client/mysqltest.vcproj b/VC++Files/client/mysqltest.vcproj index 5c075740fbd..0cc5ecd9d03 100644 --- a/VC++Files/client/mysqltest.vcproj +++ b/VC++Files/client/mysqltest.vcproj @@ -12,35 +12,36 @@ - - - - - - - - - - - - - - - @@ -140,8 +77,8 @@ @@ -208,55 +145,9 @@ - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/comp_err/comp_err.vcproj b/VC++Files/comp_err/comp_err.vcproj index b12ef8b0af1..2a95ae09bb4 100644 --- a/VC++Files/comp_err/comp_err.vcproj +++ b/VC++Files/comp_err/comp_err.vcproj @@ -10,10 +10,73 @@ Name="Win32"/> + + + + + + + + + + + + + + + @@ -25,13 +88,13 @@ AdditionalIncludeDirectories="..\include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_MBCSN;DBUG_OFF;_WINDOWS;__WIN__;_MT" StringPooling="TRUE" - RuntimeLibrary="4" + RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\release/comp_err.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/comp_err.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -40,16 +103,16 @@ @@ -78,14 +141,6 @@ - - - diff --git a/VC++Files/dbug/dbug.vcproj b/VC++Files/dbug/dbug.vcproj index 57257451aea..8bdb1a70fae 100644 --- a/VC++Files/dbug/dbug.vcproj +++ b/VC++Files/dbug/dbug.vcproj @@ -12,8 +12,8 @@ @@ -22,13 +22,13 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include" - PreprocessorDefinitions="__WIN32__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS" + PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;__WIN32__;_WINDOWS;USE_TLS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\dbug___Win32_TLS_DEBUG/dbug.pch" - AssemblerListingLocation=".\dbug___Win32_TLS_DEBUG/" - ObjectFile=".\dbug___Win32_TLS_DEBUG/" - ProgramDataBaseFileName=".\dbug___Win32_TLS_DEBUG/" + PrecompiledHeaderFile=".\TLS_DEBUG/dbug.pch" + AssemblerListingLocation=".\TLS_DEBUG/" + ObjectFile=".\TLS_DEBUG/" + ProgramDataBaseFileName=".\TLS_DEBUG/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -37,57 +37,7 @@ Name="VCCustomBuildTool"/> - - - - - - - - - - - - - - @@ -111,8 +61,8 @@ @@ -121,13 +71,13 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include" - PreprocessorDefinitions="__WIN32__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" + PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;__WIN32__;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/dbug.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj/dbug.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -136,7 +86,57 @@ Name="VCCustomBuildTool"/> + + + + + + + + + + + + + + @@ -164,84 +164,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/heap/heap.vcproj b/VC++Files/heap/heap.vcproj index b2afd752acf..d8153ec1c33 100644 --- a/VC++Files/heap/heap.vcproj +++ b/VC++Files/heap/heap.vcproj @@ -10,10 +10,59 @@ Name="Win32"/> + + + + + + + + + + + + + + @@ -27,10 +76,10 @@ StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/heap.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/heap.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -38,7 +87,7 @@ Name="VCCustomBuildTool"/> @@ -62,8 +111,8 @@ @@ -75,10 +124,10 @@ PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\heap___Win32_TLS_DEBUG/heap.pch" - AssemblerListingLocation=".\heap___Win32_TLS_DEBUG/" - ObjectFile=".\heap___Win32_TLS_DEBUG/" - ProgramDataBaseFileName=".\heap___Win32_TLS_DEBUG/" + PrecompiledHeaderFile=".\TLS_DEBUG/heap.pch" + AssemblerListingLocation=".\TLS_DEBUG/" + ObjectFile=".\TLS_DEBUG/" + ProgramDataBaseFileName=".\TLS_DEBUG/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -87,7 +136,7 @@ Name="VCCustomBuildTool"/> @@ -111,8 +160,8 @@ @@ -122,14 +171,14 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include" - PreprocessorDefinitions="DBUG_OFF;_WINDOWS;NDEBUG;USE_TLS" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;_WINDOWS;USE_TLS" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\heap___Win32_TLS/heap.pch" - AssemblerListingLocation=".\heap___Win32_TLS/" - ObjectFile=".\heap___Win32_TLS/" - ProgramDataBaseFileName=".\heap___Win32_TLS/" + PrecompiledHeaderFile=".\TLS/heap.pch" + AssemblerListingLocation=".\TLS/" + ObjectFile=".\TLS/" + ProgramDataBaseFileName=".\TLS/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -137,56 +186,7 @@ Name="VCCustomBuildTool"/> - - - - - - - - - - - - - - @@ -214,846 +214,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/innobase/innobase.vcproj b/VC++Files/innobase/innobase.vcproj index ce607bf0813..a8dd3f00863 100644 --- a/VC++Files/innobase/innobase.vcproj +++ b/VC++Files/innobase/innobase.vcproj @@ -10,62 +10,10 @@ Name="Win32"/> - - - - - - - - - - - - - - @@ -114,8 +62,8 @@ @@ -141,59 +89,7 @@ Name="VCCustomBuildTool"/> - - - - - - - - - - - - - - @@ -222,2733 +118,237 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/libmysql/libmysql.vcproj b/VC++Files/libmysql/libmysql.vcproj index 9ba877e0520..c85cc960f32 100644 --- a/VC++Files/libmysql/libmysql.vcproj +++ b/VC++Files/libmysql/libmysql.vcproj @@ -12,8 +12,8 @@ @@ -24,10 +24,10 @@ AdditionalIncludeDirectories=".,..\include,../zlib,../extra/yassl/include" PreprocessorDefinitions="_DEBUG;_WINDOWS;SAFE_MUTEX;USE_TLS;MYSQL_CLIENT" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/libmysql.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj/libmysql.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -37,7 +37,7 @@ + Name="VCPostBuildEventTool"/> @@ -95,14 +91,14 @@ xcopy debug\libmysql.lib ..\lib_debug\ /y InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories=".,..\include,../zlib,../extra/yassl/include" - PreprocessorDefinitions="DBUG_OFF;_WINDOWS;USE_TLS;NDEBUG;MYSQL_CLIENT" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;USE_TLS;MYSQL_CLIENT;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/libmysql.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/libmysql.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -111,7 +107,7 @@ xcopy debug\libmysql.lib ..\lib_debug\ /y + Name="VCPostBuildEventTool"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/libmysqld/examples/test_libmysqld.vcproj b/VC++Files/libmysqld/examples/test_libmysqld.vcproj index bf26fbd6588..018ed795cc6 100644 --- a/VC++Files/libmysqld/examples/test_libmysqld.vcproj +++ b/VC++Files/libmysqld/examples/test_libmysqld.vcproj @@ -10,10 +10,73 @@ Name="Win32"/> + + + + + + + + + + + + + + + @@ -39,17 +103,17 @@ Name="VCCustomBuildTool"/> @@ -81,47 +145,15 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj index 828e069557d..94447791753 100644 --- a/VC++Files/libmysqld/libmysqld.vcproj +++ b/VC++Files/libmysqld/libmysqld.vcproj @@ -12,8 +12,8 @@ @@ -77,49 +78,50 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> @@ -129,7 +131,7 @@ Name="VCPreLinkEventTool"/> @@ -144,8 +146,8 @@ @@ -209,9 +212,9 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> @@ -274,4332 +278,774 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/libmysqltest/myTest.vcproj b/VC++Files/libmysqltest/myTest.vcproj index afc44b482c9..53f93a7e05d 100644 --- a/VC++Files/libmysqltest/myTest.vcproj +++ b/VC++Files/libmysqltest/myTest.vcproj @@ -10,72 +10,10 @@ Name="Win32"/> - - - - - - - - - - - - - - - @@ -133,28 +71,74 @@ + + + + + + + + + + + + + + + - - - - - - diff --git a/VC++Files/my_print_defaults/my_print_defaults.vcproj b/VC++Files/my_print_defaults/my_print_defaults.vcproj index e49039b6a1e..d1497c25144 100644 --- a/VC++Files/my_print_defaults/my_print_defaults.vcproj +++ b/VC++Files/my_print_defaults/my_print_defaults.vcproj @@ -10,133 +10,10 @@ Name="Win32"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -195,6 +72,69 @@ + + + + + + + + + + + + + + + @@ -204,31 +144,6 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - @@ -25,10 +25,10 @@ PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/myisam.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj/myisam.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -37,7 +37,7 @@ Name="VCCustomBuildTool"/> @@ -62,8 +62,8 @@ @@ -77,10 +77,10 @@ StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/myisam.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/myisam.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -88,58 +88,7 @@ Name="VCCustomBuildTool"/> - - - - - - - - - - - - - - @@ -164,8 +113,8 @@ @@ -177,10 +126,10 @@ PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\myisam___Win32_TLS_DEBUG/myisam.pch" - AssemblerListingLocation=".\myisam___Win32_TLS_DEBUG/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" + PrecompiledHeaderFile=".\TLS_DEBUG/myisam.pch" + AssemblerListingLocation=".\TLS_DEBUG/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -189,7 +138,7 @@ Name="VCCustomBuildTool"/> @@ -212,6 +161,57 @@ + + + + + + + + + + + + + + @@ -221,1858 +221,162 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -72,8 +72,8 @@ @@ -141,23 +141,6 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -194,6 +71,68 @@ + + + + + + + + + + + + + + + @@ -203,31 +142,6 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - @@ -70,73 +71,10 @@ - - - - - - - - - - - - - - - @@ -203,31 +142,6 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - + + + + + + + + + + + + + + @@ -23,14 +73,14 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include" - PreprocessorDefinitions="DBUG_OFF;_WINDOWS;NDEBUG" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/myisammrg.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/myisammrg.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -38,7 +88,7 @@ Name="VCCustomBuildTool"/> @@ -63,8 +113,8 @@ @@ -76,10 +126,10 @@ PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\myisammrg___Win32_TLS_DEBUG/myisammrg.pch" - AssemblerListingLocation=".\myisammrg___Win32_TLS_DEBUG/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" + PrecompiledHeaderFile=".\TLS_DEBUG/myisammrg.pch" + AssemblerListingLocation=".\TLS_DEBUG/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -88,7 +138,7 @@ Name="VCCustomBuildTool"/> @@ -113,8 +163,8 @@ @@ -124,14 +174,14 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include" - PreprocessorDefinitions="DBUG_OFF;_WINDOWS;NDEBUG;USE_TLS" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;_WINDOWS;USE_TLS" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\myisammrg___Win32_TLS/myisammrg.pch" - AssemblerListingLocation=".\myisammrg___Win32_TLS/" - ObjectFile=".\myisammrg___Win32_TLS/" - ProgramDataBaseFileName=".\myisammrg___Win32_TLS/" + PrecompiledHeaderFile=".\TLS/myisammrg.pch" + AssemblerListingLocation=".\TLS/" + ObjectFile=".\TLS/" + ProgramDataBaseFileName=".\TLS/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -139,7 +189,7 @@ Name="VCCustomBuildTool"/> @@ -162,56 +212,6 @@ - - - - - - - - - - - - - - @@ -221,738 +221,66 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -72,8 +73,8 @@ - - - - - - - - - - - - - - - @@ -203,31 +142,6 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - @@ -71,68 +72,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -136,8 +75,8 @@ @@ -204,30 +144,6 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -164,8 +114,8 @@ @@ -213,2781 +165,608 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysqlserver/mysqlserver.vcproj b/VC++Files/mysqlserver/mysqlserver.vcproj index 43988b8489c..d4336990aba 100644 --- a/VC++Files/mysqlserver/mysqlserver.vcproj +++ b/VC++Files/mysqlserver/mysqlserver.vcproj @@ -12,8 +12,8 @@ @@ -63,8 +64,8 @@ @@ -90,7 +92,7 @@ Name="VCCustomBuildTool"/> diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj index 73aa649394e..e17b57675ac 100644 --- a/VC++Files/mysys/mysys.vcproj +++ b/VC++Files/mysys/mysys.vcproj @@ -12,8 +12,56 @@ + + + + + + + + + + + + + + @@ -24,10 +72,10 @@ AdditionalIncludeDirectories="../include,../zlib" PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_SYMDIR" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/mysys.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj98/mysys.pch" + AssemblerListingLocation=".\debug_obj98/" + ObjectFile=".\debug_obj98/" + ProgramDataBaseFileName=".\debug_obj98/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -36,107 +84,7 @@ Name="VCCustomBuildTool"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -160,8 +108,8 @@ @@ -171,14 +119,14 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../zlib" - PreprocessorDefinitions="DBUG_OFF;_WINDOWS;NDEBUG" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;_WINDOWS;NDEBUG" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/mysys.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/mysys.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -186,7 +134,7 @@ Name="VCCustomBuildTool"/> @@ -209,9 +157,9 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> @@ -221,14 +169,14 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;_WINDOWS;NDEBUG" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;_WINDOWS;NDEBUG" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\nt/mysys.pch" - AssemblerListingLocation=".\nt/" - ObjectFile=".\nt/" - ProgramDataBaseFileName=".\nt/" + PrecompiledHeaderFile=".\release_obj98/mysys.pch" + AssemblerListingLocation=".\release_obj98/" + ObjectFile=".\release_obj98/" + ProgramDataBaseFileName=".\release_obj98/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -236,7 +184,7 @@ Name="VCCustomBuildTool"/> @@ -260,8 +208,8 @@ @@ -272,10 +220,10 @@ AdditionalIncludeDirectories="../include,../zlib" PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_SYMDIR;USE_TLS" RuntimeLibrary="1" - PrecompiledHeaderFile=".\mysys___Win32_TLS_DEBUG/mysys.pch" - AssemblerListingLocation=".\mysys___Win32_TLS_DEBUG/" - ObjectFile=".\mysys___Win32_TLS_DEBUG/" - ProgramDataBaseFileName=".\mysys___Win32_TLS_DEBUG/" + PrecompiledHeaderFile=".\TLS_DEBUG/mysys.pch" + AssemblerListingLocation=".\TLS_DEBUG/" + ObjectFile=".\TLS_DEBUG/" + ProgramDataBaseFileName=".\TLS_DEBUG/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -284,7 +232,7 @@ Name="VCCustomBuildTool"/> @@ -308,8 +256,8 @@ @@ -319,14 +267,14 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../zlib" - PreprocessorDefinitions="DBUG_OFF;_WINDOWS;NDEBUG;USE_TLS" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;_WINDOWS;NDEBUG;USE_TLS" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\mysys___Win32_TLS/mysys.pch" - AssemblerListingLocation=".\mysys___Win32_TLS/" - ObjectFile=".\mysys___Win32_TLS/" - ProgramDataBaseFileName=".\mysys___Win32_TLS/" + PrecompiledHeaderFile=".\TLS/mysys.pch" + AssemblerListingLocation=".\TLS/" + ObjectFile=".\TLS/" + ProgramDataBaseFileName=".\TLS/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -334,7 +282,7 @@ Name="VCCustomBuildTool"/> @@ -362,4614 +310,336 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/perror/perror.vcproj b/VC++Files/perror/perror.vcproj index 2a7bb6407c0..c7944d6bda8 100644 --- a/VC++Files/perror/perror.vcproj +++ b/VC++Files/perror/perror.vcproj @@ -10,76 +10,10 @@ Name="Win32"/> - - - - - - - - - - - - - - - @@ -143,8 +78,8 @@ @@ -214,31 +150,6 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - @@ -25,10 +25,10 @@ PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/regex.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj/regex.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -37,7 +37,7 @@ Name="VCCustomBuildTool"/> @@ -61,8 +61,8 @@ @@ -76,10 +76,10 @@ StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/regex.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/regex.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -87,7 +87,7 @@ Name="VCCustomBuildTool"/> @@ -115,136 +115,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/replace/replace.vcproj b/VC++Files/replace/replace.vcproj index 270ff494539..b5a3a8b2da5 100644 --- a/VC++Files/replace/replace.vcproj +++ b/VC++Files/replace/replace.vcproj @@ -12,8 +12,8 @@ @@ -71,8 +73,8 @@ - - - - - - - - - - - - - - - @@ -198,30 +139,6 @@ - - - - - - - - - diff --git a/VC++Files/sql/gen_lex_hash.vcproj b/VC++Files/sql/gen_lex_hash.vcproj index 3f600f34cfb..9ea2bc4c628 100644 --- a/VC++Files/sql/gen_lex_hash.vcproj +++ b/VC++Files/sql/gen_lex_hash.vcproj @@ -13,8 +13,8 @@ + DebugInformationFormat="1" + CompileAs="0"/> @@ -59,7 +61,7 @@ Name="VCPreLinkEventTool"/> @@ -74,8 +76,8 @@ + SuppressStartupBanner="TRUE" + DebugInformationFormat="1" + CompileAs="0"/> diff --git a/VC++Files/sql/mysqld.vcproj b/VC++Files/sql/mysqld.vcproj index e18a6364c8b..347eb578a42 100644 --- a/VC++Files/sql/mysqld.vcproj +++ b/VC++Files/sql/mysqld.vcproj @@ -10,330 +10,10 @@ Name="Win32"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -393,47 +74,46 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> @@ -443,71 +123,7 @@ Name="VCPreLinkEventTool"/> - - - - - - - - - - - - - - - @@ -522,8 +138,8 @@ @@ -584,2922 +201,578 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Debug 98|Win32"> + + + + + + + + + + + + + + + + + + + Name="Classic Debug|Win32"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/strings/strings.vcproj b/VC++Files/strings/strings.vcproj index 8e16a0c7221..6bf8e573394 100644 --- a/VC++Files/strings/strings.vcproj +++ b/VC++Files/strings/strings.vcproj @@ -12,8 +12,8 @@ @@ -27,10 +27,10 @@ StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/strings.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/strings.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -38,7 +38,7 @@ Name="VCCustomBuildTool"/> @@ -62,8 +62,8 @@ @@ -75,10 +75,10 @@ PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/strings.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj/strings.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -87,7 +87,7 @@ Name="VCCustomBuildTool"/> @@ -115,918 +115,150 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/test1/test1.vcproj b/VC++Files/test1/test1.vcproj index 6a850f7b2e3..0bf34f375b2 100644 --- a/VC++Files/test1/test1.vcproj +++ b/VC++Files/test1/test1.vcproj @@ -12,8 +12,8 @@ @@ -39,15 +39,16 @@ Name="VCCustomBuildTool"/> @@ -72,8 +73,8 @@ @@ -137,23 +137,6 @@ - - - - - - diff --git a/VC++Files/tests/mysql_client_test.vcproj b/VC++Files/tests/mysql_client_test.vcproj index 89a9b71e60a..c22b7b6420a 100644 --- a/VC++Files/tests/mysql_client_test.vcproj +++ b/VC++Files/tests/mysql_client_test.vcproj @@ -12,14 +12,14 @@ @@ -39,17 +39,17 @@ @@ -73,8 +73,8 @@ @@ -86,10 +86,10 @@ PreprocessorDefinitions="_DEBUG;_WINDOWS;SAFE_MUTEX;USE_TLS;MYSQL_CLIENT;__WIN__;_WIN32" BasicRuntimeChecks="3" RuntimeLibrary="1" - PrecompiledHeaderFile=".\Debug/mysql_client_test.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" + PrecompiledHeaderFile=".\debug_obj/mysql_client_test.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -99,20 +99,18 @@ @@ -140,22 +138,6 @@ - - - - - - diff --git a/VC++Files/thr_test/thr_test.vcproj b/VC++Files/thr_test/thr_test.vcproj index ede9bd04de8..34d5c163006 100644 --- a/VC++Files/thr_test/thr_test.vcproj +++ b/VC++Files/thr_test/thr_test.vcproj @@ -12,8 +12,8 @@ @@ -72,8 +72,8 @@ @@ -100,15 +100,15 @@ Name="VCCustomBuildTool"/> @@ -137,24 +137,6 @@ - - - - - - diff --git a/VC++Files/vio/vio.vcproj b/VC++Files/vio/vio.vcproj index 3f50c1546fb..9d66765af5d 100644 --- a/VC++Files/vio/vio.vcproj +++ b/VC++Files/vio/vio.vcproj @@ -12,8 +12,8 @@ @@ -27,10 +27,10 @@ StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/vio.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/vio.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" CompileAs="0"/> @@ -38,7 +38,7 @@ Name="VCCustomBuildTool"/> @@ -63,8 +63,8 @@ @@ -75,10 +75,10 @@ AdditionalIncludeDirectories="../include,../extra/yassl/include" PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_SYMDIR" RuntimeLibrary="1" - PrecompiledHeaderFile=".\Debug/vio.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" + PrecompiledHeaderFile=".\debug_obj/vio.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="1" @@ -87,7 +87,7 @@ Name="VCCustomBuildTool"/> @@ -119,79 +119,15 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - @@ -23,66 +23,19 @@ OptimizeForProcessor="2" PreprocessorDefinitions="_DEBUG;__WIN32__;_WINDOWS" RuntimeLibrary="1" - PrecompiledHeaderFile=".\debug/zlib.pch" - AssemblerListingLocation=".\debug/" - ObjectFile=".\debug/" - ProgramDataBaseFileName=".\debug/" + PrecompiledHeaderFile=".\debug_obj/zlib.pch" + AssemblerListingLocation=".\debug_obj/" + ObjectFile=".\debug_obj/" + ProgramDataBaseFileName=".\debug_obj/" WarningLevel="3" SuppressStartupBanner="TRUE" - DebugInformationFormat="1"/> + DebugInformationFormat="1" + CompileAs="0"/> - - - - - - - - - - - - - - @@ -106,8 +59,8 @@ @@ -120,17 +73,17 @@ StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" - PrecompiledHeaderFile=".\release/zlib.pch" - AssemblerListingLocation=".\release/" - ObjectFile=".\release/" - ProgramDataBaseFileName=".\release/" + PrecompiledHeaderFile=".\release_obj/zlib.pch" + AssemblerListingLocation=".\release_obj/" + ObjectFile=".\release_obj/" + ProgramDataBaseFileName=".\release_obj/" WarningLevel="3" SuppressStartupBanner="TRUE"/> @@ -158,177 +111,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -338,54 +144,12 @@ - - - - - - - - - - - - - - - - - - @@ -395,54 +159,12 @@ - - - - - - - - - - - - - - - - - - @@ -452,27 +174,6 @@ - - - - - - - - - diff --git a/extra/yassl/taocrypt/taocrypt.vcproj b/extra/yassl/taocrypt/taocrypt.vcproj index 7ffcb664346..bcbc0f82192 100755 --- a/extra/yassl/taocrypt/taocrypt.vcproj +++ b/extra/yassl/taocrypt/taocrypt.vcproj @@ -12,8 +12,8 @@ @@ -65,8 +66,8 @@ @@ -93,7 +95,7 @@ Name="VCCustomBuildTool"/> @@ -125,423 +127,63 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -65,8 +66,8 @@ @@ -93,7 +95,7 @@ Name="VCCustomBuildTool"/> @@ -125,255 +127,39 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + TypeLibraryName=".\release_obj/CPC_GUI.tlb"/> + TypeLibraryName=".\debug_obj/CPC_GUI.tlb"/> Date: Mon, 19 Mar 2007 16:45:09 +0100 Subject: [PATCH 203/789] Manual merge mysql-test/r/sp.result: Manual merge. - lowercase 'default' changes to uppercase 'DEFAULT' sql/item_func.cc: Manual merge - shared tables is handled differently in 5.1. - Use of LEX_STRING instead of char*. - Dummy table allocated differently. --- mysql-test/r/sp.result | 20 ++++++++++---------- sql/item_func.cc | 11 ++++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 033409f3d77..1c91c964cb9 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5899,16 +5899,16 @@ insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, show create table examplebug20777; Table Create Table examplebug20777 CREATE TABLE `examplebug20777` ( - `i` int(1) NOT NULL default '0', - `2**63-2` bigint(20) unsigned default NULL, - `2**63-1` bigint(20) unsigned default NULL, - `2**63` bigint(20) unsigned default NULL, - `2**63+1` bigint(20) unsigned default NULL, - `2**64-2` bigint(20) unsigned default NULL, - `2**64-1` bigint(20) unsigned default NULL, - `2**64` bigint(20) unsigned default NULL, - `0` bigint(20) unsigned default NULL, - `-1` bigint(20) unsigned default NULL + `i` int(1) NOT NULL DEFAULT '0', + `2**63-2` bigint(20) unsigned DEFAULT NULL, + `2**63-1` bigint(20) unsigned DEFAULT NULL, + `2**63` bigint(20) unsigned DEFAULT NULL, + `2**63+1` bigint(20) unsigned DEFAULT NULL, + `2**64-2` bigint(20) unsigned DEFAULT NULL, + `2**64-1` bigint(20) unsigned DEFAULT NULL, + `2**64` bigint(20) unsigned DEFAULT NULL, + `0` bigint(20) unsigned DEFAULT NULL, + `-1` bigint(20) unsigned DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from examplebug20777 order by i; i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 0 -1 diff --git a/sql/item_func.cc b/sql/item_func.cc index 2cb67cb28a4..601682e0313 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5009,7 +5009,7 @@ Item_func_sp::cleanup() sp_result_field= NULL; } m_sp= NULL; - dummy_table->s= NULL; + dummy_table->alias= NULL; Item_func::cleanup(); } @@ -5057,13 +5057,13 @@ bool Item_func_sp::init_result_field(THD *thd) { DBUG_ENTER("Item_func_sp::init_result_field"); + + LEX_STRING empty_name= { STRING_WITH_LEN("") }; - char *empty_name= (char *) ""; TABLE_SHARE *share; DBUG_ASSERT(m_sp == NULL); DBUG_ASSERT(sp_result_field == NULL); - DBUG_ASSERT(dummy_table->s == NULL); if (!(m_sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, m_name, &thd->sp_func_cache, TRUE))) @@ -5078,8 +5078,9 @@ Item_func_sp::init_result_field(THD *thd) Below we "create" a dummy table by initializing the needed pointers. */ - dummy_table->s= share= &dummy_table->share_not_to_be_used; - dummy_table->alias = empty_name; + + share= dummy_table->s; + dummy_table->alias = ""; dummy_table->maybe_null = maybe_null; dummy_table->in_use= thd; dummy_table->copy_blobs= TRUE; From f5e1dad7d0922ad2305eeff119c33bba2b0c252c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 16:45:37 +0100 Subject: [PATCH 204/789] make_win_bin_dist: Restore accidently removed line scripts/make_win_bin_dist: Restore accidently removed line --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index b1ef199375f..a674fe08362 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -306,6 +306,7 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ +cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ From dd322a8c59201a54a1e2ee243415a5cb68c5e298 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 20:44:46 +0100 Subject: [PATCH 205/789] BUG#27270 Can't compile latest 5.1-main sql/sql_yacc.yy: BUG#27270 remove semicolon that is ignored by newer versions of bison but an error with 1.875 --- sql/sql_yacc.yy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7da1ddc7cad..96c4588e57c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7561,13 +7561,13 @@ index_hint_definition: { Select->set_index_hint_type($1, $3); } - '(' key_usage_list ')'; + '(' key_usage_list ')' | USE_SYM key_or_index index_hint_clause { Select->set_index_hint_type(INDEX_HINT_USE, $3); } - '(' opt_key_usage_list ')'; - + '(' opt_key_usage_list ')' + ; index_hints_list: index_hint_definition From 46d02a2c01e2a102e827f9c9491b3447ed4d76bc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 22:41:16 +0100 Subject: [PATCH 206/789] mysys.vcproj: Removed accidently added my_winsem.c make_win_bin_dist: Corrected test for relwithdebinfo target mysql.sln: Specify that comp_err depends on zlib VC++Files/mysys/mysys.vcproj: Removed accidently added my_winsem.c VC++Files/mysql.sln: Specify that comp_err depends on zlib scripts/make_win_bin_dist: Corrected test for relwithdebinfo target --- VC++Files/mysql.sln | 1 + VC++Files/mysys/mysys.vcproj | 3 --- scripts/make_win_bin_dist | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln index 22f274ef7f6..31b9232e2ec 100644 --- a/VC++Files/mysql.sln +++ b/VC++Files/mysql.sln @@ -4,6 +4,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comp_err", "comp_err\comp_e {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbug", "dbug\dbug.vcproj", "{FC369DF4-AEB7-4531-BF34-A638C4363BFE}" diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj index e17b57675ac..e1f7a03e9dc 100644 --- a/VC++Files/mysys/mysys.vcproj +++ b/VC++Files/mysys/mysys.vcproj @@ -590,9 +590,6 @@ - - diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index a674fe08362..59018195ef2 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -132,7 +132,7 @@ trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR # Adjust target name if needed, release with debug info has another name # ---------------------------------------------------------------------- -if [ x"$TARGET" = x"release" -a "client/relwithdebinfo/mysql.exe" ] +if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ] then TARGET="relwithdebinfo" fi From 3798a7d5008f8f569f779f096b7fc1e1cfac1031 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 00:46:19 +0300 Subject: [PATCH 207/789] sql_insert.cc: Removed wrong fix for the bug#27006. The bug was added by the fix for the bug#19978 and fixed by Monty on 2007/02/21. trigger.test, trigger.result: Corrected test case for the bug#27006. sql/sql_insert.cc: Removed wrong fix for the bug#27006. The bug was added by the fix for the bug#19978 and fixed by Monty on 2007/02/21. mysql-test/t/trigger.test: Corrected test case for the bug#27006. mysql-test/r/trigger.result: Corrected test case for the bug#27006. --- mysql-test/r/trigger.result | 11 ++++++----- mysql-test/t/trigger.test | 6 +++--- sql/sql_insert.cc | 10 +++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index da72973dc52..0a0be41927a 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1398,18 +1398,19 @@ id val 1 test1 2 test2 INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val); -INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val); +INSERT INTO t1 VALUES (2,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val); +INSERT INTO t1 VALUES (3,'test4') ON DUPLICATE KEY UPDATE val=VALUES(val); SELECT * FROM t1; id val 1 test1 -2 test2 -3 test3 +2 test3 +3 test4 SELECT * FROM t2; id val 1 test1 2 test2 -3 test2 -4 test3 +3 test3 +4 test4 DROP TRIGGER trg27006_a_insert; DROP TRIGGER trg27006_a_update; drop table t1,t2; diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 49b7b527bd9..a01efba11db 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -1700,8 +1700,7 @@ DROP PROCEDURE bug22580_proc_1; DROP PROCEDURE bug22580_proc_2; # -# Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY -# UPDATE if the row wasn't actually changed. +# Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE # --disable_warnings DROP TRIGGER IF EXISTS trg27006_a_update; @@ -1730,7 +1729,8 @@ INSERT INTO t1(val) VALUES ('test1'),('test2'); SELECT * FROM t1; SELECT * FROM t2; INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val); -INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val); +INSERT INTO t1 VALUES (2,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val); +INSERT INTO t1 VALUES (3,'test4') ON DUPLICATE KEY UPDATE val=VALUES(val); SELECT * FROM t1; SELECT * FROM t2; DROP TRIGGER trg27006_a_insert; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index dd08ccef462..d9d32d14321 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1238,19 +1238,19 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) if (table->next_number_field) table->file->adjust_next_insert_id_after_explicit_value( table->next_number_field->val_int()); - info->touched++; + if ((table->file->table_flags() & HA_PARTIAL_COLUMN_READ) || compare_record(table, thd->query_id)) { info->updated++; + trg_error= (table->triggers && + table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, + TRG_ACTION_AFTER, + TRUE)); info->copied++; } - trg_error= (table->triggers && - table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, - TRG_ACTION_AFTER, - TRUE)); goto ok_or_after_trg_err; } else /* DUP_REPLACE */ From c71bff6d1c009cb28b007b67e92d62591615921e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 01:37:33 +0300 Subject: [PATCH 208/789] sql_insert.cc: After merge fix. sql/sql_insert.cc: After merge fix. --- sql/sql_insert.cc | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 242ae16a5d3..adb5c34fd37 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1262,26 +1262,22 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) compare_record(table)) { info->updated++; + /* + If ON DUP KEY UPDATE updates a row instead of inserting one, it's + like a regular UPDATE statement: it should not affect the value of a + next SELECT LAST_INSERT_ID() or mysql_insert_id(). + Except if LAST_INSERT_ID(#) was in the INSERT query, which is + handled separately by THD::arg_of_last_insert_id_function. + */ + insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0; + if (table->next_number_field) + table->file->adjust_next_insert_id_after_explicit_value( + table->next_number_field->val_int()); trg_error= (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, - TRG_ACTION_AFTER, - TRUE)); + TRG_ACTION_AFTER, TRUE)); info->copied++; } - /* - If ON DUP KEY UPDATE updates a row instead of inserting one, it's - like a regular UPDATE statement: it should not affect the value of a - next SELECT LAST_INSERT_ID() or mysql_insert_id(). - Except if LAST_INSERT_ID(#) was in the INSERT query, which is - handled separately by THD::arg_of_last_insert_id_function. - */ - insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0; - if (table->next_number_field) - table->file->adjust_next_insert_id_after_explicit_value( - table->next_number_field->val_int()); - trg_error= (table->triggers && - table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, - TRG_ACTION_AFTER, TRUE)); goto ok_or_after_trg_err; } From 4c07323096d5d45f49352e8e3b41701416246ff2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 10:36:20 +0800 Subject: [PATCH 209/789] BUG#21699 DROP last DATAFILE from TABLESPACE even though there are still table in it. And it gives the cofusing error message. mysql-test/r/ndb_dd_basic.result: adding some test result for increasing test codes. mysql-test/t/ndb_dd_basic.test: adding some test codes for nodatafile in tablespace. storage/ndb/include/kernel/signaldata/Extent.hpp: Add NoDatafile error code when allocating extent. storage/ndb/src/kernel/blocks/tsman.cpp: when there is no datafile in spacefile , it should return NoDatafile error code, rather than NoExtentAvailable. storage/ndb/src/ndbapi/ndberror.c: add no datafile error code and corresponding error message for NoDatafile --- mysql-test/r/ndb_dd_basic.result | 28 +++++++++++++ mysql-test/t/ndb_dd_basic.test | 40 +++++++++++++++++++ .../ndb/include/kernel/signaldata/Extent.hpp | 3 +- storage/ndb/src/kernel/blocks/tsman.cpp | 6 +++ storage/ndb/src/ndbapi/ndberror.c | 3 +- 5 files changed, 78 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/r/ndb_dd_basic.result index 014858e6856..470c2cb9c0e 100644 --- a/mysql-test/r/ndb_dd_basic.result +++ b/mysql-test/r/ndb_dd_basic.result @@ -186,6 +186,34 @@ INITIAL_SIZE 1000000000000K ENGINE = NDB; ERROR HY000: The size number was correct but we don't allow the digit part to be more than 2 billion DROP TABLE t1; +create tablespace ts2 +add datafile 'datafile2_1.dat' +use logfile group lg1 +initial_size 12M +engine ndb; +CREATE TABLE City ( +ID int(11) NOT NULL AUTO_INCREMENT, +Name char(35) NOT NULL, +CountryCode char(3) NOT NULL, +District char(20) NOT NULL, +Population int(11) NOT NULL, +PRIMARY KEY (ID) +) ENGINE=ndbcluster +tablespace ts2 +storage disk; +alter tablespace ts2 +drop datafile 'datafile2_1.dat' +engine ndb; +insert +into City (Name,CountryCode,District,Population) +values ('BeiJing','CN','Beijing',2000); +ERROR HY000: Got error 1602 'No datafile in tablespace' from NDBCLUSTER +drop tablespace ts2 +engine ndb; +ERROR HY000: Failed to drop TABLESPACE +drop table City; +drop tablespace ts2 +engine ndb; CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); BEGIN; diff --git a/mysql-test/t/ndb_dd_basic.test b/mysql-test/t/ndb_dd_basic.test index 5d43d7997b0..81286d3121f 100644 --- a/mysql-test/t/ndb_dd_basic.test +++ b/mysql-test/t/ndb_dd_basic.test @@ -7,6 +7,10 @@ # Change Date: 2006-01-11 # Change: Cleanup and test rename ################################# +# Change Author: Guangbao Ni +# Change Date: 2007-03-20 +# Change: Test insert data when no datafile in spacetable +################################# -- source include/have_ndb.inc @@ -216,6 +220,42 @@ ENGINE = NDB; DROP TABLE t1; +create tablespace ts2 +add datafile 'datafile2_1.dat' +use logfile group lg1 +initial_size 12M +engine ndb; + +CREATE TABLE City ( + ID int(11) NOT NULL AUTO_INCREMENT, + Name char(35) NOT NULL, + CountryCode char(3) NOT NULL, + District char(20) NOT NULL, + Population int(11) NOT NULL, + PRIMARY KEY (ID) +) ENGINE=ndbcluster +tablespace ts2 +storage disk; + +alter tablespace ts2 +drop datafile 'datafile2_1.dat' +engine ndb; + +#It will give error messages: NoDatafile in tablespace +--error ER_GET_ERRMSG +insert +into City (Name,CountryCode,District,Population) +values ('BeiJing','CN','Beijing',2000); + +--error ER_DROP_FILEGROUP_FAILED +drop tablespace ts2 +engine ndb; + +drop table City; + +drop tablespace ts2 +engine ndb; + ############################ # Test update of mm/dd part ############################ diff --git a/storage/ndb/include/kernel/signaldata/Extent.hpp b/storage/ndb/include/kernel/signaldata/Extent.hpp index 88f2e394233..283ea7ba85a 100644 --- a/storage/ndb/include/kernel/signaldata/Extent.hpp +++ b/storage/ndb/include/kernel/signaldata/Extent.hpp @@ -31,7 +31,8 @@ struct AllocExtentReq { enum ErrorCode { UnmappedExtentPageIsNotImplemented = 1, - NoExtentAvailable = 1601 + NoExtentAvailable = 1601, + NoDatafile = 1602 }; union diff --git a/storage/ndb/src/kernel/blocks/tsman.cpp b/storage/ndb/src/kernel/blocks/tsman.cpp index 99fbc683cee..62aa80a67fe 100644 --- a/storage/ndb/src/kernel/blocks/tsman.cpp +++ b/storage/ndb/src/kernel/blocks/tsman.cpp @@ -1483,6 +1483,12 @@ Tsman::execALLOC_EXTENT_REQ(Signal* signal) { jam(); err = AllocExtentReq::NoExtentAvailable; + Local_datafile_list full_tmp(m_file_pool, ts_ptr.p->m_full_files); + if (tmp.isEmpty() && full_tmp.isEmpty()) + { + jam(); + err = AllocExtentReq::NoDatafile; + } } /** diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c index 7dd16f2d57f..b21b64156c8 100644 --- a/storage/ndb/src/ndbapi/ndberror.c +++ b/storage/ndb/src/ndbapi/ndberror.c @@ -201,7 +201,8 @@ ErrorBundle ErrorCodes[] = { { 904, HA_ERR_INDEX_FILE_FULL, IS, "Out of fragment records (increase MaxNoOfOrderedIndexes)" }, { 905, DMEC, IS, "Out of attribute records (increase MaxNoOfAttributes)" }, { 1601, HA_ERR_RECORD_FILE_FULL, IS, "Out extents, tablespace full" }, - + { 1602, DMEC, IS,"No datafile in tablespace" }, + /** * TimeoutExpired */ From a0e0166ba55f696e519d4073dea5fcdd8b74542d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 08:52:01 +0100 Subject: [PATCH 210/789] BUG#22583: RBR between MyISAM and non-MyISAM tables containing a BIT field does not work Fix to prevent MyISAM from reading data from NULL BLOB. Fix to make record comparison independent of values of unused bits in record. Updating binlog positions in tests. mysql-test/extra/rpl_tests/rpl_multi_query.test: Binlog position change mysql-test/extra/rpl_tests/rpl_stm_charset.test: Binlog position change mysql-test/include/show_binlog_events.inc: Binlog position change mysql-test/r/binlog_stm_binlog.result: Result change mysql-test/r/binlog_stm_ctype_ucs.result: Result change mysql-test/r/binlog_stm_insert_select.result: Result change mysql-test/r/binlog_stm_mix_innodb_myisam.result: Result change mysql-test/r/ctype_cp932_binlog_stm.result: Result change mysql-test/r/ndb_binlog_multi.result: Result change mysql-test/r/rpl_known_bugs_detection.result: Result change mysql-test/r/rpl_loaddata.result: Result change mysql-test/r/rpl_loaddata_s.result: Result change mysql-test/r/rpl_ndb_charset.result: Result change mysql-test/r/rpl_ndb_extraCol.result: Result change mysql-test/r/rpl_ndb_log.result: Result change mysql-test/r/rpl_ndb_multi.result: Result change mysql-test/r/rpl_rbr_to_sbr.result: Result change mysql-test/r/rpl_rotate_logs.result: Result change mysql-test/r/rpl_sp.result: Result change mysql-test/r/rpl_stm_charset.result: Result change mysql-test/r/rpl_stm_flsh_tbls.result: Result change mysql-test/r/rpl_stm_log.result: Result change mysql-test/r/rpl_stm_max_relay_size.result: Result change mysql-test/r/rpl_stm_multi_query.result: Result change mysql-test/r/rpl_stm_reset_slave.result: Result change mysql-test/r/rpl_stm_until.result: Result change mysql-test/r/rpl_truncate_7ndb.result: Result change mysql-test/r/user_var-binlog.result: Result change mysql-test/t/binlog_stm_mix_innodb_myisam.test: Binlog position change mysql-test/t/ctype_cp932_binlog_stm.test: Binlog position change mysql-test/t/mysqlbinlog.test: Binlog position change mysql-test/t/mysqlbinlog2.test: Binlog position change mysql-test/t/rpl_sp.test: Binlog position change mysql-test/t/rpl_stm_flsh_tbls.test: Binlog position change sql/log_event.cc: Emptying the record entirely since it appears MyISAM reads blob column data even when they are NULL. Adding code to set unused bits of the records before doing a comparison, and restoring the original values after. Setting the unused bits is necessary since NDB does not set them correctly, and resetting them afterwards is needed because MyISAM compares the record with the one located when updating or deleting it. mysql-test/r/rpl_row_basic_11bugs-master.opt: New BitKeeper file ``mysql-test/r/rpl_row_basic_11bugs-master.opt'' mysql-test/r/rpl_row_basic_11bugs-slave.opt: New BitKeeper file ``mysql-test/r/rpl_row_basic_11bugs-slave.opt'' --- .../extra/rpl_tests/rpl_multi_query.test | 2 +- .../extra/rpl_tests/rpl_stm_charset.test | 2 +- mysql-test/include/show_binlog_events.inc | 2 +- mysql-test/r/binlog_stm_binlog.result | 20 ++-- mysql-test/r/binlog_stm_ctype_ucs.result | 6 +- mysql-test/r/binlog_stm_insert_select.result | 6 +- .../r/binlog_stm_mix_innodb_myisam.result | 28 ++--- mysql-test/r/ctype_cp932_binlog_stm.result | 14 +-- mysql-test/r/ndb_binlog_multi.result | 4 + mysql-test/r/rpl_known_bugs_detection.result | 4 +- mysql-test/r/rpl_loaddata.result | 6 +- mysql-test/r/rpl_loaddata_s.result | 2 +- mysql-test/r/rpl_ndb_charset.result | 2 +- mysql-test/r/rpl_ndb_extraCol.result | 54 ++++----- mysql-test/r/rpl_ndb_log.result | 19 ++-- mysql-test/r/rpl_ndb_multi.result | 4 +- mysql-test/r/rpl_rbr_to_sbr.result | 4 +- mysql-test/r/rpl_rotate_logs.result | 30 ++--- mysql-test/r/rpl_row_basic_11bugs-master.opt | 1 + mysql-test/r/rpl_row_basic_11bugs-slave.opt | 1 + mysql-test/r/rpl_sp.result | 2 +- mysql-test/r/rpl_stm_charset.result | 2 +- mysql-test/r/rpl_stm_flsh_tbls.result | 4 +- mysql-test/r/rpl_stm_log.result | 16 +-- mysql-test/r/rpl_stm_max_relay_size.result | 22 ++-- mysql-test/r/rpl_stm_multi_query.result | 2 +- mysql-test/r/rpl_stm_reset_slave.result | 6 +- mysql-test/r/rpl_stm_until.result | 16 +-- mysql-test/r/rpl_truncate_7ndb.result | 72 ++++++------ mysql-test/r/user_var-binlog.result | 2 +- .../t/binlog_stm_mix_innodb_myisam.test | 2 +- mysql-test/t/ctype_cp932_binlog_stm.test | 2 +- mysql-test/t/mysqlbinlog.test | 4 +- mysql-test/t/mysqlbinlog2.test | 16 +-- mysql-test/t/rpl_sp.test | 2 +- mysql-test/t/rpl_stm_flsh_tbls.test | 2 +- sql/log_event.cc | 104 +++++++++++++++--- 37 files changed, 286 insertions(+), 201 deletions(-) create mode 100644 mysql-test/r/rpl_row_basic_11bugs-master.opt create mode 100644 mysql-test/r/rpl_row_basic_11bugs-slave.opt diff --git a/mysql-test/extra/rpl_tests/rpl_multi_query.test b/mysql-test/extra/rpl_tests/rpl_multi_query.test index 30a83886a86..a1b3b9de5f5 100644 --- a/mysql-test/extra/rpl_tests/rpl_multi_query.test +++ b/mysql-test/extra/rpl_tests/rpl_multi_query.test @@ -25,6 +25,6 @@ select * from mysqltest.t1; connection master; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; drop database mysqltest; sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_stm_charset.test b/mysql-test/extra/rpl_tests/rpl_stm_charset.test index 5657b06e88f..4822ba60db0 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_charset.test @@ -111,7 +111,7 @@ drop database mysqltest2; drop database mysqltest3; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 105; sync_slave_with_master; # Check that we can change global.collation_server (since 5.0.3) diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index ae848d10687..ce59bdb4f94 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -1,4 +1,4 @@ ---let $binlog_start=102 +--let $binlog_start=105 --replace_result $binlog_start --replace_column 2 # 4 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index fb0453b5b68..0d587175cd3 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -4,11 +4,11 @@ insert into t1 values (1,2); commit; show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # -master-bin.000001 102 Query 1 209 use `test`; create table t1 (a int, b int) engine=innodb -master-bin.000001 209 Query 1 277 use `test`; BEGIN -master-bin.000001 277 Query 1 90 use `test`; insert into t1 values (1,2) -master-bin.000001 367 Xid 1 394 COMMIT /* XID */ +master-bin.000001 4 Format_desc 1 105 Server ver: #, Binlog ver: # +master-bin.000001 105 Query 1 212 use `test`; create table t1 (a int, b int) engine=innodb +master-bin.000001 212 Query 1 280 use `test`; BEGIN +master-bin.000001 280 Query 1 90 use `test`; insert into t1 values (1,2) +master-bin.000001 370 Xid 1 397 COMMIT /* XID */ drop table t1; drop table if exists t1, t2; reset master; @@ -20,7 +20,7 @@ commit; begin; insert t2 values (5); commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb @@ -36,7 +36,7 @@ create table t1 (n int) engine=innodb; begin; commit; drop table t1; -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb master-bin.000001 # Query 1 # use `test`; BEGIN @@ -142,7 +142,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4) master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4) master-bin.000001 # Xid 1 # COMMIT /* xid= */ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002' from 102; +show binlog events in 'master-bin.000002' from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 reset master; @@ -164,7 +164,7 @@ INSERT INTO user SET host='localhost', user='@#@', password=password('Just a tes UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Intvar 1 # INSERT_ID=127 @@ -183,7 +183,7 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Intvar 1 # INSERT_ID=127 diff --git a/mysql-test/r/binlog_stm_ctype_ucs.result b/mysql-test/r/binlog_stm_ctype_ucs.result index 76f3a3b06b9..e79803223e3 100644 --- a/mysql-test/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/r/binlog_stm_ctype_ucs.result @@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 102 User var 1 142 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci -master-bin.000001 142 Query 1 231 use `test`; insert into t2 values (@v) +master-bin.000001 105 User var 1 145 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci +master-bin.000001 145 Query 1 234 use `test`; insert into t2 values (@v) flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/r/binlog_stm_insert_select.result b/mysql-test/r/binlog_stm_insert_select.result index 646a76b254d..47dc9cb3097 100644 --- a/mysql-test/r/binlog_stm_insert_select.result +++ b/mysql-test/r/binlog_stm_insert_select.result @@ -8,8 +8,8 @@ insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 196 use `test`; insert into t1 select * from t2 +master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 199 use `test`; insert into t1 select * from t2 select * from t1; a 1 @@ -22,5 +22,5 @@ create table t2(unique(a)) select a from t1; ERROR 23000: Duplicate entry '1' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 drop table t1; diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/r/binlog_stm_mix_innodb_myisam.result index 23f4e50826a..5592c06460e 100644 --- a/mysql-test/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_stm_mix_innodb_myisam.result @@ -6,7 +6,7 @@ begin; insert into t1 values(1); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) @@ -21,7 +21,7 @@ insert into t2 select * from t1; rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(2) @@ -39,7 +39,7 @@ rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(3) @@ -65,7 +65,7 @@ select a from t1 order by a; a 5 7 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(5) @@ -87,7 +87,7 @@ insert into t2 select * from t1; select get_lock("a",10); get_lock("a",10) 1 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(8) @@ -98,7 +98,7 @@ delete from t2; reset master; insert into t1 values(9); insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values(9) master-bin.000001 # Xid 1 # COMMIT /* xid= */ @@ -109,14 +109,14 @@ reset master; insert into t1 values(10); begin; insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values(10) master-bin.000001 # Xid 1 # COMMIT /* xid= */ master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 insert into t1 values(11); commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values(10) master-bin.000001 # Xid 1 # COMMIT /* xid= */ @@ -132,7 +132,7 @@ begin; insert into t1 values(12); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(12) @@ -145,7 +145,7 @@ begin; insert into t1 values(13); insert into t2 select * from t1; rollback; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; delete from t2; @@ -157,7 +157,7 @@ insert into t1 values(15); insert into t2 select * from t1; rollback to savepoint my_savepoint; commit; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(14) @@ -177,7 +177,7 @@ select a from t1 order by a; a 16 18 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(16) @@ -227,7 +227,7 @@ insert into t2 values (3); select get_lock("lock1",60); get_lock("lock1",60) 1 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(16) @@ -331,7 +331,7 @@ SELECT * from t2; a b 100 100 DROP TABLE t1,t2; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (1,1),(1,2) master-bin.000001 # Query 1 # use `test`; DROP TABLE if exists t2 diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index ef024e2fa20..d9d982a77dc 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -6,7 +6,7 @@ CREATE TABLE t1(f1 blob); PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; SET @var1= x'8300'; EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary @@ -30,17 +30,17 @@ HEX(s1) HEX(s2) d 466F6F2773206120426172 ED40ED41ED42 47.93 DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 406| +SHOW BINLOG EVENTS FROM 409| Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 406 Query 1 572 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, +master-bin.000001 409 Query 1 575 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, s2 CHAR(50) CHARACTER SET cp932, d DECIMAL(10,2)) -master-bin.000001 572 Query 1 820 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50), +master-bin.000001 575 Query 1 823 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50), IN ins2 CHAR(50) CHARACTER SET cp932, IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 820 Query 1 1039 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) -master-bin.000001 1039 Query 1 1128 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1128 Query 1 1207 use `test`; DROP TABLE t4 +master-bin.000001 823 Query 1 1042 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) +master-bin.000001 1042 Query 1 1131 use `test`; DROP PROCEDURE bug18293 +master-bin.000001 1131 Query 1 1210 use `test`; DROP TABLE t4 diff --git a/mysql-test/r/ndb_binlog_multi.result b/mysql-test/r/ndb_binlog_multi.result index 3a84c89a7a4..cae1cfa8ce7 100644 --- a/mysql-test/r/ndb_binlog_multi.result +++ b/mysql-test/r/ndb_binlog_multi.result @@ -13,6 +13,7 @@ master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Table_map # # table_id: # (test.t2) master-bin1.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) master-bin1.000001 # Write_rows # # table_id: # +master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Query # # COMMIT select * from t2 order by a; @@ -35,6 +36,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE t2 @@ -53,6 +55,7 @@ master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Table_map # # table_id: # (test.t1) master-bin1.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) master-bin1.000001 # Write_rows # # table_id: # +master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Query # # COMMIT SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM @@ -71,6 +74,7 @@ master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Table_map # # table_id: # (test.t1) master-bin1.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) master-bin1.000001 # Write_rows # # table_id: # +master-bin1.000001 # Write_rows # # table_id: # master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # use `test`; drop table t1 diff --git a/mysql-test/r/rpl_known_bugs_detection.result b/mysql-test/r/rpl_known_bugs_detection.result index eabc6185780..2d6fffd89a0 100644 --- a/mysql-test/r/rpl_known_bugs_detection.result +++ b/mysql-test/r/rpl_known_bugs_detection.result @@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table Last_Errno 1105 Last_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10' Skip_Counter 0 -Exec_Master_Log_Pos 242 +Exec_Master_Log_Pos 245 Relay_Log_Space # Until_Condition None Until_Log_File @@ -115,7 +115,7 @@ FROM t2 ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c' Skip_Counter 0 -Exec_Master_Log_Pos 1274 +Exec_Master_Log_Pos 1277 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index cae11e98caa..7a6e5740c14 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -28,7 +28,7 @@ day id category name 2003-03-22 2416 a bbbbb show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -slave-bin.000001 1276 +slave-bin.000001 1279 drop table t1; drop table t2; drop table t3; @@ -39,7 +39,7 @@ set global sql_slave_skip_counter=1; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1793 # # master-bin.000001 Yes Yes # 0 0 1793 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1796 # # master-bin.000001 Yes Yes # 0 0 1796 # None 0 No # set sql_log_bin=0; delete from t1; set sql_log_bin=1; @@ -49,7 +49,7 @@ change master to master_user='test'; change master to master_user='root'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1828 # # master-bin.000001 No No # 0 0 1828 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1831 # # master-bin.000001 No No # 0 0 1831 # None 0 No # set global sql_slave_skip_counter=1; start slave; set sql_log_bin=0; diff --git a/mysql-test/r/rpl_loaddata_s.result b/mysql-test/r/rpl_loaddata_s.result index f0c79c81c15..3f092e3afff 100644 --- a/mysql-test/r/rpl_loaddata_s.result +++ b/mysql-test/r/rpl_loaddata_s.result @@ -10,6 +10,6 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1; select count(*) from test.t1; count(*) 2 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info drop table test.t1; diff --git a/mysql-test/r/rpl_ndb_charset.result b/mysql-test/r/rpl_ndb_charset.result index 0ce4446c8a5..41dd5791702 100644 --- a/mysql-test/r/rpl_ndb_charset.result +++ b/mysql-test/r/rpl_ndb_charset.result @@ -109,7 +109,7 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest2 master-bin.000001 # Query 1 # drop database if exists mysqltest3 diff --git a/mysql-test/r/rpl_ndb_extraCol.result b/mysql-test/r/rpl_ndb_extraCol.result index bc40e24ecac..336a6152d36 100644 --- a/mysql-test/r/rpl_ndb_extraCol.result +++ b/mysql-test/r/rpl_ndb_extraCol.result @@ -28,9 +28,9 @@ a b c *** Select from slave *** SELECT * FROM t1 ORDER BY a; a b c d e -1 2 TEXAS 2 TEST -2 1 AUSTIN 2 TEST -3 4 QA 2 TEST +1 2 TEXAS NULL NULL +2 1 AUSTIN NULL NULL +3 4 QA NULL NULL *** Drop t1 *** DROP TABLE t1; *** Create t3 on slave *** @@ -289,9 +289,9 @@ a b c *** Select from slave *** SELECT * FROM t7 ORDER BY a; a b c d e -1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing -2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing -3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing +1 b1b1 Kyle NULL NULL +2 b1b1 JOE NULL NULL +3 b1b1 QA NULL NULL *** Drop t7 *** DROP TABLE t7; *** Create t8 on slave *** @@ -447,9 +447,9 @@ a b c *** Select on Slave *** SELECT * FROM t12 ORDER BY a; a b f c e -1 b1b1b1b1b1b1b1b1 Kyle test 1 -2 b1b1b1b1b1b1b1b1 JOE test 1 -3 b1b1b1b1b1b1b1b1 QA test 1 +1 b1b1b1b1b1b1b1b1 Kyle NULL NULL +2 b1b1b1b1b1b1b1b1 JOE NULL NULL +3 b1b1b1b1b1b1b1b1 QA NULL NULL *** Drop t12 *** DROP TABLE t12; **** Extra Colums End **** @@ -479,9 +479,9 @@ a b c *** Select on Slave **** SELECT * FROM t13 ORDER BY a; a b c d e -1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP -2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP -3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP +2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP +3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP *** Drop t13 *** DROP TABLE t13; *** 22117 END *** @@ -515,9 +515,9 @@ c1 c2 c3 c4 c5 *** Select on Slave **** SELECT * FROM t14 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 -1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP +2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP *** connect to master and drop columns *** ALTER TABLE t14 DROP COLUMN c2; ALTER TABLE t14 DROP COLUMN c4; @@ -530,9 +530,9 @@ c1 c3 c5 *** Select from Slave *** SELECT * FROM t14 ORDER BY c1; c1 c3 c5 c6 c7 -1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP -2 This Test Should work JOE 1 CURRENT_TIMESTAMP -3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP +1 Replication Testing Extra Col Kyle NULL CURRENT_TIMESTAMP +2 This Test Should work JOE NULL CURRENT_TIMESTAMP +3 If is does not, I will open a bug QA NULL CURRENT_TIMESTAMP *** Drop t14 *** DROP TABLE t14; *** Create t15 on slave *** @@ -563,9 +563,9 @@ c1 c2 c3 c4 c5 *** Select on Slave **** SELECT * FROM t15 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 -1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP +2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP *** Add column on master that is a Extra on Slave *** ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** @@ -618,9 +618,9 @@ c1 c2 c3 c4 c5 c6 *** Try to select from slave **** SELECT * FROM t15 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 -1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP +2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP 5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP *** DROP TABLE t15 *** DROP TABLE t15; @@ -652,9 +652,9 @@ c1 c2 c3 c4 c5 *** Select on Slave **** SELECT * FROM t16 ORDER BY c1; c1 c2 c3 c4 c5 c6 c7 -1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP +2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP *** Add Partition on master *** ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4; INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer'); diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result index 66db8c24bb2..dcd103a5b68 100644 --- a/mysql-test/r/rpl_ndb_log.result +++ b/mysql-test/r/rpl_ndb_log.result @@ -32,16 +32,17 @@ master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) master-bin.000001 # Write_rows 1 # table_id: # +master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT -show binlog events from 102 limit 1; +show binlog events from 105 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -show binlog events from 102 limit 2; +show binlog events from 105 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # BEGIN -show binlog events from 102 limit 2,1; +show binlog events from 105 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) flush logs; @@ -71,6 +72,7 @@ master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) master-bin.000001 # Write_rows 1 # table_id: # +master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 @@ -87,13 +89,13 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT show binary logs; Log_name File_size -master-bin.000001 1702 -master-bin.000002 593 +master-bin.000001 1734 +master-bin.000002 596 start slave; show binary logs; Log_name File_size -slave-bin.000001 1797 -slave-bin.000002 198 +slave-bin.000001 1829 +slave-bin.000002 201 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -110,6 +112,7 @@ slave-bin.000001 # Query 2 # BEGIN slave-bin.000001 # Table_map 2 # table_id: # (test.t1) slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status) slave-bin.000001 # Write_rows 2 # table_id: # +slave-bin.000001 # Write_rows 2 # table_id: # slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000001 # Query 2 # COMMIT slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB @@ -126,7 +129,7 @@ slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Query 2 # COMMIT show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 593 # # master-bin.000002 Yes Yes # 0 0 593 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 596 # # master-bin.000002 Yes Yes # 0 0 596 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_ndb_multi.result b/mysql-test/r/rpl_ndb_multi.result index 66819c2c9c8..a42bccbf9a5 100644 --- a/mysql-test/r/rpl_ndb_multi.result +++ b/mysql-test/r/rpl_ndb_multi.result @@ -26,11 +26,11 @@ stop slave; SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) FROM mysql.ndb_binlog_index WHERE epoch = ; @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) -102 master-bin1.000001 +105 master-bin1.000001 CHANGE MASTER TO master_port=, master_log_file = 'master-bin1.000001', -master_log_pos = 102 ; +master_log_pos = 105 ; start slave; INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); DELETE FROM t1 WHERE c3 = 1; diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/r/rpl_rbr_to_sbr.result index 4b2d129c732..d36277bed36 100644 --- a/mysql-test/r/rpl_rbr_to_sbr.result +++ b/mysql-test/r/rpl_rbr_to_sbr.result @@ -28,7 +28,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 450 +Read_Master_Log_Pos 453 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 450 +Exec_Master_Log_Pos 453 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 264f5d224bd..8f0cf29ab34 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -16,7 +16,7 @@ create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 552 # # master-bin.000001 Yes Yes # 0 0 552 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 555 # # master-bin.000001 Yes Yes # 0 0 555 # None 0 No # select * from t1; s Could not break slave @@ -27,9 +27,9 @@ insert into t2 values (34),(67),(123); flush logs; show binary logs; Log_name File_size -master-bin.000001 596 -master-bin.000002 367 -master-bin.000003 102 +master-bin.000001 599 +master-bin.000002 370 +master-bin.000003 105 create table t3 select * from temp_table; select * from t3; a @@ -43,21 +43,21 @@ start slave; purge master logs to 'master-bin.000002'; show master logs; Log_name File_size -master-bin.000002 367 -master-bin.000003 411 +master-bin.000002 370 +master-bin.000003 414 purge binary logs to 'master-bin.000002'; show binary logs; Log_name File_size -master-bin.000002 367 -master-bin.000003 411 +master-bin.000002 370 +master-bin.000003 414 purge master logs before now(); show binary logs; Log_name File_size -master-bin.000003 411 +master-bin.000003 414 insert into t2 values (65); show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 500 # # master-bin.000003 Yes Yes # 0 0 500 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 503 # # master-bin.000003 Yes Yes # 0 0 503 # None 0 No # select * from t2; m 34 @@ -74,18 +74,18 @@ count(*) create table t4 select * from temp_table; show binary logs; Log_name File_size -master-bin.000003 4189 -master-bin.000004 4194 -master-bin.000005 2036 +master-bin.000003 4192 +master-bin.000004 4197 +master-bin.000005 2039 show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000005 2036 +master-bin.000005 2039 select * from t4; a testing temporary tables part 2 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2036 # # master-bin.000005 Yes Yes # 0 0 2036 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2039 # # master-bin.000005 Yes Yes # 0 0 2039 # None 0 No # lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/r/rpl_row_basic_11bugs-master.opt b/mysql-test/r/rpl_row_basic_11bugs-master.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/r/rpl_row_basic_11bugs-master.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/r/rpl_row_basic_11bugs-slave.opt b/mysql-test/r/rpl_row_basic_11bugs-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/r/rpl_row_basic_11bugs-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index ea07a86d009..9b316abd63c 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -381,7 +381,7 @@ return 0; end| use mysqltest; set @a:= mysqltest2.f1(); -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest1 master-bin.000001 # Query 1 # create database mysqltest1 diff --git a/mysql-test/r/rpl_stm_charset.result b/mysql-test/r/rpl_stm_charset.result index f1691608bc7..a0e155b2787 100644 --- a/mysql-test/r/rpl_stm_charset.result +++ b/mysql-test/r/rpl_stm_charset.result @@ -103,7 +103,7 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest2 master-bin.000001 # Query 1 # drop database if exists mysqltest3 diff --git a/mysql-test/r/rpl_stm_flsh_tbls.result b/mysql-test/r/rpl_stm_flsh_tbls.result index a6123d75cb3..fbdbe49f04d 100644 --- a/mysql-test/r/rpl_stm_flsh_tbls.result +++ b/mysql-test/r/rpl_stm_flsh_tbls.result @@ -12,13 +12,13 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 652 ; +SHOW BINLOG EVENTS FROM 655 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 652 ; +SHOW BINLOG EVENTS FROM 655 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 # Query 1 # use `test`; flush tables diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result index e0b1aa12c9b..63e939d44a3 100644 --- a/mysql-test/r/rpl_stm_log.result +++ b/mysql-test/r/rpl_stm_log.result @@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 -show binlog events from 102 limit 1; +show binlog events from 105 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 102 limit 2; +show binlog events from 105 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Intvar 1 # INSERT_ID=1 -show binlog events from 102 limit 2,1; +show binlog events from 105 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) flush logs; @@ -66,13 +66,13 @@ master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM master-bin.000002 # Query 1 # use `test`; insert into t2 values (1) show binary logs; Log_name File_size -master-bin.000001 1343 -master-bin.000002 388 +master-bin.000001 1346 +master-bin.000002 391 start slave; show binary logs; Log_name File_size -slave-bin.000001 1443 -slave-bin.000002 289 +slave-bin.000001 1446 +slave-bin.000002 292 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -92,7 +92,7 @@ slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1) show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 388 # # master-bin.000002 Yes Yes # 0 0 388 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 391 # # master-bin.000002 Yes Yes # 0 0 391 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/r/rpl_stm_max_relay_size.result index c4a9a5bd3ff..ab0a4cd978d 100644 --- a/mysql-test/r/rpl_stm_max_relay_size.result +++ b/mysql-test/r/rpl_stm_max_relay_size.result @@ -28,7 +28,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72956 +Read_Master_Log_Pos 72959 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72956 +Exec_Master_Log_Pos 72959 Relay_Log_Space # Until_Condition None Until_Log_File @@ -71,7 +71,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72956 +Read_Master_Log_Pos 72959 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -86,7 +86,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72956 +Exec_Master_Log_Pos 72959 Relay_Log_Space # Until_Condition None Until_Log_File @@ -114,7 +114,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72956 +Read_Master_Log_Pos 72959 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -129,7 +129,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72956 +Exec_Master_Log_Pos 72959 Relay_Log_Space # Until_Condition None Until_Log_File @@ -195,7 +195,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 73042 +Read_Master_Log_Pos 73045 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -210,7 +210,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 73042 +Exec_Master_Log_Pos 73045 Relay_Log_Space # Until_Condition None Until_Log_File @@ -234,7 +234,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 73118 +Read_Master_Log_Pos 73121 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -249,7 +249,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 73118 +Exec_Master_Log_Pos 73121 Relay_Log_Space # Until_Condition None Until_Log_File @@ -264,7 +264,7 @@ Seconds_Behind_Master # flush logs; show master status; File master-bin.000002 -Position 102 +Position 105 Binlog_Do_DB Binlog_Ignore_DB set global max_binlog_size= @my_max_binlog_size; diff --git a/mysql-test/r/rpl_stm_multi_query.result b/mysql-test/r/rpl_stm_multi_query.result index bf914e6ce6c..726e2bad697 100644 --- a/mysql-test/r/rpl_stm_multi_query.result +++ b/mysql-test/r/rpl_stm_multi_query.result @@ -19,7 +19,7 @@ n 3 4 5 -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest master-bin.000001 # Query 1 # create database mysqltest diff --git a/mysql-test/r/rpl_stm_reset_slave.result b/mysql-test/r/rpl_stm_reset_slave.result index 834b9add089..4ce942869a8 100644 --- a/mysql-test/r/rpl_stm_reset_slave.result +++ b/mysql-test/r/rpl_stm_reset_slave.result @@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # stop slave; change master to master_user='test'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 No No # 0 0 105 # None 0 No # reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_stm_until.result b/mysql-test/r/rpl_stm_until.result index e8e33b66864..81e23da2bd0 100644 --- a/mysql-test/r/rpl_stm_until.result +++ b/mysql-test/r/rpl_stm_until.result @@ -26,7 +26,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 783 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 323 +Exec_Master_Log_Pos 326 Relay_Log_Space # Until_Condition Master Until_Log_File master-bin.000001 @@ -67,7 +67,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 783 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -82,7 +82,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 323 +Exec_Master_Log_Pos 326 Relay_Log_Space # Until_Condition Master Until_Log_File master-no-such-bin.000001 @@ -106,7 +106,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 783 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -121,7 +121,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 612 +Exec_Master_Log_Pos 615 Relay_Log_Space # Until_Condition Relay Until_Log_File slave-relay-bin.000004 @@ -143,7 +143,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 783 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -158,7 +158,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 780 +Exec_Master_Log_Pos 783 Relay_Log_Space # Until_Condition Master Until_Log_File master-bin.000001 diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result index 63d4b0f9411..59c285d8a82 100644 --- a/mysql-test/r/rpl_truncate_7ndb.result +++ b/mysql-test/r/rpl_truncate_7ndb.result @@ -29,16 +29,17 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 219 Query 1 283 BEGIN -master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 378 Write_rows 1 137 table_id: # -master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 467 Query 1 532 COMMIT -master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1 -master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 222 Query 1 286 BEGIN +master-bin.000001 286 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 326 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 381 Write_rows 1 137 table_id: # +master-bin.000001 423 Write_rows 1 175 table_id: # +master-bin.000001 461 Write_rows 1 213 table_id: # flags: STMT_END_F +master-bin.000001 499 Query 1 564 COMMIT +master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1 +master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1 **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; INSERT INTO t1 VALUES (1,1), (2,2); @@ -65,27 +66,30 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 219 Query 1 283 BEGIN -master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 378 Write_rows 1 137 table_id: # -master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 467 Query 1 532 COMMIT -master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1 -master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1 -master-bin.000001 688 Query 1 805 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 805 Query 1 869 BEGIN -master-bin.000001 869 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 909 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 964 Write_rows 1 137 table_id: # -master-bin.000001 1006 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 1053 Query 1 1118 COMMIT -master-bin.000001 1118 Query 1 1182 BEGIN -master-bin.000001 1182 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 1222 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1277 Write_rows 1 137 table_id: # -master-bin.000001 1319 Delete_rows 1 176 table_id: # flags: STMT_END_F -master-bin.000001 1358 Query 1 1423 COMMIT -master-bin.000001 1423 Query 1 1499 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 222 Query 1 286 BEGIN +master-bin.000001 286 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 326 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 381 Write_rows 1 137 table_id: # +master-bin.000001 423 Write_rows 1 175 table_id: # +master-bin.000001 461 Write_rows 1 213 table_id: # flags: STMT_END_F +master-bin.000001 499 Query 1 564 COMMIT +master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1 +master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1 +master-bin.000001 720 Query 1 837 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 837 Query 1 901 BEGIN +master-bin.000001 901 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 941 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 996 Write_rows 1 137 table_id: # +master-bin.000001 1038 Write_rows 1 175 table_id: # +master-bin.000001 1076 Write_rows 1 213 table_id: # flags: STMT_END_F +master-bin.000001 1114 Query 1 1179 COMMIT +master-bin.000001 1179 Query 1 1243 BEGIN +master-bin.000001 1243 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 1283 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1338 Write_rows 1 137 table_id: # +master-bin.000001 1380 Delete_rows 1 171 table_id: # +master-bin.000001 1414 Delete_rows 1 205 table_id: # flags: STMT_END_F +master-bin.000001 1448 Query 1 1513 COMMIT +master-bin.000001 1513 Query 1 1589 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 1c50289a85d..901d0718d0d 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -6,7 +6,7 @@ INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; SET @var2=char(ascii('a')); insert into t1 values (@var1),(@var2); -show binlog events from 102; +show binlog events from 105; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # User var 1 # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@`a b`) diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test index 8d7399b918e..980de0961af 100644 --- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test @@ -12,7 +12,7 @@ # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) flush logs; ---exec $MYSQL_BINLOG --start-position=551 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output +--exec $MYSQL_BINLOG --start-position=554 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test index 9111c4ad369..7ebb20f4d22 100644 --- a/mysql-test/t/ctype_cp932_binlog_stm.test +++ b/mysql-test/t/ctype_cp932_binlog_stm.test @@ -22,7 +22,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)| SELECT HEX(s1),HEX(s2),d FROM t4| DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 406| +SHOW BINLOG EVENTS FROM 409| delimiter ;| # End of 5.0 tests diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 852cc6d2e36..d91a7cb57df 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -65,7 +65,7 @@ select "--- --database --" as ""; select "--- --position --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=235 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=238 $MYSQLTEST_VARDIR/log/master-bin.000002 # These are tests for remote binlog. # They should return the same as previous test. @@ -97,7 +97,7 @@ select "--- --database --" as ""; select "--- --position --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=235 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=238 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 # Bug#7853 (mysqlbinlog does not accept input from stdin) --disable_query_log diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 85a678055d4..52045abbe78 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -52,11 +52,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=607 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=607 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -82,11 +82,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=607 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=130 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --stop-position=133 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -109,11 +109,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=607 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=607 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -136,11 +136,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=607 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=130 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form --stop-position=133 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index 9230b3bff4f..75ecbe303ce 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -566,7 +566,7 @@ connection master; # were written to the binary log. --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 105; # Restore log_bin_trust_function_creators to its original value. diff --git a/mysql-test/t/rpl_stm_flsh_tbls.test b/mysql-test/t/rpl_stm_flsh_tbls.test index 43a5234ccc7..c571ae638b6 100644 --- a/mysql-test/t/rpl_stm_flsh_tbls.test +++ b/mysql-test/t/rpl_stm_flsh_tbls.test @@ -1,7 +1,7 @@ # depends on the binlog output --source include/have_binlog_format_mixed_or_statement.inc -let $rename_event_pos= 652; +let $rename_event_pos= 655; -- source extra/rpl_tests/rpl_flsh_tbls.test # End of 4.1 tests diff --git a/sql/log_event.cc b/sql/log_event.cc index f35ac998fa6..3fe6b39503e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5641,7 +5641,7 @@ unpack_row(RELAY_LOG_INFO *rli, bitmap_clear_all(rw_set); - memcpy(table->record[0], table->s->default_values, table->s->null_bytes); + empty_record(table); Field **const begin_ptr = table->field; Field **field_ptr; @@ -5657,6 +5657,10 @@ unpack_row(RELAY_LOG_INFO *rli, { Field *const f= *field_ptr; + /* + No need to bother about columns that does not exist: they have + gotten default values when being emptied above. + */ if (bitmap_is_set(cols, field_ptr - begin_ptr)) { if ((null_mask & 0xFF) == 0) @@ -5680,10 +5684,13 @@ unpack_row(RELAY_LOG_INFO *rli, /* We only unpack the field if it was non-null */ + const char *const old_ptr= pack_ptr; pack_ptr= f->unpack(f->ptr, pack_ptr); + DBUG_PRINT("debug", ("Unpacking field '%s' from %d bytes", + f->field_name, pack_ptr - old_ptr)); } - bitmap_set_bit(rw_set, field_ptr - begin_ptr); + bitmap_set_bit(rw_set, f->field_index); null_mask <<= 1; } } @@ -6784,6 +6791,15 @@ copy_extra_record_fields(TABLE *table, return 0; // All OK } +#define DBUG_PRINT_BITSET(N,FRM,BS) \ + do { \ + char buf[256]; \ + for (uint i = 0 ; i < (BS)->n_bits ; ++i) \ + buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \ + buf[(BS)->n_bits] = '\0'; \ + DBUG_PRINT((N), ((FRM), buf)); \ + } while (0) + /* Replace the provided record in the database. @@ -6816,6 +6832,12 @@ replace_record(THD *thd, TABLE *table, int keynum; auto_afree_ptr key(NULL); +#ifndef DBUG_OFF + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set); + DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set); +#endif + while ((error= table->file->ha_write_row(table->record[0]))) { if (error == HA_ERR_LOCK_DEADLOCK || error == HA_ERR_LOCK_WAIT_TIMEOUT) @@ -6937,20 +6959,75 @@ void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info) */ static bool record_compare(TABLE *table) { + /* + Need to set the X bit and the filler bits in both records since + there are engines that do not set it correctly. + + In addition, since MyISAM checks that one hasn't tampered with the + record, it is necessary to restore the old bytes into the record + after doing the comparison. + + TODO[record format ndb]: Remove it once NDB returns correct + records. Check that the other engines also return correct records. + */ + + bool result= FALSE; + byte saved_x[2], saved_filler[2]; + + if (table->s->null_bytes > 0) + { + for (int i = 0 ; i < 2 ; ++i) + { + saved_x[i]= table->record[i][0]; + saved_filler[i]= table->record[i][table->s->null_bytes - 1]; + table->record[i][0]|= 1U; + table->record[i][table->s->null_bytes - 1]|= + 256U - (1U << table->s->last_null_bit_pos); + } + } + if (table->s->blob_fields + table->s->varchar_fields == 0) - return cmp_record(table,record[1]); + { + result= cmp_record(table,record[1]); + goto record_compare_exit; + } + /* Compare null bits */ if (memcmp(table->null_flags, table->null_flags+table->s->rec_buff_length, table->s->null_bytes)) - return TRUE; // Diff in NULL value + { + result= TRUE; // Diff in NULL value + goto record_compare_exit; + } + /* Compare updated fields */ for (Field **ptr=table->field ; *ptr ; ptr++) { if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length)) - return TRUE; + { + result= TRUE; + goto record_compare_exit; + } } - return FALSE; + +record_compare_exit: + /* + Restore the saved bytes. + + TODO[record format ndb]: Remove this code once NDB returns the + correct record format. + */ + if (table->s->null_bytes > 0) + { + for (int i = 0 ; i < 2 ; ++i) + { + table->record[i][0]= saved_x[i]; + table->record[i][table->s->null_bytes - 1]= saved_filler[i]; + } + } + + return result; } @@ -7094,6 +7171,9 @@ static int find_and_fetch_row(TABLE *table, byte *key) are all set when returning. There are storage engines that just set the necessary bits on the bytes and don't set the filler bits correctly. + + TODO[record format ndb]: Remove this code once NDB returns the + correct record format. */ if (table->s->null_bytes > 0) { @@ -7126,16 +7206,6 @@ static int find_and_fetch_row(TABLE *table, byte *key) /* Continue until we find the right record or have made a full loop */ do { - /* - Patching the record before calling rnd_next() since some - storage engines do not set the filler bits correctly. - */ - if (table->s->null_bytes > 0) - { - table->record[1][table->s->null_bytes - 1]|= - 256U - (1U << table->s->last_null_bit_pos); - } - error= table->file->rnd_next(table->record[1]); DBUG_DUMP("record[0]", table->record[0], table->s->reclength); @@ -7154,6 +7224,7 @@ static int find_and_fetch_row(TABLE *table, byte *key) default: table->file->print_error(error, MYF(0)); + DBUG_PRINT("info", ("Record not found")); table->file->ha_rnd_end(); DBUG_RETURN(error); } @@ -7163,6 +7234,7 @@ static int find_and_fetch_row(TABLE *table, byte *key) /* Have to restart the scan to be able to fetch the next row. */ + DBUG_PRINT("info", ("Record %sfound", restart_count == 2 ? "not " : "")); table->file->ha_rnd_end(); DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0); From 0e0ca2a61c6c1d30dfc1589f1a139c5579f79dad Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 10:50:10 +0200 Subject: [PATCH 211/789] Bug #26079 max_binlog_size + innodb = not make new binlog and hang server There was hanging at binlog_commit by a thread executing autocommit query. The hang appeared to be due to an overly condtion for early return from binlog_commit introduced by bug#20265 fix. Fixed with reverting the logic back to 5.0 version. mysql-test/extra/binlog_tests/binlog.test: added a regression test mysql-test/r/binlog_row_binlog.result: results changed mysql-test/r/binlog_stm_binlog.result: results changed sql/log.cc: Removing `all' conjuction arg from early return condition. There is nothing to execute by transaction if trx_data is empty. The work for rotate_and_purge is delayed till TC_LOG::unlog (same as in 5.0 code) sql/log.h: singed because there are assert on positiveness --- mysql-test/extra/binlog_tests/binlog.test | 17 +++++++++++++++++ mysql-test/r/binlog_row_binlog.result | 14 ++++++++++++++ mysql-test/r/binlog_stm_binlog.result | 14 ++++++++++++++ sql/log.cc | 2 +- sql/log.h | 2 +- 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 834edcff474..22746ccf89c 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -86,3 +86,20 @@ show binlog events from 102; drop table t1,t2,t3,tt1; -- source extra/binlog_tests/binlog_insert_delayed.test + +#Bug #26079 max_binlog_size + innodb = not make new binlog and hang server +# server should not hang, binlog must rotate in the end +reset master; +--disable_warnings +drop table if exists t3; +--enable_warnings +create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; +show master status; +let $it=4; +while ($it) +{ +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +dec $it; +} +show master status /* must show new binlog index after rotating */; +drop table t3; diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result index 769f23ea86c..bd6487105e2 100644 --- a/mysql-test/r/binlog_row_binlog.result +++ b/mysql-test/r/binlog_row_binlog.result @@ -323,3 +323,17 @@ a 400 401 drop table t1; +reset master; +drop table if exists t3; +create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 342 +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +show master status /* must show new binlog index after rotating */; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000002 102 +drop table t3; diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index fb0453b5b68..ac73fd6eed8 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -221,3 +221,17 @@ a 400 401 drop table t1; +reset master; +drop table if exists t3; +create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 342 +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +show master status /* must show new binlog index after rotating */; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000002 102 +drop table t3; diff --git a/sql/log.cc b/sql/log.cc index deb77890f35..fa2207be1f2 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1548,7 +1548,7 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all) (binlog_trx_data*) thd->ha_data[binlog_hton->slot]; DBUG_ASSERT(mysql_bin_log.is_open()); - if (all && trx_data->empty()) + if (trx_data->empty()) { // we're here because trans_log was flushed in MYSQL_BIN_LOG::log_xid() trx_data->reset(); diff --git a/sql/log.h b/sql/log.h index 970823dcd4a..ed0c3557d08 100644 --- a/sql/log.h +++ b/sql/log.h @@ -238,7 +238,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG fix_max_relay_log_size). */ ulong max_size; - ulong prepared_xids; /* for tc log - number of xids to remember */ + long prepared_xids; /* for tc log - number of xids to remember */ // current file sequence number for load data infile binary logging uint file_id; uint open_count; // For replication From a842253e7adc8cf7c087e88b68537b342c5b3863 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 11:11:08 +0100 Subject: [PATCH 212/789] BUG#24363 If the table structure has been changed, the default action about the restore will fail. - correction of patch, original patch will segfault for print option --- storage/ndb/tools/restore/consumer_restore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp index 7e3395c36f6..2ea79a2aa6c 100644 --- a/storage/ndb/tools/restore/consumer_restore.cpp +++ b/storage/ndb/tools/restore/consumer_restore.cpp @@ -668,7 +668,11 @@ err: } bool -BackupRestore::table_equal(const TableS &tableS){ +BackupRestore::table_equal(const TableS &tableS) +{ + if (!m_restore) + return true; + const char *tablename = tableS.getTableName(); if(tableS.m_dictTable == NULL){ From 60b7cfaf6e482fec94e468aeb202f0105bca762f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 11:15:15 +0100 Subject: [PATCH 213/789] Bug#27070 server logs are created unrequested and in wrong directory - Setting up a A->B->A replication causes relay logs being written by the master, remove them when test is finished mysql-test/t/rpl_dual_pos_advance.test: Cleanup files created by test case in var/run directory --- mysql-test/t/rpl_dual_pos_advance.test | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test index 518fa9df885..074aeec63b1 100644 --- a/mysql-test/t/rpl_dual_pos_advance.test +++ b/mysql-test/t/rpl_dual_pos_advance.test @@ -106,3 +106,9 @@ connection slave; sync_with_master; # End of 4.1 tests + +# Cleanup +# The A->B->A replication causes the master to start writing relay logs +# in var/run, remove them +remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001; +remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index; From 83f639eee7a036f6eadab1925c4b8d62c0969602 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 11:17:07 +0100 Subject: [PATCH 214/789] Update test reulst after setting logging to be sent both to file and tables --- mysql-test/r/flush2.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result index 8257fa05b41..15fbeed2576 100644 --- a/mysql-test/r/flush2.result +++ b/mysql-test/r/flush2.result @@ -6,7 +6,7 @@ log ON log_bin OFF log_bin_trust_function_creators ON log_error -log_output TABLE +log_output FILE,TABLE log_queries_not_using_indexes OFF log_slave_updates OFF log_slow_queries OFF @@ -18,7 +18,7 @@ log ON log_bin OFF log_bin_trust_function_creators ON log_error -log_output TABLE +log_output FILE,TABLE log_queries_not_using_indexes OFF log_slave_updates OFF log_slow_queries OFF From 6bdf1d0772f904eb55083d5e3e5b4db3adc040cf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 11:21:27 +0100 Subject: [PATCH 215/789] Bug#27070 server logs are created unrequested and in wrong directory - Avoid defaault log file names looking like .pid.slow.log by using the FN_REPLACE_EXT flag to 'fn_format' - Remove the default log files generated by log_state.test before test completes mysql-test/t/log_state.test: Tess sets location of log files to default location ie. they will be created in var/run form which the mysqld was started. Remove the files when test are completed sql/log.cc: Replace the extension formatting the default log file name from "pidfile_name" which already contains an extension --- mysql-test/t/log_state.test | 5 +++++ sql/log.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test index a5e00cb0387..e772089ce7a 100644 --- a/mysql-test/t/log_state.test +++ b/mysql-test/t/log_state.test @@ -132,3 +132,8 @@ select * from mysql.general_log; # Cleanup (must be done last to avoid delayed 'Quit' message in general log) # disconnect con1; + +# Remove the log files that was created in the "default location" +# i.e var/run +--remove_file $MYSQLTEST_VARDIR/run/master.log +--remove_file $MYSQLTEST_VARDIR/run/master-slow.log diff --git a/sql/log.cc b/sql/log.cc index deb77890f35..b44283f220e 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -68,7 +68,7 @@ char *make_default_log_name(char *buff,const char* log_ext) { strmake(buff, pidfile_name, FN_REFLEN-5); return fn_format(buff, buff, mysql_data_home, log_ext, - MYF(MY_UNPACK_FILENAME|MY_APPEND_EXT)); + MYF(MY_UNPACK_FILENAME|MY_REPLACE_EXT)); } /* From a85e2905fdd65d88913b8a09856dc6d8918a28b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 13:32:49 +0100 Subject: [PATCH 216/789] build fix for netware include/my_global.h: netware does not have , so we define placement versions of operator new and delete ourselves --- include/my_global.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/my_global.h b/include/my_global.h index b6c6ff13405..9bf411f5c82 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1489,11 +1489,24 @@ do { doubleget_union _tmp; \ #define dlerror() "" #endif +#ifndef __NETWARE__ /* - Include standard definitions of operator new and delete. + * Include standard definitions of operator new and delete. */ #ifdef __cplusplus #include #endif +#else +/* + * Define placement versions of operator new and operator delete since + * we don't have when building for Netware. + */ +#ifdef __cplusplus +inline void *operator new(size_t, void *ptr) { return ptr; } +inline void *operator new[](size_t, void *ptr) { return ptr; } +inline void operator delete(void*, void*) { /* Do nothing */ } +inline void operator delete[](void*, void*) { /* Do nothing */ } +#endif +#endif #endif /* my_global_h */ From 4945860b5cc718f45bb267a1e3d7160104070295 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 13:33:17 +0100 Subject: [PATCH 217/789] small build fix netware/Makefile.am: use detected awk variant instead of using awk directly --- netware/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netware/Makefile.am b/netware/Makefile.am index de39376f6a1..8326b30d5b5 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -54,7 +54,7 @@ DISTCLEANFILES = $(BUILT_SOURCES) # Create the libmysql.imp from libmysql/libmysql.def libmysql.imp: $(top_srcdir)/libmysql/libmysql.def - awk 'BEGIN{x=0;} \ + $(AWK) 'BEGIN{x=0;} \ END{printf("\n");} \ x==1 {printf(" %s",$$1); x++; next} \ x>1 {printf(",\n %s", $$1); next} \ From bd299fdf6c431d4e1dda343377cc83cc77dcfaa7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 14:13:07 +0100 Subject: [PATCH 218/789] BUG#26969: Field_bit::pack() and Field_bit::unpack() does not work correctly Fixing code for Field_bit packing and unpacking to work with arbitrary pointers instead of requiring Field::ptr sql/field.cc: Fixing Field_bit::pack() and Field_bit::unpack() so that they accept an arbitrary pointer to pack/unpack to/from. sql/sql_class.cc: Removing unneeded move_field_offset() nefore packing field. --- sql/field.cc | 34 ++++++++++++++++++++++++++++++---- sql/sql_class.cc | 4 +--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 488a5d591a3..ecfdb46ac02 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8505,9 +8505,28 @@ char *Field_bit::pack(char *to, const char *from, uint max_length) { DBUG_ASSERT(max_length); uint length; - if (bit_len) + if (bit_len > 0) { - uchar bits= get_rec_bits(bit_ptr, bit_ofs, bit_len); + /* + We have the following: + + ptr Points into a field in record R1 + from Points to a field in a record R2 + bit_ptr Points to the byte (in the null bytes) that holds the + odd bits of R1 + from_bitp Points to the byte that holds the odd bits of R2 + + We have the following: + + ptr - bit_ptr = from - from_bitp + + We want to isolate 'from_bitp', so this gives: + + ptr - bit_ptr - from = - from_bitp + - ptr + bit_ptr + from = from_bitp + bit_ptr + from - ptr = from_bitp + */ + uchar bits= get_rec_bits(bit_ptr + (from - ptr), bit_ofs, bit_len); *to++= bits; } length= min(bytes_in_rec, max_length - (bit_len > 0)); @@ -8518,9 +8537,16 @@ char *Field_bit::pack(char *to, const char *from, uint max_length) const char *Field_bit::unpack(char *to, const char *from) { - if (bit_len) + if (bit_len > 0) { - set_rec_bits(*from, bit_ptr, bit_ofs, bit_len); + /* + set_rec_bits is a macro, don't put the post-increment in the + argument since that might cause strange side-effects. + + For the choice of the second argument, see the explanation for + Field_bit::pack(). + */ + set_rec_bits(*from, bit_ptr + (to - ptr), bit_ofs, bit_len); from++; } memcpy(to, from, bytes_in_rec); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 4ca15a8a5f9..0b87a4185dd 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2619,9 +2619,7 @@ THD::pack_row(TABLE *table, MY_BITMAP const* cols, /* We only store the data of the field if it is non-null */ - field->move_field_offset(offset); - pack_ptr= (byte*)field->pack((char *) pack_ptr, field->ptr); - field->move_field_offset(-offset); + pack_ptr= (byte*)field->pack((char *) pack_ptr, field->ptr + offset); } null_mask <<= 1; From 089fca6bb6d6ccdf68bacfa9d022e1a072db9ada Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 17:53:55 +0400 Subject: [PATCH 219/789] tests fixed to work in embedded server mysql-test/r/delayed.result: result fixed mysql-test/r/merge.result: result fixed mysql-test/t/delayed.test: moved here from merge.test mysql-test/t/init_connect.test: test fixed as it created users, then stopped without deletion, what caused problems in consequent tests mysql-test/t/merge.test: moved to delayed.test mysql-test/t/mysqlbinlog-cp932.test: disabled in embedded server --- mysql-test/r/delayed.result | 5 +++++ mysql-test/r/merge.result | 5 ----- mysql-test/t/delayed.test | 10 ++++++++++ mysql-test/t/init_connect.test | 5 +++-- mysql-test/t/merge.test | 9 --------- mysql-test/t/mysqlbinlog-cp932.test | 2 ++ 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 82a308c63e7..b37679847be 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -250,3 +250,8 @@ SELECT HEX(a) FROM t1; HEX(a) 1 DROP TABLE t1; +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); +INSERT DELAYED INTO t2 VALUES(1); +ERROR HY000: Table storage engine for 't2' doesn't have this option +DROP TABLE t1, t2; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index e45e5853c0c..c4419d64a65 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -803,11 +803,6 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM tm1; ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, tm1; -CREATE TABLE t1(c1 INT) ENGINE=MyISAM; -CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); -INSERT DELAYED INTO t2 VALUES(1); -ERROR HY000: Table storage engine for 't2' doesn't have this option -DROP TABLE t1, t2; CREATE TABLE t1(c1 VARCHAR(1)); CREATE TABLE m1 LIKE t1; ALTER TABLE m1 ENGINE=MERGE UNION=(t1); diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 773927f6015..13615c8c269 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -242,3 +242,13 @@ INSERT DELAYED INTO t1 VALUES(1); FLUSH TABLE t1; SELECT HEX(a) FROM t1; DROP TABLE t1; + +# +# Bug#26464 - insert delayed + update + merge = corruption +# +CREATE TABLE t1(c1 INT) ENGINE=MyISAM; +CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); +--error 1031 +INSERT DELAYED INTO t2 VALUES(1); +DROP TABLE t1, t2; + diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test index c9a18a4003d..0a08559279c 100644 --- a/mysql-test/t/init_connect.test +++ b/mysql-test/t/init_connect.test @@ -2,10 +2,11 @@ # Test of init_connect variable # +# should work with embedded server after mysqltest is fixed +--source include/not_embedded.inc + --source include/add_anonymous_users.inc -# should work with embedded server after mysqltest is fixed --- source include/not_embedded.inc connect (con0,localhost,root,,); connection con0; select hex(@a); diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 07923fa020c..490010c0a42 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -430,16 +430,7 @@ CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM tm1; DROP TABLE t1, tm1; -# -# Bug#26464 - insert delayed + update + merge = corruption -# -CREATE TABLE t1(c1 INT) ENGINE=MyISAM; -CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); ---error 1031 -INSERT DELAYED INTO t2 VALUES(1); -DROP TABLE t1, t2; -# # BUG#26881 - Large MERGE tables report incorrect specification when no # differences in tables # diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test index 0e0a4e2bfae..1487606a6c2 100644 --- a/mysql-test/t/mysqlbinlog-cp932.test +++ b/mysql-test/t/mysqlbinlog-cp932.test @@ -1,3 +1,5 @@ +# disabled in embedded until tools running is fixed with embedded +--source include/not_embedded.inc -- source include/have_cp932.inc # Bug#16217 (mysql client did not know how not switch its internal charset) From 996843e51e3d9c18cc77886d3911f05ce79313b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 10:07:23 -0400 Subject: [PATCH 220/789] Bug#25765 too many dbg heap assertions on windows - SAFEMALLOC should be defined for each project in debug Windows builds. SAFEMALLOC was not defined for the innodb project. Debug asserts caused due to mixed SAFEMALLOC defines. innobase/CMakeLists.txt: Bug#25765 too many dbg heap assertions on windows - Make sure that *_DEBUG defaults are not overwritten. - Define SAFEMALLOC and SAFE_MUTEX for debug innodb builds. --- innobase/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/CMakeLists.txt b/innobase/CMakeLists.txt index 21b9210a73e..36c256932d2 100755 --- a/innobase/CMakeLists.txt +++ b/innobase/CMakeLists.txt @@ -13,8 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX") -#SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB) # Bug#19424 - InnoDB: Possibly a memory overrun of the buffer being freed (64-bit Visual C) From e1d8f329fa474e8b7a2610f45723da2ec2c07e0c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 15:12:50 +0100 Subject: [PATCH 221/789] vio.vcproj, mysqld.vcproj, mysys.vcproj, libmysqld.vcproj, mysqldemb.vcproj: No need to set LICENSE or USE_SYMDIR from project files make_win_bin_dist: Changed location of SQL initialization files to be "share/" scripts/make_win_bin_dist: Changed location of SQL initialization files to be "share/" VC++Files/libmysqld/libmysqld.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/mysqldemb/mysqldemb.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/mysys/mysys.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/sql/mysqld.vcproj: No need to set LICENSE or USE_SYMDIR from project files VC++Files/vio/vio.vcproj: No need to set LICENSE or USE_SYMDIR from project files --- VC++Files/libmysqld/libmysqld.vcproj | 20 ++++++++++---------- VC++Files/mysqldemb/mysqldemb.vcproj | 20 ++++++++++---------- VC++Files/mysys/mysys.vcproj | 6 +++--- VC++Files/sql/mysqld.vcproj | 8 ++++---- VC++Files/vio/vio.vcproj | 2 +- scripts/make_win_bin_dist | 3 +++ 6 files changed, 31 insertions(+), 28 deletions(-) diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj index 94447791753..4248522d2ff 100644 --- a/VC++Files/libmysqld/libmysqld.vcproj +++ b/VC++Files/libmysqld/libmysqld.vcproj @@ -23,7 +23,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../libmysqld,../sql,../regex,../extra/yassl/include,../bdb/build_win32,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" PrecompiledHeaderFile=".\debug_obj/libmysqld.pch" @@ -90,7 +90,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../libmysqld,../sql,../regex,../extra/yassl/include,../bdb/build_win32,../zlib" - PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" PrecompiledHeaderFile=".\debug_obj98/libmysqld.pch" @@ -158,7 +158,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../libmysqld,../sql,../regex,../extra/yassl/include,../bdb/build_win32,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -225,7 +225,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../libmysqld,../sql,../regex,../extra/yassl/include,../bdb/build_win32,../zlib" - PreprocessorDefinitions="DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -292,7 +292,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../extra/yassl/include,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -358,7 +358,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../extra/yassl/include,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" @@ -426,7 +426,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../extra/yassl/include,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -492,7 +492,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../extra/yassl/include,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" @@ -560,7 +560,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../extra/yassl/include,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -626,7 +626,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../extra/yassl/include,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" diff --git a/VC++Files/mysqldemb/mysqldemb.vcproj b/VC++Files/mysqldemb/mysqldemb.vcproj index 82fc15f6503..e4ba2cca19b 100644 --- a/VC++Files/mysqldemb/mysqldemb.vcproj +++ b/VC++Files/mysqldemb/mysqldemb.vcproj @@ -23,7 +23,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../zlib,../include,../regex,../libmysqld,../sql" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" PrecompiledHeaderFile=".\debug_obj/mysqldemb.pch" @@ -74,7 +74,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../zlib,../include,../regex,../libmysqld,../sql" - PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" PrecompiledHeaderFile=".\debug_obj98/mysqldemb.pch" @@ -126,7 +126,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -179,7 +179,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -232,7 +232,7 @@ InlineFunctionExpansion="1" OptimizeForEnterprisecessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -284,7 +284,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" @@ -337,7 +337,7 @@ InlineFunctionExpansion="1" OptimizeForEnterprisecessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -389,7 +389,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" @@ -442,7 +442,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -494,7 +494,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_SYMDIR;USE_TLS;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;_LIB;EMBEDDED_LIBRARY;HAVE_DLOPEN;SIGNAL_WITH_VIO_CLOSE;USE_TLS;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj index e1f7a03e9dc..53b5394b27d 100644 --- a/VC++Files/mysys/mysys.vcproj +++ b/VC++Files/mysys/mysys.vcproj @@ -22,7 +22,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../zlib" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_SYMDIR" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" RuntimeLibrary="1" PrecompiledHeaderFile=".\debug_obj/mysys.pch" AssemblerListingLocation=".\debug_obj/" @@ -70,7 +70,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../zlib" - PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_SYMDIR" + PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" RuntimeLibrary="1" PrecompiledHeaderFile=".\debug_obj98/mysys.pch" AssemblerListingLocation=".\debug_obj98/" @@ -218,7 +218,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../zlib" - PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_SYMDIR;USE_TLS" + PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS" RuntimeLibrary="1" PrecompiledHeaderFile=".\TLS_DEBUG/mysys.pch" AssemblerListingLocation=".\TLS_DEBUG/" diff --git a/VC++Files/sql/mysqld.vcproj b/VC++Files/sql/mysqld.vcproj index 347eb578a42..97468c2045b 100644 --- a/VC++Files/sql/mysqld.vcproj +++ b/VC++Files/sql/mysqld.vcproj @@ -408,7 +408,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../zlib,../extra/yassl/include" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -472,7 +472,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../zlib,../extra/yassl/include" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;HAVE_INNOBASE_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" PrecompiledHeaderFile=".\enterprise_debug_obj/mysqld.pch" @@ -536,7 +536,7 @@ InlineFunctionExpansion="1" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../zlib,../extra/yassl/include" - PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;DBUG_OFF;NDEBUG;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -600,7 +600,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../regex,../zlib,../extra/yassl/include" - PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE;LICENSE=Commercial" + PreprocessorDefinitions="__NT__;_DEBUG;SAFEMALLOC;SAFE_MUTEX;HAVE_ARCHIVE_DB;HAVE_BLACKHOLE_DB;HAVE_EXAMPLE_DB;HAVE_FEDERATED_DB;MYSQL_SERVER;HAVE_DLOPEN;_WINDOWS;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="1" PrecompiledHeaderFile=".\classic_debug_obj/mysqld.pch" diff --git a/VC++Files/vio/vio.vcproj b/VC++Files/vio/vio.vcproj index 9d66765af5d..b174ed52714 100644 --- a/VC++Files/vio/vio.vcproj +++ b/VC++Files/vio/vio.vcproj @@ -73,7 +73,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories="../include,../extra/yassl/include" - PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_SYMDIR" + PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS" RuntimeLibrary="1" PrecompiledHeaderFile=".\debug_obj/vio.pch" AssemblerListingLocation=".\debug_obj/" diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 59018195ef2..5d4c7ab917d 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -360,6 +360,9 @@ fi cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* +# The SQL initiation code is really expected to be in "share" +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- From 0920def39b3bce415aadd62554cc667d2fdb154f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 10:22:15 -0400 Subject: [PATCH 222/789] Post Merge Fix. --- storage/innobase/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index beeee5310c2..873a73be0ec 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -13,8 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX") -#SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib From 6fb66342b36d0a5e3ed3aea53b86fc6d719a9cd9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 10:34:25 -0400 Subject: [PATCH 223/789] Bug#23736 Pointer free error in mysqlbinlog - Mis-matched SAFEMALLOC defines caused misleading error message. client/mysqlbinlog.cc: Bug#23736 Pointer free error in mysqlbinlog - Re-worked the Load_log_processor so that it frees it's resources before my_end is called. This is necessary because SAFEMALLOC's _my_free calls pthread_mutex_lock() using THR_LOCK_malloc which is cleaned up in my_end(). include/my_sys.h: Bug#23736 Pointer free error in mysqlbinlog - Define DYNAMIC_ARRAY beofore MY_TMPDIR - Add DYNAMIC_ARRAY to MY_TMP_DIR mysys/array.c: Bug#23736 Pointer free error in mysqlbinlog - SAFEMALLOC should not be unconditionally undef'd. mysys/mf_tempdir.c: Bug#23736 Pointer free error in mysqlbinlog - Use struct's DYNAMIC_ARRAY. - Use DYNAMIC_ARRAY:delete_dynamic function instead of my_free --- client/mysqlbinlog.cc | 27 +++++++++++++-------------- include/my_sys.h | 19 ++++++++++--------- mysys/array.c | 4 ---- mysys/mf_tempdir.c | 13 ++++++------- 4 files changed, 29 insertions(+), 34 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 91fb5f2b99d..2a070d14f0d 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -155,11 +155,7 @@ class Load_log_processor public: Load_log_processor() {} - ~Load_log_processor() - { - destroy(); - delete_dynamic(&file_names); - } + ~Load_log_processor() {} int init() { @@ -179,20 +175,22 @@ public: target_dir_name_len= strlen(target_dir_name); } void destroy() + { + File_name_record *ptr= (File_name_record *)file_names.buffer; + File_name_record *end= ptr + file_names.elements; + for (; ptr < end; ptr++) { - File_name_record *ptr= (File_name_record *)file_names.buffer; - File_name_record *end= ptr + file_names.elements; - for (; ptrfname) { - if (ptr->fname) - { - my_free(ptr->fname, MYF(MY_WME)); - delete ptr->event; - bzero((char *)ptr, sizeof(File_name_record)); - } + my_free(ptr->fname, MYF(MY_WME)); + delete ptr->event; + bzero((char *)ptr, sizeof(File_name_record)); } } + delete_dynamic(&file_names); + } + /* Obtain Create_file event for LOAD DATA statement by its file_id. @@ -1517,6 +1515,7 @@ int main(int argc, char** argv) cleanup(); free_defaults(defaults_argv); my_free_open_file_info(); + load_processor.destroy(); /* We cannot free DBUG, it is used in global destructors after exit(). */ my_end(MY_DONT_FREE_DBUG); exit(exit_value); diff --git a/include/my_sys.h b/include/my_sys.h index 533d50cb25f..63a1faf3995 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -322,15 +322,6 @@ struct st_my_file_info extern struct st_my_file_info *my_file_info; -typedef struct st_my_tmpdir -{ - char **list; - uint cur, max; -#ifdef THREAD - pthread_mutex_t mutex; -#endif -} MY_TMPDIR; - typedef struct st_dynamic_array { char *buffer; @@ -339,6 +330,16 @@ typedef struct st_dynamic_array uint size_of_element; } DYNAMIC_ARRAY; +typedef struct st_my_tmpdir +{ + DYNAMIC_ARRAY full_list; + char **list; + uint cur, max; +#ifdef THREAD + pthread_mutex_t mutex; +#endif +} MY_TMPDIR; + typedef struct st_dynamic_string { char *str; diff --git a/mysys/array.c b/mysys/array.c index e3ebe8ddb42..4ea1946d837 100644 --- a/mysys/array.c +++ b/mysys/array.c @@ -15,10 +15,6 @@ /* Handling of arrays that can grow dynamicly. */ -#if defined(WIN32) || defined(__WIN__) -#undef SAFEMALLOC /* Problems with threads */ -#endif - #include "mysys_priv.h" #include "m_string.h" diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c index c24e2a0101b..bcd003920f1 100644 --- a/mysys/mf_tempdir.c +++ b/mysys/mf_tempdir.c @@ -26,9 +26,8 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) { char *end, *copy; char buff[FN_REFLEN]; - DYNAMIC_ARRAY t_arr; pthread_mutex_init(&tmpdir->mutex, MY_MUTEX_INIT_FAST); - if (my_init_dynamic_array(&t_arr, sizeof(char*), 1, 5)) + if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5)) return TRUE; if (!pathlist || !pathlist[0]) { @@ -49,14 +48,14 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) convert_dirname(buff, pathlist, end); if (!(copy=my_strdup(buff, MYF(MY_WME)))) return TRUE; - if (insert_dynamic(&t_arr, (gptr)©)) + if (insert_dynamic(&tmpdir->full_list, (gptr)©)) return TRUE; pathlist=end+1; } while (*end); - freeze_size(&t_arr); - tmpdir->list=(char **)t_arr.buffer; - tmpdir->max=t_arr.elements-1; + freeze_size(&tmpdir->full_list); + tmpdir->list=(char **)tmpdir->full_list.buffer; + tmpdir->max=tmpdir->full_list.elements-1; tmpdir->cur=0; return FALSE; } @@ -76,7 +75,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir) uint i; for (i=0; i<=tmpdir->max; i++) my_free(tmpdir->list[i], MYF(0)); - my_free((gptr)tmpdir->list, MYF(0)); + delete_dynamic(&tmpdir->full_list); pthread_mutex_destroy(&tmpdir->mutex); } From 9e2865d0267ef549ca7abd65c1630e1208f18fcc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 15:42:34 +0100 Subject: [PATCH 224/789] chmod u+x win/build-vs*.bat win/build-vs71.bat: Change mode to -rwxrw-rw- win/build-vs8.bat: Change mode to -rwxrw-rw- --- win/build-vs71.bat | 0 win/build-vs8.bat | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 win/build-vs71.bat mode change 100644 => 100755 win/build-vs8.bat diff --git a/win/build-vs71.bat b/win/build-vs71.bat old mode 100644 new mode 100755 diff --git a/win/build-vs8.bat b/win/build-vs8.bat old mode 100644 new mode 100755 From 54edcb1861998256a857773fd6385861061f3118 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 16:08:39 +0100 Subject: [PATCH 225/789] ndb - bug#27291 Fix correct min-value for LockPagesInMemory ndb/src/mgmsrv/ConfigInfo.cpp: Fix correct min-value --- ndb/src/mgmsrv/ConfigInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 7f89f5c5c49..7f220c0da65 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -566,7 +566,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { true, ConfigInfo::CI_INT, "0", - "1", + "0", "2" }, { From 26afc93a0e4154b797adb0bcb0c85cf7f4f541e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 16:16:25 +0100 Subject: [PATCH 226/789] ndb - bug#27283 (wl2325-5.0) Handle race condtition between MASTER_GCPCONF and execGCP_NODEFINISH ndb/src/kernel/blocks/ERROR_codes.txt: new error codes ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Handle race condtition between MASTER_GCPCONF and execGCP_NODEFINISH ndb/test/ndbapi/testNodeRestart.cpp: testcase ndb/test/run-test/daily-basic-tests.txt: testcase --- ndb/src/kernel/blocks/ERROR_codes.txt | 2 +- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 32 ++++++++++++++-- ndb/test/ndbapi/testNodeRestart.cpp | 45 +++++++++++++++++++++++ ndb/test/run-test/daily-basic-tests.txt | 4 ++ 4 files changed, 79 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index ed35db91738..9c2b441e7be 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -5,7 +5,7 @@ Next DBACC 3002 Next DBTUP 4014 Next DBLQH 5043 Next DBDICT 6007 -Next DBDIH 7181 +Next DBDIH 7183 Next DBTC 8039 Next CMVMI 9000 Next BACKUP 10022 diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index bf71bc56723..30749cb5a05 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -4811,6 +4811,15 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal) } else { ndbrequire(failedNodePtr.p->nodeStatus == NodeRecord::DYING); }//if + + if (ERROR_INSERTED(7181)) + { + ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ"); + CLEAR_ERROR_INSERT_VALUE; + signal->theData[1] = coldgcp; + execGCP_TCFINISHED(signal); + } + MasterGCPConf::State gcpState; switch (cgcpParticipantState) { case GCP_PARTICIPANT_READY: @@ -4877,6 +4886,14 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal) masterGCPConf->lcpActive[i] = SYSFILE->lcpActive[i]; sendSignal(newMasterBlockref, GSN_MASTER_GCPCONF, signal, MasterGCPConf::SignalLength, JBB); + + if (ERROR_INSERTED(7182)) + { + ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ"); + CLEAR_ERROR_INSERT_VALUE; + signal->theData[1] = coldgcp; + execGCP_TCFINISHED(signal); + } }//Dbdih::execMASTER_GCPREQ() void Dbdih::execMASTER_GCPCONF(Signal* signal) @@ -7542,10 +7559,10 @@ void Dbdih::execGCP_NODEFINISH(Signal* signal) } else if (cmasterState == MASTER_TAKE_OVER_GCP) { jam(); //------------------------------------------------------------- - // We are currently taking over as master. We will delay the - // signal until we have completed the take over gcp handling. + // We are currently taking over as master. Ignore + // signal in this case since we will discover it in reception of + // MASTER_GCPCONF. //------------------------------------------------------------- - sendSignalWithDelay(reference(), GSN_GCP_NODEFINISH, signal, 20, 3); return; } else { ndbrequire(cmasterState == MASTER_ACTIVE); @@ -7692,6 +7709,15 @@ void Dbdih::execGCP_TCFINISHED(Signal* signal) Uint32 gci = signal->theData[1]; ndbrequire(gci == coldgcp); + if (ERROR_INSERTED(7181) || ERROR_INSERTED(7182)) + { + ndbout_c("killing %d", refToNode(cmasterdihref)); + signal->theData[0] = 9999; + sendSignal(numberToRef(CMVMI, refToNode(cmasterdihref)), + GSN_NDB_TAMPER, signal, 1, JBB); + return; + } + cgcpParticipantState = GCP_PARTICIPANT_TC_FINISHED; signal->theData[0] = cownNodeId; signal->theData[1] = coldgcp; diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index e8f8ac66f74..dfb48ea3657 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -1178,6 +1178,48 @@ runBug27003(NDBT_Context* ctx, NDBT_Step* step) } +int +runBug27283(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + NdbRestarter res; + + if (res.getNumDbNodes() < 2) + { + return NDBT_OK; + } + + static const int errnos[] = { 7181, 7182, 0 }; + + Uint32 pos = 0; + for (Uint32 i = 0; i Date: Tue, 20 Mar 2007 17:07:53 +0100 Subject: [PATCH 227/789] enabled test case + some fixes to do the enable mysql-test/r/rpl_ndb_sync.result: enabled test case mysql-test/t/disabled.def: enabled test case sql/ha_ndbcluster.cc: enabled test case sql/ha_ndbcluster_tables.h: add defines for old sys table storage/ndb/tools/restore/Restore.cpp: add check for old sys table --- mysql-test/r/rpl_ndb_sync.result | 8 ++++---- mysql-test/t/disabled.def | 3 --- sql/ha_ndbcluster.cc | 2 ++ sql/ha_ndbcluster_tables.h | 2 ++ storage/ndb/tools/restore/Restore.cpp | 3 ++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/rpl_ndb_sync.result b/mysql-test/r/rpl_ndb_sync.result index 2b9ca24fca0..a2c3b46db5a 100644 --- a/mysql-test/r/rpl_ndb_sync.result +++ b/mysql-test/r/rpl_ndb_sync.result @@ -60,11 +60,11 @@ hex(c2) hex(c3) c1 0 1 BCDEF 1 0 CD 0 0 DEFGHIJKL -SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status; +SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status; @the_epoch:=MAX(epoch) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) -FROM mysql.binlog_index WHERE epoch > ORDER BY epoch ASC LIMIT 1; +FROM mysql.ndb_binlog_index WHERE epoch > ORDER BY epoch ASC LIMIT 1; @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) master-bin.000001 CHANGE MASTER TO @@ -89,8 +89,8 @@ hex(c2) hex(c3) c1 DROP DATABASE ndbsynctest; STOP SLAVE; reset master; -select * from mysql.binlog_index; +select * from mysql.ndb_binlog_index; Position File epoch inserts updates deletes schemaops reset slave; -select * from mysql.apply_status; +select * from mysql.ndb_apply_status; server_id epoch diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 913fe8e62ee..be3e80dd969 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,8 +16,6 @@ concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed -ndb_restore_partition : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone -rpl_ndb_sync : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated @@ -37,5 +35,4 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb plugin : Bug#25659 memory leak via "plugins" test rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly -ndb_alter_table : Bug##25774 ndb_alter_table.test fails in DBUG_ASSERT() on Linux x64 ndb_single_user : Bug#27021 Error codes in mysqld in single user mode varies diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 44df0958c39..ba03d0a54d9 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -7608,7 +7608,9 @@ int handle_trailing_share(NDB_SHARE *share) /* Ndb share has not been released as it should */ +#ifdef NOT_YET DBUG_ASSERT(FALSE); +#endif /* This is probably an error. We can however save the situation diff --git a/sql/ha_ndbcluster_tables.h b/sql/ha_ndbcluster_tables.h index 9f7b9146d91..c6bc8f577f8 100644 --- a/sql/ha_ndbcluster_tables.h +++ b/sql/ha_ndbcluster_tables.h @@ -15,7 +15,9 @@ */ #define NDB_REP_DB "mysql" +#define OLD_NDB_REP_DB "cluster" #define NDB_REP_TABLE "ndb_binlog_index" #define NDB_APPLY_TABLE "ndb_apply_status" #define OLD_NDB_APPLY_TABLE "apply_status" #define NDB_SCHEMA_TABLE "ndb_schema" +#define OLD_NDB_SCHEMA_TABLE "schema" diff --git a/storage/ndb/tools/restore/Restore.cpp b/storage/ndb/tools/restore/Restore.cpp index 3d466384782..6b00d69108d 100644 --- a/storage/ndb/tools/restore/Restore.cpp +++ b/storage/ndb/tools/restore/Restore.cpp @@ -310,7 +310,8 @@ RestoreMetaData::markSysTables() "cluster_replication" -> "cluster" -> "mysql" */ strcmp(tableName, "cluster_replication/def/" OLD_NDB_APPLY_TABLE) == 0 || - strcmp(tableName, "cluster/def/" OLD_NDB_APPLY_TABLE) == 0 || + strcmp(tableName, OLD_NDB_REP_DB "/def/" OLD_NDB_APPLY_TABLE) == 0 || + strcmp(tableName, OLD_NDB_REP_DB "/def/" OLD_NDB_SCHEMA_TABLE) == 0 || strcmp(tableName, NDB_REP_DB "/def/" NDB_APPLY_TABLE) == 0 || strcmp(tableName, NDB_REP_DB "/def/" NDB_SCHEMA_TABLE)== 0 ) table->isSysTable = true; From 298cebc1ec392e189ececca4bd6ee396561e0565 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 18:31:49 +0100 Subject: [PATCH 228/789] echo.c: Corrected GPL to be version 2 only client/echo.c: Corrected GPL to be version 2 only --- client/echo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/echo.c b/client/echo.c index 4483eaad293..e3d22edb3ae 100644 --- a/client/echo.c +++ b/client/echo.c @@ -2,8 +2,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of From 26c3e79c65b7120a0033a015544095f4b3d6805f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 18:37:09 +0100 Subject: [PATCH 229/789] my_print_default does not need to be linked with odbc32.lib(and friends) --- extra/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index ed40ec3070a..a7a5e3e7b66 100644 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -38,7 +38,7 @@ ADD_CUSTOM_TARGET(GenError DEPENDS ${PROJECT_SOURCE_DIR}/include/mysqld_error.h) ADD_EXECUTABLE(my_print_defaults my_print_defaults.c) -TARGET_LINK_LIBRARIES(my_print_defaults strings mysys dbug taocrypt odbc32 odbccp32 wsock32) +TARGET_LINK_LIBRARIES(my_print_defaults strings mysys dbug taocrypt wsock32) ADD_EXECUTABLE(perror perror.c) TARGET_LINK_LIBRARIES(perror strings mysys dbug wsock32) From 9c89dd654e90d85fefc2459711063b680ed10f24 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 19:46:02 +0200 Subject: [PATCH 230/789] Bug #24484: To correctly decide which predicates can be evaluated with a given table the optimizer must know the exact set of tables that a predicate depends on. If that mask is too wide (refer to non-existing tables) the optimizer can erroneously skip a predicate. One such case of wrong table usage mask were the aggregate functions. The have a all-1 mask (meaning depend on all tables, including non-existent ones). Fixed by making a real used_tables mask for the aggregates. The mask is constructed in the following way : 1. OR the table dependency masks of all the arguments of the aggregate. 2. If all the arguments of the function are from the local name resolution context and it is evaluated in the same name resolution context where it is referenced all the tables from that name resolution context are OR-ed to the dependency mask. This is to denote that an aggregate function depends on the number of rows it processes. 3. Handle correctly the case of an aggregate function optimization (such that the aggregate function can be pre-calculated and made a constant). Made sure that an aggregate function is never a constant (unless subject of a specific optimization and pre-calculation). One other flaw was revealed and fixed in the process : references were not calling the recalculation method for used_tables of their targets. mysql-test/r/subselect3.result: Bug #24484: test case mysql-test/t/subselect3.test: Bug #24484: test case sql/item.h: Bug #24484: Item_ref must update the used tables. sql/item_sum.cc: Bug #24484: correct calculation of used_tables for aggregates. sql/item_sum.h: Bug #24484: correct calculation of used_tables for aggregates. sql/opt_range.cc: Bug #24484: fixed ref resolution in loose index scan sql/sql_base.cc: Bug #24484: moved counting of leaf tables inside setup_tables_and_check_access. sql/sql_class.h: Bug #24484: changed table count to more narrow type. sql/sql_insert.cc: Bug #24484: moved counting of leaf tables inside setup_tables_and_check_access. Substract the first table (and its subtables) of an INSERT statement from leaf_count. sql/sql_select.cc: Bug #24484: correct check for aggregates --- mysql-test/r/subselect3.result | 53 ++++++++++++++++++++++++++++++ mysql-test/t/subselect3.test | 41 +++++++++++++++++++++++ sql/item.h | 5 +++ sql/item_sum.cc | 36 +++++++++++++++++---- sql/item_sum.h | 59 +++++++++++++++++++++------------- sql/opt_range.cc | 6 ++-- sql/sql_base.cc | 2 ++ sql/sql_class.h | 3 ++ sql/sql_insert.cc | 6 ++-- sql/sql_select.cc | 23 +++++++------ 10 files changed, 189 insertions(+), 45 deletions(-) diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index 29143b9e504..1320bc76222 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -645,3 +645,56 @@ a b Z 2 2 0 3 3 1 drop table t1,t2; +CREATE TABLE t1 (a int, b INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b)); +INSERT INTO t1 VALUES (1,1,'a'), (1,2,'b'), (1,3,'c'), (1,4,'d'), (1,5,'e'), +(2,1,'f'), (2,2,'g'), (2,3,'h'), (3,4,'i'),(3,3,'j'), (3,2,'k'), (3,1,'l'), +(1,9,'m'); +CREATE TABLE t2 (a int, b INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b)); +INSERT INTO t2 SELECT * FROM t1; +SELECT a, MAX(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) +as test FROM t1 GROUP BY a; +a MAX(b) test +1 9 m +2 3 h +3 4 i +SELECT * FROM t1 GROUP by t1.a +HAVING (MAX(t1.b) > (SELECT MAX(t2.b) FROM t2 WHERE t2.c < t1.c +HAVING MAX(t2.b+t1.a) < 10)); +a b c +SELECT a, AVG(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b)) +AS test FROM t1 GROUP BY a; +a AVG(b) test +1 4.0000 NULL +2 2.0000 k +3 2.5000 NULL +SELECT a,b,c FROM t1 WHERE b in (9,3,4) ORDER BY b,c; +a b c +1 3 c +2 3 h +3 3 j +1 4 d +3 4 i +1 9 m +SELECT a, MAX(b), +(SELECT COUNT(DISTINCT t.c) FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) +LIMIT 1) +as cnt, +(SELECT t.b FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) LIMIT 1) +as t_b, +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) LIMIT 1) +as t_b, +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) ORDER BY t.c LIMIT 1) +as t_b +FROM t1 GROUP BY a; +a MAX(b) cnt t_b t_b t_b +1 9 1 9 m m +2 3 1 3 h h +3 4 1 4 i i +SELECT a, MAX(b), +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) LIMIT 1) as test +FROM t1 GROUP BY a; +a MAX(b) test +1 9 m +2 3 h +3 4 i +DROP TABLE t1, t2; diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test index ed8480ba464..e3703c0da16 100644 --- a/mysql-test/t/subselect3.test +++ b/mysql-test/t/subselect3.test @@ -489,3 +489,44 @@ select a, b, (a,b) in (select a, min(b) from t2 group by a) Z from t1; drop table t1,t2; +# +# Bug #24484: Aggregate function used in column list subquery gives erroneous +# error +# +CREATE TABLE t1 (a int, b INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b)); +INSERT INTO t1 VALUES (1,1,'a'), (1,2,'b'), (1,3,'c'), (1,4,'d'), (1,5,'e'), + (2,1,'f'), (2,2,'g'), (2,3,'h'), (3,4,'i'),(3,3,'j'), (3,2,'k'), (3,1,'l'), + (1,9,'m'); +CREATE TABLE t2 (a int, b INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b)); +INSERT INTO t2 SELECT * FROM t1; + +# Gives error, but should work since it is (a, b) is the PK so only one +# given match possible +SELECT a, MAX(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) + as test FROM t1 GROUP BY a; +SELECT * FROM t1 GROUP by t1.a + HAVING (MAX(t1.b) > (SELECT MAX(t2.b) FROM t2 WHERE t2.c < t1.c + HAVING MAX(t2.b+t1.a) < 10)); +SELECT a, AVG(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b)) + AS test FROM t1 GROUP BY a; + +SELECT a,b,c FROM t1 WHERE b in (9,3,4) ORDER BY b,c; + +SELECT a, MAX(b), + (SELECT COUNT(DISTINCT t.c) FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) + LIMIT 1) + as cnt, + (SELECT t.b FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) LIMIT 1) + as t_b, + (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) LIMIT 1) + as t_b, + (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) ORDER BY t.c LIMIT 1) + as t_b + FROM t1 GROUP BY a; + +SELECT a, MAX(b), + (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b) LIMIT 1) as test + FROM t1 GROUP BY a; + + +DROP TABLE t1, t2; diff --git a/sql/item.h b/sql/item.h index 6c41aa09f80..1e724e2aa93 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1881,6 +1881,11 @@ public: { return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables(); } + void update_used_tables() + { + if (!depended_from) + (*ref)->update_used_tables(); + } table_map not_null_tables() const { return (*ref)->not_null_tables(); } void set_result_field(Field *field) { result_field= field; } bool is_result_field() { return 1; } diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 8bfac058936..0b0fb065bb3 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -61,6 +61,7 @@ bool Item_sum::init_sum_func_check(THD *thd) /* Save a pointer to object to be used in items for nested set functions */ thd->lex->in_sum_func= this; nest_level= thd->lex->current_select->nest_level; + nest_level_tables_count= thd->lex->current_select->join->tables; ref_by= 0; aggr_level= -1; max_arg_level= -1; @@ -176,6 +177,7 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) */ set_if_bigger(in_sum_func->max_sum_func_level, aggr_level); } + update_used_tables(); thd->lex->in_sum_func= in_sum_func; return FALSE; } @@ -271,8 +273,8 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) } -Item_sum::Item_sum(List &list) - :arg_count(list.elements) +Item_sum::Item_sum(List &list) :arg_count(list.elements), + forced_const(FALSE) { if ((args=(Item**) sql_alloc(sizeof(Item*)*arg_count))) { @@ -296,7 +298,10 @@ Item_sum::Item_sum(List &list) Item_sum::Item_sum(THD *thd, Item_sum *item): Item_result_field(thd, item), arg_count(item->arg_count), - quick_group(item->quick_group) + nest_level(item->nest_level), aggr_level(item->aggr_level), + quick_group(item->quick_group), used_tables_cache(item->used_tables_cache), + forced_const(item->forced_const), + nest_level_tables_count(item->nest_level_tables_count) { if (arg_count <= 2) args=tmp_args; @@ -425,6 +430,26 @@ case DECIMAL_RESULT: } +void Item_sum::update_used_tables () +{ + if (!forced_const) + { + used_tables_cache= 0; + for (uint i=0 ; i < arg_count ; i++) + { + args[i]->update_used_tables(); + used_tables_cache|= args[i]->used_tables(); + } + + used_tables_cache&= PSEUDO_TABLE_BITS; + + /* the aggregate function is aggregated into its local context */ + if (aggr_level == nest_level) + used_tables_cache |= (1 << nest_level_tables_count) - 1; + } +} + + String * Item_sum_num::val_str(String *str) { @@ -484,7 +509,7 @@ Item_sum_num::fix_fields(THD *thd, Item **ref) Item_sum_hybrid::Item_sum_hybrid(THD *thd, Item_sum_hybrid *item) :Item_sum(thd, item), value(item->value), hybrid_type(item->hybrid_type), hybrid_field_type(item->hybrid_field_type), cmp_sign(item->cmp_sign), - used_table_cache(item->used_table_cache), was_values(item->was_values) + was_values(item->was_values) { /* copy results from old value */ switch (hybrid_type) { @@ -1072,7 +1097,6 @@ void Item_sum_count::cleanup() DBUG_ENTER("Item_sum_count::cleanup"); count= 0; Item_sum_int::cleanup(); - used_table_cache= ~(table_map) 0; DBUG_VOID_RETURN; } @@ -1553,7 +1577,7 @@ void Item_sum_hybrid::cleanup() { DBUG_ENTER("Item_sum_hybrid::cleanup"); Item_sum::cleanup(); - used_table_cache= ~(table_map) 0; + forced_const= FALSE; /* by default it is TRUE to avoid TRUE reporting by diff --git a/sql/item_sum.h b/sql/item_sum.h index f011f105453..9ddda94a8ee 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -215,7 +215,9 @@ TODO: to catch queries where the limit is exceeded to make the code clean here. -*/ +*/ + +class st_select_lex; class Item_sum :public Item_result_field { @@ -237,19 +239,26 @@ public: int8 max_sum_func_level;/* max level of aggregation for embedded functions */ bool quick_group; /* If incremental update of fields */ +protected: + table_map used_tables_cache; + bool forced_const; + byte nest_level_tables_count; + +public: + void mark_as_sum_func(); - Item_sum() :arg_count(0), quick_group(1) + Item_sum() :arg_count(0), quick_group(1), forced_const(FALSE) { mark_as_sum_func(); } - Item_sum(Item *a) - :args(tmp_args), arg_count(1), quick_group(1) + Item_sum(Item *a) :args(tmp_args), arg_count(1), quick_group(1), + forced_const(FALSE) { args[0]=a; mark_as_sum_func(); } - Item_sum( Item *a, Item *b ) - :args(tmp_args), arg_count(2), quick_group(1) + Item_sum( Item *a, Item *b ) :args(tmp_args), arg_count(2), quick_group(1), + forced_const(FALSE) { args[0]=a; args[1]=b; mark_as_sum_func(); @@ -319,10 +328,20 @@ public: virtual const char *func_name() const= 0; virtual Item *result_item(Field *field) { return new Item_field(field); } - table_map used_tables() const { return ~(table_map) 0; } /* Not used */ - bool const_item() const { return 0; } + table_map used_tables() const { return used_tables_cache; } + void update_used_tables (); + void cleanup() + { + Item::cleanup(); + forced_const= FALSE; + } bool is_null() { return null_value; } - void update_used_tables() { } + void make_const () + { + used_tables_cache= 0; + forced_const= TRUE; + } + virtual bool const_item() const { return forced_const; } void make_field(Send_field *field); void print(String *str); void fix_num_length_and_dec(); @@ -509,23 +528,23 @@ public: class Item_sum_count :public Item_sum_int { longlong count; - table_map used_table_cache; public: Item_sum_count(Item *item_par) - :Item_sum_int(item_par),count(0),used_table_cache(~(table_map) 0) + :Item_sum_int(item_par),count(0) {} Item_sum_count(THD *thd, Item_sum_count *item) - :Item_sum_int(thd, item), count(item->count), - used_table_cache(item->used_table_cache) + :Item_sum_int(thd, item), count(item->count) {} - table_map used_tables() const { return used_table_cache; } - bool const_item() const { return !used_table_cache; } enum Sumfunctype sum_func () const { return COUNT_FUNC; } void clear(); void no_rows_in_result() { count=0; } bool add(); - void make_const(longlong count_arg) { count=count_arg; used_table_cache=0; } + void make_const(longlong count_arg) + { + count=count_arg; + Item_sum::make_const(); + } longlong val_int(); void reset_field(); void cleanup(); @@ -805,28 +824,22 @@ protected: Item_result hybrid_type; enum_field_types hybrid_field_type; int cmp_sign; - table_map used_table_cache; bool was_values; // Set if we have found at least one row (for max/min only) public: Item_sum_hybrid(Item *item_par,int sign) :Item_sum(item_par), sum(0.0), sum_int(0), hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG), - cmp_sign(sign), used_table_cache(~(table_map) 0), - was_values(TRUE) + cmp_sign(sign), was_values(TRUE) { collation.set(&my_charset_bin); } Item_sum_hybrid(THD *thd, Item_sum_hybrid *item); bool fix_fields(THD *, Item **); - table_map used_tables() const { return used_table_cache; } - bool const_item() const { return !used_table_cache; } - void clear(); double val_real(); longlong val_int(); my_decimal *val_decimal(my_decimal *); void reset_field(); String *val_str(String *); - void make_const() { used_table_cache=0; } bool keep_field_type(void) const { return 1; } enum Item_result result_type () const { return hybrid_type; } enum enum_field_types field_type() const { return hybrid_field_type; } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index f0af4b7db2a..8985561dd30 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7516,7 +7516,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) else DBUG_RETURN(NULL); - Item *expr= min_max_item->args[0]; /* The argument of MIN/MAX. */ + /* The argument of MIN/MAX. */ + Item *expr= min_max_item->args[0]->real_item(); if (expr->type() == Item::FIELD_ITEM) /* Is it an attribute? */ { if (! min_max_arg_item) @@ -7894,6 +7895,7 @@ check_group_min_max_predicates(COND *cond, Item_field *min_max_arg_item, DBUG_ENTER("check_group_min_max_predicates"); DBUG_ASSERT(cond && min_max_arg_item); + cond= cond->real_item(); Item::Type cond_type= cond->type(); if (cond_type == Item::COND_ITEM) /* 'AND' or 'OR' */ { @@ -7931,7 +7933,7 @@ check_group_min_max_predicates(COND *cond, Item_field *min_max_arg_item, DBUG_PRINT("info", ("Analyzing: %s", pred->func_name())); for (uint arg_idx= 0; arg_idx < pred->argument_count (); arg_idx++) { - cur_arg= arguments[arg_idx]; + cur_arg= arguments[arg_idx]->real_item(); DBUG_PRINT("info", ("cur_arg: %s", cur_arg->full_name())); if (cur_arg->type() == Item::FIELD_ITEM) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index ad9cd5985d1..0f9ba371ce1 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4656,6 +4656,7 @@ bool setup_tables_and_check_access(THD *thd, TABLE_LIST *leaves_tmp = NULL; bool first_table= true; + thd->leaf_count= 0; if (setup_tables (thd, context, from_clause, tables, conds, &leaves_tmp, select_insert)) return TRUE; @@ -4673,6 +4674,7 @@ bool setup_tables_and_check_access(THD *thd, return TRUE; } first_table= false; + thd->leaf_count++; } return FALSE; } diff --git a/sql/sql_class.h b/sql/sql_class.h index 05034ebd573..3421f506ca5 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1432,6 +1432,9 @@ public: query_id_t first_query_id; } binlog_evt_union; + /* pass up the count of "leaf" tables in a JOIN out of setup_tables() */ + byte leaf_count; + THD(); ~THD(); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index fb59aeea8e7..c369f03d978 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2301,12 +2301,14 @@ bool mysql_insert_select_prepare(THD *thd) DBUG_ASSERT(select_lex->leaf_tables != 0); lex->leaf_tables_insert= select_lex->leaf_tables; /* skip all leaf tables belonged to view where we are insert */ - for (first_select_leaf_table= select_lex->leaf_tables->next_leaf; + for (first_select_leaf_table= select_lex->leaf_tables->next_leaf, + thd->leaf_count --; first_select_leaf_table && first_select_leaf_table->belong_to_view && first_select_leaf_table->belong_to_view == lex->leaf_tables_insert->belong_to_view; - first_select_leaf_table= first_select_leaf_table->next_leaf) + first_select_leaf_table= first_select_leaf_table->next_leaf, + thd->leaf_count --) {} select_lex->leaf_tables= first_select_leaf_table; DBUG_RETURN(FALSE); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 05ee0d77c1f..12bab33cc13 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -342,12 +342,15 @@ JOIN::prepare(Item ***rref_pointer_array, /* Check that all tables, fields, conds and order are ok */ - if ((!(select_options & OPTION_SETUP_TABLES_DONE) && - setup_tables_and_check_access(thd, &select_lex->context, join_list, - tables_list, &conds, - &select_lex->leaf_tables, FALSE, - SELECT_ACL, SELECT_ACL)) || - setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) || + if (!(select_options & OPTION_SETUP_TABLES_DONE) && + setup_tables_and_check_access(thd, &select_lex->context, join_list, + tables_list, &conds, + &select_lex->leaf_tables, FALSE, + SELECT_ACL, SELECT_ACL)) + DBUG_RETURN(-1); + tables= thd->leaf_count; + + if (setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) || select_lex->setup_ref_array(thd, og_num) || setup_fields(thd, (*rref_pointer_array), fields_list, 1, &all_fields, 1) || @@ -437,11 +440,6 @@ JOIN::prepare(Item ***rref_pointer_array, DBUG_RETURN(-1); } } - TABLE_LIST *table_ptr; - for (table_ptr= select_lex->leaf_tables; - table_ptr; - table_ptr= table_ptr->next_leaf) - tables++; } { /* Caclulate the number of groups */ @@ -6376,7 +6374,8 @@ static void update_depend_map(JOIN *join, ORDER *order) order->item[0]->update_used_tables(); order->depend_map=depend_map=order->item[0]->used_tables(); // Not item_sum(), RAND() and no reference to table outside of sub select - if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT))) + if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT)) + && !order->item[0]->with_sum_func) { for (JOIN_TAB **tab=join->map2table; depend_map ; From d59272fb3d138e940f56622c20813b032874e946 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 19:09:28 +0100 Subject: [PATCH 231/789] Bug #27231: Server crash when dumping into outfile with long FIELDS ENCLOSED BY option - Problem: data separators were copied to a fixed-size buffer on the stack; memcpy was used, without bounds checking; a server crash could result if long FIELDS ENCLOSED BY, etc., was given - Fix: write the separators directly, instead of copying to a buffer first (in select_export::send_data()) sql/sql_class.cc: In select_export::send_data(), write data separators directly, instead of copying into a fixed-size memory buffer before writing. This avoids a buffer overflow when very large separators are specified. --- sql/sql_class.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c8d90848f6e..b187d29021a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1048,7 +1048,6 @@ bool select_export::send_data(List &items) } row_count++; Item *item; - char *buff_ptr=buff; uint used_length=0,items_left=items.elements; List_iterator_fast li(items); @@ -1148,19 +1147,18 @@ bool select_export::send_data(List &items) goto err; } } - buff_ptr=buff; // Place separators here if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT)) { - memcpy(buff_ptr,exchange->enclosed->ptr(),exchange->enclosed->length()); - buff_ptr+=exchange->enclosed->length(); + if (my_b_write(&cache, (byte*) exchange->enclosed->ptr(), + exchange->enclosed->length())) + goto err; } if (--items_left) { - memcpy(buff_ptr,exchange->field_term->ptr(),field_term_length); - buff_ptr+=field_term_length; + if (my_b_write(&cache, (byte*) exchange->field_term->ptr(), + field_term_length)) + goto err; } - if (my_b_write(&cache,(byte*) buff,(uint) (buff_ptr-buff))) - goto err; } if (my_b_write(&cache,(byte*) exchange->line_term->ptr(), exchange->line_term->length())) From 53268e1c4a016efeae22a1f54a2deab2528fe50d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 19:19:17 +0100 Subject: [PATCH 232/789] Test "help": Shift the ID values up into a range where they will not collide with those which we use for real data, when we fill the system tables. Will be merged up to 5.0 where it is needed for 5.0.38. mysql-test/t/help.test: Now that (at least in 5.0) the system tables are filled with real data, inserting rows vith ID values 1 .. 5 will fail in release build tests (it did in 5.0.38) like it should already have done in customer installations. Shift the ID values up into a high area where they will not conflict, also make the distinct for the different kinds of values (= unique throughout the test). No change to the logic. --- mysql-test/t/help.test | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test index ff431fb4ebd..de0cefab76c 100644 --- a/mysql-test/t/help.test +++ b/mysql-test/t/help.test @@ -13,30 +13,30 @@ # impossible_category_3 # impossible_function_7 -insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1'); -select @category1_id:= 1; -insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2'); -select @category2_id:= 2; -insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id); -select @category3_id:= 3; +insert into mysql.help_category(help_category_id,name)values(10001,'impossible_category_1'); +select @category1_id:= 10001; +insert into mysql.help_category(help_category_id,name)values(10002,'impossible_category_2'); +select @category2_id:= 10002; +insert into mysql.help_category(help_category_id,name,parent_category_id)values(10003,'impossible_category_3',@category2_id); +select @category3_id:= 10003; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); -select @topic1_id:= 1; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); -select @topic2_id:= 2; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); -select @topic3_id:= 3; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); -select @topic4_id:= 4; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); -select @topic5_id:= 5; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10101,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); +select @topic1_id:= 10101; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10102,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); +select @topic2_id:= 10102; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10103,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); +select @topic3_id:= 10103; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10104,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); +select @topic4_id:= 10104; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10105,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); +select @topic5_id:= 10105; -insert into mysql.help_keyword(help_keyword_id,name)values(1,'impossible_function_1'); -select @keyword1_id:= 1; -insert into mysql.help_keyword(help_keyword_id,name)values(2,'impossible_function_5'); -select @keyword2_id:= 2; -insert into mysql.help_keyword(help_keyword_id,name)values(3,'impossible_function_6'); -select @keyword3_id:= 3; +insert into mysql.help_keyword(help_keyword_id,name)values(10201,'impossible_function_1'); +select @keyword1_id:= 10201; +insert into mysql.help_keyword(help_keyword_id,name)values(10202,'impossible_function_5'); +select @keyword2_id:= 10202; +insert into mysql.help_keyword(help_keyword_id,name)values(10203,'impossible_function_6'); +select @keyword3_id:= 10203; insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword1_id,@topic2_id); insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword2_id,@topic1_id); From 55e0ff5c33817fcb75a4a026893dfda2505ce77f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 19:36:11 +0100 Subject: [PATCH 233/789] Test "help": Shift the ID values up into a range where they will not collide with those which we use for real data, when we fill the system tables. Will be merged up to 5.0 where it is needed for 5.0.38. mysql-test/r/help.result: Fix the result file according to the changed ID values in "help.test". mysql-test/t/help.test: Now that (at least in 5.0) the system tables are filled with real data, inserting rows vith ID values 1 .. 5 will fail in release build tests (it did in 5.0.38) like it should already have done in customer installations. Shift the ID values up into a high area where they will not conflict, also make the distinct for the different kinds of values (= unique throughout the test). No change to the logic. --- mysql-test/r/help.result | 88 ++++++++++++++++++++-------------------- mysql-test/t/help.test | 44 ++++++++++---------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/mysql-test/r/help.result b/mysql-test/r/help.result index edf7d0e91cb..690d7dee5dc 100644 --- a/mysql-test/r/help.result +++ b/mysql-test/r/help.result @@ -1,47 +1,47 @@ -insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1'); -select @category1_id:= 1; -@category1_id:= 1 -1 -insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2'); -select @category2_id:= 2; -@category2_id:= 2 -2 -insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id); -select @category3_id:= 3; -@category3_id:= 3 -3 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); -select @topic1_id:= 1; -@topic1_id:= 1 -1 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); -select @topic2_id:= 2; -@topic2_id:= 2 -2 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); -select @topic3_id:= 3; -@topic3_id:= 3 -3 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); -select @topic4_id:= 4; -@topic4_id:= 4 -4 -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); -select @topic5_id:= 5; -@topic5_id:= 5 -5 -insert into mysql.help_keyword(help_keyword_id,name)values(1,'impossible_function_1'); -select @keyword1_id:= 1; -@keyword1_id:= 1 -1 -insert into mysql.help_keyword(help_keyword_id,name)values(2,'impossible_function_5'); -select @keyword2_id:= 2; -@keyword2_id:= 2 -2 -insert into mysql.help_keyword(help_keyword_id,name)values(3,'impossible_function_6'); -select @keyword3_id:= 3; -@keyword3_id:= 3 -3 +insert into mysql.help_category(help_category_id,name)values(10001,'impossible_category_1'); +select @category1_id:= 10001; +@category1_id:= 10001 +10001 +insert into mysql.help_category(help_category_id,name)values(10002,'impossible_category_2'); +select @category2_id:= 10002; +@category2_id:= 10002 +10002 +insert into mysql.help_category(help_category_id,name,parent_category_id)values(10003,'impossible_category_3',@category2_id); +select @category3_id:= 10003; +@category3_id:= 10003 +10003 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10101,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); +select @topic1_id:= 10101; +@topic1_id:= 10101 +10101 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10102,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); +select @topic2_id:= 10102; +@topic2_id:= 10102 +10102 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10103,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); +select @topic3_id:= 10103; +@topic3_id:= 10103 +10103 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10104,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); +select @topic4_id:= 10104; +@topic4_id:= 10104 +10104 +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10105,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); +select @topic5_id:= 10105; +@topic5_id:= 10105 +10105 +insert into mysql.help_keyword(help_keyword_id,name)values(10201,'impossible_function_1'); +select @keyword1_id:= 10201; +@keyword1_id:= 10201 +10201 +insert into mysql.help_keyword(help_keyword_id,name)values(10202,'impossible_function_5'); +select @keyword2_id:= 10202; +@keyword2_id:= 10202 +10202 +insert into mysql.help_keyword(help_keyword_id,name)values(10203,'impossible_function_6'); +select @keyword3_id:= 10203; +@keyword3_id:= 10203 +10203 insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword1_id,@topic2_id); insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword2_id,@topic1_id); insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword3_id,@topic3_id); diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test index ff431fb4ebd..de0cefab76c 100644 --- a/mysql-test/t/help.test +++ b/mysql-test/t/help.test @@ -13,30 +13,30 @@ # impossible_category_3 # impossible_function_7 -insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1'); -select @category1_id:= 1; -insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2'); -select @category2_id:= 2; -insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id); -select @category3_id:= 3; +insert into mysql.help_category(help_category_id,name)values(10001,'impossible_category_1'); +select @category1_id:= 10001; +insert into mysql.help_category(help_category_id,name)values(10002,'impossible_category_2'); +select @category2_id:= 10002; +insert into mysql.help_category(help_category_id,name,parent_category_id)values(10003,'impossible_category_3',@category2_id); +select @category3_id:= 10003; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); -select @topic1_id:= 1; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); -select @topic2_id:= 2; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); -select @topic3_id:= 3; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); -select @topic4_id:= 4; -insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); -select @topic5_id:= 5; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10101,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1'); +select @topic1_id:= 10101; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10102,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2'); +select @topic2_id:= 10102; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10103,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3'); +select @topic3_id:= 10103; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10104,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4'); +select @topic4_id:= 10104; +insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(10105,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7'); +select @topic5_id:= 10105; -insert into mysql.help_keyword(help_keyword_id,name)values(1,'impossible_function_1'); -select @keyword1_id:= 1; -insert into mysql.help_keyword(help_keyword_id,name)values(2,'impossible_function_5'); -select @keyword2_id:= 2; -insert into mysql.help_keyword(help_keyword_id,name)values(3,'impossible_function_6'); -select @keyword3_id:= 3; +insert into mysql.help_keyword(help_keyword_id,name)values(10201,'impossible_function_1'); +select @keyword1_id:= 10201; +insert into mysql.help_keyword(help_keyword_id,name)values(10202,'impossible_function_5'); +select @keyword2_id:= 10202; +insert into mysql.help_keyword(help_keyword_id,name)values(10203,'impossible_function_6'); +select @keyword3_id:= 10203; insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword1_id,@topic2_id); insert into mysql.help_relation(help_keyword_id,help_topic_id)values(@keyword2_id,@topic1_id); From ec81cfdc0ca40f411324549c01b569534946222f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 19:43:36 +0100 Subject: [PATCH 234/789] Remove the variables for long gone disable_ps_warnings --- client/mysqltest.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index d9f1f25e093..170819e9a1e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -105,7 +105,7 @@ static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0; static my_bool parsing_disabled= 0; static my_bool display_result_vertically= FALSE, display_metadata= FALSE; static my_bool disable_query_log= 0, disable_result_log= 0; -static my_bool disable_warnings= 0, disable_ps_warnings= 0; +static my_bool disable_warnings= 0; static my_bool disable_info= 1; static my_bool abort_on_error= 1; static my_bool is_windows= 0; @@ -264,7 +264,6 @@ enum enum_commands { Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG, Q_WAIT_FOR_SLAVE_TO_STOP, Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS, - Q_ENABLE_PS_WARNINGS, Q_DISABLE_PS_WARNINGS, Q_ENABLE_INFO, Q_DISABLE_INFO, Q_ENABLE_METADATA, Q_DISABLE_METADATA, Q_EXEC, Q_DELIMITER, @@ -328,8 +327,6 @@ const char *command_names[]= "wait_for_slave_to_stop", "enable_warnings", "disable_warnings", - "enable_ps_warnings", - "disable_ps_warnings", "enable_info", "disable_info", "enable_metadata", @@ -6056,8 +6053,6 @@ int main(int argc, char **argv) case Q_DISABLE_RESULT_LOG: disable_result_log=1; break; case Q_ENABLE_WARNINGS: disable_warnings=0; break; case Q_DISABLE_WARNINGS: disable_warnings=1; break; - case Q_ENABLE_PS_WARNINGS: disable_ps_warnings=0; break; - case Q_DISABLE_PS_WARNINGS: disable_ps_warnings=1; break; case Q_ENABLE_INFO: disable_info=0; break; case Q_DISABLE_INFO: disable_info=1; break; case Q_ENABLE_METADATA: display_metadata=1; break; From 91f7f3181670523aa657420ae47d1d20fcd07aea Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 11:51:09 -0700 Subject: [PATCH 235/789] Fixed bug #27257: queries containing subqueries with COUNT(*) aggregated in outer context returned wrong results. This happened only if the subquery did not contain any references to outer fields. As there were no references to outer fields the subquery erroneously was taken for non-correlated one. Now any set function aggregated in outer context makes the subquery correlated. mysql-test/r/subselect.result: Added a test case for bug #27257. mysql-test/t/subselect.test: Added a test case for bug #27257. --- mysql-test/r/subselect.result | 25 +++++++++++++++++++++++++ mysql-test/t/subselect.test | 21 +++++++++++++++++++++ sql/item_sum.cc | 1 + 3 files changed, 47 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index f2d41bd44ae..72bde001e87 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3880,3 +3880,28 @@ this is a test. 3 this is a test. 1 this is a test. 2 DROP table t1; +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); +SELECT COUNT(*), a, +(SELECT m FROM t2 WHERE m = count(*) LIMIT 1) +FROM t1 GROUP BY a; +COUNT(*) a (SELECT m FROM t2 WHERE m = count(*) LIMIT 1) +2 2 2 +3 3 3 +1 4 1 +SELECT COUNT(*), a, +(SELECT MIN(m) FROM t2 WHERE m = count(*)) +FROM t1 GROUP BY a; +COUNT(*) a (SELECT MIN(m) FROM t2 WHERE m = count(*)) +2 2 2 +3 3 3 +1 4 1 +SELECT COUNT(*), a +FROM t1 GROUP BY a +HAVING (SELECT MIN(m) FROM t2 WHERE m = count(*)) > 1; +COUNT(*) a +2 2 +3 3 +DROP TABLE t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 1655422c51e..a238c8f070b 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2741,4 +2741,25 @@ SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t; DROP table t1; +# +# Bug #27257: COUNT(*) aggregated in outer query +# +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); + +SELECT COUNT(*), a, + (SELECT m FROM t2 WHERE m = count(*) LIMIT 1) + FROM t1 GROUP BY a; + +SELECT COUNT(*), a, + (SELECT MIN(m) FROM t2 WHERE m = count(*)) + FROM t1 GROUP BY a; + +SELECT COUNT(*), a + FROM t1 GROUP BY a + HAVING (SELECT MIN(m) FROM t2 WHERE m = count(*)) > 1; + +DROP TABLE t1,t2; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 41f0dd6496b..a8ffa200102 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -267,6 +267,7 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) sl= sl->master_unit()->outer_select() ) sl->master_unit()->item->with_sum_func= 1; } + thd->lex->current_select->mark_as_dependent(aggr_sl); return FALSE; } From 4f5582d89c84c54ebb0bbd53eb6054181a0f3f90 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 16:01:38 -0400 Subject: [PATCH 236/789] Post Merge Fix. --- mysys/mf_tempdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c index ac61558725c..36eecbeac09 100644 --- a/mysys/mf_tempdir.c +++ b/mysys/mf_tempdir.c @@ -64,7 +64,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) DBUG_RETURN(FALSE); err: - delete_dynamic(&t_arr); /* Safe to free */ + delete_dynamic(&tmpdir->full_list); /* Safe to free */ pthread_mutex_destroy(&tmpdir->mutex); DBUG_RETURN(TRUE); } From 1dde952e764cfb709041807256b6a16484118886 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Mar 2007 22:13:55 -0700 Subject: [PATCH 237/789] Modified read buffer to see if performance difference existed. Re-enabled 8gig unit test. storage/archive/archive_test.c: Re-enabled longer test. storage/archive/azio.c: Adjusted variable read and write. storage/archive/azlib.h: Adjusted variable read and write --- storage/archive/archive_test.c | 16 +++++++++------- storage/archive/azio.c | 31 ++++++++++++++++--------------- storage/archive/azlib.h | 7 ++++--- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/storage/archive/archive_test.c b/storage/archive/archive_test.c index 9ac043330fc..a5b2d1dfcc9 100644 --- a/storage/archive/archive_test.c +++ b/storage/archive/archive_test.c @@ -217,14 +217,13 @@ int main(int argc, char *argv[]) azclose(&writer_handle); azclose(&reader_handle); - exit(0); unlink(TEST_FILENAME); /* Start size tests */ printf("About to run 2/4/8 gig tests now, you may want to hit CTRL-C\n"); - size_test(TWOGIG, 2097152L); - size_test(FOURGIG, 4194304L); - size_test(EIGHTGIG, 8388608L); + size_test(TWOGIG, 2088992L); + size_test(FOURGIG, 4177984L); + size_test(EIGHTGIG, 8355968L); return 0; } @@ -234,6 +233,7 @@ int size_test(unsigned long long length, unsigned long long rows_to_test_for) azio_stream writer_handle, reader_handle; unsigned long long write_length; unsigned long long read_length= 0; + unsigned long long count; unsigned int ret; char buffer[BUFFER_LEN]; int error; @@ -244,8 +244,10 @@ int size_test(unsigned long long length, unsigned long long rows_to_test_for) return 0; } - for (write_length= 0; write_length < length ; write_length+= ret) + for (count= 0, write_length= 0; write_length < length ; + write_length+= ret) { + count++; ret= azwrite(&writer_handle, test_string, BUFFER_LEN); if (ret != BUFFER_LEN) { @@ -257,7 +259,7 @@ int size_test(unsigned long long length, unsigned long long rows_to_test_for) azflush(&writer_handle, Z_SYNC_FLUSH); } } - assert(write_length == length); + assert(write_length != count * BUFFER_LEN); /* Number of rows time BUFFER_LEN */ azflush(&writer_handle, Z_SYNC_FLUSH); printf("Reading back data\n"); @@ -279,7 +281,7 @@ int size_test(unsigned long long length, unsigned long long rows_to_test_for) } } - assert(read_length == length); + assert(read_length == write_length); assert(writer_handle.rows == rows_to_test_for); azclose(&writer_handle); azclose(&reader_handle); diff --git a/storage/archive/azio.c b/storage/archive/azio.c index 7876dd69cab..6b01d9c3c88 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -55,8 +55,8 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd) s->stream.zalloc = (alloc_func)0; s->stream.zfree = (free_func)0; s->stream.opaque = (voidpf)0; - memset(s->inbuf, 0, AZ_BUFSIZE); - memset(s->outbuf, 0, AZ_BUFSIZE); + memset(s->inbuf, 0, AZ_BUFSIZE_READ); + memset(s->outbuf, 0, AZ_BUFSIZE_WRITE); s->stream.next_in = s->inbuf; s->stream.next_out = s->outbuf; s->stream.avail_in = s->stream.avail_out = 0; @@ -109,7 +109,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd) return Z_NULL; } } - s->stream.avail_out = AZ_BUFSIZE; + s->stream.avail_out = AZ_BUFSIZE_WRITE; errno = 0; s->file = fd < 0 ? my_open(path, Flags, MYF(0)) : fd; @@ -159,7 +159,7 @@ void write_header(azio_stream *s) char buffer[AZHEADER_SIZE + AZMETA_BUFFER_SIZE]; char *ptr= buffer; - s->block_size= AZ_BUFSIZE; + s->block_size= AZ_BUFSIZE_WRITE; s->version = (unsigned char)az_magic[1]; s->minor_version = (unsigned char)az_magic[2]; @@ -224,7 +224,7 @@ int get_byte(s) if (s->stream.avail_in == 0) { errno = 0; - s->stream.avail_in = my_read(s->file, (byte *)s->inbuf, AZ_BUFSIZE, MYF(0)); + s->stream.avail_in = my_read(s->file, (byte *)s->inbuf, AZ_BUFSIZE_READ, MYF(0)); if (s->stream.avail_in == 0) { s->z_eof = 1; @@ -260,7 +260,7 @@ void check_header(azio_stream *s) if (len < 2) { if (len) s->inbuf[0] = s->stream.next_in[0]; errno = 0; - len = (uInt)my_read(s->file, (byte *)s->inbuf + len, AZ_BUFSIZE >> len, MYF(0)); + len = (uInt)my_read(s->file, (byte *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0)); if (len == 0) s->z_err = Z_ERRNO; s->stream.avail_in += len; s->stream.next_in = s->inbuf; @@ -455,7 +455,7 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int * if (s->stream.avail_in == 0 && !s->z_eof) { errno = 0; - s->stream.avail_in = (uInt)my_read(s->file, (byte *)s->inbuf, AZ_BUFSIZE, MYF(0)); + s->stream.avail_in = (uInt)my_read(s->file, (byte *)s->inbuf, AZ_BUFSIZE_READ, MYF(0)); if (s->stream.avail_in == 0) { s->z_eof = 1; @@ -522,12 +522,13 @@ unsigned int azwrite (azio_stream *s, voidpc buf, unsigned int len) { s->stream.next_out = s->outbuf; - if (my_write(s->file, (byte *)s->outbuf, AZ_BUFSIZE, MYF(0)) != AZ_BUFSIZE) + if (my_write(s->file, (byte *)s->outbuf, AZ_BUFSIZE_WRITE, + MYF(0)) != AZ_BUFSIZE_WRITE) { s->z_err = Z_ERRNO; break; } - s->stream.avail_out = AZ_BUFSIZE; + s->stream.avail_out = AZ_BUFSIZE_WRITE; } s->in += s->stream.avail_in; s->out += s->stream.avail_out; @@ -563,7 +564,7 @@ int do_flush (azio_stream *s, int flush) for (;;) { - len = AZ_BUFSIZE - s->stream.avail_out; + len = AZ_BUFSIZE_WRITE - s->stream.avail_out; if (len != 0) { @@ -574,7 +575,7 @@ int do_flush (azio_stream *s, int flush) return Z_ERRNO; } s->stream.next_out = s->outbuf; - s->stream.avail_out = AZ_BUFSIZE; + s->stream.avail_out = AZ_BUFSIZE_WRITE; } if (done) break; s->out += s->stream.avail_out; @@ -675,8 +676,8 @@ my_off_t azseek (s, offset, whence) /* There was a zmemzero here if inbuf was null -Brian */ while (offset > 0) { - uInt size = AZ_BUFSIZE; - if (offset < AZ_BUFSIZE) size = (uInt)offset; + uInt size = AZ_BUFSIZE_WRITE; + if (offset < AZ_BUFSIZE_WRITE) size = (uInt)offset; size = azwrite(s, s->inbuf, size); if (size == 0) return -1L; @@ -719,8 +720,8 @@ my_off_t azseek (s, offset, whence) } while (offset > 0) { int error; - unsigned int size = AZ_BUFSIZE; - if (offset < AZ_BUFSIZE) size = (int)offset; + unsigned int size = AZ_BUFSIZE_READ; + if (offset < AZ_BUFSIZE_READ) size = (int)offset; size = azread(s, s->outbuf, size, &error); if (error <= 0) return -1L; diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h index 9076ff23192..663b746ec52 100644 --- a/storage/archive/azlib.h +++ b/storage/archive/azlib.h @@ -196,7 +196,8 @@ extern "C" { /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ -#define AZ_BUFSIZE 16384 +#define AZ_BUFSIZE_READ 524288 +#define AZ_BUFSIZE_WRITE 16384 typedef struct azio_stream { @@ -204,8 +205,8 @@ typedef struct azio_stream { int z_err; /* error code for last stream operation */ int z_eof; /* set if end of input file */ File file; /* .gz file */ - Byte inbuf[AZ_BUFSIZE]; /* input buffer */ - Byte outbuf[AZ_BUFSIZE]; /* output buffer */ + Byte inbuf[AZ_BUFSIZE_READ]; /* input buffer */ + Byte outbuf[AZ_BUFSIZE_WRITE]; /* output buffer */ uLong crc; /* crc32 of uncompressed data */ char *msg; /* error message */ int transparent; /* 1 if input file is not a .gz file */ From 3b16860dd3b5e66156997741dc96873a26dc6ad6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 08:02:11 +0100 Subject: [PATCH 238/789] minor fix of ndb cluster startup script --- mysql-test/ndb/ndbcluster.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 1e25cd8047e..2d550294c84 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -35,8 +35,8 @@ if [ -d ../sql ] ; then exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd exec_waiter=$ndbtop/tools/ndb_waiter exec_test=$ndbtop/tools/ndb_test_platform - exec_test_ndberror= exec_test_ndberror=$ndbtop/src/ndbapi/ndberror_check + exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm else BINARY_DIST=1 if test -x "$BASEDIR/libexec/ndbd" From c73db035de783d5a7079922df4dd3c39365582ad Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 08:22:36 +0100 Subject: [PATCH 239/789] correct event buffer status reporting --- storage/ndb/src/common/debugger/EventLogger.cpp | 4 ++-- storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/storage/ndb/src/common/debugger/EventLogger.cpp b/storage/ndb/src/common/debugger/EventLogger.cpp index f6665faa187..6e446646898 100644 --- a/storage/ndb/src/common/debugger/EventLogger.cpp +++ b/storage/ndb/src/common/debugger/EventLogger.cpp @@ -652,9 +652,9 @@ void getTextEventBufferStatus(QQQQ) { "Event buffer status: used=%d%s(%d%) alloc=%d%s(%d%) " "max=%d%s apply_gci=%lld latest_gci=%lld", used, used_unit, - theData[2] ? (theData[1]*100)/theData[2] : 0, + theData[2] ? (Uint32)((((Uint64)theData[1])*100)/theData[2]) : 0, alloc, alloc_unit, - theData[3] ? (theData[2]*100)/theData[3] : 0, + theData[3] ? (Uint32)((((Uint64)theData[2])*100)/theData[3]) : 0, max_, max_unit, theData[4]+(((Uint64)theData[5])<<32), theData[6]+(((Uint64)theData[7])<<32)); diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp index 828ba51bc21..3449f3ff1d2 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -2100,15 +2100,17 @@ NdbEventBuffer::alloc_mem(EventBufData* data, NdbMem_Free((char*)data->memory); assert(m_total_alloc >= data->sz); - m_total_alloc -= data->sz; data->memory = 0; data->sz = 0; data->memory = (Uint32*)NdbMem_Allocate(alloc_size); if (data->memory == 0) + { + m_total_alloc -= data->sz; DBUG_RETURN(-1); + } data->sz = alloc_size; - m_total_alloc += data->sz; + m_total_alloc += add_sz; if (change_sz != NULL) *change_sz += add_sz; @@ -2780,7 +2782,7 @@ NdbEventBuffer::reportStatus() else apply_gci= latest_gci; - if (100*m_free_data_sz < m_min_free_thresh*m_total_alloc && + if (100*(Uint64)m_free_data_sz < m_min_free_thresh*(Uint64)m_total_alloc && m_total_alloc > 1024*1024) { /* report less free buffer than m_free_thresh, @@ -2791,7 +2793,7 @@ NdbEventBuffer::reportStatus() goto send_report; } - if (100*m_free_data_sz > m_max_free_thresh*m_total_alloc && + if (100*(Uint64)m_free_data_sz > m_max_free_thresh*(Uint64)m_total_alloc && m_total_alloc > 1024*1024) { /* report more free than 2 * m_free_thresh From e320fd786922e4c9045c34575b2a1f0f133e3bdf Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 15:36:22 +0800 Subject: [PATCH 240/789] Bug#24568, NdbScanFilter NAND/NOR operations sometimes do not works as expected this patch is an absolutely necessary supplement of the previous patch, the previous patch doesnot cover isnull() and isnotnull() methods' effect. ndb/src/ndbapi/NdbScanFilter.cpp: correct isnull() and isnotnull() when these two methods called in a NAND/NOR operation --- ndb/src/ndbapi/NdbScanFilter.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index 89abba2eddc..eb0ef4ba391 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -328,12 +328,18 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){ int NdbScanFilter::isnull(int AttrId){ - return m_impl.cond_col(Interpreter::IS_NULL, AttrId); + if(m_impl.m_negative == 1) + return m_impl.cond_col(Interpreter::IS_NOT_NULL, AttrId); + else + return m_impl.cond_col(Interpreter::IS_NULL, AttrId); } int NdbScanFilter::isnotnull(int AttrId){ - return m_impl.cond_col(Interpreter::IS_NOT_NULL, AttrId); + if(m_impl.m_negative == 1) + return m_impl.cond_col(Interpreter::IS_NULL, AttrId); + else + return m_impl.cond_col(Interpreter::IS_NOT_NULL, AttrId); } struct tab3 { From 49f2196da044715f6584b4887d84bdd54ad9d185 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 08:40:24 +0100 Subject: [PATCH 241/789] Bug #26825 MySQL Server Crashes in high load - initialize to NULL, to avoid call of free on uninitialized variable --- sql/ha_ndbcluster.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 3d0d8a3f079..877005039e2 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -952,7 +952,7 @@ int ha_ndbcluster::get_metadata(const char *path) DBUG_PRINT("enter", ("m_tabname: %s, path: %s", m_tabname, path)); do { - const void *data, *pack_data; + const void *data= NULL, *pack_data= NULL; uint length, pack_length; if (!(tab= dict->getTable(m_tabname))) @@ -3755,7 +3755,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) if ((my_errno= build_index_list(ndb, table, ILBP_OPEN))) DBUG_RETURN(my_errno); - const void *data, *pack_data; + const void *data= NULL, *pack_data= NULL; uint length, pack_length; if (readfrm(table->s->path, &data, &length) || packfrm(data, length, &pack_data, &pack_length) || @@ -4343,7 +4343,7 @@ int ha_ndbcluster::create(const char *name, NDBTAB tab; NDBCOL col; uint pack_length, length, i, pk_length= 0; - const void *data, *pack_data; + const void *data= NULL, *pack_data= NULL; char name2[FN_HEADLEN]; bool create_from_engine= (info->table_options & HA_OPTION_CREATE_FROM_ENGINE); @@ -4378,8 +4378,11 @@ int ha_ndbcluster::create(const char *name, if (readfrm(name, &data, &length)) DBUG_RETURN(1); if (packfrm(data, length, &pack_data, &pack_length)) + { + my_free((char*)data, MYF(0)); DBUG_RETURN(2); - + } + DBUG_PRINT("info", ("setFrm data: 0x%lx len: %d", (long) pack_data, pack_length)); tab.setFrm(pack_data, pack_length); my_free((char*)data, MYF(0)); From 55400a0080850330fdb913a0af5028734d793e98 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 08:47:54 +0100 Subject: [PATCH 242/789] ndb - bug#27286 make sure master node is sendable, when getting ref::NotMaster storage/ndb/src/mgmsrv/MgmtSrvr.cpp: make sure master node is sendable, when getting ref::NotMaster --- storage/ndb/src/mgmsrv/MgmtSrvr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp index f46ee8261ec..34f4927f804 100644 --- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2131,6 +2131,8 @@ MgmtSrvr::alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type) { do_send = 1; nodeId = refToNode(ref->masterRef); + if (!theFacade->get_node_alive(nodeId)) + nodeId = 0; continue; } return ref->errorCode; @@ -2621,6 +2623,8 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) ndbout_c("I'm not master resending to %d", nodeId); #endif do_send = 1; // try again + if (!theFacade->get_node_alive(nodeId)) + m_master_node = nodeId = 0; continue; } event.Event = BackupEvent::BackupFailedToStart; From 34a9dd6a5e1bb9a1823adc0a25a97cff42dbbd0f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 08:57:14 +0100 Subject: [PATCH 243/789] ndb - bug#27286 (5.0 version) make sure master is sendable ndb/src/mgmsrv/MgmtSrvr.cpp: make sure master is sendable --- ndb/src/mgmsrv/MgmtSrvr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 5c4a5ef7d17..cad299e5386 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2406,6 +2406,8 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) ndbout_c("I'm not master resending to %d", nodeId); #endif do_send = 1; // try again + if (!theFacade->get_node_alive(nodeId)) + m_master_node = nodeId = 0; continue; } event.Event = BackupEvent::BackupFailedToStart; From f275b8e9f5e231dbacc2a152923864471b4de1c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 09:13:05 +0100 Subject: [PATCH 244/789] ndb - bug#24028 in 5.0 proper fix exists only in version >= 5.1 mysql-test/r/ndb_blob.result: bug#24028 in 5.0 only mysql-test/t/ndb_blob.test: bug#24028 in 5.0 only ndb/src/ndbapi/NdbBlob.cpp: bug#24028 in 5.0 only ndb/test/ndbapi/testBlobs.cpp: bug#24028 in 5.0 only --- mysql-test/r/ndb_blob.result | 2 ++ mysql-test/t/ndb_blob.test | 5 ++++ ndb/src/ndbapi/NdbBlob.cpp | 6 +++++ ndb/test/ndbapi/testBlobs.cpp | 50 +++++++++++++++++++++++------------ 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index a5a40cffa91..2864b1dc7c9 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -76,6 +76,8 @@ commit; select a from t1 where d is null; a 1 +delete from t1 where a=45567; +commit; delete from t1 where a=1; delete from t1 where a=2; commit; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index d6e0edc89f0..32699017c03 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -96,6 +96,11 @@ update t1 set d=null where a=1; commit; select a from t1 where d is null; +# bug#24028 - does not occur on MySQL level +# bug#17986 - not seen by us anymore but could show as warning here +delete from t1 where a=45567; +commit; + # pk delete delete from t1 where a=1; delete from t1 where a=2; diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index f0e6bf2e720..2d8a4cf6bf8 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -407,6 +407,12 @@ NdbBlob::getHeadInlineValue(NdbOperation* anOp) setErrorCode(anOp); DBUG_RETURN(-1); } + /* + * If we get no data from this op then the operation is aborted + * one way or other. Following hack in 5.0 makes sure we don't read + * garbage. The proper fix exists only in version >= 5.1. + */ + theHead->length = 0; DBUG_RETURN(0); } diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index bc703d64f21..88b679eeeec 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -123,24 +123,24 @@ printusage() << "metadata" << endl << " -pk2len N length of PK2 [" << d.m_pk2len << "/" << g_max_pk2len <<"]" << endl << " -oneblob only 1 blob attribute [default 2]" << endl - << "testcases for test/skip" << endl + << "test cases for test/skip" << endl << " k primary key ops" << endl << " i hash index ops" << endl << " s table scans" << endl << " r ordered index scans" << endl << " p performance test" << endl - << "additional flags for test/skip" << endl + << "operations for test/skip" << endl << " u update existing blob value" << endl << " n normal insert and update" << endl << " w insert and update using writeTuple" << endl + << "blob operation styles for test/skip" << endl << " 0 getValue / setValue" << endl << " 1 setActiveHook" << endl << " 2 readData / writeData" << endl - << "bug tests (no blob test)" << endl + << "example: -test kn0 (need all 3 parts)" << endl + << "bug tests" << endl << " -bug 4088 ndb api hang with mixed ops on index table" << endl << " -bug 27018 middle partial part write clobbers rest of part" << endl - << " -bug nnnn delete + write gives 626" << endl - << " -bug nnnn acc crash on delete and long key" << endl ; } @@ -1028,6 +1028,32 @@ deletePk() return 0; } +static int +deleteNoPk() +{ + DBG("--- deleteNoPk ---"); + Tup no_tup; // bug#24028 + no_tup.m_pk1 = 0xb1ffb1ff; + sprintf(no_tup.m_pk2, "%-*.*s", g_opt.m_pk2len, g_opt.m_pk2len, "b1ffb1ff"); + CHK((g_con = g_ndb->startTransaction()) != 0); + Tup& tup = no_tup; + DBG("deletePk pk1=" << hex << tup.m_pk1); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->deleteTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(g_con->execute(Commit) == -1); // fail + // BUG: error should be on op but is on con now + DBG("con: " << g_con->getNdbError()); + DBG("opr: " << g_opr->getNdbError()); + CHK(g_con->getNdbError().code == 626 || g_opr->getNdbError().code == 626); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + return 0; +} + // hash index ops static int @@ -1383,6 +1409,7 @@ testmain() CHK(readPk(style) == 0); } CHK(deletePk() == 0); + CHK(deleteNoPk() == 0); CHK(verifyBlob() == 0); } if (testcase('w')) { @@ -1397,6 +1424,7 @@ testmain() CHK(readPk(style) == 0); } CHK(deletePk() == 0); + CHK(deleteNoPk() == 0); CHK(verifyBlob() == 0); } } @@ -1857,18 +1885,6 @@ bugtest_27018() return 0; } -static int -bugtest_2222() -{ - return 0; -} - -static int -bugtest_3333() -{ - return 0; -} - static struct { int m_bug; int (*m_test)(); From a7970e2408a74829c7bb8cd8b260f337d243d3e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 09:23:49 +0100 Subject: [PATCH 245/789] Bug #26825 MySQL Server Crashes in high load - initialize to NULL, to avoid call of free on uninitialized variable --- sql/ha_ndbcluster.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b091ad10fd3..ab7c3e2edc8 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6063,7 +6063,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db, int error= 0; NdbError ndb_error; uint len; - const void* data; + const void* data= NULL; Ndb* ndb; char key[FN_REFLEN]; DBUG_ENTER("ndbcluster_discover"); @@ -6131,6 +6131,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db, DBUG_RETURN(0); err: + my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); if (share) free_share(&share); if (ndb_error.code) From f397b422883a1bd039d66e54b148383d5e6e76c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 09:28:26 +0100 Subject: [PATCH 246/789] mysqlbinlog-cp932.test: merging mysql-test/t/mysqlbinlog-cp932.test: merging --- mysql-test/t/mysqlbinlog-cp932.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test index 5d44ab63f12..5a5b7646cf4 100644 --- a/mysql-test/t/mysqlbinlog-cp932.test +++ b/mysql-test/t/mysqlbinlog-cp932.test @@ -1,3 +1,6 @@ +# disabled in embedded until tools running is fixed with embedded +--source include/not_embedded.inc + -- source include/have_binlog_format_mixed_or_statement.inc -- source include/have_cp932.inc From a5c27d6cb3b234318cd578b772508c7700d47856 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 17:12:30 +0400 Subject: [PATCH 247/789] BUG#25908 - corrupted myisam table crashes server even after repair Opening certain tables that have different definitions in .MYI and .frm may result in a server crash. Compare .MYI and .frm definition when myisam table is opened. In case definitions are diffirent refuse to open such table. No test case, since it requires broken table. storage/myisam/ha_myisam.cc: Compare .MYI and .frm definition when myisam table is opened. In case definitions are diffirent refuse to open such table. --- storage/myisam/ha_myisam.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index a67d62f7447..587e5220e1c 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -632,6 +632,9 @@ bool ha_myisam::check_if_locking_is_allowed(uint sql_command, int ha_myisam::open(const char *name, int mode, uint test_if_locked) { + MI_KEYDEF *keyinfo; + MI_COLUMNDEF *recinfo= 0; + uint recs; uint i; /* @@ -654,6 +657,26 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) if (!(file=mi_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) return (my_errno ? my_errno : -1); + if (!table->s->tmp_table) /* No need to perform a check for tmp table */ + { + if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs))) + { + /* purecov: begin inspected */ + DBUG_PRINT("error", ("Failed to convert TABLE object to MyISAM " + "key and column definition")); + goto err; + /* purecov: end */ + } + if (check_definition(keyinfo, recinfo, table->s->keys, recs, + file->s->keyinfo, file->s->rec, + file->s->base.keys, file->s->base.fields, true)) + { + /* purecov: begin inspected */ + my_errno= HA_ERR_CRASHED; + goto err; + /* purecov: end */ + } + } if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE)) VOID(mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0)); @@ -675,6 +698,15 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) table->key_info[i].block_size= file->s->keyinfo[i].block_length; } return (0); +err: + this->close(); + /* + Both recinfo and keydef are allocated by my_multi_malloc(), thus only + recinfo must be freed. + */ + if (recinfo) + my_free((gptr) recinfo, MYF(0)); + return my_errno; } int ha_myisam::close(void) From f5acedb6a7d415447654dcf9377dd36954d44fa6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 15:34:47 +0100 Subject: [PATCH 248/789] ndb - bug#27283 Additional fix for 2-node case ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Add error insert ref for errcode = 7181 ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Make GSN_GCP_NODEFINISH always be sent to DIH node requesting it ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Make GSN_GCP_NODEFINISH always be sent to DIH node requesting it ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Make GSN_GCP_NODEFINISH always be sent to DIH node requesting it --- ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 2 ++ ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 7 ++++++- ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 3 +++ ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 41240a2d620..97c123ae3f4 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -1628,6 +1628,8 @@ private: // NR Uint32 c_dictLockSlavePtrI_nodeRestart; // userPtr for NR void recvDictLockConf_nodeRestart(Signal* signal, Uint32 data, Uint32 ret); + + Uint32 c_error_7181_ref; }; #if (DIH_CDATA_SIZE < _SYSFILE_SIZE32) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 30749cb5a05..967c00ea50f 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -4816,6 +4816,7 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal) { ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ"); CLEAR_ERROR_INSERT_VALUE; + signal->theData[0] = c_error_7181_ref; signal->theData[1] = coldgcp; execGCP_TCFINISHED(signal); } @@ -4891,6 +4892,7 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal) { ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ"); CLEAR_ERROR_INSERT_VALUE; + signal->theData[0] = c_error_7181_ref; signal->theData[1] = coldgcp; execGCP_TCFINISHED(signal); } @@ -7697,6 +7699,7 @@ void Dbdih::execGCP_COMMIT(Signal* signal) cgckptflag = false; emptyverificbuffer(signal, true); cgcpParticipantState = GCP_PARTICIPANT_COMMIT_RECEIVED; + signal->theData[0] = calcDihBlockRef(masterNodeId); signal->theData[1] = coldgcp; sendSignal(clocaltcblockref, GSN_GCP_NOMORETRANS, signal, 2, JBB); return; @@ -7706,11 +7709,13 @@ void Dbdih::execGCP_TCFINISHED(Signal* signal) { jamEntry(); CRASH_INSERTION(7007); + Uint32 retRef = signal->theData[0]; Uint32 gci = signal->theData[1]; ndbrequire(gci == coldgcp); if (ERROR_INSERTED(7181) || ERROR_INSERTED(7182)) { + c_error_7181_ref = retRef; // Save ref ndbout_c("killing %d", refToNode(cmasterdihref)); signal->theData[0] = 9999; sendSignal(numberToRef(CMVMI, refToNode(cmasterdihref)), @@ -7722,7 +7727,7 @@ void Dbdih::execGCP_TCFINISHED(Signal* signal) signal->theData[0] = cownNodeId; signal->theData[1] = coldgcp; signal->theData[2] = cfailurenr; - sendSignal(cmasterdihref, GSN_GCP_NODEFINISH, signal, 3, JBB); + sendSignal(retRef, GSN_GCP_NODEFINISH, signal, 3, JBB); }//Dbdih::execGCP_TCFINISHED() /*****************************************************************************/ diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index 792586d7baf..1e8fcee759c 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -1952,5 +1952,8 @@ private: // those variables should be removed and exchanged for stack // variable communication. /**************************************************************************/ + + Uint32 c_gcp_ref; }; + #endif diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 9f1426109d4..1185b790bdd 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -6894,6 +6894,7 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr) void Dbtc::execGCP_NOMORETRANS(Signal* signal) { jamEntry(); + c_gcp_ref = signal->theData[0]; tcheckGcpId = signal->theData[1]; if (cfirstgcp != RNIL) { jam(); @@ -9937,6 +9938,7 @@ void Dbtc::sendScanTabConf(Signal* signal, ScanRecordPtr scanPtr) { void Dbtc::gcpTcfinished(Signal* signal) { + signal->theData[0] = c_gcp_ref; signal->theData[1] = tcheckGcpId; sendSignal(cdihblockref, GSN_GCP_TCFINISHED, signal, 2, JBB); }//Dbtc::gcpTcfinished() From 983e1f5acb90ef3db021f393b7d294017f2da926 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 15:49:51 +0100 Subject: [PATCH 249/789] fix shell script BUILD/check-cpu: make comparison a little more compatible with less exotic shells --- BUILD/check-cpu | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BUILD/check-cpu b/BUILD/check-cpu index f1c9bc51dc5..d7125da192d 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -160,13 +160,18 @@ check_cpu () { cc_ver=`$cc --version | sed 1q` cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'` + set -- `echo $cc_verno | tr '.' ' '` + cc_major=$1 + cc_minor=$2 + cc_patch=$3 + cc_comp=`expr $cc_major '*' 100 '+' $cc_minor` case "$cc_ver--$cc_verno" in *GCC*) # different gcc backends (and versions) have different CPU flags case `gcc -dumpmachine` in i?86-*) - if test "$cc_verno" -lt "3.4" + if test "$cc_comp" -lt 304 then check_cpu_args='-mcpu=$cpu_arg' else @@ -177,7 +182,7 @@ check_cpu () { check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg' ;; x86_64-*) - if test "$cc_verno" -lt "3.4" + if test "$cc_comp" -lt 304 then check_cpu_args='-mcpu=$cpu_arg' else From 33a51fd8436cc418df0e1ce5ee0f12da6f8ab16b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 19:20:44 +0300 Subject: [PATCH 250/789] Fix a broken merge. scripts/mysql_system_tables.sql: Add time_zone to the list of mysql.event columns. scripts/mysql_system_tables_fix.sql: Update after a bad merge: now mysql_system_tables_fix contains only alter definitions, no CREATE definitions (single definition source approach that was implemented by Magnus). --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 70 +++-------------------------- 2 files changed, 6 insertions(+), 66 deletions(-) diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7be5c94ad80..f6e2a45339e 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -70,7 +70,7 @@ CALL create_slow_log_table(); DROP PROCEDURE create_slow_log_table; -CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 57f97256b39..d973c1dddae 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -424,83 +424,24 @@ END// delimiter ; CALL create_log_tables(); DROP PROCEDURE create_log_tables; -# -# EVENT table -# - - -CREATE TABLE event ( - db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - name char(64) CHARACTER SET utf8 NOT NULL default '', - body longblob NOT NULL, - definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - execute_at DATETIME default NULL, - interval_value int(11) default NULL, - interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK', - 'SECOND','MICROSECOND', 'YEAR_MONTH','DAY_HOUR', - 'DAY_MINUTE','DAY_SECOND', - 'HOUR_MINUTE','HOUR_SECOND', - 'MINUTE_SECOND','DAY_MICROSECOND', - 'HOUR_MICROSECOND','MINUTE_MICROSECOND', - 'SECOND_MICROSECOND') default NULL, - created TIMESTAMP NOT NULL, - modified TIMESTAMP NOT NULL, - last_executed DATETIME default NULL, - starts DATETIME default NULL, - ends DATETIME default NULL, - status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', - on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', - sql_mode set( - 'REAL_AS_FLOAT', - 'PIPES_AS_CONCAT', - 'ANSI_QUOTES', - 'IGNORE_SPACE', - 'NOT_USED', - 'ONLY_FULL_GROUP_BY', - 'NO_UNSIGNED_SUBTRACTION', - 'NO_DIR_IN_CREATE', - 'POSTGRESQL', - 'ORACLE', - 'MSSQL', - 'DB2', - 'MAXDB', - 'NO_KEY_OPTIONS', - 'NO_TABLE_OPTIONS', - 'NO_FIELD_OPTIONS', - 'MYSQL323', - 'MYSQL40', - 'ANSI', - 'NO_AUTO_VALUE_ON_ZERO', - 'NO_BACKSLASH_ESCAPES', - 'STRICT_TRANS_TABLES', - 'STRICT_ALL_TABLES', - 'NO_ZERO_IN_DATE', - 'NO_ZERO_DATE', - 'INVALID_DATES', - 'ERROR_FOR_DIVISION_BY_ZERO', - 'TRADITIONAL', - 'NO_AUTO_CREATE_USER', - 'HIGH_NOT_PRECEDENCE' - ) DEFAULT '' NOT NULL, - comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', - PRIMARY KEY (db,name) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; - # # EVENT privilege # - SET @hadEventPriv := 0; SELECT @hadEventPriv :=1 FROM user WHERE Event_priv LIKE '%'; ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; ALTER TABLE user MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; +UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; + ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; +# +# EVENT table +# ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(db, name); ALTER TABLE event ADD sql_mode @@ -535,7 +476,6 @@ ALTER TABLE event ADD sql_mode 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; -UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 From 858ff63811b869eb50f7dabbc96761d6750b2711 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 20:32:15 +0300 Subject: [PATCH 251/789] Fix warnings on Windows. sql/event_data_objects.cc: Fix Windows 64 bit build warnings. No better fix exists at the moment. --- sql/event_data_objects.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 4a78c1affb0..67ba371772a 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1366,7 +1366,7 @@ Event_queue_element::compute_next_execution_time() goto ret; } - time_now= current_thd->query_start(); + time_now= (my_time_t) current_thd->query_start(); DBUG_PRINT("info",("NOW: [%lu]", (ulong) time_now)); @@ -1572,7 +1572,7 @@ Event_queue_element::mark_last_executed(THD *thd) { thd->end_time(); - last_executed= thd->query_start(); + last_executed= (my_time_t) thd->query_start(); last_executed_changed= TRUE; execution_count++; From 65c34cc855ea75b1f790e738e71d304ca72403ae Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 13:58:11 -0400 Subject: [PATCH 252/789] Bug#27144 sp-destruct.test is disabled on Windows - Update test to run properly on Windows. mysql-test/t/sp-destruct.test: Bug#27144 sp-destruct.test is disabled on Windows - Enabled test on Windows. - Replaced non-portable system commands (mkdir, rmdir, mv, cp, echo) with the mysqltest builtin commands. - Replace Windows directory seperator in error ER_NOT_FROM_FILE with posix directory seperator for single test/result pair. --- mysql-test/t/sp-destruct.test | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 4f5f1cdcb9b..13ddaa43fad 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -7,13 +7,10 @@ # In the case of trouble you might want to skip this. # -# We're using --system things that probably doesn't work on Windows. ---source include/not_windows.inc - # Backup proc table ---system rm -rf $MYSQLTEST_VARDIR/master-data/mysql/backup ---system mkdir $MYSQLTEST_VARDIR/master-data/mysql/backup ---system cp $MYSQLTEST_VARDIR/master-data/mysql/proc.* $MYSQLTEST_VARDIR/master-data/mysql/backup/ +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD +--copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI use test; @@ -45,22 +42,25 @@ insert into t1 values (0); flush table mysql.proc; # Thrashing the .frm file ---system echo 'saljdlfa' > $MYSQLTEST_VARDIR/master-data/mysql/proc.frm ---replace_result $MYSQLTEST_VARDIR . master-data// '' +--write_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm +saljdfa +EOF +--replace_result $MYSQLTEST_VARDIR . master-data// '' '\\' '/' --error ER_NOT_FORM_FILE call bug14233(); ---replace_result $MYSQLTEST_VARDIR . master-data// '' +--replace_result $MYSQLTEST_VARDIR . master-data// '' '\\' '/' --error ER_NOT_FORM_FILE create view v1 as select bug14233_f(); ---replace_result $MYSQLTEST_VARDIR . master-data// '' +--replace_result $MYSQLTEST_VARDIR . master-data// '' '\\' '/' --error ER_NOT_FORM_FILE insert into t1 values (0); - flush table mysql.proc; # Drop the mysql.proc table ---system rm $MYSQLTEST_VARDIR/master-data/mysql/proc.* +--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm +--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD +--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI --error ER_NO_SUCH_TABLE call bug14233(); --error ER_NO_SUCH_TABLE @@ -69,8 +69,12 @@ create view v1 as select bug14233_f(); insert into t1 values (0); # Restore mysql.proc ---system mv $MYSQLTEST_VARDIR/master-data/mysql/backup/* $MYSQLTEST_VARDIR/master-data/mysql/ ---system rmdir $MYSQLTEST_VARDIR/master-data/mysql/backup +--copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm +--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD +--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI +--remove_file $MYSQLTEST_VARDIR/tmp/proc.frm +--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYD +--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYI flush table mysql.proc; flush privileges; From fb616ccc530e31a4fc44cb9e3d9ef51745182024 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 11:05:43 -0700 Subject: [PATCH 253/789] Modifying mysql-test-run.pl to allow steeing of --secure-file-priv to 'mysql-test' when running suites other tha the main one mysql-test/mysql-test-run.pl: Modifying to allow steeing of --secure-file-priv to 'mysql-test' when running suites other tha the main one --- mysql-test/mysql-test-run.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index fadb7c5f0e0..c53c747caa5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3642,8 +3642,16 @@ sub mysqld_arguments ($$$$$) { if ( $mysql_version_id >= 50036) { - # Prevent the started mysqld to access files outside of vardir - mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir); + # By default, prevent the started mysqld to access files outside of vardir + my $secure_file_dir= $opt_vardir; + if ( $opt_suite ne "main" ) + { + # When running a suite other than default allow the mysqld + # access to subdirs of mysql-test/ in order to make it possible + # to "load data" from the suites data/ directory. + $secure_file_dir= $glob_mysql_test_dir; + } + mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $secure_file_dir); } if ( $mysql_version_id >= 50000 ) From 16404523645b8f396ebaea9da5dfa4c453056d06 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 21:54:38 +0300 Subject: [PATCH 254/789] Bug#23345: Wrongly allowed INTO in a non-last select of a UNION. INTO clause can be specified only for the last select of a UNION and it receives the result of the whole query. But it was wrongly allowed in non-last selects of a UNION which leads to a confusing query result. Now INTO allowed only in the last select of a UNION. mysql-test/t/union.test: Added a test case for the bug#23345: Wrongly allowed INTO in a non-last select of a UNION. mysql-test/r/union.result: Added a test case for the bug#23345: Wrongly allowed INTO in a non-last select of a UNION. sql/sql_yacc.yy: Bug#23345: Wrongly allowed INTO in a non-last select of a UNION. Now INTO allowed only in the last select of a UNION. --- mysql-test/r/union.result | 8 ++++++++ mysql-test/t/union.test | 9 +++++++++ sql/sql_yacc.yy | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 9861b1bffeb..8219d68a681 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1381,4 +1381,12 @@ a SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test; ERROR 42S22: Unknown column 'c' in 'order clause' DROP TABLE t1; +(select 1 into @var) union (select 1); +ERROR HY000: Incorrect usage of UNION and INTO +(select 1) union (select 1 into @var); +select @var; +@var +1 +(select 2) union (select 1 into @var); +ERROR 42000: Result consisted of more than one row End of 5.0 tests diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 29a9ee36481..22f09466b1c 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -868,4 +868,13 @@ SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test; DROP TABLE t1; +# +# Bug#23345: Wrongly allowed INTO in a non-last select of a UNION. +# +--error 1221 +(select 1 into @var) union (select 1); +(select 1) union (select 1 into @var); +select @var; +--error 1172 +(select 2) union (select 1 into @var); --echo End of 5.0 tests diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 258283d113e..a2e7100a6f5 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9307,7 +9307,7 @@ union_list: UNION_SYM union_option { LEX *lex=Lex; - if (lex->exchange) + if (lex->result) { /* Only the last SELECT can have INTO...... */ my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO"); From 20fd65ff836533398c47567855cf42ef89c2414a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 00:09:50 +0300 Subject: [PATCH 255/789] Try to fix events_logs_tests race on Windows. mysql-test/t/events_logs_tests.test: Try to fix a race condition that breaks this test on Windows. --- mysql-test/t/events_logs_tests.test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test index 64ce4a5c3df..25b75f13f01 100644 --- a/mysql-test/t/events_logs_tests.test +++ b/mysql-test/t/events_logs_tests.test @@ -89,10 +89,12 @@ DROP EVENT long_event; SET GLOBAL long_query_time=1; CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2); --echo "Sleep some more time than the actual event run will take" ---sleep 2.5 +let $wait_timeout= 30; +let $wait_condition= SELECT COUNT(*) = 1 FROM mysql.slow_log; +--source include/wait_condition.inc --echo "Check our table. Should see 2 rows" SELECT * FROM slow_event_test; ---echo "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" +--echo "Check slow log. Should see 1 row because 2 is over the threshold of 1 for GLOBAL, though under SESSION which is 10" --replace_column 1 USER_HOST 2 SLEEPVAL SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; DROP EVENT long_event2; From 8ed9a54008fae160d63dc27fa02b9ae4348238e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 00:11:58 +0300 Subject: [PATCH 256/789] Update the result file with an updated comment. --- mysql-test/r/events_logs_tests.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result index ede7d0f4e25..0d49060f4a9 100644 --- a/mysql-test/r/events_logs_tests.result +++ b/mysql-test/r/events_logs_tests.result @@ -85,7 +85,7 @@ SELECT * FROM slow_event_test; slo_val val 20 0 1 0 -"Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" +"Check slow log. Should see 1 row because 2 is over the threshold of 1 for GLOBAL, though under SESSION which is 10" SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; user_host query_time db sql_text USER_HOST SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2) From b444f808828e42b64cdd4fa8bc9e901b1ae6e119 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 00:34:15 +0300 Subject: [PATCH 257/789] Fix for BUG#24040: Create View don't succed with "all privileges" on a database. The problem was that we required not less privileges on the base tables than we have on the view. The fix is to be more flexible and allow to create such a view (necessary privileges will be checked at the runtime). mysql-test/r/view_grant.result: Updated result file. mysql-test/t/view_grant.test: Added test case for BUG#24040 (Create View don't succed with "all privileges" on a database). sql/sql_view.cc: Implement flexible privilege check for CREATE VIEW. --- mysql-test/r/view_grant.result | 97 +++++++++++++++++++++++++--- mysql-test/t/view_grant.test | 111 +++++++++++++++++++++++++++------ sql/sql_view.cc | 35 +++++++---- 3 files changed, 203 insertions(+), 40 deletions(-) diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 45cf5076fe1..3ddf4ca979c 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -282,15 +282,6 @@ create view mysqltest.v3 as select b from mysqltest.t2; grant create view, update on mysqltest.v3 to mysqltest_1@localhost; drop view mysqltest.v3; create view mysqltest.v3 as select b from mysqltest.t2; -grant create view, update, insert on mysqltest.v3 to mysqltest_1@localhost; -drop view mysqltest.v3; -create view mysqltest.v3 as select b from mysqltest.t2; -ERROR 42000: create view command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 'v3' -create table mysqltest.v3 (b int); -grant select(b) on mysqltest.v3 to mysqltest_1@localhost; -drop table mysqltest.v3; -create view mysqltest.v3 as select b from mysqltest.t2; -ERROR 42000: create view command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 'v3' create view v4 as select b+1 from mysqltest.t2; ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't2' grant create view,update,select on test.* to mysqltest_1@localhost; @@ -773,4 +764,92 @@ DROP DATABASE mysqltest_db1; DROP DATABASE mysqltest_db2; DROP USER mysqltest_u1@localhost; DROP USER mysqltest_u2@localhost; +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; +CREATE TABLE mysqltest1.t1(c1 INT); +CREATE TABLE mysqltest1.t2(c2 INT); +CREATE TABLE mysqltest1.t3(c3 INT); +CREATE TABLE mysqltest1.t4(c4 INT); +INSERT INTO mysqltest1.t1 VALUES (11), (12), (13), (14); +INSERT INTO mysqltest1.t2 VALUES (21), (22), (23), (24); +INSERT INTO mysqltest1.t3 VALUES (31), (32), (33), (34); +INSERT INTO mysqltest1.t4 VALUES (41), (42), (43), (44); +GRANT SELECT ON mysqltest1.t1 TO mysqltest_u1@localhost; +GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost; +GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost; +GRANT SELECT, DELETE ON mysqltest1.t4 TO mysqltest_u1@localhost; +GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u1@localhost; + +---> connection: bug24040_con +SELECT * FROM mysqltest1.t1; +c1 +11 +12 +13 +14 +INSERT INTO mysqltest1.t2 VALUES(25); +UPDATE mysqltest1.t3 SET c3 = 331 WHERE c3 = 31; +DELETE FROM mysqltest1.t4 WHERE c4 = 44; +CREATE VIEW v1 AS SELECT * FROM mysqltest1.t1; +CREATE VIEW v2 AS SELECT * FROM mysqltest1.t2; +CREATE VIEW v3 AS SELECT * FROM mysqltest1.t3; +CREATE VIEW v4 AS SELECT * FROM mysqltest1.t4; +SELECT * FROM v1; +c1 +11 +12 +13 +14 +INSERT INTO v2 VALUES(26); +UPDATE v3 SET c3 = 332 WHERE c3 = 32; +DELETE FROM v4 WHERE c4 = 43; +CREATE VIEW v12 AS SELECT c1, c2 FROM mysqltest1.t1, mysqltest1.t2; +ERROR 42000: create view command denied to user 'mysqltest_u1'@'localhost' for column 'c2' in table 'v12' +CREATE VIEW v13 AS SELECT c1, c3 FROM mysqltest1.t1, mysqltest1.t3; +CREATE VIEW v14 AS SELECT c1, c4 FROM mysqltest1.t1, mysqltest1.t4; +CREATE VIEW v21 AS SELECT c2, c1 FROM mysqltest1.t2, mysqltest1.t1; +ERROR 42000: create view command denied to user 'mysqltest_u1'@'localhost' for column 'c1' in table 'v21' +CREATE VIEW v23 AS SELECT c2, c3 FROM mysqltest1.t2, mysqltest1.t3; +ERROR 42000: create view command denied to user 'mysqltest_u1'@'localhost' for column 'c3' in table 'v23' +CREATE VIEW v24 AS SELECT c2, c4 FROM mysqltest1.t2, mysqltest1.t4; +ERROR 42000: create view command denied to user 'mysqltest_u1'@'localhost' for column 'c4' in table 'v24' +CREATE VIEW v31 AS SELECT c3, c1 FROM mysqltest1.t3, mysqltest1.t1; +CREATE VIEW v32 AS SELECT c3, c2 FROM mysqltest1.t3, mysqltest1.t2; +ERROR 42000: create view command denied to user 'mysqltest_u1'@'localhost' for column 'c2' in table 'v32' +CREATE VIEW v34 AS SELECT c3, c4 FROM mysqltest1.t3, mysqltest1.t4; +CREATE VIEW v41 AS SELECT c4, c1 FROM mysqltest1.t4, mysqltest1.t1; +CREATE VIEW v42 AS SELECT c4, c2 FROM mysqltest1.t4, mysqltest1.t2; +ERROR 42000: create view command denied to user 'mysqltest_u1'@'localhost' for column 'c2' in table 'v42' +CREATE VIEW v43 AS SELECT c4, c3 FROM mysqltest1.t4, mysqltest1.t3; + +---> connection: default +SELECT * FROM mysqltest1.t1; +c1 +11 +12 +13 +14 +SELECT * FROM mysqltest1.t2; +c2 +21 +22 +23 +24 +25 +26 +SELECT * FROM mysqltest1.t3; +c3 +331 +332 +33 +34 +SELECT * FROM mysqltest1.t4; +c4 +41 +42 +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; +DROP USER mysqltest_u1@localhost; End of 5.0 tests. diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test index 0785b74dd47..815b07badf8 100644 --- a/mysql-test/t/view_grant.test +++ b/mysql-test/t/view_grant.test @@ -350,25 +350,6 @@ drop view mysqltest.v3; connection user1; create view mysqltest.v3 as select b from mysqltest.t2; -# give UPDATE and INSERT privilege (to get more privileges then underlying -# table) -connection root; -grant create view, update, insert on mysqltest.v3 to mysqltest_1@localhost; -drop view mysqltest.v3; -connection user1; --- error 1143 -create view mysqltest.v3 as select b from mysqltest.t2; - - -# If we would get more privileges on VIEW then we have on -# underlying tables => creation prohibited -connection root; -create table mysqltest.v3 (b int); -grant select(b) on mysqltest.v3 to mysqltest_1@localhost; -drop table mysqltest.v3; -connection user1; --- error 1143 -create view mysqltest.v3 as select b from mysqltest.t2; # Expression need select privileges -- error 1143 @@ -1035,4 +1016,96 @@ DROP USER mysqltest_u1@localhost; DROP USER mysqltest_u2@localhost; +# +# BUG#24040: Create View don't succed with "all privileges" on a database. +# + +# Prepare. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +--enable_warnings + +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; + +# Test. + +CREATE TABLE mysqltest1.t1(c1 INT); +CREATE TABLE mysqltest1.t2(c2 INT); +CREATE TABLE mysqltest1.t3(c3 INT); +CREATE TABLE mysqltest1.t4(c4 INT); + +INSERT INTO mysqltest1.t1 VALUES (11), (12), (13), (14); +INSERT INTO mysqltest1.t2 VALUES (21), (22), (23), (24); +INSERT INTO mysqltest1.t3 VALUES (31), (32), (33), (34); +INSERT INTO mysqltest1.t4 VALUES (41), (42), (43), (44); + +GRANT SELECT ON mysqltest1.t1 TO mysqltest_u1@localhost; +GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost; +GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost; +GRANT SELECT, DELETE ON mysqltest1.t4 TO mysqltest_u1@localhost; + +GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u1@localhost; + +--connect (bug24040_con,localhost,mysqltest_u1,,mysqltest2) +--echo +--echo ---> connection: bug24040_con + +SELECT * FROM mysqltest1.t1; +INSERT INTO mysqltest1.t2 VALUES(25); +UPDATE mysqltest1.t3 SET c3 = 331 WHERE c3 = 31; +DELETE FROM mysqltest1.t4 WHERE c4 = 44; + +CREATE VIEW v1 AS SELECT * FROM mysqltest1.t1; +CREATE VIEW v2 AS SELECT * FROM mysqltest1.t2; +CREATE VIEW v3 AS SELECT * FROM mysqltest1.t3; +CREATE VIEW v4 AS SELECT * FROM mysqltest1.t4; + +SELECT * FROM v1; +INSERT INTO v2 VALUES(26); +UPDATE v3 SET c3 = 332 WHERE c3 = 32; +DELETE FROM v4 WHERE c4 = 43; + +--error ER_COLUMNACCESS_DENIED_ERROR +CREATE VIEW v12 AS SELECT c1, c2 FROM mysqltest1.t1, mysqltest1.t2; +CREATE VIEW v13 AS SELECT c1, c3 FROM mysqltest1.t1, mysqltest1.t3; +CREATE VIEW v14 AS SELECT c1, c4 FROM mysqltest1.t1, mysqltest1.t4; + +--error ER_COLUMNACCESS_DENIED_ERROR +CREATE VIEW v21 AS SELECT c2, c1 FROM mysqltest1.t2, mysqltest1.t1; +--error ER_COLUMNACCESS_DENIED_ERROR +CREATE VIEW v23 AS SELECT c2, c3 FROM mysqltest1.t2, mysqltest1.t3; +--error ER_COLUMNACCESS_DENIED_ERROR +CREATE VIEW v24 AS SELECT c2, c4 FROM mysqltest1.t2, mysqltest1.t4; + +CREATE VIEW v31 AS SELECT c3, c1 FROM mysqltest1.t3, mysqltest1.t1; +--error ER_COLUMNACCESS_DENIED_ERROR +CREATE VIEW v32 AS SELECT c3, c2 FROM mysqltest1.t3, mysqltest1.t2; +CREATE VIEW v34 AS SELECT c3, c4 FROM mysqltest1.t3, mysqltest1.t4; + +CREATE VIEW v41 AS SELECT c4, c1 FROM mysqltest1.t4, mysqltest1.t1; +--error ER_COLUMNACCESS_DENIED_ERROR +CREATE VIEW v42 AS SELECT c4, c2 FROM mysqltest1.t4, mysqltest1.t2; +CREATE VIEW v43 AS SELECT c4, c3 FROM mysqltest1.t4, mysqltest1.t3; + +--connection default +--echo +--echo ---> connection: default + +SELECT * FROM mysqltest1.t1; +SELECT * FROM mysqltest1.t2; +SELECT * FROM mysqltest1.t3; +SELECT * FROM mysqltest1.t4; + +# Cleanup. + +-- disconnect bug24040_con + +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; +DROP USER mysqltest_u1@localhost; + + --echo End of 5.0 tests. diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 7143df8474a..cb3570105a7 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -492,35 +492,46 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, /* Compare/check grants on view with grants of underlying tables */ + + fill_effective_table_privileges(thd, &view->grant, view->db, + view->table_name); + + { + Item *report_item= NULL; + uint final_priv= VIEW_ANY_ACL; + for (sl= select_lex; sl; sl= sl->next_select()) { DBUG_ASSERT(view->db); /* Must be set in the parser */ List_iterator_fast it(sl->item_list); Item *item; - fill_effective_table_privileges(thd, &view->grant, view->db, - view->table_name); while ((item= it++)) { - Item_field *fld; + Item_field *fld= item->filed_for_view_update(); uint priv= (get_column_grant(thd, &view->grant, view->db, view->table_name, item->name) & VIEW_ANY_ACL); - if ((fld= item->filed_for_view_update())) + + if (fld && !fld->field->table->s->tmp_table) { - /* - Do we have more privileges on view field then underlying table field? - */ - if (!fld->field->table->s->tmp_table && (~fld->have_privileges & priv)) + final_priv&= fld->have_privileges; + + if (~fld->have_privileges & priv) + report_item= item; + } + } + } + + if (!final_priv) { - /* VIEW column has more privileges */ + DBUG_ASSERT(report_item); + my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), "create view", thd->security_ctx->priv_user, - thd->security_ctx->priv_host, item->name, + thd->security_ctx->priv_host, report_item->name, view->table_name); res= TRUE; goto err; - } - } } } #endif From 60ffd7e346e47d21db4243dc4aa1bc1543843539 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 20:46:24 -0700 Subject: [PATCH 258/789] BUG#27367 mysql.server should be LSB init script compliant support-files/mysql.server.sh: BUG#27367 Add force-reload and status options. Change usage message to reflect Replaced a shell call to cat with shell builtin read --- mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++ support-files/mysql.server.sh | 37 ++++++++++++++++++++++------ 3 files changed, 103 insertions(+), 7 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 65b56443eea..a907f81eb3f 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -359,20 +359,43 @@ case "$mode" in fi ;; - 'reload') + 'reload'|'force-reload') if test -s "$server_pid_file" ; then - mysqld_pid=`cat $server_pid_file` + read mysqld_pid < $server_pid_file kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL" touch $server_pid_file else log_failure_msg "MySQL PID file could not be found!" + exit 1 fi ;; - - *) - # usage - echo "Usage: $0 {start|stop|restart|reload} [ MySQL server options ]" - exit 1 + 'status') + # First, check to see if pid file exists + if [ -s "$server_pid_file" ] ; then + read mysqld_pid < $server_pid_file + if kill -0 $mysqld_pid 2>/dev/null ; then + log_success_msg "MySQL running ($mysqld_pid)" + exit 0 + else + log_failure_msg "MySQL is not running, but PID file exists" + exit 1 + fi + else + # Try to find appropriate mysqld process + mysqld_pid=`pidof $sbindir/mysqld` + if [ -z $mysqld_pid ] ; then + log_failure_msg "MySQL is not running" + exit 3 + else + log_failure_msg "MySQL is running but PID file could not be found" + exit 4 + fi + fi + ;; + *) + # usage + echo "Usage: $0 {start|stop|restart|reload|force-reload|status} [ MySQL server options ]" + exit 1 ;; esac From 774a19554b10c03adcfc6e7202252c6075ef6c62 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 12:16:52 +0800 Subject: [PATCH 259/789] Bug#27127, Incorrect behaviour of timestamp column with DEFAULT CURRENT_TIMESTAMP correct the bitmap_set_bit when a field is timestamp and described with default CURRENT_TIMESTAMP or on update CURRENT_TIMESTAMP, then it will reduce a little time cost when the field doesnot need to write. sql/sql_update.cc: here table->timestamp_field represent only the timestamp field related to CURRENT_TIMESTAMP, when the timestamp_field_type is 0 or 1, it need not to write the field data further. --- sql/sql_update.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 5aea05a9d39..bae1f8e9210 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -201,8 +201,10 @@ int mysql_update(THD *thd, table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; else { - bitmap_set_bit(table->write_set, - table->timestamp_field->field_index); + if (table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_UPDATE || + table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH) + bitmap_set_bit(table->write_set, + table->timestamp_field->field_index); } } From 428e4b07049d28224eaa067488b717c0032aa936 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Mar 2007 21:21:32 -0700 Subject: [PATCH 260/789] BUG#27367 mysql.server should be LSB init script compliant support-files/mysql.server.sh: BUG#27367 Replaced [] with test syntax. Added test for locks on RedHat/SuSE systems --- support-files/mysql.server.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index a907f81eb3f..b587bfdcdd7 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -371,7 +371,7 @@ case "$mode" in ;; 'status') # First, check to see if pid file exists - if [ -s "$server_pid_file" ] ; then + if test -s "$server_pid_file" ; then read mysqld_pid < $server_pid_file if kill -0 $mysqld_pid 2>/dev/null ; then log_success_msg "MySQL running ($mysqld_pid)" @@ -383,7 +383,16 @@ case "$mode" in else # Try to find appropriate mysqld process mysqld_pid=`pidof $sbindir/mysqld` - if [ -z $mysqld_pid ] ; then + if test -z $mysqld_pid ; then + if test "$use_mysqld_safe" = "0" ; then + lockfile=/var/lock/subsys/mysqlmanager + else + lockfile=/var/lock/subsys/mysql + fi + if test -f $lockfile ; then + log_failure_msg "MySQL is not running, but lock exists" + exit 2 + fi log_failure_msg "MySQL is not running" exit 3 else From a4a23fb907ce7b2c3e998735e074da647b3e9ffc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 00:05:36 -0700 Subject: [PATCH 261/789] Fixed bug #27362: crash at evaluation of IN predicate when one of its argument happened to be a decimal expression returning the NULL value. The crash was due to the fact the function in_decimal::set did not take into account that val_decimal() could return 0 if the decimal expression had been evaluated to NULL. mysql-test/r/func_in.result: Added a test case for bug #27362. mysql-test/t/func_in.test: Added a test case for bug #27362. --- mysql-test/r/func_in.result | 5 +++++ mysql-test/t/func_in.test | 11 +++++++++++ sql/item_cmpfunc.cc | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index fad9a7157e1..87855091699 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -470,4 +470,9 @@ a Warnings: Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1 DROP TABLE t1,t2,t3,t4; +CREATE TABLE t1 (id int not null); +INSERT INTO t1 VALUES (1),(2); +SELECT id FROM t1 WHERE id IN(4564, (SELECT IF(1=0,1,1/0)) ); +id +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index f9749662ec1..77592d015eb 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -360,4 +360,15 @@ SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29'); DROP TABLE t1,t2,t3,t4; +# +# BUG#27362: IN with a decimal expression that may return NULL +# + +CREATE TABLE t1 (id int not null); +INSERT INTO t1 VALUES (1),(2); + +SELECT id FROM t1 WHERE id IN(4564, (SELECT IF(1=0,1,1/0)) ); + +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index e032974fdea..44472bf0803 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2423,7 +2423,8 @@ void in_decimal::set(uint pos, Item *item) dec->len= DECIMAL_BUFF_LENGTH; dec->fix_buffer_pointer(); my_decimal *res= item->val_decimal(dec); - if (res != dec) + /* if item->val_decimal() is evaluated to NULL then res == 0 */ + if (!item->null_value && res != dec) my_decimal2decimal(res, dec); } From 8666675fa95229f1e77c0adc24b5b2f03bd0de6e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 08:32:41 +0100 Subject: [PATCH 262/789] BUG#23171: Illegal group log position Tail fixes after re-applying patches to older version of clone. sql/log_event.cc: Name change of shall_skip() -> do_shall_skip() Introducing public shall_skip(). Name change of skip reason enumeration constants. Removing extreneous argument to slave_print_msg() causing compiler warning. sql/log_event.h: Adding enumeration for skip reason. Factoring out exec_event() into exec_relay_log_event(). Making public interface to event execution primitives. Adding documentation. Making some (internal) functions const-correct. sql/rpl_rli.cc: replicate_same_server_id is now a member variable of RLI. sql/rpl_rli.h: replicate_same_server_id is now a member variable of RLI. sql/slave.cc: Using RLI-specific member variable replicate_same_server_id instead of global instance. Moving comments about skipping logic to exec_relay_log_event(). Moving event execution logic to exec_relay_log_event(). sql/sql_binlog.cc: Using apply_event() directly and adding comment with explenation. --- sql/log_event.cc | 119 +++++++++++---------- sql/log_event.h | 266 +++++++++++++++++++++++++++++++++------------- sql/rpl_rli.cc | 3 +- sql/rpl_rli.h | 9 ++ sql/slave.cc | 97 +++++++++++++---- sql/sql_binlog.cc | 12 ++- 6 files changed, 356 insertions(+), 150 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index ec7136b5d58..8fb1457088e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -596,14 +596,20 @@ int Log_event::do_update_pos(RELAY_LOG_INFO *rli) Log_event::enum_skip_reason -Log_event::shall_skip(RELAY_LOG_INFO *rli) +Log_event::do_shall_skip(RELAY_LOG_INFO *rli) { - if (this->server_id == ::server_id && !replicate_same_server_id) - return EVENT_SKIP_SAME_SID; + DBUG_PRINT("info", ("ev->server_id=%lu, ::server_id=%lu," + " rli->replicate_same_server_id=%d," + " rli->slave_skip_counter=%d", + (ulong) server_id, (ulong) ::server_id, + rli->replicate_same_server_id, + rli->slave_skip_counter)); + if (server_id == ::server_id && !rli->replicate_same_server_id) + return EVENT_SKIP_IGNORE; else if (rli->slave_skip_counter > 0) return EVENT_SKIP_COUNT; else - return EVENT_NOT_SKIPPED; + return EVENT_SKIP_NOT; } @@ -2566,9 +2572,9 @@ int Format_description_log_event::do_update_pos(RELAY_LOG_INFO *rli) } Log_event::enum_skip_reason -Format_description_log_event::shall_skip(RELAY_LOG_INFO *rli) +Format_description_log_event::do_shall_skip(RELAY_LOG_INFO *rli) { - return Log_event::EVENT_NOT_SKIPPED; + return Log_event::EVENT_SKIP_NOT; } #endif @@ -3077,7 +3083,7 @@ void Load_log_event::set_fields(const char* affected_db, */ int Load_log_event::do_apply_event(NET* net, RELAY_LOG_INFO const *rli, - bool use_rli_only_for_errors) + bool use_rli_only_for_errors) { LEX_STRING new_db; new_db.length= db_len; @@ -3416,6 +3422,7 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, ident_offset = post_header_len; set_if_smaller(ident_len,FN_REFLEN-1); new_log_ident= my_strndup(buf + ident_offset, (uint) ident_len, MYF(MY_WME)); + DBUG_PRINT("debug", ("new_log_ident: '%s'", new_log_ident)); DBUG_VOID_RETURN; } @@ -3438,11 +3445,13 @@ bool Rotate_log_event::write(IO_CACHE* file) /** Helper function to detect if the event is inside a group. */ +#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) static bool is_in_group(THD *const thd, RELAY_LOG_INFO *const rli) { return (thd->options & OPTION_BEGIN) != 0 || (rli->last_event_start_time > 0); } +#endif /* @@ -3470,7 +3479,8 @@ int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli) char buf[32]; #endif - DBUG_PRINT("info", ("server_id=%lu; ::server_id=%lu", this->server_id, ::server_id)); + DBUG_PRINT("info", ("server_id=%lu; ::server_id=%lu", + (ulong) this->server_id, (ulong) ::server_id)); DBUG_PRINT("info", ("new_log_ident: %s", this->new_log_ident)); DBUG_PRINT("info", ("pos: %s", llstr(this->pos, buf))); @@ -3490,10 +3500,15 @@ int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli) In that case, we don't want to touch the coordinates which correspond to the beginning of the transaction. Starting from 5.0.0, there also are some rotates from the slave itself, in the - relay log. + relay log, which shall not change the group positions. */ - if (!is_in_group(thd, rli)) + if ((server_id != ::server_id || rli->replicate_same_server_id) && + !is_in_group(thd, rli)) { + DBUG_PRINT("info", ("old group_master_log_name: '%s' " + "old group_master_log_pos: %lu", + rli->group_master_log_name, + (ulong) rli->group_master_log_pos)); memcpy(rli->group_master_log_name, new_log_ident, ident_len+1); rli->notify_group_master_log_name_update(); rli->group_master_log_pos= pos; @@ -3524,18 +3539,17 @@ int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli) Log_event::enum_skip_reason -Rotate_log_event::shall_skip(RELAY_LOG_INFO *rli) +Rotate_log_event::do_shall_skip(RELAY_LOG_INFO *rli) { - - enum_skip_reason reason= Log_event::shall_skip(rli); + enum_skip_reason reason= Log_event::do_shall_skip(rli); switch (reason) { - case Log_event::EVENT_NOT_SKIPPED: + case Log_event::EVENT_SKIP_NOT: case Log_event::EVENT_SKIP_COUNT: - return Log_event::EVENT_NOT_SKIPPED; + return Log_event::EVENT_SKIP_NOT; - case Log_event::EVENT_SKIP_SAME_SID: - return Log_event::EVENT_SKIP_SAME_SID; + case Log_event::EVENT_SKIP_IGNORE: + return Log_event::EVENT_SKIP_IGNORE; } DBUG_ASSERT(0); } @@ -3671,21 +3685,20 @@ int Intvar_log_event::do_update_pos(RELAY_LOG_INFO *rli) Log_event::enum_skip_reason -Intvar_log_event::shall_skip(RELAY_LOG_INFO *rli) +Intvar_log_event::do_shall_skip(RELAY_LOG_INFO *rli) { /* - It is a common error to set the slave skip counter to 1 instead - of 2 when recovering from an insert which used a auto increment, - rand, or user var. Therefore, if the slave skip counter is 1, - we just say that this event should be skipped because of the - slave skip count, but we do not change the value of the slave - skip counter since it will be decreased by the following insert - event. + It is a common error to set the slave skip counter to 1 instead of + 2 when recovering from an insert which used a auto increment, + rand, or user var. Therefore, if the slave skip counter is 1, we + just say that this event should be skipped by ignoring it, meaning + that we do not change the value of the slave skip counter since it + will be decreased by the following insert event. */ if (rli->slave_skip_counter == 1) - return Log_event::EVENT_SKIP_COUNT; + return Log_event::EVENT_SKIP_IGNORE; else - return Log_event::shall_skip(rli); + return Log_event::do_shall_skip(rli); } #endif @@ -3764,21 +3777,20 @@ int Rand_log_event::do_update_pos(RELAY_LOG_INFO *rli) Log_event::enum_skip_reason -Rand_log_event::shall_skip(RELAY_LOG_INFO *rli) +Rand_log_event::do_shall_skip(RELAY_LOG_INFO *rli) { /* - It is a common error to set the slave skip counter to 1 instead - of 2 when recovering from an insert which used a auto increment, - rand, or user var. Therefore, if the slave skip counter is 1, - we just say that this event should be skipped because of the - slave skip count, but we do not change the value of the slave - skip counter since it will be decreased by the following insert - event. + It is a common error to set the slave skip counter to 1 instead of + 2 when recovering from an insert which used a auto increment, + rand, or user var. Therefore, if the slave skip counter is 1, we + just say that this event should be skipped by ignoring it, meaning + that we do not change the value of the slave skip counter since it + will be decreased by the following insert event. */ if (rli->slave_skip_counter == 1) - return Log_event::EVENT_SKIP_COUNT; + return Log_event::EVENT_SKIP_IGNORE; else - return Log_event::shall_skip(rli); + return Log_event::do_shall_skip(rli); } #endif /* !MYSQL_CLIENT */ @@ -4204,22 +4216,21 @@ int User_var_log_event::do_update_pos(RELAY_LOG_INFO *rli) } Log_event::enum_skip_reason -User_var_log_event::shall_skip(RELAY_LOG_INFO *rli) - { - /* - It is a common error to set the slave skip counter to 1 instead - of 2 when recovering from an insert which used a auto increment, - rand, or user var. Therefore, if the slave skip counter is 1, - we just say that this event should be skipped because of the - slave skip count, but we do not change the value of the slave - skip counter since it will be decreased by the following insert - event. - */ - if (rli->slave_skip_counter == 1) - return Log_event::EVENT_SKIP_COUNT; - else - return Log_event::shall_skip(rli); - } +User_var_log_event::do_shall_skip(RELAY_LOG_INFO *rli) +{ + /* + It is a common error to set the slave skip counter to 1 instead + of 2 when recovering from an insert which used a auto increment, + rand, or user var. Therefore, if the slave skip counter is 1, we + just say that this event should be skipped by ignoring it, meaning + that we do not change the value of the slave skip counter since it + will be decreased by the following insert event. + */ + if (rli->slave_skip_counter == 1) + return Log_event::EVENT_SKIP_IGNORE; + else + return Log_event::do_shall_skip(rli); +} #endif /* !MYSQL_CLIENT */ @@ -5920,7 +5931,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) default: slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno, "Error in %s event: row application failed", - get_type_str(), error); + get_type_str()); thd->query_error= 1; break; } diff --git a/sql/log_event.h b/sql/log_event.h index 794cf410841..8da02a77b50 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -558,6 +558,33 @@ typedef struct st_print_event_info class Log_event { public: + /** + Enumeration of what kinds of skipping (and non-skipping) that can + occur when the slave executes an event. + + @see shall_skip + @see do_shall_skip + */ + enum enum_skip_reason { + /** + Don't skip event. + */ + EVENT_SKIP_NOT, + + /** + Skip event by ignoring it. + + This means that the slave skip counter will not be changed. + */ + EVENT_SKIP_IGNORE, + + /** + Skip event and decrease skip counter. + */ + EVENT_SKIP_COUNT + }; + + /* The offset in the log where this event originally appeared (it is preserved in relay logs, making SHOW SLAVE STATUS able to print @@ -633,40 +660,6 @@ public: #ifdef HAVE_REPLICATION int net_send(Protocol *protocol, const char* log_name, my_off_t pos); - - /** - Execute the event to change the database and update the binary - log coordinates. - - @param rli Pointer to relay log information - - @retval 0 The event was successfully executed. - @retval errno Error code when the execution failed - */ - - int exec_event(RELAY_LOG_INFO *rli) - { - // !!! Just chaining the calls in this first patch - return apply_event_impl(rli); - } - - - /** - Skip the event by just updating the binary log coordinates. - - @param rli Pointer to relay log information - - @retval 0 The event was successfully executed. - @retval errno Error code when the execution failed - */ - - int skip_event(RELAY_LOG_INFO *rli) - { - // !!! Nothing yet. This is just the reorgainization patch. - return 0; - } - - /* pack_info() is used by SHOW BINLOG EVENTS; as print() it prepares and sends a string to display to the user, so it resembles print(). @@ -747,36 +740,125 @@ public: /* returns the human readable name of the event's type */ const char* get_type_str(); -protected: /* !!! Protected in this patch to allow old usage */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) +public: + + /** + Apply the event to the database. + + This function represents the public interface for applying an + event. + + @see do_apply_event + */ + int apply_event(RELAY_LOG_INFO const *rli) { + return do_apply_event(rli); + } + + + /** + Update the relay log position. + + This function represents the public interface for "stepping over" + the event and will update the relay log information. + + @see do_update_pos + */ + int update_pos(RELAY_LOG_INFO *rli) + { + return do_update_pos(rli); + } + + /** + Decide if the event shall be skipped, and the reason for skipping + it. + + @see do_shall_skip + */ + enum_skip_reason shall_skip(RELAY_LOG_INFO *rli) + { + return do_shall_skip(rli); + } + +protected: /** Primitive to apply an event to the database. This is where the change to the database is made. + @note The primitive is protected instead of private, since there + is a hierarchy of actions to be performed in some cases. + + @see Format_description_log_event::do_apply_event() + @param rli Pointer to relay log info structure @retval 0 Event applied successfully @retval errno Error code if event application failed */ - virtual int apply_event_impl(RELAY_LOG_INFO *rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli) + { + return 0; /* Default implementation does nothing */ + } + /** - Advance binary log coordinates. + Advance relay log coordinates. - This function is called to advance the binary log or relay log - coordinates to just after the event. + This function is called to advance the relay log coordinates to + just after the event. It is essential that both the relay log + coordinate and the group log position is updated correctly, since + this function is used also for skipping events. + + Normally, each implementation of do_update_pos() shall: + + - Update the event position to refer to the position just after + the event. + + - Update the group log position to refer to the position just + after the event if the event is last in a group @param rli Pointer to relay log info structure @retval 0 Coordinates changed successfully - @retval errno Error code if advancing failed + @retval errno Error code if advancing failed (usually just + 1). Observe that handler errors are returned by the + do_apply_event() function, and not by this one. */ - virtual int advance_coord_impl(RELAY_LOG_INFO *rli) - { - // !!! Dummy implementation for this patch only - return 0; - } + virtual int do_update_pos(RELAY_LOG_INFO *rli); + + + /** + Decide if this event shall be skipped or not and the reason for + skipping it. + + The default implementation decide that the event shall be skipped + if either: + + - the server id of the event is the same as the server id of the + server and rli->replicate_same_server_id is true, + or + + - if rli->slave_skip_counter is greater than zero. + + @see do_apply_event + @see do_update_pos + + @retval Log_event::EVENT_SKIP_NOT + The event shall not be skipped and should be applied. + + @retval Log_event::EVENT_SKIP_IGNORE + The event shall be skipped by just ignoring it, i.e., the slave + skip counter shall not be changed. This happends if, for example, + the originating server id of the event is the same as the server + id of the slave. + + @retval Log_event::EVENT_SKIP_COUNT + The event shall be skipped because the slave skip counter was + non-zero. The caller shall decrease the counter by one. + */ + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli); + #endif }; @@ -818,8 +900,8 @@ public: uint16 error_code; ulong thread_id; /* - For events created by Query_log_event::apply_event_impl (and - Load_log_event::apply_event_impl()) we need the *original* thread + For events created by Query_log_event::do_apply_event (and + Load_log_event::do_apply_event()) we need the *original* thread id, to be able to log the event with the original (=master's) thread id (fix for BUG#1686). */ @@ -913,8 +995,10 @@ public: public: /* !!! Public in this patch to allow old usage */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); - int apply_event_impl(RELAY_LOG_INFO* rli, + virtual int do_apply_event(RELAY_LOG_INFO const *rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); + + int do_apply_event(RELAY_LOG_INFO const *rli, const char *query_arg, uint32 q_len_arg); #endif /* HAVE_REPLICATION */ @@ -981,7 +1065,7 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const* rli); #endif }; @@ -1086,13 +1170,13 @@ public: public: /* !!! Public in this patch to allow old usage */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli) + virtual int do_apply_event(RELAY_LOG_INFO const* rli) { - return apply_event_impl(thd->slave_net,rli,0); + return do_apply_event(thd->slave_net,rli,0); } - int apply_event_impl(NET* net, RELAY_LOG_INFO* rli, - bool use_rli_only_for_errors); + int do_apply_event(NET *net, RELAY_LOG_INFO const *rli, + bool use_rli_only_for_errors); #endif }; @@ -1171,9 +1255,20 @@ public: } virtual bool is_artificial_event() { return artificial_event; } -protected: /* !!! Protected in this patch to allow old usage */ +protected: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO*) + { + /* + Events from ourself should be skipped, but they should not + decrease the slave skip counter. + */ + if (this->server_id == ::server_id) + return Log_event::EVENT_SKIP_IGNORE; + else + return Log_event::EVENT_SKIP_NOT; + } #endif }; @@ -1222,9 +1317,11 @@ public: return FORMAT_DESCRIPTION_HEADER_LEN; } -private: +protected: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli); #endif }; @@ -1266,7 +1363,9 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli); #endif }; @@ -1310,7 +1409,9 @@ class Rand_log_event: public Log_event private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli); #endif }; @@ -1351,7 +1452,7 @@ class Xid_log_event: public Log_event private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); #endif }; @@ -1396,7 +1497,9 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli); #endif }; @@ -1425,7 +1528,18 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli) + { + /* + Events from ourself should be skipped, but they should not + decrease the slave skip counter. + */ + if (this->server_id == ::server_id) + return Log_event::EVENT_SKIP_IGNORE; + else + return Log_event::EVENT_SKIP_NOT; + } #endif }; @@ -1474,7 +1588,8 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); + virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli); #endif }; @@ -1546,7 +1661,7 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); #endif }; @@ -1600,7 +1715,7 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); #endif }; @@ -1640,7 +1755,7 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); #endif }; @@ -1679,7 +1794,7 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); #endif }; @@ -1771,7 +1886,7 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); #endif }; @@ -1880,7 +1995,8 @@ public: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); + virtual int do_update_pos(RELAY_LOG_INFO *rli); #endif #ifndef MYSQL_CLIENT @@ -2037,7 +2153,7 @@ protected: private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int apply_event_impl(RELAY_LOG_INFO* rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); /* Primitive to prepare for a sequence of row executions. @@ -2086,7 +2202,7 @@ private: RETURN VALUE Error code, if something went wrong, 0 otherwise. */ - virtual int do_prepare_row(THD*, RELAY_LOG_INFO*, TABLE*, + virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, char const *row_start, char const **row_end) = 0; /* @@ -2157,7 +2273,7 @@ private: virtual int do_before_row_operations(TABLE *table); virtual int do_after_row_operations(TABLE *table, int error); - virtual int do_prepare_row(THD*, RELAY_LOG_INFO*, TABLE*, + virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, char const *row_start, char const **row_end); virtual int do_exec_row(TABLE *table); #endif @@ -2222,7 +2338,7 @@ private: virtual int do_before_row_operations(TABLE *table); virtual int do_after_row_operations(TABLE *table, int error); - virtual int do_prepare_row(THD*, RELAY_LOG_INFO*, TABLE*, + virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, char const *row_start, char const **row_end); virtual int do_exec_row(TABLE *table); #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ @@ -2293,7 +2409,7 @@ private: virtual int do_before_row_operations(TABLE *table); virtual int do_after_row_operations(TABLE *table, int error); - virtual int do_prepare_row(THD*, RELAY_LOG_INFO*, TABLE*, + virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, char const *row_start, char const **row_end); virtual int do_exec_row(TABLE *table); #endif diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 36334351da2..182592ac403 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -29,7 +29,8 @@ int init_strvar_from_file(char *var, int max_size, IO_CACHE *f, st_relay_log_info::st_relay_log_info() - :no_storage(FALSE), info_fd(-1), cur_log_fd(-1), save_temporary_tables(0), + :no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id), + info_fd(-1), cur_log_fd(-1), save_temporary_tables(0), cur_log_old_open_count(0), group_master_log_pos(0), log_space_total(0), ignore_log_space_limit(0), last_master_timestamp(0), slave_skip_counter(0), abort_pos_wait(0), slave_run_id(0), sql_thd(0), last_slave_errno(0), diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index ed9ef3a9115..6365df8cec5 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -57,6 +57,15 @@ typedef struct st_relay_log_info */ bool no_storage; + /* + If true, events with the same server id should be replicated. This + field is set on creation of a relay log info structure by copying + the value of ::replicate_same_server_id and can be overridden if + necessary. For example of when this is done, check sql_binlog.cc, + where the BINLOG statement can be used to execute "raw" events. + */ + bool replicate_same_server_id; + /*** The following variables can only be read when protect by data lock ****/ /* diff --git a/sql/slave.cc b/sql/slave.cc index b58069a82ca..0e705d732ea 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -811,7 +811,7 @@ do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"); { if ((master_row= mysql_fetch_row(master_res)) && (::server_id == strtoul(master_row[1], 0, 10)) && - !replicate_same_server_id) + !mi->rli.replicate_same_server_id) errmsg= "The slave I/O thread stops because master and slave have equal \ MySQL server ids; these ids must be different for replication to work (or \ the --replicate-same-server-id option must be used on slave but this does \ @@ -1721,20 +1721,9 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) if (ev) { int type_code = ev->get_type_code(); - int exec_res; + int exec_res= 0; /* - Queries originating from this server must be skipped. - Low-level events (Format_desc, Rotate, Stop) from this server - must also be skipped. But for those we don't want to modify - group_master_log_pos, because these events did not exist on the master. - Format_desc is not completely skipped. - Skip queries specified by the user in slave_skip_counter. - We can't however skip events that has something to do with the - log files themselves. - Filtering on own server id is extremely important, to ignore execution of - events created by the creation/rotation of the relay log (remember that - now the relay log starts with its Format_desc, has a Rotate etc). */ DBUG_PRINT("info",("type_code=%d (%s), server_id=%d", @@ -1742,8 +1731,27 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) /* - Execute the event, but first we set some data that is needed for + Execute the event to change the database and update the binary + log coordinates, but first we set some data that is needed for the thread. + + The event will be executed unless it is supposed to be skipped. + + Queries originating from this server must be skipped. Low-level + events (Format_description_log_event, Rotate_log_event, + Stop_log_event) from this server must also be skipped. But for + those we don't want to modify 'group_master_log_pos', because + these events did not exist on the master. + Format_description_log_event is not completely skipped. + + Skip queries specified by the user in 'slave_skip_counter'. We + can't however skip events that has something to do with the log + files themselves. + + Filtering on own server id is extremely important, to ignore + execution of events created by the creation/rotation of the relay + log (remember that now the relay log starts with its Format_desc, + has a Rotate etc). */ thd->server_id = ev->server_id; // use the original server id for logging @@ -1753,9 +1761,62 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) ev->when = time(NULL); ev->thd = thd; // because up to this point, ev->thd == 0 - exec_res= ev->exec_event(rli); - DBUG_PRINT("info", ("exec_event result = %d", exec_res)); - DBUG_ASSERT(rli->sql_thd==thd); + int reason= ev->shall_skip(rli); + if (reason == Log_event::EVENT_SKIP_COUNT) + --rli->slave_skip_counter; + pthread_mutex_unlock(&rli->data_lock); + if (reason == Log_event::EVENT_SKIP_NOT) + exec_res= ev->apply_event(rli); +#ifndef DBUG_OFF + else + { + /* + This only prints information to the debug trace. + + TODO: Print an informational message to the error log? + */ + static const char *const explain[] = { + "event was not skipped", // EVENT_SKIP_NOT, + "event originated from this server", // EVENT_SKIP_IGNORE, + "event skip counter was non-zero" // EVENT_SKIP_COUNT + }; + DBUG_PRINT("info", ("%s was skipped because %s", + ev->get_type_str(), explain[reason])); + } +#endif + + DBUG_PRINT("info", ("apply_event error = %d", exec_res)); + if (exec_res == 0) + { + int error= ev->update_pos(rli); + char buf[22]; + DBUG_PRINT("info", ("update_pos error = %d", error)); + DBUG_PRINT("info", ("group %s %s", + llstr(rli->group_relay_log_pos, buf), + rli->group_relay_log_name)); + DBUG_PRINT("info", ("event %s %s", + llstr(rli->event_relay_log_pos, buf), + rli->event_relay_log_name)); + /* + The update should not fail, so print an error message and + return an error code. + + TODO: Replace this with a decent error message when merged + with BUG#24954 (which adds several new error message). + */ + if (error) + { + slave_print_msg(ERROR_LEVEL, rli, ER_UNKNOWN_ERROR, + "It was not possible to update the positions" + " of the relay log information: the slave may" + " be in an inconsistent state." + " Stopped in %s position %s", + rli->group_relay_log_name, + llstr(rli->group_relay_log_pos, buf)); + DBUG_RETURN(1); + } + } + /* Format_description_log_event should not be deleted because it will be used to read info about the relay log's format; it will be deleted when @@ -2902,7 +2963,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) pthread_mutex_lock(log_lock); if ((uint4korr(buf + SERVER_ID_OFFSET) == ::server_id) && - !replicate_same_server_id) + !mi->rli.replicate_same_server_id) { /* Do not write it to the relay log. diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index 23ca5330053..27418c9f9fc 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -150,9 +150,17 @@ void mysql_client_binlog_statement(THD* thd) DBUG_PRINT("info", ("bytes_decoded=%d; bufptr=0x%lx; buf[EVENT_LEN_OFFSET]=%u", bytes_decoded, bufptr, uint4korr(bufptr+EVENT_LEN_OFFSET))); ev->thd= thd; - if (int err= ev->exec_event(thd->rli_fake)) + /* + We go directly to the application phase, since we don't need + to check if the event shall be skipped or not. + + Neither do we have to update the log positions, since that is + not used at all: the rli_fake instance is used only for error + reporting. + */ + if (int err= ev->apply_event(thd->rli_fake)) { - DBUG_PRINT("info", ("exec_event() - error=%d", error)); + DBUG_PRINT("info", ("apply_event() - error=%d", error)); /* TODO: Maybe a better error message since the BINLOG statement now contains several events. From 2b9fdea8c6eff96b938dfd0a47331a02ca186760 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 00:43:14 -0700 Subject: [PATCH 263/789] Fixes for 5.1-arch repository to compile on Windows. CMakeLists.txt: Moved zlib to be processed before extra as CMake doesn't handle forward references well. client/CMakeLists.txt: Ensure that -DTHREADS is specified for mysqlslap.c client/mysqlslap.c: Removed includes which are already included in client_priv.h Moved variable declarations to be at start of function before any code is emitted as VSC is strict. --- CMakeLists.txt | 2 +- client/CMakeLists.txt | 1 + client/mysqlslap.c | 8 ++------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb4d77db73f..48992cf574b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,10 +131,10 @@ ADD_SUBDIRECTORY(dbug) ADD_SUBDIRECTORY(strings) ADD_SUBDIRECTORY(regex) ADD_SUBDIRECTORY(mysys) +ADD_SUBDIRECTORY(zlib) ADD_SUBDIRECTORY(extra/yassl) ADD_SUBDIRECTORY(extra/yassl/taocrypt) ADD_SUBDIRECTORY(extra) -ADD_SUBDIRECTORY(zlib) ADD_SUBDIRECTORY(storage/heap) ADD_SUBDIRECTORY(storage/myisam) ADD_SUBDIRECTORY(storage/myisammrg) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index d492c49a6b2..ea9e7547354 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -95,6 +95,7 @@ ADD_EXECUTABLE(mysqladmin mysqladmin.cc) TARGET_LINK_LIBRARIES(mysqladmin mysqlclient mysys dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqlslap mysqlslap.c) +SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS") TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys yassl taocrypt zlib wsock32 dbug) ADD_EXECUTABLE(echo echo.c) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 6fb810b6a23..809c1a6b5da 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -82,10 +82,6 @@ TODO: #define SELECT_TYPE_REQUIRES_PREFIX 5 #include "client_priv.h" -#include -#include -#include -#include #include #include #include @@ -1554,13 +1550,13 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) uint x; struct timeval start_time, end_time; thread_context con; + pthread_t mainthread; /* Thread descriptor */ + pthread_attr_t attr; /* Thread attributes */ DBUG_ENTER("run_scheduler"); con.stmt= stmts; con.limit= limit; - pthread_t mainthread; /* Thread descriptor */ - pthread_attr_t attr; /* Thread attributes */ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); From 744de3ccabbae1a4c2d94cacb7a50c00c9de8b44 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 15:54:41 +0800 Subject: [PATCH 264/789] Bug#25446, START BACKUP NOWAIT Reports error and then continues storage/ndb/src/mgmclient/CommandInterpreter.cpp: add a goto to avoid a repeated ndb_mgm_start_backup() call --- storage/ndb/src/mgmclient/CommandInterpreter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/ndb/src/mgmclient/CommandInterpreter.cpp b/storage/ndb/src/mgmclient/CommandInterpreter.cpp index fdcea63640c..c3dd5c340ce 100644 --- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp @@ -2489,6 +2489,7 @@ CommandInterpreter::executeStartBackup(char* parameters, bool interactive) { flags = 0; result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply); + goto END_BACKUP; } else if (sz == 1 || (sz == 3 && args[1] == "WAIT" && args[2] == "COMPLETED")) { @@ -2522,6 +2523,7 @@ CommandInterpreter::executeStartBackup(char* parameters, bool interactive) } result = ndb_mgm_start_backup(m_mgmsrv, flags, &backupId, &reply); +END_BACKUP: if (result != 0) { ndbout << "Backup failed" << endl; printError(); From 9f9e2f2df02ba7cbeb075ea345f979eb244f97a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 12:19:41 +0400 Subject: [PATCH 265/789] merging --- sql/sql_base.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d4316f11491..a3c03fdaf12 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5771,11 +5771,13 @@ bool setup_tables_and_check_access(THD *thd, TABLE_LIST *leaves_tmp= NULL; bool first_table= true; + thd->leaf_count= 0; if (setup_tables(thd, context, from_clause, tables, &leaves_tmp, select_insert)) return TRUE; - *leaves= leaves_tmp; + if (leaves) + *leaves= leaves_tmp; for (; leaves_tmp; leaves_tmp= leaves_tmp->next_leaf) { @@ -5787,6 +5789,7 @@ bool setup_tables_and_check_access(THD *thd, return TRUE; } first_table= 0; + thd->leaf_count++; } return FALSE; } From 50b5064ccd0af957080d9c9efd022e33c7c9c060 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 12:24:56 +0400 Subject: [PATCH 266/789] bug #16546 (DATETIME + 0 not always coerced in the same way) fix for cast( AS DATETIME) + 0 operation. I just implemented Item_datetime_typecast::val() method as it is usually done in other classes. Should be fixed more radically in 5.0 mysql-test/r/type_datetime.result: result added mysql-test/t/type_datetime.test: testcase sql/item_timefunc.h: added double conversion to Item_datetime_typecast --- mysql-test/r/type_datetime.result | 3 +++ mysql-test/t/type_datetime.test | 6 ++++++ sql/item_timefunc.h | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index f313a6b934b..64337bd2c2f 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -166,3 +166,6 @@ dt 0000-00-00 00:00:00 0000-00-00 00:00:00 drop table t1; +select cast('2006-12-05 22:10:10' as datetime) + 0; +cast('2006-12-05 22:10:10' as datetime) + 0 +20061205221010.000000 diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 4b6741b4242..87b86b55fc9 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -113,4 +113,10 @@ insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); select * from t1; drop table t1; +# +# Bug #16546 DATETIME+0 not always coerced the same way +# +select cast('2006-12-05 22:10:10' as datetime) + 0; + + # End of 4.1 tests diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 45cad627c05..2383b4f86ac 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -751,12 +751,19 @@ public: String *val_str(String *str); const char *cast_type() const { return "datetime"; } enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } + void fix_length_and_dec() + { + Item_typecast_maybe_null::fix_length_and_dec(); + decimals= DATETIME_DEC; + } + Field *tmp_table_field(TABLE *t_arg) { return (new Field_datetime(maybe_null, name, t_arg, &my_charset_bin)); } bool result_as_longlong() { return TRUE; } longlong val_int(); + double val() { return (double) val_int(); } }; class Item_func_makedate :public Item_str_func From 2b983572a7763914abeb61b8084e2f54d0de915d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 12:44:38 +0400 Subject: [PATCH 267/789] bug #16546 (DATETIME+0 not always coerced the same way) fix for cast( AS DATETIME)+0 in 5.0 and above versions. val_real now works using val_decimal for DATETIME Items Superfluous val_real() methods deleted sql/item_timefunc.h: val_real() for datetime functions implemented as { return val_real_from_decimal(); } It's not a fastest possible way, but code is simple and less error-prone, what i belive is more important here as this part works unfrequently. --- sql/item_timefunc.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index acc5e6a80cc..14ceb8dcb28 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -330,7 +330,7 @@ public: enum_field_types field_type() const { return MYSQL_TYPE_DATE; } String *val_str(String *str); longlong val_int(); - double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); } + double val_real() { return val_real_from_decimal(); } const char *func_name() const { return "date"; } void fix_length_and_dec() { @@ -368,6 +368,7 @@ public: return (new Field_datetime(maybe_null, name, t_arg, &my_charset_bin)); } bool result_as_longlong() { return TRUE; } + double val_real() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); @@ -390,13 +391,14 @@ public: enum_field_types field_type() const { return MYSQL_TYPE_TIME; } void fix_length_and_dec() { - decimals=0; + decimals= DATETIME_DEC; max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; } Field *tmp_table_field(TABLE *t_arg) { return (new Field_time(maybe_null, name, t_arg, &my_charset_bin)); } + double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); @@ -504,7 +506,6 @@ public: Item_func_now() :Item_date_func() {} Item_func_now(Item *a) :Item_date_func(a) {} enum Item_result result_type () const { return STRING_RESULT; } - double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; } longlong val_int() { DBUG_ASSERT(fixed == 1); return value; } int save_in_field(Field *to, bool no_conversions); String *val_str(String *str); @@ -592,11 +593,6 @@ class Item_func_from_unixtime :public Item_date_func THD *thd; public: Item_func_from_unixtime(Item *a) :Item_date_func(a) {} - double val_real() - { - DBUG_ASSERT(fixed == 1); - return (double) Item_func_from_unixtime::val_int(); - } longlong val_int(); String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } @@ -635,7 +631,6 @@ class Item_func_convert_tz :public Item_date_func Item_func_convert_tz(Item *a, Item *b, Item *c): Item_date_func(a, b, c), from_tz_cached(0), to_tz_cached(0) {} longlong val_int(); - double val_real() { return (double) val_int(); } String *val_str(String *str); const char *func_name() const { return "convert_tz"; } bool fix_fields(THD *, Item **); @@ -661,7 +656,6 @@ public: Item_str_timefunc::fix_length_and_dec(); collation.set(&my_charset_bin); maybe_null=1; - decimals= DATETIME_DEC; } const char *func_name() const { return "sec_to_time"; } bool result_as_longlong() { return TRUE; } @@ -699,7 +693,6 @@ public: const char *func_name() const { return "date_add_interval"; } void fix_length_and_dec(); enum_field_types field_type() const { return cached_field_type; } - double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); } longlong val_int(); bool get_date(TIME *res, uint fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; @@ -800,6 +793,7 @@ public: } bool result_as_longlong() { return TRUE; } longlong val_int(); + double val_real() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); @@ -827,6 +821,7 @@ public: } bool result_as_longlong() { return TRUE; } longlong val_int(); + double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); @@ -859,6 +854,7 @@ public: } bool result_as_longlong() { return TRUE; } longlong val_int(); + double val_real() { return val_real_from_decimal(); } double val() { return (double) val_int(); } my_decimal *val_decimal(my_decimal *decimal_value) { @@ -928,6 +924,7 @@ public: } void print(String *str); const char *func_name() const { return "add_time"; } + double val_real() { return val_real_from_decimal(); } my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); From c8e15cf23bb031096682ff4ebc413a2ff6a3abf3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 01:59:47 -0700 Subject: [PATCH 268/789] fixes for 5.1-arch repository client/Makefile.am: fix flags to ensure that mysqlslap still compiles on Unix --- client/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/client/Makefile.am b/client/Makefile.am index 1c908ea715e..4b78ee2b0c9 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -76,6 +76,7 @@ mysqlimport_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ mysqlshow_SOURCES= mysqlshow.c mysqlslap_SOURCES= mysqlslap.c +mysqlslap_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ @CLIENT_EXTRA_LDFLAGS@ \ $(LIBMYSQLCLIENT_LA) \ From aa3233619874c3bfee4d43957148ef2c7904aa6c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 10:56:47 +0100 Subject: [PATCH 269/789] Bug #24791: Union with AVG-groups generates wrong results The problem in this bug is when we create temporary tables. When temporary tables are created for unions, there is some inferrence being carried out regarding the type of the column. Whenever this column type is inferred to be REAL (i.e. FLOAT or DOUBLE), MySQL will always try to maintain exact precision, and if that is not possible (there are hardware limits, since FLOAT and DOUBLE are stored as approximate values) will switch to using approximate values. The problem here is that at this point the information about number of significant digits is not available. Furthermore, the number of significant digits should be increased for the AVG function, however, this was not properly handled. There are 4 parts to the problem: #1: DOUBLE and FLOAT fields don't display their proper display lengths in max_display_length(). This is hard-coded as 53 for DOUBLE and 24 for FLOAT. Now changed to instead return the field_length. #2: Type holders for temporary tables do not preserve the max_length of the Item's from which they are created, and is instead reverted to the 53 and 24 from above. This causes *all* fields to get non-fixed significant digits. #3: AVG function does not update max_length (display length) when updating number of decimals. #4: The function that switches to non-fixed number of significant digits should use DBL_DIG + 2 or FLT_DIG + 2 as cut-off values (Since fixed precision does not use the 'e' notation) Of these points, #1 is the controversial one, but this change is preferred and has been cleared with Monty. The function causes quite a few unit tests to blow up and they had to b changed, but each one is annotated and motivated. We frequently see the magical 53 and 24 give way to more relevant numbers. mysql-test/r/create.result: bug#24791 changed test result With the changes made for FLOAT and DOUBLE, the original display lengths are now preserved. mysql-test/r/temp_table.result: bug#24791 changed test resullt Test case added mysql-test/r/type_float.result: bug#24791 changed test result delta 1: field was originally declared as DOUBLE with no display length, so the hardware maximum is chosen rather than 53. delta 2: fields exceed the maximum precision and thus switch to non-fixed significant digits delta 3: Same as above, number of decmals and significant digits was not specified when t3 was created. mysql-test/t/temp_table.test: bug#24791 Test case sql/field.h: bug#24791 The method max_display_length is reimplemented as uint32 max_display_length() { return field_length; } in Field_double and Field_float. Since all subclasses of Field_real now have the same implementation of this method, the implementation has been moved up the hierarchy to Field_real. sql/item.cc: bug#24791 We switch to a non-fixed number of significant digits (by setting decimals=NOT_FIXED_DECIMAL) if the calculated display length is greater than the display length of a value with the maximum precision. These values differ for double and float, obviously. sql/item_sum.cc: bug#24791 We must increase the display length accordinly whenever we change number of decimal places. --- mysql-test/r/create.result | 4 ++-- mysql-test/r/temp_table.result | 21 +++++++++++++++++++++ mysql-test/r/type_float.result | 8 ++++---- mysql-test/t/temp_table.test | 16 ++++++++++++++++ sql/field.h | 4 +--- sql/item.cc | 18 +++++++++++------- sql/item_sum.cc | 4 +++- 7 files changed, 58 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 11c1431de7b..0a8fef8d881 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -447,8 +447,8 @@ t2 CREATE TABLE `t2` ( `ifnull(c,c)` mediumint(8) default NULL, `ifnull(d,d)` int(11) default NULL, `ifnull(e,e)` bigint(20) default NULL, - `ifnull(f,f)` float(24,2) default NULL, - `ifnull(g,g)` double(53,3) default NULL, + `ifnull(f,f)` float(3,2) default NULL, + `ifnull(g,g)` double(4,3) default NULL, `ifnull(h,h)` decimal(5,4) default NULL, `ifnull(i,i)` year(4) default NULL, `ifnull(j,j)` date default NULL, diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 139a7da77de..d6adf51602b 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -152,3 +152,24 @@ SELECT * FROM t1; i DROP TABLE t1; End of 4.1 tests. +CREATE TABLE t1 ( c FLOAT( 20, 14 ) ); +INSERT INTO t1 VALUES( 12139 ); +CREATE TABLE t2 ( c FLOAT(30,18) ); +INSERT INTO t2 VALUES( 123456 ); +SELECT AVG( c ) FROM t1 UNION SELECT 1; +AVG( c ) +12139 +1 +SELECT 1 UNION SELECT AVG( c ) FROM t1; +1 +1 +12139 +SELECT 1 UNION SELECT * FROM t2 UNION SELECT 1; +1 +1 +123456 +SELECT c/1 FROM t1 UNION SELECT 1; +c/1 +12139 +1 +DROP TABLE t1, t2; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 0cb77f42caf..188963c5bdf 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -92,7 +92,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `col1` double default NULL, - `col2` double(53,5) default NULL, + `col2` double(22,5) default NULL, `col3` double default NULL, `col4` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -232,12 +232,12 @@ insert into t2 values ("1.23456780"); create table t3 select * from t2 union select * from t1; select * from t3; d -1.234567800 -100000000.000000000 +1.2345678 +100000000 show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `d` double(22,9) default NULL + `d` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; create table t1 select 105213674794682365.00 + 0.0 x; diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 8cb9e34ca08..90f868f5932 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -163,3 +163,19 @@ DROP TABLE t1; --echo End of 4.1 tests. + +# +# Bug #24791: Union with AVG-groups generates wrong results +# +CREATE TABLE t1 ( c FLOAT( 20, 14 ) ); +INSERT INTO t1 VALUES( 12139 ); + +CREATE TABLE t2 ( c FLOAT(30,18) ); +INSERT INTO t2 VALUES( 123456 ); + +SELECT AVG( c ) FROM t1 UNION SELECT 1; +SELECT 1 UNION SELECT AVG( c ) FROM t1; +SELECT 1 UNION SELECT * FROM t2 UNION SELECT 1; +SELECT c/1 FROM t1 UNION SELECT 1; + +DROP TABLE t1, t2; diff --git a/sql/field.h b/sql/field.h index 524380800f3..a00419893e1 100644 --- a/sql/field.h +++ b/sql/field.h @@ -432,6 +432,7 @@ public: int store_decimal(const my_decimal *); my_decimal *val_decimal(my_decimal *); + uint32 max_display_length() { return field_length; } }; @@ -461,7 +462,6 @@ public: void overflow(bool negative); bool zero_pack() const { return 0; } void sql_type(String &str) const; - uint32 max_display_length() { return field_length; } }; @@ -719,7 +719,6 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return sizeof(float); } void sql_type(String &str) const; - uint32 max_display_length() { return 24; } }; @@ -762,7 +761,6 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return sizeof(double); } void sql_type(String &str) const; - uint32 max_display_length() { return 53; } uint size_of() const { return sizeof(*this); } }; diff --git a/sql/item.cc b/sql/item.cc index 11a5039ca19..958de308cc4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -6348,8 +6348,6 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item) :Item(thd, item), enum_set_typelib(0), fld_type(get_real_type(item)) { DBUG_ASSERT(item->fixed); - - max_length= display_length(item); maybe_null= item->maybe_null; collation.set(item->collation); get_full_info(item); @@ -6521,11 +6519,17 @@ bool Item_type_holder::join_types(THD *thd, Item *item) { int delta1= max_length_orig - decimals_orig; int delta2= item->max_length - item->decimals; - if (fld_type == MYSQL_TYPE_DECIMAL) - max_length= max(delta1, delta2) + decimals; - else - max_length= min(max(delta1, delta2) + decimals, - (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7); + max_length= max(delta1, delta2) + decimals; + if (fld_type == MYSQL_TYPE_FLOAT && max_length > FLT_DIG + 2) + { + max_length= FLT_DIG + 6; + decimals= NOT_FIXED_DEC; + } + if (fld_type == MYSQL_TYPE_DOUBLE && max_length > DBL_DIG + 2) + { + max_length= DBL_DIG + 7; + decimals= NOT_FIXED_DEC; + } } else max_length= (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 41f0dd6496b..acc2d22c57c 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1096,8 +1096,10 @@ void Item_sum_avg::fix_length_and_dec() f_scale= args[0]->decimals; dec_bin_size= my_decimal_get_binary_size(f_precision, f_scale); } - else + else { decimals= min(args[0]->decimals + prec_increment, NOT_FIXED_DEC); + max_length= args[0]->max_length + prec_increment; + } } From 4dee1e6a975b3befe070f2631984b6ac813fea00 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 11:12:18 +0100 Subject: [PATCH 270/789] ndb - fix test prg ndb/test/ndbapi/testNodeRestart.cpp: fix test prg --- ndb/test/ndbapi/testNodeRestart.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index dfb48ea3657..c0bc8b7747c 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -1161,7 +1161,7 @@ runBug27003(NDBT_Context* ctx, NDBT_Step* step) return NDBT_FAILED; res.startNodes(&node, 1); - res.waitNodesStartPhase(&node, 1, 2); + NdbSleep_SecSleep(3); pos++; } pos = 0; From c2bb8446bca648d391072825413a8dd44045beb2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 11:17:57 +0100 Subject: [PATCH 271/789] ndb - fix test prg --- storage/ndb/test/ndbapi/testNodeRestart.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp index ad9069142ab..3f77945047c 100644 --- a/storage/ndb/test/ndbapi/testNodeRestart.cpp +++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp @@ -1364,7 +1364,7 @@ runBug27003(NDBT_Context* ctx, NDBT_Step* step) return NDBT_FAILED; res.startNodes(&node, 1); - res.waitNodesStartPhase(&node, 1, 2); + NdbSleep_SecSleep(3); pos++; } pos = 0; From ec2639f4ec5a5c003f867d5909c63e0dc26486f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 11:20:38 +0100 Subject: [PATCH 272/789] ndb - fix testprg storage/ndb/test/ndbapi/testNodeRestart.cpp: fix testprg --- storage/ndb/test/ndbapi/testNodeRestart.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp index 6e5c12d4d8c..e88a0d65ac0 100644 --- a/storage/ndb/test/ndbapi/testNodeRestart.cpp +++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp @@ -1231,8 +1231,7 @@ int runBug25984(NDBT_Context* ctx, NDBT_Step* step){ if (restarter.startNodes(&victim, 1)) return NDBT_FAILED; - if (restarter.waitNodesStartPhase(&victim, 1, 2)) - return NDBT_FAILED; + NdbSleep_SecSleep(3); } if (restarter.waitNodesNoStart(&victim, 1)) From 9f10e20f3f84ec24edcb3320846cc940a0e34ba0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:32:54 +1100 Subject: [PATCH 273/789] [PATCH] WL#3704 mgmapi timeouts: use NdbMgmHandle write_timeout Start using the write_timeout we already have in NdbMgmHandle Index: ndb-work/storage/ndb/src/mgmapi/mgmapi.cpp =================================================================== storage/ndb/src/mgmapi/mgmapi.cpp: WL#3704 mgmapi timeouts: use NdbMgmHandle write_timeout --- storage/ndb/src/mgmapi/mgmapi.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index f13e5880e22..6bb01cb244b 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -323,7 +323,7 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow *command_reply, DBUG_ENTER("ndb_mgm_call"); DBUG_PRINT("enter",("handle->socket: %d, cmd: %s", handle->socket, cmd)); - SocketOutputStream out(handle->socket); + SocketOutputStream out(handle->socket, handle->write_timeout); SocketInputStream in(handle->socket, handle->read_timeout); out.println(cmd); @@ -771,7 +771,7 @@ ndb_mgm_get_status(NdbMgmHandle handle) CHECK_HANDLE(handle, NULL); CHECK_CONNECTED(handle, NULL); - SocketOutputStream out(handle->socket); + SocketOutputStream out(handle->socket, handle->write_timeout); SocketInputStream in(handle->socket, handle->read_timeout); out.println("get status"); @@ -2405,7 +2405,7 @@ int ndb_mgm_check_connection(NdbMgmHandle handle){ CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); - SocketOutputStream out(handle->socket); + SocketOutputStream out(handle->socket, handle->write_timeout); SocketInputStream in(handle->socket, handle->read_timeout); char buf[32]; if (out.println("check connection")) @@ -2535,7 +2535,7 @@ ndb_mgm_convert_to_transporter(NdbMgmHandle *handle) (*handle)->connected= 0; // we pretend we're disconnected s= (*handle)->socket; - SocketOutputStream s_output(s); + SocketOutputStream s_output(s, (*handle)->write_timeout); s_output.println("transporter connect"); s_output.println(""); @@ -2611,7 +2611,7 @@ int ndb_mgm_end_session(NdbMgmHandle handle) CHECK_CONNECTED(handle, 0); DBUG_ENTER("ndb_mgm_end_session"); - SocketOutputStream s_output(handle->socket); + SocketOutputStream s_output(handle->socket, handle->write_timeout); s_output.println("end session"); s_output.println(""); From b3dd80dd59882305b8a35421e5f35cc2407aacbe Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:33:07 +1100 Subject: [PATCH 274/789] [PATCH] WL#3704 mgmapi timeouts: Add ndb_mgmd error injection Add error injection either for this connection or for whole server. Currently nothing for injecting errors into *another* connection... but that's perhaps getting tricky-dicky for this point in time. Perhaps needed for events if we don't do anything fancy. Index: ndb-work/storage/ndb/src/mgmsrv/MgmtSrvr.cpp =================================================================== storage/ndb/src/mgmsrv/MgmtSrvr.cpp: WL#3704 mgmapi timeouts: Add ndb_mgmd error injection storage/ndb/src/mgmsrv/MgmtSrvr.hpp: WL#3704 mgmapi timeouts: Add ndb_mgmd error injection storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: Add ndb_mgmd error injection storage/ndb/src/mgmsrv/Services.hpp: WL#3704 mgmapi timeouts: Add ndb_mgmd error injection storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: Add ndb_mgmd error injection --- storage/ndb/src/mgmsrv/MgmtSrvr.cpp | 29 ++++++++++++++-- storage/ndb/src/mgmsrv/MgmtSrvr.hpp | 4 +++ storage/ndb/src/mgmsrv/Services.cpp | 20 ++++++++++- storage/ndb/src/mgmsrv/Services.hpp | 2 ++ storage/ndb/test/ndbapi/testMgm.cpp | 52 +++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 4 deletions(-) diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp index 53bd93395bb..e836ef8d32a 100644 --- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -66,6 +66,9 @@ #define DEBUG(x) #endif +int g_errorInsert; +#define ERROR_INSERTED(x) (g_errorInsert == x) + #define INIT_SIGNAL_SENDER(ss,nodeId) \ SignalSender ss(theFacade); \ ss.lock(); /* lock will be released on exit */ \ @@ -177,6 +180,7 @@ MgmtSrvr::logLevelThreadRun() m_log_level_requests.lock(); } m_log_level_requests.unlock(); + NdbSleep_MilliSleep(_logLevelThreadSleep); } } @@ -1730,14 +1734,29 @@ MgmtSrvr::setNodeLogLevelImpl(int nodeId, const SetLogLevelOrd & ll) int MgmtSrvr::insertError(int nodeId, int errorNo) { + int block; + if (errorNo < 0) { return INVALID_ERROR_NUMBER; } - INIT_SIGNAL_SENDER(ss,nodeId); - + SignalSender ss(theFacade); + ss.lock(); /* lock will be released on exit */ + + if(getNodeType(nodeId) == NDB_MGM_NODE_TYPE_NDB) + { + block= CMVMI; + if(!theFacade->theClusterMgr->getNodeInfo(nodeId).connected + || !theFacade->get_node_alive(nodeId)) + return NO_CONTACT_WITH_PROCESS; + } + else if(getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM) + block= _blockNumber; + else + return WRONG_PROCESS_TYPE; + SimpleSignal ssig; - ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_TAMPER_ORD, + ssig.set(ss,TestOrd::TraceAPI, block, GSN_TAMPER_ORD, TamperOrd::SignalLength); TamperOrd* const tamperOrd = CAST_PTR(TamperOrd, ssig.getDataPtrSend()); tamperOrd->errorNo = errorNo; @@ -1972,6 +1991,10 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal) case GSN_NODE_FAILREP: break; + case GSN_TAMPER_ORD: + ndbout << "TAMPER ORD" << endl; + break; + default: g_eventLogger.error("Unknown signal received. SignalNumber: " "%i from (%d, %x)", diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.hpp b/storage/ndb/src/mgmsrv/MgmtSrvr.hpp index 19804f735b4..a54b7866091 100644 --- a/storage/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -38,6 +38,10 @@ */ #define MGMSRV 1 +#define MGM_ERROR_MAX_INJECT_SESSION_ONLY 10000 + +extern int g_errorInsert; + class ConfigInfoServer; class NdbApiSignal; class Config; diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index dc865c594c0..e55c4ec6349 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -288,6 +288,8 @@ struct PurgeStruct NDB_TICKS tick; }; +#define ERROR_INSERTED(x) (g_errorInsert == x || m_errorInsert == x) + MgmApiSession::MgmApiSession(class MgmtSrvr & mgm, NDB_SOCKET_TYPE sock, Uint64 session_id) : SocketServer::Session(sock), m_mgmsrv(mgm) { @@ -300,6 +302,7 @@ MgmApiSession::MgmApiSession(class MgmtSrvr & mgm, NDB_SOCKET_TYPE sock, Uint64 m_ctx= NULL; m_session_id= session_id; m_mutex= NdbMutex_Create(); + m_errorInsert= 0; DBUG_VOID_RETURN; } @@ -613,11 +616,22 @@ void MgmApiSession::insertError(Parser::Context &, Properties const &args) { Uint32 node = 0, error = 0; + int result= 0; args.get("node", &node); args.get("error", &error); - int result = m_mgmsrv.insertError(node, error); + if(node==m_mgmsrv.getOwnNodeId() + && error < MGM_ERROR_MAX_INJECT_SESSION_ONLY) + { + m_errorInsert= error; + if(error==0) + g_errorInsert= error; + } + else + { + result= m_mgmsrv.insertError(node, error); + } m_output->println("insert error reply"); if(result != 0) @@ -1602,6 +1616,10 @@ void MgmApiSession::check_connection(Parser_t::Context &ctx, const class Properties &args) { + if(ERROR_INSERTED(1)) + { + NdbSleep_SecSleep(10); + } m_output->println("check connection reply"); m_output->println("result: Ok"); m_output->println(""); diff --git a/storage/ndb/src/mgmsrv/Services.hpp b/storage/ndb/src/mgmsrv/Services.hpp index c112c66da36..76f839e3aab 100644 --- a/storage/ndb/src/mgmsrv/Services.hpp +++ b/storage/ndb/src/mgmsrv/Services.hpp @@ -46,6 +46,8 @@ private: Parser_t::Context *m_ctx; Uint64 m_session_id; + int m_errorInsert; + const char *get_error_text(int err_no) { return m_mgmsrv.getErrorText(err_no, m_err_str, sizeof(m_err_str)); } diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp index c4301165497..0c6c05a0594 100644 --- a/storage/ndb/test/ndbapi/testMgm.cpp +++ b/storage/ndb/test/ndbapi/testMgm.cpp @@ -207,6 +207,53 @@ int runTestApiSession(NDBT_Context* ctx, NDBT_Step* step) } } +int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) +{ + char *mgm= ctx->getRemoteMgm(); + int result= NDBT_FAILED; + int cc= 0; + + NdbMgmHandle h; + h= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(h, mgm); + ndb_mgm_connect(h,0,0,0); + + ndbout << "Connected" << endl; + + if(ndb_mgm_check_connection(h) < 0) + { + result= NDBT_FAILED; + goto done; + } + + ndbout << "Checked Connection" << endl; + + ndb_mgm_reply reply; + reply.return_code= 0; + + if(ndb_mgm_insert_error(h, 3, 1, &reply)< 0) + { + ndbout << "failed to insert error " << endl; + result= NDBT_FAILED; + goto done; + } + + ndbout << "Inserted session error" << endl; + + cc= ndb_mgm_check_connection(h); + if(cc < 0) + result= NDBT_OK; + else + result= NDBT_FAILED; + + ndbout << "Tried check connection with result: " << cc << endl; +done: + ndb_mgm_disconnect(h); + ndb_mgm_destroy_handle(&h); + + return result; +} + NDBT_TESTSUITE(testMgm); TESTCASE("SingleUserMode", @@ -218,6 +265,11 @@ TESTCASE("ApiSessionFailure", "Test failures in MGMAPI session"){ INITIALIZER(runTestApiSession); +} +TESTCASE("ApiTimeout1", + "Test timeout for MGMAPI"){ + INITIALIZER(runTestApiTimeout1); + } NDBT_TESTSUITE_END(testMgm); From ef41a27c9b35466dc78c89bcb756127f7e8c0c2d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:33:19 +1100 Subject: [PATCH 275/789] [PATCH] WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms) Add not so neat set_timeout call to make testMgm work Index: ndb-work/storage/ndb/include/mgmapi/mgmapi.h =================================================================== storage/ndb/include/mgmapi/mgmapi.h: WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms) storage/ndb/src/mgmapi/mgmapi.cpp: WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms) storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms) --- storage/ndb/include/mgmapi/mgmapi.h | 11 +++++++++++ storage/ndb/src/mgmapi/mgmapi.cpp | 10 ++++++++++ storage/ndb/test/ndbapi/testMgm.cpp | 2 ++ 3 files changed, 23 insertions(+) diff --git a/storage/ndb/include/mgmapi/mgmapi.h b/storage/ndb/include/mgmapi/mgmapi.h index 883d3c43699..017a5954d8d 100644 --- a/storage/ndb/include/mgmapi/mgmapi.h +++ b/storage/ndb/include/mgmapi/mgmapi.h @@ -555,6 +555,17 @@ extern "C" { */ int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds); + /** + * Sets the number of milliseconds for timeout for read and write operations + * to the socket + * Default is 50,000 for read, 1000 for write + * + * @param handle NdbMgmHandle + * @param rw_milliseconds number of milliseconds + * @return zero on success + */ + int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int rw_milliseconds); + /** * Connects to a management server. Connectstring is set by * ndb_mgm_set_connectstring(). diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index 6bb01cb244b..a0a6493f41d 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -444,6 +444,16 @@ int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds) return 0; } +extern "C" +int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int rw_milliseconds) +{ + if(!handle) + return -1; + + handle->read_timeout= handle->write_timeout= rw_milliseconds; + return 0; +} + /** * Connect to a management server */ diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp index 0c6c05a0594..08b9305f13d 100644 --- a/storage/ndb/test/ndbapi/testMgm.cpp +++ b/storage/ndb/test/ndbapi/testMgm.cpp @@ -240,6 +240,8 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) ndbout << "Inserted session error" << endl; + ndb_mgm_set_timeout(h,1000,1000); + cc= ndb_mgm_check_connection(h); if(cc < 0) result= NDBT_OK; From 45f698c5516eb6d188077e876af82086e8cafba7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:33:31 +1100 Subject: [PATCH 276/789] [PATCH] WL#3704 mgmapi timeouts: Rename inputstream timeout Index: ndb-work/storage/ndb/include/util/InputStream.hpp =================================================================== storage/ndb/include/util/InputStream.hpp: WL#3704 mgmapi timeouts: Rename inputstream timeout storage/ndb/src/common/util/InputStream.cpp: WL#3704 mgmapi timeouts: Rename inputstream timeout --- storage/ndb/include/util/InputStream.hpp | 4 ++-- storage/ndb/src/common/util/InputStream.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ndb/include/util/InputStream.hpp b/storage/ndb/include/util/InputStream.hpp index 031260dac3b..928b8ff9aba 100644 --- a/storage/ndb/include/util/InputStream.hpp +++ b/storage/ndb/include/util/InputStream.hpp @@ -48,10 +48,10 @@ extern FileInputStream Stdin; class SocketInputStream : public InputStream { NDB_SOCKET_TYPE m_socket; - unsigned m_timeout; + unsigned m_timeout_ms; bool m_startover; public: - SocketInputStream(NDB_SOCKET_TYPE socket, unsigned readTimeout = 1000); + SocketInputStream(NDB_SOCKET_TYPE socket, unsigned read_timeout_ms = 1000); virtual ~SocketInputStream() {} char* gets(char * buf, int bufLen); }; diff --git a/storage/ndb/src/common/util/InputStream.cpp b/storage/ndb/src/common/util/InputStream.cpp index 74c31cd7583..016985328a1 100644 --- a/storage/ndb/src/common/util/InputStream.cpp +++ b/storage/ndb/src/common/util/InputStream.cpp @@ -34,10 +34,10 @@ FileInputStream::gets(char * buf, int bufLen){ } SocketInputStream::SocketInputStream(NDB_SOCKET_TYPE socket, - unsigned readTimeout) + unsigned read_timeout_ms) : m_socket(socket) { m_startover= true; - m_timeout = readTimeout; + m_timeout_ms = read_timeout_ms; } char* @@ -52,7 +52,7 @@ SocketInputStream::gets(char * buf, int bufLen) { else offset= strlen(buf); - int res = readln_socket(m_socket, m_timeout, buf+offset, bufLen-offset, m_mutex); + int res = readln_socket(m_socket, m_timeout_ms, buf+offset, bufLen-offset, m_mutex); if(res == 0) { From 8293b317d1cf6961720e033b8951ee403248692f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:33:43 +1100 Subject: [PATCH 277/789] [PATCH] WL#3704 mgmapi timeouts: Add bool timeout flag to Streams Index: ndb-work/storage/ndb/include/util/InputStream.hpp =================================================================== storage/ndb/include/util/InputStream.hpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/include/util/OutputStream.hpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/src/common/util/InputStream.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/src/common/util/OutputStream.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams --- storage/ndb/include/util/InputStream.hpp | 4 +++ storage/ndb/include/util/OutputStream.hpp | 3 ++ storage/ndb/src/common/util/InputStream.cpp | 6 ++++ storage/ndb/src/common/util/OutputStream.cpp | 17 +++++++++++ storage/ndb/src/mgmsrv/Services.cpp | 7 ++++- storage/ndb/test/ndbapi/testMgm.cpp | 32 +++++++++++++++----- 6 files changed, 60 insertions(+), 9 deletions(-) diff --git a/storage/ndb/include/util/InputStream.hpp b/storage/ndb/include/util/InputStream.hpp index 928b8ff9aba..4aabf2d1160 100644 --- a/storage/ndb/include/util/InputStream.hpp +++ b/storage/ndb/include/util/InputStream.hpp @@ -50,10 +50,14 @@ class SocketInputStream : public InputStream { NDB_SOCKET_TYPE m_socket; unsigned m_timeout_ms; bool m_startover; + bool m_timedout; public: SocketInputStream(NDB_SOCKET_TYPE socket, unsigned read_timeout_ms = 1000); virtual ~SocketInputStream() {} char* gets(char * buf, int bufLen); + bool timedout() { return m_timedout; }; + void reset_timeout() { m_timedout= false; }; + }; #endif diff --git a/storage/ndb/include/util/OutputStream.hpp b/storage/ndb/include/util/OutputStream.hpp index d56d04adc50..072d4288229 100644 --- a/storage/ndb/include/util/OutputStream.hpp +++ b/storage/ndb/include/util/OutputStream.hpp @@ -45,9 +45,12 @@ public: class SocketOutputStream : public OutputStream { NDB_SOCKET_TYPE m_socket; unsigned m_timeout_ms; + bool m_timedout; public: SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned write_timeout_ms = 1000); virtual ~SocketOutputStream() {} + bool timedout() { return m_timedout; }; + void reset_timeout() { m_timedout= false; }; int print(const char * fmt, ...); int println(const char * fmt, ...); diff --git a/storage/ndb/src/common/util/InputStream.cpp b/storage/ndb/src/common/util/InputStream.cpp index 016985328a1..17703eb7e52 100644 --- a/storage/ndb/src/common/util/InputStream.cpp +++ b/storage/ndb/src/common/util/InputStream.cpp @@ -38,10 +38,13 @@ SocketInputStream::SocketInputStream(NDB_SOCKET_TYPE socket, : m_socket(socket) { m_startover= true; m_timeout_ms = read_timeout_ms; + m_timedout= false; } char* SocketInputStream::gets(char * buf, int bufLen) { + if(timedout()) + return 0; assert(bufLen >= 2); int offset= 0; if(m_startover) @@ -63,7 +66,10 @@ SocketInputStream::gets(char * buf, int bufLen) { m_startover= true; if(res == -1) + { + m_timedout= true; return 0; + } return buf; } diff --git a/storage/ndb/src/common/util/OutputStream.cpp b/storage/ndb/src/common/util/OutputStream.cpp index 99216ba5a28..ebc352b1b50 100644 --- a/storage/ndb/src/common/util/OutputStream.cpp +++ b/storage/ndb/src/common/util/OutputStream.cpp @@ -45,21 +45,38 @@ SocketOutputStream::SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned write_timeout_ms){ m_socket = socket; m_timeout_ms = write_timeout_ms; + m_timedout= false; } int SocketOutputStream::print(const char * fmt, ...){ va_list ap; + + if(timedout()) + return -1; + va_start(ap, fmt); const int ret = vprint_socket(m_socket, m_timeout_ms, fmt, ap); va_end(ap); + + if (errno==ETIMEDOUT) + m_timedout= true; + return ret; } int SocketOutputStream::println(const char * fmt, ...){ va_list ap; + + if(timedout()) + return -1; + va_start(ap, fmt); const int ret = vprintln_socket(m_socket, m_timeout_ms, fmt, ap); va_end(ap); + + if (errno==ETIMEDOUT) + m_timedout= true; + return ret; } diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index e55c4ec6349..0bbdf4a9e51 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -1641,7 +1641,12 @@ MgmApiSession::get_mgmd_nodeid(Parser_t::Context &ctx, Properties const &args) { m_output->println("get mgmd nodeid reply"); - m_output->println("nodeid:%u",m_mgmsrv.getOwnNodeId()); + m_output->println("nodeid:%u",m_mgmsrv.getOwnNodeId()); + if(ERROR_INSERTED(1)) + { + NdbSleep_SecSleep(10); + } + m_output->println(""); } diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp index 08b9305f13d..35ad6c73ec1 100644 --- a/storage/ndb/test/ndbapi/testMgm.cpp +++ b/storage/ndb/test/ndbapi/testMgm.cpp @@ -218,16 +218,12 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) ndb_mgm_set_connectstring(h, mgm); ndb_mgm_connect(h,0,0,0); - ndbout << "Connected" << endl; - if(ndb_mgm_check_connection(h) < 0) { result= NDBT_FAILED; goto done; } - ndbout << "Checked Connection" << endl; - ndb_mgm_reply reply; reply.return_code= 0; @@ -238,9 +234,7 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) goto done; } - ndbout << "Inserted session error" << endl; - - ndb_mgm_set_timeout(h,1000,1000); + ndb_mgm_set_timeout(h,2500); cc= ndb_mgm_check_connection(h); if(cc < 0) @@ -248,7 +242,29 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) else result= NDBT_FAILED; - ndbout << "Tried check connection with result: " << cc << endl; + ndbout << "test 2" << endl; + ndb_mgm_connect(h,0,0,0); + + cc= ndb_mgm_get_mgmd_nodeid(h); + if(cc==0) + result= NDBT_OK; + else + result= NDBT_FAILED; + + if(ndb_mgm_insert_error(h, 3, 0, &reply)< 0) + { + ndbout << "failed to remove inserted error " << endl; + result= NDBT_FAILED; + goto done; + } + + cc= ndb_mgm_get_mgmd_nodeid(h); + ndbout << "got node id: " << cc << endl; + if(cc==0) + result= NDBT_FAILED; + else + result= NDBT_OK; + done: ndb_mgm_disconnect(h); ndb_mgm_destroy_handle(&h); From 446e5b36d72a4594333442d401449e291505d9d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:33:56 +1100 Subject: [PATCH 278/789] [PATCH] WL#3704 mgmapi timeouts: Return sane errors for timeout in mgmapi In ndb_mgm_call, add checks for expired timeout in (Input|Output)Stream. In case of timeout, we set NdbMgmHandle->last_error and return NULL. In api calls not using ndb_mgm_call (or using it in conjunction with own IO), they'll need to check for timeouts manually. Macros are provided to do this. Add ndb_mgm_disconnect_quiet(h) to disconnect without checking errors (so we don't clobber NdbMgmHandle->last_error). This helps us provide the *consistent* semantic that on timeout we leave the NdbMgmHandle *disconnected*. We check for this in testMgm. Change CHECK_REPLY in mgmapi to also check for set error in handle->last_error This will pick up the ETIMEDOUT errors and return them to client (through returning correct failure code for API call and setting NdbMgmHandle error). Applications written to MGMAPI before this patch will behave as before, and even hopefully check get_last_error and report the error back to the end user! Adding the last CHECK_TIMEDOUT_RET and delete in ndb_mgm_call() we slightly change behaviour of mgmapi. Previously, if disconnect midway through a reply, where there were only optional parameters left, we'd get a Properties object from ndb_mgm_call() containing NULLs for the optional parameters, leading to interesting error messages. This enables the returning of the *real* message and actually improves the API without breaking compatibility. ndb_mgm_start_signallog ndb_mgm_stop_signallog ndb_mgm_log_signals ndb_mgm_set_trace ndb_mgm_insert_error ndb_mgm_set_int64_parameter [1] ndb_mgm_set_string_parameter [1] ndb_mgm_purge_stale_sessions [2] - return error code on error during ndb_mgm_call TODO: ndb_mgm_report_event [2] [1] marked for removal, unused. [2] return codes incorrect in CHECK_HANDLE/CONNECTED. undocumented. Server side: in Services (per session) add macro for injecting timeout error (just waiting 10 seconds before continuing... it does work!) We inject these errors in a number of critical places - including the tricky api functions that don't just use ndb_mgm_call but do their own thing (get_config, get_status and friends) ATRT: Expand testMgm to add timout tests for API. Fully automated. *THEORETICALLY* timing dependent - an ultra-slow network will cause problems and "fake" failures... I welcome other solutions. Tests aren't exhaustive, but cover the generics and the tricky bits. Also test some calling semantics (incl disconnected on error). It is encouraged to add *more* mgmapi tests, not less :) InputStream: Fix where timedout error is set Index: ndb-work/storage/ndb/src/mgmapi/mgmapi.cpp =================================================================== storage/ndb/src/common/util/InputStream.cpp: WL#3704 mgmapi timeouts: Return sane errors for timeout in mgmapi storage/ndb/src/mgmapi/mgmapi.cpp: WL#3704 mgmapi timeouts: Return sane errors for timeout in mgmapi storage/ndb/src/mgmapi/mgmapi_internal.h: WL#3704 mgmapi timeouts: Return sane errors for timeout in mgmapi storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: Return sane errors for timeout in mgmapi storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: Return sane errors for timeout in mgmapi --- storage/ndb/src/common/util/InputStream.cpp | 2 +- storage/ndb/src/mgmapi/mgmapi.cpp | 156 +++++--- storage/ndb/src/mgmapi/mgmapi_internal.h | 2 + storage/ndb/src/mgmsrv/Services.cpp | 37 +- storage/ndb/test/ndbapi/testMgm.cpp | 397 ++++++++++++++++++-- 5 files changed, 505 insertions(+), 89 deletions(-) diff --git a/storage/ndb/src/common/util/InputStream.cpp b/storage/ndb/src/common/util/InputStream.cpp index 17703eb7e52..ee7f2d5c8b2 100644 --- a/storage/ndb/src/common/util/InputStream.cpp +++ b/storage/ndb/src/common/util/InputStream.cpp @@ -59,6 +59,7 @@ SocketInputStream::gets(char * buf, int bufLen) { if(res == 0) { + m_timedout= true; buf[0]=0; return buf; } @@ -67,7 +68,6 @@ SocketInputStream::gets(char * buf, int bufLen) { if(res == -1) { - m_timedout= true; return 0; } diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index a0a6493f41d..5671bf1561d 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -137,18 +137,41 @@ setError(NdbMgmHandle h, int error, int error_line, const char * msg, ...){ return ret; \ } -#define CHECK_REPLY(reply, ret) \ +#define CHECK_REPLY(handle, reply, ret) \ if(reply == NULL) { \ - SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, ""); \ + if(!handle->last_error) \ + SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, ""); \ return ret; \ } -#define DBUG_CHECK_REPLY(reply, ret) \ +#define DBUG_CHECK_REPLY(handle, reply, ret) \ if (reply == NULL) { \ - SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, ""); \ + if(!handle->last_error) \ + SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, ""); \ DBUG_RETURN(ret); \ } +#define CHECK_TIMEDOUT(in, out) \ + if(in.timedout() || out.timedout()) \ + SET_ERROR(handle, ETIMEDOUT, \ + "Time out talking to management server"); + +#define CHECK_TIMEDOUT_RET(h, in, out, ret) \ + if(in.timedout() || out.timedout()) { \ + SET_ERROR(handle, ETIMEDOUT, \ + "Time out talking to management server"); \ + ndb_mgm_disconnect_quiet(h); \ + return ret; \ + } + +#define DBUG_CHECK_TIMEDOUT_RET(h, in, out, ret) \ + if(in.timedout() || out.timedout()) { \ + SET_ERROR(handle, ETIMEDOUT, \ + "Time out talking to management server"); \ + ndb_mgm_disconnect_quiet(h); \ + DBUG_RETURN(ret); \ + } + /***************************************************************************** * Handles *****************************************************************************/ @@ -375,6 +398,8 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow *command_reply, } out.println(""); + CHECK_TIMEDOUT_RET(handle, in, out, NULL); + Parser_t::Context ctx; ParserDummy session(handle->socket); Parser_t parser(command_reply, in, true, true, true); @@ -382,14 +407,17 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow *command_reply, const Properties* p = parser.parse(ctx, session); if (p == NULL){ if(!ndb_mgm_is_connected(handle)) { + CHECK_TIMEDOUT_RET(handle, in, out, NULL); DBUG_RETURN(NULL); } else { + CHECK_TIMEDOUT_RET(handle, in, out, NULL); if(ctx.m_status==Parser_t::Eof || ctx.m_status==Parser_t::NoLine) { ndb_mgm_disconnect(handle); + CHECK_TIMEDOUT_RET(handle, in, out, NULL); DBUG_RETURN(NULL); } /** @@ -411,6 +439,10 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow *command_reply, p->print(handle->logfile, "IN: "); } #endif + + if(p && (in.timedout() || out.timedout())) + delete p; + CHECK_TIMEDOUT_RET(handle, in, out, NULL); DBUG_RETURN(p); } @@ -603,6 +635,22 @@ ndb_mgm_get_fd(NdbMgmHandle handle) return handle->socket; } +/** + * Disconnect from mgm server without error checking + * Should be used internally only. + * e.g. on timeout, we leave NdbMgmHandle disconnected + */ +extern "C" +int +ndb_mgm_disconnect_quiet(NdbMgmHandle handle) +{ + NDB_CLOSE_SOCKET(handle->socket); + handle->socket = NDB_INVALID_SOCKET; + handle->connected = 0; + + return 0; +} + /** * Disconnect from a mgm server */ @@ -614,11 +662,7 @@ ndb_mgm_disconnect(NdbMgmHandle handle) CHECK_HANDLE(handle, -1); CHECK_CONNECTED(handle, -1); - NDB_CLOSE_SOCKET(handle->socket); - handle->socket = NDB_INVALID_SOCKET; - handle->connected = 0; - - return 0; + return ndb_mgm_disconnect_quiet(handle); } struct ndb_mgm_type_atoi @@ -787,18 +831,24 @@ ndb_mgm_get_status(NdbMgmHandle handle) out.println("get status"); out.println(""); + CHECK_TIMEDOUT_RET(handle, in, out, NULL); + char buf[1024]; if(!in.gets(buf, sizeof(buf))) { + CHECK_TIMEDOUT_RET(handle, in, out, NULL); SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, "Probably disconnected"); return NULL; } if(strcmp("node status\n", buf) != 0) { + CHECK_TIMEDOUT_RET(handle, in, out, NULL); + ndbout << in.timedout() << " " << out.timedout() << buf << endl; SET_ERROR(handle, NDB_MGM_ILLEGAL_NODE_STATUS, buf); return NULL; } if(!in.gets(buf, sizeof(buf))) { + CHECK_TIMEDOUT_RET(handle, in, out, NULL); SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, "Probably disconnected"); return NULL; } @@ -807,6 +857,7 @@ ndb_mgm_get_status(NdbMgmHandle handle) Vector split; tmp.split(split, ":"); if(split.size() != 2){ + CHECK_TIMEDOUT_RET(handle, in, out, NULL); SET_ERROR(handle, NDB_MGM_ILLEGAL_NODE_STATUS, buf); return NULL; } @@ -841,8 +892,12 @@ ndb_mgm_get_status(NdbMgmHandle handle) if(!in.gets(buf, sizeof(buf))) { free(state); - SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, - "Probably disconnected"); + if(in.timedout() || out.timedout()) + SET_ERROR(handle, ETIMEDOUT, + "Time out talking to management server"); + else + SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, + "Probably disconnected"); return NULL; } tmp.assign(buf); @@ -873,6 +928,7 @@ ndb_mgm_get_status(NdbMgmHandle handle) if(i+1 != noOfNodes){ free(state); + CHECK_TIMEDOUT_RET(handle, in, out, NULL); SET_ERROR(handle, NDB_MGM_ILLEGAL_NODE_STATUS, "Node count mismatch"); return NULL; } @@ -901,7 +957,7 @@ ndb_mgm_enter_single_user(NdbMgmHandle handle, args.put("nodeId", nodeId); const Properties *reply; reply = ndb_mgm_call(handle, enter_single_reply, "enter single user", &args); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); BaseString result; reply->get("result", result); @@ -932,7 +988,7 @@ ndb_mgm_exit_single_user(NdbMgmHandle handle, struct ndb_mgm_reply* /*reply*/) const Properties *reply; reply = ndb_mgm_call(handle, exit_single_reply, "exit single user", 0); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); const char * buf; reply->get("result", &buf); @@ -1029,7 +1085,7 @@ ndb_mgm_stop3(NdbMgmHandle handle, int no_of_nodes, const int * node_list, reply = ndb_mgm_call(handle, stop_reply_v2, "stop all", &args); else reply = ndb_mgm_call(handle, stop_reply_v1, "stop all", &args); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); if(!reply->get("stopped", &stoppedNoOfNodes)){ SET_ERROR(handle, NDB_MGM_STOP_FAILED, @@ -1071,7 +1127,7 @@ ndb_mgm_stop3(NdbMgmHandle handle, int no_of_nodes, const int * node_list, else reply = ndb_mgm_call(handle, stop_reply_v1, "stop", &args); - CHECK_REPLY(reply, stoppedNoOfNodes); + CHECK_REPLY(handle, reply, stoppedNoOfNodes); if(!reply->get("stopped", &stoppedNoOfNodes)){ SET_ERROR(handle, NDB_MGM_STOP_FAILED, "Could not get number of stopped nodes from mgm server"); @@ -1174,7 +1230,7 @@ ndb_mgm_restart3(NdbMgmHandle handle, int no_of_nodes, const int * node_list, handle->read_timeout= 5*60*1000; // 5 minutes reply = ndb_mgm_call(handle, restart_reply_v1, "restart all", &args); handle->read_timeout= timeout; - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); BaseString result; reply->get("result", result); @@ -1301,7 +1357,7 @@ ndb_mgm_get_clusterlog_severity_filter(NdbMgmHandle handle, Properties args; const Properties *reply; reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); for(unsigned int i=0; i < severity_size; i++) { reply->get(clusterlog_severity_names[severity[i].category], &severity[i].value); @@ -1332,7 +1388,7 @@ ndb_mgm_get_clusterlog_severity_filter_old(NdbMgmHandle handle) Properties args; const Properties *reply; reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args); - CHECK_REPLY(reply, NULL); + CHECK_REPLY(handle, reply, NULL); for(int i=0; i < (int)NDB_MGM_EVENT_SEVERITY_ALL; i++) { reply->get(clusterlog_severity_names[i], &enabled[i]); @@ -1364,7 +1420,7 @@ ndb_mgm_set_clusterlog_severity_filter(NdbMgmHandle handle, const Properties *reply; reply = ndb_mgm_call(handle, filter_reply, "set logfilter", &args); - CHECK_REPLY(reply, retval); + CHECK_REPLY(handle, reply, retval); BaseString result; reply->get("result", result); @@ -1458,7 +1514,7 @@ ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle, Properties args; const Properties *reply; reply = ndb_mgm_call(handle, getloglevel_reply, "get cluster loglevel", &args); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); for(int i=0; i < loglevel_count; i++) { reply->get(clusterlog_names[loglevel[i].category], &loglevel[i].value); @@ -1494,7 +1550,7 @@ ndb_mgm_get_clusterlog_loglevel_old(NdbMgmHandle handle) Properties args; const Properties *reply; reply = ndb_mgm_call(handle, getloglevel_reply, "get cluster loglevel", &args); - CHECK_REPLY(reply, NULL); + CHECK_REPLY(handle, reply, NULL); for(int i=0; i < loglevel_count; i++) { reply->get(clusterlog_names[i], &loglevel[i]); @@ -1527,7 +1583,7 @@ ndb_mgm_set_clusterlog_loglevel(NdbMgmHandle handle, int nodeId, const Properties *reply; reply = ndb_mgm_call(handle, clusterlog_reply, "set cluster loglevel", &args); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); DBUG_ENTER("ndb_mgm_set_clusterlog_loglevel"); DBUG_PRINT("enter",("node=%d, category=%d, level=%d", nodeId, cat, level)); @@ -1565,7 +1621,7 @@ ndb_mgm_set_loglevel_node(NdbMgmHandle handle, int nodeId, args.put("level", level); const Properties *reply; reply = ndb_mgm_call(handle, loglevel_reply, "set loglevel", &args); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); BaseString result; reply->get("result", result); @@ -1624,7 +1680,7 @@ ndb_mgm_listen_event_internal(NdbMgmHandle handle, const int filter[], if(reply == NULL) { close(sockfd); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); } delete reply; return sockfd; @@ -1668,7 +1724,7 @@ ndb_mgm_dump_state(NdbMgmHandle handle, int nodeId, const int * _args, const Properties *prop; prop = ndb_mgm_call(handle, dump_state_reply, "dump state", &args); - CHECK_REPLY(prop, -1); + CHECK_REPLY(handle, prop, -1); BaseString result; prop->get("result", result); @@ -1705,6 +1761,7 @@ ndb_mgm_start_signallog(NdbMgmHandle handle, int nodeId, start_signallog_reply, "start signallog", &args); + CHECK_REPLY(handle, prop, -1); if(prop != NULL) { BaseString result; @@ -1741,6 +1798,7 @@ ndb_mgm_stop_signallog(NdbMgmHandle handle, int nodeId, const Properties *prop; prop = ndb_mgm_call(handle, stop_signallog_reply, "stop signallog", &args); + CHECK_REPLY(handle, prop, -1); if(prop != NULL) { BaseString result; @@ -1805,6 +1863,7 @@ ndb_mgm_log_signals(NdbMgmHandle handle, int nodeId, const Properties *prop; prop = ndb_mgm_call(handle, stop_signallog_reply, "log signals", &args); + CHECK_REPLY(handle, prop, -1); if(prop != NULL) { BaseString result; @@ -1842,6 +1901,7 @@ ndb_mgm_set_trace(NdbMgmHandle handle, int nodeId, int traceNumber, const Properties *prop; prop = ndb_mgm_call(handle, set_trace_reply, "set trace", &args); + CHECK_REPLY(handle, prop, -1); if(prop != NULL) { BaseString result; @@ -1879,6 +1939,7 @@ ndb_mgm_insert_error(NdbMgmHandle handle, int nodeId, int errorCode, const Properties *prop; prop = ndb_mgm_call(handle, insert_error_reply, "insert error", &args); + CHECK_REPLY(handle, prop, -1); if(prop != NULL) { BaseString result; @@ -1919,7 +1980,7 @@ ndb_mgm_start(NdbMgmHandle handle, int no_of_nodes, const int * node_list) Properties args; const Properties *reply; reply = ndb_mgm_call(handle, start_reply, "start all", &args); - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); Uint32 count = 0; if(!reply->get("started", &count)){ @@ -1985,7 +2046,7 @@ ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); handle->read_timeout= old_timeout; } - CHECK_REPLY(reply, -1); + CHECK_REPLY(handle, reply, -1); BaseString result; reply->get("result", result); @@ -2019,7 +2080,7 @@ ndb_mgm_abort_backup(NdbMgmHandle handle, unsigned int backupId, const Properties *prop; prop = ndb_mgm_call(handle, stop_backup_reply, "abort backup", &args); - CHECK_REPLY(prop, -1); + CHECK_REPLY(handle, prop, -1); const char * buf; prop->get("result", &buf); @@ -2036,7 +2097,7 @@ ndb_mgm_abort_backup(NdbMgmHandle handle, unsigned int backupId, extern "C" struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) { - + SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_configuration"); CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); @@ -2054,7 +2115,7 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) { const Properties *prop; prop = ndb_mgm_call(handle, reply, "get config", &args); - CHECK_REPLY(prop, 0); + CHECK_REPLY(handle, prop, 0); do { const char * buf; @@ -2091,9 +2152,14 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) { size_t start = 0; do { if((read = read_socket(handle->socket, handle->read_timeout, - &buf64[start], len-start)) == -1){ - delete[] buf64; + &buf64[start], len-start)) < 1){ + delete[] buf64; buf64 = 0; + if(read==0) + SET_ERROR(handle, ETIMEDOUT, "Timeout reading packed config"); + else + SET_ERROR(handle, errno, "Error reading packed config"); + ndb_mgm_disconnect_quiet(handle); break; } start += read; @@ -2214,7 +2280,7 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype, const Properties *prop; prop= ndb_mgm_call(handle, reply, "get nodeid", &args); - CHECK_REPLY(prop, -1); + CHECK_REPLY(handle, prop, -1); nodeid= -1; do { @@ -2266,7 +2332,7 @@ ndb_mgm_set_int_parameter(NdbMgmHandle handle, const Properties *prop; prop= ndb_mgm_call(handle, reply, "set parameter", &args); - CHECK_REPLY(prop, -1); + CHECK_REPLY(handle, prop, -1); int res= -1; do { @@ -2305,7 +2371,8 @@ ndb_mgm_set_int64_parameter(NdbMgmHandle handle, const Properties *prop; prop= ndb_mgm_call(handle, reply, "set parameter", &args); - + CHECK_REPLY(handle, prop, 0); + if(prop == NULL) { SET_ERROR(handle, EIO, "Unable set parameter"); return -1; @@ -2348,6 +2415,7 @@ ndb_mgm_set_string_parameter(NdbMgmHandle handle, const Properties *prop; prop= ndb_mgm_call(handle, reply, "set parameter", &args); + CHECK_REPLY(handle, prop, 0); if(prop == NULL) { SET_ERROR(handle, EIO, "Unable set parameter"); @@ -2385,7 +2453,8 @@ ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **purged){ const Properties *prop; prop= ndb_mgm_call(handle, reply, "purge stale sessions", &args); - + CHECK_REPLY(handle, prop, -1); + if(prop == NULL) { SET_ERROR(handle, EIO, "Unable to purge stale sessions"); return -1; @@ -2470,7 +2539,7 @@ ndb_mgm_set_connection_int_parameter(NdbMgmHandle handle, const Properties *prop; prop= ndb_mgm_call(handle, reply, "set connection parameter", &args); - DBUG_CHECK_REPLY(prop, -1); + DBUG_CHECK_REPLY(handle, prop, -1); int res= -1; do { @@ -2512,7 +2581,7 @@ ndb_mgm_get_connection_int_parameter(NdbMgmHandle handle, const Properties *prop; prop = ndb_mgm_call(handle, reply, "get connection parameter", &args); - DBUG_CHECK_REPLY(prop, -3); + DBUG_CHECK_REPLY(handle, prop, -3); int res= -1; do { @@ -2574,7 +2643,7 @@ ndb_mgm_get_mgmd_nodeid(NdbMgmHandle handle) const Properties *prop; prop = ndb_mgm_call(handle, reply, "get mgmd nodeid", &args); - DBUG_CHECK_REPLY(prop, 0); + DBUG_CHECK_REPLY(handle, prop, 0); if(!prop->get("nodeid",&nodeid)){ fprintf(handle->errstream, "Unable to get value\n"); @@ -2609,7 +2678,7 @@ int ndb_mgm_report_event(NdbMgmHandle handle, Uint32 *data, Uint32 length) const Properties *prop; prop = ndb_mgm_call(handle, reply, "report event", &args); - DBUG_CHECK_REPLY(prop, -1); + DBUG_CHECK_REPLY(handle, prop, -1); DBUG_RETURN(0); } @@ -2628,6 +2697,7 @@ int ndb_mgm_end_session(NdbMgmHandle handle) SocketInputStream in(handle->socket, handle->read_timeout); char buf[32]; in.gets(buf, sizeof(buf)); + CHECK_TIMEDOUT_RET(handle, in, s_output, -1); DBUG_RETURN(0); } @@ -2653,7 +2723,7 @@ int ndb_mgm_get_version(NdbMgmHandle handle, const Properties *prop; prop = ndb_mgm_call(handle, reply, "get version", &args); - CHECK_REPLY(prop, 0); + CHECK_REPLY(handle, prop, 0); Uint32 id; if(!prop->get("id",&id)){ @@ -2704,7 +2774,7 @@ ndb_mgm_get_session_id(NdbMgmHandle handle) const Properties *prop; prop = ndb_mgm_call(handle, reply, "get session id", &args); - CHECK_REPLY(prop, 0); + CHECK_REPLY(handle, prop, 0); if(!prop->get("id",&session_id)){ fprintf(handle->errstream, "Unable to get session id\n"); @@ -2741,7 +2811,7 @@ ndb_mgm_get_session(NdbMgmHandle handle, Uint64 id, const Properties *prop; prop = ndb_mgm_call(handle, reply, "get session", &args); - CHECK_REPLY(prop, 0); + CHECK_REPLY(handle, prop, 0); Uint64 r_id; int rlen= 0; diff --git a/storage/ndb/src/mgmapi/mgmapi_internal.h b/storage/ndb/src/mgmapi/mgmapi_internal.h index d30be221dcd..192bc57afd9 100644 --- a/storage/ndb/src/mgmapi/mgmapi_internal.h +++ b/storage/ndb/src/mgmapi/mgmapi_internal.h @@ -68,6 +68,8 @@ extern "C" { */ NDB_SOCKET_TYPE ndb_mgm_convert_to_transporter(NdbMgmHandle *handle); + int ndb_mgm_disconnect_quiet(NdbMgmHandle handle); + #ifdef __cplusplus } #endif diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index 0bbdf4a9e51..17072c240ae 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -290,6 +290,8 @@ struct PurgeStruct #define ERROR_INSERTED(x) (g_errorInsert == x || m_errorInsert == x) +#define SLEEP_ERROR_INSERTED(x) if(ERROR_INSERTED(x)){NdbSleep_SecSleep(10);} + MgmApiSession::MgmApiSession(class MgmtSrvr & mgm, NDB_SOCKET_TYPE sock, Uint64 session_id) : SocketServer::Session(sock), m_mgmsrv(mgm) { @@ -599,13 +601,23 @@ MgmApiSession::getConfig(Parser_t::Context &, char *tmp_str = (char *) malloc(base64_needed_encoded_length(src.length())); (void) base64_encode(src.get_data(), src.length(), tmp_str); - + + SLEEP_ERROR_INSERTED(1); + m_output->println("get config reply"); m_output->println("result: Ok"); m_output->println("Content-Length: %d", strlen(tmp_str)); m_output->println("Content-Type: ndbconfig/octet-stream"); + SLEEP_ERROR_INSERTED(2); m_output->println("Content-Transfer-Encoding: base64"); m_output->println(""); + if(ERROR_INSERTED(3)) + { + int l= strlen(tmp_str); + tmp_str[l/2]='\0'; + m_output->println(tmp_str); + NdbSleep_SecSleep(10); + } m_output->println(tmp_str); free(tmp_str); @@ -748,6 +760,7 @@ MgmApiSession::endSession(Parser::Context &, m_allocated_resources= new MgmtSrvr::Allocated_resources(m_mgmsrv); + SLEEP_ERROR_INSERTED(1); m_output->println("end session reply"); } @@ -998,12 +1011,16 @@ MgmApiSession::getStatus(Parser::Context &, while(m_mgmsrv.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_MGM)){ noOfNodes++; } - + SLEEP_ERROR_INSERTED(1); m_output->println("node status"); + SLEEP_ERROR_INSERTED(2); m_output->println("nodes: %d", noOfNodes); + SLEEP_ERROR_INSERTED(3); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_NDB); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_MGM); + SLEEP_ERROR_INSERTED(4); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_API); + SLEEP_ERROR_INSERTED(5); nodeId = 0; @@ -1118,8 +1135,10 @@ MgmApiSession::enterSingleUser(Parser::Context &, Properties const &args) { int stopped = 0; Uint32 nodeId = 0; + int result= 0; args.get("nodeId", &nodeId); - int result = m_mgmsrv.enterSingleUser(&stopped, nodeId); + + result = m_mgmsrv.enterSingleUser(&stopped, nodeId); m_output->println("enter single user reply"); if(result != 0) { m_output->println("result: %s", get_error_text(result)); @@ -1616,12 +1635,11 @@ void MgmApiSession::check_connection(Parser_t::Context &ctx, const class Properties &args) { - if(ERROR_INSERTED(1)) - { - NdbSleep_SecSleep(10); - } + SLEEP_ERROR_INSERTED(1); m_output->println("check connection reply"); + SLEEP_ERROR_INSERTED(2); m_output->println("result: Ok"); + SLEEP_ERROR_INSERTED(3); m_output->println(""); } @@ -1642,10 +1660,7 @@ MgmApiSession::get_mgmd_nodeid(Parser_t::Context &ctx, { m_output->println("get mgmd nodeid reply"); m_output->println("nodeid:%u",m_mgmsrv.getOwnNodeId()); - if(ERROR_INSERTED(1)) - { - NdbSleep_SecSleep(10); - } + SLEEP_ERROR_INSERTED(1); m_output->println(""); } diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp index 35ad6c73ec1..5f3147f1d91 100644 --- a/storage/ndb/test/ndbapi/testMgm.cpp +++ b/storage/ndb/test/ndbapi/testMgm.cpp @@ -22,6 +22,7 @@ #include #include #include +#include int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ @@ -191,6 +192,8 @@ int runTestApiSession(NDBT_Context* ctx, NDBT_Step* step) ndb_mgm_set_connectstring(h, mgm); ndb_mgm_connect(h,0,0,0); + NdbSleep_SecSleep(1); + if(ndb_mgm_get_session(h,session_id,&sess,&slen)) { ndbout << "Failed, session still exists" << endl; @@ -207,51 +210,66 @@ int runTestApiSession(NDBT_Context* ctx, NDBT_Step* step) } } -int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) +int runTestApiTimeoutBasic(NDBT_Context* ctx, NDBT_Step* step) { char *mgm= ctx->getRemoteMgm(); int result= NDBT_FAILED; int cc= 0; + int mgmd_nodeid= 0; + ndb_mgm_reply reply; NdbMgmHandle h; h= ndb_mgm_create_handle(); ndb_mgm_set_connectstring(h, mgm); - ndb_mgm_connect(h,0,0,0); - if(ndb_mgm_check_connection(h) < 0) + ndbout << "TEST timout check_connection" << endl; + for(int error_ins=1; error_ins<=3; error_ins++) { - result= NDBT_FAILED; - goto done; + ndbout << "trying error " << error_ins << endl; + ndb_mgm_connect(h,0,0,0); + + if(ndb_mgm_check_connection(h) < 0) + { + result= NDBT_FAILED; + goto done; + } + + mgmd_nodeid= ndb_mgm_get_mgmd_nodeid(h); + if(mgmd_nodeid==0) + { + ndbout << "Failed to get mgmd node id to insert error" << endl; + result= NDBT_FAILED; + goto done; + } + + reply.return_code= 0; + + if(ndb_mgm_insert_error(h, mgmd_nodeid, error_ins, &reply)< 0) + { + ndbout << "failed to insert error " << endl; + result= NDBT_FAILED; + goto done; + } + + ndb_mgm_set_timeout(h,2500); + + cc= ndb_mgm_check_connection(h); + if(cc < 0) + result= NDBT_OK; + else + result= NDBT_FAILED; + + if(ndb_mgm_is_connected(h)) + { + ndbout << "FAILED: still connected" << endl; + result= NDBT_FAILED; + } } - ndb_mgm_reply reply; - reply.return_code= 0; - - if(ndb_mgm_insert_error(h, 3, 1, &reply)< 0) - { - ndbout << "failed to insert error " << endl; - result= NDBT_FAILED; - goto done; - } - - ndb_mgm_set_timeout(h,2500); - - cc= ndb_mgm_check_connection(h); - if(cc < 0) - result= NDBT_OK; - else - result= NDBT_FAILED; - - ndbout << "test 2" << endl; + ndbout << "TEST get_mgmd_nodeid" << endl; ndb_mgm_connect(h,0,0,0); - cc= ndb_mgm_get_mgmd_nodeid(h); - if(cc==0) - result= NDBT_OK; - else - result= NDBT_FAILED; - - if(ndb_mgm_insert_error(h, 3, 0, &reply)< 0) + if(ndb_mgm_insert_error(h, mgmd_nodeid, 0, &reply)< 0) { ndbout << "failed to remove inserted error " << endl; result= NDBT_FAILED; @@ -261,10 +279,132 @@ int runTestApiTimeout1(NDBT_Context* ctx, NDBT_Step* step) cc= ndb_mgm_get_mgmd_nodeid(h); ndbout << "got node id: " << cc << endl; if(cc==0) + { + ndbout << "FAILED: didn't get node id" << endl; result= NDBT_FAILED; + } else result= NDBT_OK; + ndbout << "TEST end_session" << endl; + ndb_mgm_connect(h,0,0,0); + + if(ndb_mgm_insert_error(h, mgmd_nodeid, 1, &reply)< 0) + { + ndbout << "FAILED: insert error 1" << endl; + result= NDBT_FAILED; + goto done; + } + + cc= ndb_mgm_end_session(h); + if(cc==0) + { + ndbout << "FAILED: success in calling end_session" << endl; + result= NDBT_FAILED; + } + else if(ndb_mgm_get_latest_error(h)!=ETIMEDOUT) + { + ndbout << "FAILED: Incorrect error code (" << ndb_mgm_get_latest_error(h) + << " != expected " << ETIMEDOUT << ") desc: " + << ndb_mgm_get_latest_error_desc(h) + << " line: " << ndb_mgm_get_latest_error_line(h) + << " msg: " << ndb_mgm_get_latest_error_msg(h) + << endl; + result= NDBT_FAILED; + } + else + result= NDBT_OK; + + if(ndb_mgm_is_connected(h)) + { + ndbout << "FAILED: is still connected after error" << endl; + result= NDBT_FAILED; + } +done: + ndb_mgm_disconnect(h); + ndb_mgm_destroy_handle(&h); + + return result; +} + +int runTestApiGetStatusTimeout(NDBT_Context* ctx, NDBT_Step* step) +{ + char *mgm= ctx->getRemoteMgm(); + int result= NDBT_OK; + int cc= 0; + int mgmd_nodeid= 0; + + NdbMgmHandle h; + h= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(h, mgm); + + for(int error_ins=0; error_ins<=5; error_ins++) + { + ndb_mgm_connect(h,0,0,0); + + if(ndb_mgm_check_connection(h) < 0) + { + result= NDBT_FAILED; + goto done; + } + + mgmd_nodeid= ndb_mgm_get_mgmd_nodeid(h); + if(mgmd_nodeid==0) + { + ndbout << "Failed to get mgmd node id to insert error" << endl; + result= NDBT_FAILED; + goto done; + } + + ndb_mgm_reply reply; + reply.return_code= 0; + + if(ndb_mgm_insert_error(h, mgmd_nodeid, error_ins, &reply)< 0) + { + ndbout << "failed to insert error " << error_ins << endl; + result= NDBT_FAILED; + } + + ndbout << "trying error: " << error_ins << endl; + + ndb_mgm_set_timeout(h,2500); + + struct ndb_mgm_cluster_state *cl= ndb_mgm_get_status(h); + + if(cl!=NULL) + free(cl); + + /* + * For whatever strange reason, + * get_status is okay with not having the last enter there. + * instead of "fixing" the api, let's have a special case + * so we don't break any behaviour + */ + + if(error_ins!=0 && error_ins!=5 && cl!=NULL) + { + ndbout << "FAILED: got a ndb_mgm_cluster_state back" << endl; + result= NDBT_FAILED; + } + + if(error_ins!=0 && error_ins!=5 && ndb_mgm_is_connected(h)) + { + ndbout << "FAILED: is still connected after error" << endl; + result= NDBT_FAILED; + } + + if(error_ins!=0 && error_ins!=5 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT) + { + ndbout << "FAILED: Incorrect error code (" << ndb_mgm_get_latest_error(h) + << " != expected " << ETIMEDOUT << ") desc: " + << ndb_mgm_get_latest_error_desc(h) + << " line: " << ndb_mgm_get_latest_error_line(h) + << " msg: " << ndb_mgm_get_latest_error_msg(h) + << endl; + result= NDBT_FAILED; + } + } + done: ndb_mgm_disconnect(h); ndb_mgm_destroy_handle(&h); @@ -272,6 +412,180 @@ done: return result; } +int runTestMgmApiGetConfigTimeout(NDBT_Context* ctx, NDBT_Step* step) +{ + char *mgm= ctx->getRemoteMgm(); + int result= NDBT_OK; + int mgmd_nodeid= 0; + + NdbMgmHandle h; + h= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(h, mgm); + + for(int error_ins=0; error_ins<=3; error_ins++) + { + ndb_mgm_connect(h,0,0,0); + + if(ndb_mgm_check_connection(h) < 0) + { + result= NDBT_FAILED; + goto done; + } + + mgmd_nodeid= ndb_mgm_get_mgmd_nodeid(h); + if(mgmd_nodeid==0) + { + ndbout << "Failed to get mgmd node id to insert error" << endl; + result= NDBT_FAILED; + goto done; + } + + ndb_mgm_reply reply; + reply.return_code= 0; + + if(ndb_mgm_insert_error(h, mgmd_nodeid, error_ins, &reply)< 0) + { + ndbout << "failed to insert error " << error_ins << endl; + result= NDBT_FAILED; + } + + ndbout << "trying error: " << error_ins << endl; + + ndb_mgm_set_timeout(h,2500); + + struct ndb_mgm_configuration *c= ndb_mgm_get_configuration(h,0); + + if(c!=NULL) + free(c); + + if(error_ins!=0 && c!=NULL) + { + ndbout << "FAILED: got a ndb_mgm_configuration back" << endl; + result= NDBT_FAILED; + } + + if(error_ins!=0 && ndb_mgm_is_connected(h)) + { + ndbout << "FAILED: is still connected after error" << endl; + result= NDBT_FAILED; + } + + if(error_ins!=0 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT) + { + ndbout << "FAILED: Incorrect error code (" << ndb_mgm_get_latest_error(h) + << " != expected " << ETIMEDOUT << ") desc: " + << ndb_mgm_get_latest_error_desc(h) + << " line: " << ndb_mgm_get_latest_error_line(h) + << " msg: " << ndb_mgm_get_latest_error_msg(h) + << endl; + result= NDBT_FAILED; + } + } + +done: + ndb_mgm_disconnect(h); + ndb_mgm_destroy_handle(&h); + + return result; +} + +int runTestMgmApiEventTimeout(NDBT_Context* ctx, NDBT_Step* step) +{ + char *mgm= ctx->getRemoteMgm(); + int result= NDBT_OK; + int mgmd_nodeid= 0; + + NdbMgmHandle h; + h= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(h, mgm); + + for(int error_ins=0; error_ins<=3; error_ins++) + { + ndb_mgm_connect(h,0,0,0); + + if(ndb_mgm_check_connection(h) < 0) + { + result= NDBT_FAILED; + goto done; + } + + mgmd_nodeid= ndb_mgm_get_mgmd_nodeid(h); + if(mgmd_nodeid==0) + { + ndbout << "Failed to get mgmd node id to insert error" << endl; + result= NDBT_FAILED; + goto done; + } + + ndb_mgm_reply reply; + reply.return_code= 0; + + if(ndb_mgm_insert_error(h, mgmd_nodeid, error_ins, &reply)< 0) + { + ndbout << "failed to insert error " << error_ins << endl; + result= NDBT_FAILED; + } + + ndbout << "trying error: " << error_ins << endl; + + ndb_mgm_set_timeout(h,2500); + + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, + 1, NDB_MGM_EVENT_CATEGORY_STARTUP, + 0 }; + int fd= ndb_mgm_listen_event(h, filter); + + if(fd==NDB_INVALID_SOCKET) + { + ndbout << "FAILED: could not listen to event" << endl; + result= NDBT_FAILED; + } + + char *tmp= 0; + char buf[512]; + SocketInputStream in(fd,20000); + do { + if((tmp = in.gets(buf, sizeof(buf)))) + { + const char ping_token[]=""; + if(memcmp(ping_token,tmp,sizeof(ping_token)-1)) + if(tmp && strlen(tmp)) + ndbout << tmp; + } + else + { + if(in.timedout()) + { + ndbout << "TIMED OUT READING EVENT" << endl; + break; + } + } + } while(true); + + if(error_ins!=0 && ndb_mgm_is_connected(h)) + { + ndbout << "FAILED: is still connected after error" << endl; + result= NDBT_FAILED; + } + + if(error_ins!=0 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT) + { + ndbout << "FAILED: Incorrect error code (" << ndb_mgm_get_latest_error(h) + << " != expected " << ETIMEDOUT << ") desc: " + << ndb_mgm_get_latest_error_desc(h) + << " line: " << ndb_mgm_get_latest_error_line(h) + << " msg: " << ndb_mgm_get_latest_error_msg(h) + << endl; + result= NDBT_FAILED; + } + } + +done: + ndb_mgm_disconnect(h); + ndb_mgm_destroy_handle(&h); + + return result; +} NDBT_TESTSUITE(testMgm); TESTCASE("SingleUserMode", @@ -284,9 +598,24 @@ TESTCASE("ApiSessionFailure", INITIALIZER(runTestApiSession); } -TESTCASE("ApiTimeout1", - "Test timeout for MGMAPI"){ - INITIALIZER(runTestApiTimeout1); +TESTCASE("ApiTimeoutBasic", + "Basic timeout tests for MGMAPI"){ + INITIALIZER(runTestApiTimeoutBasic); + +} +TESTCASE("ApiGetStatusTimeout", + "Test timeout for MGMAPI getStatus"){ + INITIALIZER(runTestApiGetStatusTimeout); + +} +TESTCASE("ApiGetConfigTimeout", + "Test timeouts for mgmapi get_configuration"){ + INITIALIZER(runTestMgmApiGetConfigTimeout); + +} +TESTCASE("ApiMgmEventTimeout", + "Test timeouts for mgmapi get_configuration"){ + INITIALIZER(runTestMgmApiEventTimeout); } NDBT_TESTSUITE_END(testMgm); From 80220f70605a34685965cf223876ce9ce243c8dc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:34:08 +1100 Subject: [PATCH 279/789] [PATCH] WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates. Also add an ERROR_codes.txt file for mgmd Index: ndb-work/storage/ndb/src/mgmsrv/ERROR_codes.txt =================================================================== storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates. storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates. storage/ndb/src/mgmsrv/ERROR_codes.txt: WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates. --- storage/ndb/src/mgmsrv/ERROR_codes.txt | 27 +++++++++++++++++++++++++ storage/ndb/src/mgmsrv/Services.cpp | 12 +++++------ storage/ndb/test/ndbapi/testMgm.cpp | 28 ++++++++++++++++++-------- 3 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 storage/ndb/src/mgmsrv/ERROR_codes.txt diff --git a/storage/ndb/src/mgmsrv/ERROR_codes.txt b/storage/ndb/src/mgmsrv/ERROR_codes.txt new file mode 100644 index 00000000000..4c9f4982e7e --- /dev/null +++ b/storage/ndb/src/mgmsrv/ERROR_codes.txt @@ -0,0 +1,27 @@ +Next Session 10 +Next Global 10000 + + +#define MGM_ERROR_MAX_INJECT_SESSION_ONLY 10000 +Errors < 10000 are per-session only - in MgmApiSession. + +Others are for the whole mgm server. + +Error 0 is no error + +TIMEOUTS +-------- + +num where type testing + +1 get config sleep begin +2 get config sleep middle parsable +3 get config mangle halfway through encoded properties + +4 end session sleep before reply + +5 node status sleep before reply +6 node status sleep during parsable reply +7 node status sleep after parsable, before status reply +8 node status sleep partway through status reporting +9 node status sleep end of status printing diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index 17072c240ae..201d0ba7412 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -760,7 +760,7 @@ MgmApiSession::endSession(Parser::Context &, m_allocated_resources= new MgmtSrvr::Allocated_resources(m_mgmsrv); - SLEEP_ERROR_INSERTED(1); + SLEEP_ERROR_INSERTED(4); m_output->println("end session reply"); } @@ -1011,16 +1011,16 @@ MgmApiSession::getStatus(Parser::Context &, while(m_mgmsrv.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_MGM)){ noOfNodes++; } - SLEEP_ERROR_INSERTED(1); + SLEEP_ERROR_INSERTED(5); m_output->println("node status"); - SLEEP_ERROR_INSERTED(2); + SLEEP_ERROR_INSERTED(6); m_output->println("nodes: %d", noOfNodes); - SLEEP_ERROR_INSERTED(3); + SLEEP_ERROR_INSERTED(7); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_NDB); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_MGM); - SLEEP_ERROR_INSERTED(4); + SLEEP_ERROR_INSERTED(8); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_API); - SLEEP_ERROR_INSERTED(5); + SLEEP_ERROR_INSERTED(9); nodeId = 0; diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp index 5f3147f1d91..aa14e12bd88 100644 --- a/storage/ndb/test/ndbapi/testMgm.cpp +++ b/storage/ndb/test/ndbapi/testMgm.cpp @@ -223,8 +223,11 @@ int runTestApiTimeoutBasic(NDBT_Context* ctx, NDBT_Step* step) ndb_mgm_set_connectstring(h, mgm); ndbout << "TEST timout check_connection" << endl; - for(int error_ins=1; error_ins<=3; error_ins++) + int errs[] = { 1, 2, 3, -1}; + + for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++) { + int error_ins= errs[error_ins_no]; ndbout << "trying error " << error_ins << endl; ndb_mgm_connect(h,0,0,0); @@ -289,7 +292,7 @@ int runTestApiTimeoutBasic(NDBT_Context* ctx, NDBT_Step* step) ndbout << "TEST end_session" << endl; ndb_mgm_connect(h,0,0,0); - if(ndb_mgm_insert_error(h, mgmd_nodeid, 1, &reply)< 0) + if(ndb_mgm_insert_error(h, mgmd_nodeid, 4, &reply)< 0) { ndbout << "FAILED: insert error 1" << endl; result= NDBT_FAILED; @@ -338,8 +341,11 @@ int runTestApiGetStatusTimeout(NDBT_Context* ctx, NDBT_Step* step) h= ndb_mgm_create_handle(); ndb_mgm_set_connectstring(h, mgm); - for(int error_ins=0; error_ins<=5; error_ins++) + int errs[] = { 0, 5, 6, 7, 8, 9, -1 }; + + for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++) { + int error_ins= errs[error_ins_no]; ndb_mgm_connect(h,0,0,0); if(ndb_mgm_check_connection(h) < 0) @@ -381,19 +387,19 @@ int runTestApiGetStatusTimeout(NDBT_Context* ctx, NDBT_Step* step) * so we don't break any behaviour */ - if(error_ins!=0 && error_ins!=5 && cl!=NULL) + if(error_ins!=0 && error_ins!=9 && cl!=NULL) { ndbout << "FAILED: got a ndb_mgm_cluster_state back" << endl; result= NDBT_FAILED; } - if(error_ins!=0 && error_ins!=5 && ndb_mgm_is_connected(h)) + if(error_ins!=0 && error_ins!=9 && ndb_mgm_is_connected(h)) { ndbout << "FAILED: is still connected after error" << endl; result= NDBT_FAILED; } - if(error_ins!=0 && error_ins!=5 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT) + if(error_ins!=0 && error_ins!=9 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT) { ndbout << "FAILED: Incorrect error code (" << ndb_mgm_get_latest_error(h) << " != expected " << ETIMEDOUT << ") desc: " @@ -422,8 +428,11 @@ int runTestMgmApiGetConfigTimeout(NDBT_Context* ctx, NDBT_Step* step) h= ndb_mgm_create_handle(); ndb_mgm_set_connectstring(h, mgm); - for(int error_ins=0; error_ins<=3; error_ins++) + int errs[] = { 0, 1, 2, 3, -1 }; + + for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++) { + int error_ins= errs[error_ins_no]; ndb_mgm_connect(h,0,0,0); if(ndb_mgm_check_connection(h) < 0) @@ -499,8 +508,11 @@ int runTestMgmApiEventTimeout(NDBT_Context* ctx, NDBT_Step* step) h= ndb_mgm_create_handle(); ndb_mgm_set_connectstring(h, mgm); - for(int error_ins=0; error_ins<=3; error_ins++) + int errs[] = { 0, -1 }; + + for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++) { + int error_ins= errs[error_ins_no]; ndb_mgm_connect(h,0,0,0); if(ndb_mgm_check_connection(h) < 0) From 7652e96fffc967afd55781dffcd34a8d81a4e034 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:34:19 +1100 Subject: [PATCH 280/789] [PATCH] WL#3704 mgmapi timeouts: manipulate some things to get infrastructure for event timeouts Index: ndb-work/storage/ndb/src/mgmsrv/MgmtSrvr.cpp =================================================================== storage/ndb/src/mgmsrv/ERROR_codes.txt: WL#3704 mgmapi timeouts: manipulate some things to get infrastructure for event timeouts storage/ndb/src/mgmsrv/MgmtSrvr.cpp: WL#3704 mgmapi timeouts: manipulate some things to get infrastructure for event timeouts storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: manipulate some things to get infrastructure for event timeouts storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: manipulate some things to get infrastructure for event timeouts --- storage/ndb/src/mgmsrv/ERROR_codes.txt | 4 ++- storage/ndb/src/mgmsrv/MgmtSrvr.cpp | 8 +++++ storage/ndb/src/mgmsrv/Services.cpp | 4 +-- storage/ndb/test/ndbapi/testMgm.cpp | 46 ++++++++++++++++---------- 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/storage/ndb/src/mgmsrv/ERROR_codes.txt b/storage/ndb/src/mgmsrv/ERROR_codes.txt index 4c9f4982e7e..44a6047c05e 100644 --- a/storage/ndb/src/mgmsrv/ERROR_codes.txt +++ b/storage/ndb/src/mgmsrv/ERROR_codes.txt @@ -1,5 +1,5 @@ Next Session 10 -Next Global 10000 +Next Global 10001 #define MGM_ERROR_MAX_INJECT_SESSION_ONLY 10000 @@ -25,3 +25,5 @@ num where type testing 7 node status sleep after parsable, before status reply 8 node status sleep partway through status reporting 9 node status sleep end of status printing + +10000 events PING no ping don't send pings to event listeners diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp index e836ef8d32a..558ab358fd5 100644 --- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -181,6 +181,9 @@ MgmtSrvr::logLevelThreadRun() } m_log_level_requests.unlock(); + if(!ERROR_INSERTED(10000)) + m_event_listner.check_listeners(); + NdbSleep_MilliSleep(_logLevelThreadSleep); } } @@ -1750,6 +1753,11 @@ MgmtSrvr::insertError(int nodeId, int errorNo) || !theFacade->get_node_alive(nodeId)) return NO_CONTACT_WITH_PROCESS; } + else if(nodeId == _ownNodeId) + { + g_errorInsert= errorNo; + return 0; + } else if(getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM) block= _blockNumber; else diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index 201d0ba7412..d39c4945f69 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -296,8 +296,8 @@ MgmApiSession::MgmApiSession(class MgmtSrvr & mgm, NDB_SOCKET_TYPE sock, Uint64 : SocketServer::Session(sock), m_mgmsrv(mgm) { DBUG_ENTER("MgmApiSession::MgmApiSession"); - m_input = new SocketInputStream(sock); - m_output = new SocketOutputStream(sock); + m_input = new SocketInputStream(sock, 30000); + m_output = new SocketOutputStream(sock, 30000); m_parser = new Parser_t(commands, *m_input, true, true, true); m_allocated_resources= new MgmtSrvr::Allocated_resources(m_mgmsrv); m_stopSelf= 0; diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp index aa14e12bd88..0064c8fd679 100644 --- a/storage/ndb/test/ndbapi/testMgm.cpp +++ b/storage/ndb/test/ndbapi/testMgm.cpp @@ -23,6 +23,7 @@ #include #include #include +#include int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ @@ -508,7 +509,7 @@ int runTestMgmApiEventTimeout(NDBT_Context* ctx, NDBT_Step* step) h= ndb_mgm_create_handle(); ndb_mgm_set_connectstring(h, mgm); - int errs[] = { 0, -1 }; + int errs[] = { 10000, 0, -1 }; for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++) { @@ -553,14 +554,26 @@ int runTestMgmApiEventTimeout(NDBT_Context* ctx, NDBT_Step* step) result= NDBT_FAILED; } + Uint32 theData[25]; + EventReport *fake_event = (EventReport*)theData; + fake_event->setEventType(NDB_LE_NDBStopForced); + fake_event->setNodeId(42); + theData[2]= 0; + theData[3]= 0; + theData[4]= 0; + theData[5]= 0; + + ndb_mgm_report_event(h, theData, 6); + char *tmp= 0; char buf[512]; - SocketInputStream in(fd,20000); - do { + SocketInputStream in(fd,2000); + for(int i=0; i<20; i++) + { if((tmp = in.gets(buf, sizeof(buf)))) { - const char ping_token[]=""; - if(memcmp(ping_token,tmp,sizeof(ping_token)-1)) +// const char ping_token[]=""; +// if(memcmp(ping_token,tmp,sizeof(ping_token)-1)) if(tmp && strlen(tmp)) ndbout << tmp; } @@ -568,28 +581,25 @@ int runTestMgmApiEventTimeout(NDBT_Context* ctx, NDBT_Step* step) { if(in.timedout()) { - ndbout << "TIMED OUT READING EVENT" << endl; + ndbout << "TIMED OUT READING EVENT at iteration " << i << endl; break; } } - } while(true); + } - if(error_ins!=0 && ndb_mgm_is_connected(h)) + /* + * events go through a *DIFFERENT* socket than the NdbMgmHandle + * so we should still be connected (and be able to check_connection) + * + */ + + if(ndb_mgm_check_connection(h) && !ndb_mgm_is_connected(h)) { ndbout << "FAILED: is still connected after error" << endl; result= NDBT_FAILED; } - if(error_ins!=0 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT) - { - ndbout << "FAILED: Incorrect error code (" << ndb_mgm_get_latest_error(h) - << " != expected " << ETIMEDOUT << ") desc: " - << ndb_mgm_get_latest_error_desc(h) - << " line: " << ndb_mgm_get_latest_error_line(h) - << " msg: " << ndb_mgm_get_latest_error_msg(h) - << endl; - result= NDBT_FAILED; - } + ndb_mgm_disconnect(h); } done: From 1ff37f91435fa8b64e09806a62330981f117b2f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:34:31 +1100 Subject: [PATCH 281/789] [PATCH] WL#3704 mgmapi timeouts: Test for structured events timeouts (with err injection). Index: ndb-work/storage/ndb/test/ndbapi/testMgm.cpp =================================================================== storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: Test for structured events timeouts (with err injection). --- storage/ndb/test/ndbapi/testMgm.cpp | 113 ++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/storage/ndb/test/ndbapi/testMgm.cpp b/storage/ndb/test/ndbapi/testMgm.cpp index 0064c8fd679..cc074087bdb 100644 --- a/storage/ndb/test/ndbapi/testMgm.cpp +++ b/storage/ndb/test/ndbapi/testMgm.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -609,6 +610,113 @@ done: return result; } +int runTestMgmApiStructEventTimeout(NDBT_Context* ctx, NDBT_Step* step) +{ + char *mgm= ctx->getRemoteMgm(); + int result= NDBT_OK; + int mgmd_nodeid= 0; + + NdbMgmHandle h; + h= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(h, mgm); + + int errs[] = { 10000, 0, -1 }; + + for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++) + { + int error_ins= errs[error_ins_no]; + ndb_mgm_connect(h,0,0,0); + + if(ndb_mgm_check_connection(h) < 0) + { + result= NDBT_FAILED; + goto done; + } + + mgmd_nodeid= ndb_mgm_get_mgmd_nodeid(h); + if(mgmd_nodeid==0) + { + ndbout << "Failed to get mgmd node id to insert error" << endl; + result= NDBT_FAILED; + goto done; + } + + ndb_mgm_reply reply; + reply.return_code= 0; + + if(ndb_mgm_insert_error(h, mgmd_nodeid, error_ins, &reply)< 0) + { + ndbout << "failed to insert error " << error_ins << endl; + result= NDBT_FAILED; + } + + ndbout << "trying error: " << error_ins << endl; + + ndb_mgm_set_timeout(h,2500); + + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, + 1, NDB_MGM_EVENT_CATEGORY_STARTUP, + 0 }; + NdbLogEventHandle le_handle= ndb_mgm_create_logevent_handle(h, filter); + + struct ndb_logevent le; + for(int i=0; i<20; i++) + { + if(error_ins==0 || (error_ins!=0 && i<5)) + { + Uint32 theData[25]; + EventReport *fake_event = (EventReport*)theData; + fake_event->setEventType(NDB_LE_NDBStopForced); + fake_event->setNodeId(42); + theData[2]= 0; + theData[3]= 0; + theData[4]= 0; + theData[5]= 0; + + ndb_mgm_report_event(h, theData, 6); + } + int r= ndb_logevent_get_next(le_handle, &le, 2500); + if(r>0) + { + ndbout << "Receieved event" << endl; + } + else if(r<0) + { + ndbout << "ERROR" << endl; + } + else // no event + { + ndbout << "TIMED OUT READING EVENT at iteration " << i << endl; + if(error_ins==0) + result= NDBT_FAILED; + else + result= NDBT_OK; + break; + } + } + + /* + * events go through a *DIFFERENT* socket than the NdbMgmHandle + * so we should still be connected (and be able to check_connection) + * + */ + + if(ndb_mgm_check_connection(h) && !ndb_mgm_is_connected(h)) + { + ndbout << "FAILED: is still connected after error" << endl; + result= NDBT_FAILED; + } + + ndb_mgm_disconnect(h); + } + +done: + ndb_mgm_disconnect(h); + ndb_mgm_destroy_handle(&h); + + return result; +} + NDBT_TESTSUITE(testMgm); TESTCASE("SingleUserMode", "Test single user mode"){ @@ -639,6 +747,11 @@ TESTCASE("ApiMgmEventTimeout", "Test timeouts for mgmapi get_configuration"){ INITIALIZER(runTestMgmApiEventTimeout); +} +TESTCASE("ApiMgmStructEventTimeout", + "Test timeouts for mgmapi get_configuration"){ + INITIALIZER(runTestMgmApiStructEventTimeout); + } NDBT_TESTSUITE_END(testMgm); From e26da089a031982ff07df802fac2464d8bcab9a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:34:43 +1100 Subject: [PATCH 282/789] [PATCH] WL#3704 mgmapi timeouts: consolidate NdbMgmHandle timeouts into one Only one timeout value is needed. Also saves 8bytes per NdbMgmHandle :) Index: ndb-work/storage/ndb/include/mgmapi/mgmapi.h =================================================================== storage/ndb/include/mgmapi/mgmapi.h: WL#3704 mgmapi timeouts: consolidate NdbMgmHandle timeouts into one storage/ndb/src/mgmapi/mgmapi.cpp: WL#3704 mgmapi timeouts: consolidate NdbMgmHandle timeouts into one --- storage/ndb/include/mgmapi/mgmapi.h | 14 +++---- storage/ndb/src/mgmapi/mgmapi.cpp | 59 +++++++++++++---------------- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/storage/ndb/include/mgmapi/mgmapi.h b/storage/ndb/include/mgmapi/mgmapi.h index 017a5954d8d..f862dd72f9b 100644 --- a/storage/ndb/include/mgmapi/mgmapi.h +++ b/storage/ndb/include/mgmapi/mgmapi.h @@ -546,8 +546,7 @@ extern "C" { const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz); /** - * Sets the number of seconds to wait for connect(2) during ndb_mgm_connect - * Default is no timeout + * DEPRICATED: use ndb_mgm_set_timeout instead. * * @param handle NdbMgmHandle * @param seconds number of seconds @@ -556,15 +555,16 @@ extern "C" { int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds); /** - * Sets the number of milliseconds for timeout for read and write operations - * to the socket - * Default is 50,000 for read, 1000 for write + * Sets the number of milliseconds for timeout of network operations + * Default is 60 seconds. + * Only increments of 1000 ms are supported. No function is gaurenteed + * to return in a fraction of a second. * * @param handle NdbMgmHandle - * @param rw_milliseconds number of milliseconds + * @param timeout_ms number of milliseconds * @return zero on success */ - int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int rw_milliseconds); + int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int timeout_ms); /** * Connects to a management server. Connectstring is set by diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index 5671bf1561d..9db3a6e6004 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -91,9 +91,7 @@ struct ndb_mgm_handle { int last_error; int last_error_line; char last_error_desc[NDB_MGM_MAX_ERR_DESC_SIZE]; - int read_timeout; - int write_timeout; - unsigned int connect_timeout; + unsigned int timeout; NDB_SOCKET_TYPE socket; @@ -187,9 +185,7 @@ ndb_mgm_create_handle() h->last_error = 0; h->last_error_line = 0; h->socket = NDB_INVALID_SOCKET; - h->read_timeout = 50000; - h->write_timeout = 100; - h->connect_timeout = 0; + h->timeout = 60000; h->cfg_i = -1; h->errstream = stdout; h->m_name = 0; @@ -346,8 +342,8 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow *command_reply, DBUG_ENTER("ndb_mgm_call"); DBUG_PRINT("enter",("handle->socket: %d, cmd: %s", handle->socket, cmd)); - SocketOutputStream out(handle->socket, handle->write_timeout); - SocketInputStream in(handle->socket, handle->read_timeout); + SocketOutputStream out(handle->socket, handle->timeout); + SocketInputStream in(handle->socket, handle->timeout); out.println(cmd); #ifdef MGMAPI_LOG @@ -469,20 +465,17 @@ int ndb_mgm_is_connected(NdbMgmHandle handle) extern "C" int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds) { - if(!handle) - return -1; - - handle->connect_timeout= seconds; + return ndb_mgm_set_timeout(handle, seconds*1000); return 0; } extern "C" -int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int rw_milliseconds) +int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int timeout_ms) { if(!handle) return -1; - handle->read_timeout= handle->write_timeout= rw_milliseconds; + handle->timeout= timeout_ms; return 0; } @@ -515,7 +508,7 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries, NDB_SOCKET_TYPE sockfd= NDB_INVALID_SOCKET; Uint32 i; SocketClient s(0, 0); - s.set_connect_timeout(handle->connect_timeout); + s.set_connect_timeout(handle->timeout); if (!s.init()) { fprintf(handle->errstream, @@ -825,8 +818,8 @@ ndb_mgm_get_status(NdbMgmHandle handle) CHECK_HANDLE(handle, NULL); CHECK_CONNECTED(handle, NULL); - SocketOutputStream out(handle->socket, handle->write_timeout); - SocketInputStream in(handle->socket, handle->read_timeout); + SocketOutputStream out(handle->socket, handle->timeout); + SocketInputStream in(handle->socket, handle->timeout); out.println("get status"); out.println(""); @@ -1226,10 +1219,10 @@ ndb_mgm_restart3(NdbMgmHandle handle, int no_of_nodes, const int * node_list, args.put("initialstart", initial); args.put("nostart", nostart); const Properties *reply; - const int timeout = handle->read_timeout; - handle->read_timeout= 5*60*1000; // 5 minutes + const int timeout = handle->timeout; + handle->timeout= 5*60*1000; // 5 minutes reply = ndb_mgm_call(handle, restart_reply_v1, "restart all", &args); - handle->read_timeout= timeout; + handle->timeout= timeout; CHECK_REPLY(handle, reply, -1); BaseString result; @@ -1262,13 +1255,13 @@ ndb_mgm_restart3(NdbMgmHandle handle, int no_of_nodes, const int * node_list, args.put("nostart", nostart); const Properties *reply; - const int timeout = handle->read_timeout; - handle->read_timeout= 5*60*1000; // 5 minutes + const int timeout = handle->timeout; + handle->timeout= 5*60*1000; // 5 minutes if(use_v2) reply = ndb_mgm_call(handle, restart_reply_v2, "restart node v2", &args); else reply = ndb_mgm_call(handle, restart_reply_v1, "restart node", &args); - handle->read_timeout= timeout; + handle->timeout= timeout; if(reply != NULL) { BaseString result; reply->get("result", result); @@ -2038,13 +2031,13 @@ ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, args.put("completed", wait_completed); const Properties *reply; { // start backup can take some time, set timeout high - Uint64 old_timeout= handle->read_timeout; + Uint64 old_timeout= handle->timeout; if (wait_completed == 2) - handle->read_timeout= 48*60*60*1000; // 48 hours + handle->timeout= 48*60*60*1000; // 48 hours else if (wait_completed == 1) - handle->read_timeout= 10*60*1000; // 10 minutes + handle->timeout= 10*60*1000; // 10 minutes reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); - handle->read_timeout= old_timeout; + handle->timeout= old_timeout; } CHECK_REPLY(handle, reply, -1); @@ -2151,7 +2144,7 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) { int read = 0; size_t start = 0; do { - if((read = read_socket(handle->socket, handle->read_timeout, + if((read = read_socket(handle->socket, handle->timeout, &buf64[start], len-start)) < 1){ delete[] buf64; buf64 = 0; @@ -2484,8 +2477,8 @@ int ndb_mgm_check_connection(NdbMgmHandle handle){ CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); - SocketOutputStream out(handle->socket, handle->write_timeout); - SocketInputStream in(handle->socket, handle->read_timeout); + SocketOutputStream out(handle->socket, handle->timeout); + SocketInputStream in(handle->socket, handle->timeout); char buf[32]; if (out.println("check connection")) goto ndb_mgm_check_connection_error; @@ -2614,7 +2607,7 @@ ndb_mgm_convert_to_transporter(NdbMgmHandle *handle) (*handle)->connected= 0; // we pretend we're disconnected s= (*handle)->socket; - SocketOutputStream s_output(s, (*handle)->write_timeout); + SocketOutputStream s_output(s, (*handle)->timeout); s_output.println("transporter connect"); s_output.println(""); @@ -2690,11 +2683,11 @@ int ndb_mgm_end_session(NdbMgmHandle handle) CHECK_CONNECTED(handle, 0); DBUG_ENTER("ndb_mgm_end_session"); - SocketOutputStream s_output(handle->socket, handle->write_timeout); + SocketOutputStream s_output(handle->socket, handle->timeout); s_output.println("end session"); s_output.println(""); - SocketInputStream in(handle->socket, handle->read_timeout); + SocketInputStream in(handle->socket, handle->timeout); char buf[32]; in.gets(buf, sizeof(buf)); CHECK_TIMEDOUT_RET(handle, in, s_output, -1); From c59722ad839db68b751e2f9be64671edc95cefab Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:34:55 +1100 Subject: [PATCH 283/789] [PATCH] WL#3704 mgmapi timeouts: clarify multiple mgmd connect timeout semantics Index: ndb-work/storage/ndb/include/mgmapi/mgmapi.h =================================================================== storage/ndb/include/mgmapi/mgmapi.h: WL#3704 mgmapi timeouts: clarify multiple mgmd connect timeout semantics storage/ndb/src/mgmapi/mgmapi.cpp: WL#3704 mgmapi timeouts: clarify multiple mgmd connect timeout semantics --- storage/ndb/include/mgmapi/mgmapi.h | 17 +++++++++++++++++ storage/ndb/src/mgmapi/mgmapi.cpp | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/storage/ndb/include/mgmapi/mgmapi.h b/storage/ndb/include/mgmapi/mgmapi.h index f862dd72f9b..2bedba963e2 100644 --- a/storage/ndb/include/mgmapi/mgmapi.h +++ b/storage/ndb/include/mgmapi/mgmapi.h @@ -515,6 +515,18 @@ extern "C" { int ndb_mgm_set_connectstring(NdbMgmHandle handle, const char *connect_string); + /** + * Returns the number of management servers in the connect string + * (as set by ndb_mgm_set_connectstring()). This can be used + * to help work out how long the maximum amount of time that + * ndb_mgm_connect can take. + * + * @param handle Management handle + * + * @return < 0 on error + */ + int ndb_mgm_number_of_mgmd_in_connect_string(NdbMgmHandle handle); + int ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid); int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle); int ndb_mgm_get_connected_port(NdbMgmHandle handle); @@ -570,6 +582,11 @@ extern "C" { * Connects to a management server. Connectstring is set by * ndb_mgm_set_connectstring(). * + * The timeout value is for connect to each management server. + * Use ndb_mgm_number_of_mgmd_in_connect_string to work out + * the approximate maximum amount of time that could be spent in this + * function. + * * @param handle Management handle. * @param no_retries Number of retries to connect * (0 means connect once). diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index 9db3a6e6004..35c591ddf3d 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -479,6 +479,22 @@ int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int timeout_ms) return 0; } +extern "C" +int ndb_mgm_number_of_mgmd_in_connect_string(NdbMgmHandle handle) +{ + int count=0; + int i; + LocalConfig &cfg= handle->cfg; + + for (i = 0; i < cfg.ids.size(); i++) + { + if (cfg.ids[i].type != MgmId_TCP) + continue; + count++; + } + return count; +} + /** * Connect to a management server */ From aa8b15b70b80f6c33c05a1aaf3d926bf10715525 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:35:07 +1100 Subject: [PATCH 284/789] [PATCH] WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request use portable method, getting milliseconds between calls - Linux would let us do funky stuff by getting the timeout from select(2). Everywhere else sucks and doesn't let us do that :( Index: ndb-work/storage/ndb/include/util/InputStream.hpp =================================================================== storage/ndb/include/util/InputStream.hpp: WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request storage/ndb/include/util/OutputStream.hpp: WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request storage/ndb/include/util/socket_io.h: WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request storage/ndb/src/common/util/InputStream.cpp: WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request storage/ndb/src/common/util/OutputStream.cpp: WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request storage/ndb/src/common/util/socket_io.cpp: WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: Change to have total timeout for call, not per request --- storage/ndb/include/util/InputStream.hpp | 1 + storage/ndb/include/util/OutputStream.hpp | 1 + storage/ndb/include/util/socket_io.h | 17 +++++--- storage/ndb/src/common/util/InputStream.cpp | 11 +++-- storage/ndb/src/common/util/OutputStream.cpp | 22 +++++++--- storage/ndb/src/common/util/socket_io.cpp | 44 +++++++++++++------- storage/ndb/src/mgmsrv/Services.cpp | 43 ++++++++++--------- 7 files changed, 91 insertions(+), 48 deletions(-) diff --git a/storage/ndb/include/util/InputStream.hpp b/storage/ndb/include/util/InputStream.hpp index 4aabf2d1160..2b0e6cfc5b9 100644 --- a/storage/ndb/include/util/InputStream.hpp +++ b/storage/ndb/include/util/InputStream.hpp @@ -49,6 +49,7 @@ extern FileInputStream Stdin; class SocketInputStream : public InputStream { NDB_SOCKET_TYPE m_socket; unsigned m_timeout_ms; + unsigned m_timeout_remain; bool m_startover; bool m_timedout; public: diff --git a/storage/ndb/include/util/OutputStream.hpp b/storage/ndb/include/util/OutputStream.hpp index 072d4288229..13975cada3e 100644 --- a/storage/ndb/include/util/OutputStream.hpp +++ b/storage/ndb/include/util/OutputStream.hpp @@ -46,6 +46,7 @@ class SocketOutputStream : public OutputStream { NDB_SOCKET_TYPE m_socket; unsigned m_timeout_ms; bool m_timedout; + unsigned m_timeout_remain; public: SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned write_timeout_ms = 1000); virtual ~SocketOutputStream() {} diff --git a/storage/ndb/include/util/socket_io.h b/storage/ndb/include/util/socket_io.h index a988f4a1e8d..f76b6790b19 100644 --- a/storage/ndb/include/util/socket_io.h +++ b/storage/ndb/include/util/socket_io.h @@ -28,15 +28,20 @@ extern "C" { int read_socket(NDB_SOCKET_TYPE, int timeout_ms, char *, int len); - int readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, + int readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, int *time, char * buf, int buflen, NdbMutex *mutex); - int write_socket(NDB_SOCKET_TYPE, int timeout_ms, const char[], int len); + int write_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time, + const char[], int len); - int print_socket(NDB_SOCKET_TYPE, int timeout_ms, const char *, ...); - int println_socket(NDB_SOCKET_TYPE, int timeout_ms, const char *, ...); - int vprint_socket(NDB_SOCKET_TYPE, int timeout_ms, const char *, va_list); - int vprintln_socket(NDB_SOCKET_TYPE, int timeout_ms, const char *, va_list); + int print_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time, + const char *, ...); + int println_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time, + const char *, ...); + int vprint_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time, + const char *, va_list); + int vprintln_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time, + const char *, va_list); #ifdef __cplusplus } diff --git a/storage/ndb/src/common/util/InputStream.cpp b/storage/ndb/src/common/util/InputStream.cpp index ee7f2d5c8b2..2337344d91a 100644 --- a/storage/ndb/src/common/util/InputStream.cpp +++ b/storage/ndb/src/common/util/InputStream.cpp @@ -37,7 +37,8 @@ SocketInputStream::SocketInputStream(NDB_SOCKET_TYPE socket, unsigned read_timeout_ms) : m_socket(socket) { m_startover= true; - m_timeout_ms = read_timeout_ms; + m_timeout_remain= m_timeout_ms = read_timeout_ms; + m_timedout= false; } @@ -55,9 +56,13 @@ SocketInputStream::gets(char * buf, int bufLen) { else offset= strlen(buf); - int res = readln_socket(m_socket, m_timeout_ms, buf+offset, bufLen-offset, m_mutex); + int time= 0; + int res = readln_socket(m_socket, m_timeout_remain, &time, + buf+offset, bufLen-offset, m_mutex); - if(res == 0) + if(res >= 0) + m_timeout_remain-=time; + if(res == 0 || m_timeout_remain<=0) { m_timedout= true; buf[0]=0; diff --git a/storage/ndb/src/common/util/OutputStream.cpp b/storage/ndb/src/common/util/OutputStream.cpp index ebc352b1b50..0943e47e33f 100644 --- a/storage/ndb/src/common/util/OutputStream.cpp +++ b/storage/ndb/src/common/util/OutputStream.cpp @@ -44,7 +44,7 @@ FileOutputStream::println(const char * fmt, ...){ SocketOutputStream::SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned write_timeout_ms){ m_socket = socket; - m_timeout_ms = write_timeout_ms; + m_timeout_remain= m_timeout_ms = write_timeout_ms; m_timedout= false; } @@ -55,12 +55,18 @@ SocketOutputStream::print(const char * fmt, ...){ if(timedout()) return -1; + int time= 0; va_start(ap, fmt); - const int ret = vprint_socket(m_socket, m_timeout_ms, fmt, ap); + int ret = vprint_socket(m_socket, m_timeout_ms, &time, fmt, ap); va_end(ap); - if (errno==ETIMEDOUT) + if(ret >= 0) + m_timeout_remain-=time; + if(errno==ETIMEDOUT || m_timeout_remain<=0) + { m_timedout= true; + ret= -1; + } return ret; } @@ -71,12 +77,18 @@ SocketOutputStream::println(const char * fmt, ...){ if(timedout()) return -1; + int time= 0; va_start(ap, fmt); - const int ret = vprintln_socket(m_socket, m_timeout_ms, fmt, ap); + int ret = vprintln_socket(m_socket, m_timeout_ms, &time, fmt, ap); va_end(ap); - if (errno==ETIMEDOUT) + if(ret >= 0) + m_timeout_remain-=time; + if (errno==ETIMEDOUT || m_timeout_remain<=0) + { m_timedout= true; + ret= -1; + } return ret; } diff --git a/storage/ndb/src/common/util/socket_io.cpp b/storage/ndb/src/common/util/socket_io.cpp index d19c792e20f..dfdcd19412f 100644 --- a/storage/ndb/src/common/util/socket_io.cpp +++ b/storage/ndb/src/common/util/socket_io.cpp @@ -18,6 +18,7 @@ #include #include #include +#include extern "C" int @@ -47,7 +48,7 @@ read_socket(NDB_SOCKET_TYPE socket, int timeout_millis, extern "C" int -readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, +readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, int *time, char * buf, int buflen, NdbMutex *mutex){ if(buflen <= 1) return 0; @@ -62,7 +63,10 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, if(mutex) NdbMutex_Unlock(mutex); + Uint64 tick= NdbTick_CurrentMillisecond(); const int selectRes = select(socket + 1, &readset, 0, 0, &timeout); + + *time= NdbTick_CurrentMillisecond() - tick; if(mutex) NdbMutex_Lock(mutex); @@ -126,9 +130,13 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, FD_ZERO(&readset); FD_SET(socket, &readset); - timeout.tv_sec = (timeout_millis / 1000); - timeout.tv_usec = (timeout_millis % 1000) * 1000; + timeout.tv_sec = ((timeout_millis - *time) / 1000); + timeout.tv_usec = ((timeout_millis - *time) % 1000) * 1000; + + tick= NdbTick_CurrentMillisecond(); const int selectRes = select(socket + 1, &readset, 0, 0, &timeout); + *time= NdbTick_CurrentMillisecond() - tick; + if(selectRes != 1){ return -1; } @@ -139,7 +147,7 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, extern "C" int -write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, +write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, int *time, const char buf[], int len){ fd_set writeset; FD_ZERO(&writeset); @@ -148,7 +156,11 @@ write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, timeout.tv_sec = (timeout_millis / 1000); timeout.tv_usec = (timeout_millis % 1000) * 1000; + + Uint64 tick= NdbTick_CurrentMillisecond(); const int selectRes = select(socket + 1, 0, &writeset, 0, &timeout); + *time= NdbTick_CurrentMillisecond() - tick; + if(selectRes != 1){ return -1; } @@ -167,9 +179,13 @@ write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, FD_ZERO(&writeset); FD_SET(socket, &writeset); - timeout.tv_sec = 1; - timeout.tv_usec = 0; + timeout.tv_sec = ((timeout_millis - *time) / 1000); + timeout.tv_usec = ((timeout_millis - *time) % 1000) * 1000; + + Uint64 tick= NdbTick_CurrentMillisecond(); const int selectRes2 = select(socket + 1, 0, &writeset, 0, &timeout); + *time= NdbTick_CurrentMillisecond() - tick; + if(selectRes2 != 1){ return -1; } @@ -180,11 +196,11 @@ write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, extern "C" int -print_socket(NDB_SOCKET_TYPE socket, int timeout_millis, +print_socket(NDB_SOCKET_TYPE socket, int timeout_millis, int *time, const char * fmt, ...){ va_list ap; va_start(ap, fmt); - int ret = vprint_socket(socket, timeout_millis, fmt, ap); + int ret = vprint_socket(socket, timeout_millis, time, fmt, ap); va_end(ap); return ret; @@ -192,18 +208,18 @@ print_socket(NDB_SOCKET_TYPE socket, int timeout_millis, extern "C" int -println_socket(NDB_SOCKET_TYPE socket, int timeout_millis, +println_socket(NDB_SOCKET_TYPE socket, int timeout_millis, int *time, const char * fmt, ...){ va_list ap; va_start(ap, fmt); - int ret = vprintln_socket(socket, timeout_millis, fmt, ap); + int ret = vprintln_socket(socket, timeout_millis, time, fmt, ap); va_end(ap); return ret; } extern "C" int -vprint_socket(NDB_SOCKET_TYPE socket, int timeout_millis, +vprint_socket(NDB_SOCKET_TYPE socket, int timeout_millis, int *time, const char * fmt, va_list ap){ char buf[1000]; char *buf2 = buf; @@ -221,7 +237,7 @@ vprint_socket(NDB_SOCKET_TYPE socket, int timeout_millis, } else return 0; - int ret = write_socket(socket, timeout_millis, buf2, size); + int ret = write_socket(socket, timeout_millis, time, buf2, size); if(buf2 != buf) free(buf2); return ret; @@ -229,7 +245,7 @@ vprint_socket(NDB_SOCKET_TYPE socket, int timeout_millis, extern "C" int -vprintln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, +vprintln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, int *time, const char * fmt, va_list ap){ char buf[1000]; char *buf2 = buf; @@ -249,7 +265,7 @@ vprintln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, } buf2[size-1]='\n'; - int ret = write_socket(socket, timeout_millis, buf2, size); + int ret = write_socket(socket, timeout_millis, time, buf2, size); if(buf2 != buf) free(buf2); return ret; diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index d39c4945f69..c658d5f0d6f 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -1334,20 +1334,21 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) { if(threshold <= m_clients[i].m_logLevel.getLogLevel(cat)) { - NDB_SOCKET_TYPE fd= m_clients[i].m_socket; - if(fd != NDB_INVALID_SOCKET) + if(m_clients[i].m_socket==NDB_INVALID_SOCKET) + continue; + + SocketOutputStream out(m_clients[i].m_socket); + + int r; + if (m_clients[i].m_parsable) + r= out.println(str.c_str()); + else + r= out.println(m_text); + + if (r<0) { - int r; - if (m_clients[i].m_parsable) - r= println_socket(fd, - MAX_WRITE_TIMEOUT, str.c_str()); - else - r= println_socket(fd, - MAX_WRITE_TIMEOUT, m_text); - if (r == -1) { - copy.push_back(fd); - m_clients.erase(i, false); - } + copy.push_back(m_clients[i].m_socket); + m_clients.erase(i, false); } } } @@ -1398,14 +1399,16 @@ Ndb_mgmd_event_service::check_listeners() m_clients.lock(); for(i= m_clients.size() - 1; i >= 0; i--) { - int fd= m_clients[i].m_socket; - DBUG_PRINT("info",("%d %d",i,fd)); - char buf[1]; - buf[0]=0; - if (fd != NDB_INVALID_SOCKET && - println_socket(fd,MAX_WRITE_TIMEOUT,"") == -1) + if(m_clients[i].m_socket==NDB_INVALID_SOCKET) + continue; + + SocketOutputStream out(m_clients[i].m_socket); + + DBUG_PRINT("info",("%d %d",i,m_clients[i].m_socket)); + + if(out.println("") < 0) { - NDB_CLOSE_SOCKET(fd); + NDB_CLOSE_SOCKET(m_clients[i].m_socket); m_clients.erase(i, false); n=1; } From a69b2aa7d4fae14cb042e32df3d005aa90c406c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:35:19 +1100 Subject: [PATCH 285/789] [PATCH] WL#3704 mgmapi timeouts: use timeouts in mgm client as side effect - turbo accellerator patch for ndb_mgm - sholud make it quicker... so that 4mhz cpu will seem even faster. Index: ndb-work/storage/ndb/src/mgmclient/CommandInterpreter.cpp =================================================================== storage/ndb/src/mgmclient/CommandInterpreter.cpp: WL#3704 mgmapi timeouts: use timeouts in mgm client --- storage/ndb/src/mgmclient/CommandInterpreter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/storage/ndb/src/mgmclient/CommandInterpreter.cpp b/storage/ndb/src/mgmclient/CommandInterpreter.cpp index fdcea63640c..793b2e3cc98 100644 --- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp @@ -726,10 +726,9 @@ event_thread_run(void* p) do_event_thread= 1; char *tmp= 0; char buf[1024]; - SocketInputStream in(fd,10); do { - if (tmp == 0) NdbSleep_MilliSleep(10); - if((tmp = in.gets(buf, 1024))) + SocketInputStream in(fd,2000); + if((tmp = in.gets(buf, sizeof(buf)))) { const char ping_token[]= ""; if (memcmp(ping_token,tmp,sizeof(ping_token)-1)) @@ -739,6 +738,10 @@ event_thread_run(void* p) ndbout << tmp; } } + else if(in.timedout() && ndb_mgm_check_connection(handle)<0) + { + break; + } } while(do_event_thread); NDB_CLOSE_SOCKET(fd); } From 09bbc265078a601bb1056389b358a8a8828b33fc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:35:31 +1100 Subject: [PATCH 286/789] [PATCH] WL#3704 mgmapi timeouts: update NDBAPI usage of mgmapi for timeouts Default timout of 30secs for ConfigRetriever Default timout of 5sec for use by Transporter (ports etc). And Ndb_cluster_connection::set_timeout() api for setting timeout from NDBAPI applications. Should be called before connect. e.g. c.set_timeout(4200); c.connect(); Index: ndb-work/storage/ndb/include/mgmcommon/ConfigRetriever.hpp =================================================================== storage/ndb/include/mgmcommon/ConfigRetriever.hpp: WL#3704 mgmapi timeouts: update NDBAPI usage of mgmapi for timeouts storage/ndb/include/ndbapi/ndb_cluster_connection.hpp: WL#3704 mgmapi timeouts: update NDBAPI usage of mgmapi for timeouts storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: WL#3704 mgmapi timeouts: update NDBAPI usage of mgmapi for timeouts storage/ndb/src/common/transporter/TransporterRegistry.cpp: WL#3704 mgmapi timeouts: update NDBAPI usage of mgmapi for timeouts storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: WL#3704 mgmapi timeouts: update NDBAPI usage of mgmapi for timeouts --- .../ndb/include/mgmcommon/ConfigRetriever.hpp | 3 ++- .../include/ndbapi/ndb_cluster_connection.hpp | 18 ++++++++++++++++++ .../src/common/mgmcommon/ConfigRetriever.cpp | 5 ++++- .../common/transporter/TransporterRegistry.cpp | 1 + .../ndb/src/ndbapi/ndb_cluster_connection.cpp | 7 +++++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/storage/ndb/include/mgmcommon/ConfigRetriever.hpp b/storage/ndb/include/mgmcommon/ConfigRetriever.hpp index 221e24d0572..27a189c1563 100644 --- a/storage/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/storage/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -28,7 +28,8 @@ class ConfigRetriever { public: ConfigRetriever(const char * _connect_string, Uint32 version, Uint32 nodeType, - const char * _bind_address = 0); + const char * _bind_address = 0, + int timeout_ms = 30000); ~ConfigRetriever(); int do_connect(int no_retries, int retry_delay_in_seconds, int verbose); diff --git a/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp b/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp index e3532b072c0..80bfe7461f8 100644 --- a/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -61,6 +61,24 @@ public: */ void set_name(const char *name); + /** + * Set timeout + * + * Used as a timeout when talking to the management server, + * helps limit the amount of time that we may block when connecting + * + * Basically just calls ndb_mgm_set_timeout(h,ms). + * + * The default is 30 seconds. + * + * @param timeout_ms millisecond timeout. As with ndb_mgm_set_timeout, + * only increments of 1000 are really supported, + * with not to much gaurentees about calls completing + * in any hard amount of time. + * @return 0 on success + */ + int set_timeout(int timeout_ms); + /** * Connect to a cluster management server * diff --git a/storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp index bcb13f38c72..35b1a91e9da 100644 --- a/storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -45,7 +45,8 @@ ConfigRetriever::ConfigRetriever(const char * _connect_string, Uint32 version, Uint32 node_type, - const char * _bindaddress) + const char * _bindaddress, + int timeout_ms) { DBUG_ENTER("ConfigRetriever::ConfigRetriever"); @@ -61,6 +62,8 @@ ConfigRetriever::ConfigRetriever(const char * _connect_string, DBUG_VOID_RETURN; } + ndb_mgm_set_timeout(m_handle, timeout_ms); + if (ndb_mgm_set_connectstring(m_handle, _connect_string)) { BaseString tmp(ndb_mgm_get_latest_error_msg(m_handle)); diff --git a/storage/ndb/src/common/transporter/TransporterRegistry.cpp b/storage/ndb/src/common/transporter/TransporterRegistry.cpp index 8ff95d1115e..0d4e9b49a5b 100644 --- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp @@ -119,6 +119,7 @@ void TransporterRegistry::set_mgm_handle(NdbMgmHandle h) if (m_mgm_handle) ndb_mgm_destroy_handle(&m_mgm_handle); m_mgm_handle= h; + ndb_mgm_set_timeout(m_mgm_handle, 5000); #ifndef DBUG_OFF if (h) { diff --git a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp index 24ac05caf07..a6c7c917ee2 100644 --- a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -666,5 +666,12 @@ Ndb_cluster_connection::get_active_ndb_objects() const { return m_impl.m_transporter_facade->get_active_ndb_objects(); } + +int Ndb_cluster_connection::set_timeout(int timeout_ms) +{ + return ndb_mgm_set_timeout(m_impl.m_config_retriever->get_mgmHandle(), + timeout_ms); +} + template class Vector; From 5c529b66754fe837283be3749e1a38309e29a42b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:35:43 +1100 Subject: [PATCH 287/789] [PATCH] WL#3704 mgmapi timeouts: Add MGMAPI tests to autotest daily run Index: ndb-work/storage/ndb/test/run-test/daily-basic-tests.txt =================================================================== storage/ndb/test/run-test/daily-basic-tests.txt: WL#3704 mgmapi timeouts: Add MGMAPI tests to autotest daily run --- .../ndb/test/run-test/daily-basic-tests.txt | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index c0b83d4594d..98c63cdf813 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -842,3 +842,31 @@ cmd: DbAsyncGenerator args: -time 60 -p 1 -proc 25 type: bench +max-time: 120 +cmd: testMgm +args: -n ApiSessionFailure T1 + +max-time: 120 +cmd: testMgm +args: -n ApiTimeoutBasic T1 + +max-time: 120 +cmd: testMgm +args: -n ApiSessionFailure T1 + +max-time: 120 +cmd: testMgm +args: -n ApiGetStatusTimeout T1 + +max-time: 120 +cmd: testMgm +args: -n ApiGetConfigTimeout T1 + +max-time: 120 +cmd: testMgm +args: -n ApiMgmEventTimeout T1 + +max-time: 120 +cmd: testMgm +args: -n ApiMgmStructEventTimeout T1 + From c4dd23f74a06bf1f2ee939cf650965e13ada77d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:35:55 +1100 Subject: [PATCH 288/789] [PATCH] WL#3704 mgmapi timeouts: Correct cpc client usage of Socket Input/OutputStream for timeouts Index: ndb-work/storage/ndb/include/util/InputStream.hpp =================================================================== storage/ndb/include/util/InputStream.hpp: WL#3704 mgmapi timeouts: Correct cpc client usage of Socket Input/OutputStream for timeouts storage/ndb/test/include/CpcClient.hpp: WL#3704 mgmapi timeouts: Correct cpc client usage of Socket Input/OutputStream for timeouts storage/ndb/test/src/CpcClient.cpp: WL#3704 mgmapi timeouts: Correct cpc client usage of Socket Input/OutputStream for timeouts --- storage/ndb/include/util/InputStream.hpp | 2 +- storage/ndb/test/include/CpcClient.hpp | 2 -- storage/ndb/test/src/CpcClient.cpp | 26 ++++++++---------------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/storage/ndb/include/util/InputStream.hpp b/storage/ndb/include/util/InputStream.hpp index 2b0e6cfc5b9..746fb7904a4 100644 --- a/storage/ndb/include/util/InputStream.hpp +++ b/storage/ndb/include/util/InputStream.hpp @@ -53,7 +53,7 @@ class SocketInputStream : public InputStream { bool m_startover; bool m_timedout; public: - SocketInputStream(NDB_SOCKET_TYPE socket, unsigned read_timeout_ms = 1000); + SocketInputStream(NDB_SOCKET_TYPE socket, unsigned read_timeout_ms = 60000); virtual ~SocketInputStream() {} char* gets(char * buf, int bufLen); bool timedout() { return m_timedout; }; diff --git a/storage/ndb/test/include/CpcClient.hpp b/storage/ndb/test/include/CpcClient.hpp index 62f016f8e1d..a743499566f 100644 --- a/storage/ndb/test/include/CpcClient.hpp +++ b/storage/ndb/test/include/CpcClient.hpp @@ -70,8 +70,6 @@ private: char *host; int port; NDB_SOCKET_TYPE cpc_sock; - InputStream *cpc_in; - OutputStream *cpc_out; public: int connect(); diff --git a/storage/ndb/test/src/CpcClient.cpp b/storage/ndb/test/src/CpcClient.cpp index 51f2fb4cf4d..d5dfd01327e 100644 --- a/storage/ndb/test/src/CpcClient.cpp +++ b/storage/ndb/test/src/CpcClient.cpp @@ -428,8 +428,6 @@ SimpleCpcClient::SimpleCpcClient(const char *_host, int _port) { host = strdup(_host); port = _port; cpc_sock = -1; - cpc_in = NULL; - cpc_out = NULL; } SimpleCpcClient::~SimpleCpcClient() { @@ -444,12 +442,6 @@ SimpleCpcClient::~SimpleCpcClient() { close(cpc_sock); cpc_sock = -1; } - - if(cpc_in != NULL) - delete cpc_in; - - if(cpc_out != NULL) - delete cpc_out; } int @@ -475,17 +467,15 @@ SimpleCpcClient::connect() { if (::connect(cpc_sock, (struct sockaddr*) &sa, sizeof(sa)) < 0) return -1; - cpc_in = new SocketInputStream(cpc_sock, 60000); - cpc_out = new SocketOutputStream(cpc_sock); - return 0; } int SimpleCpcClient::cpc_send(const char *cmd, const Properties &args) { - - cpc_out->println(cmd); + SocketOutputStream cpc_out(cpc_sock); + + cpc_out.println(cmd); Properties::Iterator iter(&args); const char *name; @@ -498,18 +488,18 @@ SimpleCpcClient::cpc_send(const char *cmd, switch(t) { case PropertiesType_Uint32: args.get(name, &val_i); - cpc_out->println("%s: %d", name, val_i); + cpc_out.println("%s: %d", name, val_i); break; case PropertiesType_char: args.get(name, val_s); - cpc_out->println("%s: %s", name, val_s.c_str()); + cpc_out.println("%s: %s", name, val_s.c_str()); break; default: /* Silently ignore */ break; } } - cpc_out->println(""); + cpc_out.println(""); return 0; } @@ -523,9 +513,11 @@ SimpleCpcClient::Parser_t::ParserStatus SimpleCpcClient::cpc_recv(const ParserRow_t *syntax, const Properties **reply, void **user_value) { + SocketInputStream cpc_in(cpc_sock); + Parser_t::Context ctx; ParserDummy session(cpc_sock); - Parser_t parser(syntax, *cpc_in, true, true, true); + Parser_t parser(syntax, cpc_in, true, true, true); *reply = parser.parse(ctx, session); if(user_value != NULL) *user_value = ctx.m_currentCmd->user_value; From 7e00600a40b0a77ab8416cc171de4ca26059c3a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:36:07 +1100 Subject: [PATCH 289/789] [PATCH] WL#3704 mgmapi timeouts: For mgm server, have timeout per operation, not for entire connection (i.e. fix the bug) for TransporterRegistry, keep connection to management server alive. Index: ndb-work/storage/ndb/include/util/InputStream.hpp =================================================================== storage/ndb/include/util/InputStream.hpp: WL#3704 mgmapi timeouts: For mgm server, have timeout per operation, not for entire connection (i.e. fix the bug) storage/ndb/include/util/OutputStream.hpp: WL#3704 mgmapi timeouts: For mgm server, have timeout per operation, not for entire connection (i.e. fix the bug) storage/ndb/src/common/transporter/TransporterRegistry.cpp: WL#3704 mgmapi timeouts: For mgm server, have timeout per operation, not for entire connection (i.e. fix the bug) storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: For mgm server, have timeout per operation, not for entire connection (i.e. fix the bug) --- storage/ndb/include/util/InputStream.hpp | 3 ++- storage/ndb/include/util/OutputStream.hpp | 3 ++- .../src/common/transporter/TransporterRegistry.cpp | 14 +++++++++++++- storage/ndb/src/mgmsrv/Services.cpp | 3 +++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/storage/ndb/include/util/InputStream.hpp b/storage/ndb/include/util/InputStream.hpp index 746fb7904a4..3e696eac732 100644 --- a/storage/ndb/include/util/InputStream.hpp +++ b/storage/ndb/include/util/InputStream.hpp @@ -32,6 +32,7 @@ public: * Set the mutex to be UNLOCKED when blocking (e.g. select(2)) */ void set_mutex(NdbMutex *m) { m_mutex= m; }; + virtual void reset_timeout() {}; protected: NdbMutex *m_mutex; }; @@ -57,7 +58,7 @@ public: virtual ~SocketInputStream() {} char* gets(char * buf, int bufLen); bool timedout() { return m_timedout; }; - void reset_timeout() { m_timedout= false; }; + void reset_timeout() { m_timedout= false; m_timeout_remain= m_timeout_ms;}; }; diff --git a/storage/ndb/include/util/OutputStream.hpp b/storage/ndb/include/util/OutputStream.hpp index 13975cada3e..7f75283475f 100644 --- a/storage/ndb/include/util/OutputStream.hpp +++ b/storage/ndb/include/util/OutputStream.hpp @@ -29,6 +29,7 @@ public: virtual int print(const char * fmt, ...) = 0; virtual int println(const char * fmt, ...) = 0; virtual void flush() {}; + virtual void reset_timeout() {}; }; class FileOutputStream : public OutputStream { @@ -51,7 +52,7 @@ public: SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned write_timeout_ms = 1000); virtual ~SocketOutputStream() {} bool timedout() { return m_timedout; }; - void reset_timeout() { m_timedout= false; }; + void reset_timeout() { m_timedout= false; m_timeout_remain= m_timeout_ms;}; int print(const char * fmt, ...); int println(const char * fmt, ...); diff --git a/storage/ndb/src/common/transporter/TransporterRegistry.cpp b/storage/ndb/src/common/transporter/TransporterRegistry.cpp index 0d4e9b49a5b..f35217a9726 100644 --- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1059,9 +1059,16 @@ TransporterRegistry::update_connections() void TransporterRegistry::start_clients_thread() { + int persist_mgm_count= 0; DBUG_ENTER("TransporterRegistry::start_clients_thread"); while (m_run_start_clients_thread) { NdbSleep_MilliSleep(100); + persist_mgm_count++; + if(persist_mgm_count==50) + { + ndb_mgm_check_connection(m_mgm_handle); + persist_mgm_count= 0; + } for (int i= 0, n= 0; n < nTransporters && m_run_start_clients_thread; i++){ Transporter * t = theTransporters[i]; if (!t) @@ -1119,7 +1126,12 @@ TransporterRegistry::start_clients_thread() { g_eventLogger.info("Management server closed connection early. " "It is probably being shut down (or has problems). " - "We will retry the connection."); + "We will retry the connection. %d %s %s line: %d", + ndb_mgm_get_latest_error(m_mgm_handle), + ndb_mgm_get_latest_error_desc(m_mgm_handle), + ndb_mgm_get_latest_error_msg(m_mgm_handle), + ndb_mgm_get_latest_error_line(m_mgm_handle) + ); } } /** else diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index c658d5f0d6f..f260ff7e3ec 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -344,6 +344,9 @@ MgmApiSession::runSession() while(!stop) { NdbMutex_Lock(m_mutex); + m_input->reset_timeout(); + m_output->reset_timeout(); + m_parser->run(ctx, *this); if(ctx.m_currentToken == 0) From fd4862cf23a2fe8efd3f7292eb4d4032cb857a6a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:36:19 +1100 Subject: [PATCH 290/789] [PATCH] WL#3704 mgmapi timeouts: Fix infinite (0) timeout for ndb_logevent_get_next Index: ndb-work/storage/ndb/src/mgmapi/ndb_logevent.cpp =================================================================== storage/ndb/src/mgmapi/ndb_logevent.cpp: WL#3704 mgmapi timeouts: Fix infinite (0) timeout for ndb_logevent_get_next --- storage/ndb/src/mgmapi/ndb_logevent.cpp | 31 ++++++++++--------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/storage/ndb/src/mgmapi/ndb_logevent.cpp b/storage/ndb/src/mgmapi/ndb_logevent.cpp index 9963c24ce40..ed72db297ab 100644 --- a/storage/ndb/src/mgmapi/ndb_logevent.cpp +++ b/storage/ndb/src/mgmapi/ndb_logevent.cpp @@ -389,14 +389,18 @@ int ndb_logevent_get_next(const NdbLogEventHandle h, struct ndb_logevent *dst, unsigned timeout_in_milliseconds) { + if (timeout_in_milliseconds == 0) + { + int res; + while ((res = ndb_logevent_get_next(h, dst, 60000))==0); + return res; + } + SocketInputStream in(h->socket, timeout_in_milliseconds); Properties p; char buf[256]; - struct timeval start_time; - gettimeofday(&start_time, 0); - /* header */ while (1) { if (in.gets(buf,sizeof(buf)) == 0) @@ -409,24 +413,15 @@ int ndb_logevent_get_next(const NdbLogEventHandle h, // timed out return 0; } + if ( strcmp("log event reply\n", buf) == 0 ) break; if ( strcmp("\n", buf) ) ndbout_c("skipped: %s", buf); - struct timeval now; - gettimeofday(&now, 0); - unsigned elapsed_ms= (now.tv_sec-start_time.tv_sec)*1000 + - ((signed int)now.tv_usec-(signed int)start_time.tv_usec)/1000; - - if (elapsed_ms >= timeout_in_milliseconds) - { - // timed out - return 0; - } - - new (&in) SocketInputStream(h->socket, timeout_in_milliseconds-elapsed_ms); + if(in.timedout()) + return 0; } /* read name-value pairs into properties object */ @@ -437,11 +432,9 @@ int ndb_logevent_get_next(const NdbLogEventHandle h, h->m_error= NDB_LEH_READ_ERROR; return -1; } - if ( buf[0] == 0 ) - { - // timed out + if (in.timedout()) return 0; - } + if ( buf[0] == '\n' ) { break; From 38b044d49d96c0a8ceb8dcd1c598d8bc83a5acc8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:36:31 +1100 Subject: [PATCH 291/789] [PATCH] WL#3704 mgmapi timeouts: Print full error from mgmd in NdbRestarter errors Turns out they can be useful in working out what's going wrong. Index: ndb-work/storage/ndb/test/src/NdbRestarter.cpp =================================================================== storage/ndb/test/src/NdbRestarter.cpp: WL#3704 mgmapi timeouts: Print full error from mgmd in NdbRestarter errors --- storage/ndb/test/src/NdbRestarter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/ndb/test/src/NdbRestarter.cpp b/storage/ndb/test/src/NdbRestarter.cpp index 299517b32d3..1acd28dab23 100644 --- a/storage/ndb/test/src/NdbRestarter.cpp +++ b/storage/ndb/test/src/NdbRestarter.cpp @@ -26,6 +26,8 @@ #define MGMERR(h) \ ndbout << "latest_error="< Date: Thu, 22 Mar 2007 13:17:08 +0100 Subject: [PATCH 294/789] BUG#27044 bug fix of 27320 fixes this, added test case --- mysql-test/r/rpl_ndb_do_table.result | 4 ++++ mysql-test/t/rpl_ndb_do_table.test | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/mysql-test/r/rpl_ndb_do_table.result b/mysql-test/r/rpl_ndb_do_table.result index a5854985352..dda2844f6d0 100644 --- a/mysql-test/r/rpl_ndb_do_table.result +++ b/mysql-test/r/rpl_ndb_do_table.result @@ -19,4 +19,8 @@ t1 SELECT COUNT(*) FROM t1; COUNT(*) 3 +INSERT INTO t1 VALUES (3, repeat('bad',1)); +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +INSERT INTO t1 VALUES (3, repeat('bad too',1)); +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' DROP TABLE IF EXISTS t1, t2; diff --git a/mysql-test/t/rpl_ndb_do_table.test b/mysql-test/t/rpl_ndb_do_table.test index 278a326aefd..700c79766e1 100644 --- a/mysql-test/t/rpl_ndb_do_table.test +++ b/mysql-test/t/rpl_ndb_do_table.test @@ -27,6 +27,20 @@ INSERT INTO t2 VALUES(3, repeat('ghi',3000)); SHOW TABLES; SELECT COUNT(*) FROM t1; +# +# Bug #27044 replicated with unique field ndb table allows dup key inserts +# +connection master; + +--error ER_DUP_ENTRY_WITH_KEY_NAME +INSERT INTO t1 VALUES (3, repeat('bad',1)); + +connection slave; +--error ER_DUP_ENTRY_WITH_KEY_NAME +INSERT INTO t1 VALUES (3, repeat('bad too',1)); + +# cleanup + connection master; DROP TABLE IF EXISTS t1, t2; --sync_slave_with_master From 33da0f3736fe3b4bc2fed8ea585d5adf74d6b02b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 14:58:43 +0100 Subject: [PATCH 295/789] Bug#24791: Union with AVG-groups generates wrong results Patch appled after doing a pull from the team tree. Additional tests had to be fixed mysql-test/r/union.result: Bug 24791 The tests for temporary tables have been fixed. Since the call to display_length(Item) was removed from the constructor for Item_type_holder, items in temporary tables keep the original values of the items, rather than the magic numbers supplied by display_length. --- mysql-test/r/union.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 8219d68a681..efdd8195fb5 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -554,7 +554,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varbinary(20) NOT NULL default '' + `a` varbinary(2) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; @@ -655,7 +655,7 @@ f show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f` varbinary(24) default NULL + `f` varbinary(12) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT y from t2 UNION select da from t2; From 685d21b72f201a2eb16718e73c76e62ee708458d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 15:07:32 +0100 Subject: [PATCH 296/789] - renaming TMP_TABLE to NON_TRANSACTIONAL_TMP_TABLE because this is what it actually means (Monty approved the renaming) - correcting description of transaction_alloc command-line options (our manual is correct) - fix for a failure of rpl_trigger. mysql-test/t/rpl_misc_functions.test: test was cleaning up only on slave, but it's also needed on master, otherwise it influences rpl_trigger.test sql/lock.cc: clearer name sql/mysqld.cc: I checked the code that those two variables are not about binlogging but about the size of the transaction's memroot which is used to create savepoint structures and to store list of tables to be invalidated (for NDB). The manual has a correct description, no need to fix it. sql/sql_base.cc: clearer name sql/sql_derived.cc: clearer name sql/sql_select.cc: clearer name sql/table.h: clearer name: TMP_TABLE is used for non-transactional tables. --- mysql-test/t/rpl_misc_functions.test | 2 ++ sql/lock.cc | 8 ++++---- sql/mysqld.cc | 4 ++-- sql/sql_base.cc | 2 +- sql/sql_derived.cc | 2 +- sql/sql_select.cc | 2 +- sql/table.h | 3 ++- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test index 43ce3afc8ad..f00beff583a 100644 --- a/mysql-test/t/rpl_misc_functions.test +++ b/mysql-test/t/rpl_misc_functions.test @@ -89,12 +89,14 @@ INSERT INTO t1 VALUES (test_replication_sf()); --exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql # Cleanup +connection master; --disable_warnings DROP PROCEDURE IF EXISTS test_replication_sp1; DROP PROCEDURE IF EXISTS test_replication_sp2; DROP FUNCTION IF EXISTS test_replication_sf; DROP TABLE IF EXISTS t1; --enable_warnings +--sync_slave_with_master # If all is good, when can cleanup our dump files. --system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql diff --git a/sql/lock.cc b/sql/lock.cc index bf1512b754c..233d12d9cc4 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -544,7 +544,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle, goto end; /* A temporary table does not have locks. */ - if (table->s->tmp_table == TMP_TABLE) + if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) goto end; /* Get command lock or LOCK TABLES lock. Maybe empty for INSERT DELAYED. */ @@ -569,7 +569,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle, if (haystack->placeholder()) continue; table2= haystack->table; - if (table2->s->tmp_table == TMP_TABLE) + if (table2->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) continue; /* All tables in list must be in lock. */ @@ -655,7 +655,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, *write_lock_used=0; for (i=tables=lock_count=0 ; i < count ; i++) { - if (table_ptr[i]->s->tmp_table != TMP_TABLE) + if (table_ptr[i]->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE) { tables+=table_ptr[i]->file->lock_count(); lock_count++; @@ -697,7 +697,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, TABLE *table; enum thr_lock_type lock_type; - if ((table=table_ptr[i])->s->tmp_table == TMP_TABLE) + if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) continue; lock_type= table->reginfo.lock_type; if (lock_type >= TL_WRITE_ALLOW_WRITE) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9a7928b214f..0237ed144e8 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6120,12 +6120,12 @@ The minimum value for this variable is 4096.", (gptr*) &max_system_variables.tmp_table_size, 0, GET_ULL, REQUIRED_ARG, 32*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0}, {"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE, - "Allocation block size for transactions to be stored in binary log", + "Allocation block size for various transaction-related structures", (gptr*) &global_system_variables.trans_alloc_block_size, (gptr*) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG, REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0}, {"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE, - "Persistent buffer for transactions to be stored in binary log", + "Persistent buffer for various transaction-related structures", (gptr*) &global_system_variables.trans_prealloc_size, (gptr*) &max_system_variables.trans_prealloc_size, 0, GET_ULONG, REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ~0L, 0, 1024, 0}, diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 77bb1d9642b..e8cb3ae675d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2950,7 +2950,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db, share= tmp_table->s; tmp_table->reginfo.lock_type=TL_WRITE; // Simulate locked share->tmp_table= (tmp_table->file->has_transactions() ? - TRANSACTIONAL_TMP_TABLE : TMP_TABLE); + TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE); share->table_cache_key= (char*) (tmp_table+1); share->db= share->table_cache_key; share->key_length= (uint) (strmov(((char*) (share->table_name= diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index cd46f3bcc0e..84622398f6f 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -179,7 +179,7 @@ exit: orig_table_list->table_name= (char*) table->s->table_name; orig_table_list->table_name_length= strlen((char*)table->s->table_name); table->derived_select_number= first_select->select_number; - table->s->tmp_table= TMP_TABLE; + table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE; #ifndef NO_EMBEDDED_ACCESS_CHECKS if (orig_table_list->referencing_view) table->grant= orig_table_list->grant; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9fe92d63da3..433aef68e25 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9165,7 +9165,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, table->s->table_name= table->s->path= tmpname; table->s->db= ""; table->s->blob_ptr_size= mi_portable_sizeof_char_ptr; - table->s->tmp_table= TMP_TABLE; + table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE; table->s->db_low_byte_first=1; // True for HEAP and MyISAM table->s->table_charset= param->table_charset; table->s->keys_for_keyread.init(); diff --git a/sql/table.h b/sql/table.h index e2bd5ba0a7d..5fc73b22d2d 100644 --- a/sql/table.h +++ b/sql/table.h @@ -55,7 +55,8 @@ typedef struct st_grant_info ulong orig_want_privilege; } GRANT_INFO; -enum tmp_table_type {NO_TMP_TABLE=0, TMP_TABLE=1, TRANSACTIONAL_TMP_TABLE=2, +enum tmp_table_type {NO_TMP_TABLE=0, + NON_TRANSACTIONAL_TMP_TABLE=1, TRANSACTIONAL_TMP_TABLE=2, SYSTEM_TMP_TABLE=3}; enum frm_type_enum From ff7b01d8d436f77325de5cbf2f0c520a6fa35164 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 16:53:37 +0100 Subject: [PATCH 297/789] Makefile.am: Don't install benchmark executable CMakeLists.txt: Handle CMAKE_C_FLAGS_RELWITHDEBINFO and CMAKE_CXX_FLAGS_RELWITHDEBINFO extra/yassl/taocrypt/benchmark/Makefile.am: Don't install benchmark executable CMakeLists.txt: Handle CMAKE_C_FLAGS_RELWITHDEBINFO and CMAKE_CXX_FLAGS_RELWITHDEBINFO mysys/CMakeLists.txt: Handle CMAKE_C_FLAGS_RELWITHDEBINFO and CMAKE_CXX_FLAGS_RELWITHDEBINFO --- CMakeLists.txt | 8 ++++++++ extra/yassl/taocrypt/benchmark/Makefile.am | 2 +- mysys/CMakeLists.txt | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b458864c410..2a76361693a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,13 +86,17 @@ ENDIF(CYBOZU) # in some places we use DBUG_OFF SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF") +SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D DBUG_OFF") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D DBUG_OFF") +SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -D DBUG_OFF") IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8") IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR @@ -104,10 +108,14 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR ${CMAKE_C_FLAGS_DEBUG_INIT}) STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) + STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO + ${CMAKE_C_FLAGS_RELWITHDEBINFO}) STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) + STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO + ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) diff --git a/extra/yassl/taocrypt/benchmark/Makefile.am b/extra/yassl/taocrypt/benchmark/Makefile.am index 891dd532b98..2fe1c90c90d 100644 --- a/extra/yassl/taocrypt/benchmark/Makefile.am +++ b/extra/yassl/taocrypt/benchmark/Makefile.am @@ -1,5 +1,5 @@ INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL -bin_PROGRAMS = benchmark +noinst_PROGRAMS = benchmark benchmark_SOURCES = benchmark.cpp benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la benchmark_CXXFLAGS = -DYASSL_PURE_C diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index f529b559fb0..608d7cb1ce9 100755 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -22,7 +22,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") # Currently, USE_TLS crashes in Debug builds, so until that is fixed Debug # .dlls cannot be loaded at runtime. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DUSE_TLS") +SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DUSE_TLS") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DUSE_TLS") +SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DUSE_TLS") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys ) ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c From 05861963bc4b5ba7f3997574ca32ae19735f0683 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 16:59:55 +0100 Subject: [PATCH 298/789] BUG#23171: Illegal group log position Post-merge fixes. mysql-test/r/rpl_ndb_basic.result: Result change. sql/log_event.cc: Adding const-cast. --- mysql-test/r/rpl_ndb_basic.result | 4 ++-- sql/log_event.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/rpl_ndb_basic.result b/mysql-test/r/rpl_ndb_basic.result index 32a1c790c99..d6a9cdd4102 100644 --- a/mysql-test/r/rpl_ndb_basic.result +++ b/mysql-test/r/rpl_ndb_basic.result @@ -97,8 +97,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 146 -Last_Error Error in Write_rows event: error during transaction execution on table test.t1 +Last_Errno 1105 +Last_Error Unknown error Skip_Counter 0 Exec_Master_Log_Pos Relay_Log_Space diff --git a/sql/log_event.cc b/sql/log_event.cc index 8e6311ce53a..6dae0342886 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6024,7 +6024,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) mysql_unlock_tables(thd, thd->lock); thd->lock= 0; thd->query_error= 1; - rli->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(ERR_BAD_TABLE_DEF); } } From 8ceea7c4760ab5aa67d0604acc8a4e4ab6c04475 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 17:31:39 +0100 Subject: [PATCH 299/789] Fix for BUG#26194 "mysqlbinlog --base64-output produces invalid SQL"; when it was printing a Query event, it produced invalid SQL (missing the BINLOG keyword, so the SQL started with the base64 string, which is incorrect). Note: no testcase; I have a .test which shows that the bugfix works, but it triggers BUG#26361 and so gives Valgrind warnings. I'm sending this test to the fixer of BUG#26361 for her/him to push when she/he fixes BUG#26361. client/mysqlbinlog.cc: writing the header (a line started with "#", i.e. a comment) and the body (the real operation) of an event to the same IO_CACHE (result_cache) confused the logic of Log_event::print_base64() (which is that if the cache is not empty then the BINLOG keyword should not be printed); it caused the BINLOG keyword to miss hence a syntactically wrong output of "mysqlbinlog --base64-output" for Query events. So we just use the two IO_CACHE already available in "print_event_info". sql/log_event.cc: using the new small inline function. Note that the replication code should one day be fixed to trap all errors (like disk write errors). sql/log_event.h: small inline function to group two operations: copying an IO_CACHE to a FILE, and reinitializing this IO_CACHE for being filled again. sql/records.cc: fix after merge --- client/mysqlbinlog.cc | 16 +++++++--------- sql/log_event.cc | 9 +++------ sql/log_event.h | 8 ++++++++ sql/records.cc | 3 ++- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 940fac6da38..50235534cb8 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -483,19 +483,17 @@ static int write_event_header_and_base64(Log_event *ev, FILE *result_file, PRINT_EVENT_INFO *print_event_info) { + IO_CACHE *head= &print_event_info->head_cache; + IO_CACHE *body= &print_event_info->body_cache; DBUG_ENTER("write_event_header_and_base64"); - /* Write header and base64 output to cache */ - IO_CACHE result_cache; - if (open_cached_file(&result_cache, NULL, NULL, 0, MYF(MY_WME | MY_NABP))) - return 1; - ev->print_header(&result_cache, print_event_info, FALSE); - ev->print_base64(&result_cache, print_event_info, FALSE); + /* Write header and base64 output to cache */ + ev->print_header(head, print_event_info, FALSE); + ev->print_base64(body, print_event_info, FALSE); /* Read data from cache and write to result file */ - my_b_copy_to_file(&result_cache, result_file); - close_cached_file(&result_cache); - DBUG_RETURN(0); + DBUG_RETURN(copy_event_cache_to_file_and_reinit(head, result_file) || + copy_event_cache_to_file_and_reinit(body, result_file)); } diff --git a/sql/log_event.cc b/sql/log_event.cc index f8d3c43bfba..dc411c14f93 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -75,8 +75,7 @@ public: ~Write_on_release_cache() { - if (!my_b_copy_to_file(m_cache, m_file)) - reinit_io_cache(m_cache, WRITE_CACHE, 0L, FALSE, TRUE); + copy_event_cache_to_file_and_reinit(m_cache, m_file); if (m_flags | FLUSH_F) fflush(m_file); } @@ -6160,10 +6159,8 @@ void Rows_log_event::print_helper(FILE *file, if (get_flags(STMT_END_F)) { - my_b_copy_to_file(head, file); - my_b_copy_to_file(body, file); - reinit_io_cache(head, WRITE_CACHE, 0, FALSE, TRUE); - reinit_io_cache(body, WRITE_CACHE, 0, FALSE, TRUE); + copy_event_cache_to_file_and_reinit(head, file); + copy_event_cache_to_file_and_reinit(body, file); } } #endif diff --git a/sql/log_event.h b/sql/log_event.h index 7cbe8925d9a..656860a2b55 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2230,4 +2230,12 @@ private: #endif }; +static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, + FILE *file) +{ + return + my_b_copy_to_file(cache, file) || + reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE); +} + #endif /* _log_event_h */ diff --git a/sql/records.cc b/sql/records.cc index 0923ab1d75e..0fb9f4f9650 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -150,7 +150,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, info->file= table->file; info->forms= &info->table; /* Only one table */ - if (table->s->tmp_table == TMP_TABLE && !table->sort.addon_field) + if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE && + !table->sort.addon_field) VOID(table->file->extra(HA_EXTRA_MMAP)); if (table->sort.addon_field) From 0a48cd93b4d26056e669b1a9bd5be791b3b79b94 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 18:44:16 +0200 Subject: [PATCH 300/789] Bug #26207: When making the key image to use in index search MySQL was not explicitly suppressing warnings. And if the context happens to enable warnings (e.g. INSERT .. SELECT) the warnings resulting from converting the data the key is compared to are reported to the client. Fixed by suppressing warnings when converting the data to the same type as the key parts. mysql-test/r/insert_select.result: Bug #26207: test case mysql-test/t/insert_select.test: Bug #26207: test case sql/sql_select.h: Bug #26207: supress warnings when converting data of the same type to key buffer format. --- mysql-test/r/insert_select.result | 29 +++++++++++++++++ mysql-test/t/insert_select.test | 27 +++++++++++++++- sql/sql_select.h | 53 ++++++++++++++++++++++++------- 3 files changed, 96 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index 92b3ea0e42b..a96add7eb9a 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -744,3 +744,32 @@ f1 f2 2 2 10 10 DROP TABLE t1, t2; +SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1 (c VARCHAR(30), INDEX ix_c (c(10))); +CREATE TABLE t2 (d VARCHAR(10)); +INSERT INTO t1 (c) VALUES ('7_chars'), ('13_characters'); +EXPLAIN +SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +2 SUBQUERY t1 ref ix_c ix_c 13 const 1 Using where +SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; +(SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') +13 +13 +INSERT INTO t2 (d) +SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; +INSERT INTO t2 (d) +SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='7_chars') FROM t1; +INSERT INTO t2 (d) +SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c IN (SELECT t1.c FROM t1)) +FROM t1; +SELECT * FROM t2; +d +13 +13 +7 +7 +20 +20 +DROP TABLE t1,t2; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 31508b3d6c4..bbc51be6dc9 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -306,4 +306,29 @@ INSERT INTO t2 (f1, f2) SELECT * FROM t2; DROP TABLE t1, t2; - +# +# Bug #26207: inserts don't work with shortened index +# +SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; + +CREATE TABLE t1 (c VARCHAR(30), INDEX ix_c (c(10))); +CREATE TABLE t2 (d VARCHAR(10)); +INSERT INTO t1 (c) VALUES ('7_chars'), ('13_characters'); + +EXPLAIN + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; + +SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; + +INSERT INTO t2 (d) + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; + +INSERT INTO t2 (d) + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='7_chars') FROM t1; + +INSERT INTO t2 (d) + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c IN (SELECT t1.c FROM t1)) + FROM t1; + +SELECT * FROM t2; +DROP TABLE t1,t2; diff --git a/sql/sql_select.h b/sql/sql_select.h index a17d7fcb362..e70e42da4ae 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -488,15 +488,11 @@ extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b); class store_key :public Sql_alloc { - protected: - Field *to_field; // Store data here - char *null_ptr; - char err; public: bool null_key; /* TRUE <=> the value of the key has a null part */ enum store_key_result { STORE_KEY_OK, STORE_KEY_FATAL, STORE_KEY_CONV }; store_key(THD *thd, Field *field_arg, char *ptr, char *null, uint length) - :null_ptr(null), err(0), null_key(0) + :null_key(0), null_ptr(null), err(0) { if (field_arg->type() == FIELD_TYPE_BLOB) { @@ -510,8 +506,35 @@ public: ptr, (uchar*) null, 1); } virtual ~store_key() {} /* Not actually needed */ - virtual enum store_key_result copy()=0; virtual const char *name() const=0; + + /** + @brief sets ignore truncation warnings mode and calls the real copy method + + @details this function makes sure truncation warnings when preparing the + key buffers don't end up as errors (because of an enclosing INSERT/UPDATE). + */ + enum store_key_result copy() + { + enum store_key_result result; + enum_check_fields saved_count_cuted_fields= + to_field->table->in_use->count_cuted_fields; + + to_field->table->in_use->count_cuted_fields= CHECK_FIELD_IGNORE; + + result= copy_inner(); + + to_field->table->in_use->count_cuted_fields= saved_count_cuted_fields; + + return result; + } + + protected: + Field *to_field; // Store data here + char *null_ptr; + char err; + + virtual enum store_key_result copy_inner()=0; }; @@ -531,13 +554,15 @@ class store_key_field: public store_key copy_field.set(to_field,from_field,0); } } - enum store_key_result copy() + const char *name() const { return field_name; } + + protected: + enum store_key_result copy_inner() { copy_field.do_copy(©_field); null_key= to_field->is_null(); return err != 0 ? STORE_KEY_FATAL : STORE_KEY_OK; } - const char *name() const { return field_name; } }; @@ -552,13 +577,15 @@ public: null_ptr_arg ? null_ptr_arg : item_arg->maybe_null ? &err : NullS, length), item(item_arg) {} - enum store_key_result copy() + const char *name() const { return "func"; } + + protected: + enum store_key_result copy_inner() { int res= item->save_in_field(to_field, 1); null_key= to_field->is_null() || item->null_value; return (err != 0 || res > 2 ? STORE_KEY_FATAL : (store_key_result) res); } - const char *name() const { return "func"; } }; @@ -574,7 +601,10 @@ public: &err : NullS, length, item_arg), inited(0) { } - enum store_key_result copy() + const char *name() const { return "const"; } + +protected: + enum store_key_result copy_inner() { int res; if (!inited) @@ -589,7 +619,6 @@ public: null_key= to_field->is_null() || item->null_value; return (err > 2 ? STORE_KEY_FATAL : (store_key_result) err); } - const char *name() const { return "const"; } }; bool cp_buffer_from_ref(THD *thd, TABLE_REF *ref); From df3a48ea43b93ad91546d71c49963665f13179db Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 19:17:15 +0200 Subject: [PATCH 301/789] Bug #27354 stored function in where condition was always treated as const Possible problems: function call could be eliminated from where class and only be evaluated once; function can be evaluated during table and item setup phase which could cause side effects not to be registered in binlog. Fixed with introducing func_item_sp::used_tables() returning the correct table_map constant. mysql-test/r/sp.result: results changed mysql-test/t/sp.test: regression test demonstrating that function's returns match where condition of the top-level query table. sql/item_func.h: private used_tables() method returning the correct table_bit with meaning the item is not a constant --- mysql-test/r/sp.result | 25 +++++++++++++++++++++++++ mysql-test/t/sp.test | 24 ++++++++++++++++++++++++ sql/item_func.h | 4 +++- 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 34f2aa94000..eae5c3a38d6 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5779,3 +5779,28 @@ SUM(f2) bug25373(f1) DROP FUNCTION bug25373| DROP TABLE t3| drop table t1,t2; +CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM; +CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb; +set @a=0; +CREATE function bug27354() RETURNS int deterministic +begin +insert into t1 values (null); +set @a=@a+1; +return @a; +end| +update t2 set b=1 where a=bug27354(); +select count(t_1.a),count(t_2.a) from t1 as t_1, t2 as t_2 /* must be 0,0 */; +count(t_1.a) count(t_2.a) +0 0 +insert into t2 values (1,1),(2,2),(3,3); +update t2 set b=-b where a=bug27354(); +select * from t2 /* must return 1,-1 ... */; +a b +1 -1 +2 -2 +3 -3 +select count(*) from t1 /* must be 3 */; +count(*) +3 +drop table t1,t2; +drop function bug27354; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 9af24ee0337..0875c61ef0f 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6770,3 +6770,27 @@ DROP TABLE t3| # practical, or create table t3, t4 etc temporarily (and drop them). delimiter ;| drop table t1,t2; + +CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM; +CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb; +set @a=0; + +delimiter |; +CREATE function bug27354() RETURNS int deterministic +begin +insert into t1 values (null); +set @a=@a+1; +return @a; +end| + +delimiter ;| +update t2 set b=1 where a=bug27354(); +select count(t_1.a),count(t_2.a) from t1 as t_1, t2 as t_2 /* must be 0,0 */; +insert into t2 values (1,1),(2,2),(3,3); +update t2 set b=-b where a=bug27354(); +select * from t2 /* must return 1,-1 ... */; +select count(*) from t1 /* must be 3 */; + + +drop table t1,t2; +drop function bug27354; diff --git a/sql/item_func.h b/sql/item_func.h index 68591f9c6f5..24f30994b22 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1411,7 +1411,7 @@ private: bool execute(Field **flp); bool execute_impl(THD *thd, Field *return_value_fld); Field *sp_result_field(void) const; - + public: Item_func_sp(Name_resolution_context *context_arg, sp_name *name); @@ -1422,6 +1422,8 @@ public: virtual ~Item_func_sp() {} + table_map used_tables() const { return RAND_TABLE_BIT; } + void cleanup(); const char *func_name() const; From 1a52767fcad94766e13322fc552c508c89dcb91a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 13:35:29 -0400 Subject: [PATCH 302/789] Bug#26346: stack + buffer overrun in mysqldump Fixes to buffer overlows from long command line args, and unchecked dyn_str return codes. Also light refactoring. client/mysqldump.c: Bug#26346 stack + buffer overrun in mysqldump mysql-test/r/mysqldump.result: Bug#26346 stack + buffer overrun in mysqldump mysql-test/t/mysqldump.test: Bug#26346 stack + buffer overrun in mysqldump --- client/mysqldump.c | 552 ++++++++++++++++++++-------------- mysql-test/r/mysqldump.result | 19 +- mysql-test/t/mysqldump.test | 24 ++ 3 files changed, 354 insertions(+), 241 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 94ab9dac5ac..333bfbff1e6 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -76,13 +76,13 @@ #define IGNORE_DATA 0x01 /* don't dump data for this table */ #define IGNORE_INSERT_DELAYED 0x02 /* table doesn't support INSERT DELAYED */ -static char *add_load_option(char *ptr, const char *object, - const char *statement); +static void add_load_option(DYNAMIC_STRING *str, const char *option, + const char *option_value); static ulong find_set(TYPELIB *lib, const char *x, uint length, char **err_pos, uint *err_len); static char *alloc_query_str(ulong size); -static char *field_escape(char *to,const char *from,uint length); +static void field_escape(DYNAMIC_STRING* in, const char *from); static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, quick= 1, extended_insert= 1, lock_tables=1,ignore_errors=0,flush_logs=0,flush_privileges=0, @@ -121,6 +121,19 @@ FILE *md_result_file= 0; static char *shared_memory_base_name=0; #endif static uint opt_protocol= 0; + +/* +Dynamic_string wrapper functions. In this file use these +wrappers, they will terminate the process if there is +an allocation failure. +*/ +static void init_dynamic_string_checked(DYNAMIC_STRING *str, const char *init_str, + uint init_alloc, uint alloc_increment); +static void dynstr_append_checked(DYNAMIC_STRING* dest, const char* src); +static void dynstr_set_checked(DYNAMIC_STRING *str, const char *init_str); +static void dynstr_append_mem_checked(DYNAMIC_STRING *str, const char *append, + uint length); +static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size); /* Constant for detection of default value of default_charset. If default_charset is equal to mysql_universal_client_charset, then @@ -419,7 +432,9 @@ static struct my_option my_long_options[] = static const char *load_default_groups[]= { "mysqldump","client",0 }; -static void safe_exit(int error); +static void maybe_exit(int error); +static void die(int error, const char* reason, ...); +static void maybe_die(int error, const char* reason, ...); static void write_header(FILE *sql_file, char *db_name); static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row, const char *prefix,const char *name, @@ -474,11 +489,7 @@ static void verbose_msg(const char *fmt, ...) void check_io(FILE *file) { if (ferror(file)) - { - fprintf(stderr, "%s: Got errno %d on write\n", my_progname, errno); - ignore_errors= 0; /* We can't ignore this error */ - safe_exit(EX_EOF); - } + die(EX_EOF, "Got errno %d on write", errno); } static void print_version(void) @@ -864,12 +875,74 @@ static int get_options(int *argc, char ***argv) static void DB_error(MYSQL *mysql_arg, const char *when) { DBUG_ENTER("DB_error"); - fprintf(stderr, "%s: Got error: %d: %s %s\n", my_progname, + maybe_die(EX_MYSQLERR, "Got error: %d: %s %s", mysql_errno(mysql_arg), mysql_error(mysql_arg), when); - fflush(stderr); - safe_exit(EX_MYSQLERR); DBUG_VOID_RETURN; -} /* DB_error */ +} + + + +/* + Prints out an error message and kills the process. + + SYNOPSIS + die() + error_num - process return value + fmt_reason - a format string for use by my_vsnprintf. + ... - variable arguments for above fmt_reason string + + DESCRIPTION + This call prints out the formatted error message to stderr and then + terminates the process. +*/ +static void die(int error_num, const char* fmt_reason, ...) +{ + char buffer[1000]; + va_list args; + va_start(args,fmt_reason); + my_vsnprintf(buffer, sizeof(buffer), fmt_reason, args); + va_end(args); + + fprintf(stderr, "%s: %s\n", my_progname, buffer); + fflush(stderr); + + ignore_errors= 0; /* force the exit */ + maybe_exit(error_num); +} + + +/* + Prints out an error message and maybe kills the process. + + SYNOPSIS + maybe_die() + error_num - process return value + fmt_reason - a format string for use by my_vsnprintf. + ... - variable arguments for above fmt_reason string + + DESCRIPTION + This call prints out the formatted error message to stderr and then + terminates the process, unless the --force command line option is used. + + This call should be used for non-fatal errors (such as database + errors) that the code may still be able to continue to the next unit + of work. + +*/ +static void maybe_die(int error_num, const char* fmt_reason, ...) +{ + char buffer[1000]; + va_list args; + va_start(args,fmt_reason); + my_vsnprintf(buffer, sizeof(buffer), fmt_reason, args); + va_end(args); + + fprintf(stderr, "%s: %s\n", my_progname, buffer); + fflush(stderr); + + maybe_exit(error_num); +} + /* @@ -894,10 +967,8 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res, if (mysql_query(mysql_con, query) || (res && !((*res)= mysql_store_result(mysql_con)))) { - fprintf(stderr, "%s: Couldn't execute '%s': %s (%d)\n", - my_progname, query, - mysql_error(mysql_con), mysql_errno(mysql_con)); - safe_exit(EX_MYSQLERR); + maybe_die(EX_MYSQLERR, "Couldn't execute '%s': %s (%d)", + query, mysql_error(mysql_con), mysql_errno(mysql_con)); return 1; } return 0; @@ -942,7 +1013,7 @@ static void free_resources() } -static void safe_exit(int error) +static void maybe_exit(int error) { if (!first_error) first_error= error; @@ -1002,10 +1073,7 @@ static int connect_to_db(char *host, char *user,char *passwd) my_snprintf(buff, sizeof(buff), "/*!40100 SET @@SQL_MODE='%s' */", compatible_mode_normal_str); if (mysql_query_with_error_report(mysql, 0, buff)) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(1); - } /* set time_zone to UTC to allow dumping date types between servers with different time zone settings @@ -1014,10 +1082,7 @@ static int connect_to_db(char *host, char *user,char *passwd) { my_snprintf(buff, sizeof(buff), "/*!40103 SET TIME_ZONE='+00:00' */"); if (mysql_query_with_error_report(mysql, 0, buff)) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(1); - } } DBUG_RETURN(0); } /* connect_to_db */ @@ -1038,10 +1103,8 @@ static void unescape(FILE *file,char *pos,uint length) char *tmp; DBUG_ENTER("unescape"); if (!(tmp=(char*) my_malloc(length*2+1, MYF(MY_WME)))) - { - ignore_errors=0; /* Fatal error */ - safe_exit(EX_MYSQLERR); /* Force exit */ - } + die(EX_MYSQLERR, "Couldn't allocate memory"); + mysql_real_escape_string(&mysql_connection, tmp, pos, length); fputc('\'', file); fputs(tmp, file); @@ -1350,7 +1413,7 @@ static void print_blob_as_hex(FILE *output_file, const char *str, ulong len) /* dump_routines_for_db - -- retrievs list of routines for a given db, and prints out + -- retrieves list of routines for a given db, and prints out the CREATE PROCEDURE definition into the output (the dump). This function has logic to print the appropriate syntax depending on whether @@ -1545,11 +1608,10 @@ static uint get_table_structure(char *table, char *db, char *table_type, if (!insert_pat_inited) { insert_pat_inited= 1; - if (init_dynamic_string(&insert_pat, "", 1024, 1024)) - safe_exit(EX_MYSQLERR); + init_dynamic_string_checked(&insert_pat, "", 1024, 1024); } else - dynstr_set(&insert_pat, ""); + dynstr_set_checked(&insert_pat, ""); } insert_option= ((delayed && opt_ignore) ? " DELAYED IGNORE " : @@ -1581,18 +1643,13 @@ static uint get_table_structure(char *table, char *db, char *table_type, my_snprintf(buff, sizeof(buff), "show create table %s", result_table); if (mysql_query_with_error_report(mysql, 0, buff)) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); - } if (path) { if (!(sql_file= open_sql_file_for_table(table))) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); - } + write_header(sql_file, db); } if (!opt_xml && opt_comments) @@ -1656,7 +1713,6 @@ static uint get_table_structure(char *table, char *db, char *table_type, my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR)); - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } else @@ -1719,7 +1775,6 @@ static uint get_table_structure(char *table, char *db, char *table_type, { if (path) my_fclose(sql_file, MYF(MY_WME)); - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -1731,19 +1786,19 @@ static uint get_table_structure(char *table, char *db, char *table_type, */ if (write_data) { - dynstr_append_mem(&insert_pat, "INSERT ", 7); - dynstr_append(&insert_pat, insert_option); - dynstr_append_mem(&insert_pat, "INTO ", 5); - dynstr_append(&insert_pat, opt_quoted_table); + dynstr_append_checked(&insert_pat, "INSERT "); + dynstr_append_checked(&insert_pat, insert_option); + dynstr_append_checked(&insert_pat, "INTO "); + dynstr_append_checked(&insert_pat, opt_quoted_table); if (complete_insert) { - dynstr_append_mem(&insert_pat, " (", 2); + dynstr_append_checked(&insert_pat, " ("); } else { - dynstr_append_mem(&insert_pat, " VALUES ", 8); + dynstr_append_checked(&insert_pat, " VALUES "); if (!extended_insert) - dynstr_append_mem(&insert_pat, "(", 1); + dynstr_append_checked(&insert_pat, "("); } } @@ -1753,10 +1808,10 @@ static uint get_table_structure(char *table, char *db, char *table_type, { if (init) { - dynstr_append_mem(&insert_pat, ", ", 2); + dynstr_append_checked(&insert_pat, ", "); } init=1; - dynstr_append(&insert_pat, + dynstr_append_checked(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); } } @@ -1771,10 +1826,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, my_snprintf(query_buff, sizeof(query_buff), "show fields from %s", result_table); if (mysql_query_with_error_report(mysql, &result, query_buff)) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); - } /* Make an sql-file, if path was given iow. option -T was given */ if (!opt_no_create_info) @@ -1782,10 +1834,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, if (path) { if (!(sql_file= open_sql_file_for_table(table))) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); - } write_header(sql_file, db); } if (!opt_xml && opt_comments) @@ -1803,17 +1852,17 @@ static uint get_table_structure(char *table, char *db, char *table_type, if (write_data) { - dynstr_append_mem(&insert_pat, "INSERT ", 7); - dynstr_append(&insert_pat, insert_option); - dynstr_append_mem(&insert_pat, "INTO ", 5); - dynstr_append(&insert_pat, result_table); + dynstr_append_checked(&insert_pat, "INSERT "); + dynstr_append_checked(&insert_pat, insert_option); + dynstr_append_checked(&insert_pat, "INTO "); + dynstr_append_checked(&insert_pat, result_table); if (opt_complete_insert) - dynstr_append_mem(&insert_pat, " (", 2); + dynstr_append_checked(&insert_pat, " ("); else { - dynstr_append_mem(&insert_pat, " VALUES ", 8); + dynstr_append_checked(&insert_pat, " VALUES "); if (!extended_insert) - dynstr_append_mem(&insert_pat, "(", 1); + dynstr_append_checked(&insert_pat, "("); } } @@ -1828,11 +1877,11 @@ static uint get_table_structure(char *table, char *db, char *table_type, check_io(sql_file); } if (complete_insert) - dynstr_append_mem(&insert_pat, ", ", 2); + dynstr_append_checked(&insert_pat, ", "); } init=1; if (opt_complete_insert) - dynstr_append(&insert_pat, + dynstr_append_checked(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); if (!opt_no_create_info) { @@ -1882,7 +1931,6 @@ static uint get_table_structure(char *table, char *db, char *table_type, my_progname, result_table, mysql_error(mysql)); if (path) my_fclose(sql_file, MYF(MY_WME)); - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -1992,9 +2040,9 @@ continue_xml: } if (opt_complete_insert) { - dynstr_append_mem(&insert_pat, ") VALUES ", 9); + dynstr_append_checked(&insert_pat, ") VALUES "); if (!extended_insert) - dynstr_append_mem(&insert_pat, "(", 1); + dynstr_append_checked(&insert_pat, "("); } if (sql_file != md_result_file) { @@ -2041,7 +2089,6 @@ static void dump_triggers_for_table(char *table, { if (path) my_fclose(sql_file, MYF(MY_WME)); - safe_exit(EX_MYSQLERR); DBUG_VOID_RETURN; } if (mysql_num_rows(result)) @@ -2100,24 +2147,28 @@ DELIMITER ;;\n"); DBUG_VOID_RETURN; } -static char *add_load_option(char *ptr,const char *object, - const char *statement) +static void add_load_option(DYNAMIC_STRING *str, const char *option, + const char *option_value) { - if (object) + if (!option_value) { - /* Don't escape hex constants */ - if (object[0] == '0' && (object[1] == 'x' || object[1] == 'X')) - ptr= strxmov(ptr," ",statement," ",object,NullS); - else - { - /* char constant; escape */ - ptr= strxmov(ptr," ",statement," '",NullS); - ptr= field_escape(ptr,object,(uint) strlen(object)); - *ptr++= '\''; - } + /* Null value means we don't add this option. */ + return; } - return ptr; -} /* add_load_option */ + + dynstr_append_checked(str, option); + + if (strncmp(option_value, "0x", sizeof("0x")-1) == 0) + { + /* It's a hex constant, don't escape */ + dynstr_append_checked(str, option_value); + } + else + { + /* char constant; escape */ + field_escape(str, option_value); + } +} /* @@ -2127,28 +2178,36 @@ static char *add_load_option(char *ptr,const char *object, syntax errors from the SQL parser. */ -static char *field_escape(char *to,const char *from,uint length) +static void field_escape(DYNAMIC_STRING* in, const char *from) { - const char *end; - uint end_backslashes=0; + uint end_backslashes= 0; - for (end= from+length; from != end; from++) + dynstr_append_checked(in, "'"); + + while (*from) { - *to++= *from; + dynstr_append_mem_checked(in, from, 1); + if (*from == '\\') end_backslashes^=1; /* find odd number of backslashes */ else { if (*from == '\'' && !end_backslashes) - *to++= *from; /* We want a duplicate of "'" for MySQL */ + { + /* We want a duplicate of "'" for MySQL */ + dynstr_append_checked(in, "\'"); + } end_backslashes=0; } + from++; } /* Add missing backslashes if user has specified odd number of backs.*/ if (end_backslashes) - *to++= '\\'; - return to; -} /* field_escape */ + dynstr_append_checked(in, "\\"); + + dynstr_append_checked(in, "'"); +} + static char *alloc_query_str(ulong size) @@ -2156,10 +2215,8 @@ static char *alloc_query_str(ulong size) char *query; if (!(query= (char*) my_malloc(size, MYF(MY_WME)))) - { - ignore_errors= 0; /* Fatal error */ - safe_exit(EX_MYSQLERR); /* Force exit */ - } + die(EX_MYSQLERR, "Couldn't allocate a query string."); + return query; } @@ -2179,13 +2236,14 @@ static char *alloc_query_str(ulong size) void */ + static void dump_table(char *table, char *db) { char ignore_flag; - char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; + char buf[200], table_buff[NAME_LEN+3]; + DYNAMIC_STRING query_string; char table_type[NAME_LEN]; char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table; - char *query= query_buf; int error= 0; ulong rownr, row_break, total_length, init_length; uint num_fields; @@ -2239,44 +2297,69 @@ static void dump_table(char *table, char *db) opt_quoted_table= quote_name(table, table_buff2, 0); verbose_msg("-- Sending SELECT query...\n"); + + init_dynamic_string_checked(&query_string, "", 1024, 1024); + if (path) { char filename[FN_REFLEN], tmp_path[FN_REFLEN]; - convert_dirname(tmp_path,path,NullS); + + if (strlen(path) >= FN_REFLEN) + { + /* + This check is made because the some the file functions below + have FN_REFLEN sized stack allocated buffers and will cause + a crash even if the input destination buffer is large enough + to hold the output. + */ + die(EX_USAGE, "Input filename or options too long: %s", path); + } + + /* + Convert the path to native os format + and resolve to the full filepath. + */ + convert_dirname(tmp_path,path,NullS); my_load_path(tmp_path, tmp_path, NULL); - fn_format(filename, table, tmp_path, ".txt", 4); - my_delete(filename, MYF(0)); /* 'INTO OUTFILE' doesn't work, if - filename wasn't deleted */ + fn_format(filename, table, tmp_path, ".txt", MYF(MY_UNPACK_FILENAME)); + + /* Must delete the file that 'INTO OUTFILE' will write to */ + my_delete(filename, MYF(0)); + + /* convert to a unix path name to stick into the query */ to_unix_path(filename); - my_snprintf(query, QUERY_LENGTH, - "SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '%s'", - filename); - end= strend(query); + + /* now build the query string */ + + dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '"); + dynstr_append_checked(&query_string, filename); + dynstr_append_checked(&query_string, "'"); if (fields_terminated || enclosed || opt_enclosed || escaped) - end= strmov(end, " FIELDS"); - end= add_load_option(end, fields_terminated, " TERMINATED BY"); - end= add_load_option(end, enclosed, " ENCLOSED BY"); - end= add_load_option(end, opt_enclosed, " OPTIONALLY ENCLOSED BY"); - end= add_load_option(end, escaped, " ESCAPED BY"); - end= add_load_option(end, lines_terminated, " LINES TERMINATED BY"); - *end= '\0'; + dynstr_append_checked(&query_string, " FIELDS"); + + add_load_option(&query_string, " TERMINATED BY ", fields_terminated); + add_load_option(&query_string, " ENCLOSED BY ", enclosed); + add_load_option(&query_string, " OPTIONALLY ENCLOSED BY ", opt_enclosed); + add_load_option(&query_string, " ESCAPED BY ", escaped); + add_load_option(&query_string, " LINES TERMINATED BY ", lines_terminated); - my_snprintf(buff, sizeof(buff), " FROM %s", result_table); - end= strmov(end,buff); - if (where || order_by) + dynstr_append_checked(&query_string, " FROM "); + dynstr_append_checked(&query_string, result_table); + + if (where) { - query= alloc_query_str((ulong) ((end - query) + 1 + - (where ? strlen(where) + 7 : 0) + - (order_by ? strlen(order_by) + 10 : 0))); - end= strmov(query, query_buf); - - if (where) - end= strxmov(end, " WHERE ", where, NullS); - if (order_by) - end= strxmov(end, " ORDER BY ", order_by, NullS); + dynstr_append_checked(&query_string, " WHERE "); + dynstr_append_checked(&query_string, where); } - if (mysql_real_query(mysql, query, (uint) (end - query))) + + if (order_by) + { + dynstr_append_checked(&query_string, " ORDER BY "); + dynstr_append_checked(&query_string, order_by); + } + + if (mysql_real_query(mysql, query_string.str, query_string.length)) { DB_error(mysql, "when executing 'SELECT INTO OUTFILE'"); DBUG_VOID_RETURN; @@ -2290,41 +2373,38 @@ static void dump_table(char *table, char *db) result_table); check_io(md_result_file); } - my_snprintf(query, QUERY_LENGTH, - "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s", - result_table); - if (where || order_by) - { - query= alloc_query_str((ulong) (strlen(query) + 1 + - (where ? strlen(where) + 7 : 0) + - (order_by ? strlen(order_by) + 10 : 0))); - end= strmov(query, query_buf); + + dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM "); + dynstr_append_checked(&query_string, result_table); - if (where) + if (where) + { + if (!opt_xml && opt_comments) { - if (!opt_xml && opt_comments) - { - fprintf(md_result_file, "-- WHERE: %s\n", where); - check_io(md_result_file); - } - end= strxmov(end, " WHERE ", where, NullS); - } - if (order_by) - { - if (!opt_xml && opt_comments) - { - fprintf(md_result_file, "-- ORDER BY: %s\n", order_by); - check_io(md_result_file); - } - end= strxmov(end, " ORDER BY ", order_by, NullS); + fprintf(md_result_file, "-- WHERE: %s\n", where); + check_io(md_result_file); } + + dynstr_append_checked(&query_string, " WHERE "); + dynstr_append_checked(&query_string, where); } + if (order_by) + { + if (!opt_xml && opt_comments) + { + fprintf(md_result_file, "-- ORDER BY: %s\n", order_by); + check_io(md_result_file); + } + dynstr_append_checked(&query_string, " ORDER BY "); + dynstr_append_checked(&query_string, order_by); + } + if (!opt_xml && !opt_compact) { fputs("\n", md_result_file); check_io(md_result_file); } - if (mysql_query_with_error_report(mysql, 0, query)) + if (mysql_query_with_error_report(mysql, 0, query_string.str)) { DB_error(mysql, "when retrieving data from server"); goto err; @@ -2398,14 +2478,9 @@ static void dump_table(char *table, char *db) ulong length= lengths[i]; if (!(field= mysql_fetch_field(res))) - { - my_snprintf(query, QUERY_LENGTH, - "%s: Not enough fields from table %s! Aborting.\n", - my_progname, result_table); - fputs(query,stderr); - error= EX_CONSCHECK; - goto err; - } + die(EX_CONSCHECK, + "Not enough fields from table %s! Aborting.\n", + result_table); /* 63 is my_charset_bin. If charsetnr is not 63, @@ -2424,9 +2499,9 @@ static void dump_table(char *table, char *db) if (extended_insert && !opt_xml) { if (i == 0) - dynstr_set(&extended_row,"("); + dynstr_set_checked(&extended_row,"("); else - dynstr_append(&extended_row,","); + dynstr_append_checked(&extended_row,","); if (row[i]) { @@ -2441,15 +2516,10 @@ static void dump_table(char *table, char *db) - In non-HEX mode we need up to 2 bytes per character, plus 2 bytes for leading and trailing '\'' characters. */ - if (dynstr_realloc(&extended_row,length * 2+2)) - { - fputs("Aborting dump (out of memory)",stderr); - error= EX_EOM; - goto err; - } + dynstr_realloc_checked(&extended_row,length * 2+2); if (opt_hex_blob && is_blob) { - dynstr_append(&extended_row, "0x"); + dynstr_append_checked(&extended_row, "0x"); extended_row.length+= mysql_hex_string(extended_row.str + extended_row.length, row[i], length); @@ -2457,13 +2527,13 @@ static void dump_table(char *table, char *db) } else { - dynstr_append(&extended_row,"'"); + dynstr_append_checked(&extended_row,"'"); extended_row.length += mysql_real_escape_string(&mysql_connection, &extended_row.str[extended_row.length], row[i],length); extended_row.str[extended_row.length]='\0'; - dynstr_append(&extended_row,"'"); + dynstr_append_checked(&extended_row,"'"); } } else @@ -2472,30 +2542,26 @@ static void dump_table(char *table, char *db) char *ptr= row[i]; if (my_isalpha(charset_info, *ptr) || (*ptr == '-' && my_isalpha(charset_info, ptr[1]))) - dynstr_append(&extended_row, "NULL"); + dynstr_append_checked(&extended_row, "NULL"); else { if (field->type == FIELD_TYPE_DECIMAL) { /* add " signs around */ - dynstr_append(&extended_row, "'"); - dynstr_append(&extended_row, ptr); - dynstr_append(&extended_row, "'"); + dynstr_append_checked(&extended_row, "'"); + dynstr_append_checked(&extended_row, ptr); + dynstr_append_checked(&extended_row, "'"); } else - dynstr_append(&extended_row, ptr); + dynstr_append_checked(&extended_row, ptr); } } } else - dynstr_append(&extended_row,"''"); - } - else if (dynstr_append(&extended_row,"NULL")) - { - fputs("Aborting dump (out of memory)",stderr); - error= EX_EOM; - goto err; + dynstr_append_checked(&extended_row,"''"); } + else + dynstr_append_checked(&extended_row,"NULL"); } else { @@ -2512,16 +2578,16 @@ static void dump_table(char *table, char *db) { if (opt_hex_blob && is_blob && length) { - /* Define xsi:type="xs:hexBinary" for hex encoded data */ - print_xml_tag(md_result_file, "\t\t", "", "field", "name=", - field->name, "xsi:type=", "xs:hexBinary", NullS); - print_blob_as_hex(md_result_file, row[i], length); + /* Define xsi:type="xs:hexBinary" for hex encoded data */ + print_xml_tag(md_result_file, "\t\t", "", "field", "name=", + field->name, "xsi:type=", "xs:hexBinary", NullS); + print_blob_as_hex(md_result_file, row[i], length); } else { - print_xml_tag(md_result_file, "\t\t", "", "field", "name=", - field->name, NullS); - print_quoted_xml(md_result_file, row[i], length); + print_xml_tag(md_result_file, "\t\t", "", "field", "name=", + field->name, NullS); + print_quoted_xml(md_result_file, row[i], length); } fputs("\n", md_result_file); } @@ -2581,7 +2647,7 @@ static void dump_table(char *table, char *db) if (extended_insert) { ulong row_length; - dynstr_append(&extended_row,")"); + dynstr_append_checked(&extended_row,")"); row_length= 2 + extended_row.length; if (total_length + row_length < opt_net_buffer_length) { @@ -2617,14 +2683,14 @@ static void dump_table(char *table, char *db) check_io(md_result_file); if (mysql_errno(mysql)) { - my_snprintf(query, QUERY_LENGTH, + my_snprintf(buf, sizeof(buf), "%s: Error %d: %s when dumping table %s at row: %ld\n", my_progname, mysql_errno(mysql), mysql_error(mysql), result_table, rownr); - fputs(query,stderr); + fputs(buf,stderr); error= EX_CONSCHECK; goto err; } @@ -2647,15 +2713,13 @@ static void dump_table(char *table, char *db) check_io(md_result_file); } mysql_free_result(res); - if (query != query_buf) - my_free(query, MYF(MY_ALLOW_ZERO_PTR)); + dynstr_free(&query_string); } DBUG_VOID_RETURN; err: - if (query != query_buf) - my_free(query, MYF(MY_ALLOW_ZERO_PTR)); - safe_exit(error); + dynstr_free(&query_string); + maybe_exit(error); DBUG_VOID_RETURN; } /* dump_table */ @@ -2842,8 +2906,8 @@ static int init_dumping(char *database, int init_func(char*)) check_io(md_result_file); } } - if (extended_insert && init_dynamic_string(&extended_row, "", 1024, 1024)) - exit(EX_EOM); + if (extended_insert) + init_dynamic_string_checked(&extended_row, "", 1024, 1024); return 0; } /* init_dumping */ @@ -2876,11 +2940,11 @@ static int dump_all_tables_in_db(char *database) if (lock_tables) { DYNAMIC_STRING query; - init_dynamic_string(&query, "LOCK TABLES ", 256, 1024); + init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024); for (numrows= 0 ; (table= getTableName(1)) ; numrows++) { - dynstr_append(&query, quote_name(table, table_buff, 1)); - dynstr_append(&query, " READ /*!32311 LOCAL */,"); + dynstr_append_checked(&query, quote_name(table, table_buff, 1)); + dynstr_append_checked(&query, " READ /*!32311 LOCAL */,"); } if (numrows && mysql_real_query(mysql, query.str, query.length-1)) DB_error(mysql, "when using LOCK TABLES"); @@ -2953,11 +3017,11 @@ static my_bool dump_all_views_in_db(char *database) if (lock_tables) { DYNAMIC_STRING query; - init_dynamic_string(&query, "LOCK TABLES ", 256, 1024); + init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024); for (numrows= 0 ; (table= getTableName(1)); numrows++) { - dynstr_append(&query, quote_name(table, table_buff, 1)); - dynstr_append(&query, " READ /*!32311 LOCAL */,"); + dynstr_append_checked(&query, quote_name(table, table_buff, 1)); + dynstr_append_checked(&query, " READ /*!32311 LOCAL */,"); } if (numrows && mysql_real_query(mysql, query.str, query.length-1)) DB_error(mysql, "when using LOCK TABLES"); @@ -3009,9 +3073,7 @@ static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root) quote_for_like(old_table_name, show_name_buff)); if (mysql_query_with_error_report(mysql, 0, query)) - { - safe_exit(EX_MYSQLERR); - } + return NullS; if ((table_res= mysql_store_result(mysql))) { @@ -3047,9 +3109,9 @@ static int dump_selected_tables(char *db, char **table_names, int tables) init_alloc_root(&root, 8192, 0); if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *)))) - exit(EX_EOM); + die(EX_EOM, "alloc_root failure."); - init_dynamic_string(&lock_tables_query, "LOCK TABLES ", 256, 1024); + init_dynamic_string_checked(&lock_tables_query, "LOCK TABLES ", 256, 1024); for (; tables > 0 ; tables-- , table_names++) { /* the table name passed on commandline may be wrong case */ @@ -3058,16 +3120,14 @@ static int dump_selected_tables(char *db, char **table_names, int tables) /* Add found table name to lock_tables_query */ if (lock_tables) { - dynstr_append(&lock_tables_query, quote_name(*pos, table_buff, 1)); - dynstr_append(&lock_tables_query, " READ /*!32311 LOCAL */,"); + dynstr_append_checked(&lock_tables_query, quote_name(*pos, table_buff, 1)); + dynstr_append_checked(&lock_tables_query, " READ /*!32311 LOCAL */,"); } pos++; } else { - my_printf_error(0,"Couldn't find table: \"%s\"\n", MYF(0), - *table_names); - safe_exit(EX_ILLEGAL_TABLE); + maybe_die(EX_ILLEGAL_TABLE, "Couldn't find table: \"%s\"", *table_names); /* We shall countinue here, if --force was given */ } } @@ -3482,12 +3542,12 @@ static int replace(DYNAMIC_STRING *ds_str, const char *start= strstr(ds_str->str, search_str); if (!start) return 1; - init_dynamic_string(&ds_tmp, "", + init_dynamic_string_checked(&ds_tmp, "", ds_str->length + replace_len, 256); - dynstr_append_mem(&ds_tmp, ds_str->str, start - ds_str->str); - dynstr_append_mem(&ds_tmp, replace_str, replace_len); - dynstr_append(&ds_tmp, start + search_len); - dynstr_set(ds_str, ds_tmp.str); + dynstr_append_mem_checked(&ds_tmp, ds_str->str, start - ds_str->str); + dynstr_append_mem_checked(&ds_tmp, replace_str, replace_len); + dynstr_append_checked(&ds_tmp, start + search_len); + dynstr_set_checked(ds_str, ds_tmp.str); dynstr_free(&ds_tmp); return 0; } @@ -3533,10 +3593,7 @@ static my_bool get_view_structure(char *table, char* db) my_snprintf(query, sizeof(query), "SHOW CREATE TABLE %s", result_table); if (mysql_query_with_error_report(mysql, &table_res, query)) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); - } /* Check if this is a view */ field= mysql_fetch_field_direct(table_res, 0); @@ -3550,10 +3607,8 @@ static my_bool get_view_structure(char *table, char* db) if (path) { if (!(sql_file= open_sql_file_for_table(table))) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(1); - } + write_header(sql_file, db); } @@ -3599,14 +3654,14 @@ static my_bool get_view_structure(char *table, char* db) /* Save the result of SHOW CREATE TABLE in ds_view */ row= mysql_fetch_row(table_res); lengths= mysql_fetch_lengths(table_res); - init_dynamic_string(&ds_view, row[1], lengths[1] + 1, 1024); + init_dynamic_string_checked(&ds_view, row[1], lengths[1] + 1, 1024); mysql_free_result(table_res); /* Get the result from "select ... information_schema" */ if (!(table_res= mysql_store_result(mysql)) || !(row= mysql_fetch_row(table_res))) { - safe_exit(EX_MYSQLERR); + DB_error(mysql, "when trying to save the result of SHOW CREATE TABLE in ds_view."); DBUG_RETURN(1); } @@ -3678,6 +3733,45 @@ static my_bool get_view_structure(char *table, char* db) DBUG_RETURN(0); } +/* + The following functions are wrappers for the dynamic string functions + and if they fail, the wrappers will terminate the current process. +*/ + +#define DYNAMIC_STR_ERROR_MSG "Couldn't perform DYNAMIC_STRING operation" + +static void init_dynamic_string_checked(DYNAMIC_STRING *str, const char *init_str, + uint init_alloc, uint alloc_increment) +{ + if (init_dynamic_string(str, init_str, init_alloc, alloc_increment)) + die(EX_MYSQLERR, DYNAMIC_STR_ERROR_MSG); +} + +static void dynstr_append_checked(DYNAMIC_STRING* dest, const char* src) +{ + if (dynstr_append(dest, src)) + die(EX_MYSQLERR, DYNAMIC_STR_ERROR_MSG); +} + +static void dynstr_set_checked(DYNAMIC_STRING *str, const char *init_str) +{ + if (dynstr_set(str, init_str)) + die(EX_MYSQLERR, DYNAMIC_STR_ERROR_MSG); +} + +static void dynstr_append_mem_checked(DYNAMIC_STRING *str, const char *append, + uint length) +{ + if (dynstr_append_mem(str, append, length)) + die(EX_MYSQLERR, DYNAMIC_STR_ERROR_MSG); +} + +static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size) +{ + if (dynstr_realloc(str, additional_size)) + die(EX_MYSQLERR, DYNAMIC_STR_ERROR_MSG); +} + int main(int argc, char **argv) { diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 2d32984e4ef..df2effb2a72 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1567,29 +1567,17 @@ create table t3(a varchar(30) primary key, b int not null); test_sequence ------ Testing with illegal table names ------ mysqldump: Couldn't find table: "\d-2-1.sql" - mysqldump: Couldn't find table: "\t1" - mysqldump: Couldn't find table: "\t1" - mysqldump: Couldn't find table: "\\t1" - mysqldump: Couldn't find table: "t\1" - mysqldump: Couldn't find table: "t\1" - mysqldump: Couldn't find table: "t/1" - mysqldump: Couldn't find table: "T_1" - mysqldump: Couldn't find table: "T%1" - mysqldump: Couldn't find table: "T'1" - mysqldump: Couldn't find table: "T_1" - mysqldump: Couldn't find table: "T_" - test_sequence ------ Testing with illegal database names ------ mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database @@ -3218,5 +3206,12 @@ INSERT INTO t1 VALUES(1,0xff00fef0); DROP TABLE t1; # +# Bug#26346: stack + buffer overrun in mysqldump +# +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); +mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DROP TABLE t1; +# # End of 5.0 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 31741cdba9f..0b943e31fdb 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1429,6 +1429,30 @@ INSERT INTO t1 VALUES(1,0xff00fef0); DROP TABLE t1; + + +--echo # +--echo # Bug#26346: stack + buffer overrun in mysqldump +--echo # + +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); + +# too long a file path causes an error +--error 1 +--exec $MYSQL_DUMP --tab=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test 2>&1 + +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-terminated-by=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-enclosed-by=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-optionally-enclosed-by=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-escaped-by=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test +--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --lines-terminated-by=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test + +--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql +--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt + +DROP TABLE t1; + --echo # --echo # End of 5.0 tests --echo # From 7eb3881bd8c6b5c8dc705558414dbbe444804694 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 20:32:07 +0200 Subject: [PATCH 303/789] Fixed compiler warnings. mysys/default.c: Fixed bug. ndb/src/mgmclient/CommandInterpreter.cpp: Added parenthesis around the expression. sql/mysqld.cc: Fixed compiler warnings. Added a missing component in options struct (bug). sql-common/my_time.c: Removed garbage. sql/sql_table.cc: A possible use of a variable uninitialized. support-files/compiler_warnings.supp: BitKeeper file /home/my/bk/mysql-4.1-main/support-files/compiler_warnings.supp --- client/mysqlbinlog.cc | 2 +- client/mysqldump.c | 2 +- client/sql_string.cc | 4 +- extra/perror.c | 4 +- heap/_check.c | 10 ++--- heap/hp_delete.c | 4 +- heap/hp_hash.c | 2 +- heap/hp_open.c | 7 +-- heap/hp_rkey.c | 2 +- heap/hp_rrnd.c | 8 ++-- heap/hp_write.c | 6 +-- include/raid.h | 4 +- isam/_dynrec.c | 4 +- isam/_page.c | 4 +- isam/_search.c | 15 ++++--- isam/close.c | 6 +-- isam/delete.c | 9 ++-- isam/open.c | 2 +- isam/rkey.c | 4 +- isam/sort.c | 2 +- isam/write.c | 14 +++--- libmysql/libmysql.c | 15 ++++--- libmysqld/libmysqld.c | 2 +- myisam/mi_close.c | 5 ++- myisam/mi_delete.c | 11 ++--- myisam/mi_dynrec.c | 5 ++- myisam/mi_keycache.c | 5 ++- myisam/mi_page.c | 4 +- myisam/mi_statrec.c | 2 +- myisam/myisamchk.c | 1 + myisammrg/myrg_extra.c | 2 +- mysys/default.c | 2 +- mysys/hash.c | 16 ++++--- mysys/list.c | 3 +- mysys/mf_iocache.c | 11 +++-- mysys/mf_keycache.c | 30 ++++++------- mysys/mf_keycaches.c | 4 +- mysys/my_alloc.c | 5 ++- mysys/my_dup.c | 2 +- mysys/my_fopen.c | 6 +-- mysys/my_fstream.c | 8 ++-- mysys/my_getwd.c | 3 +- mysys/my_handler.c | 5 ++- mysys/my_lib.c | 2 +- mysys/my_lread.c | 4 +- mysys/my_lwrite.c | 4 +- mysys/my_malloc.c | 4 +- mysys/my_pread.c | 8 ++-- mysys/my_read.c | 4 +- mysys/my_realloc.c | 6 +-- mysys/my_seek.c | 2 +- mysys/my_tempnam.c | 2 +- mysys/my_write.c | 2 +- mysys/raid.cc | 37 ++++++++-------- mysys/safemalloc.c | 10 ++--- mysys/thr_lock.c | 15 ++++--- mysys/tree.c | 4 +- mysys/typelib.c | 2 +- ndb/src/mgmclient/CommandInterpreter.cpp | 4 +- regex/regexec.c | 3 +- sql-common/client.c | 12 ++--- sql-common/my_time.c | 2 +- sql/examples/ha_archive.cc | 3 +- sql/ha_innodb.cc | 4 +- sql/ha_ndbcluster.cc | 36 ++++++++------- sql/item.cc | 2 + sql/item_cmpfunc.cc | 6 +-- sql/item_subselect.cc | 2 +- sql/log.cc | 4 +- sql/log_event.cc | 6 +-- sql/mysqld.cc | 9 ++-- sql/net_serv.cc | 2 +- sql/opt_range.cc | 2 +- sql/slave.cc | 12 ++--- sql/sql_cache.cc | 22 +++++----- sql/sql_class.cc | 12 ++--- sql/sql_delete.cc | 2 +- sql/sql_parse.cc | 8 ++-- sql/sql_prepare.cc | 2 +- sql/sql_repl.cc | 4 +- sql/sql_select.cc | 1 + sql/sql_table.cc | 2 +- sql/sql_update.cc | 4 +- sql/strfunc.cc | 2 +- sql/table.cc | 2 +- sql/tztime.cc | 4 +- sql/unireg.cc | 4 +- support-files/compiler_warnings.supp | 56 ++++++++++++++++++++++++ tests/mysql_client_test.c | 5 ++- 89 files changed, 353 insertions(+), 254 deletions(-) create mode 100644 support-files/compiler_warnings.supp diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 77240a2c750..3f3771e6441 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -834,7 +834,7 @@ static int dump_remote_log_entries(const char* logname) } if (len < 8 && net->read_pos[0] == 254) break; // end of data - DBUG_PRINT("info",( "len= %u, net->read_pos[5] = %d\n", + DBUG_PRINT("info",( "len: %lu net->read_pos[5]: %d\n", len, net->read_pos[5])); Log_event *ev = Log_event::read_log_event((const char*) net->read_pos + 1 , len - 1, &error_msg, old_format); diff --git a/client/mysqldump.c b/client/mysqldump.c index 3bf9fff1b86..e9d48f3edfa 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2654,7 +2654,7 @@ int main(int argc, char **argv) default_charset= (char *)mysql_universal_client_charset; bzero((char*) &ignore_table, sizeof(ignore_table)); - MY_INIT("mysqldump"); + MY_INIT(argv[0]); if (get_options(&argc, &argv)) { my_end(0); diff --git a/client/sql_string.cc b/client/sql_string.cc index 690997152f1..1f007fd3a17 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -103,7 +103,7 @@ bool String::set(longlong num, CHARSET_INFO *cs) } else { - str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num); + str_length=cs->cset->snprintf(cs,Ptr,l,"%ld", (long) num); } str_charset=cs; return FALSE; @@ -121,7 +121,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs) } else { - str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num); + str_length=cs->cset->snprintf(cs,Ptr,l,"%ld", (long) num); } str_charset=cs; return FALSE; diff --git a/extra/perror.c b/extra/perror.c index 764f54eafe3..e5c256aadf3 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -253,7 +253,9 @@ int main(int argc,char *argv[]) 'Unknown Error' (without regard to case). */ if (msg && - my_strnncoll(&my_charset_latin1, msg, 13, "Unknown Error", 13) && + my_strnncoll(&my_charset_latin1, + (const uchar *) msg, 13, + (const uchar *) "Unknown Error", 13) && (!unknown_error || strcmp(msg, unknown_error))) { found=1; diff --git a/heap/_check.c b/heap/_check.c index ad432856a69..6540f46454b 100644 --- a/heap/_check.c +++ b/heap/_check.c @@ -87,7 +87,7 @@ int heap_check_heap(HP_INFO *info, my_bool print_status) if (records != share->records || deleted != share->deleted) { - DBUG_PRINT("error",("Found rows: %lu (%lu) deleted %lu (%lu)", + DBUG_PRINT("error",("Found rows: %lu (%u) deleted %lu (%u)", records, share->records, deleted, share->deleted)); error= 1; } @@ -123,7 +123,7 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, blength, records)) != i) { - DBUG_PRINT("error",("Record in wrong link: Link %d Record: %lx Record-link %d", i,hash_info->ptr_to_rec,rec_link)); + DBUG_PRINT("error",("Record in wrong link: Link %d Record: %lx Record-link %d", i, (ulong) hash_info->ptr_to_rec, rec_link)); error=1; } else @@ -135,12 +135,12 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, } if (found != records) { - DBUG_PRINT("error",("Found %ld of %ld records", found, records)); + DBUG_PRINT("error",("Found %u of %ld records", found, records)); error=1; } if (keydef->hash_buckets != hash_buckets_found) { - DBUG_PRINT("error",("Found %ld buckets, stats shows %ld buckets", + DBUG_PRINT("error",("Found %u buckets, stats shows %ld buckets", hash_buckets_found, keydef->hash_buckets)); error=1; } @@ -181,7 +181,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records, { error= 1; DBUG_PRINT("error",("Record in wrong link: key: %d Record: %lx\n", - keynr, recpos)); + keynr, (ulong) recpos)); } else found++; diff --git a/heap/hp_delete.c b/heap/hp_delete.c index 266a9da6ca3..2e57d6393e9 100644 --- a/heap/hp_delete.c +++ b/heap/hp_delete.c @@ -24,7 +24,7 @@ int heap_delete(HP_INFO *info, const byte *record) HP_SHARE *share=info->s; HP_KEYDEF *keydef, *end, *p_lastinx; DBUG_ENTER("heap_delete"); - DBUG_PRINT("enter",("info: %lx record: %lx",info,record)); + DBUG_PRINT("enter",("info: %lx record: %lx", (ulong) info, (ulong) record)); test_active(info); @@ -143,7 +143,7 @@ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, info->current_hash_ptr=last_ptr; info->current_ptr = last_ptr ? last_ptr->ptr_to_rec : 0; DBUG_PRINT("info",("Corrected current_ptr to point at: %lx", - info->current_ptr)); + (ulong) info->current_ptr)); } empty=pos; if (gpos) diff --git a/heap/hp_hash.c b/heap/hp_hash.c index ee5b4958e62..8d2aa5e9fe9 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -120,7 +120,7 @@ byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key, { switch (nextflag) { case 0: /* Search after key */ - DBUG_PRINT("exit",("found key at %d",pos->ptr_to_rec)); + DBUG_PRINT("exit",("found key at %lu", (ulong) pos->ptr_to_rec)); info->current_hash_ptr=pos; DBUG_RETURN(info->current_ptr= pos->ptr_to_rec); case 1: /* Search next */ diff --git a/heap/hp_open.c b/heap/hp_open.c index 1fa832208fb..a51c458171e 100644 --- a/heap/hp_open.c +++ b/heap/hp_open.c @@ -63,8 +63,9 @@ HP_INFO *heap_open(const char *name, int mode) #ifndef DBUG_OFF info->opt_flag= READ_CHECK_USED; /* Check when changing */ #endif - DBUG_PRINT("exit",("heap: %lx reclength: %d records_in_block: %d", - info,share->reclength,share->block.records_in_block)); + DBUG_PRINT("exit",("heap: 0x%lx reclength: %d records_in_block: %d", + (ulong) info, share->reclength, + share->block.records_in_block)); DBUG_RETURN(info); } @@ -82,7 +83,7 @@ HP_SHARE *hp_find_named_heap(const char *name) info= (HP_SHARE*) pos->data; if (!strcmp(name, info->name)) { - DBUG_PRINT("exit", ("Old heap_database: %lx",info)); + DBUG_PRINT("exit", ("Old heap_database: 0x%lx", (ulong) info)); DBUG_RETURN(info); } } diff --git a/heap/hp_rkey.c b/heap/hp_rkey.c index 2c23d9d721e..eac8dbd6903 100644 --- a/heap/hp_rkey.c +++ b/heap/hp_rkey.c @@ -23,7 +23,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, HP_SHARE *share= info->s; HP_KEYDEF *keyinfo= share->keydef + inx; DBUG_ENTER("heap_rkey"); - DBUG_PRINT("enter",("base: %lx inx: %d",info,inx)); + DBUG_PRINT("enter",("base: 0x%lx inx: %d", (ulong) info, inx)); if ((uint) inx >= share->keys) { diff --git a/heap/hp_rrnd.c b/heap/hp_rrnd.c index cce3ce24e51..51bbbfc141e 100644 --- a/heap/hp_rrnd.c +++ b/heap/hp_rrnd.c @@ -29,7 +29,7 @@ int heap_rrnd(register HP_INFO *info, byte *record, byte *pos) { HP_SHARE *share=info->s; DBUG_ENTER("heap_rrnd"); - DBUG_PRINT("enter",("info: %lx pos: %lx",info,pos)); + DBUG_PRINT("enter",("info: 0x%lx pos: 0x%lx", (ulong) info, (ulong) pos)); info->lastinx= -1; if (!(info->current_ptr= pos)) @@ -44,7 +44,7 @@ int heap_rrnd(register HP_INFO *info, byte *record, byte *pos) } info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV; memcpy(record,info->current_ptr,(size_t) share->reclength); - DBUG_PRINT("exit",("found record at %lx",info->current_ptr)); + DBUG_PRINT("exit",("found record at 0x%lx", (ulong) info->current_ptr)); info->current_hash_ptr=0; /* Can't use rnext */ DBUG_RETURN(0); } /* heap_rrnd */ @@ -64,7 +64,7 @@ int heap_rrnd_old(register HP_INFO *info, byte *record, ulong pos) { HP_SHARE *share=info->s; DBUG_ENTER("heap_rrnd"); - DBUG_PRINT("enter",("info: %lx pos: %ld",info,pos)); + DBUG_PRINT("enter",("info: 0x%lx pos: %ld",info,pos)); info->lastinx= -1; if (pos == (ulong) -1) @@ -98,7 +98,7 @@ end: } info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV; memcpy(record,info->current_ptr,(size_t) share->reclength); - DBUG_PRINT("exit",("found record at %lx",info->current_ptr)); + DBUG_PRINT("exit",("found record at 0x%lx",info->current_ptr)); info->current_hash_ptr=0; /* Can't use rnext */ DBUG_RETURN(0); } /* heap_rrnd */ diff --git a/heap/hp_write.c b/heap/hp_write.c index 841dda6264e..b79b03477f5 100644 --- a/heap/hp_write.c +++ b/heap/hp_write.c @@ -144,7 +144,7 @@ static byte *next_free_record_pos(HP_SHARE *info) pos=info->del_link; info->del_link= *((byte**) pos); info->deleted--; - DBUG_PRINT("exit",("Used old position: %lx",pos)); + DBUG_PRINT("exit",("Used old position: 0x%lx", (ulong) pos)); DBUG_RETURN(pos); } if (!(block_pos=(info->records % info->block.records_in_block))) @@ -159,8 +159,8 @@ static byte *next_free_record_pos(HP_SHARE *info) DBUG_RETURN(NULL); info->data_length+=length; } - DBUG_PRINT("exit",("Used new position: %lx", - (byte*) info->block.level_info[0].last_blocks+block_pos* + DBUG_PRINT("exit",("Used new position: 0x%lx", + (ulong) info->block.level_info[0].last_blocks+block_pos* info->block.recbuffer)); DBUG_RETURN((byte*) info->block.level_info[0].last_blocks+ block_pos*info->block.recbuffer); diff --git a/include/raid.h b/include/raid.h index c840afcbaab..ec27eccdf3e 100644 --- a/include/raid.h +++ b/include/raid.h @@ -141,7 +141,7 @@ class RaidFd { inline void Calculate() { DBUG_ENTER("RaidFd::_Calculate"); - DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu", + DBUG_PRINT("info",("_position: %lu _raid_chunksize: %lu _size: %lu", (ulong) _position, _raid_chunksize, (ulong) _size)); _total_block = (ulong) (_position / _raid_chunksize); @@ -149,7 +149,7 @@ class RaidFd { _remaining_bytes = (uint) (_raid_chunksize - (_position - _total_block * _raid_chunksize)); DBUG_PRINT("info", - ("_total_block: %d this_block: %d _remaining_bytes:%d", + ("_total_block: %lu this_block: %d _remaining_bytes: %d", _total_block, _this_block, _remaining_bytes)); DBUG_VOID_RETURN; } diff --git a/isam/_dynrec.c b/isam/_dynrec.c index 25fe01e23f2..c158068eb83 100644 --- a/isam/_dynrec.c +++ b/isam/_dynrec.c @@ -713,8 +713,8 @@ uint _nisam_rec_unpack(register N_INFO *info, register byte *to, byte *from, DBUG_RETURN((info->packed_length=found_length)); err: my_errno=HA_ERR_RECORD_DELETED; - DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx", - to,to_end,from,from_end)); + DBUG_PRINT("error",("to_end: 0x%lx -> 0x%lx from_end: 0x%lx -> 0x%lx", + (long) to, (long) to_end, (long) from, (long) from_end)); DBUG_DUMP("from",(byte*) info->rec_buff,info->s->base.min_pack_length); DBUG_RETURN(MY_FILE_ERROR); } /* _nisam_rec_unpack */ diff --git a/isam/_page.c b/isam/_page.c index e31115e624f..36626ba186b 100644 --- a/isam/_page.c +++ b/isam/_page.c @@ -70,7 +70,7 @@ int _nisam_write_keypage(register N_INFO *info, register N_KEYDEF *keyinfo, my_errno=EINVAL; return(-1); } - DBUG_PRINT("page",("write page at: %lu",(long) page,buff)); + DBUG_PRINT("page",("write page at: %lu", (long) page)); DBUG_DUMP("buff",(byte*) buff,getint(buff)); #endif @@ -138,6 +138,6 @@ ulong _nisam_new(register N_INFO *info, N_KEYDEF *keyinfo) (uint) keyinfo->base.block_length,0)) pos= NI_POS_ERROR; } - DBUG_PRINT("exit",("Pos: %d",pos)); + DBUG_PRINT("exit",("Pos: %lu", pos)); DBUG_RETURN(pos); } /* _nisam_new */ diff --git a/isam/_search.c b/isam/_search.c index fbffd6786e1..a2a3b096ea1 100644 --- a/isam/_search.c +++ b/isam/_search.c @@ -208,14 +208,15 @@ int _nisam_seq_search(N_INFO *info, register N_KEYDEF *keyinfo, uchar *page, uch if ((flag=_nisam_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag)) >= 0) break; #ifdef EXTRA_DEBUG - DBUG_PRINT("loop",("page: %lx key: '%s' flag: %d",page,t_buff,flag)); + DBUG_PRINT("loop",("page: 0x%lx key: '%s' flag: %d", + (long) page, t_buff, flag)); #endif memcpy(buff,t_buff,length); *ret_pos=page; } if (flag == 0) memcpy(buff,t_buff,length); /* Result is first key */ - DBUG_PRINT("exit",("flag: %d ret_pos: %lx",flag,*ret_pos)); + DBUG_PRINT("exit",("flag: %d ret_pos: 0x%lx", flag, (long) *ret_pos)); DBUG_RETURN(flag); } /* _nisam_seq_search */ @@ -754,8 +755,8 @@ int _nisam_search_next(register N_INFO *info, register N_KEYDEF *keyinfo, uint nod_flag; uchar lastkey[N_MAX_KEY_BUFF]; DBUG_ENTER("_nisam_search_next"); - DBUG_PRINT("enter",("nextflag: %d lastpos: %d int_keypos: %lx", - nextflag,info->lastpos,info->int_keypos)); + DBUG_PRINT("enter",("nextflag: %u lastpos: %lu int_keypos: 0x%lx", + nextflag, info->lastpos, (long) info->int_keypos)); DBUG_EXECUTE("key",_nisam_print_key(DBUG_FILE,keyinfo->seg,key);); if ((nextflag & SEARCH_BIGGER && info->int_keypos >= info->int_maxpos) || @@ -807,7 +808,7 @@ int _nisam_search_next(register N_INFO *info, register N_KEYDEF *keyinfo, VOID(_nisam_move_key(keyinfo,info->lastkey,lastkey)); VOID((*keyinfo->get_key)(keyinfo,nod_flag,&info->int_keypos,info->lastkey)); info->lastpos=_nisam_dpos(info,nod_flag,info->int_keypos); - DBUG_PRINT("exit",("found key at %d",info->lastpos)); + DBUG_PRINT("exit",("found key at %lu", info->lastpos)); DBUG_RETURN(0); } /* _nisam_search_next */ @@ -845,7 +846,7 @@ int _nisam_search_first(register N_INFO *info, register N_KEYDEF *keyinfo, regis info->page_changed=info->buff_used=0; info->last_search_keypage=info->int_pos; - DBUG_PRINT("exit",("found key at %d",info->lastpos)); + DBUG_PRINT("exit",("found key at %lu", info->lastpos)); DBUG_RETURN(0); } /* _nisam_search_first */ @@ -884,6 +885,6 @@ int _nisam_search_last(register N_INFO *info, register N_KEYDEF *keyinfo, regist info->page_changed=info->buff_used=0; info->last_search_keypage=info->int_pos; - DBUG_PRINT("exit",("found key at %d",info->lastpos)); + DBUG_PRINT("exit",("found key at %lu", info->lastpos)); DBUG_RETURN(0); } /* _nisam_search_last */ diff --git a/isam/close.c b/isam/close.c index 37425653a5d..59ab91d944e 100644 --- a/isam/close.c +++ b/isam/close.c @@ -23,9 +23,9 @@ int nisam_close(register N_INFO *info) int error=0,flag; ISAM_SHARE *share=info->s; DBUG_ENTER("nisam_close"); - DBUG_PRINT("enter",("base: %lx reopen: %u locks: %u", - info,(uint) share->reopen, - (uint) (share->w_locks+share->r_locks))); + DBUG_PRINT("enter",("base: 0x%lx reopen: %u locks: %u", + (long) info, (uint) share->reopen, + (uint) (share->w_locks + share->r_locks))); pthread_mutex_lock(&THR_LOCK_isam); if (info->lock_type == F_EXTRA_LCK) diff --git a/isam/delete.c b/isam/delete.c index 5aa542561c1..d6dbd19bd53 100644 --- a/isam/delete.c +++ b/isam/delete.c @@ -258,7 +258,8 @@ static int del(register N_INFO *info, register N_KEYDEF *keyinfo, uchar *key, ISAM_SHARE *share=info->s; S_PARAM s_temp; DBUG_ENTER("del"); - DBUG_PRINT("enter",("leaf_page: %ld keypos: %lx",leaf_page,keypos)); + DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", + (long) leaf_page, (long) keypos)); DBUG_DUMP("leaf_buff",(byte*) leaf_buff,getint(leaf_buff)); endpos=leaf_buff+getint(leaf_buff); @@ -349,7 +350,8 @@ static int underflow(register N_INFO *info, register N_KEYDEF *keyinfo, S_PARAM s_temp; ISAM_SHARE *share=info->s; DBUG_ENTER("underflow"); - DBUG_PRINT("enter",("leaf_page: %ld keypos: %lx",leaf_page,keypos)); + DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", + leaf_page, (long) keypos)); DBUG_DUMP("anc_buff",(byte*) anc_buff,getint(anc_buff)); DBUG_DUMP("leaf_buff",(byte*) leaf_buff,getint(leaf_buff)); @@ -558,7 +560,8 @@ static uint remove_key(N_KEYDEF *keyinfo, uint nod_flag, int r_length,s_length,first,diff_flag; uchar *start; DBUG_ENTER("remove_key"); - DBUG_PRINT("enter",("keypos: %lx page_end: %lx",keypos,page_end)); + DBUG_PRINT("enter",("keypos: 0x%lx page_end: 0x%lx", + (long) keypos, (long) page_end)); start=keypos; if (!(keyinfo->base.flag & (HA_PACK_KEY | HA_SPACE_PACK_USED))) diff --git a/isam/open.c b/isam/open.c index be62fd86192..39c33c877af 100644 --- a/isam/open.c +++ b/isam/open.c @@ -116,7 +116,7 @@ N_INFO *nisam_open(const char *name, int mode, uint handle_locking) HA_OPTION_TEMP_COMPRESS_RECORD)) { DBUG_PRINT("error",("wrong options: 0x%lx", - uint2korr(share->state.header.options))); + (long) uint2korr(share->state.header.options))); my_errno=HA_ERR_OLD_FILE; goto err; } diff --git a/isam/rkey.c b/isam/rkey.c index bbe4576418b..ee7b9d3ad40 100644 --- a/isam/rkey.c +++ b/isam/rkey.c @@ -27,8 +27,8 @@ int nisam_rkey(N_INFO *info, byte *buf, int inx, const byte *key, uint key_len, uchar *key_buff; ISAM_SHARE *share=info->s; DBUG_ENTER("nisam_rkey"); - DBUG_PRINT("enter",("base: %lx inx: %d search_flag: %d", - info,inx,search_flag)); + DBUG_PRINT("enter",("base: 0x%lx inx: %d search_flag: %d", + (long) info, inx, search_flag)); if ((inx = _nisam_check_index(info,inx)) < 0) DBUG_RETURN(-1); diff --git a/isam/sort.c b/isam/sort.c index 5d13f8085d2..64dcb405157 100644 --- a/isam/sort.c +++ b/isam/sort.c @@ -542,7 +542,7 @@ my_string name; #if O_TEMPORARY == 0 && !defined(CANT_DELETE_OPEN_FILES) VOID(my_delete(name,MYF(MY_WME | ME_NOINPUT))); #endif - DBUG_PRINT("exit",("stream: %lx",stream)); + DBUG_PRINT("exit",("stream: 0x%lx", (long) stream)); DBUG_RETURN (stream); } /* opentemp */ diff --git a/isam/write.c b/isam/write.c index f2c0d8dbc45..2147c7cd59e 100644 --- a/isam/write.c +++ b/isam/write.c @@ -226,7 +226,7 @@ int _nisam_insert(register N_INFO *info, register N_KEYDEF *keyinfo, int key_offset; S_PARAM s_temp; DBUG_ENTER("_nisam_insert"); - DBUG_PRINT("enter",("key_pos: %lx",key_pos)); + DBUG_PRINT("enter",("key_pos: 0x%lx", (long) key_pos)); DBUG_EXECUTE("key",_nisam_print_key(DBUG_FILE,keyinfo->seg,key);); nod_flag=test_if_nod(anc_buff); @@ -243,8 +243,9 @@ int _nisam_insert(register N_INFO *info, register N_KEYDEF *keyinfo, { DBUG_PRINT("test",("t_length: %d ref_len: %d", t_length,s_temp.ref_length)); - DBUG_PRINT("test",("n_ref_len: %d n_length: %d key: %lx", - s_temp.n_ref_length,s_temp.n_length,s_temp.key)); + DBUG_PRINT("test",("n_ref_len: %d n_length: %d key: 0x%lx", + s_temp.n_ref_length, s_temp.n_length, + (long) s_temp.key)); } #endif key_offset = (uint)(endpos-key_pos); @@ -430,7 +431,7 @@ uint _nisam_get_pack_key_length(N_KEYDEF *keyinfo, uint nod_flag, uchar *key_pos if (*start == *key_pos && diff_flag && start != key_end) length++; /* One new pos for ref.len */ - DBUG_PRINT("test",("length: %d key_pos: %lx",length,key_pos)); + DBUG_PRINT("test",("length: %d key_pos: 0x%lx",length,key_pos)); if (n_length != 128) { /* Not same key after */ key=start+ref_length; @@ -597,7 +598,7 @@ _nisam_get_pack_key_length(N_KEYDEF *keyinfo, if (*start == *key_pos && diff_flag && start != key_end) length++; /* One new pos for ref.len */ } - DBUG_PRINT("test",("length: %d key_pos: %lx",length,key_pos)); + DBUG_PRINT("test",("length: %d key_pos: 0x%lx", length, (long) key_pos)); key=start+ref_length; while (n_length > 0 && key < key_end && *key == *key_pos) @@ -696,7 +697,8 @@ uchar *_nisam_find_half_pos(N_INFO *info, N_KEYDEF *keyinfo, uchar *page, uchar VOID((*keyinfo->get_key)(keyinfo,nod_flag,&page,key)); } while (page < end); - DBUG_PRINT("exit",("returns: %lx page: %lx half: %lx",lastpos,page,end)); + DBUG_PRINT("exit",("returns: 0x%lx page: 0x%lx half: 0x%lx", + (long) lastpos, (long) page, (long) end)); DBUG_RETURN(lastpos); } /* _nisam_find_half_pos */ diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e963c0e429c..3102476a803 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2124,7 +2124,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) } stmt->bind= stmt->params + stmt->param_count; stmt->state= MYSQL_STMT_PREPARE_DONE; - DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count)); + DBUG_PRINT("info", ("Parameter count: %u", stmt->param_count)); DBUG_RETURN(0); } @@ -2461,9 +2461,10 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) { NET *net= &stmt->mysql->net; DBUG_ENTER("store_param"); - DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu is_null: %d", + DBUG_PRINT("enter",("type: %d buffer: 0x%lx length: %lu is_null: %d", param->buffer_type, - param->buffer ? param->buffer : "0", *param->length, + (long) (param->buffer ? param->buffer : NullS), + *param->length, *param->is_null)); if (*param->is_null) @@ -2499,7 +2500,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) my_bool res; DBUG_ENTER("execute"); - DBUG_PRINT("enter",("packet: %s, length :%d",packet ? packet :" ", length)); + DBUG_PRINT("enter",("packet: %s, length :%lu", packet ? packet : " ", length)); mysql->last_used_con= mysql; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ @@ -3239,8 +3240,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, MYSQL_BIND *param; DBUG_ENTER("mysql_stmt_send_long_data"); DBUG_ASSERT(stmt != 0); - DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld", - param_number, data, length)); + DBUG_PRINT("enter",("param no: %d data: 0x%lx length: %ld", + param_number, (ulong) data, length)); /* We only need to check for stmt->param_count, if it's not null @@ -3960,7 +3961,7 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) ulong bind_count= stmt->field_count; uint param_count= 0; DBUG_ENTER("mysql_stmt_bind_result"); - DBUG_PRINT("enter",("field_count: %d", bind_count)); + DBUG_PRINT("enter",("field_count: %lu", bind_count)); if (!bind_count) { diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 0b21d11df31..9e88085a616 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -191,7 +191,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, } } - DBUG_PRINT("exit",("Mysql handler: %lx",mysql)); + DBUG_PRINT("exit",("Mysql handler: 0x%lx", (ulong) mysql)); DBUG_RETURN(mysql); error: diff --git a/myisam/mi_close.c b/myisam/mi_close.c index 62f5617de1a..8a4f6ee7f5d 100644 --- a/myisam/mi_close.c +++ b/myisam/mi_close.c @@ -28,8 +28,9 @@ int mi_close(register MI_INFO *info) int error=0,flag; MYISAM_SHARE *share=info->s; DBUG_ENTER("mi_close"); - DBUG_PRINT("enter",("base: %lx reopen: %u locks: %u", - info,(uint) share->reopen, (uint) share->tot_locks)); + DBUG_PRINT("enter",("base: 0x%lx reopen: %u locks: %u", + (long) info, (uint) share->reopen, + (uint) share->tot_locks)); pthread_mutex_lock(&THR_LOCK_myisam); if (info->lock_type == F_EXTRA_LCK) diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c index 9bbf10bc38a..76e6a9d7f91 100644 --- a/myisam/mi_delete.c +++ b/myisam/mi_delete.c @@ -152,7 +152,7 @@ static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo, DBUG_PRINT("error",("Couldn't allocate memory")); DBUG_RETURN(my_errno=ENOMEM); } - DBUG_PRINT("info",("root_page: %ld",old_root)); + DBUG_PRINT("info",("root_page: %lu", (ulong) old_root)); if (!_mi_fetch_keypage(info,keyinfo,old_root,DFLT_INIT_HITS,root_buff,0)) { error= -1; @@ -392,7 +392,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key, MYISAM_SHARE *share=info->s; MI_KEY_PARAM s_temp; DBUG_ENTER("del"); - DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", leaf_page, + DBUG_PRINT("enter",("leaf_page: %lu keypos: 0x%lx", (ulong) leaf_page, (ulong) keypos)); DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff)); @@ -579,7 +579,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo, else { /* Page is full */ endpos=anc_buff+anc_length; - DBUG_PRINT("test",("anc_buff: %lx endpos: %lx",anc_buff,endpos)); + DBUG_PRINT("test",("anc_buff: 0x%lx endpos: 0x%lx", (long) anc_buff, + (long) endpos)); if (keypos != anc_buff+2+key_reflength && !_mi_get_last_key(info,keyinfo,anc_buff,anc_key,keypos,&length)) goto err; @@ -756,8 +757,8 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag, int s_length; uchar *start; DBUG_ENTER("remove_key"); - DBUG_PRINT("enter",("keypos: %lx page_end: %lx",keypos,page_end)); - + DBUG_PRINT("enter",("keypos: 0x%lx page_end: 0x%lx", (long) keypos, + (long) page_end)); start=keypos; if (!(keyinfo->flag & (HA_PACK_KEY | HA_SPACE_PACK_USED | HA_VAR_LENGTH_KEY | diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index 260f461685e..7e57202c38d 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -1029,8 +1029,9 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from, DBUG_RETURN(found_length); err: my_errno=HA_ERR_RECORD_DELETED; - DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx", - to,to_end,from,from_end)); + DBUG_PRINT("error",("to_end: 0x%lx -> 0x%lx from_end: 0x%lx -> 0x%lx", + (ulong) to, (ulong) to_end, (ulong) from, + (ulong) from_end)); DBUG_DUMP("from",(byte*) info->rec_buff,info->s->base.min_pack_length); DBUG_RETURN(MY_FILE_ERROR); } /* _mi_rec_unpack */ diff --git a/myisam/mi_keycache.c b/myisam/mi_keycache.c index 99a2fd6db15..a1c4f841dd2 100644 --- a/myisam/mi_keycache.c +++ b/myisam/mi_keycache.c @@ -54,8 +54,9 @@ int mi_assign_to_key_cache(MI_INFO *info, int error= 0; MYISAM_SHARE* share= info->s; DBUG_ENTER("mi_assign_to_key_cache"); - DBUG_PRINT("enter",("old_key_cache_handle: %lx new_key_cache_handle: %lx", - share->key_cache, key_cache)); + DBUG_PRINT("enter", + ("old_key_cache_handle: 0x%lx new_key_cache_handle: 0x%lx", + (long) share->key_cache, (long) key_cache)); /* Skip operation if we didn't change key cache. This can happen if we diff --git a/myisam/mi_page.c b/myisam/mi_page.c index 16713c87e10..103f6f536f4 100644 --- a/myisam/mi_page.c +++ b/myisam/mi_page.c @@ -27,7 +27,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo, uchar *tmp; uint page_size; DBUG_ENTER("_mi_fetch_keypage"); - DBUG_PRINT("enter",("page: %ld",page)); + DBUG_PRINT("enter",("page: %ld", (long) page)); tmp=(uchar*) key_cache_read(info->s->key_cache, info->s->kfile, page, level, (byte*) buff, @@ -78,7 +78,7 @@ int _mi_write_keypage(register MI_INFO *info, register MI_KEYDEF *keyinfo, my_errno=EINVAL; DBUG_RETURN((-1)); } - DBUG_PRINT("page",("write page at: %lu",(long) page,buff)); + DBUG_PRINT("page",("write page at: %lu",(long) page)); DBUG_DUMP("buff",(byte*) buff,mi_getint(buff)); #endif diff --git a/myisam/mi_statrec.c b/myisam/mi_statrec.c index 8f5cde45e24..951d390ba4f 100644 --- a/myisam/mi_statrec.c +++ b/myisam/mi_statrec.c @@ -254,7 +254,7 @@ int _mi_read_rnd_static_record(MI_INFO *info, byte *buf, if (filepos >= info->state->data_file_length) { DBUG_PRINT("test",("filepos: %ld (%ld) records: %ld del: %ld", - filepos/share->base.reclength,filepos, + (long) filepos/share->base.reclength, (long) filepos, info->state->records, info->state->del)); fast_mi_writeinfo(info); DBUG_RETURN(my_errno=HA_ERR_END_OF_FILE); diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 49e3ea0f142..962d6a0c383 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -721,6 +721,7 @@ get_one_option(int optid, case 2: method_conv= MI_STATS_METHOD_IGNORE_NULLS; break; + default: assert(0); /* Impossible */ } check_param.stats_method= method_conv; break; diff --git a/myisammrg/myrg_extra.c b/myisammrg/myrg_extra.c index 62cf5f01aba..3f133780e23 100644 --- a/myisammrg/myrg_extra.c +++ b/myisammrg/myrg_extra.c @@ -28,7 +28,7 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function, int error,save_error=0; MYRG_TABLE *file; DBUG_ENTER("myrg_extra"); - DBUG_PRINT("info",("function: %d",(ulong) function)); + DBUG_PRINT("info",("function: %lu",(ulong) function)); if (function == HA_EXTRA_CACHE) { diff --git a/mysys/default.c b/mysys/default.c index fadf6efbc5b..4c99ae4cbf9 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -491,7 +491,7 @@ static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, ext= fn_ext(search_file->name); /* check extension */ - for (tmp_ext= (char**) f_extensions; *tmp_ext; *tmp_ext++) + for (tmp_ext= (char**) f_extensions; *tmp_ext; tmp_ext++) { if (!strcmp(ext, *tmp_ext)) break; diff --git a/mysys/hash.c b/mysys/hash.c index 75135a470c9..5d83dae0faa 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -53,7 +53,7 @@ _hash_init(HASH *hash,CHARSET_INFO *charset, void (*free_element)(void*),uint flags CALLER_INFO_PROTO) { DBUG_ENTER("hash_init"); - DBUG_PRINT("enter",("hash: 0x%lx size: %d",hash,size)); + DBUG_PRINT("enter",("hash: 0x%lx size: %d", (long) hash, size)); hash->records=0; if (my_init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0)) @@ -109,7 +109,7 @@ static inline void hash_free_elements(HASH *hash) void hash_free(HASH *hash) { DBUG_ENTER("hash_free"); - DBUG_PRINT("enter",("hash: 0x%lxd",hash)); + DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash)); hash_free_elements(hash); hash->free= 0; @@ -129,7 +129,7 @@ void hash_free(HASH *hash) void my_hash_reset(HASH *hash) { DBUG_ENTER("my_hash_reset"); - DBUG_PRINT("enter",("hash: 0x%lxd",hash)); + DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash)); hash_free_elements(hash); reset_dynamic(&hash->array); @@ -645,7 +645,9 @@ my_bool hash_check(HASH *hash) if ((rec_link=hash_rec_mask(hash,hash_info,blength,records)) != i) { DBUG_PRINT("error", - ("Record in wrong link at %d: Start %d Record: 0x%lx Record-link %d", idx,i,hash_info->data,rec_link)); + ("Record in wrong link at %d: " + "Start %d Record: 0x%lx Record-link %d", + idx, i, (long) hash_info->data, rec_link)); error=1; } else @@ -656,13 +658,13 @@ my_bool hash_check(HASH *hash) } if (found != records) { - DBUG_PRINT("error",("Found %ld of %ld records")); + DBUG_PRINT("error",("Found %u of %u records", found, records)); error=1; } if (records) DBUG_PRINT("info", - ("records: %ld seeks: %d max links: %d hitrate: %.2f", - records,seek,max_links,(float) seek / (float) records)); + ("records: %u seeks: %u max links: %d hitrate: %.2f", + records, seek, max_links, (float) seek / (float) records)); return error; } #endif diff --git a/mysys/list.c b/mysys/list.c index 480c1080a45..9755dbcde84 100644 --- a/mysys/list.c +++ b/mysys/list.c @@ -28,7 +28,8 @@ LIST *list_add(LIST *root, LIST *element) { DBUG_ENTER("list_add"); - DBUG_PRINT("enter",("root: 0x%lx element: %lx", root, element)); + DBUG_PRINT("enter",("root: 0x%lx element: 0x%lx", (long) root, + (long) element)); if (root) { if (root->prev) /* If add in mid of list */ diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index a91002d3b4c..8bf9ad84e34 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -589,7 +589,9 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, DBUG_ENTER("init_io_cache_share"); DBUG_PRINT("io_cache_share", ("read_cache: 0x%lx share: 0x%lx " "write_cache: 0x%lx threads: %u", - read_cache, cshare, write_cache, num_threads)); + (long) read_cache, + (long) cshare, + (long) write_cache, num_threads)); DBUG_ASSERT(num_threads > 1); DBUG_ASSERT(read_cache->type == READ_CACHE); @@ -651,7 +653,7 @@ void remove_io_thread(IO_CACHE *cache) pthread_mutex_lock(&cshare->mutex); DBUG_PRINT("io_cache_share", ("%s: 0x%lx", (cache == cshare->source_cache) ? - "writer" : "reader", cache)); + "writer" : "reader", (long) cache)); /* Remove from share. */ total= --cshare->total_threads; @@ -727,7 +729,8 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) cshare->running_threads--; DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u", (cache == cshare->source_cache) ? - "writer" : "reader", cache, (ulong) pos, + "writer" : "reader", + (long) cache, (ulong) pos, cshare->running_threads)); if (cshare->source_cache) @@ -866,7 +869,7 @@ static void unlock_io_cache(IO_CACHE *cache) DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u", (cache == cshare->source_cache) ? "writer" : "reader", - cache, (ulong) cshare->pos_in_file, + (long) cache, (ulong) cshare->pos_in_file, cshare->total_threads)); cshare->running_threads= cshare->total_threads; diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 88b5051c52b..8ce3a6dde5c 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -410,9 +410,9 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, DBUG_PRINT("exit", ("disk_blocks: %d block_root: 0x%lx hash_entries: %d\ hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx", - keycache->disk_blocks, keycache->block_root, - keycache->hash_entries, keycache->hash_root, - keycache->hash_links, keycache->hash_link_root)); + keycache->disk_blocks, (long) keycache->block_root, + keycache->hash_entries, (long) keycache->hash_root, + keycache->hash_links, (long) keycache->hash_link_root)); bzero((gptr) keycache->changed_blocks, sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH); bzero((gptr) keycache->file_blocks, @@ -613,7 +613,7 @@ void change_key_cache_param(KEY_CACHE *keycache, uint division_limit, void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) { DBUG_ENTER("end_key_cache"); - DBUG_PRINT("enter", ("key_cache: 0x%lx", keycache)); + DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache)); if (!keycache->key_cache_inited) DBUG_VOID_RETURN; @@ -632,7 +632,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) keycache->blocks_changed= 0; } - DBUG_PRINT("status", ("used: %d changed: %d w_requests: %lu " + DBUG_PRINT("status", ("used: %lu changed: %lu w_requests: %lu " "writes: %lu r_requests: %lu reads: %lu", keycache->blocks_used, keycache->global_blocks_changed, (ulong) keycache->global_cache_w_requests, @@ -1058,7 +1058,7 @@ static void unreg_request(KEY_CACHE *keycache, if (block->temperature == BLOCK_WARM) keycache->warm_blocks--; block->temperature= BLOCK_HOT; - KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks=%u", + KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu", keycache->warm_blocks)); } link_block(keycache, block, hot, (my_bool)at_end); @@ -1077,7 +1077,7 @@ static void unreg_request(KEY_CACHE *keycache, keycache->warm_blocks++; block->temperature= BLOCK_WARM; } - KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks=%u", + KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu", keycache->warm_blocks)); } } @@ -1313,11 +1313,11 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache, DBUG_ENTER("find_key_block"); KEYCACHE_THREAD_TRACE("find_key_block:begin"); - DBUG_PRINT("enter", ("fd: %u pos %lu wrmode: %lu", - (uint) file, (ulong) filepos, (uint) wrmode)); - KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %u pos: %lu wrmode: %lu", + DBUG_PRINT("enter", ("fd: %u pos: %lu wrmode: %d", + (uint) file, (ulong) filepos, wrmode)); + KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %u pos: %lu wrmode: %d", (uint) file, (ulong) filepos, - (uint) wrmode)); + wrmode)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", test_key_cache(keycache, "start of find_key_block", 0);); @@ -1587,9 +1587,9 @@ restart: KEYCACHE_DBUG_ASSERT(page_status != -1); *page_st=page_status; KEYCACHE_DBUG_PRINT("find_key_block", - ("fd: %u pos %lu block->status %u page_status %lu", + ("fd: %u pos: %lu block->status: %u page_status: %d", (uint) file, (ulong) filepos, block->status, - (uint) page_status)); + page_status)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", @@ -2274,7 +2274,7 @@ static int flush_key_blocks_int(KEY_CACHE *keycache, BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache; int last_errno= 0; DBUG_ENTER("flush_key_blocks_int"); - DBUG_PRINT("enter",("file: %d blocks_used: %d blocks_changed: %d", + DBUG_PRINT("enter",("file: %d blocks_used: %lu blocks_changed: %lu", file, keycache->blocks_used, keycache->blocks_changed)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) @@ -2474,7 +2474,7 @@ int flush_key_blocks(KEY_CACHE *keycache, { int res; DBUG_ENTER("flush_key_blocks"); - DBUG_PRINT("enter", ("keycache: 0x%lx", keycache)); + DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache)); if (keycache->disk_blocks <= 0) DBUG_RETURN(0); diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 38fef31fdd4..e5086014a27 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -159,7 +159,7 @@ static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length) result= hash->default_value; else result= ((SAFE_HASH_ENTRY*) result)->data; - DBUG_PRINT("exit",("data: 0x%lx", result)); + DBUG_PRINT("exit",("data: 0x%lx", (long) result)); DBUG_RETURN(result); } @@ -190,7 +190,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length, SAFE_HASH_ENTRY *entry; my_bool error= 0; DBUG_ENTER("safe_hash_set"); - DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, data)); + DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, (long) data)); rw_wrlock(&hash->mutex); entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length); diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index d52a8efeed2..62fcbd491f9 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -47,7 +47,7 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size __attribute__((unused))) { DBUG_ENTER("init_alloc_root"); - DBUG_PRINT("enter",("root: 0x%lx", mem_root)); + DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root)); mem_root->free= mem_root->used= mem_root->pre_alloc= 0; mem_root->min_malloc= 32; mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE; @@ -263,7 +263,8 @@ void free_root(MEM_ROOT *root, myf MyFlags) { reg1 USED_MEM *next,*old; DBUG_ENTER("free_root"); - DBUG_PRINT("enter",("root: 0x%lx flags: %u", root, (uint) MyFlags)); + DBUG_PRINT("enter",("root: 0x%lx flags: %u", + (long) root, (uint) MyFlags)); if (!root) /* QQ: Should be deleted */ DBUG_VOID_RETURN; /* purecov: inspected */ diff --git a/mysys/my_dup.c b/mysys/my_dup.c index 4b7434e29ea..cdc15b3ebce 100644 --- a/mysys/my_dup.c +++ b/mysys/my_dup.c @@ -30,7 +30,7 @@ File my_dup(File file, myf MyFlags) File fd; const char *filename; DBUG_ENTER("my_dup"); - DBUG_PRINT("my",("file: %d MyFlags: %d", MyFlags)); + DBUG_PRINT("my",("file: %d MyFlags: %d", file, MyFlags)); fd = dup(file); filename= (((uint) file < my_file_limit) ? my_file_info[(int) file].name : "Unknown"); diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index f07beec9f39..6e81d40a2d6 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -79,7 +79,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags) my_stream_opened++; my_file_info[fileno(fd)].type = STREAM_BY_FOPEN; pthread_mutex_unlock(&THR_LOCK_open); - DBUG_PRINT("exit",("stream: 0x%lx",fd)); + DBUG_PRINT("exit",("stream: 0x%lx", (long) fd)); DBUG_RETURN(fd); } pthread_mutex_unlock(&THR_LOCK_open); @@ -103,7 +103,7 @@ int my_fclose(FILE *fd, myf MyFlags) { int err,file; DBUG_ENTER("my_fclose"); - DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",fd, MyFlags)); + DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) fd, MyFlags)); pthread_mutex_lock(&THR_LOCK_open); file=fileno(fd); @@ -163,7 +163,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) pthread_mutex_unlock(&THR_LOCK_open); } - DBUG_PRINT("exit",("stream: 0x%lx",fd)); + DBUG_PRINT("exit",("stream: 0x%lx", (long) fd)); DBUG_RETURN(fd); } /* my_fdopen */ diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c index 5b17e3ff51c..7ac2cc0d89e 100644 --- a/mysys/my_fstream.c +++ b/mysys/my_fstream.c @@ -40,7 +40,7 @@ uint my_fread(FILE *stream, byte *Buffer, uint Count, myf MyFlags) uint readbytes; DBUG_ENTER("my_fread"); DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", - stream, Buffer, Count, MyFlags)); + (long) stream, (long) Buffer, Count, MyFlags)); if ((readbytes = (uint) fread(Buffer,sizeof(char),(size_t) Count,stream)) != Count) @@ -81,7 +81,7 @@ uint my_fwrite(FILE *stream, const byte *Buffer, uint Count, myf MyFlags) #endif DBUG_ENTER("my_fwrite"); DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", - stream, Buffer, Count, MyFlags)); + (long) stream, (long) Buffer, Count, MyFlags)); #if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) errors=0; @@ -153,7 +153,7 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence, { DBUG_ENTER("my_fseek"); DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d", - stream, pos, whence, MyFlags)); + (long) stream, (ulong) pos, whence, MyFlags)); DBUG_RETURN(fseek(stream, (off_t) pos, whence) ? MY_FILEPOS_ERROR : (my_off_t) ftell(stream)); } /* my_seek */ @@ -166,7 +166,7 @@ my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused))) { off_t pos; DBUG_ENTER("my_ftell"); - DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",stream, MyFlags)); + DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) stream, MyFlags)); pos=ftell(stream); DBUG_PRINT("exit",("ftell: %lu",(ulong) pos)); DBUG_RETURN((my_off_t) pos); diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c index 5663ceaa60e..9c9b9cf7bbb 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -45,7 +45,8 @@ int my_getwd(my_string buf, uint size, myf MyFlags) { my_string pos; DBUG_ENTER("my_getwd"); - DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", buf,size,MyFlags)); + DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", + (long) buf, size, MyFlags)); #if ! defined(MSDOS) if (curr_dir[0]) /* Current pos is saved here */ diff --git a/mysys/my_handler.c b/mysys/my_handler.c index 156e7892580..3d90b7f892a 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -543,8 +543,11 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) case HA_KEYTYPE_DOUBLE: a= end; break; + case HA_KEYTYPE_END: /* purecov: inspected */ + /* keep compiler happy */ + DBUG_ASSERT(0); + break; } } return keyseg; } - diff --git a/mysys/my_lib.c b/mysys/my_lib.c index 1908c70f407..41bfbc83b35 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -625,7 +625,7 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags) int m_used; DBUG_ENTER("my_stat"); DBUG_PRINT("my", ("path: '%s', stat_area: 0x%lx, MyFlags: %d", path, - (byte *) stat_area, my_flags)); + (long) stat_area, my_flags)); if ((m_used= (stat_area == NULL))) if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags))) diff --git a/mysys/my_lread.c b/mysys/my_lread.c index a96febe4474..02ed3b5d213 100644 --- a/mysys/my_lread.c +++ b/mysys/my_lread.c @@ -27,8 +27,8 @@ uint32 my_lread(int Filedes, byte *Buffer, uint32 Count, myf MyFlags) { uint32 readbytes; DBUG_ENTER("my_lread"); - DBUG_PRINT("my",("Fd: %d Buffer: %ld Count: %ld MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", + Filedes, (long) Buffer, Count, MyFlags)); DBUG_PRINT("error", ("Deprecated my_lread() function should not be used.")); diff --git a/mysys/my_lwrite.c b/mysys/my_lwrite.c index 02c56a69ba4..f012e9d6a85 100644 --- a/mysys/my_lwrite.c +++ b/mysys/my_lwrite.c @@ -23,8 +23,8 @@ uint32 my_lwrite(int Filedes, const byte *Buffer, uint32 Count, myf MyFlags) { uint32 writenbytes; DBUG_ENTER("my_lwrite"); - DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %ld MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", + Filedes, (long) Buffer, Count, MyFlags)); DBUG_PRINT("error", ("Deprecated my_lwrite() function should not be used.")); diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 3f601a42dc9..a146b9ddd27 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -44,7 +44,7 @@ gptr my_malloc(unsigned int size, myf my_flags) } else if (my_flags & MY_ZEROFILL) bzero(point,size); - DBUG_PRINT("exit",("ptr: 0x%lx",point)); + DBUG_PRINT("exit",("ptr: 0x%lx", (long) point)); DBUG_RETURN(point); } /* my_malloc */ @@ -55,7 +55,7 @@ gptr my_malloc(unsigned int size, myf my_flags) void my_no_flags_free(gptr ptr) { DBUG_ENTER("my_free"); - DBUG_PRINT("my",("ptr: 0x%lx",ptr)); + DBUG_PRINT("my",("ptr: 0x%lx", (long) ptr)); if (ptr) free(ptr); DBUG_VOID_RETURN; diff --git a/mysys/my_pread.c b/mysys/my_pread.c index f378d548731..f4218fac65f 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -30,7 +30,7 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, int error; DBUG_ENTER("my_pread"); DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d", - Filedes, (ulong) offset, Buffer, Count, MyFlags)); + Filedes, (ulong) offset, (long) Buffer, Count, MyFlags)); for (;;) { @@ -49,8 +49,8 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, if (error) { my_errno=errno; - DBUG_PRINT("warning",("Read only %ld bytes off %ld from %d, errno: %d", - readbytes,Count,Filedes,my_errno)); + DBUG_PRINT("warning",("Read only %u bytes off %u from %d, errno: %d", + readbytes, Count, Filedes, my_errno)); #ifdef THREAD if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR) { @@ -87,7 +87,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset, ulong written; DBUG_ENTER("my_pwrite"); DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %d MyFlags: %d", - Filedes, (ulong) offset,Buffer, Count, MyFlags)); + Filedes, (ulong) offset, (long) Buffer, Count, MyFlags)); errors=0; written=0L; for (;;) diff --git a/mysys/my_read.c b/mysys/my_read.c index 8b88e483fef..a08a008de6f 100644 --- a/mysys/my_read.c +++ b/mysys/my_read.c @@ -39,7 +39,7 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags) uint readbytes, save_count; DBUG_ENTER("my_read"); DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + Filedes, (long) Buffer, Count, MyFlags)); save_count= Count; for (;;) @@ -48,7 +48,7 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags) if ((readbytes= (uint) read(Filedes, Buffer, Count)) != Count) { my_errno= errno ? errno : -1; - DBUG_PRINT("warning",("Read only %ld bytes off %ld from %d, errno: %d", + DBUG_PRINT("warning",("Read only %u bytes off %u from %d, errno: %d", readbytes, Count, Filedes, my_errno)); #ifdef THREAD if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR) diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c index c8edb172890..872518f2b0b 100644 --- a/mysys/my_realloc.c +++ b/mysys/my_realloc.c @@ -27,8 +27,8 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags) { gptr point; DBUG_ENTER("my_realloc"); - DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d",oldpoint, size, - my_flags)); + DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d", + (long) oldpoint, size, my_flags)); if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) DBUG_RETURN(my_malloc(size,my_flags)); @@ -60,6 +60,6 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags) my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); } #endif - DBUG_PRINT("exit",("ptr: 0x%lx",point)); + DBUG_PRINT("exit",("ptr: 0x%lx", (long) point)); DBUG_RETURN(point); } /* my_realloc */ diff --git a/mysys/my_seek.c b/mysys/my_seek.c index a9ae68cd5f0..5f8318cd729 100644 --- a/mysys/my_seek.c +++ b/mysys/my_seek.c @@ -55,7 +55,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, if (newpos == (os_off_t) -1) { my_errno=errno; - DBUG_PRINT("error",("lseek: %lu, errno: %d",newpos,errno)); + DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos, errno)); DBUG_RETURN(MY_FILEPOS_ERROR); } if ((my_off_t) newpos != pos) diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c index 9f765298fb6..4b4ab8de242 100644 --- a/mysys/my_tempnam.c +++ b/mysys/my_tempnam.c @@ -106,7 +106,7 @@ my_string my_tempnam(const char *dir, const char *pfx, #ifdef OS2 /* changing environ variable doesn't work with VACPP */ char buffer[256], *end; - buffer[sizeof[buffer)-1]= 0; + buffer[sizeof(buffer)-1]= 0; end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS); /* remove ending backslash */ if (end[-1] == '\\') diff --git a/mysys/my_write.c b/mysys/my_write.c index ae8cb4ab02b..26b9a4f2444 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -27,7 +27,7 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) ulong written; DBUG_ENTER("my_write"); DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %d MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + Filedes, (long) Buffer, Count, MyFlags)); errors=0; written=0L; for (;;) diff --git a/mysys/raid.cc b/mysys/raid.cc index 62587c438ca..4f1be0103e9 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -185,8 +185,8 @@ extern "C" { uint my_raid_write(File fd,const byte *Buffer, uint Count, myf MyFlags) { DBUG_ENTER("my_raid_write"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u MyFlags: %d", - fd, Buffer, Count, MyFlags)); + DBUG_PRINT("enter",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", + fd, (long) Buffer, Count, MyFlags)); if (is_raid(fd)) { RaidFd *raid= (*dynamic_element(&RaidFd::_raid_map,fd,RaidFd**)); @@ -198,8 +198,8 @@ extern "C" { uint my_raid_read(File fd, byte *Buffer, uint Count, myf MyFlags) { DBUG_ENTER("my_raid_read"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u MyFlags: %d", - fd, Buffer, Count, MyFlags)); + DBUG_PRINT("enter",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", + fd, (long) Buffer, Count, MyFlags)); if (is_raid(fd)) { RaidFd *raid= (*dynamic_element(&RaidFd::_raid_map,fd,RaidFd**)); @@ -212,8 +212,9 @@ extern "C" { myf MyFlags) { DBUG_ENTER("my_raid_pread"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u offset: %u MyFlags: %d", - Filedes, Buffer, Count, offset, MyFlags)); + DBUG_PRINT("enter", + ("Fd: %d Buffer: 0x%lx Count: %u offset: %lu MyFlags: %d", + Filedes, (long) Buffer, Count, (ulong) offset, MyFlags)); if (is_raid(Filedes)) { assert(offset != MY_FILEPOS_ERROR); @@ -231,8 +232,8 @@ extern "C" { my_off_t offset, myf MyFlags) { DBUG_ENTER("my_raid_pwrite"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u offset: %u MyFlags: %d", - Filedes, Buffer, Count, offset, MyFlags)); + DBUG_PRINT("enter",("Fd: %d Buffer: 0x%lx Count: %u offset: %lu MyFlags: %d", + Filedes, (long) Buffer, Count, (ulong) offset, MyFlags)); if (is_raid(Filedes)) { assert(offset != MY_FILEPOS_ERROR); @@ -250,8 +251,8 @@ extern "C" { myf MyFlags) { DBUG_ENTER("my_raid_lock"); - DBUG_PRINT("enter",("Fd: %d start: %u length: %u MyFlags: %d", - fd, start, length, MyFlags)); + DBUG_PRINT("enter",("Fd: %d start: %lu length: %lu MyFlags: %d", + fd, (ulong) start, (ulong) length, MyFlags)); if (my_disable_locking) DBUG_RETURN(0); if (is_raid(fd)) @@ -284,8 +285,8 @@ extern "C" { int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags) { DBUG_ENTER("my_raid_chsize"); - DBUG_PRINT("enter",("Fd: %d newlength: %u MyFlags: %d", - fd, newlength, MyFlags)); + DBUG_PRINT("enter",("Fd: %d newlength: %lu MyFlags: %d", + fd, (ulong) newlength, MyFlags)); if (is_raid(fd)) { RaidFd *raid= (*dynamic_element(&RaidFd::_raid_map,fd,RaidFd**)); @@ -413,7 +414,7 @@ RaidFd(uint raid_type, uint raid_chunks, ulong raid_chunksize) _fd_vector(0) { DBUG_ENTER("RaidFd::RaidFd"); - DBUG_PRINT("enter",("RaidFd_type: %u Disks: %u Chunksize: %d", + DBUG_PRINT("enter",("RaidFd_type: %u Disks: %u Chunksize: %lu", raid_type, raid_chunks, raid_chunksize)); /* TODO: Here we should add checks if the malloc fails */ @@ -622,7 +623,7 @@ Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags) { DBUG_ENTER("RaidFd::Lock"); DBUG_PRINT("enter",("locktype: %d start: %lu length: %lu MyFlags: %d", - locktype, start, length, MyFlags)); + locktype, (ulong) start, (ulong) length, MyFlags)); my_off_t bufptr = start; // Loop until all data is locked while(length) @@ -732,8 +733,8 @@ my_off_t RaidFd:: Tell(myf MyFlags) { DBUG_ENTER("RaidFd::Tell"); - DBUG_PRINT("enter",("MyFlags: %d _position %d", - MyFlags,_position)); + DBUG_PRINT("enter",("MyFlags: %d _position: %lu", + MyFlags, (ulong) _position)); DBUG_RETURN(_position); } @@ -741,8 +742,8 @@ int RaidFd:: Chsize(File fd, my_off_t newlength, int filler, myf MyFlags) { DBUG_ENTER("RaidFd::Chsize"); - DBUG_PRINT("enter",("Fd: %d, newlength: %d, MyFlags: %d", - fd, newlength,MyFlags)); + DBUG_PRINT("enter",("Fd: %d newlength: %lu MyFlags: %d", + fd, (ulong) newlength, MyFlags)); _position = newlength; Calculate(); uint _rounds = _total_block / _raid_chunks; // INT() assumed diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 6cdf98c5f5f..5f93b861b31 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -194,7 +194,7 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags) if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); /* Return a pointer to the real data */ - DBUG_PRINT("exit",("ptr: 0x%lx", data)); + DBUG_PRINT("exit",("ptr: 0x%lx", (long) data)); if (sf_min_adress > data) sf_min_adress= data; if (sf_max_adress < data) @@ -259,7 +259,7 @@ void _myfree(gptr ptr, const char *filename, uint lineno, myf myflags) { struct st_irem *irem; DBUG_ENTER("_myfree"); - DBUG_PRINT("enter",("ptr: 0x%lx", ptr)); + DBUG_PRINT("enter",("ptr: 0x%lx", (long) ptr)); if (!sf_malloc_quick) (void) _sanity (filename, lineno); @@ -410,7 +410,7 @@ void TERMINATE(FILE *file) } DBUG_PRINT("safe", ("%6u bytes at 0x%09lx, allocated at line %4d in '%s'", - irem->datasize, data, irem->linenum, irem->filename)); + irem->datasize, (long) data, irem->linenum, irem->filename)); irem= irem->next; } } @@ -447,7 +447,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename, fprintf(stderr, " discovered at %s:%d\n", filename, lineno); (void) fflush(stderr); DBUG_PRINT("safe",("Underrun at 0x%lx, allocated at %s:%d", - data, irem->filename, irem->linenum)); + (long) data, irem->filename, irem->linenum)); flag=1; } @@ -463,7 +463,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename, fprintf(stderr, " discovered at '%s:%d'\n", filename, lineno); (void) fflush(stderr); DBUG_PRINT("safe",("Overrun at 0x%lx, allocated at %s:%d", - data, + (long) data, irem->filename, irem->linenum)); flag=1; diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index d6443539216..fb1c2ca6409 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -436,7 +436,8 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) data->thread_id=my_thread_id(); /* Must be reset ! */ VOID(pthread_mutex_lock(&lock->mutex)); DBUG_PRINT("lock",("data: 0x%lx thread: %ld lock: 0x%lx type: %d", - data,data->thread_id,lock,(int) lock_type)); + (long) data, data->thread_id, (long) lock, + (int) lock_type)); check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ? "enter read_lock" : "enter write_lock",0); if ((int) lock_type <= (int) TL_READ_NO_INSERT) @@ -598,8 +599,8 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) goto end; } } - DBUG_PRINT("lock",("write locked by thread: %ld, type: %ld", - lock->read.data->thread_id,data->type)); + DBUG_PRINT("lock",("write locked by thread: %ld type: %d", + lock->read.data->thread_id, (int) data->type)); } DBUG_RETURN(wait_for_lock(&lock->write_wait,data,0)); } @@ -665,7 +666,7 @@ void thr_unlock(THR_LOCK_DATA *data) enum thr_lock_type lock_type=data->type; DBUG_ENTER("thr_unlock"); DBUG_PRINT("lock",("data: 0x%lx thread: %ld lock: 0x%lx", - data,data->thread_id,lock)); + (long) data, data->thread_id, (long) lock)); pthread_mutex_lock(&lock->mutex); check_locks(lock,"start of release lock",0); @@ -835,7 +836,7 @@ int thr_multi_lock(THR_LOCK_DATA **data,uint count) { THR_LOCK_DATA **pos,**end; DBUG_ENTER("thr_multi_lock"); - DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); + DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) data, count)); if (count > 1) sort_locks(data,count); /* lock everything */ @@ -907,7 +908,7 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count) { THR_LOCK_DATA **pos,**end; DBUG_ENTER("thr_multi_unlock"); - DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); + DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) data, count)); for (pos=data,end=data+count; pos < end ; pos++) { @@ -921,7 +922,7 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count) else { DBUG_PRINT("lock",("Free lock: data: 0x%lx thread: %ld lock: 0x%lx", - *pos,(*pos)->thread_id,(*pos)->lock)); + (long) *pos, (*pos)->thread_id, (long) (*pos)->lock)); } } DBUG_VOID_RETURN; diff --git a/mysys/tree.c b/mysys/tree.c index bec1ec680f1..4eae086ab96 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -89,7 +89,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit, tree_element_free free_element, void *custom_arg) { DBUG_ENTER("init_tree"); - DBUG_PRINT("enter",("tree: 0x%lx size: %d",tree,size)); + DBUG_PRINT("enter",("tree: 0x%lx size: %d", (long) tree, size)); if (default_alloc_size < DEFAULT_ALLOC_SIZE) default_alloc_size= DEFAULT_ALLOC_SIZE; @@ -137,7 +137,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit, static void free_tree(TREE *tree, myf free_flags) { DBUG_ENTER("free_tree"); - DBUG_PRINT("enter",("tree: 0x%lx",tree)); + DBUG_PRINT("enter",("tree: 0x%lx", (long) tree)); if (tree->root) /* If initialized */ { diff --git a/mysys/typelib.c b/mysys/typelib.c index 90a093b0b32..d329b687668 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -49,7 +49,7 @@ int find_type(my_string x, TYPELIB *typelib, uint full_name) reg1 my_string i; reg2 const char *j; DBUG_ENTER("find_type"); - DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x,typelib)); + DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) typelib)); if (!typelib->count) { diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index ea5dc218898..3b47abd7cd3 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1263,8 +1263,8 @@ CommandInterpreter::executeConnect(char* parameters) int retval; disconnect(); if (!emptyString(parameters)) { - if (retval = ndb_mgm_set_connectstring(m_mgmsrv, - BaseString(parameters).trim().c_str())) + if ((retval = ndb_mgm_set_connectstring(m_mgmsrv, + BaseString(parameters).trim().c_str()))) { printError(); return retval; diff --git a/regex/regexec.c b/regex/regexec.c index b7ad83ba883..13c253ca4f6 100644 --- a/regex/regexec.c +++ b/regex/regexec.c @@ -15,7 +15,8 @@ #include "utils.h" #include "regex2.h" -static int nope = 0; /* for use in asserts; shuts lint up */ +/* for use in asserts */ +#define nope 0 /* macros for manipulating states, small version */ #define states long diff --git a/sql-common/client.c b/sql-common/client.c index 431c1bdf418..27ed5cf4dbd 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -601,7 +601,7 @@ net_safe_read(MYSQL *mysql) if (len == packet_error || len == 0) { - DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %d", + DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %lu", vio_description(net->vio),len)); #ifdef MYSQL_SERVER if (vio_was_interrupted(net->vio)) @@ -858,7 +858,7 @@ void STDCALL mysql_free_result(MYSQL_RES *result) { DBUG_ENTER("mysql_free_result"); - DBUG_PRINT("enter",("mysql_res: %lx",result)); + DBUG_PRINT("enter",("mysql_res: 0x%lx", (ulong) result)); if (result) { MYSQL *mysql= result->handle; @@ -1174,7 +1174,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, { uchar *pos; /* fields count may be wrong */ - DBUG_ASSERT ((field - result) < fields); + DBUG_ASSERT ((uint) (field - result) < fields); cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7); field->catalog = strdup_root(alloc,(char*) row->data[0]); field->db = strdup_root(alloc,(char*) row->data[1]); @@ -1350,7 +1350,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, DBUG_PRINT("info",("status: %u warning_count: %u", mysql->server_status, mysql->warning_count)); } - DBUG_PRINT("exit",("Got %d rows",result->rows)); + DBUG_PRINT("exit",("Got %lu rows", (ulong) result->rows)); DBUG_RETURN(result); } @@ -2178,7 +2178,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, goto error; #endif - DBUG_PRINT("exit",("Mysql handler: %lx",mysql)); + DBUG_PRINT("exit",("Mysql handler: 0x%lx", (ulong) mysql)); reset_sigpipe(mysql); DBUG_RETURN(mysql); @@ -2533,7 +2533,7 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *query, ulong length) { DBUG_ENTER("mysql_real_query"); - DBUG_PRINT("enter",("handle: %lx",mysql)); + DBUG_PRINT("enter",("handle: 0x%lx", (ulong) mysql)); DBUG_PRINT("query",("Query = '%-.4096s'",query)); if (mysql_send_query(mysql,query,length)) diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 77226da3dc8..532a8f843e5 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -902,7 +902,7 @@ my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone, */ if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE)) tmp= 0; -end: + return (my_time_t) tmp; } /* my_system_gmt_sec */ diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 16ba7605415..02d27b398f1 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -573,7 +573,8 @@ int ha_archive::write_row(byte * buf) table->timestamp_field->set_time(); pthread_mutex_lock(&share->mutex); written= gzwrite(share->archive_write, buf, table->reclength); - DBUG_PRINT("ha_archive::get_row", ("Wrote %d bytes expected %d", written, table->reclength)); + DBUG_PRINT("ha_archive::get_row", ("Wrote %d bytes expected %d", (int) written, + table->reclength)); share->dirty= TRUE; if (written != (z_off_t)table->reclength) goto error; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 3d1724efb91..d7219bb0b1c 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -3594,7 +3594,7 @@ ha_innobase::rnd_pos( } if (error) { - DBUG_PRINT("error",("Got error: %ld",error)); + DBUG_PRINT("error",("Got error: %d", error)); DBUG_RETURN(error); } @@ -3604,7 +3604,7 @@ ha_innobase::rnd_pos( error = index_read(buf, pos, ref_length, HA_READ_KEY_EXACT); if (error) { - DBUG_PRINT("error",("Got error: %ld",error)); + DBUG_PRINT("error",("Got error: %d", error)); } change_active_index(keynr); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d16e00f4e52..d61c8242677 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -692,8 +692,8 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob) { char *buf= m_blobs_buffer + offset; uint32 len= 0xffffffff; // Max uint32 - DBUG_PRINT("value", ("read blob ptr=%x len=%u", - (UintPtr)buf, (uint)blob_len)); + DBUG_PRINT("value", ("read blob ptr: 0x%lx len: %u", + (ulong)buf, (uint)blob_len)); if (ndb_blob->readData(buf, len) != 0) DBUG_RETURN(-1); DBUG_ASSERT(len == blob_len); @@ -1484,7 +1484,7 @@ inline int ha_ndbcluster::next_result(byte *buf) all pending update or delete operations should be sent to NDB */ - DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); + DBUG_PRINT("info", ("ops_pending: %lu", (ulong) m_ops_pending)); if (m_ops_pending) { // if (current_thd->transaction.on) @@ -2026,7 +2026,7 @@ int ha_ndbcluster::write_row(byte *record) (ulong) next_val)); if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) DBUG_PRINT("info", - ("Setting next auto increment value to %u", next_val)); + ("Setting next auto increment value to %u", (uint) next_val)); } m_skip_auto_increment= TRUE; @@ -2417,7 +2417,7 @@ void ha_ndbcluster::print_results() break; } case NdbDictionary::Column::Int: { - fprintf(DBUG_FILE, "Int\t%lld", field->val_int()); + fprintf(DBUG_FILE, "Int\t%ld", (long) field->val_int()); break; } case NdbDictionary::Column::Unsigned: { @@ -2787,7 +2787,7 @@ int ha_ndbcluster::close_scan() Take over any pending transactions to the deleteing/updating transaction before closing the scan */ - DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); + DBUG_PRINT("info", ("ops_pending: %lu", (ulong) m_ops_pending)); if (execute_no_commit(this,trans) != 0) { no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); @@ -3823,7 +3823,7 @@ static int create_ndb_column(NDBCOL &col, col.setAutoIncrement(TRUE); ulonglong value= info->auto_increment_value ? info->auto_increment_value : (ulonglong) 1; - DBUG_PRINT("info", ("Autoincrement key, initial: %llu", value)); + DBUG_PRINT("info", ("Autoincrement key, initial: %lu", (ulong) value)); col.setAutoIncrementInitialValue(value); } else @@ -3926,7 +3926,8 @@ int ha_ndbcluster::create(const char *name, if (packfrm(data, length, &pack_data, &pack_length)) DBUG_RETURN(2); - DBUG_PRINT("info", ("setFrm data=%x, len=%d", pack_data, pack_length)); + DBUG_PRINT("info", ("setFrm data: 0x%lx len: %u", (ulong) pack_data, + pack_length)); tab.setFrm(pack_data, pack_length); my_free((char*)data, MYF(0)); my_free((char*)pack_data, MYF(0)); @@ -3934,7 +3935,7 @@ int ha_ndbcluster::create(const char *name, for (i= 0; i < form->fields; i++) { Field *field= form->field[i]; - DBUG_PRINT("info", ("name: %s, type: %u, pack_length: %d", + DBUG_PRINT("info", ("name: %s type: %u pack_length: %d", field->field_name, field->real_type(), field->pack_length())); if ((my_errno= create_ndb_column(col, field, info))) @@ -5221,14 +5222,14 @@ static int packfrm(const void *data, uint len, uint blob_len; frm_blob_struct* blob; DBUG_ENTER("packfrm"); - DBUG_PRINT("enter", ("data: %x, len: %d", data, len)); + DBUG_PRINT("enter", ("data: 0x%lx len: %u", (ulong) data, len)); error= 1; org_len= len; if (my_compress((byte*)data, &org_len, &comp_len)) goto err; - DBUG_PRINT("info", ("org_len: %d, comp_len: %d", org_len, comp_len)); + DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", org_len, comp_len)); DBUG_DUMP("compressed", (char*)data, org_len); error= 2; @@ -5248,7 +5249,8 @@ static int packfrm(const void *data, uint len, *pack_len= blob_len; error= 0; - DBUG_PRINT("exit", ("pack_data: %x, pack_len: %d", *pack_data, *pack_len)); + DBUG_PRINT("exit", ("pack_data: 0x%lx pack_len: %u", (ulong) *pack_data, + *pack_len)); err: DBUG_RETURN(error); @@ -5262,13 +5264,13 @@ static int unpackfrm(const void **unpack_data, uint *unpack_len, byte *data; ulong complen, orglen, ver; DBUG_ENTER("unpackfrm"); - DBUG_PRINT("enter", ("pack_data: %x", pack_data)); + DBUG_PRINT("enter", ("pack_data: 0x%lx", (ulong) pack_data)); complen= uint4korr((char*)&blob->head.complen); orglen= uint4korr((char*)&blob->head.orglen); ver= uint4korr((char*)&blob->head.ver); - DBUG_PRINT("blob",("ver: %d complen: %d orglen: %d", + DBUG_PRINT("blob",("ver: %lu complen: %lu orglen: %lu", ver,complen,orglen)); DBUG_DUMP("blob->data", (char*) blob->data, complen); @@ -5287,7 +5289,8 @@ static int unpackfrm(const void **unpack_data, uint *unpack_len, *unpack_data= data; *unpack_len= complen; - DBUG_PRINT("exit", ("frmdata: %x, len: %d", *unpack_data, *unpack_len)); + DBUG_PRINT("exit", ("frmdata: 0x%lx len: %u", (ulong) *unpack_data, + *unpack_len)); DBUG_RETURN(0); } @@ -5367,7 +5370,8 @@ ndb_get_table_statistics(ha_ndbcluster* file, bool report_error, Ndb* ndb, * row_count= sum_rows; if(commit_count) * commit_count= sum_commits; - DBUG_PRINT("exit", ("records: %u commits: %u", sum_rows, sum_commits)); + DBUG_PRINT("exit", ("records: %u commits: %u", (uint) sum_rows, + (uint) sum_commits)); DBUG_RETURN(0); retry: diff --git a/sql/item.cc b/sql/item.cc index bf96fdf3f43..a43f9c092ec 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -649,6 +649,8 @@ bool agg_item_charsets(DTCollation &coll, const char *fname, doesn't display each argument's characteristics. - if nargs is 1, then this error cannot happen. */ + LINT_INIT(safe_args[0]); + LINT_INIT(safe_args[1]); if (nargs >=2 && nargs <= 3) { safe_args[0]= args[0]; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ffb60754381..bd763ccec2f 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1738,7 +1738,7 @@ byte *in_row::get_value(Item *item) void in_row::set(uint pos, Item *item) { DBUG_ENTER("in_row::set"); - DBUG_PRINT("enter", ("pos %u item 0x%lx", pos, (ulong) item)); + DBUG_PRINT("enter", ("pos: %u item: 0x%lx", pos, (ulong) item)); ((cmp_item_row*) base)[pos].store_value_by_template(&tmp, item); DBUG_VOID_RETURN; } @@ -1820,7 +1820,7 @@ cmp_item* cmp_item_row::make_same() cmp_item_row::~cmp_item_row() { DBUG_ENTER("~cmp_item_row"); - DBUG_PRINT("enter",("this: %lx", this)); + DBUG_PRINT("enter",("this: 0x%lx", (long) this)); if (comparators) { for (uint i= 0; i < n; i++) @@ -2413,7 +2413,7 @@ longlong Item_is_not_null_test::val_int() if (!used_tables_cache && !with_subselect) { owner->was_null|= (!cached_value); - DBUG_PRINT("info", ("cached :%d", cached_value)); + DBUG_PRINT("info", ("cached :%ld", (long) cached_value)); DBUG_RETURN(cached_value); } if (args[0]->is_null()) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index cdbcde8b56b..f17a2d2c8d3 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -54,7 +54,7 @@ void Item_subselect::init(st_select_lex *select_lex, { DBUG_ENTER("Item_subselect::init"); - DBUG_PRINT("subs", ("select_lex 0x%xl", (ulong) select_lex)); + DBUG_PRINT("subs", ("select_lex: 0x%lx", (ulong) select_lex)); unit= select_lex->master_unit(); if (unit->item) diff --git a/sql/log.cc b/sql/log.cc index b91ec2b3dee..0fc06653e00 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2255,8 +2255,8 @@ void MYSQL_LOG::report_pos_in_innodb() if (is_open() && have_innodb == SHOW_OPTION_YES) { DBUG_PRINT("info", ("Reporting binlog info into InnoDB - " - "name: '%s' position: %d", - log_file_name, my_b_tell(&log_file))); + "name: '%s' position: %lu", + log_file_name, (ulong) my_b_tell(&log_file))); innobase_store_binlog_offset_and_flush_log(log_file_name, my_b_tell(&log_file)); } diff --git a/sql/log_event.cc b/sql/log_event.cc index 412ebbce0ac..d02bb2a5483 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2043,8 +2043,8 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg, #ifndef DBUG_OFF char buff[22]; DBUG_ENTER("Rotate_log_event::Rotate_log_event(THD*,...)"); - DBUG_PRINT("enter",("new_log_ident %s pos %s flags %lu", new_log_ident_arg, - llstr(pos_arg, buff), flags)); + DBUG_PRINT("enter",("new_log_ident: %s pos: %s flags: %u", + new_log_ident_arg, llstr(pos_arg, buff), flags)); #endif if (flags & DUP_NAME) new_log_ident= my_strdup_with_length((byte*) new_log_ident_arg, @@ -2673,7 +2673,7 @@ Slave_log_event::Slave_log_event(THD* thd_arg, memcpy(master_log, rli->group_master_log_name, master_log_len + 1); master_port = mi->port; master_pos = rli->group_master_log_pos; - DBUG_PRINT("info", ("master_log: %s pos: %d", master_log, + DBUG_PRINT("info", ("master_log: %s pos: %lu", master_log, (ulong) master_pos)); } else diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 20f20a0a86b..91e124743ce 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1443,7 +1443,7 @@ static void server_init(void) if (strlen(mysqld_unix_port) > (sizeof(UNIXaddr.sun_path) - 1)) { - sql_print_error("The socket file path is too long (> %lu): %s", + sql_print_error("The socket file path is too long (> %u): %s", sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port); unireg_abort(1); } @@ -3189,7 +3189,7 @@ int main(int argc, char **argv) { if (global_system_variables.log_warnings) sql_print_warning("Asked for %ld thread stack, but got %ld", - thread_stack, stack_size); + thread_stack, (long) stack_size); thread_stack= stack_size; } } @@ -3669,7 +3669,7 @@ static void create_new_thread(THD *thd) threads.append(thd); if (thread_count-delayed_insert_threads > max_used_connections) max_used_connections=thread_count-delayed_insert_threads; - DBUG_PRINT("info",(("creating thread %d"), thd->thread_id)); + DBUG_PRINT("info",(("creating thread %lu"), thd->thread_id)); thd->connect_time = time(NULL); if ((error=pthread_create(&thd->real_id,&connection_attrib, handle_one_connection, @@ -4767,7 +4767,8 @@ master-ssl", (gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \ --skip-merge.", - (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0}, + (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, + 0, 0}, {"myisam-recover", OPT_MYISAM_RECOVER, "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.", (gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0, diff --git a/sql/net_serv.cc b/sql/net_serv.cc index a5a05d381cd..ead10fe7674 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -697,7 +697,7 @@ my_real_read(NET *net, ulong *complen) { my_bool interrupted = vio_should_retry(net->vio); - DBUG_PRINT("info",("vio_read returned %d, errno: %d", + DBUG_PRINT("info",("vio_read returned %ld errno: %d", length, vio_errno(net->vio))); #if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER) /* diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 06e42ff363f..4ead85620cf 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -806,7 +806,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, double scan_time; DBUG_ENTER("test_quick_select"); DBUG_PRINT("enter",("keys_to_use: %lu prev_tables: %lu const_tables: %lu", - keys_to_use.to_ulonglong(), (ulong) prev_tables, + (ulong) keys_to_use.to_ulonglong(), (ulong) prev_tables, (ulong) const_tables)); delete quick; diff --git a/sql/slave.cc b/sql/slave.cc index 75b18f6f307..c18e457471f 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2822,7 +2822,7 @@ server_errno=%d)", return packet_error; } - DBUG_PRINT("info",( "len=%u, net->read_pos[4] = %d\n", + DBUG_PRINT("info",( "len: %lu net->read_pos[4]: %d\n", len, mysql->net.read_pos[4])); return len - 1; } @@ -3743,7 +3743,7 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev) /* Safe copy as 'rev' has been "sanitized" in Rotate_log_event's ctor */ memcpy(mi->master_log_name, rev->new_log_ident, rev->ident_len+1); mi->master_log_pos= rev->pos; - DBUG_PRINT("info", ("master_log_pos: '%s' %d", + DBUG_PRINT("info", ("master_log_pos: '%s' %lu", mi->master_log_name, (ulong) mi->master_log_pos)); #ifndef DBUG_OFF /* @@ -3849,7 +3849,7 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf, position in the master's log, we must use the original value. */ mi->master_log_pos += --event_len; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); pthread_mutex_unlock(&mi->data_lock); my_free((char*)tmp_buf, MYF(0)); DBUG_RETURN(error); @@ -3870,7 +3870,7 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf, } delete ev; mi->master_log_pos+= inc_pos; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); pthread_mutex_unlock(&mi->data_lock); DBUG_RETURN(0); } @@ -3963,7 +3963,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) DBUG_ASSERT(rli->ign_master_log_name_end[0]); rli->ign_master_log_pos_end= mi->master_log_pos; rli->relay_log.signal_update(); // the slave SQL thread needs to re-check - DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu event originating from the same server, ignored", (ulong) mi->master_log_pos)); } else { @@ -3971,7 +3971,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) if (likely(!(error= rli->relay_log.appendv(buf,event_len,0)))) { mi->master_log_pos+= inc_pos; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); rli->relay_log.harvest_bytes_written(&rli->log_space_total); } rli->ign_master_log_name_end[0]= 0; // last event is not ignored diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index fc03e03dee7..9f7807aabc7 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -383,7 +383,7 @@ inline Query_cache_block * Query_cache_block_table::block() void Query_cache_block::init(ulong block_length) { DBUG_ENTER("Query_cache_block::init"); - DBUG_PRINT("qcache", ("init block 0x%lx length: %lu", (ulong) this, + DBUG_PRINT("qcache", ("init block: 0x%lx length: %lu", (ulong) this, block_length)); length = block_length; used = 0; @@ -528,7 +528,8 @@ void Query_cache_query::init_n_lock() my_rwlock_init(&lock, NULL); lock_writing(); DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx", - ((byte*) this)-ALIGN_SIZE(sizeof(Query_cache_block)))); + (long) ((byte*) this) - + ALIGN_SIZE(sizeof(Query_cache_block)))); DBUG_VOID_RETURN; } @@ -537,7 +538,8 @@ void Query_cache_query::unlock_n_destroy() { DBUG_ENTER("Query_cache_query::unlock_n_destroy"); DBUG_PRINT("qcache", ("destroyed & unlocked query for block 0x%lx", - ((byte*)this)-ALIGN_SIZE(sizeof(Query_cache_block)))); + (long) ((byte*) this) - + ALIGN_SIZE(sizeof(Query_cache_block)))); /* The following call is not needed on system where one can destroy an active semaphore @@ -1140,7 +1142,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) #ifndef EMBEDDED_LIBRARY do { - DBUG_PRINT("qcache", ("Results (len %lu, used %lu, headers %lu)", + DBUG_PRINT("qcache", ("Results (len: %lu used: %lu headers: %u)", result_block->length, result_block->used, result_block->headers_len()+ ALIGN_SIZE(sizeof(Query_cache_result)))); @@ -1832,8 +1834,8 @@ Query_cache::append_result_data(Query_cache_block **current_block, Query_cache_block *query_block) { DBUG_ENTER("Query_cache::append_result_data"); - DBUG_PRINT("qcache", ("append %lu bytes to 0x%lx query", - data_len, query_block)); + DBUG_PRINT("qcache", ("append: %lu bytes to: 0x%lx query", + data_len, (ulong) query_block)); if (query_block->query()->add(data_len) > query_cache_limit) { @@ -3336,10 +3338,10 @@ void Query_cache::queries_dump() Query_cache_query_flags flags; memcpy(&flags, str+len, QUERY_CACHE_FLAGS_SIZE); str[len]= 0; // make zero ending DB name - DBUG_PRINT("qcache", ("F:%u C:%u L:%lu T:'%s' (%u) '%s' '%s'", + DBUG_PRINT("qcache", ("F: %u C: %u L: %lu T: '%s' (%u) '%s' '%s'", flags.client_long_flag, flags.character_set_client_num, - (ulong)flags.limit, flags.time_zone->get_name(), + (ulong)flags.limit, flags.time_zone->get_name()->ptr(), len, str, strend(str)+1)); DBUG_PRINT("qcache", ("-b- 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx", (ulong) block, (ulong) block->next, (ulong) block->prev, @@ -3569,7 +3571,7 @@ my_bool Query_cache::check_integrity(bool not_locked) default: DBUG_PRINT("error", ("block 0x%lx have incorrect type %u", - block, block->type)); + (ulong) block, block->type)); result = 1; } @@ -3668,7 +3670,7 @@ my_bool Query_cache::check_integrity(bool not_locked) if (count != bins[i].number) { DBUG_PRINT("error", ("bin[%d].number is %d, but bin have %d blocks", - bins[i].number, count)); + i, bins[i].number, count)); result = 1; } } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c8d90848f6e..fc20d7b38e1 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -156,9 +156,8 @@ bool foreign_key_prefix(Key *a, Key *b) THD::THD() :user_time(0), global_read_lock(0), is_fatal_error(0), - last_insert_id_used(0), - insert_id_used(0), rand_used(0), time_zone_used(0), - in_lock_tables(0), bootstrap(0) + rand_used(0), last_insert_id_used(0), insert_id_used(0), + time_zone_used(0), in_lock_tables(0), bootstrap(0) { current_arena= this; host= user= priv_user= db= ip=0; @@ -616,7 +615,8 @@ void THD::add_changed_table(const char *key, long key_length) { list_include(prev_changed, curr, changed_table_dup(key, key_length)); DBUG_PRINT("info", - ("key_length %u %u", key_length, (*prev_changed)->key_length)); + ("key_length: %ld %u", key_length, + (*prev_changed)->key_length)); DBUG_VOID_RETURN; } else if (cmp == 0) @@ -626,7 +626,7 @@ void THD::add_changed_table(const char *key, long key_length) { list_include(prev_changed, curr, changed_table_dup(key, key_length)); DBUG_PRINT("info", - ("key_length %u %u", key_length, + ("key_length: %ld %u", key_length, (*prev_changed)->key_length)); DBUG_VOID_RETURN; } @@ -638,7 +638,7 @@ void THD::add_changed_table(const char *key, long key_length) } } *prev_changed = changed_table_dup(key, key_length); - DBUG_PRINT("info", ("key_length %u %u", key_length, + DBUG_PRINT("info", ("key_length: %ld %u", key_length, (*prev_changed)->key_length)); DBUG_VOID_RETURN; } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index b84b2f7eef4..3aa37a9935d 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -272,7 +272,7 @@ cleanup: else { send_ok(thd,deleted); - DBUG_PRINT("info",("%d records deleted",deleted)); + DBUG_PRINT("info",("%lu records deleted", (ulong) deleted)); } DBUG_RETURN(0); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 66b68cfc2f1..8f735641e55 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -306,9 +306,9 @@ int check_user(THD *thd, enum enum_server_command command, if (!(thd->master_access & NO_ACCESS)) // authentification is OK { DBUG_PRINT("info", - ("Capabilities: %d packet_length: %ld Host: '%s' " + ("Capabilities: %lu packet_length: %ld Host: '%s' " "Login user: '%s' Priv_user: '%s' Using password: %s " - "Access: %u db: '%s'", + "Access: %lu db: '%s'", thd->client_capabilities, thd->max_client_packet_length, thd->host_or_ip, thd->user, thd->priv_user, passwd_len ? "yes": "no", @@ -857,7 +857,7 @@ static int check_connection(THD *thd) if (thd->client_capabilities & CLIENT_IGNORE_SPACE) thd->variables.sql_mode|= MODE_IGNORE_SPACE; #ifdef HAVE_OPENSSL - DBUG_PRINT("info", ("client capabilities: %d", thd->client_capabilities)); + DBUG_PRINT("info", ("client capabilities: %lu", thd->client_capabilities)); if (thd->client_capabilities & CLIENT_SSL) { /* Do the SSL layering. */ @@ -1003,7 +1003,7 @@ pthread_handler_decl(handle_one_connection,arg) of handle_one_connection, which is thd. We need to know the start of the stack so that we could check for stack overruns. */ - DBUG_PRINT("info", ("handle_one_connection called by thread %d\n", + DBUG_PRINT("info", ("handle_one_connection called by thread %lu\n", thd->thread_id)); // now that we've called my_thread_init(), it is safe to call DBUG_* diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index b5aed0bbc4e..9b6d6bdd92e 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1394,7 +1394,7 @@ static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) enum enum_sql_command sql_command= lex->sql_command; int res= 0; DBUG_ENTER("send_prepare_results"); - DBUG_PRINT("enter",("command: %d, param_count: %ld", + DBUG_PRINT("enter",("command: %d param_count: %u", sql_command, stmt->param_count)); if ((&lex->select_lex != lex->all_selects_list || diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index f83313a8fd8..9d35d822b8e 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1017,7 +1017,7 @@ int change_master(THD* thd, MASTER_INFO* mi) { mi->master_log_pos= lex_mi->pos; } - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); if (lex_mi->host) strmake(mi->host, lex_mi->host, sizeof(mi->host)-1); @@ -1129,7 +1129,7 @@ int change_master(THD* thd, MASTER_INFO* mi) } } mi->rli.group_master_log_pos = mi->master_log_pos; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); /* Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index af3ad782ee3..b4d9749911a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6052,6 +6052,7 @@ do_select(JOIN *join,List *fields,TABLE *table,Procedure *procedure) JOIN_TAB *join_tab; int (*end_select)(JOIN *, struct st_join_table *,bool); DBUG_ENTER("do_select"); + LINT_INIT(join_tab); List *columns_list= procedure ? &join->procedure_fields_list : fields; join->procedure=procedure; /* diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0316d6a3c10..3e9323ec086 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2711,7 +2711,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, enum enum_duplicates handle_duplicates, bool ignore) { TABLE *table,*new_table; - int error; + int error= 0; char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN]; char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias; char index_file[FN_REFLEN], data_file[FN_REFLEN]; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 7ed1b48d7aa..fcce3ad64b3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -407,7 +407,7 @@ int mysql_update(THD *thd, send_ok(thd, (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated, thd->insert_id_used ? thd->last_insert_id : 0L,buff); - DBUG_PRINT("info",("%d records updated",updated)); + DBUG_PRINT("info",("%lu records updated", (ulong) updated)); } thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */ free_io_cache(table); @@ -495,7 +495,7 @@ static table_map get_table_map(List *items) while ((item= (Item_field *) item_it++)) map|= item->used_tables(); - DBUG_PRINT("info",("table_map: 0x%08x", map)); + DBUG_PRINT("info",("table_map: 0x%08lx", (long) map)); return map; } diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 81aca092cec..1b718e511ad 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -150,7 +150,7 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) int find,pos; const char *j; DBUG_ENTER("find_type2"); - DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x,typelib)); + DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x, (long) typelib)); if (!typelib->count) { diff --git a/sql/table.cc b/sql/table.cc index a85da8395e7..c1d43af2eec 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -87,7 +87,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, SQL_CRYPT *crypted=0; MEM_ROOT **root_ptr, *old_root; DBUG_ENTER("openfrm"); - DBUG_PRINT("enter",("name: '%s' form: %lx",name,outparam)); + DBUG_PRINT("enter",("name: '%s' form: 0x%lx", name, (ulong) outparam)); bzero((char*) outparam,sizeof(*outparam)); outparam->blob_ptr_size=sizeof(char*); diff --git a/sql/tztime.cc b/sql/tztime.cc index 9af33526c98..bfbc1ae0b30 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -948,8 +948,8 @@ TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) */ if (shift) { - if (local_t > (TIMESTAMP_MAX_VALUE - shift*86400L + - sp->revtis[i].rt_offset - saved_seconds)) + if (local_t > (my_time_t) (TIMESTAMP_MAX_VALUE - shift*86400L + + sp->revtis[i].rt_offset - saved_seconds)) { DBUG_RETURN(0); /* my_time_t overflow */ } diff --git a/sql/unireg.cc b/sql/unireg.cc index e5ee0222f20..c9c39f38842 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -358,14 +358,14 @@ static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo, key_parts+=key->key_parts; DBUG_PRINT("loop",("flags: %d key_parts: %d at %lx", key->flags,key->key_parts, - key->key_part)); + (long) key->key_part)); for (key_part=key->key_part,key_part_end=key_part+key->key_parts ; key_part != key_part_end ; key_part++) { uint offset; - DBUG_PRINT("loop",("field: %d startpos: %lu length: %ld", + DBUG_PRINT("loop",("field: %d startpos: %lu length: %d", key_part->fieldnr, key_part->offset + data_offset, key_part->length)); int2store(pos,key_part->fieldnr+1+FIELD_NAME_USED); diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp new file mode 100644 index 00000000000..b18c925dae1 --- /dev/null +++ b/support-files/compiler_warnings.supp @@ -0,0 +1,56 @@ +# +# cmd-line-utils is not important in 4.1 +# +.*/cmd-line-utils/readline/* : .*comparison is always true.* +.*/cmd-line-utils/readline/* : .*discards qualifiers from pointer target type.* +.*/cmd-line-utils/readline/* : .*may be used uninitialized in this.* + +# +# not important in 4.1 +# +my_tempnam.c: .*the use of `tempnam' is dangerous, better use `mkstemp'.* + +# +# bdb is not critical to keep up to date +# +.*/bdb/.* : .*discards qualifiers from pointer target type.* +.*/bdb/.* : .*unused parameter.* +.*/bdb/.* : .*may be used uninitialized.* +.*/bdb/.* : .*empty body in an if-statement.* +db_vrfy.c : .*comparison is always false due to limited range of data type.* + +# +# Ignore all conversion warnings on windows 64 +# (Is safe as we are not yet supporting strings >= 2G) +# +.* : conversion from '__int64' to .*int'.* +.* : conversion from '__int64' to 'uint8'.* +.* : conversion from '__int64' to 'uint32'.* +.* : conversion from '__int64' to 'u.*long'.* +.* : conversion from '__int64' to 'long'.* +.* : conversion from '__int64' to 'off_t'.* +.* : conversion from '.*size_t' to .*int'.* +.* : conversion from '.*size_t' to 'TaoCrypt::word32'.* +.* : conversion from '.*size_t' to 'u.*long'.* +.* : conversion from '.*size_t' to 'uint32'.* +.* : conversion from '.*size_t' to 'off_t'.* +.* : conversion from '.*size_t' to 'size_s'.* + +# +# innobase is not critical in 4.1 to be kept up-to-date +# +.*/innobase/.* : .*unused parameter.* +.*/innobase/.* : .*may be used uninitialized in.* + +# +# The following should be fixed by the ndb team +# +.*/ndb/.* : .*used uninitialized in this function.* +.*/ndb/.* : .*unused variable.* +.*/ndb/.* : .*defined but not used.* +.*/ndb/.* : .*format.*expects type.* +.*/ndb/.* : .*has virtual functions but non-virtual destructor.* +.*/ndb/.* : .*comparison between signed and unsigned integer expressions.* +.*/ndb/.* : .*deprecated conversion from string constant to.* +.*/ndb/.* : .*enumeration value.*not handled in switch.* +.*/ndb/.* : .*enumeral and non-enumeral type in conditional expression.* diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 98d7182d46f..fb2dc879c28 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -767,6 +767,7 @@ static void verify_field_count(MYSQL_RES *result, uint exp_count) /* Utility function to execute a query using prepare-execute */ +#ifndef EMBEDDED_LIBRARY static void execute_prepare_query(const char *query, ulonglong exp_count) { MYSQL_STMT *stmt; @@ -787,7 +788,7 @@ static void execute_prepare_query(const char *query, ulonglong exp_count) DIE_UNLESS(affected_rows == exp_count); mysql_stmt_close(stmt); } - +#endif /* Store result processing */ @@ -11716,6 +11717,7 @@ static void test_bug12001() DIE_UNLESS(res==1); } +#ifndef EMBEDDED_LIBRARY static void test_bug12744() { MYSQL_STMT *prep_stmt = NULL; @@ -11746,6 +11748,7 @@ static void test_bug12744() } rc= mysql_stmt_close(prep_stmt); } +#endif /* Bug#11718: query with function, join and order by returns wrong type From 84536ba9e4afedd7741c27974eb34b3f858ad94e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 19:38:56 +0100 Subject: [PATCH 304/789] Deleted directories Docs/Books/ Docs/MySQL-logos/ Deleted files Docs/Tutorial-MySQL-final.txt Docs/bk.txt Docs/Support/.cvsignore Docs/Support/colspec-fix.pl Docs/Support/docbook-fixup.pl Docs/Support/docbook-prefix.pl Docs/Support/docbook-split Docs/Support/make-docbook Docs/Support/make-makefile Docs/Support/test-make-manual Docs/Support/test-make-manual-de Docs/Support/trivial-makeinfo-4.0c.patch Docs/Support/xwf Deleted file now in internals main text Docs/my_sys.txt Deleted file now in internals svn tree Docs/net_doc.txt Removed obsolete entries Docs/.cvsignore Added note that info is obsolete Docs/linuxthreads.txt BitKeeper/deleted/.del-colspec-fix.pl: Delete: Docs/Support/colspec-fix.pl BitKeeper/deleted/.del-docbook-fixup.pl: Delete: Docs/Support/docbook-fixup.pl BitKeeper/deleted/.del-docbook-prefix.pl: Delete: Docs/Support/docbook-prefix.pl BitKeeper/deleted/.del-docbook-split: Delete: Docs/Support/docbook-split BitKeeper/deleted/.del-make-docbook: Delete: Docs/Support/make-docbook BitKeeper/deleted/.del-make-makefile: Delete: Docs/Support/make-makefile BitKeeper/deleted/.del-test-make-manual-de: Delete: Docs/Support/test-make-manual-de BitKeeper/deleted/.del-test-make-manual: Delete: Docs/Support/test-make-manual BitKeeper/deleted/.del-trivial-makeinfo-4.0c.patch: Delete: Docs/Support/trivial-makeinfo-4.0c.patch BitKeeper/deleted/.del-xwf: Delete: Docs/Support/xwf BitKeeper/deleted/.del-algor.eps~1a57aff065918206: Delete: Docs/Books/algor.eps BitKeeper/deleted/.del-algor.gif: Delete: Docs/Books/algor.gif BitKeeper/deleted/.del-algor.txt: Delete: Docs/Books/algor.txt BitKeeper/deleted/.del-dbi.eps~7b1032f98de7736d: Delete: Docs/Books/dbi.eps BitKeeper/deleted/.del-dbi.gif: Delete: Docs/Books/dbi.gif BitKeeper/deleted/.del-dbi.txt: Delete: Docs/Books/dbi.txt BitKeeper/deleted/.del-dubois.eps~f24e09a7fa420436: Delete: Docs/Books/dubois.eps BitKeeper/deleted/.del-dubois.gif: Delete: Docs/Books/dubois.gif BitKeeper/deleted/.del-dubois.txt: Delete: Docs/Books/dubois.txt BitKeeper/deleted/.del-ecomm.eps~17833026ebd7656: Delete: Docs/Books/ecomm.eps BitKeeper/deleted/.del-ecomm.gif: Delete: Docs/Books/ecomm.gif BitKeeper/deleted/.del-ecomm.txt: Delete: Docs/Books/ecomm.txt BitKeeper/deleted/.del-in_21.eps~8150d06653dab178: Delete: Docs/Books/in_21.eps BitKeeper/deleted/.del-in_21.gif: Delete: Docs/Books/in_21.gif BitKeeper/deleted/.del-in_21.txt: Delete: Docs/Books/in_21.txt BitKeeper/deleted/.del-manual.eps~1c2ebcea50b4840c: Delete: Docs/Books/manual.eps BitKeeper/deleted/.del-manual.gif: Delete: Docs/Books/manual.gif BitKeeper/deleted/.del-manual.txt: Delete: Docs/Books/manual.txt BitKeeper/deleted/.del-msql.eps~f3801b9d166ae4fc: Delete: Docs/Books/msql.eps BitKeeper/deleted/.del-msql.gif: Delete: Docs/Books/msql.gif BitKeeper/deleted/.del-msql.txt: Delete: Docs/Books/msql.txt BitKeeper/deleted/.del-prof.eps~1f54d9a56eb2b908: Delete: Docs/Books/prof.eps BitKeeper/deleted/.del-prof.gif: Delete: Docs/Books/prof.gif BitKeeper/deleted/.del-prof.txt: Delete: Docs/Books/prof.txt BitKeeper/deleted/.del-pthreads.eps~2ca8ff2d1181b2c0: Delete: Docs/Books/pthreads.eps BitKeeper/deleted/.del-pthreads.gif: Delete: Docs/Books/pthreads.gif BitKeeper/deleted/.del-pthreads.txt: Delete: Docs/Books/pthreads.txt BitKeeper/deleted/.del-realmen.eps~cc022325d3cb045: Delete: Docs/Books/realmen.eps BitKeeper/deleted/.del-realmen.gif: Delete: Docs/Books/realmen.gif BitKeeper/deleted/.del-realmen.txt: Delete: Docs/Books/realmen.txt BitKeeper/deleted/.del-sql-99.eps~f85c06de7a016c7d: Delete: Docs/Books/sql-99.eps BitKeeper/deleted/.del-sql-99.gif: Delete: Docs/Books/sql-99.gif BitKeeper/deleted/.del-sql-99.txt: Delete: Docs/Books/sql-99.txt BitKeeper/deleted/.del-mysql-01.gif: Delete: Docs/MySQL-logos/mysql-01.gif BitKeeper/deleted/.del-mysql-02.gif: Delete: Docs/MySQL-logos/mysql-02.gif BitKeeper/deleted/.del-mysql-03.gif: Delete: Docs/MySQL-logos/mysql-03.gif BitKeeper/deleted/.del-mysql-04.gif: Delete: Docs/MySQL-logos/mysql-04.gif BitKeeper/deleted/.del-mysql-05.gif: Delete: Docs/MySQL-logos/mysql-05.gif BitKeeper/deleted/.del-mysql-06.gif: Delete: Docs/MySQL-logos/mysql-06.gif BitKeeper/deleted/.del-mysql-07.gif: Delete: Docs/MySQL-logos/mysql-07.gif BitKeeper/deleted/.del-mysql-08.gif: Delete: Docs/MySQL-logos/mysql-08.gif BitKeeper/deleted/.del-mysql-09.gif: Delete: Docs/MySQL-logos/mysql-09.gif BitKeeper/deleted/.del-mysql-10.gif: Delete: Docs/MySQL-logos/mysql-10.gif BitKeeper/deleted/.del-mysql-11.gif: Delete: Docs/MySQL-logos/mysql-11.gif BitKeeper/deleted/.del-mysql-12.gif: Delete: Docs/MySQL-logos/mysql-12.gif BitKeeper/deleted/.del-mysql-13.gif: Delete: Docs/MySQL-logos/mysql-13.gif BitKeeper/deleted/.del-mysql-14.gif: Delete: Docs/MySQL-logos/mysql-14.gif BitKeeper/deleted/.del-mysql-15.gif: Delete: Docs/MySQL-logos/mysql-15.gif BitKeeper/deleted/.del-mysql-16.gif: Delete: Docs/MySQL-logos/mysql-16.gif BitKeeper/deleted/.del-mysql-17.gif: Delete: Docs/MySQL-logos/mysql-17.gif BitKeeper/deleted/.del-mysql-compatible.jpg: Delete: Docs/MySQL-logos/mysql-compatible.jpg BitKeeper/deleted/.del-mysql_anim-01.gif: Delete: Docs/MySQL-logos/mysql_anim-01.gif BitKeeper/deleted/.del-mysql_anim-02.gif: Delete: Docs/MySQL-logos/mysql_anim-02.gif BitKeeper/deleted/.del-mysql_anim-03.gif: Delete: Docs/MySQL-logos/mysql_anim-03.gif BitKeeper/deleted/.del-mysql_anim-04.gif: Delete: Docs/MySQL-logos/mysql_anim-04.gif BitKeeper/deleted/.del-mysql_anim-05.gif: Delete: Docs/MySQL-logos/mysql_anim-05.gif BitKeeper/deleted/.del-mysql_anim-06.gif: Delete: Docs/MySQL-logos/mysql_anim-06.gif BitKeeper/deleted/.del-Tutorial-MySQL-final.txt: Delete: Docs/Tutorial-MySQL-final.txt BitKeeper/deleted/.del-net_doc.txt: Delete: Docs/net_doc.txt BitKeeper/deleted/.del-my_sys.txt: Delete: Docs/my_sys.txt BitKeeper/deleted/.del-bk.txt: Delete: Docs/bk.txt BitKeeper/deleted/.del-.cvsignore: Delete: Docs/Support/.cvsignore Docs/.cvsignore: Removed obsolete entries Docs/linuxthreads.txt: Added note info is obsolete --- Docs/.cvsignore | 37 +- Docs/Books/algor.eps | 1419 ------------------- Docs/Books/algor.gif | Bin 15001 -> 0 bytes Docs/Books/algor.txt | 0 Docs/Books/dbi.eps | 1212 ---------------- Docs/Books/dbi.gif | Bin 3308 -> 0 bytes Docs/Books/dbi.txt | 0 Docs/Books/dubois.eps | 1203 ---------------- Docs/Books/dubois.gif | Bin 2026 -> 0 bytes Docs/Books/dubois.txt | 0 Docs/Books/ecomm.eps | 1149 --------------- Docs/Books/ecomm.gif | Bin 2509 -> 0 bytes Docs/Books/ecomm.txt | 0 Docs/Books/in_21.eps | 1149 --------------- Docs/Books/in_21.gif | Bin 2514 -> 0 bytes Docs/Books/in_21.txt | 0 Docs/Books/manual.eps | 1221 ---------------- Docs/Books/manual.gif | Bin 2575 -> 0 bytes Docs/Books/manual.txt | 0 Docs/Books/msql.eps | 1221 ---------------- Docs/Books/msql.gif | Bin 8772 -> 0 bytes Docs/Books/msql.txt | 0 Docs/Books/prof.eps | 1167 --------------- Docs/Books/prof.gif | Bin 2942 -> 0 bytes Docs/Books/prof.txt | 0 Docs/Books/pthreads.eps | 1212 ---------------- Docs/Books/pthreads.gif | Bin 8463 -> 0 bytes Docs/Books/pthreads.txt | 0 Docs/Books/realmen.eps | 1167 --------------- Docs/Books/realmen.gif | Bin 7910 -> 0 bytes Docs/Books/realmen.txt | 0 Docs/Books/sql-99.eps | 1248 ---------------- Docs/Books/sql-99.gif | Bin 13038 -> 0 bytes Docs/Books/sql-99.txt | 0 Docs/MySQL-logos/mysql-01.gif | Bin 4097 -> 0 bytes Docs/MySQL-logos/mysql-02.gif | Bin 4811 -> 0 bytes Docs/MySQL-logos/mysql-03.gif | Bin 716 -> 0 bytes Docs/MySQL-logos/mysql-04.gif | Bin 909 -> 0 bytes Docs/MySQL-logos/mysql-05.gif | Bin 2192 -> 0 bytes Docs/MySQL-logos/mysql-06.gif | Bin 3082 -> 0 bytes Docs/MySQL-logos/mysql-07.gif | Bin 4209 -> 0 bytes Docs/MySQL-logos/mysql-08.gif | Bin 1595 -> 0 bytes Docs/MySQL-logos/mysql-09.gif | Bin 2627 -> 0 bytes Docs/MySQL-logos/mysql-10.gif | Bin 2455 -> 0 bytes Docs/MySQL-logos/mysql-11.gif | Bin 1436 -> 0 bytes Docs/MySQL-logos/mysql-12.gif | Bin 2642 -> 0 bytes Docs/MySQL-logos/mysql-13.gif | Bin 2914 -> 0 bytes Docs/MySQL-logos/mysql-14.gif | Bin 2686 -> 0 bytes Docs/MySQL-logos/mysql-15.gif | Bin 2310 -> 0 bytes Docs/MySQL-logos/mysql-16.gif | Bin 19192 -> 0 bytes Docs/MySQL-logos/mysql-17.gif | Bin 2059 -> 0 bytes Docs/MySQL-logos/mysql-compatible.jpg | Bin 2809 -> 0 bytes Docs/MySQL-logos/mysql_anim-01.gif | Bin 15008 -> 0 bytes Docs/MySQL-logos/mysql_anim-02.gif | Bin 21236 -> 0 bytes Docs/MySQL-logos/mysql_anim-03.gif | Bin 16958 -> 0 bytes Docs/MySQL-logos/mysql_anim-04.gif | Bin 12716 -> 0 bytes Docs/MySQL-logos/mysql_anim-05.gif | Bin 22962 -> 0 bytes Docs/MySQL-logos/mysql_anim-06.gif | Bin 42606 -> 0 bytes Docs/Support/.cvsignore | 2 - Docs/Support/colspec-fix.pl | 78 - Docs/Support/docbook-fixup.pl | 200 --- Docs/Support/docbook-prefix.pl | 50 - Docs/Support/docbook-split | 70 - Docs/Support/make-docbook | 29 - Docs/Support/make-makefile | 7 - Docs/Support/test-make-manual | 137 -- Docs/Support/test-make-manual-de | 137 -- Docs/Support/trivial-makeinfo-4.0c.patch | 11 - Docs/Support/xwf | 67 - Docs/Tutorial-MySQL-final.txt | 1643 ---------------------- Docs/bk.txt | 65 - Docs/linuxthreads.txt | 2 + Docs/my_sys.txt | 140 -- Docs/net_doc.txt | 945 ------------- 74 files changed, 3 insertions(+), 16985 deletions(-) delete mode 100644 Docs/Books/algor.eps delete mode 100644 Docs/Books/algor.gif delete mode 100644 Docs/Books/algor.txt delete mode 100644 Docs/Books/dbi.eps delete mode 100644 Docs/Books/dbi.gif delete mode 100644 Docs/Books/dbi.txt delete mode 100644 Docs/Books/dubois.eps delete mode 100644 Docs/Books/dubois.gif delete mode 100644 Docs/Books/dubois.txt delete mode 100644 Docs/Books/ecomm.eps delete mode 100644 Docs/Books/ecomm.gif delete mode 100644 Docs/Books/ecomm.txt delete mode 100644 Docs/Books/in_21.eps delete mode 100644 Docs/Books/in_21.gif delete mode 100644 Docs/Books/in_21.txt delete mode 100644 Docs/Books/manual.eps delete mode 100644 Docs/Books/manual.gif delete mode 100644 Docs/Books/manual.txt delete mode 100644 Docs/Books/msql.eps delete mode 100644 Docs/Books/msql.gif delete mode 100644 Docs/Books/msql.txt delete mode 100644 Docs/Books/prof.eps delete mode 100644 Docs/Books/prof.gif delete mode 100644 Docs/Books/prof.txt delete mode 100644 Docs/Books/pthreads.eps delete mode 100644 Docs/Books/pthreads.gif delete mode 100644 Docs/Books/pthreads.txt delete mode 100644 Docs/Books/realmen.eps delete mode 100644 Docs/Books/realmen.gif delete mode 100644 Docs/Books/realmen.txt delete mode 100644 Docs/Books/sql-99.eps delete mode 100644 Docs/Books/sql-99.gif delete mode 100644 Docs/Books/sql-99.txt delete mode 100644 Docs/MySQL-logos/mysql-01.gif delete mode 100644 Docs/MySQL-logos/mysql-02.gif delete mode 100644 Docs/MySQL-logos/mysql-03.gif delete mode 100644 Docs/MySQL-logos/mysql-04.gif delete mode 100644 Docs/MySQL-logos/mysql-05.gif delete mode 100644 Docs/MySQL-logos/mysql-06.gif delete mode 100644 Docs/MySQL-logos/mysql-07.gif delete mode 100644 Docs/MySQL-logos/mysql-08.gif delete mode 100644 Docs/MySQL-logos/mysql-09.gif delete mode 100644 Docs/MySQL-logos/mysql-10.gif delete mode 100644 Docs/MySQL-logos/mysql-11.gif delete mode 100644 Docs/MySQL-logos/mysql-12.gif delete mode 100644 Docs/MySQL-logos/mysql-13.gif delete mode 100644 Docs/MySQL-logos/mysql-14.gif delete mode 100644 Docs/MySQL-logos/mysql-15.gif delete mode 100644 Docs/MySQL-logos/mysql-16.gif delete mode 100644 Docs/MySQL-logos/mysql-17.gif delete mode 100644 Docs/MySQL-logos/mysql-compatible.jpg delete mode 100644 Docs/MySQL-logos/mysql_anim-01.gif delete mode 100644 Docs/MySQL-logos/mysql_anim-02.gif delete mode 100644 Docs/MySQL-logos/mysql_anim-03.gif delete mode 100644 Docs/MySQL-logos/mysql_anim-04.gif delete mode 100644 Docs/MySQL-logos/mysql_anim-05.gif delete mode 100644 Docs/MySQL-logos/mysql_anim-06.gif delete mode 100644 Docs/Support/.cvsignore delete mode 100755 Docs/Support/colspec-fix.pl delete mode 100755 Docs/Support/docbook-fixup.pl delete mode 100755 Docs/Support/docbook-prefix.pl delete mode 100755 Docs/Support/docbook-split delete mode 100755 Docs/Support/make-docbook delete mode 100755 Docs/Support/make-makefile delete mode 100755 Docs/Support/test-make-manual delete mode 100755 Docs/Support/test-make-manual-de delete mode 100644 Docs/Support/trivial-makeinfo-4.0c.patch delete mode 100755 Docs/Support/xwf delete mode 100644 Docs/Tutorial-MySQL-final.txt delete mode 100644 Docs/bk.txt delete mode 100644 Docs/my_sys.txt delete mode 100644 Docs/net_doc.txt diff --git a/Docs/.cvsignore b/Docs/.cvsignore index 777efb1eb7b..6a00212535b 100644 --- a/Docs/.cvsignore +++ b/Docs/.cvsignore @@ -1,40 +1,5 @@ -COPYING -COPYING.LIB +INSTALL-SOURCE INSTALL-BINARY Makefile Makefile.in -Manual-updates -before-gpl-changes-manual.texi -include.texi -manual-before-gpl.texi -manual-tmp.aux -manual-tmp.cp -manual-tmp.fn -manual-tmp.ky -manual-tmp.log -manual-tmp.pdf -manual-tmp.pg -manual-tmp.texi -manual-tmp.toc -manual-tmp.tp -manual-tmp.vr -manual.aux -manual.cp -manual.cps -manual.fn -manual.fns -manual.html -manual.ky -manual.log -manual.pdf -manual.pg -manual.toc -manual.tp -manual.txt -manual.vr -manual_a4.ps -manual_a4.ps.gz -manual_letter.ps -manual_letter.ps.gz -manual_toc.html mysql.info diff --git a/Docs/Books/algor.eps b/Docs/Books/algor.eps deleted file mode 100644 index b202f02d12a..00000000000 --- a/Docs/Books/algor.eps +++ /dev/null @@ -1,1419 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /home/mwagner/work/bk/mysql/Docs/Flags/algor.eps -%%CreationDate: Sun Dec 31 14:27:48 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 254 383 -%%EndComments -%%BeginPreview: 100 154 1 154 -% fffffffffffffffffffffffff0 -% fffffffffffffffffffffffff0 -% fffffffffffffffffffffffff0 -% ffffffffff7ffffffffffffbb0 -% fbbbefffbbfefffffffffffff0 -% fffffff7fffffbdeefffffeff0 -% f7ffbf7ffffbffffffbff7bf70 -% ffffffffbeefffffffffbffff0 -% f77bfffbfffff7fffffffffdf0 -% fffffffffdffbfbffefeff7ff0 -% dfffeefffffeffffdffffffbf0 -% fb77bff7b7effffdfffbfdfff0 -% ffde3ffffde3f7bfff7ff785d0 -% 6f9f3feff977bfffff3fbf38f0 -% fe8f3f7fff33fffffbfffe7ff0 -% 774f31eb5532f4d75fb6fcfed0 -% 7e6f2c18011222224e2034fff0 -% fee72e9d3d333332ff33bcdbf0 -% 760724bc3933b3321f331cffb0 -% fcf3259cb933337b8733bc7ff0 -% 79f32f9d39373332ef333e7df0 -% f5e12049391323324e339b02f0 -% 7effce77def7deddbfd7bfd7f0 -% ffffdf7fffffffffffffffffd0 -% 6fefce7ffffffffffffffffff0 -% feff61fdfff7dffffffffffef0 -% 7ffffff7ddeffdff7efffbb7f0 -% f7deffffffff7ffdfbfbefffd0 -% 7effffdfffffffeffffffffdf0 -% 7fffeefedffbffffffefffbff0 -% f7fbffffff7f6dfdbfff7bf770 -% ffdfbffffff7ffeffffffffef0 -% 6ffffff77ffffffffdfffffff0 -% 7efffd7dfdfdddfef7dff7eff0 -% fffbfe9cffb2fdfffb9eff7f70 -% 7befbcb6aab7b955af5bfffdf0 -% effffe689138a548b0affbf7f0 -% 7fbff6ad9dbe4d568bcffffff0 -% 7ffefc88aab2b2355893bfbfb0 -% fbffeffff7dfdecbff7ffffff0 -% ffbbffffffffff5ffffffff6f0 -% 7ffffffffffffdffffffffbff0 -% 77fffffddfdfbffff7fffdfff0 -% ff7fbdfffefdfbf6ffef7fffb0 -% 7ff7ffffffffffffffbffffef0 -% f7ffffefdfffffefeffffffbf0 -% 7f7f7dfffffdfbfffffffdeff0 -% 6ffdfffffeffefdefff6fffff0 -% fef7ffdf7ff7ffffff7fffffb0 -% fffff7fffbffffbff7fffddef0 -% 6dffdffdfffffffdfffff7fff0 -% 7fefffbfefdfbeffdf77bffff0 -% ffff7fffff7ef7ffffffffbbf0 -% 6bbdff7bdffffff7bdffffffb0 -% fffffbffffffeffffffdfffff0 -% 6f7ffff7bdedbeeef7b7edddf0 -% fffbefffffffffffffffffffd0 -% 7daebaaaaaad6aad5addb77ff0 -% 6ffffffffffffffbf7b76ddbb0 -% ff756bbadb55aab6fffffffff0 -% 6db4d62100000000008a515ff0 -% fffdabbaad250896555ce7ff70 -% 6f6d76a9a449084233d7565df0 -% ffeaa73521004210891cd57ff0 -% 7da44a400a5494842041215ff0 -% 77fae53ad08021294a9e6afbb0 -% ff6dbf51442208423195b5aff0 -% 6ffd653a8c4110862adad77ff0 -% fdaaeb51410842105154a55fb0 -% 6f644044100210008401287df0 -% ffedaf29429442290956576ff0 -% 6ebad2b98c2108c6318cb57f70 -% ffeeee914a210844335aebdff0 -% bb68a10a484000814914a67bd0 -% 77ca4a50108451100221095ff0 -% ff74a4a5420800054846657f70 -% 6feeeb198c6314c4318cd6dbf0 -% 7d6aa6b08a210846229a657ff0 -% ffd4a90450882109445292df70 -% 6da40049010000100100087bf0 -% ff6aed225a52a5214a56e55ff0 -% 6feca330842288c6308c537fb0 -% fd6ad62986631844118a556ef0 -% 6fc80088204842884a50927ff0 -% ff65504208800011000104dff0 -% 7de885292252aaa44a54517bd0 -% 6f6d6611845318c4118c465ff0 -% ffd242b14c229482310852ff70 -% 7d649404209021114452885df0 -% efd1004002444224000012fff0 -% 7f645529589294894a52445fd0 -% edcd4210c4231892318c4afdf0 -% 7f6042914a4892662100515ff0 -% 7bd51424014950084849087bb0 -% ef62008020120550800012dff0 -% bfc928214ac4b2252a42887ff0 -% 7d6843188c2998c6218c425b70 -% efe110014a622545280028fff0 -% 7f4288a4108aa4100022815ff0 -% 7de524002104a9208a40947bb0 -% ef600952ca7244c62011085ff0 -% 7fcc621086251aa5318c637f70 -% fb6101154a49b04a2900005df0 -% 6fca944010820510802114fff0 -% fea21084211454000402115fd0 -% 6fe945298e61916f5150847bf0 -% fd6c4210c8451842310c635fb0 -% 7fc125294932a5922140087ff0 -% eb6a884210840000840292ddf0 -% 7fd020842108a5284020047fd0 -% 77654a3148329483294aa95bf0 -% ff6c6310866318c6318c42ffb0 -% 6dd14529245294a80908525ff0 -% ff64104411040001002204fdf0 -% 77c94482204842104400915fd0 -% ff74a539865298c4199a467bf0 -% 6f6d67208c6314a6310c6adfd0 -% fdd0a4a55210042540d2a2ff70 -% 77650840008040000a00085bf0 -% efca528a52048229405552fff0 -% 7f7ce7308c6318c6259a655fb0 -% edd5542984510844310cd7fdf0 -% 7f5aa555520200894aa4a45ff0 -% dde452000088421000020affd0 -% 7b5aad5aa81000214a28e25b70 -% f7eee6918a6218c63196affff0 -% bf5ad5394c210844294cb55ff0 -% 76eca54541004102529466fdd0 -% efca4a50100a12100022485ff0 -% 7d75e2aa820040014a94d3ffb0 -% 6fdebb315c62088a32daa6bbf0 -% fb69d6aa842110462995fb7ff0 -% 6fdaa52949084210529e455fb0 -% ff64524200509081002052fef0 -% 6dd6e739528022122a8d445ff0 -% ff6d6dd58c25084452dad7fdd0 -% 6fdad731204108822956b55ff0 -% 7d6aaa548a8841145298a3dfd0 -% fffffffffffffffffff7fefdf0 -% ed55555555555555555eadbff0 -% 7ffffffffffffffffff7fbf7b0 -% 77ffffffffffffffff7ffffff0 -% ff7fdfeeef7dbf7bb7feefdef0 -% 6fedff7ffff7fdfffffffffff0 -% fdfffdffbffff7ffffb7ff7bd0 -% 7fdfb7fffbff7fefbdff6ffff0 -% efffffedffb7ffbefffffeef70 -% 7dbbffffdfffeefff7eefffdf0 -% ffff7ddffeff7ffdfffff7ffd0 -% 6dffeffffff7fdffdeffffdbf0 -% 7ff7ffff6dffffeffff7df7fd0 -% fbbffedfffefdffefbffffff70 -% 77ff7bfdffffffffffef7efbf0 -% fffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 368.503937 translate -239.288271 -368.503937 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 154 8 -% Transformation matrix -[ 100 0 0 154 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404 -0404045c0c735c0c735c04745c0c735c0c735c04745c04745c0c735c0c735c0c735c046c540b6c -540b6c5c0c73540b6c540b6c5c0c735c046c5004645c046c500464540b6c540b6c540b74540b74 -540b6c500464540b6c500464540b6c540b6c5004645c0c73540b6c540b6c5c15745c15745c1574 -5c1574540b74500464500464540b6c540b6c5c0c73500464540b74500464500464540b6c500464 -540b6c500464540b74540b6c540b6c540b6c540b6c500464500464540b6c540b6c5004645c0c73 -540b6c540b74540b6c500464540b6c500464500464540b6c4c086c5004644c086c5004644c086c -4c086c540b6c540b74540b6c540b6c500464540b745004644c0b74500464540b744c086c55146c -5415745415745415745c1574541574540b6c55146c541574040404 -0404045c0c7c5c0c7c5c0c735c0c73640c795c0c735c0c735c0c735c0c735c04745c0c73640c79 -5c046c5c0c735c046c5c0c73540b6c5c0c735c0c735c0c735c046c5c0c73500464540b6c5c0c73 -5004645c0c735c0c735004645c0c73540b745c0c73540b6c540b6c5c0c73540b6c540b6c5c1574 -5c1574540b6c540b6c540b74540b6c5c0c73540b74540b74540b6c5c0c73540b6c540b74540b74 -540b74540b6c540b6c540b6c540b6c540b6c540b6c540b745c0c73540b6c540b74540b6c540b74 -540b6c540b6c540b74540b74540b6c540b74540b74500464500464540b6c500464540b6c540b6c -540b6c4c086c541574540b6c540b744c086c540b6c4c086c540b6c4c0b74540b6c540b6c4c086c -5415745415745c157454157454157454157454157455146c040404 -0404045c0c735c0c735c04745c0c735c0c73640c795c0c735c04745c04745c0c73640c79540b6c -5c0c73540b6c5c0c735c0c73540b6c5c0c735c0c73540b6c5c046c5004645c04745c0c73500464 -5004645c0c735004645c0c73541574540b6c540b6c540b6c5c0c73540b6c540b6c540b6c5c0c73 -540b6c5c1574540b74500464540b6c5c1574540b74500464540b6c540b74500464540b6c540b6c -540b6c540b6c540b6c5c0c73540b6c540b6c540b6c540b6c540b6c5c0c73540b6c540b6c540b6c -540b6c540b6c540b6c540b6c540b6c540b6c540b6c540b6c540b74540b74540b6c4c086c540b6c -540b6c540b6c540b6c4c086c5004644c086c5004644c086c4c086c5004644c086c540b6c540b6c -55146c54157454157455146c5c1574541574541574540b6c040404 -0404045c0c73640c795c0c735c04745c0c735c0c73640c795c0c735c0c735c0c735c04745c0c73 -660b655c04745c0c73540b6c5c046c540b6c5c0c735c0c735004645c0474540b6c5004645c0c73 -540b74540b6c5c0c735004645c0c73540b74540b6c5c0c73540b6c540b6c5c0c735c1574540b6c -540b6c540b6c540b6c540b745c0c73540b6c5c0c73540b6c5c1574540b6c540b74540b74540b6c -540b6c540b6c540b6c540b74540b6c540b6c540b6c540b6c540b6c540b6c540b6c540b74540b6c -5c0c73540b6c540b6c540b6c540b6c540b6c540b6c500464540b6c500464540b6c5004644c086c -540b6c4c086c4c086c540b6c540b6c540b6c540b74540b6c540b6c540b74540b6c540b6c540b6c -540b6c5415745c1574541574541574540b6c55146c540b74040404 -040404540b6c5c0c735c0c736414745c0c7c5c0c735c0c735c0c735c04745c0474540b745c0474 -540b6c540b6c5c0c73540b6c5c046c540b6c5004645c0c735c0c73540b6c5004645c0c73540b6c -5c046c540b6c5c0c735c0c73540b6c540b6c540b6c5c0c73540b74540b6c540b6c540b6c540b74 -540b6c540b6c540b74540b6c540b74540b6c540b6c540b74540b6c540b6c540b6c540b6c5c0c73 -540b6c540b74540b6c540b6c540b74540b6c540b6c540b6c540b6c540b6c540b6c540b6c540b6c -540b74540b6c5c0c73540b6c540b74540b6c540b6c500464500464500464540b74540b6c540b6c -540b6c500464540b6c4c086c540b6c4c086c540b6c540b6c540b6c540b6c4c086c540b6c540b6c -540b6c540b74541574541574541574541574541574540b74040404 -0404045c1574640c795c0c735c15746414745c0c7c5c0c735c0c735c04745c0c735c04745c046c -5c0c73540b6c5c0c73540b6c5c0c735c0c735c0c73500464540b6c540b6c5c0c735c0c73500464 -540b6c540b6c5c1574540b6c540b6c540b6c540b6c540b6c5c0c73540b6c540b6c540b745c1574 -5c0c73540b6c540b6c5c0c73540b6c540b6c540b6c540b6c540b74540b6c540b6c540b6c540b74 -540b6c540b6c5c0c73540b6c540b6c540b6c540b6c540b6c540b74500464540b6c500464540b74 -5c0c73540b6c540b6c540b6c540b6c540b6c540b74540b6c540b74500464540b6c540b6c540b6c -4c086c540b6c4c086c540b6c540b6c4c086c540b6c540b6c540b6c540b6c540b6c55146c4c086c -540b6c540b6c54157455146c540b74541574541574540b6c040404 -0404046414745c0c7c5c15745c147c6414745c0c735c0c735c0c735c0c735c04745c04745c0c73 -5c0c735c0c73540b6c5c0c735c0c735c0c73500464540b6c5c04745004645c046c540b6c500464 -5c0c7355146c5c0c73540b6c540b745c0c73540b6c5c15745c1574540b6c540b6c5c0c73540b6c -5c1574540b74540b6c540b6c5c0c73540b6c540b6c540b6c540b6c5c1574540b6c540b6c540b6c -540b6c540b74540b6c540b6c540b74540b6c540b6c540b6c540b6c540b6c540b74540b74500464 -540b6c540b74500464540b6c540b74540b6c540b6c540b74500464500464540b6c540b6c540b6c -540b6c4c086c540b6c540b7454157455146c4c086c540b6c4c086c540b6c540b74540b74541574 -541c6c541574540b6c540b7455146c540b74540b6c540b6c040404 -0404045c0c735c0c735c0c73641a7c641a7c5c147c5c0c735c0c735c15745c0c73540b6c540b6c -5c0c735c046c540b6c5c0c735c046c500464540b745c0c735004645c046c5004645c0c73500464 -5c0c7c540b6c5c0c735c15745c15745c15745004645c0c735c15745c1574540b6c540b6c540b6c -5c1574540b6c500464540b74540b6c540b6c540b6c540b7455146c540b6c540b6c500464540b6c -540b6c5c0c73540b6c540b74540b6c540b6c5c0c73540b6c500464540b74500464540b74500464 -540b74540b6c540b6c540b74540b74540b74540b6c540b6c540b6c540b74540b6c4c086c540b6c -4c086c540b6c540b6c5415745415744c086c4c086c4c086c540b6c4c086c55146c540b6c540b6c -541574541574541574541574540b74541574540b6c541574040404 -0404045c147c6414745c0c73641a7c5c15745c15745c04746414745c0c735c0c735c04745c0c73 -540b6c5c0c735c046c540b6c5c046c5c0c735004645c0c735c0c735004645c0c73540b745c046c -540b6c540b6c540b6c5c0c73540b745c0c73540b745004645c0c73540b6c540b6c540b6c5c1574 -5c0c73540b6c5c1574540b6c540b6c5c0c735c0c73540b6c5c157455146c5c0c73540b6c500464 -540b6c540b6c540b6c5c0c735004645c15745c0c73540b6c540b74540b74540b74500464540b74 -540b74540b6c540b6c540b6c540b6c540b6c540b6c540b74540b6c540b6c540b6c500464540b6c -540b74540b74540b6c540b6c4c086c4c086c540b6c540b6c54157454157455146c4c086c4c086c -540b6c55146c540b6c541574540b6c541574540b74540b74040404 -0404046414746414745c0c73641a7c5c15745c0c735c0c735c0c73540b6c5c0c73660b65540b6c -640c79540b6c5c046c5c046c540b74540b6c5c0c735004645c046c5c04745c0c73500464500464 -5004645c046c5c0c735c1574540b6c5c15745c0c735c0c735c0c73540b6c540b6c5c0c735c1574 -5c1574540b6c5c15745c1574540b6c541574540b6c540b6c5c15745c0c73500464540b74540b74 -540b6c540b6c540b6c540b74540b745c1574540b6c540b6c540b6c540b74500464540b74500464 -540b6c540b74540b6c540b74540b6c540b74540b6c540b6c540b6c540b74540b6c540b74540b6c -540b6c540b74540b6c540b6c55146c4c086c4c086c540b6c540b745c15744c086c55146c55146c -4c086c540b7455146c540b6c540b6c540b6c541574540b6c040404 -0404045c147c641a7c641a7c5c15746414745c0c735c0c735c15745c0c735c0c73540b745c0c73 -5c0c735c046c5c046c5c0c73641474540b6c5c046c5c0474540b6c5c046c540b6c5c0c73540b74 -5c0474540b6c5c0c735c1574540b6c5c1574540b6c5c15745c0c735c15745c0c73540b6c540b6c -5c147c540b6c540b6c540b6c5415745c15745c0c735c0c73500464540b6c540b6c5c0c73540b6c -541574540b6c540b6c540b6c540b6c5c1574540b6c500464540b6c540b6c540b74540b6c540b6c -540b74540b6c540b6c540b6c540b6c540b6c55146c4c086c540b6c540b74540b6c540b6c540b74 -541574540b6c4c146c5415745415744c086c540b6c540b6c540b74541574540b6c4c0b74440458 -4c086c4c086c5004644c086c54157455146c540b74540b74040404 -0404045c0c73641474641a7c5c2479641a7c5c15745c0c735c0c73885b87b986805c046c5c0c73 -5c0c735c04747c4b82c8b7a8e9b899872164500464540b6c5c046c540b6c5c0c735c046c540b6c -540b6c5c15745c0c73540b6c5c0c735c0c73540b6c540b6c540b74540b6c540b6c7c4b82a37483 -6817695c0c735004645c157494788fcac4b7ca83775c0460540b6c5c15745c1574540b6c55146c -5c15745c1e6c540b6c540b6c540b7455146c540b6c500464540b74540b6c540b6c540b6c500464 -5c0c73540b6c540b6c540b74540b6c540b6c540b746b3779874d7a540b6c540b6c540b74540b74 -540b6c540b6c540b6c540b6c540b6c4c086c54157455146c55146c540b6c55146c7c4b8294788f -a48899a48899a37483885b87641c7454157455146c541574040404 -0404045c0c7c5c147c641474641a7c6414745c147c5c0c735c1574c7b8b7fad9a581205c540b74 -5c0c735c0c73540b74c19ba5fad9a5872164540b745c0474540b6c5c0474540b6c5c0c73540b6c -5c0c735c0c735c0c735c157455146c540b6c540b6c5c0c735c0c73540b6c4c086ca69798f7d8b8 -81205c6b3779885b876817696b3779faecc9c78c825c0460540b6c5c1574641c74540b6c55146c -5c157455146c540b6c540b6c5c0c735c1574540b6c540b74540b74540b6c5c0c73540b74540b74 -540b6c540b6c540b6c540b6c5c0c73540b6c55146cc7b8b7e9b8996f175c540b744c086c5c1574 -5c0c7355146c55146c55146c55146c55146c5c1574541574540b6c541c6cb8a8a7e7c7a594788f -773c7c7c4b8294788fe8dab9ca83774c146c54157455146c040404 -040404641474641a7c641474641a7c6414745c0c735c0c73773c7ce9b899f9ebb6ca83775c046c -540b745c0c734c086ca48899fad9a581205c540b745c04745004644c086c540b745c0c735c0c73 -5c04745c046c500464540b6c5c0c735c0c73500464540b6c540b74500464540b6c641c746a2976 -4c086cb8a8a7f8d094660b65541574e8dab9ca8377500464540b74500464540b745c0c73540b6c -540b74540b74540b74500464540b6c541574500464500464500464540b74540b745c0c73500464 -540b74500464540b6c540b7455146c540b6c540b6c6b3779773c7c540b6c540b6c540b74500464 -540b74500464540b6c541574540b744c146c5c1574541c6c4c1575c7b8b7f7c7a87926664c086c -540b74540b7444045894788fab5f70540b74541574541574040404 -0404046414745c0c7c641a7c641a7c6414745c147c5c0c73b89898ab5f70c8b7a8f8d0946f175c -5c147c5c0c73500464a48899fad9a5781a66540c7c7c4b8294788fa37483773372641c74641474 -641a7c885b8794788f885b87681769641c74773c7c773c7c6a2976885b877733726b3779874d7a -5c1464b8a8a7f7be9a69256b641c74e8dab9ca83776a297694788f874d7a681769540b745c1c7c -6b37797733726b377994788f773c7c5c0c64672784885b87874d7a540b6c540b74540b746a2976 -885b87885b8779266655146c540b6c5415745415745c15746a2976540b6c5c157464257c6a2976 -5c1574885b87773c7c55146c540b74540b6c55146c4c086c867389faecc9ab5f704c0b7455146c -55146c55146c540b745c2479641c7455146c5c15745c2479040404 -0404045c0c735c147c640c795c147c5c0c7c5c0c73773c7cd7a899781a66885b87f9ebb6ab5f70 -5c046c5c0c73540b74a48899fad9a5792666b89898c78c82773c7cc8a9a7f9ebb6c9a799b98680 -d9b899ab5f70773c7cc8b7a8e9b899ae7b74d9d5b8f7be9ad7a899faecc9c78c82c8b7a8fad9a5 -ab5f70d9d5b8f7d8b8c9a79992655fd8c7b8e6aa9dc78c82c8a9a7faecc9c89887681769885b87 -e8dab9e9b899c89887c8b7a8f9ebb6b98680b7898fc8b7a8f9ebb6c78c825c0c64885b87d7a899 -885b87a48899e9b899792666540b74540b74885b87d9d5b8e9b8996f175c867389e8dab9d9b899 -b99886c8b7a8f9ebb6d6998669256b5c15745415744c1575b8a8a7f9ebb68a2f624c157555146c -54157455146c55146c5415745c157454157455146c5c1574040404 -0404045c0c7c6414745c147c640c795c147c540b74a48899ca8377640c79641c74d9d5b8e6aa87 -660b655c0c7c500464a48899fad9a5ab5f70f9ebb68a2f62540b74773c7cfaecc9ab5f70b9b6a8 -e6aa875c0460540b7464257cfaecc9ca8377b89898f9ebb68f416b7c4b82792666a48899fad9a5 -8a2f62b9b6a8f7be9a681769641a7cd9d5b8e8bb88781a664c1575a48899f9ebb68a2f624c086c -c8b7a8fad9a57926664c086cb8a8a7fad9a58a2f624c086cac99a7fad9a58a2f62c7b8b7d88e7d -500464500464ab5f706817695415745c15744c146cb9b6a8f7be9a6f175c541574d8c7b8f8d094 -7926664c157594788ffaecc98f416b5415745c157455146cc8b7a8f9ebb68f416b541574541c6c -55146c5415745c15745415745c1574541574541574541574040404 -0404046414745c0c7c6414746414745c0c7c672784e7c7a5c8a886a69798b89898dad4a8f9ebb6 -99275e5c0c73540b74ac99a7fad9a5ab5f70f9ebb6ab5f70540b74885b87f8d0948f416be9d8c8 -ca83775c046c5c15745c1574d7c8a8e6aa87b89898f8d0946f175c540b74540b74a48899fad9a5 -81205cb9b6a8f7bb86660b655c1574e8dab9d699865c0c64540b6c94788ff9ebb68a2f62541574 -c8b7a8efad935c0c644c086ca48899f7be9a68176950046494788ff9ebb68a2f62a48899f9ebb6 -d9b899a4889977337255146c540b6c540b6c541574b8a8a7f7be9a6f175c55146cc7b8b7efad93 -660b654c0b747c4b82f9ebb6ab5f704c146c54157455146cc8a9a7f9ebb68f416b541c7c5c1574 -55146c541c6c54157455146c55146c5c1574541574540b74040404 -040404640c796414745c147c641a7c5c0c7ca48899d699866c1c7c6a29766c1c7c6b3779f9ebb6 -e59b87540b6c4c086cac99a7f8d094781a66a48899e9b899a3748394788f8f416b641c74f9ebb6 -e09e75660b65641474540b74c8b7a8e6aa87b89898f7be9a781a665c0c73500464a48899fad9a5 -872164c8b7a8efad935c04605c1e6cd9d5b8d69986660b65540b7494788ff9ebb68a2f62541574 -cac4a7e9b8995c1464500464a48899f7be9a6817694c0b7494788ff9ebb68a2f625c1574885b87 -a48899cac4b7f9ebb6ab5f70540b6c540b74540b6cb8a8a7f7be9a6817694c0b74c7b8b7efad93 -5c0c644c086c7c4b82faecc9ab5f704c086c5c157455146c867389faecc9d88e7d5c1e6c541574 -5415745c15745c15745c157454157454157455146c541574040404 -0404045c0c736414745c147c5c147c672784e7c7a599275e5c047c5c0c7c5c15744c0b74a69798 -f9ebb68a2f624c086ca48899fad9a56f175ca48899c898877926666414745c147c5c0c73b9b6a8 -fad9a581205c4c0b745c1574e8dab9ab5f70a48899f8d0946817695c147c540b7494788ffad9a5 -781a66b9b6a8efad93681769541c6ce8dab9d88e7d5c0460540b7494788ff9ebb699275e4c086c -c8b7a8efad9364105c4c086ca48899f7bb86660b654c086c94788ff9ebb681205ca37483781a66 -4c086c541c6ce8dab9ab5f70500464541574500464ac99a7f7be9a6f175c4c0b74cac4b7e9b899 -5c0460540b747c4b82f9ebb6ab5f705415745c1e6c55146c541574b9b6a8faecc9ae7b74540b6c -4c086c540b6c4c086c541c6c641c745c15745415745c1574040404 -040404640c79641474640c796a2976c19ba5e9d9a6ae7b747926665c0c7c5c0c73773c7cc8a9a7 -f9ebb6c89887874d7ad8b7a8fad9a5ab5f70c8b7a8f9ebb6d7c8a8d7c8a8dad4a8c89997874d7a -d9d5b8d9b899874d7aa69798c78c82773372cac4a7fad9a5ab5f706414746a2976b9b6a8f9ebb6 -ab5f70b7898ff9ebb6d7a899a37483e8dab9e9b8998f416b50046494788ff9ebb6ab5f707c4b82 -d9d5b8e7c7a58f416b6b3779b8a8a7fad9a58f416b50046494788ff9ebb6ab5f70c5b699c78c82 -773c7c94788fd7a899792666540b6c540b6c6b3779cac4a7fad9a5874d7a773c7cd9d5b8e7c7a5 -773372540b6c885b87faecc9ca83776a297654157455146c541574541c6cb89898faecc9d9b899 -a8878694788f94788fb8a8a7a3748355146c5415745c1574040404 -0404045c0c7c5c0c7c5c0c7c6c1c7c6b37796a2976773c7c6c14745c0c735c0c7c64257c773c7c -6a29766b37797733726b377964257c885b87c9a799a374837c4b827c4b82a48899f9ebb6ab5f70 -641c74885b87885b87773c7c540b6c773c7c773c7c6b37797c4b82641c746a2976773c7c773c7c -7c4b82681769885b877c4b82773c7c773c7c7c4b826b37795c0c736a2976885b877c4b82773c7c -7c4b827c4b827733727733727c4b82885b87874d7a5c0c7364257c885b87885b87874d7a94788f -94788f885b87681769540b74540b6c540b6c773c7c885b87885b87874d7a874d7a885b87885b87 -874d7a55146c5c2479885b87885b8769256b55146c540b6c5415744c086c4c146c6b377994788f -a69798a4889994788f874d7a5c15745c1574541574541574040404 -0404045c0c7c640c795c147c5c047c5c0474640c795c0c7c5c0c7c5c0c735c0c735c0c73540c7c -5c0c735c04745c04745c0474500464ac99a7e6aa875c0460540b74540b74540b6cf9ebb6ab5f70 -5004645004645c0c735c046c540b6c5c0c73500464540b74540b745c147c5c0c73540b74540b74 -540b74500464540b74540b745c0c73540b6c4c086c540b745c0c735c0474540b74540b6c540b6c -540b6c540b6c4c086c540b745004645004644c086c5c0c735004644c086c4c086c4c0b744c086c -4c0b74500464540b6c540b6c540b6c540b6c4c086c540b744c086c4c0b744c0b744c086c4c086c -4c086c540b74540b744c086c440458540b74541574540b74540b6c540b6c541574541574540b74 -4c0b74540b6c4c086c540b7455146c541574541574541574040404 -0404045c0c735c0c7c6414745c0c735c0c735c0c7c5c0c735c15745c0c735c0c735c0c735c0c73 -5c15745c0c735c0c735c0c73500464b89898f8d0946f175c50046450046494788fe9b89981205c -540b745c0c735c0c735c0c735c0c735c15745c0474540b6c6414745c0c73540b6c540b6c540b6c -5c0c73540b745004645c0c73540b6c5c0c735004645c0c73540b6c540b745c0c735c1574540b6c -540b74540b6c540b74540b6c5c0c735c0c73500464540b6c540b74540b6c5004645c0c735c0c73 -500464540b74540b74540b6c540b6c4c086c540b6c5c0c73540b74500464500464500464540b74 -500464540b6c500464500464540b74540b74540b6c540b6c540b6c540b6c540b74540b74541574 -541574540b745c1574540b74541574540b6c5c15745c1574040404 -0404046414745c147c6414746414745c0c7c640c795c0c735c0c73540b6c540b6c5c0c735c0c73 -5c0c735c0c73540b6c5c0c735c04745c1c7cb89898d7aaa794788fa48899b7898f773372540b74 -5c0c735c0c735c0c735c0c735c15745c1574540b6c5c0c73540b6c5c0c73540b74540b6c5c046c -5004645c0c735004645c0c73540b6c5c15745c1574540b74540b6c540b6c540b6c5c15745c1574 -5c1574540b74540b6c540b6c5c1574540b74540b74500464540b6c5c15745c0c73540b6c540b6c -540b6c540b6c540b6c540b6c540b6c540b6c540b74540b6c540b6c540b74540b6c540b74540b6c -540b6c4c086c540b6c540b74500464540b6c540b6c540b6c4c086c540b6c540b6c540b6c540b6c -54157454157454157455146c541574541574540b74541574040404 -0404046414745c0c7c5c0c7c6414745c0c735c0c735c0c736414745c0c735c0c735c0c735c0c73 -540b745c0c735c0c73540b745c0c735c0c73540b6c6c1c7c6b37796a29765c04745004645c0c73 -5c0c735c0c735c0c735c15745c15745c0c735004645c0c735c1574540b6c5c0c73540b6c5c0c73 -540b745c0c735c0c73540b745c1e6c5c1574540b74540b6c5c1574540b745c0c735c1574540b6c -5c15745c15745c15745c0c73540b74540b6c540b6c540b6c500464540b74540b6c540b745c1574 -540b74540b6c540b6c540b74540b6c540b6c540b74541574540b6c540b6c540b6c540b6c540b6c -540b74540b6c4c086c540b6c540b6c540b744c086c541574540b74540b6c4c086c5c157455146c -54157455146c5c15745c15745c1c7c54157455146c5c1574040404 -0404045c0c7c5c0c7c6414745c0c7c641474641a7c6414745c0c735c0c735c15745c0c73540b6c -5c0c735c0c735c0c73540b6c540b6c5c0c735c0c73540b6c5c046c5c0c73540b6c5c04745c046c -5c0c73540b6c540b745c15745c0c73540b6c5c0c735c0c735c0c735c0c73540b745c0c73540b6c -540b6c540b6c5c1574540b6c5415745c15745c0c735004645c0c735c0c735c15745c15745c0c73 -540b6c540b6c540b74540b6c540b6c5c0c73540b74540b6c540b6c540b6c5c15745c15745c1574 -540b6c540b6c540b6c540b74540b6c540b745c1574540b74540b6c540b744c086c540b6c540b6c -540b6c540b6c540b6c540b6c540b6c54157454157455146c540b6c540b74540b6c540b7455146c -55146c5415745415745c24795c1574541574541574541574040404 -0404045c0c735c0c735c147c640c795c147c5c0c736414746414746414745c0c735c0c735c0c73 -5c0c735c0c73540b745c0c735c0c735c0c735c0c735c0c735c0c735c0c73540b6c540b6c540b6c -5c0c735c0c736414745c0c73540b745c0c735c0c73540b6c5c0c73541574540b6c540b6c5c046c -540b6c540b6c5c0c735c0c735c0c735c15745415745c15745c1574540b74540b6c5c0c73540b74 -540b6c540b6c540b6c540b6c5c0c73540b74540b6c540b6c5c0c73540b6c541574540b6c5c1574 -5c1574540b6c540b745c1574540b74540b6c540b6c540b6c540b74540b6c540b74540b74540b74 -540b6c540b74540b6c540b6c540b74540b6c540b6c541574540b6c540b6c540b74541574540b74 -540b7455146c5c2479541c6c5415745415745c15745c1574040404 -0404045c0c735c15745c0c735c0c735c0c735c0c736414745c147c5c147c5c0c735c0c735c147c -5c0c735c0c735c0c735c0c73540b6c6414745c0c73540b6c540b6c5c0c73640c79640c79641474 -5c0c735c0c735c15745c157455146c5c15745c15745c0c735c15745c0c73540b74540b6c540b6c -5c046c540b74540b6c540b6c540b6c540b6c5415745c15745c15745c15745c1c7c5c1574540b6c -540b74540b6c540b6c540b7455146c540b74540b6c540b6c5c15745c0c735c1574540b6c540b6c -541574540b6c540b6c5c0c73540b6c540b6c4c086c540b6c5c1574540b6c5415745c1574540b6c -540b6c540b6c540b744c086c540b6c540b6c4c146c541574540b74540b6c55146c541574540b6c -5415745415745415745c15745c1574541574541574541c6c040404 -0404046414746414746414745c0c7c5c0c735c0c735c0c7c5c0c735c0c735c0c73540b745c0c73 -5c0c73540b6c640c79540b6c5c0c735c0c735c0c735c0c735c0c735c0c73540b6c540b745c0c73 -5c1574540b6c540b74540b6c5415745c15745c0c73540b6c540b74540b6c540b6c5004645c0c73 -540b6c5c0c735c0c73540b74540b6c5c1574540b6c5c15745c15745c15745c157455146c5c1574 -540b6c540b6c5c15745c0c735c0c73540b6c540b6c540b6c5415745c15745c1c7c5c15745c1e6c -5c1574541574500464540b6c4c086c540b6c540b6c540b6c540b6c540b6c500464540b745c1574 -540b6c540b745c1574540b74540b6c540b7455146c55146c540b6c540b74541574541574540b6c -540b6c5c24795c24795c24795c2479541c6c5415745c1c7c040404 -0404046414745c147c6414745c147c5c0c735c0c735c0c735c0474540b745c0c735c0c735c0c73 -5c0c735c0c73660b65540b6c5c0c735c0c73540b6c5c0c73540b6c540b6c5c0c735c0c73540b6c -540b745c0c735c0c73540b6c540b745c15745c15745c1574540b6c540b6c540b6c5c0c73500464 -5c0c73540b6c5c0c73500464540b6c5c15745c1574540b6c540b6c5c1574540b6c5c15745c1574 -540b6c5c0c73540b745c1574540b6c5c0c73540b6c5c0c73540b745c0c735c15745c15745c1574 -5c15745c15745c0c73540b6c540b6c540b6c540b74540b74540b6c540b74540b6c540b6c540b6c -540b74540b6c540b6c540b6c540b6c540b6c541574541574540b6c540b6c540b745415744c086c -55146c5c15745415745c15745c24795c1574541574541c6c040404 -0404045c0c736414745c0c7c5c0c7c5c0c735c0c7c5c0c73540b745c0c735c04745c04745c0c73 -5c046c5c0c735c0c735c0c735c04745c0c735c046c540b6c5c04745c0474540b745c046c540b74 -540b6c540b6c5c0c735c0c7350046454047c5c0c73540b745c046c540b6c5c046c540b6c5c0c73 -540b745c15745c0c73540b745004645c0c73540b6c5004645c0c735c0c735c15745c15745c1574 -540b6c5c0c73500464540b745c0c73540b6c540b745c0c735c15745c157455146c5c0c73541574 -5c1574540b6c5415745c0c73540b6c540b6c540b74540b6c540b74500464540b74540b74540b6c -540b6c540b6c540b74540b6c540b6c4c086c55146c55146c540b7455146c540b6c55146c540b6c -55146c54157455146c54157454157454157455146c541574040404 -0404045c0c735c147c5c0c7c6414745c0c735c147c5c0c735c0c735c0c735c0c735c0c735c0c73 -5c0c73540b6c5c0c735c04745c0c735c0c73540b6c5c0c73540b74641c746b37796b3779792666 -540b6c5c0c735c0c735c0c736b3779773c7c6414745c0c73540b745c0c73540b6c540b6c540b74 -540b745c1574500464540b74540b6c5004646a29767c4b8269256b5c0c735c157455146c540b6c -500464540b746b3779773372540b745c0c73540b6c5c15745c1574540b6c5415745c15745c1574 -540b6c540b6c540b6c54157455146c55146c540b74540b745415746b377955146c540b6c540b74 -540b6c540b6c540b6c540b74540b6c540b6c54157455146c4c1575540b6c4c086c4c086c540b74 -55146c54157455146c540b6c55146c540b7455146c540b6c040404 -0404046414746414746414745c0c735c0c735c0c7c6414745c0c735c0c735c0c735c0474640c79 -5c0c73640c795c046c5c0c735c0c735c0c735c0c73540b6c540b747c4b82e7c7a5874d7ab8a8a7 -a37483500464540b74540b7494788fd69986500464540b74540b6c540b74500464540b74540b74 -540b74540b74885b876817694c0b74885b87b7898f7c4b82b7898f681769540b74540b745c0c73 -5c04744c086cb89898a374835004644c086c540b745c0474540b74500464500464540b74540b6c -540b6c540b74540b6c540b7494788f8f416b4c086c4c086c6a2976d8b7a88a2f62540b74541574 -540b6c540b74540b6c540b6c540b74540b6c541574541574540b6c55146c54157455146c5c1574 -5415745415745c1574541574540b7455146c540b74541574040404 -0404045c147c6414745c147c5c0c736414745c15745c0c735c147c5c15745c0c735c0c735c0c73 -640c795c0c735c0c735c0c735c0c735c0c735c0c735c0c7c5004646b3779e9b89964105c94788f -d88e7d640c797c4b82874d7a7c4b82d69986885b87874d7a540b6c773c7c885b876a2976773c7c -874d7a874d7ad8b7a88f416b4c0b74b89898ab5f70540b6c69256b55146c773c7c874d7a681769 -5c24797c4b82c89997ab5f705c1e6c7c4b827733726817696a2976885b876b3779773c7c69256b -5c24796817696b3779773c7c773c7c69256b5c1574885b87773c7cc9a7997733726b37796a2976 -540b6c55146c540b7455146c540b6c540b74541574541574540b74540b7455146c540b74541574 -5c1574541574541574541574541574541574541574541574040404 -0404045c15745c147c6414746414745c147c5c0c735c0c735c0c735c0c735c0c735c0c735c0c73 -5c0c73540b6c540b6c5c0c735c0c735c15745c15745c0c735c04746b3779d8b7a8b89898b7898f -6a2976b7898f773372a48899d7a899d7a899885b87c8a9a7c89887ae7b74a37483d7a899c5b699 -c89887a37483d8b7a8ab5f70540b747c4b82c8b7a8c8a9a7a37483a37483a37483a48899c89887 -b98680773c7cc8a9a7b98680b7898f874d7ad7c8a8b7898fb99886885b87d9b899d9b8998f416b -a48899ab5f70885b87b98680b5a898a37483a37483885b87a37483c89997a37483a374836b3779 -55146c541574540b6c540b6c540b6c540b6c540b6c55146c540b7455146c540b6c55146c540b6c -5415745c1574540b6c5c157455146c541574541574541574040404 -0404045c0c735c0c735c147c6414745c0c7c640c795c0c735c0c735c0c735c0c73640c795c0474 -5c04745c0c735c0c735c0c735c0c736414745c15746414745c04746b3779e6aa9da37483d7a899 -773372e6b8ab64105c885b87f7c7a8d88e7d44045894788ff9ebb6b7898f7c4b82874d7ac89997 -8f416b4c086cc9a799792666540b7468176955146c6b3779d8b7a8fad9a5a374837c4b82b8a8a7 -d6998644045894788fb7898fc89997885b87a37483a37483d7a8997c4b82936f72a48899c78c82 -b7898fd7a899a3748369256ba69798d7a899a37483500464541574c9a799e7c7a5874d7a4c086c -540b7455146c541574540b6c540b74540b6c540b74541574540b6c541574540b6c4c086c55146c -540b6c541574540b6c540b6c55146c54157455146c55146c040404 -0404045c0c735c0c735c0c735c0c7c5c0c735c0c73640c795c0c735c15745c0c735c0c735c0c73 -5c0c7c5c0c735c0c735c0c735c0c735c0c735c0c73540b6c5c04747c4b82e7c7a579266694788f -c9a799d9b899ab5f7094788fb98680d9b899874d7aa37483a37483c89997874d7a773c7cc19ba5 -ab5f705c0c73c8a9a7a37483540b74a37483a374837c4b82a88786b7898fc89887773c7c874d7a -d7aaa7936f72c19ba5b98680a69798c8a886885b87885b87d9b899874d7a7733726b3779e7c7a5 -792666ac99a7ca8377540b6cb8a8a7c89887c9a799874d7a773c7cc5b699ae7b74c9a799ab5f70 -540b74540b6c541574541574541574540b6c540b6c540b744c146c540b6c54157455146c4c086c -55146c5415744c086c55146c540b74541574541574541574040404 -0404045c0c735c0c735c0c73641474640c79640c795c0c7c5c0c736414745c0c735c0c735c0c7c -5c0474540b6c540b745c0c73540b6c5c0c735c0c735c0c735c0c736c1c7c773c7c6a29765c0c73 -773c7c6a29767c4b82773372641474773c7c874d7a640c79540b74773c7c7c4b826a2976773c7c -6b3779500464773c7c7c4b825c157464257c7c4b827c4b82641474540b747c4b827c4b82641c74 -6b3779885b87773c7c885b87c89887885b87b89898c78c826b3779885b876b3779541574773372 -540b6c6b37796a29765c15747c4b82773c7c773c7c885b87773c7c7c4b826a29766b37797c4b82 -540b6c540b6c540b6c540b6c540b6c540b6c540b744c086c540b6c4c086c540b6c540b6c540b6c -5415745c1574541574540b6c541574541574540b744c146c040404 -0404045c0c7c5c0c735c0c736414745c0c7c640c796414745c0c73540b745c0c735c04745c0474 -5c0c735c04745c046c5c04745c0c735c04745c0c735c04745004645c0c735004645c04745c0474 -500464540b74540b745c04745c0c73540b744c086c5004645c0c735004645004645c0c73540b74 -5004645c0c7c500464540b745c15745c0474500464540b745c0c735c0c73540b74540b6c540b74 -540b7450046455146c6b3779c8999768176994788f874d7a500464540b74500464540b6c4c086c -5c157455146c540b6c540b6c4c086c540b6c540b6c4c086c540b6c4c0b744c0b745415744c086c -4c0b74540b6c4c086c540b6c4c086c540b6c540b6c4c086c540b6c540b6c540b744c086c55146c -541574541574540b6c540b6c54157454157455146c541574040404 -0404045c147c5c0c735c0c7c5c04745c0c735c0c735c0c7c5c0c735c0c735c0c735c0c7c5c0474 -5c04745c0c735c0c735c046c5c04745c0c735c0474540b745c0c735c0c735c04745c04745c0474 -5c04745c046c5c04745c046c540b74540b6c540b6c5c1574540b745c0c735c147c5c0c735c046c -540b745004645c0c735415745c0c73500464500464540b6c540b6c540b6c540b74541574540b6c -540b6c5415745c157455146c6b37797c4b826b37795c04745c0c73540b6c540b74540b6c5c1574 -540b6c540b6c540b6c540b74540b6c540b7455146c55146c500464540b6c540b6c55146c540b6c -500464540b74540b6c540b6c540b6c540b6c4c086c540b6c4c086c540b6c4c086c5c1574541574 -540b6c541574540b6c4c146c55146c540b6c5415744c146c040404 -0404045c0c735c147c640c795c0c735c0c73640c795c0c735c0c735c0c735c0c735c04745c0c7c -5c0c735c0c735c0c735c0c735c0c735c04745c0c735c046c5c0c735c04745c0c735c0c735c0474 -5c0474540b74540b745c04745c0c735c0474540b745c0c735c1574540b6c5c15745c15745c0c73 -5004645c0c73540b745c15745c0c73540b74540b74540b6c540b6c540b6c5c0c73540b6c5c1574 -540b6c5004645c1574540b74540b74500464540b745415745c15745c1574540b6c5c1574541574 -540b6c540b6c540b6c540b74540b6c540b74540b6c5c0c73540b6c4c086c55146c540b74500464 -540b6c4c086c540b6c5004644c086c540b6c500464540b6c540b74540b6c540b6c540b6c540b74 -540b6c541574540b6c540b745415744c086c55146c541574040404 -0404045c0c735c147c6414745c0c7c5c0c735c0c73640c795c0c7c5c0c7c5c0c7c5c04745c0c73 -5c0c735c0c735c0c73540b745c0c735c0c735c04745c0c735c04745c0c735c0c735c04745c0474 -5c0474540b745c0474540b745c04745c04745c0c735c0c73540b745c0c73540b6c5c0c73540b6c -5c0c735c0c735c0c735c0c73540b6c540b6c5c04745c15745c1574540b6c540b6c5c0c735c0c73 -5c15745c1574540b6c540b6c540b6c5c0c73540b6c540b6c5c15745c15745c15745c1574540b6c -540b6c540b74540b6c540b6c540b6c540b6c540b6c540b6c540b6c540b7454157455146c540b74 -500464540b6c540b6c4c086c540b6c540b6c540b74540b74541574540b6c540b74540b6c540b6c -540b6c540b6c4c086c541574541574541574541574541574040404 -0404045c0c735c0c735c147c5c0c7c5c0c735c0c735c0c735c0c735c15745c0c735c0c735c0c73 -5c0c735c0c73540b745c0c73540b745c04745c0c735c0c735c04745c0c735c0c735c0474540b74 -5c04745c04745c04745c04745c0474540b74540b745c0c735c1574540b6c540b74540b6c5c046c -5004645c04745c0c73540b74500464540b74540b6c5c0c7355146c540b745c0c73540b6c540b74 -5c15745c24795c0c73540b6c540b6c540b6c540b6c540b74540b6c5c15745c15745c1574540b74 -5c15745c1574540b6c540b74540b6c540b6c4c0b74540b74540b6c540b74641c74541574540b6c -540b74540b6c4c086c540b6c4c086c540b6c540b6c540b74540b6c540b6c540b6c540b6c540b6c -540b6c4c086c55146c540b6c541574540b6c55146c55146c040404 -0404045c0c735c0c7c5c0c735c0c735c0c735c0c73540b745c0c735c0c735c0c735c0c735c0c73 -5c0c735c0c735c0c735c04745c0474540b745c04745c0c735c0c735c0c735c0c735c04745c0474 -5c0474540b745c046c540b74540b745c04745c0474540b745c1574540b745c0c735c0c73540b74 -540b74540b74540b745c0474540b745004645c0c735c1574540b74540b6c540b74540b6c540b6c -5c0c735c15745415745c0c73540b6c540b6c540b6c5c0c735c0c735c15745c1574541574540b74 -540b6c540b6c540b74540b6c540b74540b6c540b6c540b6c540b6c540b6c541574540b6c540b6c -540b6c540b6c540b6c4c086c500464540b6c540b74540b6c540b74540b6c4c086c540b6c540b6c -540b74540b74540b7454157455146c541574540b6c541574040404 -0404045c147c6414745c0c7c5c0c735c0c735c0c736414745c0c735c0c735c0c735c0c73540b74 -5c0c73640c795c0c735c0c735c0c735c046c5c0c735c046c5c04745c0c735c04745c0c735c0c73 -5c04745c046c5c04745c04745c04745c0474540b745c0c735c0c735c0c73540b745c0c73540b74 -5c0474500464540b745c046c540b745c0c73540b745c15745c0c73540b6c540b6c5c0c73540b6c -540b6c5c1574540b74540b74540b74540b6c5c0c73540b6c540b6c5c147c5c1574540b6c540b6c -540b6c540b74540b6c540b6c540b6c540b74500464540b6c540b6c540b74540b6c55146c540b6c -540b6c540b74540b6c540b74540b74540b6c540b6c540b6c540b6c540b6c540b6c540b6c540b74 -54157455146c4c086c541574540b6c541574540b6c541574040404 -0404045c1574641a7c641a7c5c0c735c0c735c0c735c0c7c5c0c735c15745c0c73540b745c0c73 -5c0c735c0c735c0c735c0c735c0c735c0c735c046c540b745c04745c0c735c0c735c0474540b6c -5c0c735c0c735c0c735c0474540b745c0474540b74540b6c540b6c5c04745c0474500464540b74 -5c0c735c0c735c0474540b745c0474540b6c540b6c540b74540b6c540b6c540b6c540b6c540b74 -5c0c73541574540b6c5c0c73540b6c540b6c5415745c1574540b6c540b6c5c1574541574540b6c -540b6c540b74540b74540b6c540b6c5c1574540b74540b74540b6c540b6c4c086c5c15744c146c -5c1574541574540b6c540b74540b6c540b6c4c086c540b6c4c086c540b6c4c086c540b6c540b6c -540b6c540b6c55146c540b6c540b7455146c541574541574040404 -040404641a7c641a7c641a7c64257c6414745c147c5c15745c0c735c0c735c0c735c0c735c0c73 -5c0c735c04745c0c735c0c735c0c735c0c735c04745c04745c0c735c04745c047c5c0c735c0c73 -5c0c735415745c1574540b74540b74540b74540b6c5c0c735c046c540b6c540b6c5c0c735c0c73 -5c15745c147c540b745c0474540b6c540b745c04745c046c5c0c73540b6c540b745004645c0c73 -540b6c540b6c5c0c73540b6c5c0c73540b74540b6c540b6c540b74540b6c5c0c73540b6c540b74 -540b6c540b6c5c1574540b6c540b6c540b6c540b6c540b6c540b74540b6c500464541574540b74 -55146c540b74540b6c540b6c540b6c540b6c540b6c4c086c540b6c54157455146c55146c4c086c -540b6c4c1575540b6c541574541574541574541574541574040404 -0404045c15745c147c641474641474640c795c0c735c15745c0c735c15745c0c735c0c735c0c73 -5c0c735c0c735c04745c0c735c0c7c5c0c735c0c735c0c735c04745c04745c0c735c0c735c0c73 -5c0c735c046c5c0c735c046c5c04745c0c735c0c73540b6c5c0c735c0c735c0c735c15745c1574 -5c0c735c0c735c04745004645c0474540b74540b6c540b745c0c73540b6c540b6c5c0c73540b6c -5c0c73540b745c0c735c1574540b6c5c15745c0c73540b6c5c15745c1574541574540b6c5c1574 -541574540b6c540b74540b74540b74540b6c540b6c5c15745c1574540b74540b6c540b7455146c -540b6c540b6c540b6c540b74540b6c540b6c4c086c540b6c5c15744c086c5415744c146c55146c -540b6c540b6c4c086c540b7454157454157455146c5c1574040404 -0404046414746414745c147c5c147c5c147c5c147c6414745c15745c0c735c0c735c0c735c0c73 -5c0c735c046c5c0c735c0c73540b745c0c735c04745c04745c0c735c0474540b745c04745c0c73 -5c0c735c0c735c0c73540b745c0c735c15745c0c735c0c73540b74540b6c540b745c0c73541574 -540b6c5c0c73540b745c0c73540b745c04745c0c735c0c73540b74540b74500464540b6c5c0c73 -5c0c73540b6c540b74540b6c5c0c735c1574540b74540b745c0c73540b6c5c1574540b74540b6c -540b6c540b7455146c540b6c541574540b74540b745c15745c1574540b6c540b74540b74540b6c -541574541574540b74540b6c540b74540b6c540b6c540b6c540b7455146c4c086c5415745c1574 -4c15754c0b745415744c086c4c146c55146c540b7455146c040404 -040404641a7c5c0c7c5c147c5c15746414745c15745c147c5c0c735c0c735c0c735c15745c0c73 -540b6c540b6c540b6c5c0c735c0474540b745c04745c0474540b745c0c735c0474540b745c0c7c -5c047c5c0c73540b745c0c735c0c735c0c735c15745c157455146c5c0c735c1574540b6c5c0c73 -5c1574540b745c0474540b745c0c73540b6c5c0c73540b6c5c0c73540b6c5c0c735c15745c1574 -540b6c540b6c540b6c540b745c0c73540b74540b74540b6c540b74540b6c5c15745c1574540b74 -540b6c5c1574541574540b6c540b6c540b6c5c157455146c540b74540b6c5c15745c0c73540b74 -540b6c540b6c540b745c1574540b74540b6c540b6c540b74540b6c540b6c5415745c157455146c -4c086c540b6c540b74540b6c540b6c540b7455146c541574040404 -0404046414746414745c1574641a7c641474641a7c5c147c540b6c5c0c735c15745c0c735c0c73 -6414745c0c735c04745c0c73540b6c5c04745c0474540b745c04745c046c5c0c735c04745c0474 -5c0c735c0c735c0c73540b745c0c735c147c5c0c735c0c73540b745c0c735c0c735c0c735c0c73 -5c0c735c0c73540b745c046c540b74540b74540b6c5c0c735c0c73540b6c5c1c7c5c147c5c1574 -5415745c0c735c0c73540b6c540b6c540b6c540b74540b74540b6c5c0c735c0c735c0c73541574 -5c15745c15745c15745c1574540b745c15745c1574540b6c540b6c540b74541574540b6c540b74 -55146c540b74540b6c5c1574540b74540b6c4c086c540b6c540b6c540b6c55146c541574541574 -5c157454157455146c5415745415745415745415744c1575040404 -0404046414745c0c7c641a7c64257c6727846414745c0c735c0c735c147c5c0c735c0c735c0c73 -5c147c5c0c735c0c73540b745c0474540b745c0c73640c795c04745c04745c0c735c0c7c5c0474 -5c0c735c0c735c0c735c0c735c0c735c0c735c0c73540b745c0c735c0c73540b6c5c0c73540b74 -5c0c7c540b745c046c540b74540b6c540b6c5c0c735c15745c0c735415745c15745c15745c1c7c -5c15745c0c735c0c73540b74540b74540b74540b6c540b6c5c0c73540b74540b6c540b6c540b6c -5c1574541574540b7455146c5c15745c15745c1574540b74540b6c540b6c540b6c540b745c1574 -540b74540b6c540b745c1574540b74540b6c540b6c55146c540b74540b74540b6c54157455146c -5415745c157454157455146c54157454157454157455146c040404 -040404641a7c641a7c64257c64257c641a7c641a7c5c0c7c5c0c735c0c735c0c7c5c0c735c0c7c -5c15745c0c735c04745c0c735c046c640c79540b6c5c0c735c0c735c046c640c795c0c735c046c -540b745c0c735c0c735c0c73540b6c5c0c73540b745c0c735c0c735c0c735c0c735c0c735c0c73 -5c0c73500464540b745c0c735c15745c0c73540b6c540b745c0c7355146c5c15745c15745c1574 -5c1574540b745c15745c15745c0c735c0c73540b6c540b745c1574540b6c5c0c735c0c73541574 -5c15745c15745c1574540b74540b6c5c0c735415745c1574540b6c540b74540b6c540b6c540b6c -5c15745c1574540b6c540b74540b6c540b6c540b6c540b74540b74540b74540b6c540b6c5c1574 -5c157454157454157454157454157455146c541574541574040404 -04040464257c5c1c7c64257c641c74641a7c5c15745c15745c15745c0c735c0c735c0c735c0c73 -5c0c735c0c735c0c735c0c735c0c735c0c735c0c735c0c735c0c735c0c735c0c735c15745c0c73 -5c0c735c15745c1574540b6c540b6c5c0c735c0c73640c795c0c73540b6c5c0c735c0c735c1574 -5c15745c0c7c5c0c735c04745c15745c0c73540b745c15745c15745c0c73641c745c15745c1574 -55146c5c15745c15745c1574540b745c0c73540b746414745c1574540b6c5c15745c157455146c -5415745c15745c15745c1574540b6c5415745c15745c15745c1574540b6c540b6c5c1574540b74 -540b6c5c1574540b74540b6c540b6c540b74540b6c5c15745c1574540b74540b6c540b74541574 -54157455146c540b7455146c541574541574541574541574040404 -040404641a7c641a7c641a7c5c147c5c15745c147c6414745c0c7c54147c540c7c540c7c540c7c -5c0c7c540c7c540b74540b74540c7c540c7c540c7c540c7c54047c54047c540c7c540b74540b74 -54147c5c0c7c540c7c540c7c540c7c540c7c540b74540b74540c7c540c7c540b744c0b745c147c -540c7c540c7c540b74540b74540b74540b74540c7c54157454157454147c54147c5415745c1574 -5c1574541574540b744c0b7454147c540c7c540c7c54147c540b7454157454147c541c7c54147c -5c1c7c5415745415744c0b744c0b7454147c54147c540b744c0b74540b74540b74540b74540b74 -4c0b744c0b74540b74540b744c0b744c086c4c15754c0b744c0b744c15754c0b74540b744c1575 -541574540b6c55146c541574540b6c54157455146c541574040404 -040404641a7c641a7c6414746414746414745c147c5c147c681769b0254eb0254eb0254eb0254e -b0254eb0254eb0254eb0254eb0254eb0254eb0254eb0254eb0254eb0254eb0254eb0254ea52357 -a52357b0254eb0254ea52357a52357a52357a52357a52357a52357a52357a52357a52357a52357 -a52357a52357a5235799275ea52357a52357a5235799275ea5235799275e99275e99275e99275e -99275e99275e99275e99275e99275e99275e8d1d5c99275e99275e8d1d5c99275e99275e99275e -99275e8d1d5c8d1d5c8d1d5c8d1d5c8721648d1d5c8721648d1d5c872164872164872164872164 -87216481205c872164872164781a66872164872164872164781a66781a66781a66781a66781a66 -5c1574541574540b74540b6c541574541574541574541574040404 -040404641a7c5c147c5c147c6414745c147c6414745c147c8d1d5ccd342a852415852415472415 -852415472415852415472415852415852415472415852415852415852415852415852415852415 -852415852415852415852415852415852415852415852415852415852415852415852415852415 -852415852415852415852415852415852415852415852415852415852415852415852415852415 -852415a82916852415a82916852415a82916852415a82916852415a82916b63024b63024852415 -a82916852415a82916a82916a82916a82916b63024a82916a82916a82916a82916b63024b63024 -a82916b63024a82916a82916b63024b63024b63024b63024b63024b63024b63024cd342adb3738 -81205c54147c541574541574541574540b6c5c157455146c040404 -040404641a7c641c745c147c5c147c641474641a7c54147c8d1d5ccd342a141c104d3d2c5d4c36 -5d4c366c545646423b5d4c36472f223d363051524b45535b30444339291f3d363030444345535b -30444339291f3d363045535b51524b51524b472f2251524b45535b51524b40474b4d3d2c4d3d2c -51524b51524b595c59675f464d3d2c5d4c3645535b40474b51524b4d3d2c51524b51524b51524b -675f4651524b51524b45535b595c5951524b46423b40474b40474b40474b51524b51524b40474b -40474b3d363039291f46423b30444340474b3d363039291f304443302f2a30444319271c302f2a -304443302f2a3d3630302f2a302f2a3044433d3630302f2a39291f39291f19271c141c10b63024 -8d1d5c4c0b7455146c540b74540b6c55146c540b6c55146c040404 -040404641a7c64257c64257c6414746414746414745c147c8d1d5ccd342a39291f4d3d2c8c6540 -a37483b99886d9b899666178815a556f596f9588a7d9d5b85f6b976c5456666178a8b1c9dad4a8 -7472977a687994788fc6c2cae8bb88a48899b98680c7abb5d8c7b8e8bb88d8b9b7e6aa87f7be9a -d8b9b7efad93f7c8c8f7c7a8f6c5b7d7aaa7d7aaa7f5eae7f9ebb6f8ecd8d8b9b7c8a9a7fcf8e7 -f7d8b8f8ecd8d8b7a8e6aa9df7c8c8f6c5b7f6c5b7c7b8b7e6b8abe6b8abe6aa87e6b8abe8dab9 -d8b9b7c19ba5c78c82c19ba5d8c7b8c8b7a894788f92655f82839bccd6c69897a86c5456815a55 -747297c6c2ca878aa77a687992655f7a6879c8a886a48899a37483675f465d4c364d3d2ca82916 -8d1d5c4c0b74540b74541574541574540b744c146c541574040404 -040404641a7c64257c641a7c641a7c5c147c5c147c5c147c8d1d5cb63024472f225d4c3619271c -565b68a37357c78b4f5c495a40474b4b4b6492655fa373575c495a45535b4b4b647c6267ae845d -6f596f565b687a6879be8b70d2966d7b7779595c59a48899d69986df9b5ac898877a6879c19ba5 -e6aa87e6aa87e6aa9d7b7779e6b8abe7c7a5f7be9ad8c7b8878283e8d8d8e9d8c8e9d8c8c6c2ca -878283e7c8c8e6b8abf7c7a8c8a9a7878283f6c5b7d9b899e6b8abc89997878283d7aaa7efad93 -d9a887a48899696f7aa48899d9a887be8b707a68795a6889776a86c898877c6267535f83565b77 -605170c8a886936f72565b774b4b646c5456d2966dae7b74666178302f2a8c654046423bb63024 -8d1d5c540b745c15745c0c73540b6c541574540b745c1c7c040404 -040404641474641a7c641a7c6414746414745c147c5c147ca52357a8291639291f92655f45535b -3d363092655fc78b4f92655f565b6840474b815a55ae845d40474b45535b4b5967675f46be8b70 -6051704b5967605170be8b70c8988778798859667894788fc78d61df9b5ab8989870706aa69798 -d88e7de8bb88d7aaa770706ad8b9b7e6aa9de7c7a5c8a9a77b7779e8d8d8d7a899e9d8c8d7c8c8 -7b7779e6b8abe6aa87e7c8c8b8a8a7878283e6b8abe6aa87e9c8b8a48899696f7ac89997f0ac7d -d699867b7779596678a37483d69986ae7b74596678565b776f596fae98706c5456565b774b5976 -5c495aa373577c62674b4b64666178936f72c78d6192655f40474b616568a887865d4c36a82916 -8d1d5c4c1575540b74541574540b745415745415745c1574040404 -0404045c147c6414746414745c0c7c5c147c5c15745c0c7c8d1d5ca829163d3630878283936f72 -5d4c36827668d9a8878f8b977c62675c495a878283c8a88666617840474b565b77a59887c5b699 -776a86815a55878283b8a8a7c8b7a8a37483be8b70ac99a7ca8377df9b5ad69b98d69986d6acb4 -d7a899d7aaa7e6b8abe9c8b8f7c8c8d88e7dc89997f6c5b7f8ecd8f5eae7b98680c8a9a7f7c8c8 -f8ecd8f7c8c8c78c82d7aaa7f6c5b7f7c8c8f7c8c8d69b98d3bac4d7aaa7d8b9b7d8b9b7efad93 -c7abb5b7898fb7898f999cb5d8c7b8999cb57a68797c6267747297d7c8a882839b565b685c495a -676a88c8b688867389605170936f729588a7d9b888766a4d815a55936f72a6979851524bb63024 -8d1d5c4c0b7454157455146c54157454157455146c5c1574040404 -0404045c15746414745c147c5c0c735c0c736414745c147c8d1d5ca82916472f22d9a887c78b4f -c78d61c8a671ae9870d9a887ab7b45c78d61b6a788a88786c8a6718c6540c8a671c5b699a69798 -e8bb88c78d61e9b899b9b7b4b5a898e8bb88d2966de9b899d8b7a8d7a899e6aa87f0ac7dd9a887 -d7a899d69b98e09e75efad93c89887c89997c89997c89887e7c8c8ae7b74c89887c78c82a59887 -e7c8c8c78c82c78c82d69986c89887e9b899d7a899d7aaa7d7a899e6aa87f7be9ae6b8abd8b7a8 -d8b7a8e6aa87e6aa87e9c8b8c7b8b7cac4b7e9b899d2966de7c7a5a8a6a9cac4a7ae9870a37357 -d9b899988884c8b7a8be8b70a37357d9b899b89898d9b888d2966dd2966dc9a79940474bb63024 -8d1d5c4c15755c1574540b745415745c1574541574541574040404 -040404640c796414745c147c6414745c15745c0c7c5c0c7c8d1d5ca82916302f2a6c5456815a55 -92655fb99886b6a7886c54565d4c367a6879a48899b6a7887c6267815a557c6267a59887c8b688 -747297936f72936f72b8aab7c8a9a79588a7ca8377b98680c7b8b7d9a887b8aab7e6b8abd7a899 -c8a9a7d69986d7c8c8f7c7a8e9b899c8a9a7d69b98ebdae5f5eae7f6c5b7c89997c78c82e8d8d8 -f5ebf5f6c5b7c89997d69b98e7c8c8f7c7a8d7aaa7d7aaa7d7aaa7e7c8c8e6b8abc8a9a7d8b9b7 -ac99a7c8a9a7d88e7da48899cac4b7b8aab7a48899ae7b74988884d7c8a8a697987a687992655f -936f72c5b699a69798815a556c5456776a86c9a799b5a898a37357936f7287828346423bb63024 -8d1d5c4c15755415745c157455146c54157455146c541574040404 -0404045c147c6414745c0c7c6414746414745c147c5c0c7c8d1d5cb630244724155c495a40474b -6661788c6540a3735740474b4b4b64565b77675f46a373575c495a45535b4b5976a88786e09e75 -6f596f4b5967666178c9a799e09e7586738961656882839be6b8abf7bb86a488997a6879b8aab7 -e7c8c8f7bb86c8b7a8988884e7c8c8e7c8c8e7c8c8d8b9b7878283e7c8c8c6c2cad8b9b7e7c8c8 -878283e6c9d9e8d8d8e9c8b8c7abb57b7779d3bac4e7c7a5f7be9aac99a7787988c7abb5f8d094 -d7a899776a865a688994788fe9b899c78c82666178666178867389e8bb8892655f565b774b4b64 -5c495abe8b707a68795966784b59675c495ac78d6194788f7a68794b4b64815a554d3d2cb63024 -8721644c0b7454157455146c540b745c15745415745c1574040404 -04040467278464257c641a7c672784641a7c6414745c0c7c8d1d5ca8291639291f6c545640474b -304443815a55a3735751524b45535b45535b5d4c36ab7b457a6879595c594b4b64a37357d2966d -6f596f4b5967565b77d2966dd9a8877a68794b5967787988e6aa87f7c7a8988884565b688f8b97 -f7be9afad9a5b89898616568d3bac4e9c8b8f5eae7c7abb570706ae7c8c8e7c8c8e8d8d8c7b8b7 -616568c7b8b7f6d8c8f8ecd8a8a6a9696f7ad6acb4f7be9af6d8c882839b565b68b8a8a7f7c7a8 -e6aa9d696f7a4b5967a37483f0ac7dd88e7d6661784b5976936f72e09e7592655f4b5967696f7a -936f72ab7b45675f464b59675966786f596fa37357815a5545535b565b68936f7246423bb63024 -8d1d5c541574541574540b6c54157455146c541574541574040404 -04040464257c6a2976672784641a7c641a7c5c1c7c541c7c8d1d5ccd342a39291f696f7a6c5456 -5c495a936f72c8a67178798851524b4b4b64827668d9b56ab8989892655f5c495aae9870c8b688 -696f7a936f72867389b6a788c9a799878283b998869588a7b5a898e9c8b8ac99a7d8b7a8b9b6c0 -c9a799e9c8b8c7b8b7e8d8d8d8d7dad69986d8b9b7f7c8c8ebdae5ebdae5d69b98c8a9a7f7c8c8 -e8d8d8ebdae5e59b87d8b9b7e7c8c8e8d8d8d6c8d5f7be9ac7b8b7c8a9a7cac4b7a9a7baf7c7a8 -a9a7baa69798b8989882839bdac896999cb5867389a37483676a88dac8968673896f596fa37483 -c19ba5e8bb88867389565b776c5456787988d9b8997a687960517060517077809751524bb63024 -8a2f624c1575541574541574541574540b745415745c1574040404 -04040464257c64257c641a7c641a7c5c1c7c6414745c1c7c99275ea829163d3630dac896ae9870 -c78d61c5b699a59887d9b8888c6540c78b4fc8a671c8a671efad5ec78b4fd2966db6a788ae9870 -e8bb88df9b5af7bb86b5a898b5a898f8d094f7be9af7d8b8b9b6c0b9b6a8fad9a5fad9a5f7c7a8 -d8b7a8d7aaa7f7c7a8faecc9e6b8abd8b7a8e6aa9dd8b7a8e9e7e8d6acb4d69b98d69b98d7aaa7 -e8d8d8d8b7a8d7aaa7d7aaa7e6b8abf6d8c8e9c8b8d8b9b7e9b899f7c7a8f7d8b8f7d8b8b9b6c0 -d7c8c8f7d8b8f8d094fad9a5b9b6a8cac4a7e9b899f0ac7ddac896b5a898c8b7a8d9b888c78d61 -e8bb88c8b688d9b888c78b4fa37357d9b899b5a898c8b688c78d61c9a799b9b7b440474bb63024 -87216454147c5c15745415745c15745415745c1574541574040404 -04040464257c641a7c641a7c641a7c5c147c5c157454147c99275ecd342a3d36306775886c5456 -5c495a988884c8a6716c5456815a55a37357d9a887c8a671776a86ae7b74936f72a59887b6a788 -7b7779ae7b74936f72a8a6a9c5b6999588a7d7a899a48899b9b6c0c7b8b7ac99a7e7c7a5c89997 -c7b8b7d9b899c6c2cae9e7e8d8b9b7d6acb4d7aaa7ebdae5f5ebf5f7c8c8d7aaa7d69b98e8d8d8 -f5ebf5e6b8abd8b9b7d7aaa7d8d7dae9e7e8c8a9a7d7c8c8c19ba5d7c8c8e7c7a5a69798ccd6c6 -a8a6a9c7abb5e9b899a59887cac4a79fa19ac89997be8b70988884d9b899b5a898ae7b74ae7b74 -988884c8b688d9b899ae7b7492655f787988c8b688988884815a557b7779999cb540474bcd342a -8721645415745415745c1c7c5415745415745c15745c1574040404 -040404641a7c5c1c7c641a7c64257c6414745c15745c1c7c99275ecd342a39291f4b4b644b5967 -45535b675f46a373575c495a40474b867389a37357c78b4f7a68794b5967596678be8b70f0af71 -6f596f4b5967666178e9b899f6c77c778097565b77778097e9c8b8f8d09482839b696f7a999cb5 -f8ecd8f8ecd8b8aab7787988b9b6c0e8d8d8e9d8c8b9b6c0988884e6c9d9d8d7dae9c8b8d7c8c8 -988884d6c8d5f5eae7e9c8b8b8aab7787988b5c0d5f8ecd8d8b9b7787988676a88ac99a7faecc9 -d8c7b8676a885966789588a7fad9a5c8a886535f834b4b64936f72f0ac7db99886666178565b77 -776a86d2966db986808f8b97565b775c495ac78d6170706a4b5976565b777b777946423bb63024 -8721644c15755415745415745415745c2479541c7c541c6c040404 -0404045c147c641a7c641c745c24795c1574641a7c5c1c7c99275eb6302439291f565b684b5967 -4b4b64675f46ae845d60517045535b45535ba37357c78b4f7c62674b5967666178ae845ddf9b5a -c78c82616568666178e6aa87e8bb88776a8645535b687798e9b899fad9a582839b4b596782839b -f7d8b8f5eae7a9a7ba616568a9a7baf6d9d9f5eae7a8a6a9616568c6c2caf6d8c8f5eae7b9b6c0 -696f7ab9b6c0f6d9d9f5eae7ac99a7565b68b9b6c0f8ecd8e8d8d8696f7a4b5967a8a6a9fad9a5 -e9c8b8676a884b5967a48899f8d094e6aa9d6051707b7779c89997df9b5aca83775966784b5967 -867389d2966da373574b4b644b59676f596fae845d6c54564b5967565b775c495a39291fb63024 -8721644c15755c15745415745415745415745415745c2479040404 -040404641a7c64257c64257c641a7c64257c641c745c1c7ca52357a8291640474b7b777951524b -565b68988884c8b688666178815a556c5456936f72c8a671867389ae7b74936f72ae7b74efad5e -e6b8abd699867a6879ae9870c8a886778097c8a9a79588a7b5a898c8b7a882839bcbcdc0a9a7ba -c9a799e9d8c8a9a7bac6d2e1c8c9d8d7aaa7e7c8c8d7c8c8ebdae5ebdae5d69b98d8b9b7e7c8c8 -e9e7e8d6c8d5e6b8abd7c8c8b8aab7c8c9d8a9a7bae9d9a6b9b6c0999cb5b9b6c09588a7e9d9a6 -999cb5878aa7b8aab782839bdac896a48899867389d7aaa7d8b7a8efad5e988884867389a37483 -747297d9b899936f726f596f7c6267776a86dac8968f8b974b4b6460517082839b5d4c36b63024 -8721645415745415745c15745415745415745415745c2479040404 -040404641a7c641a7c64257c64257c641a7c5c1c7c5c1c7ca52357a8291646423bd7c8a8a37357 -ae9870c5b699a69798d9b888c78b4fd9b56ac8a671a59887d9b56adf9b5adf9b5ad9b56ac89887 -f0af71f0af71f8d094b5a898b6a788f8d094fad9a5fad9a5c8b7a8b5a898fad9a5f8ecd8f8ecd8 -c7b8b7c7b8b7f7d8b8fcf8e7f6d8c8d8b7a8d8b7a8f7c8c8fcf8e7d8b9b7e6aa9dd7aaa7d8b7a8 -f8f6f7f6d8c8e6b8abd8b7a8fad9a5fcf8e7e9d8c8c7abb5c6c2caf8ecd8f8ecd8e9d9a6b9b6a8 -cac4b7f9ebb6fad9a5e9d9a6b5a898c8b7a8fad9a5f7bb86f7bb86d7a899c8a671efad5ee09e75 -d9b899a69798c8b688e09e75d2966ddac896b5a898c5b699ae845db6a788cac4b740474bb63024 -8a2f6254147c5415745c1574541574541574541c6c5c2479040404 -040404641a7c641c74641a7c641a7c641a7c5c157454147ca52357a829163d36308673896f596f -6c5456988884c8b68886738992655f827668988884c8a6717c6267ae7b74d9a887e6aa87d69986 -988884d7a899a48899a69798b5a898878283d9b899a59887a8a6a9c8b7a8a9a7bad8d7daa9a7ba -b8aab7c7b8b7a8b1c9d8d7dab8a8a7d8b9b7d8b7a8c8c9d8e9e7e8d8b9b7d6acb4d7aaa7d2dae7 -e9e7e8c7b8b7d8c7b8c19ba5c8c9d8dbe1e7ac99a7d7c8c8a8a6a9b5c0d5e8d8d89fa19acac4b7 -a8a6a9c8a9a7dac896988884d9b888a8a6a9c89997e6aa9da69798d9a887e6b8abe6aa87c78c82 -867389c8b688a59887a37483ae7b748f8b97c8b7a8a69798936f7292655f9fa19a45535bb63024 -8721644c15755c15745c15745415745415745c15745c2479040404 -040404641a7c5c1c7c5c147c5c1574641a7c641a7c5c1c7c99275eb6302439291f6c5456565b68 -4b5967936f72c78d617c62674b59674b4b64ae7b74efad5e7c626745535b94788fe09e75f0af71 -988884565b77676a88e8bb88f8d094867389565b68687798e9d8c8faecc9878aa7596678687798 -e9e7e8f5eae7878aa7696f7aa9a7baf2f4eaf8ecd89897a870706ab9b6c0e9e7e8e9d8c8a9a7ba -7b7779a8b1c9fcf8e7e9d8c8999cb566617898a8c2f8f6f7e8d8d868779859667898a8c2fcf8e7 -d8c7b85a6889565b778f8b97f8d094d8c7b8676a88676a88a48899f7bb86e9b899a48899605170 -7a6879f0af71a88786535f83596678867389e6aa87936f724b597659667886738951524bb63024 -81205c5415745c15745415745415745c1574541574541574040404 -0404045c1c7c641a7c641a7c5c1c7c641a7c5c24795c1c7c99275eb630243d36307c6267565b68 -4b596792655fd9a8877a68794b5967605170be8b70f0ac7d7a6879565b684b5967b99886f7bb86 -867389565b778f8b97e8bb88f0af71e6b8ab70706a676a88e8dab9faecc97887a8596678687798 -d9d5b8f8ecd87b8db45966788896b8f6d9d9f2f4ea999cb5677588a8b1c9e8d8d8e9e7e89897a8 -696f7a999cb5f8ecd8e9e7e8878aa75a68898896b8faecc9c8c9d86877985966788896b8faecc9 -d8c7b8565b777b7779f7c8c8f7bb86f7bb868782834b59769897a8f8d094c78c824b59764b5967 -94788ff0af71b7898f596678565b77936f72d9a887a37483565b685966787c62674d3d2ccd342a -8721645415745415745c15745c15745415745c15745c1c7c040404 -0404045c1c7c641a7c641a7c641a7c641a7c64257c541c7ca52357b6302446423b988884a37357 -936f72b5a898c8b7a8988884ae7b749888848f8b97b5a898988884c89887a88786988884c8a886 -9897a8d9b899d9a887ca8377df9b5af7c7a8e9d8c8a69798988884c8b7a89897a8d8d7daa8b1c9 -b5a898b9b7b49897a8d2dae7a8b1c9c8b7a8c7b8b7b9b6c0dbe1e7c8c9d8d8b7a8d8b9b7c6c2ca -dbe1e7b5c0d5d7c8a8b9b6c0b9b6c0dbe1e7a8b1c9d7c8a8999cb5a8b1c9c8c9d88a95a9dac896 -8f8b97a9a7baf6d8c8f6c5b7f0af71b99886c7abb5d8b7a8878aa7d8b7a8878283a88786b89898 -867389cac4a78f8b97a37483a3748382839bd3bac4999cb5936f72a374839897a846423bcd342a -781a664c15755c15745c1c7c5c1574541574541574541574040404 -040404641a7c5c1c7c641a7c641a7c5c1574641a7c5c1c7c99275eb6302451524bdac896c78d61 -d2966dc8b7a8b5a898d7c8a8e09e75f0af71b6a788b5a898e8bb88f6c77cf6c77cc8b688a59887 -f6c77cf6c77cefad5edf9b5ad2966defad5ef6d8c8f9ebb6b5a898a59887e9d9a6fcf8e7faecc9 -b9b6a8b9b6a8f9ebb6fcf8e7f8ecd8c7b8b7c7b8b7faecc9f2f4eaf6c5b7d8c7b8d8b9b7e9d8c8 -f2f4eae9d8c8c7b8b7c7b8b7fcf8e7fcf8e7e9d9a6acb4accac4a7fcf8e7fcf8e7e9d9a6b5a898 -c8b7a8faecc9f7d8b8efad5ef0ac7de09e75f0af71fad9a5e7c7a5a59887c8b688f6c77cf8d094 -e9d9a6b5a898cac4a7f7bb86e8bb88d7c8c8ac99a7d8c7b8d69986d9a887cac4a746423bb63024 -7926665415745c15745415745c15745c15745415745c1574040404 -040404641a7c641c745c1c7c641a7c641a7c5c15745c1c7ca52357b6302446423b988884936f72 -936f72ac99a7d9a887867389ae7b74827668a69798d9b888778097b99886a37483988884c8b688 -696f7ab99886f7c7a8f0ac7dd2966db9b6c0c6c2ca7b8db4b89898c8b7a8687798b8aab7878aa7 -a9a7bad7c8a88896b8c8c9d88a95a9c6c2cac7b8b798a8c2b5c0d5a9a7bad7c8c8c5b699a8b1c9 -b5c0d58896b8d7c8c8b9b7b48896b8b5c0d58a95a9d9d5b89fa19aa8b1c9b9b6c082839bdac896 -9897a898a8c2ebdae5c7abb5df9b5aefad93f6c5b7c9a7998f8b97d9b56a878283a48899b89898 -82839bd7c8a8a4889994788fae7b74878aa7d8b9b7a69798a37483ae7b74ac99a746423bcd342a -8721644c15755415745415745415745415745415745c1574040404 -040404641a7c641a7c641a7c641a7c641a7c5c1c7c5c1c7ca52357a829164d3d2ca37357595c59 -565b68be8b70df9b5a92655f4b5967565b77c89887f6c77ca374834b5967596678d9b899f6c77c -8782834b5967b89898f7d8b8f7d8b8b8aab7565b68778097e8d8d8fcf8e7878aa745535b687798 -e9e7e8fcf8e78a95a9565b688896b8f8f6f7dbe1e77b8db46661788896b8dbe1e7d8d7da8a95a9 -565b688896b8eaebf6f2f4ea7887a84b596798a8c2fcf8e7d8d7da5a6889565b6898a8c2f8ecd8 -dbe1e75a6889696f7ab5c0d5f7d8b8f6d8c8a697984b5967b89898f6c77cd8b7a8565b774b5976 -ac99a7f8d094c89887535f834b597694788fe6aa87b98680596678676a88a374833d3630cd342a -781a665415745c157454157454157455146c5415745c1574040404 -040404641a7c641a7c5c1c7c641a7c64257c5c1c7c5c1c7ca52357a829163d3630a887867b7779 -70706aae7b74e6aa87988884616568596678c89887f8d094878283565b685a6889d8b7a8f8d094 -878283565b685a6889e8dab9f7d8b87887a8696f7aa8b1c9e7c7a5e7c7a5f6d9d98782835a6889 -d9d7c8f8ecd87887a85966787887a8e9d8c8ebdae56b7eab5966787b8db4ccd6c6d2dae77887a8 -5a68897887a8d8d7dae9e7e86b7eab5a68898896b8f8ecd8d7c8c8596678988884ebdae5f7d8b8 -e8d8d8a9a7ba59667898a8c2f8ecd8d8c7b8565b774b5976b5a898f6c77cd8b7a85a6889596678 -a48899f7c7a8c8a9a75a6889696f7aa37483e09e75b7898f616568696f7ab986803d3630b63024 -87216454147c541574540b6c5415745c15745c1574541574040404 -040404641c74641a7c641a7c5c1c7c641c7464257c5c2479a52357a8291651524bc89887c78d61 -b98680b99886c8b7a8a59887c89887b89898ac99a7c8b7a8a69798d9b899a8a6a99fa19ac5b699 -a69798d8c7b89fa19ab6a788c8b688a8a6a9ebdae5d7c8c8d69986f0ac7df6c5b7e9e7e8a9a7ba -b5a898b9b6a88a95a9d2dae798a8c2b9b6a8acb4ac999cb5b5c0d598a8c2b8a8a7cac4b7a8b1c9 -c6d2e198a8c2cac4a7b9b7b498a8c2dbe1e79897a8dac8969fa19aa8b1c9e9e7e8f7c8c8f0af71 -d7a899e8d8d8c8c9d88f8b97c5b699988884b9b7b4c6c2ca878aa7d9b56a988884b8a8a7c7b8b7 -9897a8d7c8c8ac99a7b7898fd7aaa7ac99a7d9b899c19ba5b98680b7898fb8aab746423bcd342a -872164541574540b6c5415745c1574541574541574541574040404 -0404046414745c15745c15746414745c1c7c641a7c541c7ca52357a829165d4c36c5b699d2966d -c78b4fd9a887b5a898e9b899f0ac7df7bb86c8b688b8a8a7e8dab9f8d094f8d094c5b699b5a898 -dad4a8f8ecd8fad9a5b5a898b6a788e9d9a6f8ecd8f7bb86e09e75e09e75d2966df8ecd8faecc9 -c5b699b5a898e8dab9fcf8e7faecc9aab4b8cac4a7faecc9dbe1e7f8ecd8c7b8b7b9b6c0e9e7d7 -dbe1e7e8dab9c8b7a8b9b7b4f8ecd8fcf8e7e9d9a6b5a898b9b6a8f8ecd8faecc9df9b5ad88e7d -e09e75e8bb88f8ecd8e9d9a6a59887c5b699f9ebb6faecc9e9d9a69fa19acac4a7fad9a5f9ebb6 -e9c8b8b8a8a7d8c7b8f7c7a8f7be9ae6b8abc19ba5c9a799d88e7dd9a887c8a9a746423bb63024 -79266654147c541574541574540b6c5415745c1574541574040404 -0404045c147c641a7c5c147c5c15746414745c1c7c5c1c7ca52357a829164d3d2cc89887ae7b74 -b98680c8a9a7d69986a48899b99886a88786a9a7bad9b8998f8b97b89898878283a8a6a9dac896 -878aa7a8b1c97887a8b5a898b6a788747297b9b6c0f6d9d9e6aa87d2966de8d8d8d6c8d57b8db4 -b5a898cac4b777809798a8c27b8db4cac4b7b9b6c08896b8a8b1c97b8db4c6c2cab9b7b47b8db4 -a8b1c97b8db4cbcdc0b9b6a87b8db4a8b1c9687798d9b8999fa19a9897a8ebdae5d3bac4df9b5a -e6aa9df5eae7c6c2ca778097dac8968f8b97a9a7bab5c0d58a95a9d7c8a88f8b97ac99a7c9a799 -9897a8d8c7b8ac99a7c8a9a7d69b98ac99a7d7aaa7c19ba5c89887c78c82b8a8a740474bcd342a -781a665415745c157454157454157455146c540b745c1574040404 -0404045c1574641474641a7c5c147c5c147c5c1574541574b0254ea82916472f22c78d61595c59 -70706ac89887f0af71be8b70565b68696f7ae6b8abf8d094ae98704b5967677588f6d8c8faecc9 -a9a7ba45535b677588e9e7e8f8ecd8778097565b68b8a8a7f6d9d9f6d8c8c8c9d8616568677588 -e9e7e8e9e7e87887a84b59677887a8dbe1e7c6d2e16175a65966787887a8d2dae7d2dae7687798 -4b59767b8db4dbe1e7d8d7da6b7eab565b688896b8e9e7d7dbe1e75a6889787988dbe1e7e7c8c8 -f8ecd8b8a8a7565b6898a8c2fcf8e7d8d7da5a6889565b77b5c0d5faecc9d8c7b8596678565b77 -b8a8a7fad9a5d8b7a8677588676a88c8a9a7efad93d7a8997a6879787988c898873d3630b63024 -7926664c15755c15745c1574540b6c5415745415745c1574040404 -0404045c1c7c6414745c15745c1574641a7c641a7c541c7ca52357a829164d3d2cd2966d988884 -936f72d2966de09e75d8b7a87b7779787988d9a887f7bb86ac99a77b7779778097d7c8a8f8ecd8 -9897a8596678687798ccd6c6faecc96b7eab5966785a6889d9d7c8f6d8c8687798696f7ad7c8c8 -e7c8c8d8b7a8e8d8d8867389687798d8d7dac6c2ca6175a65a68896b7eabccd6c6c6d2e16175a6 -5a68896175a6d9d7c8c6c2ca5a68898f8b97e8d8d8d9b899e8d8d8c7b8b7565b68999cb5f8ecd8 -c8c9d8565b775966789897a8f9ebb6d7c8c85a6889596678b9b6c0f8ecd8d6c8d5676a88677588 -c9a799f7be9ae7c8c8787988878283d7a899e59b87d7aaa77b777994788fd88e7d4d3d2ccd342a -781a66540b745c15745c157454157455146c5415745c1574040404 -040404641a7c5c147c6414746414745c1574641a7c5c1c7ca52357a8291646423bd88e7dd2966d -d9a887b89898c89997c89887f0ac7dd9b899b5a898c9a799a69798e8dab9c6c2cab9b7b4cac4b7 -a8a6a9d8d7dab5c0d5a8a6a9b8a8a79fa19ae9e7e8a8a6a9a8a6a9b5a898999cb5dbe1e7f6d9d9 -e59b87d88e7de9c8b8c6d2e19897a8c5b699c5b69998a8c2c6d2e198a8c2b9b6a8aab4b898a8c2 -b5c0d5999cb5b9b6a89fa19a98a8c2c6d2e1e9c8b8d88e7de6aa9df7c8c8c6d2e18f8b97c5b699 -988884c6c2cad2dae78896b8d9b56aa59887b5c0d5c6d2e1999cb5d7c8c8a8a6a9c7b8b7d8d7da -b8aab7d9b899b8aab7d7aaa7e7c8c8c7abb5c89997c7abb5d69b98d7aaa7c7abb5472f22cd342a -781a665415745415745415745415745415745c1574541574040404 -0404045c1574641c746414745c1c7c641474641a7c54147ca52357a829165d4c36b99886c8a671 -e09e75c89887c8a886d7a899e8bb88f0ac7dd7a899c9a799e7c7a5f8ecd8f7d8b8d8b7a8c8b7a8 -e9d8c8fcf8e7faecc9c5b699b9b6a8e8dab9fcf8e7f9ebb6c5b699b5a898e9d9a6e9e7e8d69986 -e09e75e59b87ca8377d6c8d5e9d8c8b6a788c5b699e8dab9dbe1e7e9d8c8c8b7a8b9b6a8e9e7d7 -dbe1e7dad4a8b5a898c5b699faecc9d3bac4c78d61e59b87d2966dd9a887f5eae7d7c8a8a69798 -cac4a7f9ebb6fcf8e7e9d9a6b9b6a8cac4a7faecc9fcf8e7e9d8c8b9b7b4d8c7b8f8ecd8faecc9 -e6b8abd7aaa7d8b7a8f7c7a8efad93d69b98c8a9a7c89997e6aa87d69986c898873d3630cd342a -7926664c0b745c15745c15745415745415745c15745c2479040404 -0404045c1c7c641a7c5c1c7c6414745c1c7c5c1c7c54147cb0254ea829164d3d2ce6aa9dd9a887 -d69986e6b8abbe8b70d7aaa7d7a899c9a799d6acb4d9b899ac99a7b9b6c0a8a6a9b8aab7e7c7a5 -878aa7a8b1c98a95a9cac4b7dac8968896b8a8b1c97887a8a8a6a9dac896747297b9b6c0f6d9d9 -e6aa9dd88e7df6d9d9a8b1c95a6889b5a898b9b7b468779898a8c26b7eabcbcdc0b9b6a86b7eab -7b8db45f6b97d7c8a8a8a6a9676a88c6c2caf7c8c8ca8377e6aa9debdae598a8c2687798dac896 -9fa19a8896b8c6c2ca8a95a9d9d5b8b5a898b5c0d5b5c0d58896b8e9c8b8b8a8a7c8c9d8d6c8d5 -a9a7bad7aaa7d8b7a8d8b9b7e9b899c8a9a7c89887e6aa9de6b8abefad93d7aaa73d3630cd342a -781a66541574541574541574541574541574541574541574040404 -040404641c7464257c641a7c641a7c5c15745c15745c1c7cb0254ea829165d4c36e09e75766a4d -7c6267e9b899e09e75e8bb88595c597b7779e8dab9f6d8c8c7b8b7595c59787988dbe1e7f8ecd8 -b9b6c0565b68687798f8f6f7fcf8e7a9a7ba4b5967687798e9e7e8e9e7d78a95a9616568b8aab7 -d6c8d5c6c2cab9b6c0616568778097d8d7dac8c9d8677588565b686b7eabc6d2e1b5c0d5687798 -4b59678a95a9c6d2e1d2dae76775887b7779c8c9d8c7b8b7d6c8d5a8a6a9565b6898a8c2f8ecd8 -d8d7da677588596678a8b1c9fcf8e7e9e7d7677588676a88c6d2e1fcf8e7d6c8d5787988696f7a -d6c8d5f6d8c8e7c8c894788f7b7779d8b9b7efad93e6b8ab867389988884d7aaa73d3630db3738 -781a664c1575540b6c55146c5415745c157455146c5c1c7c040404 -040404641a7c64257c641a7c641a7c641a7c5c15745c147cb0254eb6302451524be6aa87b99886 -b99886e6aa87c8a671e6b8aba88786a69798e6b8abe9c8b8c6c2ca87828382839bd8b9b7f7d8b8 -a8b1c9787988778097ccd6c6fcf8e78896b8677588687798ccd6c6e9e7d76b7eab676a885a6889 -c8c9d8d9d5b8565b77878283e8d8d8c89997c7b8b7dbe1e77b77795a6889ccd6c6b9b7b44b5967 -8f8b97eaebf6c8a9a7c7abb5e6c9d9696f7a687798e9e7d7b9b6c0535f835a68898896b8e9e7d7 -d2dae75f6b97596678a8b1c9fcf8e7e9e7e8687798677588c6c2caf6d8c8dbe1e77780978f8b97 -d7c8c8e9c8b8e8d8d8a48899988884e6aa9de09e75e9c8b8a37483a88786e59b8739291fcd342a -7926665415745415745c15745415745415745415745c1574040404 -040404641a7c672784641a7c5c1c7c641a7c5c1c7c5c147cb0254ea829165d4c36d2966df0ac7d -e8bb88c89887b98680c89887fad9a5d8c7b8c19ba5d7a899d7a899e8d8d8d8d7dac9a799d7a899 -b89898e9e7d7c6d2e1b9b7b4c7b8b7aab4b8e9e7e8b5c0d5b9b7b4cac4b7acb4acc6d2e1a9a7ba -a8a6a9b6a7889fa19ab5c0d5d6acb4d88e7dd7a899e7c8c8a8b1c982839bb6a788a598879897a8 -b5c0d5d3bac4d69986d69986e7c8c8b5c0d5988884c5b699a59887aab4b8c6d2e198a8c2d7c8a8 -a8a6a9b9b6c0dbe1e798a8c2d8c7b8b8aab7c6c2cadbe1e7b8aab7d8b7a8c7abb5d7c8c8ebdae5 -d3bac4d7aaa7c7abb5e9c8b8e8d8d8d7aaa7b98680d7aaa7f7be9ae9c8b8d69b98472f22cd342a -7926664c15755415745c15745415745415745c1574541c7c040404 -040404641a7c6414745c15745c1c7c641a7c5c1c7c5c147cb0254ea8291651524bb6a788e09e75 -d2966dc78d61c78c82c9a799e8dab9e6aa87d88e7dc9a799d8b7a8e9e7e8f7c7a8d7a899d7a899 -d8c7b8fcf8e7faecc9d7c8a8c8b7a8e9e7d7f2f4eae9d8c8c8b7a8b9b6a8e8dab9dbe1e7e8dab9 -c5b699b6a788dad4a8d7c8c8ca8377ca8377ca8377ae7b74b5c0d5d9d5b8ae9870b6a788d9d5b8 -a9a7baae7b74c78c82d88e7dc78c82c8c9d8d8c7b8b5a898c5b699e8dab9e9e7e8dad4a8b9b6a8 -cac4a7f8ecd8ecf8fce9d8c8b9b6c0d7c8a8f8ecd8f8ecd8e6b8abd8b7a8d9b899f6d9d9e9d8c8 -c9a799d7aaa7c89997e9c8b8d8b9b7b7898fc89997ca8377d7a899c78c82b898983d3630cd342a -792666541c7c540b7455146c5c15745415745c1574541574040404 -040404641a7c64257c641a7c641a7c641a7c641a7c5c147ca52357a829165d4c36f6c5b7d9b899 -e6aa87e6b8abbe8b70f7c7a8d7c8c8e6b8abd8b9b7c89887d8b9b7c6c2cab9b6c0d7c8c8e9b899 -b8aab7b5c0d5a9a7bac6c2cadac8968896b898a8c27887a8b9b6c0dad4a87b8db48896b87887a8 -b8aab7c5b6996175a6a8b1c9f5eae7b98680d69b98eaebf6878aa745535bc5b69998888445535b -98a8c2f5ebf5c78c82d69b98eaebf698a8c26b7eabdac8969897a87b8db498a8c27887a8d9d5b8 -a8a6a98896b898a8c28896b8d9d7c8c8a9a7c8c9d8c8c9d8b8aab7d8b7a8d8b9b7d2dae7d6c8d5 -d3bac4c89997e6b8abebdae5f6d9d9e6b8abb98680e6aa9df7c7a8f7c7a8d7c8c83d3630cd342a -7926665415745c15745c15745415745415745415745c1574040404 -04040464257c5c1c7c641a7c5c1c7c5c157464257c5c1c7cb0254ea829165d4c36f7be9a7b7779 -827668e7c7a5e7c7a5e7c8c8675f46988884f6d9d9e9d8c8d6c8d5595c598f8b97f5ebf5f5eae7 -c6c2ca595c5982839bf5ebf5e9e7e8999cb5565b68687798d2dae7d8d7da8896b8565b68687798 -c6d2e1d8d7da7887a861656898a8c2b9b6c0a8b1c99897a8616568778097b9b6c0a8b1c9696f7a -70706a98a8c2a9a7bab5c0d598a8c2565b687b8db4dbe1e7c6d2e15f6b9759667898a8c2dbe1e7 -c6d2e15a6889616568a8b1c9f2f4eae9e7e8787988696f7ac6d2e1f8ecd8e8d8d88782837b7779 -d2dae7e6c9d9e8d8d894788f7b7779ebdae5e7c8c8e9c8b87a6879a69798e6b8ab4d3d2ccd342a -641c745415745c15745415745415745415745c1574541574040404 -04040464257c64257c64257c641a7c641474641a7c5c1c7ca52357a8291646423bf6d8c8cac4a7 -d7c8a8e6b8abb99886f7c8c8b5a898d8b7a8e6aa9dc9a799e7c8c8c8a9a7c7b8b7d8b7a8d8c7b8 -d6c8d5ac99a7999cb5d8c7b8e7c8c8999cb58a95a97887a8b9b6c0d8d7da6b7eab7887a86175a6 -aab4b8d8d7da6175a6687798596678c6c2cab5a8983044438a95a9ecf8fcb98680a69798ecf8fc -787988304443cbcdc0b8a8a7565b775f6b976b7eabe9d8c8b5c0d56175a66877987b8db4e9e7d7 -b5c0d56b7eab82839b98a8c2e8d8d8dbe1e78a95a99897a8d7c8c8e9c8b8dbe1e7ac99a7ac99a7 -f7c9d7c8a9a7ebdae5c8a9a7b89898f7c9d7c89997e8d8d8a69798c6c2cae9b89939291fdb3738 -781a665415745415745415745c15745415745c15745c1e6c040404 -04040464257c641a7c5c1574641a7c5c1c7c641a7c5c1c7cb0254ea8291651524bc89887e8bb88 -e9b899c89887be8b70be8b70e9c8b8d3bac4c89887c78c82c89887e9d8c8e8d8d8c9a799c89887 -c9a799e8d8d8ebdae5c8b7a8d7a899c8b7a8d8d7dac8c9d8c7b8b7c7b8b7cac4b7d2dae7c8c9d8 -b9b7b4b8a8a7b9b6a8c6c2cac8b7a8b6a788ae845da0b0a0a8b1c9b89898be8b70ca8377c89997 -a8b1c9ae9870b6a788c8b688b9b6a8b5c0d5b9b6c0cac4b7b8a8a7cbcdc0c6d2e1b9b6c0c6c2ca -b9b6a8ccd6c6d2dae7c6c2cad8b7a8c7b8b7d7c8c8eaebf6d8b9b7d7aaa7c8a9a7e8d8d8f5ebf5 -d6acb4c89887d69b98d8b9b7e8d8d8d7aaa7b98680c8a9a7f6c5b7c6c2cab8a8a73d3630cd342a -7926665415745c157455146c5415745415745415745c1574040404 -040404641a7c64257c5c15745c147c5c15745c1c7c54147cb0254ea829165d4c36c9a799e7c7a5 -e8bb88b99886ae7b74b98680d7c8c8d7a899c78c82c78c82c9a799e8d8d8d8b7a8c89887d7a899 -d8b9b7e9e7e8d7c8c8d7aaa7c8a9a7d7c8c8d2dae7d8c7b8c8b7a8b9b7b4c6c2cad2dae7cbcdc0 -b9b6a8acb4accbcdc0b5c0d5cac4a7b6a788ae9870b5a898a9a7bab98680b98680ae7b74936f72 -a8b1c9cac4b7ae9870c8a886c5b699c6d2e1cac4b7cac4b7b9b6a8d2dae7dbe1e7d7c8c8c7b8b7 -cac4b7dbe1e7d8d7dad8b7a8d8b7a8d8b7a8e9e7d7f6d9d9c19ba5d7aaa7c8a9a7e8d8d8e8d8d8 -c89997c89997c78c82c6c2cad3bac4ae7b74c19ba5b99886d8c7b8d7a899b898983d3630db3738 -6817695415745c15745c15745c157454157455146c5c1574040404 -0404045c1c7c641a7c64257c5c157464147464147454147cb0254ea829164d3d2cf7d8b8c7b8b7 -d8b9b7d8c7b8be8b70f7c7a8c8a9a7e6b8abd8b9b7c89887e6b8abb8aab7b9b6c0d6c8d5d7a899 -d3bac4a9a7ba999cb5d8d7dae7c7a5999cb58896b87887a8c8c9d8d7c8c86b7eab7b8db46b7eab -b9b6c0d9d5b86175a6687798596678c5b699a0b0a030444398a8c2f8f6f7936f72c9a799ecf8fc -7887a8304443b6a788cac4a7535f836175a66b7eabe9d8c8aab4b86b7eab7b8db47b8db4e9e7d7 -b9b6c07b8db48896b8a8b1c9e9d8c8d6acb4a8b1c9b9b6c0c8c9d8d8b7a8d6acb4c6c2cad3bac4 -e6c9d9c89997e6aa9de8d8d8e7c8c8f7c8c8b7898fe7c8c8e8d8d8e8d8d8d7c8c83d3630db3738 -681769541574541574541574541574541574541574541574040404 -0404045c1c7c641474641a7c641a7c5c147c641a7c541574b0254ea829165d4c36f7bb86616568 -827668f7c7a8e9c8b8e9c8b851524b988884f6d9d9e7c8c8d6c8d5595c597b7779e9e7e8f5eae7 -c8c9d8595c59787988e9e7e8dbe1e7999cb5565b68687798c6d2e1d2dae78896b8565b68687798 -c6d2e1c6d2e17b8db46165688896b8a8b1c998a8c278798861656898a8c2a9a7baa8b1c98a95a9 -595c59778097a8b1c9b5c0d5778097565b688896b8d2dae7c6d2e15f6b974b596798a8c2d2dae7 -d2dae77780974b5967a8b1c9e9e7e8eaebf6787988616568dbe1e7f5eae7f5eae77b7779595c59 -d8d7dae8d8d8ebdae5a48899616568ebdae5e7c8c8f7c8c870706a878283e7c7a53d3630cd342a -781a664c1575541574541c6c5415745415745c1574541574040404 -040404641a7c641a7c641a7c5c1c7c641a7c64257c5c147cb0254ea8291651524bf7c7a8d9b899 -d9a887e09e75b99886e7c8c8d7a899c8a9a7e6aa9dc8a9a7d3bac4b8aab7b8aab7d8b9b7e9c8b8 -b9b6c0999cb59897a8c7b8b7e8d8d87887a87887a86b7eabc8b7a8d9d7c86b7eab7780976175a6 -b9b7b4e8dab95f6b978a95a9eaebf6c78c82c8a9a7ecf8fc787988304443ccd6c6a59887304443 -9fa19af5ebf5b7898fb8aab7eaebf67887a86175a6e8dab9a9a7ba6175a67887a86b7eabe8dab9 -b5c0d56b7eab7887a88896b8e8dab9d2dae78a95a98a95a9c6c2cae9c8b8dbe1e7a9a7baa8a6a9 -d6c8d5d8b9b7ebdae5c7abb5c19ba5f7c8c8c89997e7c8c8c89997c7b8b7e9b899472f22db3738 -6817695415745415745415744c157555146c5415745c1574040404 -040404672784641a7c5c1c7c641a7c5c1c7c641a7c5c147cb0254e85241551524bc8a671df9b5a -e09e75c78c82c78c82c78c82e8dab9e9c8b8d69b98c89887d9a887e8d8d8e9d8c8d8b7a8d7aaa7 -c9a799f8ecd8f5eae7c8b7a8b9b7b4cac4b7e9e7e8d8d7dac8b7a8b9b6a8c8b7a8c6d2e1cbcdc0 -b5a898b5a898b9b6a8c8c9d8c8a9a7d88e7dd69b98c19ba5a8b1c9b6a788a59887ae9870acb4ac -98a8c2b89898d88e7dd69986d7aaa7c6d2e1b5a898b6a788b5a898cbcdc0c6d2e1b9b6c0c8b7a8 -c5b699d9d5b8dbe1e7b9b6c0d8b7a8c8b7a8e8d8d8f8f6f7c7b8b7d8b7a8d7aaa7e7c8c8e9e7e8 -d8b9b7d69b98d69b98f6c5b7e9e7e8d7aaa7b7898fd69b98e8bb88e6b8abb8a8a7472f22cd342a -79266654157454157454157455146c55146c5415745c2479040404 -0404045c157464257c641a7c641a7c641a7c5c1c7c5c1c7cb0254ea829165d4c36c89887d9b888 -e09e75be8b70c78c82c89887fad9a5d9a887c78c82c89887c8b7a8e8d8d8d8b7a8c89887c9a799 -c7b8b7f2f4ead8c7b8b8a8a7b8a8a7c8c9d8f2f4eaccd6c6a8a6a99fa19ab9b7b4dbe1e7cac4b7 -b6a788b6a788c8b688d6c8d5d69b98d88e7dd69986b89898b5c0d5c7b8b7b6a788ae9870c7b8b7 -a8b1c9ca8377d69b98d88e7dc19ba5d2dae7cac4b7b5a898b6a788d9d5b8dbe1e7d9d5b8b9b6a8 -acb4ace9e7d7fcf8e7d7c8c8b9b6c0c7b8b7f5eae7f5eae7d8b7a8d8b7a8d8b7a8e8d8d8e9d8c8 -c89997c8a9a7c8a9a7e7c8c8e9c8b8ca8377c89997b7898fd7a899d88e7db7898f3d3630cd342a -6c147454157455146c541574541574540b745415745c2479040404 -040404641a7c641a7c641c745c1c7c5c1c7c641a7c541c7cb0254e8524154d3d2cf0ac7dd69986 -d9a887d9b899c78b4fefad93b5a898c9a799d8c7b8d9a887c7abb5a8a6a99897a8c6c2cae7c7a5 -999cb59897a87887a8d8d7dae8dab97887a87887a8687798b5c0d5dad4a86877987887a85a6889 -a8a6a9d7c8a84b59768a95a9f6d9d9c78c82d7aaa7f5ebf5878aa74b5976dac896b5a8984b5976 -98a8c2f8f6f7c89997d69b98ebdae582839b596678e8dab9a9a7ba5f6b977887a86b7eabe9d8c8 -acb4ac7b8db48896b87b8db4e9e7d7b9b7b48896b8aab4b8a8b1c9e9c8b8c8a9a7b5c0d5c6c2ca -c8c9d8d8b9b7d7aaa7d3bac4d7c8c8e9c8b8c78c82e6aa9de6b8abe6b8abd6acb4302f2adb3738 -68176954157454157454157454157455146c5415745c1574040404 -040404641a7c641a7c5c147c641c74641a7c641a7c5c147cb0254ea829165d4c36f0af71616568 -7c6267e9b899f0af71d9a887595c59878283f7d8b8f7d8b8c7b8b7595c597b7779ebdae5f5eae7 -b9b6c051524b778097f5eae7f8f6f7999cb545535b687798e9e7e8e9e7d77b8db44b59678f8b97 -d8d7dac6c2ca9897a8595c59999cb5c8c9d8c8c9d88a95a9595c596b7eabc6d2e1b5c0d5677588 -61656898a8c2c8c9d8d6c8d59897a8616568a8b1c9c8c9d8d2dae77879884b596798a8c2f2f4ea -e9e7e86775884b5967b5c0d5f8f6f7f2f4ea778097596678d2dae7fcf8e7ebdae5677588696f7a -ebdae5f8ecd8f6d8c87b77797a6879e6b8abe9b899f7c7a87b7779936f72d7a8993d3630cd342a -681769540b745415745c15745c1574540b7455146c5c2479040404 -040404641a7c641a7c5c15745c1c7c641a7c641a7c54147cc3324e8524155d4c36efad93c78c82 -c8a886d9a887d2966dc8b7a8b99886b5a898d7a899e6b8abb8aab7a8a6a9878aa7c8a9a7e9d8c8 -8896b88a95a97887a8cac4a7e9d8c87887a8878aa7687798cac4b7d8c7b85f6b979897a8f6d9d9 -d69b98d69986f6d9d99897a84b5976d9d5b8b8a8a75a68896b7eab5f6b97cbcdc0a8b1c96175a6 -7887a85f6b97d9d7c8b9b6a84b5976b8aab7f7c9d7ca8377d8b9b7e8d8d882839b6175a6e8dab9 -aab4b86877987887a88896b8f9ebb6c8c9d8878aa7878aa7a9a7bafaecc9c8c9d8878aa79897a8 -b9b6c0f7c7a8d8d7daac99a7a69798d7aaa7d7a899e7c8c8b7898fc89997e6aa9d472f22db3738 -68176954157455146c5415745415745415745415745c2479040404 -0404045c1c7c641a7c641a7c641a7c5c24795c1c7c54147cb0254ea8291651524bd69986df9b5a -e09e75c89887c89887be8b70f0af71e9b899d8b7a8c9a799d9b899faecc9e9d8c8c8b7a8b8a8a7 -d7c8a8f5eae7e9d8c8b5a898acb4accac4a7f2f4ead8c7b8b6a788b6a788cac4a7dbe1e7d7a899 -d88e7dd88e7dd69b98c6c2cac9a799b6a788b6a788cac4b7d2dae7ccd6c6b9b6a8b9b6a8d9d5b8 -d2dae7c5b699b5a898b6a788d8d7dac6c2cad69986d88e7de59b87e6b8abe8d8d8b5a898b6a788 -b5a898f9ebb6f2f4eab9b6c0c8b7a8b9b6a8e9d8c8f8f6f7b9b6c0c8b7a8c8b7a8f8ecd8f5eae7 -d8b9b7d6acb4d7aaa7efad93f7c7a8c7abb5d69b98d69b98e6aa87e6aa9dc19ba54d3d2cdb3738 -69256b5415745415745c1574541574540b6c5415745c2479040404 -0404045c1c7c64257c5c15745c247964257c5c15745c1c7cb0254e8524155d4c36c9a799d2966d -d2966dc78c82c8a886c9a799f7be9ad9a887b89898c9a799d8b9b7f6d8c8dac896b5a898b8a8a7 -b9b6c0e9e7e8cac4b7b5a898c5b699d9d7c8fcf8e7d9d5b8a59887b6a788c5b699f5eae7efad93 -d2966de09e75d7a899d8d7dacac4a7b5a898b5a898cac4b7d2dae7b9b7b4b9b6a8b9b6a8c6d2e1 -d2dae7cac4a7c5b699b5a898cbcdc0d7c8c8d88e7de59b87e59b87e9c8b8f8f6f7cac4b7b6a788 -b5a898e8dab9fcf8e7dad4a8b9b6a8b9b6a8f2f4eafcf8e7d8c7b8c7b8b7cac4b7f8ecd8f6d8c8 -d9b899c7b8b7d8b9b7f7d8b8e6b8abc89887c8a9a7c89997e6aa9de59b87b998863d3630db3738 -69256b5415745c15745415745c15745415745c15745c2479040404 -0404045c1574641a7c641c7464257c64257c64257c541c7cc3324ea829165d4c36d69986b98680 -b99886c8b7a8d2966dc9a7999888848f8b97c7b8b7f0ac7da69798a6979882839bc6c2caf7d8b8 -82839b7780976b7eabd6c8d5dad4a87887a8878aa75f6b97c5b699dad4a85f6b978a95a9e6c9d9 -e6b8abd69b98f6d9d99897a85f6b97dad4a8b9b6a86175a67b8db46b7eabd9d7c8b9b7b46b7eab -7887a86175a6d9d5b8b9b6a85a6889b9b6c0ebdae5d69986e6b8abebdae59897a87887a8fad9a5 -a0b0a06877988896b87b8db4faecc9b9b7b47b8db48896b8999cb5f8ecd8999cb5999cb5a8a6a9 -b8aab7f7c7a8c19ba5999cb5c8a9a7d3bac4d7a899d69b98c19ba5d7aaa7c19ba5302f2adb3738 -69256b5415745c15745c15745c15745415745c1574541574040404 -0404045c1c7c641a7c641c7464257c64257c641a7c541574c3324e8524155d4c36d2966d595c59 -70706ae59b87e8bb88b99886595c597b7779f7be9af6c77ca598874b5967677588f7d8b8faecc9 -a9a7ba45535b787988f8ecd8f5eae79897a8595c598f8b97e9e7d7f8ecd8ac99a745535b999cb5 -f5eae7d8d7da9897a845535b7b8db4d2dae7c6d2e16877984b59678896b8d2dae7c6d2e1687798 -4b59677b8db4d2dae7d2dae7676a88565b68c8c9d8e9e7d7e9e7e887828345535bc8c9d8fcf8e7 -f5eae77b77794b5967b9b6c0fcf8e7e9e7e8677588616568d2dae7f8ecd8e7c8c8696f7a596678 -d8b7a8f7c7a8e6b8ab696f7a616568d7aaa7e6aa87c9a7996165687b7779ca837739291fdb3738 -6817695415745415745415745415745c15745c1c7c5c2479040404 -040404641a7c5c157464257c641c745c1c7c6414745c147cb0254ea8291651524bb99886ae7b74 -a59887d69986d9b888ac99a7a88786988884c8a886e7c7a582839b988884747297b5a898e8dab9 -7780978f8b97687798cac4a7d9b8995a68899897a8f7c9d7e59b87d9a887c6c2caa8a6a9687798 -dad4a8d9b8995f6b977780976175a6d9d5b8c6c2ca6175a67887a86b7eabd9d7c8b5c0d56175a6 -7887a86b7eabd9d5b8c6c2ca6175a67780976b7eabf9ebb6ac99a7687798b9b6c0d8d7dae09e75 -f7c8c8e7c8c882839b7887a8f9ebb6a9a7ba7780977887a89897a8f9ebb6a8b1c978798882839b -a48899fad9a5b9b6c094788f8f8b97b89898e9b899c7b8b794788fac99a7c89887472f22db3738 -68176954157454157454157455146c5415745c15745c2479040404 -0404045c24795c157464257c641c745c1574641a7c5c1574c3324e852415595c59d9a887df9b5a -e09e75d9b899c9a799d9a887f0ac7de9b899c8b7a8c8b7a8d9b899f8d094e9b899b5a898b5a898 -dac896faecc9e8dab9a59887b6a788cac4a7f8ecd8e9b899e09e75d2966de6aa87f6d9d9e9d9a6 -b6a788b6a788d7c8a8e9e7e8cbcdc0a8a6a9b9b6a8cbcdc0d2dae7d7c8c8b9b7b4b9b6c0d7c8c8 -d2dae7c6c2cab9b7b4b9b6a8e9d8c8e9e7e8c5b699b6a788b5a898e9e7d7faecc9d69986e09e75 -efad93f6c5b7fcf8e7b6a788b6a788c5b699faecc9fcf8e7c7b8b7b9b6a8b5a898f8d094f7d8b8 -b9b6c0d6acb4c8b7a8e9b899e6b8abd3bac4d7aaa7d7aaa7d2966dd7a899c8a9a73d3630db3738 -68176954157454157454157454157455146c5415745c2479040404 -040404641c7464257c641a7c641a7c641a7c64257c5c147cc3324e852415675f46c9a799b98680 -c78d61b89898c9a799c8a9a7e8bb88c89887b99886b8a8a7b9b7b4f7be9ac8b688b6a788b5a898 -b8a8a7e8dab9c5b699a59887b6a788c9a799f5eae7e9b899e09e75f0ac7de7c7a5f5eae7c7b8b7 -b6a788b6a788cac4a7f2f4eab9b7b4b9b6a8b9b6a8d8d7dadbe1e7cac4b7c7b8b7c7b8b7d2dae7 -dbe1e7cac4a7b9b6a8b9b6a8dbe1e7f2f4eadac896b5a898988884e9d8c8f6d9d9e09e75f0ac7d -e6aa87e8dab9f5eae7cac4a7b6a788b6a788f7d8b8f8ecd8cac4a7b9b6a8b9b7b4f7d8b8f7d8b8 -cac4b7c6c2cac7b8b7f6c5b7f7be9ad7a899c8a9a7c8a9a7d69986d9a887c5b69946423bdb3738 -69256b541c7c541574541574541574540b745415745c2479040404 -0404045c1c7c64257c5c1574641a7c5c147c641a7c541574c3324e8524155d4c36ae7b7470706a -7b7779c89887df9b5a9888847a68797b7779c5b699e8bb887a6879696f7a676a88c8b7a8f6c77c -878283596678666178dac896e8dab96b7eab787988b9b6c0e9c8b8f7c7a8e6c9d9878283687798 -d9d5b8e8dab96b7eab6775887887a8e9e7d7c7b8b76b7eab7887a88896b8d8d7dac7b8b77b8db4 -7887a87b8db4d8d7dad9d5b86b7eab7780977b8db4f9ebb6acb4ac676a88b9b6c0f6d9d9f7bb86 -e7c8c8b9b6c07780977b8db4fad9a5b8a8a77780977780979897a8f9ebb6ac99a77780978f8b97 -9897a8f7d8b8ac99a7778097a48899ac99a7e9b899b8989894788fa48899ac99a73d3630db3738 -69256b5415745415745415745415745415745415745c1574040404 -040404641a7c64257c64257c5c1c7c5c15745c15745c147cc3324e8524155d4c36ae7b74595c59 -616568be8b70e09e75936f72595c59596678e09e75f7bb8698888440474b596678dac896f6c77c -936f7245535bb8a8a7f7d8b8f6d8c89897a851524b778097f8ecd8f8ecd882839b45535b7887a8 -fcf8e7fcf8e77887a845535b8a95a9f8f6f7dbe1e768779861656898a8c2e8d8d8d2dae782839b -45535b8896b8f2f4eaf2f4ea7780974b596798a8c2f8f6f7e9e7e859667845535bc6c2cafcf8e7 -ebdae5677588565b68c8c9d8f8ecd8f6d8c87b777945535bc8b7a8f8d094d6acb44b59764b5967 -c9a799f7c7a8d7aaa7596678596678b98680e6aa87b986805966787b7779ae7b7439291fdb3738 -69256b54157454157454157454157455146c5415745c2479040404 -040404641c74641a7c641a7c641a7c641a7c641a7c54147cb0254e852415595c59a88786ae7b74 -936f72c8a886cac4a7878283ae7b74867389a59887dac89694788fb99886867389a59887c8a671 -787988c89887f7be9af0ac7dd2966db9b6c0c6c2ca7887a8c5b699b99886687798b9b6c08896b8 -cac4a7cac4b78a95a9a8b1c97887a8d8c7b8b9b6c08896b8aab4b898a8c2e7c7a5c8c9d8999cb5 -a8b1c98896b8d9d7c8b9b6c08896b8a8b1c97887a8e8dab998a8c27b8db49897a8687798e7c7a5 -9897a87b8db4b9b6c0b9b6c0f0af71f6c5b7e6b8ab776a8682839bf8d09482839b77809782839b -82839bfad9a5ac99a786738974729794788ff7c7a8999cb586738994788fa6979839291fdb3738 -6817695415745c15745415745415745415745415745c2479040404 -040404641a7c641a7c5c1c7c641c745c1c7c641a7c54147cc3324ea82916595c59d9b888c78d61 -c8a671c8b7a8b5a898dac896e09e75f6c77cb6a788b5a898f8d094f7bb86f6c77cb6a788a59887 -f6c77cf6c77cefad5edf9b5adf9b5af0af71faecc9f8d094b6a788b6a788fad9a5fcf8e7f9ebb6 -b9b6a8b9b6a8f9ebb6f8f6f7e9d8c8b9b6c0c7b8b7e9d8c8f5ebf5e9c8b8d8b9b7d7c8a8e8dab9 -f2f4eae9d8c8c7b8b7c7b8b7f8ecd8fcf8e7e8dab9acb4accac4a7faecc9f8ecd8d9b888b6a788 -c5b699faecc9f7d8b8d2966de09e75f0ac7df7bb86f8d094c8a886a59887c5b699f8d094f7c7a8 -c7b8b7acb4acc8b7a8f0ac7de6b8abb9b6c0c7b8b7d8b9b7d2966dd9b899b9b7b4302f2adb3738 -69256b5415745415745415745415745415745415745c2479040404 -0404045c1c7c641a7c641a7c5c1c7c6414745c1c7c54147cc3324e852415675f46a8a6a9ae7b74 -92655fac99a7b5a898a48899be8b70ae845da69798b6a788988884d69986988884936f72c8a886 -a69798e9b899c89997be8b70f0af71e6b8abe9c8b88f8b97b6a788b6a7889897a8d8d7da999cb5 -b9b7b4b5a898a8b1c9e9e7e8aab4b8d8c7b8c8b7a8d2dae7e9e7e8c7b8b7e6b8abd7aaa7d2dae7 -eaebf6c8b7a8d8b9b7c8b7a8c8c9d8e9e7e89fa19ac8b7a8a8a6a9d2dae7e9e7d79fa19ac8b688 -a88786d8c7b8f7d8b8f7be9ae09e75b99886e9b899e9d9a6b8a8a7c5b699a59887d7a899e9b899 -b5a898b8a8a7a9a7bac89997d69986b8aab7b9b6c0b8aab7b98680be8b70b5a8983d3630db3738 -641c744c1575541574541574541574541574541574541574040404 -04040464257c641a7c641a7c641a7c5c1c7c641a7c54147cc3324e8524155d4c36827668616568 -616568a88786d2966d6661786165685a6889b99886df9b5a666178565b68565b68c8a671f6c77c -8782835966788f8b97f0ac7df0af71e6b8ab696f7a787988fad9a5f9ebb66877985966787887a8 -e9e7e8e9d8c87887a867758898a8c2f8ecd8d9d7c882839b677588b5c0d5faecc9e9c8b8999cb5 -78798898a8c2f5eae7e8dab97887a85a68898896b8f8ecd8b9b6c0687798676a888896b8f9ebb6 -b5a898535f83ac99a7f6c5b7efad5ed8b7a882839b687798a48899f8d094988884565b77676a88 -747297fad9a59888845f6b97676a8882839be6b8ab94788f676a88776a868f8b973d3630db3738 -68176954157454157454157454157455146c5415745c2479040404 -04040464257c64257c64257c641a7c641c74641a7c5c1c7cc3324eb6302451524b7c626745535b -45535ba37357c78d617a687945535b616568c78d61df9b5a7c626745535b988884f0ac7df0af71 -936f7245535b787988e9d9a6f7bb867a687945535b778097f6d8c8f8ecd8878aa745535b82839b -f8ecd8f2f4ea7887a8595c59a9a7bafaecc9e9e7e88f8b9770706ac6c2cae8d8d8eaebf6ac99a7 -565b68a9a7bafcf8e7f8f6f79897a8565b68a8b1c9fcf8e7dbe1e75a68894b5967b5c0d5f8ecd8 -e9d8c85966784b5967b5a898f8d094e9c8b85966784b5976c8a9a7f7bb86e6aa9d696f7a45535b -b98680f0ac7dae7b74565b77596678ae7b74e09e75a374835966786661786c5456472415db3738 -6817694c157555146c5c15745415745415745415745c2479040404 -04040464257c5c2479641a7c64257c641a7c64257c5c1c7cc3324e85241570706a8782836c5456 -6f596fa59887c8b688696f7a92655f7a6879ae9870c8a6717a6879ae845dd69b98e8bb88c78d61 -82839bc89887867389b5a898ae9870787988b6a78882839bb9b6a8c7b8b78a95a9c8c9d8999cb5 -b9b6a8c7b8b79897a8c6c2caa9a7bad7a899c7b8b7c7b8b7d8d7dad6c8d5d7a899d7c8c8d7c8c8 -c6d2e1b9b6c0d8b7a8d3bac4a9a7bab5c0d5999cb5e9d8c8999cb5999cb5a8b1c98896b8e9d9a6 -9897a88f8b97a88786778097dac896a488999588a7a488999897a8f7bb86e6b8abc19ba5885b87 -787988e8bb88867389776a8674729782839be7c7a582839b676a88676a88778097472f22db3738 -681769540b6c5415745415745c15745415745c1574541574040404 -04040464257c64257c64257c5c24795c157464257c5c1c7cc3324e852415595c59dac896ae9870 -ae9870b6a788a59887e8bb88c78b4fefad5eae9870ae9870d9b56adf9b5aefad5ed2966dc8a671 -f0af71f0af71f6c77cae9870b6a788f8d094f8d094fad9a5b5a898c5b699f9ebb6fcf8e7f8ecd8 -c7b8b7c8b7a8fad9a5fcf8e7e9c8b8d8b7a8e9b899f6c5b7f5eae7e6b8abd7aaa7d7a899e7c7a5 -f5eae7e9c8b8d8b7a8e6b8abf7d8b8fcf8e7e9c8b8b9b6c0d8c7b8f8ecd8fcf8e7d9d5b8b9b6a8 -cac4a7fad9a5fad9a5d9b888b99886cac4a7f8d094f7bb86f0ac7dd7a899e8bb88f0af71f0af71 -c8a671b5a898c5b699d2966dd9a887c7b8b7b8a8a7b9b6a8ae7b74d8c7b8aab4b8472f22db3738 -5c1e6c5415745c15745c1574541574541574540b745c2479040404 -04040464257c672784641a7c5c15745c247964257c5c1c7cc3324e852415766a4d8f8b9751524b -595c59a59887b6a7887b7779815a55766a4d936f72ae98707b7779ae845d7b7779ae845df0af71 -d7a899d69986936f72ae9870b6a788a69798d9b8998f8b97b9b7b4b5a898a9a7bae9d8c8a8a6a9 -c7b8b7c8b7a8c8c9d8d8d7dab8aab7d8b9b7e6b8abeaebf6e9e7e8d8b9b7d7aaa7d7aaa7e9e7e8 -f5eae7d8c7b8e9c8b8d7a899d2dae7e8d8d8b8a8a7e9c8b8a8a6a9d8d7dad9d5b8a69798cbcdc0 -a8a6a9d8c7b8e8dab99fa19ac8b688988884d7a899f7be9ae7c7a5e8bb88ae9870c78c82d69986 -b5a898c5b699a59887ae7b74ae7b74b5a898b9b7b49897a8675f46988884a0b0a03d3630db3738 -6817695415745c15745c15745415745415745415745c2479040404 -0404045c157464257c641c7464257c64257c5c24795c2479c3324e852415675f46595c5945535b -45535b6c5456ab7b45565b6845535b4b4b64a37357c78d616661784b5967666178be8b70df9b5a -b99886616568596678e8bb88f0ac7d676a884b5967778097e8dab9f8d09478798859667882839b -f8ecd8f6d8c89897a8696f7ab9b6c0f8ecd8e9e7d7ac99a78f8b97d8d7daf6d9d9f6d9d9b8aab7 -878283c8c9d8f6d9d9e9c8b89897a8787988b5c0d5f8ecd8c7b8b77780976877989897a8f9ebb6 -c5b699687798676a88a48899f8d094b6a7885966789897a8e6aa9defad5ea88786676a88676a88 -94788fe8bb887c62674b4b64565b77776a86c8a8866661784b59764b5976776a8639291fdb3738 -5c1e6c5415745c15745415745c15745415745c15745c2479040404 -04040464257c5c157464257c67278464257c5c24795c1c7cc3324e8524155d4c36595c5945535b -45535b675f46ab7b455c495a40474b936f72ae845dc78b4f6f596f45535b666178d2966ddf9b5a -6f596f45535b696f7ae8bb88e8bb887879884b5967787988f7c7a8f7d8b8787988616568878aa7 -f7d8b8f5eae79897a870706ad6c8d5f7c8c8f5eae7a6979870706ae8d8d8e9d8c8f5eae7b8a8a7 -616568c6c2caf6d9d9f5eae7a8a6a9616568c6c2caf8ecd8e8d8d8787988596678b8a8a7fad9a5 -e9c8b8696f7a4b5967ac99a7f8d094d7aaa7666178565b68b98680f0af71b7898f596678565b77 -ae7b74c78d61ae7b74676a884b4b647c6267a373575c495a4b5976565b685c495a39291fdb3738 -5c1e6c5415745415745415745c15745415745415745c2479040404 -04040464257c64257c64257c64257c64257c6727845c2479c3324e8524156165687879886c5456 -5c495a878283c8a67170706a815a55a37483d9b56abe8b70867389a373577a6879b6a788ae9870 -7b7779c78d6194788fb6a788b8a8a78f8b97c89887778097b8a8a7b9b7b4a48899d9b899b9b6c0 -c9a799d8c7b8c7b8b7ebdae5e6c9d9d7a899d7c8c8e7c8c8ebdae5f7c9d7c89887d6acb4f6d9d9 -e8d8d8e6c9d9d9a887d3bac4e7c8c8d8d7dab8aab7f7c7a8b8aab7b8a8a7b8a8a79897a8e9d8c8 -999cb58f8b97a6979882839be9d9a6ac99a794788f936f72787988e8bb8894788f867389776a86 -687798e8bb88c8a9a7a374836f596f676a88e8bb88676a88605170676a887879884d3d2cdb3738 -5c1e6c540b745415745c1c7c541574541574540b745c2479040404 -0404045c157464257c67278464257c64257c5c24795c2479c3324e85241551524bdac896ae845d -ab7b45ae9870ae9870d9b56aab7b45c78b4fd9b56ad9b56aefad5ec78b4fd9b56aae9870ae9870 -efad5eefad5ee8bb88c5b699c8b7a8f8d094f7bb86f7d8b8b9b7b4c7b8b7fad9a5fad9a5f7c7a8 -d6acb4d8b7a8f8d094f8ecd8e9b899e6aa9dd7a899e6b8abe9e7e8c9a799d69b98d69b98d7a899 -e9e7d7d7aaa7d7aaa7e6aa9de6b8abf8ecd8e9c8b8d8b7a8e9b899f7be9afad9a5e8dab9c7b8b7 -cac4b7f7c7a8f7c7a8e8dab9acb4acd7c8a8f7bb86f7bb86d9b888b5a898cac4a7e09e75d2966d -c9a799c5b699f8d094c78d61c78d61c8a886b6a788b6a788a37357c5b699a9a7ba472f22db3738 -5c1e6c5415745c15745415745415745415745415745c1c7c040404 -04040464257c64257c5c24795c247964257c64257c5c1c7cc3324e852415766a4d7b77796c5456 -595c59a37357ae98707a6879675f46595c59ae845dd9b56ab7898fa37357815a55ae9870b6a788 -7b7779ae7b74867389b9b7b4b6a788ac99a7d7a899a48899c7b8b7d9b899c6c2cae7c7a5c19ba5 -d8b7a8e9b899e8d8d8e9d8c8e6b8abd7a899e6aa9df5eae7f5eae7e6b8abc89997d7a899ebdae5 -f5eae7f6c5b7e6b8abe6aa9de8d8d8f6d8c8e6b8abe6b8abc8a9a7e9d8c8f6c5b7c8b7a8d8c7b8 -a9a7bad6acb4d7a899a69798b9b7b4a8a6a9b99886c898879897a8c8b688988884ae7b74be8b70 -e6b8abd9b8889888846c5456827668b5a898c5b699a5988792655fa8878682839b3d3630db3738 -6817695415745415745415745415745415745c15745c2479040404 -04040467278464257c64257c6b377964257c64257c64257cc3324e852415675f467c626740474b -40474b8c6540ab7b4561656845535b4b4b64766a4dab7b4594788f565b684b4b64ae845ddf9b5a -6f596f4b5967676a88e6aa9ddf9b5a776a86596678878283e7c7a5f0af71867389616568ac99a7 -f6d8c8f7bb86ac99a7878283e8d8d8e8dab9f6d8c8c8a9a7a48899ebdae5d7c8c8f6c5b7d8b9b7 -988884e6c9d9e8d8d8f6c5b7b8aab78f8b97e7c8c8f7c7a8e6b8ab9588a7778097b8aab7fad9a5 -c8a8866877985a688982839bf8d094a88786676a885a6889867389f0af717c6267565b778f8b97 -b7898fc78d61616568535f835a68897a6879c8a6717a68794b5976565b777a6879472f22db3738 -5c1574540b6c54157455146c54157454157455146c541574040404 -04040464257c5c157464257c64257c64257c5c1c7c5c1c7cc3324e852415675f466c5456304443 -666178a373578c654040474b51524b565b68766a4dab7b455c495a45535b605170ae845dd2966d -6661784b5967696f7ae09e75e6aa87787988595c598f8b97f7bb86e8bb88a48899616568c8b7a8 -f7be9afad9a5a69798827668f7c8c8e9c8b8f5eae79fa19a827668e8d8d8d8b9b7e9e7e8b8a8a7 -70706ad7c8c8f6d9d9f8ecd8c8a9a770706ae6b8abf7be9af6d8c88f8b97616568c9a799f7be9a -e6b8ab787988596678b98680efad93c89887596678596678ae7b74e09e75936f724b59764b5967 -7c6267ab7b455c495a596678565b77815a55a3735792655f565b68565b68815a55472415db3738 -55146c55146c5415745c1574540b7455146c5415745c1574040404 -040404641a7c64257c64257c5c15745c1c7c6414745c1574c3324e852415766a4d8276688c6540 -92655fb6a788ae98706165685c495a7c6267b99886be8b70565b68815a556f596fb6a788b5a898 -936f72ae7b7494788fc5b699b8a8a794788fc78c82ac99a7c8a886d8b9b7b89898e9b899d3bac4 -d69986d8b9b7e6b8abf7c7a8e6b8abc89887e7c8c8f6d9d9ebdae5f6d8c8be8b70d6acb4f6d8c8 -ebdae5f6d9d9d7a899d8b9b7f6c5b7e9c8b8d3bac4e6aa87d7c8c8d8b7a8c8a9a7b8aab7e9b899 -b8aab7b7898fa488999588a7e8dab9999cb586738986738982839bdad4a8747297666178605170 -676a88dac8968673896165685c495a677588e8bb889888847a6879605170677588472f22db3738 -641474540b7454157454157455146c540b745415745c2479040404 -040404641a7c641a7c64257c641a7c5c15745c15745c1574c3324e852415675f46d9b56ac78b4f -c78b4fc78d61ae9870df9b5a8c6540df9b5aae9870ae9870d9b56a8c6540c8a671b5a898b8a8a7 -e8bb88c78d61e7c7a5b9b7b4c8a9a7e8bb88e09e75e9b899d8c7b8d8b7a8f7be9af7be9ad7a899 -d7a899d7aaa7e6aa87e9b899c89887d7a899c78c82d9b899e7c8c8b98680c89997c89997c8a886 -e8d8d8c89887d7aaa7d69b98d9a887f7c7a8d7a899e6b8abd7aaa7efad93f7c7a8e6b8abd8b9b7 -e6b8abf7bb86f7c7a8e9d8c8b9b6c0d3bac4d7a899e9b899d8c7b8b9b7b4d7c8a8be8b70c78d61 -c5b699b5a898d9b899ae845dae845dc8a886b5a898dac896be8b70d2966d98888439291fdb3738 -681769541574541574540b6c54157455146c5415745c2479040404 -040404641a7c64257c641a7c64257c64257c641c745c1574c3324e852415766a4d988884827668 -675f468c6540d9b56a8276686c5456595c59827668c8a6716f596f595c59666178a8a6a9b6a788 -7472977c62677a6879c7b8b7b5a8989588a7b98680a88786d7aaa7e8bb88d3bac4d9b899d7a899 -d7aaa7d7a899f6d9d9f7c7a8e6b8abc89887e6b8abe8d8d8faecc9e9d8c8b99886d8b7a8e9e7e8 -f6d8c8e6b8abc89997e6aa9df6d9d9f6c5b7e6b8abd7aaa7d8b9b7e9c8b8e9b899d8b9b7e9c8b8 -c8b7a8c19ba5d69986b8a8a7d7c8c8a9a7baa88786ae7b74b5a898cbcdc0999cb57c6267827668 -9fa19ac5b69998888492655fa37483c7b8b7d9b888936f72ae7b74c9a799a59887472f22db3738 -55146c540b745c1574541574540b6c5415745415745c1c7c040404 -040404641a7c64257c641c7464257c641a7c5c147c5c1c7cc3324e852415675f46a37357304443 -3044438c6540ab7b45815a5545535b40474b815a55ab7b454b4b6445535b4b4b64766a4da37357 -6051704b59677a6879ae845dca83777879884b5967988884e09e75e09e75a48899616568c8a9a7 -e6b8abf7bb86b5a8987b7779e9d8c8e9b899f7be9aa6979882839bf5eae7e9c8b8f6d8c8c6c2ca -7b7779e9c8b8e9b899f7c7a8c8b7a8878283f7c8c8e6aa9df7be9aa48899787988d6acb4efad93 -d88e7d82839b677588a48899e9b899ae7b745a68895966787a6879b6a7886165685a6889565b77 -605170c8a6716f596f4b5976677588ae7b74d9a88770706a45535b778097a37483472f22db3738 -55146c54157454157455146c5415745415745c15745c2479040404 -0404045c1c7c64257c64257c641a7c5c15745c1c7c5c1574c3324e8524158c65405d4c36302f2a -7c6267ae9870df9b5a6c545651524b4b4b64878283c8a671565b77565b68565b77ae9870b5a898 -666178616568787988d9b56ad8b7a88673897b7779b89898d9b888d9b899b5a898878283d8b7a8 -f7bb86f7c7a8d7aaa7988884f6c5b7d9a887e9d8c8b8a8a7878283f5eae7d8b7a8e9e7e8cbcdc0 -878283e9d8c8e6aa87e8dab9c8a9a7988884f6c5b7e9b899f6c5b7ac99a7787988d7a899e8bb88 -d7a8998f8b97696f7ab7898fd9b888b98680696f7a677588867389b99886616568535f83535f83 -616568b998866f596f4b59764b59677a6879d2966dae7b7445535b40474ba373574d3d2cdb3738 -55146c541574540b6c5415745c157454157455146c64257c040404 -0404045c1574641a7c641a7c5c1c7c641a7c5c15745c1574c3324e8524154d3d2c766a4dab7b45 -a373578276688276688276688c65407c62678782839fa19a8782835d4c368782839fa19a9fa19a -8782838c6540878283b5a898b8a8a7ae9870ae845db8a8a7b8a8a7c7b8b7c9a799d88e7dd8b9b7 -c8a886c7b8b7e6b8abe9b899d8b7a8c78c82cbcdc0e8dab9e8dab9e8d8d8b99886d7c8c8e9d8c8 -e8dab9e8d8d8c9a799d8b9b7f6c5b7e9c8b8f7c8c8d7a899d8b9b7efad93d7a899d8b9b7e7c7a5 -d7c8c8c89997b7898fb8a8a7e9d9a6a9a7baa374838673899897a8d9d5b87887a86661786f596f -878aa7d8c7b87780977a68797c6267867389d9b888a48899a374835d4c36595c594d3d2cdb3738 -641c745415745415745415745415745c15745415745c2479040404 -0404045c147c5c1574641a7c641a7c641a7c5c1c7c5c1c7cc3324ea8291639291f472f22472415 -472415472415472415472415472415472415472f22472415472f22472f22472f22472f22472f22 -47241547241547241539291f47241547241539291f39291f472f22472f2247241547241539291f -39291f47241539291f472f223d3630472f2239291f472f224d3d2c4d3d2c3d36303d3630472415 -4d3d2c3d3630472f22302f2a472f22472f223d36304d3d2c4d3d2c4d3d2c4d3d2c3d36303d3630 -4d3d2c4d3d2c4d3d2c46423b46423b46423b472f223d363046423b46423b46423b4d3d2c46423b -40474b3d36304d3d2c472f224d3d2c46423b46423b46423b4d3d2c46423b19271c472415db3738 -641c745415745415745415745415745415745415745c1574040404 -040404641474641474641a7c5c1c7c641a7c641a7c5c1c7cb0254edb3738cd342acd342acd342a -cd342acd342acd342acd342acd342acd342acd342acd342acd342adb3738cd342adb3738cd342a -cd342acd342acd342acd342acd342acd342acd342adb3738cd342adb3738cd342acd342acd342a -cd342acd342acd342acd342acd342acd342acd342acd342adb3738cd342acd342acd342acd342a -cd342acd342acd342acd342acd342acd342acd342acd342ab63024cd342ab63024cd342acd342a -cd342acd342acd342acd342acd342acd342ab63024b63024b63024b63024b63024b63024b63024 -b63024b63024b63024b63024b63024b63024b63024b63024b63024a82916b63024cd342adb3738 -55146c5415745c157454157454157455146c541574541c6c040404 -0404045c147c5c1c7c5c1c7c641a7c641a7c641a7c5c1c7c641c74641c74681769641474681769 -681769681769681769681769681769681769681769681769681769681769681769681769681769 -6817696817695c1464681769660b656817696f175c781a666817696817696817696f175c681769 -6f175c681769681769781a66781a66792666781a667926666a2976681769781a666f175c6f175c -6f175c781a66781a66781a666f175c781a66781a66792666872164781a6687216479266681205c -781a667926668a2f627926667926668721648721648a2f6281205c8d1d5c8721648d1d5c872164 -8721648a2f628721648d1d5c87216487216499275e8721648d1d5c8721648d1d5c8d1d5c872164 -55146c5415745415745c15745415745415745415745c2479040404 -0404045c15745c1574641a7c641a7c5c1c7c5c147c5c1574641a7c5c147c5c0c735c0c735c0c73 -540c7c5c0c73540b745c0c735c0c73540b74540b74540b74540b74540b745c0c735c0c735c0c73 -5c15745c15745c1574540b745c0c735c147c5c147c54157454157455146c5c0c735c1574541574 -540b74540b74540b6c540b744c1575540b74540b745415745c1574540b6c541574541574541574 -540b74540b74540b74540b74540c7c540b74541574540b74541574540b74540b74540b744c0b74 -5415744c157554147c54157454147c4c0b744c1575541c7c5415744c15754c0b744c0b744c1575 -4c0b744c15754c15754c15754c0b744c15754c0b744c0b744c1575540b744c0b744c0b7454147c -54157455146c5415745415745c157454157455146c5c1c7c040404 -040404641a7c641a7c641a7c641a7c641a7c5c15745c147c5c147c5c15745c0c735c15745c0c73 -540b6c5c0c735c1574540b745c15745c15745c15745c0c73540b6c5c0c735c0c73540b74540b74 -5c0c735c1574540b74540b6c5c15745c157455146c5c1e6c5c15745c157455146c5415745c0c73 -5c15745c15745415745c15745c1574540b6c55146c5c24795c24795c15745c15745c157455146c -541574540b6c540b745415745c1574540b74540b74541574540b745c15745415745415745c1574 -55146c540b745c157455146c54157455146c54157454157454157454157455146c541574540b6c -5415745415745c1c7c54157455146c54157454157454157454157455146c540b6c55146c541574 -541574541574541574541c7c54157455146c5415745c2479040404 -040404641a7c641a7c5c147c5c1c7c5c147c5c15745c15745c147c5415745c0c735c15745c0c73 -540b745c1574540b745c0c735c1574540b6c540b6c540b6c5c0c73540b74540b6c5c1574540b6c -5415745c1574540b6c5c0c735c1574540b6c55146c5c24795c15745c15745c0c735c0c73540b6c -5c15745c15745c15745c15745c157455146c5c15745c24795415745c15745415745c15745c1574 -541574540b6c55146c540b74540b6c540b745c15745c0c73540b74540b6c540b6c540b6c541574 -541574540b6c540b6c540b6c54157455146c5415745415745415745c157455146c540b6c541574 -54157455146c5415745415744c157554157455146c541574540b6c4c086c540b6c4c1575541574 -5415745415745415745415745415745415745415745c1574040404 -0404045c1c7c5c147c5c15746414745c15745c15745c15745c147c5c15745c0c735c1574540b74 -540b6c5c1574540b6c5c0c73540b745c157455146c5c0c73540b6c5c15745c0c735c0c73540b6c -5c15745c1574540b6c5c1574540b6c540b6c5c15745c1e6c55146c540b6c55146c5c1574500464 -540b7455146c5c15745c0c735c1574540b74540b6c5415745415745c15745415745415745c1574 -5415745c1574540b74540b6c540b745c15745c1574541574540b6c55146c540b7455146c540b6c -540b6c540b6c4c1575540b6c541574541574540b6c540b6c55146c541574540b7455146c4c146c -54157455146c54157454157455146c55146c541574540b6c55146c540b6c541574541574541574 -54157454157454157454157455146c5415745415745c2479040404 -0404045c1574641a7c641a7c641a7c6414746414745c147c5c15745c15745c15745c0c735c1574 -5c0c735c0c735c0c735c15745c15745c15745c15745c15745c0c73540b745c1574540b6c5c0c73 -5415745c0c7355146c540b74540b6c540b6c540b74540b6c5415745c15745415745c15745c0c73 -540b6c540b74540b6c540b6c540b6c55146c540b6c540b6c5c1574541574540b6c5c157455146c -540b6c5415745c15745c1574541574540b745c15745c15745c0c73540b6c540b6c540b6c540b6c -54157455146c5c157454157454157455146c540b6c540b6c5c157454157455146c541574541574 -540b6c4c1575541574541574540b6c541574540b6c4c086c54157455146c4c1575541574541574 -5415745415745415745415745415745415745415745c2479040404 -040404641a7c641a7c5c1c7c641a7c5c147c5c147c5c15745c15745c15745c0c735c1574641474 -5c1574540b6c5c1574540b74540b6c5c15745c15745c15745c0c73540b6c540b745415745c1574 -5c15745c15745c0c73540b6c5c15745c1574540b6c5c15745c15745c1574541574540b74540b6c -5c157455146c540b74540b6c540b6c5c1574540b6c540b745c15745c15745c1574541574541574 -5c15745415745415745c15745415745415745c1574540b745c15745415745c1574541574541574 -54157455146c5c2479541574541c6c541574540b6c540b6c541574541574541574541574541574 -5415745415745c157455146c541574541574541574540b74540b6c55146c5c2479541574541574 -54157454157454157454157454157454157454157464257c040404 -0404045c15745c147c5c15745c1c7c6414745c15745c1574641a7c5c1574540b745c15745c1574 -5c15745c0c735c157455146c5c1574540b6c540b745c1574540b6c5c0c735c1574540b6c541574 -5c15745c15745415745c157455146c5c1574540b7455146c5c15745415745c1574540b6c55146c -64147455146c540b6c55146c5415745c1574540b6c5c157455146c540b74540b6c541574541574 -5c15745c15745415745415745c15745c1574540b74540b6c540b74540b6c5c0c7355146c541574 -541574541574541574541c6c5415745c1574540b74540b6c54157455146c5415745415744c086c -55146c5415745415744c157555146c5415745c15744c0b74540b6c541574541574541574541574 -5c24795415745415745c2479541574541c7c5c15745c2479040404 -0404045c15745c15745c15746414745c1c7c6414745c0c7c64257c5c15745c0c735c0c73540b74 -540b745c15745c15745c15745c15745c157455146c540b745c15745c15745c1574540b6c5c0c73 -5c15745c15745c1574540b6c540b6c5c1574540b6c540b6c5415745c15745c1574540b6c540b74 -55146c540b6c55146c540b6c540b6c5c15745c15745c1574540b6c5c15745c1574540b6c540b6c -5c15745c157455146c55146c5c157455146c5c15745c15745c15745415745c15745415745c1574 -5c15745c15745415744c146c541574541c6c541574540b6c4c086c55146c540b6c54157455146c -4c086c55146c540b6c55146c540b6c54157455146c540b6c55146c540b6c541574541574541574 -5415745415745415745415745415745415745415745c2479040404 -0404045c0c735c147c5c15745c147c641a7c641a7c5c0c735c15745c1574540b74540b6c5c1574 -5c1574540b745c15745c1574540b745c15745c1574540b6c540b6c5c15745c1574540b745c1574 -5c15745c15745c1574540b74540b6c540b74540b6c5415745c0c735415745c1574540b6c540b6c -540b74540b6c540b7455146c540b6c5c1574541574540b6c540b6c540b6c5c1574540b6c540b6c -5c15745c1574541574540b6c540b745c1574540b6c5c1574540b6c55146c540b74541574541574 -5415745415745415745415745c15745415745c1574541574541574541574540b6c55146c540b74 -540b6c4c086c541574541574540b6c4c086c5415745415744c146c540b7455146c4c146c541574 -5415745415745c1c7c5415745415745415745415745c2479040404 -0404045c0c735c1574641a7c6414745c147c5c15745c0c735c24795c0c735c0c735c0c735c1574 -5c1574540b745c0c73540b74540b6c5c1574540b6c5415745c15745415745c157455146c540b6c -5c15745415745c1574540b6c540b6c540b6c5c15745415745c15745c15745c157455146c5c1574 -5c15745c15745c1574540b6c5c0c73541574540b6c5c1574540b6c540b7455146c5415745c1574 -540b74541574540b6c540b74540b6c55146c540b745c1574540b6c54157455146c5c1574541574 -55146c55146c5415745c15745415744c146c541574541574540b6c540b6c540b6c54157455146c -4c086c55146c540b6c540b7455146c54157455146c4c15754c146c55146c4c1575541574541574 -5415745415745415745415745415745c15745415745c2479040404 -0404045c15746414745c1c7c641a7c641a7c5c15745c15745c15745c15745c0c735c15745c1574 -5c15745c0c73540b745c0c735c0c735c0c735c0c73540b6c5c15745c15745c0c735415745c1574 -5415745c1574541574540b745004645c0c73540b6c540b745c15745c1574540b6c5415745c0c73 -5415745c0c73540b74540b6c55146c540b6c55146c5c0c73540b6c5415745c0c7355146c540b74 -540b6c540b745c0c7355146c540b745c1574540b6c540b6c540b6c540b6c540b74541574540b6c -540b6c540b6c5415745c15745415744c1575540b6c55146c540b6c4c146c540b7455146c4c086c -55146c5415744c086c540b6c55146c540b745415744c146c541574541574541574541574541574 -54157454157455146c5415745415745415745415745c1574040404 -040404641a7c641a7c5c1574641a7c641a7c5c147c5c0c735c147c5c147c5c15745415745c1574 -540b74541574540b745c15745415745c0c73540b6c540b745415745c15745c15745c1574541574 -5c15745415745c15745c0c735c0c73540b74540b6c5c15745c15745c1574540b6c540b6c540b6c -540b6c540b74540b6c540b6c540b6c540b6c540b74540b6c540b6c540b6c540b745c157455146c -540b74540b6c540b6c540b74540b6c540b74540b6c5c1574540b74540b74540b6c540b6c540b6c -541574540b6c55146c4c146c541574541574541574541574540b6c540b6c55146c4c086c55146c -540b74540b6c5415744c086c540b7455146c540b6c541574540b6c55146c4c086c55146c4c146c -55146c4c157555146c5415745415745415745415745c2479040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404040404040404040404040404 -040404040404040404040404040404040404040404040404040404 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/algor.gif b/Docs/Books/algor.gif deleted file mode 100644 index 6b640dee39cd9434c496d9e7b13955cee01abe19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15001 zcmWk#2U}B1*F7h_CqU@!P=tUAp$7py1Vj+TfT#$lp$9|>iU^8&l8}O;#tw=aii-6H zM8tA^LywBrh^W{@QDTqERcx2fZ+^gj_A`6-npu0TnHLkq2~N)f4gue$fG0tm69=pJ z7OpKwT5_p!SC?;mc}DJov#oNmiK? zoBaCi^|)bI_^NH*8Lw_U+F_s8sHhP^X>T9DlsjdetvOldmQ!e%CSS0z)Fx+N>8>nB zT3SrX2EVoKr!PIw-rp!FQ>4ms$k~O<3jclkufQ@dZ`!If3_p#MRlqDxV`gm#EiaE1 z%hpw6cE=V&kUd$}WvMEo) zl&4Y3v!<0Nk^jUgPqHh>b+1Uml*bVY((KBcPMk`jlqZ=Nr@5BJk&EM)1xd{EIP>*M zcIEs8VQ=Tn4f(SDij%vx9~^r4_;Q;jC%yF4$t%?dn~K*SjE&6_OAeQoDYQ3+-n{*q zo3D^>J6ThEaY^cim8%XeS}AF2zLCEEgyKN^2ISz9RKcn(XHo=}n|8DcHdL3&n_`!h zY}A;=Zt@p9GQ!&3 zPNi0zZ9TgzZ5h*!(f^?LSlyw|6K`(a)+8jx3WfQP2b&(lZu|Un)B7dC~nBt zzVaWBj!(WD(w-=q)a`rJuDE=ub$MLi@oM?Ub1N=3RiD{3*Kk!KE)n!?U$`J_hPFvI z-go@lQ2UF+DOK69@voxu70bU}l|5>&c|D{J3uJ3AH4XK(_w7g@II!AycJreqx&G+- zU=PP{*AKmJuld&3)Ua;ptJCt!)v|fs&eyjKzYb}KE;YT@w$F1l|9EcijgvLnYWag2 z*~6xqmxtwFdoI0dKlAUK@oGiI(9X@TP9M1`+0a)dZt}2@x|;9FUU_~~u_$HnWf{`O zcD?QI`QUK%!_z0Vr%n!CzSQ1yvakJ;w&q}yT=q??ZLh8#*J{5$dSn>eeRTRx|;);i~f`)l}ps-ou&^<+p8xG-d z8BE_uMc@7y1^=DsQ^uY{UVBT+JzOgnRHJ*>Ig_BMoPlRQ%VEB75oNmzI5#-f$h zFSw0{eVQnxt9445PQIr1TKvpF_KO~>Q94IeJmG|3SDQmcLF*<>i zaw+r3Qxmv~7PYO=!x#Rd_mfT&IOgwjj-oaPSw=LboqBkq)7&{xp`tCwiXLJIL ze6rs={NQgk+>OBaQyo{)hn-x%-u#Q@=QcI;`PBl2e_=i5`#RRz=d+e?yhgltYM*OF zZOc^gZ*T1mmnG-6jCDk0zW-|b$i2D4e&gQ1Y=gF3Z2B@%ymw|o?xOh-43i4x%$TBt zg<-4lNr{o&t`%`jbxWA}sAbvDO=fkst=JSg1Y|HmRfFhFPc9y;FmtPKyl3J-9XE;m z=XGQ^{aY)9B7|TULs4AnT&#Iif=`k%{Jg*^;Z%&1GIB0dBr$EhA638q-EKkTYQm3+ zr%~3&8zW7-cfVdNA+MM)kGkWd9hhHmWny`Skhb5(guA?%xhVcW^tAo+Yjfu^D;!Lu z3oA??N1Dmq(xr8k&Kp_g^BHflO%s^eQgedr0LEMrl`dVhgrDAHHkW$&^~r;@*JkGN zX;VIpXJgVnG4o^7C+{#8as8*^UMF=`dEK~HPx8CuDk07O3-~hM6V&ga__qv+xBKe& zUvB%~Vt-i>db{A>?XYjf7w93+R1vpk8&snUf^_9BciQeKB-FrraeH@!oq!wSym?vm z+x)wg>#71UZ_T#*-V|nPL#)zF9K>^pjgclHaXyhI3nPs?{ninhE zLDrg#cni~~Uv33&B_v9G2b4})QYQr>*t&AQ(D0^Tf_wIcggV`2EDSaN<2go{f?$0A zpeEi6>~_WnP?atu$HB-8RlX|)>GIiqPt(OV=}OZ+>y3i+g^rslh8KDkzB7@}Y3Xj3 zI~;&N_gZEn&QXrG9OJFPVd1?V4?>n|p><;xgbK;mnZf9H#cEQh@JpqBujskD==tlj zi93D!4U0bbb`Nzf0FDcswtMhOoAJzlVJ^tz4Yl+_zmP@ofg;83`JS6G1AT6C<8Ny2z_q)pd`?M@^ij&bSaq~r|7fgy|wyMws3yu)GCs_$?0 z-CY?^GabG(jRt=RM+)~zfL>%C<0iFnQz5Qva>-vTa`{XDOTCu2Vin_%b``cMCXzVTyW55dm2N` znB?KC2nqQ7Unt7D>aOX@B4kc+x^)Kw@7S-~7XNgZUaEq9jDTWx`-o{a(CrYldq+TZ z9etFAb$G+TFD)OY zZJjg@Mwy;qOKaj$%+7YHXHwC&RKp1KWK&PJd+PQSy|Z~A(!(xyB5!J~H^0jP0{O!v zLG`HZhzbZAG1*l(#pgPFX3IHgyQu~6sP#D(_J8#zI}+JqW|vjejDp>jIsP-u)zMMD zrB3tn8l5Q~|Asqm|BMlZhBwdEJYnRJs+I{lfzy*cfLk~Yb4^TL$Cr2(G%xb2McD=@ zk-i!9%i`$K>aiuJor@dciY4Ygf+-pt76Cg;rGe*|`Kh&C)KKaVnrce&JL(9aL&_(wi&5Pv0v&w-qF zZr^v|g#YE51^FBI9(k5@GVp$-o63TesPDJ0pHaq*QQV|%V@r)(SL_EPsZyY~py?v# z@LQs*^>GqhE8rTz5PAIbNeo@;#TV=$E=+4t1y2E(0?z>D2Y)9U1%$R1z@*8h>0hd9 zh<_^(lbvjgCr0HTPq>Bm)luma`DW*IfVqsf4U=^an`s(8ovW@~-O48(XZ4ZyK;rmF z4Y6;imoN}UG3V6jZ3Hl(7BFHaU{aVt<2M_YZlTuV(srYEA6HiAw4j#2jwGuxwtuTzhGkjSLhHvD`QuAb(d;qlVMu8 zLb*W3mLBpW!1_E|RFmFrwr}*HP-b@Q<5?S#rabe^5^hZS`e{yD_ej^4UrQUgWryyJ zyTe;hHD{jh9fw_S4<}R(Y~r4D!{>3gH0C6nH@fz8{#t4j_D*>rcY%Bcn({sww48BQ z1|q}M{Z?pFqzapsrLm{MI4^_Gj$B=)?RN%s7)c$~5zoW)FB;-?J!yys4>M?AA=(I= zI>IAOr~rcs&UW5ih98uMzO0 zl=Rgeu9%2zi11Os=Mfdh>pDm5-Z2jl^y05yuL0@``#0ydBXQ&>vuG6=ud zNITKNj1PCPiGRJN8*p*~Zm4~;G_;F+KnkI5Gbro#aXJJRYKT2*9AAew)6o~+$JZj1^%~rAfUH&G@|0i~K($t4Sq#dg z9=DZ;z6Swij2+S@aC2)`TdrvkKPcGNiAp7L!G7w$2<0x%o1~$>)KI>tNgwrK?Pn(Q-e#WZda{wWmrWgnsrROgq!EN( zx{sQI0NF78x+Y<*kxj z143M>$7M;0TY#vG(clJv5amaBKSqC~qg%tYS31fg9WV*d{sHI?%FSEGmM3&h58`8I zwvw;&=@SU$0fYJlqD|%!D9rXc&@@T4)+RY~Q2r2)R$JFm5O7w9r z8T1qlwLXiq#Yi};CLYk^KPpHoRM_V{njWJ4=Eb(@h`Wv0J~gq24bnDJ&a-I~Lg2HS zdRHI*iA{Z_0=!?L9$jLtJdy0lT<;e^ey1Z;@Ts>UV22TZn@t(x6Se}Rvk)NV(XR`s z8EoQOJ?T6TCq?kJ8e%Dru#pW)g!uSD`WCpch(X*9;l--$Oe0>Z!q%!mgpJSDlO95# zl#zlLW;_M>TaEY+Z0ZLi-c<8v#{uV?i4TgofzcaT{)_5#*u6SJD?&2W(dr=JGz4}c zO&vz+^C^B)69eehVegybdf@OrA|eQtWnd>MiN~4z#yNx zPPwItPey5I&Pvk15XztfufcQ|EVztCy9?1?b<%Bx)CWS~p&I;Uq)sqsj{xwVo<78; zy8%=;7_io0k3;eR9_|w!w~Qwb(4R#R@)$#bC=-M9_9kmjPN^^w*XR&6dZrLPQ{8O$ zq}kyK%2$W-)S(<1D7&Aa>(yo_2FgLx60Acx8A0ExEk0LU9Hum&lLmB9fiqTt4#Ep| ze9#5~?cmn%)K)tUXo9p_!L1f8S*B#@S*b(se3w&r$OHvVbK1P-fyZEwlU3ctv{dNa zU7Lj`au&+6;}0?~`)=~xZNm>aBK=A?fF|481eLGMa}#Y>gquO2eV5!Uycb$|*KI|j zdsw>Jn$KplJ8Zq0P2-Ks>CUeA+LoVkVnhf9*Xo_1mP_d<(*W=ax5TdKfSWL}SWGrk zeKk4q08)l9)mKeRxlEIv%r;Bg^RjiG5N4K9Fi~gcj5578Y`$ZuZ9tu==k8*QVd!p2 z-mKmB#j-2w+H$#|L%Ga7p(M9$DdvpDIzNDVWJ*YzFu}aGD9jo_$207lMlPui+lMI8 z@jSX(g-Ya+#?@wL-%j%v6%Bnd2{X-}!$ubjxV%WfMyN4M`SiPb@bzH~4512^`b-HO z*c&kVUUFeF5%>g7-1Y!eF`HIX{6@Hv3y@`M%;mWW5c z{z{ptvpv2WJOWd!d8qkL*nibUk$n0S6)Fi>OGL6Gg%;)r7CTaWdf3BS?7%UigV|^w z24)_D@l&Gb@KAFQjE9Cwh0*@{E}|Okp+uoV(SAm>zw!FoIJ6`jz2O%+T#5Ej_2s9b zrom_r02R*fmCispPbpC|HTHhSUI;)b<1mYiyDSzh%69WKXh_8qpj>PW77S^O-ZgY9m6 zydNz;fo{QNt$s*`cyy}T-dRue{&a0cr#4B6!oX;ZPWyHk^MiNi_4cwM6L-u~aNch8 z5FZ@z`8&y?|BB(2wNv97JDBlr1T_n9Z} zeynr)IP7rXQW?})wshS2S3pZXgt_m78` zZ#Z+wh3o8GU*`ACWPDTk&-5$nW#v}k(+UsRQ|g%k;`aG+cQ2y3Av7n`EzIA2l_S?V z%Xyvcd%NJE^25v9-^I4)ggsdIwQaUfanN06t%cd{5KK!3Q*2?j&~%#jai`bmCdRsc zn4?X%z}+8Y)1$+KtA zr_Mdo+dm%(dp>6W{I!ZUe&o5~H|-<{0tLO3MFK^nDEAB|`oT z6DRnzzu9zC9sLE5@*f16wbOBdqDM-wTu8sArjI_rvN(SIG5LE`_3iQMQ7$sHWCv}wR8sDcn3jWE` zE+xp~qkgg}eK75(a(n^-eyXrp3P8AzN`pX#j(mrmPMZSAFVxuedRqg41bDtfsuPI-uXiJ4ls$}V@&{hFF**5ru_wp2Q-ww)Yx|rAhJ1$ z00O@*B4oI*$^jBE>yM{FDBVbT#(5#~jE&=^ET@yQ$hp^fRVZGV!3 z0LpA`ef&eOnyJdzlZQ$-2cegW}HgS~Ji_lGB;yX5V z3?^*VQPl{rj)yDG=)Z*2T$u22Ay^6#N&$uh)$v`@x9eC) z**nT-Zf?9?oa9Zlb?cqQe+O^ol%49zxx>oZIyAUSO646Ydvd*weed>A2z{xHV&Xja zrgH1lQD)iN(Hmyd$pi0w`}z-aR(-x+6at^^vShh!JXO}v$86#h8euTt6?x9Omy>^= z%8Y$*WOlLZ>iW!+R1a2O>sUzcnuuc|DyZjfeczsQVVg#>&TM!UX;n642tWMrc5VCW z&s81d^m{G0Yv-<^Jo+A4sf%ekXKeaV-E{c}if`(v`3X&}9($)p_FPx4eL3GQFyq&@qP-iuZNpIC z{@EOHvakg|BSt~F>@m%Kk8?!nXUsFIW$T)=&2F}YE8!;(XZ#pGVY}wXBYkz@&QBwh zP49eqcKKzU$~Bw0Gkk9K+~>N!L+d`2jdBtKAB~b1z1i)m^llv*Gnvz>>2=tuQ_VYC z_9J~5Su;|1(y{Dmjl12x$btV2_aUxjy9MLN_?Gl@=yG#Gy)(y))M7ffB)_lFs~ z>`eTni=fYJv38}f;#Ik5JX1SJ( z{;B6^lH%BPFuIac{Q4ctylrWn*7iAdW)JX5@hQ@aI{bENb zXFJycjPS43kZJILM#)|(Fr0~AdVV*6EmBoRp}^}kXQi%dY`E7w)(#ZnT}^xIk>Z?B zz4rM#6J)k)uc&it02C{Nyz-_}veV47BVtEj;;HU`$laB4N1w+{G+KzEJQj%!|Z9JkGXv-_oW0ER+(UQW%5-e$acl5b_?fdzq|G8l_I zCo+|BBu7_MUV+m|t1VxTp4eC93qG}6YIAVz(nYOm_uAZRwSBfZiOaC7X3QYB^I2t& z)7__At#Lh&wIaCJf_Er=?wVxT_ahcdl25%nxKeD5wa}yvH}35WsewZ_ZA%{xO`L!E z9CsM7zT!!TtPP-oT3kQF9r z$?lV~Iln-c0vMufN{;Y3@Kwes=Teqyrs}Yz7hWA={Rmv zhvg^(JuP0js|bUb{$}-Z-h>lo8Z+&9aO3nJ>9RRWSKD$%B%bd?XZLs5cR)z=&~8de zqlki2;)tKwcvB72 zySFbrt1{suD9>I#z#QtbNE6~`kBP_x#;EQ5VR`UXr=44>>a7O(w*$J1=9tJ8-iY< z-b54lYU5=b z6q^eiZMeZ_bLKU@(W30?tOM)zWK+gn$G`VJJ^opI+%DVW*h7`|iNg5)a)}Eixj#nV zaX9^H=76tt?`f&uhQji^*wi1lYaV<#9<%B-=#pcd>F{It{pO?w}_fL@94=<&JeO#J; z_=l)j?k-f7>R8#)^ZvDglzn=ZOGxMpW_(GeO^UsA7uM1v#Jhbdi zD)HKUT=V#^s64_Ghxb$YD}TMWC3N6+9QALAjWttjU(!2&QrIDlO9^Ut@~k$#<-!>| zwo`F3X)`X^9AUp?Su*ugoX#`gjFe5ST=co+=TIpfpgic%gKIl{@{TZol>$B9L(oBw z6796SR)W9t@_Sd^@|2DLt06S}fK6-JDb878Z_}1@!!|mJt#vTwIA@-`QuD?o@-=Qg zK|I@3NJ%b7-iK-7>0Ac3IY@>1bL>qLAyoZGKF&`YPMU8-Gqfs)JHif{_9)r}0r(3i zJBB-GXtzcHqw^{!h3Y;Y9@Afp)^;!w+35U`tGI?}z`XTng~vPoY;{QI8f6+)MB7|kkMcLd&t|GCb6Zt}1Dd&n^GeZ3 z$gtHpBVrbv0lF8f%q`UOg2lDSB5ECJXbNE}!R^%wKGU2(;M3^+g1X7OVnB3py4Xbv z6lz3v8j+&`BZLBCNg@g&!!bmpAyK>lXWlMy<;e1M@>~KKcqW9#k*zKT9o3jZp2(FU z8rdt3LvYrrtM3|6maV|OTfibi1xC=)vkLT7%U2_yy9#`8b(VAT-)s5P&V`=`uYvYj z5Icz}F(Q$NMP-JHH2_#(HG9eho7hyb2>@du9D@K9vqW)L*KM_;sRjCQl%b+ffFvR^ zk^!`g18me4E1D2Ts4}F#D+!icGem_($R*nU{x;OIs~2g>v+YJZ0uK8-$D-QyUP_+0{9puJ;BwJh@m)bLOnnn$TVAzPBHz0op9#B7n3wW4Sn4v4J){wi z%^b9u8GAvLHh9QgskUusduV#@2Px3gr73;8R{1l?>x{FgxpJDK_u?XdVbVey7X{UCq29sBv3$sPJz7^T2KugBVap#tsdt*PDR?~0Iday_A$neQL<8A74G2Q?C z_#V2GIGvTUkKcph!){A@iq*E z0^?ED5talb_#Nn>m#qLqJ!jP)PZJa028G{azoMX6u5x)&>26Af;L<#j(nkJ4^OR+x>|wR`Bhjw�d-S3+ zyFBNMJtt2?)jXoTnz+7MO7=Ts=I4{j*&li7K}N{_0>8k$^OPa#e;Y-P{ARbSH}YIi zPET&7mA9Swa!L92k`wjT)Kb5>i8FeZ`Ek~)^KsAik6PDE3hf+q(_hv1=5%SFQ(B7bs_dbd$pC9cP_6){s>%UMHaxrW4 zLKwMv%(t2qo>;kR&@!{t{NAFp?w&8Ee$J^r^67yuNT?rsnh(Q4K@CCrSpnZiJxj~m zux36IU#mRKg}VdM-l>BIJ9S~|z>(?gse2b+p5Z6i-u_{mnuK1WDE7)Y6XULD7uiRR zrR+ao%UNoxF1gkllRe?ITeqRMUGJhps3=30&y>r|*kI`u7pqHByP2ZAn5g4HvWdmtqvvHxw37RtA7-(B zaL!-os&|J`OFO)(&Mm7vbM7eG&+l+$D6c3pG!^wHgfCLa%3wqY$qsXYvLRfK z7MQICa@06xlVqj=hZdp(wWt*gAP|y(JX{HYUI54zv!0*pY9szzM$ALNpRGLW2P ze7GJBwqqAED&{1Ec>+1N8a)M0X45mz|4e>!L?3}coyDH9YGLKwG^C41kDkJnc$1dbI^U}1P!X(_t%L=E2HX+>Aa}zpfq`%x zez}h*SSi_}#{_UJrbv2BSgC?&g$V&99KK@PF0{V_6AB&N(Ilx7Vk`BMFr#!80jbEv z7VssZ>c%y~KfNT%6UygAOK{ayH%q-2{*q(1qAF^{&yH5CiN+~{aVZAeW&`5sj$;W= z128Tc#wH-*)t_bA1U!j=P94I886~raFj2{pFoR?xTN*^Dn61SuGf2W2=)X(RB(0o3 zDci#N)8wAZbf^Fhc5M@W6GKws4wM;y3?8t-YTshP`mJUf1U>y&skrS^x1L#D9n5M`1z__HHa$1uO`V>AwRrP~++5L58jly(>c0)FV2csPe zlz<;!mbV88*3*0pU*=h1XH80GwO6caN6$9OH)~{DnnWQ0!8=7iSoej+2WS(c70dE!#4CI6LNFJjFa2f2v?}z5bka`#Se+b@LbJ z^ZtxA+0@fn)9Jb zy;ckQ%i~pH8!)elV|ZnS-`9A!=3d`^OL*&ZVJC*Q0E&0-HwG82K1Lu;v{jx7k3Z@I zIGrb)3a-$a)y}PEmJO_o5nNzhpm;rNzqeqzmSwyh^t-g7 zln#qXuAA(5{{;QKmVonYRW#!<&r2`daTsgl-f|L6gp-&nDFb+4H-V3WIK zaNuw4=+4kPS!N3Z_AXDqmmR^cbId(rUKh!`P!ZAZKay-VwPVhR?jAKv^Bui|xT&HJ z%PN`>^;zy8GQm5zHKO`#N88QlHu=mwq+sbp2Wl4bH5|{%81gwejie)eb51GTlf z4jb*e3o?h|jp29)q1_19Zo{uS>C8%lND%@;8BxxA2D_qcijkA zAn1iILNw=d|L879t)0tui!ISDM3+79b`w2M51CHMLO!TnG`1(2I%7RW)fqS4wopcP zg`J>`U<2o7cJ4wse7koi?3=0qi+RU_slFz?54orPOp5N!30r?6(j*bXp*UTR+`Axf zud?gTZ1={f4o+@+R0p)G|5cjZ27CtIsp#5Wxpl>aNw4ijf9F2iO*onxB?YjHovB8aHJqXUmIW0O3v@xQ*0J0fr5KHv1d&8v#{ zSXj~(H>Zd1LJvA$<=5iDEUkOsBZ|)0KJ##`&%)qOEMwHR)9eBH?3bl33!yeu#&%ax zc~P9_0m|pONx$QOv!OqE@WRkf6%nFPOt)leJLliX$~V~x-roLS4Spe|;;m{mu>M_! z^>aSXr?{D#DnwiN3jt=gO1k1~IHlCc^)Mpxkau;a8#EF2DtKF{;SaA@;>m+bJa5RE zzPVZxHqtEe{Z+?I7oZ)wdlVrxu@*&~Zrc{0U15S@%7pR{JV|Nm6cKiK9R^Ulv40x+ z{QmnM^Z)+I)hdZ)Kd;y457R7EbYXbBuF!2J@~rH7t5RNsWW>$sR^np^ z8=%$7Zd*Mf4@}E2D`SJ`f5LZd*$2{&bGnJ6x=O#MaB8|0*1g9l6_nPYLFK$kf{?y0 z$z{90Ni~x&iE*W*Pmx+NJFG6(QL^_Hx%TVuL53o#&4W=gliic*)j^Ea)z26mlKCF` zMD@->Z9HL=%m{2Ij%Q^|-(#E?tO0ix#A%qLUGt~4S`*_T7s2^5bSM2kWsfC%LRw%UL7lR4bc_15e|3e#Y>kxc{;rvrs_C>`$F{9JV?OYaBJewnSYAWu-RC-wQ!P zlErO^2JQB)<1DAN!=XeYvA@PA&eC?!j_@OGu4{IszZ)grUOhK#43bwB!?fiLiT9Pm zA{rdw=xp_IcKYShTi?O4N0wF3vJvg7`Q&Uy;LoG}@$s7QT>keLJ0j?4GbOt`oLm}> z4ftS`aWr-^Q~_=P1TTZMtxlCuryHZ2lRVFDy6yKKi8fHw-*u_@Wb zYD61l`P38VeKy>pt^KJ}_G($OefCdbIWR(kQ?V{46qp>dkBj;H?Apbfj`5HUah-saRpGx!B<3=lt^cR?4?bW* z0pljjx`tZq&JUBq_jj1@)juCnBxa8k(1pXBR7as>x*6II&-av}5KW^Er3{2*Q zPx8?IOsiM=2&bpbl#;Xx``ZGz0I%9HV@3L^&@KL^wNu+LF@2WI)4aLcgmv3fYJW2S z*Ch2_VN%6cqn@dexznGwSS}qJwK}Jd3{-?}A5+(7;BG{2S1%!SCYNqn8^|b0*VKm|BtJBZkCUv6>$I)XC*kdxVWI zKu+R!+g;Smvl)O;X;uiOUA(FtUcP}UtZ^{vk0aUiy+Gq} zHUXWdQe~S)%Lu%LU0%fzw11Uzaf(mUDbnLiwB;Yo=W8>FD;@=Y8Tzo*plEYx2j(t2 zJnW5=EaPk)8Dw?2&-&wtsRk{bn>s8$Alu9Q`Pe+oT$>gp&hH%xm>n%<9!1vvEq`)g zl$ObIWg}715#}soq)SB+2^HO7Z#V#K$rf#+mAjz7LcKV1$f&OzwSA?p<$U{?v8OknTtTR>DIZGd5onQ6xV52(K%BIJ7tO3Ec8F0!u{eT)@g%meW$^$%deFSjB#gYb#Y*> z*F;zEAbQ#)dQSUPXDCn13GE6f2A!%ZI95kO3L=7jbvPy;2F65?m4^HuXxl3BKig&3 zA0AS07Y4Me{rvZ=)U`CFV_ffZD**S>j$HK`CWdY zXbHvKKZ`Pp(KWk0;+~N^r&to&jrNN~+urC3jFi+Uy8e9m@+k)~zpQ<=D39a_-vX=; zLBckQXCmSN7CPAQ2dX=!n<(wp^d3+ic8`v5c15wDazmJ6r`E2S%JAD#v455bQX%YG zi8TQg>>uG*^-rj>er7c619$m7UD3H*Vi64o!V&& zjh^T4;4}!@W_3(I3p)U)5H@-mQ*7rCPru(i{rjT$$?DueC-h~N|Co3#N&-TE47-{c zg0UzR8a2cXYZ9}&kA?{&f^}%`eb)Yb^sH#E$3E^Ho@5SF5{FyF$%>dQ=noXcc~5qQ zG2pOru9ZJbRfwkPL94Tf4J5HsA>bf9BMV0Nb6xyj(8~EUhP$bnZM$XyfJTzMbK0_P z*~zl(WrwDPs-;8)X5U(@odQ5+qZE6qa)XMY~Nr7gCk=2AKLh+f}bC= z6qQ>XHJ+a6zQG}vL2x%IK3PJGV+hi z5jP{Zq|N;~F|K63!E07Wc2bA!5|JkQ#if^+g~hn_HXa+eueRQd+)|QfI-%L>>9Nmq zyz;-3TduIGay&}8j-`pj%}VzgQ_+t3qKzL;GOP18^|Bu7D;ncHk1siWe1+$UoYN=P Nc%ID2hXEku{{Sygcas1B diff --git a/Docs/Books/algor.txt b/Docs/Books/algor.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/Books/dbi.eps b/Docs/Books/dbi.eps deleted file mode 100644 index e636ad315e7..00000000000 --- a/Docs/Books/dbi.eps +++ /dev/null @@ -1,1212 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /opt/local/x1/work/bk/mysql/Docs/Books/dbi.eps -%%CreationDate: Sun Dec 31 14:29:02 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 296 383 -%%EndComments -%%BeginPreview: 100 131 1 131 -% fffffffffffffffffffffffff0 -% 80aaaaaaaaaaaaaaaaaaaaa810 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000004401012000000000010 -% 80000000000240200000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80a00000000400000000000010 -% 800552a4251100000000000010 -% 80900411110100000000000010 -% 80000000000000000000000010 -% 80012000020800000000000010 -% 81fedffffdf7fffffffffff810 -% 8112a4924a4a24444444444810 -% 80ed5b6db58adbbbbbbbbbb010 -% 81001555554aa000a000a02810 -% 81638aaaaa8558745c68a85010 -% 81424555554aa8aa2a2a50d410 -% 8152a555554ad4aa145428a810 -% 8142c286a88aa8ab8a5450a810 -% 8162a471484aac548a5458a810 -% 81428491048aa8ab0a01a8a810 -% 815008e14b4ad4ad4a2850a810 -% 8142b0094a8aa855445458a810 -% 8162a9d68aa554aa8a5428a810 -% 8142a92aca8aa8aa8a5728a810 -% 8152a8d54acad4ad145428a810 -% 8142a8aa8a855455165528a810 -% 8162d4514a8aa8542a5450a810 -% 8140aa068282a000d004a72810 -% 8155558935355b6f592f595010 -% 815556b6d5d56a92aadbb75810 -% 8155aaaaaa55556d555faaa810 -% 8155555555aaaaaaaadbeda810 -% 800000000000000000ffdac010 -% 800000000000000001fe754010 -% 800000000000000003dda56010 -% 800000000000000007f9bfe010 -% 80000000000000000fab6f6010 -% 80000000000000001fdb74a010 -% 8000000000000007fedd577010 -% 800000000000003fbfe8aeb010 -% 8000005a954000ff7faebfb810 -% 80000ffffffffffdefd9053810 -% 80001effffffffd52f697b5010 -% 80007bf7ffffffadffdc4fa010 -% 8000f56ab6ddf77b55abda4010 -% 8003b56b6dbbdfd7aff4a10010 -% 8007d66ddbaebcb5b7b1800010 -% 800ea9b6bed7efaedde3000010 -% 801f7abdeada5adb56d2000010 -% 801dca6db555bdfd7aa6000010 -% 803eb6ebeb77eb4eade4000010 -% 803b553dabac9bbb2a68000010 -% 807f4b6bf8d377abbac0000010 -% 807da8976fadd6b7d550000010 -% 80fe9b4af976b7766048000010 -% 80fba4a3bf555bebea90000010 -% 81ff6d54fbfb2bbf4a50000010 -% 81fbe4c15d56ebeaa2a0000010 -% 83ff5a543ffd19df6d00000010 -% 83ffbaa516b3a7bc8b30000010 -% 83f572bd4bfef97aeea0000010 -% 83af7b384eeaabf73c80000010 -% 87a5b97f0055b76af300000010 -% 85a7de7ff29f4ee9f400000010 -% 87e3b57ff925dd5b4100000010 -% 8d23ec7abe1254a76f00000010 -% 876352ef55e445d4ff00000010 -% 8b43fcdce13f5ef7fe00000010 -% 8ac1e5f6a00031b4ea00000010 -% 8f43a935600005dafc00000010 -% 8b435a7a400002b4f600000010 -% 8ac3ec246000036c6900000010 -% 8d235438800002ba5c00000010 -% 8fc3f012c00002ac5a00000010 -% 8563a82a800001d82200000010 -% 8aa36034800001f47600000010 -% 86a3d029000001583000000010 -% 85e3e026000001582e00000010 -% 8797c058000000f43400000010 -% 84afc02ad00001343100000010 -% 83a780c4880000d83500000010 -% 836b805a080000d82a00000010 -% 817380ec080000a41000000010 -% 81688075580000b43500000010 -% 80b62051a80000281900000010 -% 804d486ef00000e81400000010 -% 803dc58e600000241b00000010 -% 8005b96fc00000c80c00000010 -% 801b9b6f800000a80d00000010 -% 801edb7e800000540480000010 -% 801ebbeb000000140400000010 -% 801c055e800000580550000010 -% 801600057000002c02a8000010 -% 801500028c0000240324000010 -% 80160002b40000160294000010 -% 80140001ac0000118174000010 -% 80134000200000154000000010 -% 801540000000000ab000000010 -% 801520000000000a5000000010 -% 8015400000000004e000000010 -% 800fc000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80810000000000000000000010 -% 815a6900000000000000000010 -% 804a4100000000000000000010 -% 81022800000000281080120010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% fffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 368.503937 translate -281.300715 -368.503937 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 131 8 -% Transformation matrix -[ 100 0 0 131 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202 -020202ffffffffffffffffffffffffffffffd9eaec7dd6e509a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffd9eaecd9eaecd9eaecd9eaecd9eaec -d9eaecd9eaecffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffd9eaecd9eaecffffffffffffffffffffffffffffffd9eaecd9eaecffffffffffffffffff -ffffffffffffd9eaecc7c7c9ffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -d9eaecffffffffffffd9eaecffffffffffffffffffffffffd9eaecffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffc7c7c9c7c7c99b9b9fc7c7c9afafb2c7c7c99b9b9fc7c7c9afafb2c7c7c9c7c7c9c7c7c9 -afafb2d9eaecc7c7c9c7c7c9afafb2c7c7c9afafb2afafb2c7c7c9c7c7c9afafb2c7c7c99b9b9f -afafb2c7c7c99b9b9fafafb2d9eaecafafb2c7c7c9d9eaecffffffc7c7c9d9eaecd9eaecc7c7c9 -afafb2c7c7c9ffffffc7c7c9c7c7c9c7c7c9d9eaecafafb2ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffd9eaecffffffd9eaecc7c7c9c7c7c9d9eaecc7c7c9d9eaecd9eaecd9eaecd9eaecc7c7c9 -d9eaecffffffd9eaecffffffd9eaecffffffc7c7c9afafb2d9eaecd9eaecafafb2ffffffd9eaec -c7c7c9d9eaecd9eaecc7c7c9d9eaecd9eaecafafb2afafb2ffffffc7c7c9d9eaecd9eaecd9eaec -d9eaecd9eaecffffffd9eaecd9eaecd9eaecd9eaecc7c7c9ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffc7c7c9d9eaecafafb2ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffd9eaecffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffff9b9b9fffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffff8a8a8ed9eaec7a7b80c7c7c9afafb2 -c7c7c9d9eaecd9eaecc7c7c9c7c7c9ffffffafafb2c7c7c9d9eaecc7c7c9c7c7c9d9eaecafafb2 -d9eaecc7c7c9c7c7c9c7c7c9c7c7c9d9eaecc7c7c9d9eaecafafb2d9eaecd9eaecafafb2c7c7c9 -d9eaecc7c7c9ffffffffffff9b9b9fd9eaec9b9b9fafafb2d9eaecd9eaecc7c7c9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffd9eaec8a8a8ed9eaecd9eaec9b9b9fd9eaec -8a8a8effffff6c6c71c7c7c9afafb2d9eaec9b9b9fc7c7c9c7c7c9afafb2afafb2afafb2afafb2 -afafb2afafb2c7c7c96c6c719b9b9fc7c7c9c7c7c9d9eaecafafb29b9b9fc7c7c9afafb2c7c7c9 -afafb29b9b9fffffffffffff9b9b9f9b9b9fd9eaecafafb26c6c71d9eaecc7c7c9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffafafb2afafb2ffffffd9eaecafafb2ffffff -c7c7c9d9eaecc7c7c99b9b9fc7c7c9c7c7c9d9eaecafafb29b9b9fafafb2c7c7c99b9b9fc7c7c9 -c7c7c98a8a8ed9eaecafafb2c7c7c9c7c7c9afafb2c7c7c9c7c7c99b9b9fafafb2afafb2c7c7c9 -8a8a8ed9eaecffffffc7c7c9afafb2afafb2c7c7c9c7c7c98a8a8ec7c7c9ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffc7c7c9ffffffc7c7c9ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffafafb2 -d9eaecc7c7c9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffff7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e5d9eaecffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be7dd6e5d9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be7dd6e57dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -7dd6e57dd6e57dd6e57dd6e5d9eaec7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e509a4be09a4be -09a4be09a4be09a4be09a4be7dd6e5d9eaecd9eaecffffffd9eaec7dd6e57dd6e57dd6e57dd6e5 -7dd6e509a4be09a4be09a4be09a4be09a4be7dd6e57dd6e57dd6e57dd6e57dd6e57dd6e509a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4bed9eaecffffff -d9eaec09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be7dd6e5ffffffffffff7dd6e509a4be09a4be09a4be09a4be7dd6e5d9eaecd9eaec7dd6e5 -09a4be09a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5 -ffffffd9eaec09a4be09a4be09a4be09a4be7dd6e57dd6e5ffffffd9eaec7dd6e509a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be7dd6e5ffffff7dd6e509a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4beffffffd9eaec09a4be09a4be09a4be09a4be09a4be -7dd6e5ffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff7dd6e509a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4beffffffd9eaec09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5 -ffffff7dd6e509a4be09a4be09a4be09a4beffffffd9eaec09a4be09a4be09a4be09a4be09a4be -09a4beffffffffffff09a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4bed9eaecffffff7dd6e509a4be09a4be09a4be7dd6e5 -7dd6e57dd6e57dd6e509a4be09a4be09a4be09a4be09a4be09a4be7dd6e509a4be09a4be7dd6e5 -7dd6e509a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -d9eaecffffff7dd6e509a4be09a4be09a4beffffffd9eaec09a4be09a4be09a4be09a4be09a4be -09a4beffffffffffff09a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4beffffffd9eaec09a4be09a4be7dd6e5d9eaec09a4be -09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be7dd6e5ffffff09a4be7dd6e5ffffff -ffffff7dd6e509a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -7dd6e5ffffff7dd6e509a4be09a4be09a4beffffff7dd6e509a4be09a4be09a4be09a4be09a4be -7dd6e5ffffff7dd6e509a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be7dd6e5ffffff7dd6e509a4bed9eaec7dd6e509a4be09a4be -09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be7dd6e5ffffffffffff7dd6e509a4be7dd6e5 -7dd6e509a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -7dd6e5ffffffd9eaec09a4be09a4be09a4beffffffffffff7dd6e57dd6e57dd6e57dd6e5d9eaec -d9eaec09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -d9eaec7dd6e57dd6e57dd6e57dd6e5ffffff7dd6e509a4be7dd6e5ffffff7dd6e509a4be09a4be -09a4be09a4be7dd6e5d9eaecffffff09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be -09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4beffffffffffff09a4be09a4be09a4beffffffd9eaec7dd6e57dd6e57dd6e57dd6e5d9eaec -ffffff7dd6e509a4be09a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be7dd6e57dd6e57dd6e57dd6e509a4be09a4bed9eaecffffff7dd6e57dd6e57dd6e5 -7dd6e57dd6e57dd6e57dd6e57dd6e509a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be -09a4be09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4beffffffffffff09a4be09a4be09a4beffffff7dd6e509a4be09a4be09a4be09a4be09a4be -7dd6e5ffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4bed9eaecd9eaec09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be -09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -7dd6e5ffffffd9eaec09a4be09a4be09a4beffffff7dd6e509a4be09a4be09a4be09a4be09a4be -09a4be7dd6e5ffffff7dd6e509a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4bed9eaecffffff09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be -09a4be09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -7dd6e5ffffff7dd6e509a4be09a4be09a4beffffff7dd6e509a4be09a4be09a4be09a4be09a4be -09a4be09a4beffffffd9eaec09a4be09a4be09a4be7dd6e5ffffff7dd6e509a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffff7dd6e509a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be -09a4be09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -ffffffd9eaec09a4be09a4be09a4be09a4beffffff7dd6e509a4be09a4be09a4be09a4be09a4be -09a4be09a4beffffffd9eaec09a4be09a4be09a4be7dd6e5ffffff7dd6e509a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4beffffffd9eaec09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be -09a4be09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4bed9eaec -ffffff7dd6e509a4be09a4be09a4be09a4beffffff7dd6e509a4be09a4be09a4be09a4be09a4be -09a4be7dd6e5ffffff7dd6e509a4be09a4be09a4be7dd6e5ffffff7dd6e509a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be7dd6e5ffffff -7dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5ffffffd9eaec09a4be -09a4be09a4be09a4be7dd6e57dd6e509a4be09a4be09a4be7dd6e5ffffff09a4be09a4be09a4be -09a4be09a4be09a4bed9eaecffffff09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4bed9eaecffffff7dd6e509a4be09a4be09a4be09a4be09a4be09a4bed9eaecffffff -7dd6e509a4be09a4be09a4be09a4be09a4beffffffd9eaec09a4be09a4be09a4be09a4be09a4be -7dd6e5ffffffffffff09a4be09a4be09a4be09a4be7dd6e5d9eaec7dd6e509a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be7dd6e5d9eaecffffff -d9eaec7dd6e57dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4be7dd6e5d9eaecffffff -ffffffd9eaecd9eaec7dd6e509a4be09a4be09a4be7dd6e5d9eaecffffffd9eaec7dd6e509a4be -09a4be09a4be7dd6e5d9eaecffffffd9eaec7dd6e509a4be09a4be09a4be09a4be09a4be09a4be -7dd6e57dd6e5ffffffffffffffffff7dd6e57dd6e57dd6e57dd6e57dd6e5d9eaec7dd6e509a4be -09a4be09a4be09a4be09a4be7dd6e5d9eaecffffffffffff7dd6e57dd6e57dd6e57dd6e509a4be -c7c7c9d9eaec09a4be09a4be09a4be09a4be7dd6e59b9b9f6c6c716c6c717dd6e57dd6e509a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be7dd6e509a4be09a4be -09a4be7dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -7dd6e57dd6e509a4be09a4be09a4be09a4be09a4be7dd6e509a4be09a4be7dd6e509a4be09a4be -09a4be09a4be7dd6e509a4be09a4be7dd6e509a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be7dd6e509a4be09a4be09a4be7dd6e509a4be7dd6e57dd6e509a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be7dd6e57dd6e509a4be09a4be7dd6e57dd6e57dd6e56c6c71444348 -1f1f2209a4be09a4be09a4be09a4be09a4be7a7b805d5e62afafb25d5e629b9b9f09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be0202027a7b80 -4443480202025050546c6c714443485050545d5e6250505450505434353909a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be3435391f1f227a7b80 -3435390202023435398a8a8e6c6c718a8a8e6c6c717a7b805d5e626c6c7109a4be09a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be -09a4be09a4be09a4be09a4be09a4be09a4be09a4be09a4be5d5e626c6c711f1f221f1f225d5e62 -1f1f221f1f220202021f1f226c6c716c6c718a8a8e5050547a7b805d5e6244434809a4be09a4be -09a4be09a4be7dd6e5ffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaec -d9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaec -d9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaecd9eaec -d9eaecd9eaecd9eaecd9eaecd9eaecffffffd9eaec5050544443483435391f1f221f1f221f1f22 -1f1f223435391f1f225050545d5e625050545050546c6c717a7b808a8a8e3435395d5e62afafb2 -d9eaecd9eaecffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffd9eaec3435391f1f221f1f224443483435391f1f22020202 -5d5e625d5e628a8a8e6c6c715d5e624443487a7b808a8a8e7a7b807a7b808a8a8e5050547a7b80 -d9eaecffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffd9eaec5050543435394443483435395d5e623435391f1f221f1f22 -9b9b9f8a8a8e5050545d5e626c6c716c6c719b9b9f6c6c718a8a8e9b9b9f9b9b9f505054343539 -9b9b9fffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffd9eaec5d5e621f1f221f1f223435393435395050545050540202027a7b80 -c7c7c94443485050548a8a8e7a7b805d5e627a7b805d5e623435393435393435391f1f22020202 -afafb2ffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffff7a7b803435393435391f1f223435394443486c6c716c6c713435399b9b9f -6c6c715050547a7b808a8a8e3435395050543435393435393435393435396c6c713435391f1f22 -c7c7c9ffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffd9eaec6c6c713435393435391f1f223435391f1f223435396c6c714443484443488a8a8e -5050545050548a8a8e3435391f1f226c6c715d5e623435397a7b807a7b808a8a8e6c6c71343539 -8a8a8effffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffc7c7c9c7c7c98a8a8e505054444348343539 -3435391f1f221f1f221f1f221f1f221f1f223435391f1f224443487a7b807a7b804443486c6c71 -7a7b807a7b807a7b806c6c715050545d5e627a7b803435393435398a8a8e8a8a8e7a7b80343539 -1f1f22ffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffafafb26c6c711f1f221f1f221f1f22343539343539343539 -4443484443483435391f1f221f1f220202023435393435393435396c6c716c6c715d5e625d5e62 -afafb29b9b9f8a8a8e7a7b809b9b9f8a8a8e1f1f223435394443489b9b9f3435398a8a8e444348 -1f1f229b9b9fffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffd9eaecd9eaecc7c7c9afafb29b9b9f -9b9b9f6c6c716c6c717a7b807a7b808a8a8e9b9b9f9b9b9f9b9b9f9b9b9f9b9b9f8a8a8e8a8a8e -8a8a8e9b9b9f9b9b9fafafb2afafb2afafb2afafb2c7c7c9c7c7c9d9eaecd9eaecd9eaecffffff -ffffffffffffd9eaecafafb24443481f1f223435391f1f223435394443483435391f1f225d5e62 -5050543435394443481f1f221f1f220202021f1f224443485d5e627a7b807a7b805050546c6c71 -7a7b809b9b9f7a7b809b9b9f6c6c715d5e624443481f1f225050544443485050548a8a8e343539 -343539343539d9eaecffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffd9eaec7a7b801f1f22020202343539020202020202 -1f1f221f1f220202020202021f1f220202021f1f220202020202020202020202021f1f22020202 -0202020202020202020202020202020202020202020202020202020202020202021f1f22343539 -4443485050541f1f220202023435391f1f223435394443483435391f1f225d5e624443485d5e62 -5050544443487a7b804443481f1f221f1f223435394443483435395d5e626c6c711f1f228a8a8e -8a8a8e8a8a8eafafb29b9b9f9b9b9f9b9b9f7a7b804443485d5e621f1f229b9b9fafafb2343539 -1f1f22505054ffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffff9b9b9f1f1f223435394443484443485d5e62444348343539 -1f1f221f1f223435391f1f221f1f221f1f221f1f221f1f221f1f221f1f221f1f223435391f1f22 -1f1f221f1f220202021f1f221f1f221f1f220202020202021f1f221f1f220202021f1f22020202 -0202021f1f220202021f1f224443483435397a7b805050546c6c715d5e626c6c71505054505054 -7a7b806c6c716c6c713435391f1f221f1f221f1f225d5e625050546c6c717a7b803435398a8a8e -c7c7c97a7b80afafb29b9b9f8a8a8e7a7b806c6c718a8a8e7a7b805050549b9b9fafafb29b9b9f -505054d9eaecffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffc7c7c95050541f1f223435394443484443485050541f1f225d5e62343539 -1f1f223435394443483435395050544443480202024443481f1f225050543435391f1f22343539 -1f1f224443480202021f1f223435393435393435391f1f223435390202021f1f224443481f1f22 -4443483435390202023435393435397a7b805d5e628a8a8e4443481f1f228a8a8e8a8a8e444348 -5d5e621f1f223435395d5e624443481f1f220202024443485050546c6c718a8a8e4443486c6c71 -9b9b9fc7c7c99b9b9f7a7b807a7b806c6c715d5e625050544443481f1f225050547a7b807a7b80 -afafb2ffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff8a8a8e3435391f1f223435395050545050546c6c717a7b805d5e625d5e625d5e62 -3435395050545050548a8a8e7a7b806c6c71505054505054505054343539444348444348444348 -5d5e624443483435395050544443480202024443484443483435391f1f224443483435391f1f22 -5d5e624443480202024443485d5e627a7b804443486c6c714443486c6c715d5e623435395d5e62 -7a7b807a7b805d5e627a7b805d5e623435391f1f223435395050547a7b807a7b803435398a8a8e -8a8a8e6c6c716c6c715d5e626c6c715050546c6c714443481f1f225d5e629b9b9f5d5e628a8a8e -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -afafb23435393435396c6c715d5e625050544443487a7b805d5e628a8a8e9b9b9f6c6c716c6c71 -3435398a8a8e4443488a8a8e5d5e625d5e627a7b805050546c6c715d5e62505054444348505054 -4443480202026c6c713435391f1f225d5e625d5e624443481f1f22444348343539444348343539 -1f1f221f1f221f1f224443485050545050546c6c715d5e627a7b806c6c715d5e62020202505054 -6c6c714443489b9b9f4443481f1f224443483435391f1f225d5e624443485d5e626c6c718a8a8e -afafb28a8a8e3435395d5e628a8a8eafafb2c7c7c9c7c7c9d9eaecafafb2c7c7c9c7c7c9ffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9b9b9f -1f1f223435394443481f1f224443487a7b807a7b807a7b801f1f227a7b807a7b80afafb27a7b80 -4443486c6c718a8a8e5d5e628a8a8e6c6c715050543435395050547a7b805d5e625d5e625d5e62 -5050545050548a8a8e6c6c716c6c714443481f1f225d5e625d5e625050545050545050545d5e62 -3435390202028a8a8e7a7b805d5e625d5e625d5e623435396c6c713435397a7b805d5e62444348 -6c6c711f1f226c6c716c6c715050545050540202020202028a8a8e5050544443488a8a8ec7c7c9 -9b9b9f8a8a8e505054d9eaecffffffffffffd9eaecffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffafafb2343539 -3435394443485d5e623435396c6c716c6c716c6c717a7b808a8a8e9b9b9f8a8a8e4443487a7b80 -6c6c714443485d5e620202026c6c716c6c716c6c715050543435391f1f22444348343539444348 -8a8a8e5d5e621f1f227a7b806c6c717a7b806c6c714443484443485d5e621f1f22444348505054 -3435394443486c6c713435395050546c6c715d5e626c6c716c6c715d5e625d5e625d5e62444348 -4443487a7b805050543435396c6c716c6c715050541f1f22444348343539505054d9eaecc7c7c9 -6c6c71343539c7c7c9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaec444348343539 -4443481f1f225d5e626c6c716c6c711f1f226c6c714443488a8a8e8a8a8e7a7b807a7b806c6c71 -6c6c711f1f225050545d5e625d5e626c6c713435395050546c6c715050546c6c71505054444348 -9b9b9f4443483435397a7b805d5e624443486c6c716c6c715d5e628a8a8e7a7b808a8a8e6c6c71 -3435395d5e625d5e624443485050545d5e626c6c713435393435397a7b803435391f1f229b9b9f -8a8a8e8a8a8e6c6c716c6c71343539343539afafb23435391f1f226c6c716c6c71d9eaecc7c7c9 -5050547a7b80ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffff9b9b9f1f1f22343539 -1f1f226c6c715d5e621f1f226c6c715050548a8a8e8a8a8e6c6c719b9b9f7a7b80c7c7c9444348 -4443486c6c715d5e623435397a7b801f1f224443486c6c714443486c6c717a7b808a8a8e9b9b9f -9b9b9f7a7b807a7b806c6c718a8a8e8a8a8e6c6c717a7b807a7b805d5e625d5e62505054444348 -1f1f226c6c717a7b806c6c715050543435396c6c715d5e624443485d5e626c6c717a7b806c6c71 -6c6c711f1f225050544443487a7b807a7b808a8a8e5d5e625d5e62505054afafb2c7c7c9afafb2 -5d5e62d9eaecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffff4443481f1f22343539 -3435395d5e626c6c716c6c716c6c719b9b9f5d5e628a8a8e4443486c6c716c6c71afafb25d5e62 -3435396c6c717a7b806c6c716c6c711f1f225050543435391f1f227a7b805d5e626c6c717a7b80 -3435398a8a8e7a7b800202025d5e628a8a8e0202023435396c6c710202024443486c6c717a7b80 -5d5e625d5e621f1f224443485d5e626c6c716c6c716c6c713435393435395d5e627a7b809b9b9f -7a7b803435397a7b803435395050548a8a8e5050545d5e621f1f22343539afafb2c7c7c97a7b80 -afafb2ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffc7c7c91f1f223435391f1f22 -5d5e623435393435396c6c716c6c719b9b9f3435398a8a8e8a8a8e6c6c717a7b809b9b9f7a7b80 -5050545d5e624443485d5e625d5e625050543435394443485050547a7b809b9b9f9b9b9f7a7b80 -1f1f225d5e625d5e626c6c715d5e626c6c716c6c717a7b807a7b807a7b806c6c717a7b80444348 -5d5e628a8a8e5050543435396c6c718a8a8e5d5e625050546c6c715d5e623435396c6c718a8a8e -9b9b9f5d5e628a8a8e5050549b9b9f5d5e62c7c7c96c6c711f1f226c6c71afafb27a7b809b9b9f -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffff5d5e620202023435391f1f22 -4443484443485050549b9b9f7a7b808a8a8eafafb26c6c717a7b808a8a8e4443489b9b9f7a7b80 -5050546c6c716c6c715050543435395050543435395050544443485d5e621f1f226c6c719b9b9f -9b9b9f7a7b803435399b9b9f6c6c716c6c718a8a8e6c6c711f1f227a7b805d5e62505054343539 -5d5e627a7b805d5e621f1f221f1f228a8a8e7a7b806c6c717a7b805d5e625d5e621f1f226c6c71 -8a8a8e5050546c6c711f1f22afafb25d5e629b9b9f9b9b9f5050549b9b9fd9eaec8a8a8ed9eaec -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffc7c7c9020202020202444348444348 -0202025d5e626c6c715050547a7b807a7b809b9b9f8a8a8e9b9b9f9b9b9f9b9b9f9b9b9f6c6c71 -8a8a8e7a7b806c6c716c6c713435395050544443481f1f224443487a7b804443486c6c716c6c71 -5d5e624443488a8a8e5d5e626c6c711f1f228a8a8e9b9b9f5d5e625d5e625d5e628a8a8e6c6c71 -7a7b804443480202025050545d5e628a8a8e5d5e626c6c715050545050545d5e62444348343539 -3435398a8a8e7a7b808a8a8e8a8a8eafafb28a8a8eafafb2505054afafb29b9b9f8a8a8effffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffff5050540202020202021f1f221f1f22 -3435395d5e625050541f1f229b9b9fc7c7c97a7b805d5e629b9b9f5050549b9b9f5d5e626c6c71 -afafb2d9eaec7a7b807a7b803435395d5e625050543435393435395d5e624443485d5e627a7b80 -5d5e626c6c717a7b801f1f227a7b808a8a8e5050546c6c717a7b806c6c715050545050545d5e62 -6c6c718a8a8e1f1f225050546c6c716c6c715050543435397a7b803435395d5e628a8a8e6c6c71 -5d5e625d5e626c6c719b9b9fafafb2afafb2afafb2c7c7c97a7b80afafb29b9b9f7a7b80ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffc7c7c90202020202021f1f22343539444348 -4443480202025050545d5e627a7b80afafb2afafb28a8a8e7a7b809b9b9f8a8a8e9b9b9f8a8a8e -9b9b9fafafb2afafb2afafb28a8a8e5d5e625050546c6c711f1f221f1f223435393435396c6c71 -5d5e626c6c715d5e627a7b805d5e629b9b9f4443485d5e627a7b809b9b9f8a8a8e8a8a8e343539 -3435397a7b800202024443484443484443483435394443484443488a8a8e3435390202027a7b80 -4443483435397a7b801f1f22c7c7c95d5e62c7c7c9afafb29b9b9fc7c7c99b9b9fafafb2ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec4443480202021f1f220202023435391f1f22 -4443481f1f225050546c6c71505054505054c7c7c99b9b9f3435398a8a8e7a7b808a8a8e505054 -afafb27a7b809b9b9f8a8a8ec7c7c9afafb25050545d5e623435393435393435396c6c716c6c71 -1f1f225d5e623435395d5e620202025d5e627a7b807a7b804443489b9b9f9b9b9f8a8a8e9b9b9f -7a7b807a7b803435391f1f225050544443481f1f227a7b806c6c716c6c715d5e623435397a7b80 -5d5e625d5e62afafb29b9b9fc7c7c98a8a8ec7c7c98a8a8e7a7b80afafb28a8a8eafafb2ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffafafb21f1f221f1f22020202020202343539343539 -5d5e624443481f1f225050544443484443489b9b9f8a8a8e7a7b80afafb2afafb25d5e62343539 -afafb2c7c7c9afafb2afafb2c7c7c99b9b9f9b9b9f5d5e625d5e625d5e623435395050545d5e62 -3435395050545d5e625050545050548a8a8e3435394443485d5e628a8a8e5050545050545d5e62 -7a7b809b9b9f5050541f1f224443481f1f225050545d5e621f1f225050545050546c6c71505054 -6c6c718a8a8eafafb29b9b9fc7c7c96c6c719b9b9f5d5e629b9b9f8a8a8ec7c7c9afafb2ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffff8a8a8e0202021f1f221f1f220202021f1f221f1f22 -3435391f1f223435395050546c6c715050546c6c716c6c71afafb26c6c719b9b9fafafb26c6c71 -afafb2afafb29b9b9fafafb2c7c7c9c7c7c9afafb2afafb25050543435393435391f1f22444348 -5050543435395d5e620202023435396c6c715050545d5e626c6c718a8a8e9b9b9fafafb27a7b80 -343539afafb29b9b9f1f1f221f1f223435397a7b806c6c714443485d5e620202027a7b806c6c71 -8a8a8e5d5e628a8a8e6c6c717a7b808a8a8e5050548a8a8eafafb2c7c7c99b9b9fc7c7c9ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffff5050540202021f1f221f1f221f1f221f1f22343539 -1f1f221f1f223435394443487a7b801f1f225d5e623435399b9b9f5050547a7b806c6c718a8a8e -7a7b809b9b9f9b9b9f7a7b809b9b9fafafb28a8a8ec7c7c9c7c7c97a7b80343539444348444348 -4443485050545050545050545050545d5e627a7b807a7b806c6c715d5e628a8a8e4443487a7b80 -9b9b9f6c6c718a8a8e1f1f223435398a8a8e5050545050541f1f223435395d5e628a8a8e6c6c71 -6c6c71c7c7c9afafb29b9b9f6c6c711f1f22444348afafb2d9eaec8a8a8e7a7b80ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffd9eaec1f1f221f1f22444348343539343539343539444348 -4443485d5e625050545d5e625050543435395050548a8a8eafafb28a8a8ec7c7c98a8a8e7a7b80 -7a7b805d5e623435395d5e627a7b808a8a8e7a7b80afafb2afafb29b9b9f5d5e627a7b80343539 -1f1f225050540202023435395050541f1f226c6c711f1f227a7b801f1f225050541f1f225d5e62 -5050546c6c718a8a8e3435395d5e625d5e624443483435393435395d5e627a7b809b9b9f5d5e62 -4443485d5e628a8a8e3435394443485050548a8a8e5d5e629b9b9f9b9b9fc7c7c9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffff9b9b9f0202020202024443484443483435398a8a8e9b9b9f -3435393435393435398a8a8e4443483435391f1f225d5e629b9b9f6c6c715050549b9b9f9b9b9f -4443481f1f22343539505054afafb2afafb2afafb28a8a8eafafb2c7c7c97a7b806c6c71505054 -7a7b806c6c714443484443487a7b806c6c716c6c715050547a7b806c6c718a8a8e7a7b808a8a8e -5d5e628a8a8e3435391f1f226c6c714443481f1f221f1f225050543435395050545050548a8a8e -8a8a8e3435396c6c713435394443486c6c71c7c7c99b9b9fc7c7c99b9b9fd9eaecffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffff5d5e624443483435394443487a7b804443489b9b9fd9eaec -1f1f226c6c711f1f227a7b808a8a8e6c6c713435393435396c6c71afafb25d5e62c7c7c98a8a8e -1f1f220202021f1f220202023435398a8a8e9b9b9fafafb2c7c7c9d9eaecafafb28a8a8eafafb2 -afafb29b9b9f6c6c717a7b805050546c6c715d5e628a8a8e3435397a7b806c6c718a8a8e505054 -8a8a8e5d5e620202024443486c6c713435394443485d5e629b9b9f7a7b807a7b809b9b9f343539 -3435395d5e621f1f22505054afafb28a8a8e7a7b80c7c7c98a8a8ec7c7c9ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffd9eaec5050545050540202024443487a7b80444348afafb2ffffff -4443483435393435391f1f225050545d5e625d5e623435393435398a8a8e5d5e62c7c7c95d5e62 -0202021f1f223435393435391f1f221f1f221f1f221f1f225d5e626c6c71d9eaecc7c7c9c7c7c9 -8a8a8e7a7b808a8a8e9b9b9f6c6c715d5e625050545050543435398a8a8e8a8a8e8a8a8e7a7b80 -5050540202026c6c718a8a8e4443483435393435396c6c716c6c719b9b9f9b9b9f5d5e62343539 -5050541f1f224443487a7b80afafb2c7c7c9c7c7c98a8a8ec7c7c9ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffff9b9b9f1f1f226c6c714443485050544443481f1f22c7c7c9ffffff -9b9b9f0202024443484443485d5e626c6c715d5e623435396c6c716c6c715d5e62afafb2444348 -1f1f223435391f1f223435393435391f1f223435394443481f1f223435395050549b9b9f9b9b9f -7a7b809b9b9fc7c7c99b9b9f8a8a8e8a8a8e6c6c715050547a7b801f1f225d5e628a8a8e7a7b80 -6c6c713435398a8a8e7a7b806c6c716c6c716c6c717a7b805050548a8a8e5050540202028a8a8e -5050545d5e62c7c7c9c7c7c9c7c7c99b9b9f5050549b9b9fffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffff8a8a8e1f1f226c6c716c6c717a7b807a7b805d5e62d9eaecffffff -afafb20202021f1f224443481f1f223435398a8a8e5d5e625050549b9b9fc7c7c9c7c7c9343539 -3435394443481f1f223435394443485d5e625d5e625050544443481f1f221f1f224443487a7b80 -c7c7c9d9eaecc7c7c9afafb29b9b9f9b9b9fc7c7c99b9b9fc7c7c97a7b805050549b9b9f8a8a8e -8a8a8e3435398a8a8e9b9b9f7a7b806c6c717a7b807a7b808a8a8eafafb20202026c6c717a7b80 -3435396c6c718a8a8e8a8a8e4443480202021f1f22c7c7c9ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffff7a7b805d5e623435394443487a7b80505054505054ffffffffffff -d9eaec3435390202026c6c713435395d5e627a7b808a8a8e9b9b9f9b9b9fc7c7c9afafb21f1f22 -5050545050543435394443486c6c715d5e625d5e626c6c716c6c71343539c7c7c95d5e62444348 -5d5e627a7b807a7b807a7b80c7c7c9afafb2afafb28a8a8ec7c7c9afafb28a8a8eafafb2c7c7c9 -afafb25050548a8a8e7a7b805d5e623435397a7b809b9b9f8a8a8e6c6c715050549b9b9f7a7b80 -3435391f1f221f1f221f1f223435390202025d5e62ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffff7a7b807a7b801f1f22343539c7c7c98a8a8e7a7b80ffffffffffff -ffffff5d5e620202026c6c716c6c715050545d5e62505054505054afafb2c7c7c93435391f1f22 -6c6c714443480202025050545d5e627a7b807a7b805d5e623435398a8a8effffffffffffafafb2 -8a8a8e9b9b9f8a8a8e6c6c714443485d5e625050545050546c6c718a8a8e7a7b808a8a8e7a7b80 -6c6c713435395d5e626c6c716c6c713435391f1f224443488a8a8e8a8a8e5d5e624443481f1f22 -3435393435394443483435393435394443489b9b9fffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffd9eaec5d5e626c6c717a7b80afafb26c6c714443489b9b9fffffffffffff -ffffff7a7b800202021f1f221f1f223435395d5e627a7b805d5e62afafb28a8a8e505054444348 -5050545d5e625050544443486c6c718a8a8e7a7b809b9b9f343539c7c7c9ffffffffffffffffff -ffffffffffffffffffd9eaecc7c7c9c7c7c97a7b80afafb2ffffffd9eaecc7c7c96c6c715d5e62 -c7c7c96c6c719b9b9f4443485d5e628a8a8e5d5e621f1f227a7b808a8a8e7a7b80afafb2020202 -0202021f1f227a7b803435394443487a7b809b9b9fffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffd9eaec4443485050543435395d5e627a7b801f1f229b9b9fffffffffffff -ffffff5d5e621f1f225d5e624443486c6c719b9b9f343539afafb2afafb25d5e62d9eaec6c6c71 -1f1f223435396c6c716c6c719b9b9f1f1f228a8a8e5d5e625d5e62d9eaecffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffff9b9b9f8a8a8e8a8a8e3435391f1f228a8a8e6c6c713435396c6c719b9b9fffffff1f1f22 -1f1f220202025050543435391f1f227a7b80afafb2ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffd9eaec5d5e626c6c710202023435399b9b9f343539afafb2ffffffffffff -ffffff6c6c711f1f226c6c716c6c716c6c716c6c711f1f22afafb25d5e629b9b9fffffff9b9b9f -1f1f225050545050548a8a8e9b9b9f8a8a8ec7c7c93435395d5e62ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffafafb27a7b807a7b805d5e625050547a7b805050545050548a8a8eafafb2ffffff5d5e62 -1f1f220202023435396c6c715d5e627a7b80afafb2d9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffd9eaec6c6c717a7b808a8a8eafafb28a8a8e5d5e62afafb2ffffffffffff -ffffff5d5e620202025d5e623435393435398a8a8e5050546c6c716c6c71ffffffffffffd9eaec -3435396c6c718a8a8e5050548a8a8ec7c7c9c7c7c99b9b9f7a7b80ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffd9eaec7a7b805d5e625d5e626c6c710202025d5e625d5e625d5e62afafb2ffffff9b9b9f -1f1f225d5e625d5e625d5e628a8a8e9b9b9f9b9b9fd9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffd9eaec5d5e624443487a7b808a8a8e9b9b9f6c6c719b9b9fffffffffffff -ffffff5d5e621f1f225050545050545d5e626c6c717a7b807a7b80d9eaecffffffffffffffffff -5050543435396c6c71afafb2d9eaecc7c7c9afafb28a8a8ec7c7c9ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff4443488a8a8e8a8a8e6c6c710202025050546c6c714443489b9b9fffffffafafb2 -3435398a8a8e0202020202027a7b809b9b9f9b9b9fffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffff6c6c711f1f220202021f1f225050543435396c6c71ffffffffffff -ffffff5050540202023435395050544443480202028a8a8eafafb2ffffffffffffffffffffffff -9b9b9f7a7b809b9b9f9b9b9f6c6c719b9b9f5050546c6c71ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff4443487a7b806c6c719b9b9f8a8a8e5d5e625d5e626c6c719b9b9fffffffd9eaec -6c6c717a7b801f1f221f1f227a7b808a8a8e9b9b9fffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffff9b9b9f5d5e627a7b806c6c717a7b807a7b80505054ffffffffffff -ffffff5050541f1f224443487a7b805d5e627a7b809b9b9fc7c7c9ffffffffffffffffffffffff -6c6c717a7b805050549b9b9f505054c7c7c97a7b80c7c7c9ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffafafb24443481f1f223435396c6c719b9b9f343539444348c7c7c9ffffffffffff -8a8a8e6c6c71afafb2c7c7c9c7c7c97a7b809b9b9fffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffff8a8a8e6c6c719b9b9f7a7b808a8a8e8a8a8e6c6c71d9eaecffffff -ffffff5050541f1f224443484443483435399b9b9f9b9b9fffffffffffffffffffffffffd9eaec -5050545d5e626c6c719b9b9fc7c7c9afafb28a8a8effffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffd9eaec3435393435391f1f220202025d5e625d5e627a7b80c7c7c9ffffffffffff -8a8a8e4443485d5e629b9b9f8a8a8e5d5e628a8a8effffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffafafb20202025050549b9b9f6c6c717a7b806c6c71c7c7c9ffffff -d9eaec1f1f221f1f221f1f224443486c6c718a8a8effffffffffffffffffffffffffffffafafb2 -6c6c718a8a8e8a8a8e8a8a8eafafb27a7b80c7c7c9ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffd9eaec5d5e628a8a8e6c6c715d5e621f1f225d5e629b9b9fc7c7c9ffffffffffff -afafb24443481f1f228a8a8eafafb28a8a8ed9eaecffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffafafb24443486c6c713435390202021f1f225050547a7b80ffffff -9b9b9f0202021f1f221f1f223435396c6c71c7c7c9ffffffffffffffffffffffffffffffafafb2 -8a8a8e9b9b9fafafb29b9b9f7a7b806c6c71ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffff7a7b805d5e626c6c71c7c7c96c6c714443488a8a8ec7c7c9ffffffffffff -c7c7c94443487a7b809b9b9f5d5e626c6c71d9eaecffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffc7c7c96c6c713435391f1f225050548a8a8e9b9b9f8a8a8e9b9b9f -1f1f220202021f1f221f1f223435399b9b9fffffffffffffffffffffffffffffffffffff8a8a8e -6c6c717a7b807a7b80ffffff6c6c71c7c7c9ffffffd9eaecd9eaecc7c7c9ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffff9b9b9f8a8a8e5d5e620202025050545050547a7b80d9eaecffffffffffff -ffffff1f1f223435397a7b806c6c718a8a8ec7c7c9ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffff6c6c716c6c719b9b9f7a7b80c7c7c97a7b808a8a8e6c6c71 -0202020202021f1f22343539343539ffffffffffffffffffffffffffffffffffffafafb29b9b9f -8a8a8e8a8a8e6c6c718a8a8e6c6c71d9eaec9b9b9f5d5e629b9b9f6c6c71afafb2ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffff8a8a8e7a7b80afafb21f1f225050546c6c718a8a8ec7c7c9ffffffffffff -ffffff1f1f220202028a8a8ec7c7c9afafb28a8a8effffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffafafb25050541f1f221f1f22afafb26c6c719b9b9fafafb2 -3435390202021f1f221f1f228a8a8effffffffffffffffffffffffffffffd9eaec7a7b807a7b80 -7a7b80c7c7c9afafb25d5e629b9b9f9b9b9f8a8a8ec7c7c9c7c7c9c7c7c95d5e62afafb2ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffafafb25d5e627a7b808a8a8e7a7b805d5e629b9b9fc7c7c9ffffffffffff -ffffff4443484443489b9b9fafafb2afafb25d5e62ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffd9eaec5d5e623435396c6c718a8a8e5050546c6c71afafb2 -8a8a8e1f1f221f1f221f1f22c7c7c9ffffffffffffffffffffffffffffffafafb28a8a8e5d5e62 -7a7b809b9b9f5d5e628a8a8e6c6c71afafb2c7c7c9c7c7c9d9eaecc7c7c97a7b808a8a8effffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffc7c7c95d5e621f1f229b9b9f6c6c710202027a7b80d9eaecffffffffffff -ffffff6c6c716c6c715d5e62afafb28a8a8e8a8a8effffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffafafb25d5e629b9b9f3435391f1f226c6c718a8a8e -c7c7c99b9b9f1f1f221f1f22d9eaecffffffffffffffffffffffffffffffffffff5d5e62505054 -505054c7c7c95d5e625d5e626c6c71d9eaecc7c7c9d9eaecd9eaecc7c7c96c6c71afafb2ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffd9eaec6c6c719b9b9f5050548a8a8e8a8a8e9b9b9fd9eaecffffffffffff -ffffff7a7b805d5e629b9b9fafafb29b9b9fafafb2d9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec5d5e626c6c711f1f225d5e626c6c716c6c71 -afafb2c7c7c99b9b9f5d5e62d9eaecffffffffffffffffffffffffffffffffffffafafb2505054 -4443483435396c6c716c6c71afafb2afafb29b9b9fafafb2afafb29b9b9f505054c7c7c9ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffff6c6c71c7c7c94443485d5e628a8a8e9b9b9fd9eaecffffffffffff -ffffff8a8a8e5d5e629b9b9f9b9b9fc7c7c99b9b9fd9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffc7c7c95d5e627a7b807a7b805d5e625d5e62 -0202025d5e62afafb2c7c7c9afafb29b9b9fc7c7c9ffffffffffffffffffffffffd9eaec444348 -6c6c715050547a7b80afafb2afafb28a8a8e3435396c6c717a7b806c6c715d5e62ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffff7a7b809b9b9f5d5e628a8a8e9b9b9fc7c7c9d9eaecffffffffffff -ffffff9b9b9f4443485d5e626c6c71afafb29b9b9fd9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffff9b9b9f5d5e62afafb28a8a8e020202 -0202027a7b805d5e62c7c7c99b9b9f9b9b9f9b9b9f8a8a8eafafb2c7c7c9c7c7c9c7c7c95d5e62 -6c6c718a8a8e8a8a8e7a7b807a7b809b9b9f444348343539505054444348c7c7c9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffff7a7b808a8a8e343539afafb24443488a8a8ed9eaecffffffffffff -ffffffafafb26c6c718a8a8e6c6c71afafb2afafb2d9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffff9b9b9f7a7b807a7b801f1f22 -6c6c71afafb26c6c714443485d5e629b9b9fd9eaecafafb29b9b9fafafb27a7b808a8a8e9b9b9f -9b9b9fafafb24443481f1f223435398a8a8e8a8a8e4443483435399b9b9fffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffff6c6c719b9b9f7a7b80c7c7c98a8a8e9b9b9fc7c7c9ffffffffffff -ffffffc7c7c95050546c6c716c6c717a7b806c6c71d9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c97a7b809b9b9f -6c6c718a8a8e5d5e620202028a8a8e3435396c6c71343539c7c7c9afafb25d5e62c7c7c96c6c71 -6c6c71afafb23435390202020202024443485050545050546c6c71ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffff5050548a8a8e7a7b80afafb28a8a8e9b9b9fafafb2ffffffffffff -ffffffffffffafafb24443484443489b9b9f7a7b80d9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaec1f1f225d5e62 -8a8a8e6c6c714443481f1f229b9b9fafafb21f1f221f1f229b9b9f1f1f225050548a8a8e1f1f22 -5050547a7b805050541f1f220202021f1f224443487a7b80d9eaecffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffff5050549b9b9f444348afafb26c6c719b9b9fc7c7c9ffffffffffff -ffffffffffffd9eaec3435395050549b9b9f9b9b9fc7c7c9ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaec1f1f22343539 -3435395d5e625d5e625050546c6c718a8a8e1f1f224443488a8a8e0202025050547a7b80020202 -1f1f225050545d5e623435393435395d5e626c6c71d9eaecffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffafafb28a8a8e6c6c715d5e627a7b80afafb2afafb2ffffffffffff -ffffffffffffffffff9b9b9f6c6c719b9b9f9b9b9f9b9b9fffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaec343539444348 -1f1f221f1f228a8a8e8a8a8e5d5e625d5e623435395050548a8a8e5050545050546c6c71343539 -1f1f225d5e625050545d5e626c6c714443486c6c71ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffd9eaec8a8a8ec7c7c97a7b807a7b805d5e62afafb2ffffffffffff -ffffffffffffffffffc7c7c95d5e62c7c7c9afafb2afafb2d9eaecffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaec5d5e62444348 -3435396c6c71c7c7c9ffffffc7c7c9afafb2afafb28a8a8e7a7b806c6c715d5e625d5e625d5e62 -5d5e625d5e625050541f1f224443485d5e627a7b808a8a8ec7c7c9c7c7c9d9eaecffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffff8a8a8e8a8a8e6c6c717a7b806c6c71c7c7c9ffffffffffff -ffffffffffffffffffd9eaec6c6c717a7b80c7c7c99b9b9f9b9b9f8a8a8e7a7b80afafb2ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaec6c6c716c6c71 -3435396c6c719b9b9fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffd9eaecd9eaec4443486c6c718a8a8eafafb27a7b805d5e627a7b808a8a8ec7c7c9ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffafafb2444348c7c7c95d5e621f1f22c7c7c9ffffffffffff -ffffffffffffffffffffffff8a8a8e0202027a7b809b9b9fc7c7c95d5e62afafb25d5e62afafb2 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c95d5e627a7b80 -4443486c6c719b9b9fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffff9b9b9f5d5e62afafb28a8a8e7a7b809b9b9f9b9b9f7a7b807a7b80d9eaec -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffff6c6c718a8a8eafafb27a7b809b9b9fd9eaecffffff -ffffffffffffffffffffffffafafb23435395d5e628a8a8e9b9b9f8a8a8eafafb29b9b9f5d5e62 -d9eaecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c95050548a8a8e -5050546c6c71c7c7c9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffd9eaec5d5e628a8a8e7a7b809b9b9f8a8a8e6c6c718a8a8e343539c7c7c9 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffafafb26c6c719b9b9f6c6c716c6c71afafb2d9eaec -ffffffffffffffffffffffffd9eaec4443487a7b80afafb2afafb2afafb27a7b80afafb21f1f22 -9b9b9fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c96c6c719b9b9f -7a7b809b9b9fafafb2d9eaecffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffafafb25d5e625d5e626c6c716c6c716c6c715d5e626c6c71d9eaec -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffff444348afafb2afafb29b9b9f8a8a8e505054 -9b9b9fd9eaecffffffffffffffffffafafb25050547a7b805d5e626c6c714443487a7b809b9b9f -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c96c6c71afafb2 -9b9b9f5d5e625d5e628a8a8eafafb2ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffd9eaecc7c7c9afafb29b9b9fc7c7c9c7c7c9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffff5050549b9b9f8a8a8eafafb28a8a8e7a7b80 -9b9b9f8a8a8ec7c7c9ffffffffffffffffffd9eaecd9eaecc7c7c9afafb2afafb2d9eaecffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c95050549b9b9f -5050548a8a8e8a8a8e9b9b9f7a7b80c7c7c9ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffff9b9b9f6c6c71afafb28a8a8e9b9b9f7a7b80 -c7c7c95d5e627a7b80c7c7c9ffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c9343539afafb2 -8a8a8e7a7b809b9b9f5d5e629b9b9f9b9b9fffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffc7c7c94443488a8a8e7a7b808a8a8e8a8a8e -5050547a7b804443489b9b9fffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaec6c6c719b9b9f -4443488a8a8e9b9b9f8a8a8e6c6c718a8a8effffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffafafb24443488a8a8eafafb26c6c71 -5d5e626c6c717a7b80ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c7c97a7b80 -3435396c6c713435394443486c6c71d9eaecffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd9eaecc7c7c9 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -d9eaecd9eaecd9eaecd9eaecd9eaecffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffafafb29b9b9fc7c7c9ffffffc7c7c99b9b9f -d9eaecc7c7c99b9b9fc7c7c9c7c7c9c7c7c9ffffffc7c7c9d9eaecafafb2ffffffc7c7c9d9eaec -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffafafb28a8a8ec7c7c96c6c71d9eaec7a7b805d5e62 -9b9b9f8a8a8e9b9b9fc7c7c97a7b806c6c71ffffff8a8a8ed9eaecafafb25d5e62c7c7c9d9eaec -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffff9b9b9fafafb2ffffff5d5e62d9eaec8a8a8e505054 -afafb28a8a8eafafb2d9eaec7a7b806c6c71ffffff8a8a8effffffd9eaec9b9b9fffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffd9eaecc7c7c9c7c7c9d9eaecffffffd9eaecd9eaecffffffffffffd9eaec -ffffffd9eaecd9eaecd9eaecffffffffffffd9eaecd9eaecd9eaecffffffd9eaecffffffffffff -d9eaecffffffffffffd9eaecd9eaecd9eaecffffffd9eaecc7c7c9d9eaecffffffffffffd9eaec -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffd9eaec8a8a8e7a7b809b9b9fffffff9b9b9fc7c7c9 -c7c7c97a7b808a8a8ec7c7c99b9b9f5d5e62afafb28a8a8e9b9b9fc7c7c9c7c7c9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffd9eaecafafb2c7c7c9c7c7c9afafb2c7c7c99b9b9fafafb2d9eaecc7c7c9d9eaec -c7c7c9c7c7c99b9b9fc7c7c9afafb2d9eaecafafb2afafb2d9eaecafafb2c7c7c9d9eaecd9eaec -ffffffffffffc7c7c9d9eaecafafb2afafb2ffffffd9eaec8a8a8eafafb2d9eaecc7c7c9afafb2 -d9eaecc7c7c9ffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffd9eaecffffffffffffffffffffffff -ffffffffffffd9eaecffffffffffffd9eaecd9eaecffffffd9eaecffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffd9eaecffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202020202020202020202020202 -020202020202020202020202020202020202020202020202020202 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/dbi.gif b/Docs/Books/dbi.gif deleted file mode 100644 index de7bc2dae61f251a7bd45aded761cbb7ec433d46..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3308 zcmVg;T6aYRE%A^8LV00000EC2ui0Av7z000F4P{>KEy*TU5y9OZG6hUd8 zXsWJk>%M9cg3@f?c&_h!?>E3;<5u(afHvf;!7%2A0I0~hD^ha|27!UlaMJkIf{;vl5>!gmY0tLn46q7 zm7SoDpP{67qot@ur>U%Tnys*^ud%eQIBf`xQaA*)nK%m#248MXYk3G_dALBwAOsC* zOuiwI4Z+dZ01jbWTx8%34&G{8T?oAZ1keZ$)6@WvgK}+NxM%jkWo2hw!Ej`0|kkeWD4#H2A(XU3X0V@w=TF+~9+L?@!KXksVGB_|9ujq*|k3zQ_90?9g+rcSC& zWsErCR3%veTm#5RThc0vpi9xB0NeE}+p;~UvZZU%?FzVY)AB6=;;h%NDf511JA^Am zqdvd30F0usiNOI1*FBp!q~5tSk4`>DVMBN`9Lf zCf$fbVV8!D*Yj(Na@UfD>vuHo7Me3BJ?i>(T-hNGD}NlI@kQrRd;b-$B6{`VhOf&s zUYczQAScQ193Va<% zmvWpfm|cJ633uCs^!ZoaeHh}GAy4d;7?*aA1t?*J_gQwrU??ru+I|-rqMK1rY^7Bc zj_GJrOcmMoBU(zeK^6fHIIv@E8uF)8QzzXuC6#KyMCFr9Wi^ol4;+Ak0Rtc~00AdH zwP8+dmLz}y4+x+Dm|4Mo{54h`%JFRNfapeeb4I^Zm^h8CJg zw#f>FYPzekdVsKS!b+?Ib-uemxqv?WF97YVn(qU<@|tgxzM@kuw5&crK%rq?>#wp* zpu?ob3#{Yw$36EGP#d+X5hlF5+8M8<7Y{(}oCXjOwZdVdiZHq#eR_j1DobGLrC?9M z>jp6^pmNNB25YCVVWJ)B0YK|4^#hfj(JH%C5D+unDXUuXq<&xeHPc>SnyLYFMtY|K z^R8+qtc5aQfXj@RtH2oqC~&O*)*vuocD&-ok76#eEt5&ASpRoDfUk(FKW?1+Qd)beDPR1m(+bN8CIMlZUZfU)09pO2 z3~I=NEq0){rD4nfftp;#-e)L0ZOT`6B3F~bX6Tp&c%K%k|$ zDfr+N=!=)Lngpw!!H#is695hI#5#jjig7rc-MHeluf(y;S13cAzBtA@&50uc{dyt9 zM1Vg^H3?G&D;MJ=Ri{Y*eJgyZ0w4*4#j1&I=15}~}RjytwfKU#A9;|%TG#aAIX;LHMx1zdFrl+YxH z4mw^lTlu^c=;Y)yGQ7-<jd^yam2>0uYuTa~<@ehca2c>2L>NfHcveg>~I?CaBY9 z)i|aAEksmP)r1xo>a;RRVXs%jlG#7I=esa%abYdn!a&MZK&#?%1_=1tE31YwXid(O z=RgDbjz?BkAxxPMjhfl2R;gFbiGW)e$C(CVS4u$SluWbO7v~hxakPUB`1l6C^fxP1 zrm<($OaM9nhr?`E4yMH-pcgI*k&ISMRq=wLvocpXVn(fiSr8P;#^u3{{YqE?W!1rG z_dPB!>0-(MC|4uu(11y$3SG@})hvOlMeGd=v`%Xkq0A;J2%7D2281Xq)h4TPy>A^+ zyh0rapwCqGEMKroTfNqCw2J!Fmi;W)7B_XMSp6ztZL{DWM<_2ZKx4WGaUR>Cfhm*< zETqz00IyVrT3iqi9k5EAtSU#YY|2Z9yPMgpd{@9>3`7*OSXM^amW%89?s$cgW;VT5 zu}F!*j7-X)_bjKw{PL1~-@4f31QK7%hCpw03R4s4+dPFWu}nwf@zTCUNZlE7Q2+k#}JBeUW`*K>)xZpcx#dKa$H7T*aL0Q=%AbAUe7RO>~vR+NX3dCX+1EdRr zY@RTKT|h8T-|R4w*$_+_EU=iRCB2W;4!hX38H7a;smc8>1O^b?tjJVAtF5iTGmD}a zfX4)diQ}m6L+RwaCR}T-`4tTqqSM$If=ZEbW@MnGq<9H8UsaNUNrl_K#sL6J@$iNm%B@TlTL|jqx@zpz5KXUzZ!>kfE01!n- z&%416f0vW7LcprZiT(2b9>*|Zl}eo^;07);l%b+=rjX8ot}VTJy+O!@y9ZwIW|OC9 z2Q?|{XNOqBn5S5?P^K%GX;^1cNMF;vdSWwkP6b?5zY4fsv@au8SCA?jQ)vMIDX^@7 z-UnlfcP0t5LX&bV86;IcMl|A3Sx3-xAM;>~b|&bM4A++(ZzC;e0B4FfF`ZO_=+ISj zzzxbIfwOlex?_1x00~m{W*2u3k(V9vvME0GNeW{Jsn;`n@CU5Kwk_dy zDAgosO^5@Nr+-m&N>L+KW|E9*hy~Ttj65KOFS9$fI0MiaH6MXKzXC1jz=4W(3*<5< z)5tA9btq6|2aecDyAW=FRZV#%d);^o!j}d_c2zp3KU`0T}pmBE>4Vxea zhR`EXpaenC2Z9-xdf-BMlN~Rk4#BlTWuk-Acm)Y$1`Htv=AZ`2um(_o3%PI&48ahG qxddAy0){{eaJiLS*$G*Bn#yQLs%e$28FU^Ho3c5Zv{{=G002A8>emMV diff --git a/Docs/Books/dbi.txt b/Docs/Books/dbi.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/Books/dubois.eps b/Docs/Books/dubois.eps deleted file mode 100644 index 412693fe405..00000000000 --- a/Docs/Books/dubois.eps +++ /dev/null @@ -1,1203 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /opt/local/x1/work/bk/mysql/Docs/Books/dubois.eps -%%CreationDate: Sun Dec 31 14:29:20 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 298 383 -%%EndComments -%%BeginPreview: 100 130 1 130 -% fffffffffffffffffffffffff0 -% fe000000000000000000000010 -% d555242000000000000924aab0 -% fe000600000000000000000010 -% d5488d020000a0070440040950 -% fe00160048010004800011a010 -% d51214c0aa02400a4000437110 -% fe2821404800000940c102d050 -% aa0854410501081010b70d1410 -% fe14810240080222514184a890 -% aa223640b5114000012d4baa10 -% fe1d49140040048aaa42285490 -% ab894040800000000011552ab0 -% feb20a00000010000041215290 -% 55cab4aad28b7552aa94556a90 -% 7e34a5b78a6a555d5d75adb6b0 -% d5dfeaff8fd8ab76aabbfffff0 -% bf501c074235188eab502ff7f0 -% 6aeff76ac031702f56ea4fc9f0 -% dfbd5ad5f54de8556dd9557f70 -% 7577ed6a4aa575aadb76ddd7f0 -% 5fdbbaaaaaa9ca55eedddb6ff0 -% f576ab55554a35522beff6daf0 -% 5fdd6aaa5492852dd29bfdf7b0 -% f55695535aa474a22aaaa6ad70 -% 5f69d55adaa5baaaaaaaadfff0 -% 75debbaaf55aa556ad56daad70 -% df7bd4aad6d55faaaefb7dfbd0 -% 75dd5f75adab6aeaa2ababbf70 -% df77ebdaeadadeddd5d56ebff0 -% 75fd5aff3db7b7f55555556ab0 -% dfffff57effdffdfbabb6fdff0 -% 75d754b55aaa52b2aaa55aaaf0 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e030c01426100000000000010 -% 74030c020c3100000000000010 -% de010c02081100000000000010 -% 7401849b881900000000000010 -% de008cc0c81100000000000010 -% 7402c4406c1100000000000010 -% de044440641100000000000010 -% 74064c26462398000000000010 -% 5e00000001c010000000000010 -% f4000000006000000000000010 -% 5e0000c0001800000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 5e000000000000000000000010 -% f4080000000000000000000010 -% 5e0f9000000000000000000010 -% 740f8000000000000000000010 -% de000000000000000000000010 -% 740d0000000000000000000010 -% de0fe000000000000000000010 -% 740a9000000000000000000010 -% de000000000000000000000010 -% 74000000000000000000000010 -% 5e000000000000000000000010 -% f4000000000000000000000010 -% 7ffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 368.503937 translate -283.464567 -368.503937 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 130 8 -% Transformation matrix -[ 100 0 0 130 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101 -010101f50237f50237f50237f50237f50237f50237b78794c9c2c4b3b3b3b3b3b3b3b3b3b3b3b3 -b3b3b3b3b3b3c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4d6d6d6c9c2c4d6d6d6c9c2c4 -c9c2c4c9c2c4d6d6d6c9c2c4d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6c9c2c4d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6c9c2c4c9c2c4c9c2c4c9c2c4 -c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4b3b3b3c9c2c4c9c2c4c9c2c4 -b3b3b3c9c2c4b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3010101 -010101f50237f50237f50237f50237f50237f50237b78794c9c2c4b3b3b3b3b3b3b3b3b3b3b3b3 -b3b3b3c9c2c4b3b3b3c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4d6d6d6c9c2c4c9c2c4 -c9c2c4c9c2c4c9c2c4c9c2c4d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6c9c2c4d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6c9c2c4c9c2c4c9c2c4 -c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4b3b3b3c9c2c4c9c2c4c9c2c4b3b3b3 -b3b3b3b3b3b3b3b3b3c9c2c4b3b3b3b3b3b3b3b3b3b3b3b3010101 -010101f50237f50237f50237f50237f50237f50237b78794c9c2c4b3b3b3b3b3b3b3b3b3c9c2c4 -c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4d6d6d6c9c2c4514e4f696869c9c2c4d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9d6d6d6d6d6d6e9e9e9d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9e9e9e9d6d6d6d6d6d6d6d6d6e9e9e9 -e9e9e9e9e9e9d6d6d6d6d6d6e9e9e9d6d6d6e9e9e9d6d6d6e9e9e9e9e9e9d6d6d6d6d6d6e9e9e9 -e9e9e9d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4 -c9c2c4c9c2c4b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3010101 -010101f50237f50237f50237f50237f50237f50237b78794c9c2c4b3b3b3c9c2c4c9c2c4c9c2c4 -c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4d6d6d6e9e9e9818181514e4f6968699b9b9bd6d6d6e9e9e9 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9d6d6d6e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9 -e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9d6d6d6b3b3b3b3b3b3b3b3b3e9e9e9 -e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e99b9b9b818181818181b3b3b3 -e9e9e9e9e9e9d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6c9c2c4d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6 -c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4b3b3b3c9c2c4b3b3b3010101 -010101f50237f50237f50237f50237f50237f50237b78794c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4 -c9c2c4c9c2c4d6d6d6c9c2c4d6d6d6d6d6d6b3b3b3818181514e4f6968698181819b9b9bd6d6d6 -d6d6d6d6d6d6d6d6d6e9e9e9e9e9e9e9e9e9d6d6d69b9b9bc9c2c4d6d6d6c9c2c49b9b9be9e9e9 -e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9d6d6d6b3b3b3b3b3b3c9c2c49b9b9bb3b3b3 -e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9ffffffb3b3b3696869696869818181818181 -b3b3b3d6d6d6e9e9e9e9e9e9d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9e9e9e9d6d6d6d6d6d6d6d6d6 -d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d69b9b9b6968699b9b9bc9c2c4818181 -b3b3b3d6d6d6b3b3b3c9c2c4c9c2c4c9c2c4c9c2c4b3b3b3010101 -010101f50237f50237f50237f50237f50237f50237b78794d6d6d6c9c2c4c9c2c4b3b3b3c9c2c4 -d6d6d6c9c2c4d6d6d6c9c2c4d6d6d6c9c2c49b9b9bb3b3b38181818181819b9b9b6968699b9b9b -e9e9e9e9e9e9e9e9e9d6d6d6e9e9e9e9e9e99b9b9b9b9b9b9b9b9b818181818181818181b3b3b3 -e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9b3b3b39b9b9bc9c2c49b9b9b9b9b9bd6d6d6 -d6d6d6ffffffe9e9e9e9e9e9e9e9e9e9e9e9ffffffd6d6d69b9b9b8181818181819b9b9bb3b3b3 -9b9b9bb3b3b3e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9d6d6d6c9c2c4e9e9e9e9e9e9e9e9e9e9e9e9 -e9e9e9e9e9e9d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6e9e9e9696869514e4f818181514e4f302f2f -696869d6d6d6c9c2c4d6d6d6c9c2c4c9c2c4c9c2c4c9c2c4010101 -010101f50237f50237f50237f50237f50237f50237b78794d6d6d6c9c2c4c9c2c49b9b9b9b9b9b -c9c2c4d6d6d6d6d6d6d6d6d6d6d6d69b9b9b9b9b9bb3b3b3b3b3b3b3b3b39b9b9b9b9b9b818181 -c9c2c4e9e9e9e9e9e9e9e9e9ffffffc9c2c49b9b9b9b9b9b9b9b9b9b9b9b9b9b9b8181819b9b9b -c9c2c4ffffffe9e9e9e9e9e9ffffffffffffd6d6d6c9c2c4c9c2c4d6d6d6e9e9e9d6d6d6d6d6d6 -d6d6d6e9e9e9ffffffffffffe9e9e9e9e9e9ffffffb3b3b39b9b9bb3b3b39b9b9b9b9b9b9b9b9b -9b9b9b9b9b9bd6d6d6e9e9e9e9e9e9e9e9e9ffffff9b9b9b696869b3b3b3d6d6d6e9e9e9d6d6d6 -d6d6d6b3b3b3d6d6d6e9e9e9d6d6d6d6d6d6e9e9e9b3b3b3514e4fb3b3b3818181514e4f9b9b9b -514e4f9b9b9bd6d6d6c9c2c4c9c2c4c9c2c4c9c2c4c9c2c4010101 -010101f50237f50237f50237f50237f50237f50237b78794d6d6d6d6d6d6c9c2c4b3b3b3818181 -9b9b9bd6d6d6d6d6d6ffffff9b9b9b9b9b9b9b9b9bc9c2c49b9b9bb3b3b3b3b3b3b3b3b3818181 -c9c2c4e9e9e9e9e9e9ffffffe9e9e99b9b9bb3b3b3b3b3b3b3b3b3d6d6d6d6d6d69b9b9bc9c2c4 -b3b3b3d6d6d6ffffffffffffffffffb3b3b3d6d6d6d6d6d6c9c2c4e9e9e9e9e9e9ffffffc9c2c4 -c9c2c4b3b3b3d6d6d6ffffffffffffffffffc9c2c49b9b9bd6d6d6c9c2c4c9c2c4d6d6d6b3b3b3 -9b9b9bb3b3b3b3b3b3e9e9e9e9e9e9ffffffd6d6d66968696968698181818181819b9b9b818181 -818181514e4f818181e9e9e9d6d6d6e9e9e9b3b3b36968698181819b9b9b8181819b9b9bb3b3b3 -818181696869c9c2c4d6d6d6c9c2c4c9c2c4c9c2c4c9c2c4010101 -010101f50237f50237f50237f50237f50237f50237b78794d6d6d6d6d6d6d6d6d68181819b9b9b -818181c9c2c4d6d6d69b9b9b9b9b9b9b9b9b9b9b9bb3b3b39b9b9bb3b3b3c9c2c49b9b9b9b9b9b -c9c2c4e9e9e9ffffffe9e9e99b9b9b9b9b9bc9c2c48181819b9b9bd6d6d6c9c2c49b9b9bb3b3b3 -b3b3b3c9c2c4ffffffffffffc9c2c49b9b9bd6d6d6d6d6d6b3b3b3d6d6d6e9e9e9e9e9e9b3b3b3 -d6d6d6c9c2c49b9b9be9e9e9ffffffd6d6d68181819b9b9bb3b3b3c9c2c4b3b3b3e9e9e9c9c2c4 -9b9b9b9b9b9b9b9b9bc9c2c4ffffffe9e9e99b9b9b8181819b9b9b9b9b9b9b9b9bb3b3b3c9c2c4 -818181818181514e4fb3b3b3ffffffffffff8181816968699b9b9b9b9b9b9b9b9bb3b3b3818181 -9b9b9b696869696869d6d6d6c9c2c4c9c2c4c9c2c4c9c2c4010101 -010101f50237f50237f50237f50237f50237f50237b78794e9e9e9d6d6d6c9c2c4818181b3b3b3 -b3b3b39b9b9bc9c2c49b9b9bb3b3b39b9b9b818181b3b3b3696869818181d6d6d69b9b9b9b9b9b -b3b3b3c9c2c4d6d6d6c9c2c49b9b9bb3b3b3b3b3b3b3b3b39b9b9b818181b3b3b3b3b3b3b3b3b3 -c9c2c4b3b3b3b3b3b3d6d6d69b9b9bc9c2c4c9c2c4c9c2c4c9c2c48181818181819b9b9bd6d6d6 -e9e9e9d6d6d6c9c2c4c9c2c4ffffffb3b3b3b3b3b3e9e9e9d6d6d6d6d6d6b3b3b3b3b3b3e9e9e9 -c9c2c4d6d6d6c9c2c4b3b3b3e9e9e9c9c2c4818181b3b3b39b9b9b9b9b9bb3b3b3818181818181 -9b9b9b8181819b9b9b696869d6d6d6c9c2c4514e4f9b9b9b9b9b9b696869514e4f818181818181 -9b9b9b818181818181c9c2c4e9e9e9d6d6d6d6d6d6d6d6d6010101 -010101f50237f50237f50237f50237f50237f50237b78794d6d6d6d6d6d6d6d6d69b9b9b514e4f -6968699b9b9b818181b3b3b36968699b9b9bb3b3b3818181b3b3b39b9b9b818181b3b3b39b9b9b -c9c2c49b9b9bb3b3b3b3b3b3b3b3b3d6d6d6b3b3b3c9c2c4c9c2c49b9b9bd6d6d6b3b3b3c9c2c4 -c9c2c4b3b3b3c9c2c49b9b9bb3b3b3c9c2c4c9c2c4c9c2c4b3b3b3b3b3b3c9c2c4d6d6d6d6d6d6 -d6d6d6c9c2c4b3b3b3c9c2c49b9b9bc9c2c4d6d6d6c9c2c4c9c2c4b3b3b3b3b3b39b9b9bc9c2c4 -b3b3b3b3b3b3c9c2c49b9b9b9b9b9b9b9b9bb3b3b3b3b3b3b3b3b3c9c2c49b9b9b9b9b9bb3b3b3 -9b9b9b818181b3b3b39b9b9b9b9b9b8181819b9b9b9b9b9b9b9b9b9b9b9b9b9b9b818181818181 -8181818181818181818181819b9b9bb3b3b39b9b9bc9c2c4010101 -010101f50237f50237f50237f50237f50237f50237696869818181d6d6d6c9c2c4d6d6d6696869 -818181d6d6d6696869e9e9e9818181c9c2c4e9e9e99b9b9be9e9e9c9c2c4c9c2c4ffffff9b9b9b -e9e9e9b3b3b3d6d6d6d6d6d6b3b3b3ffffff9b9b9be9e9e9e9e9e9d6d6d6ffffffd6d6d6e9e9e9 -d6d6d6d6d6d6ffffffe9e9e9ffffffe9e9e9ffffffffffffe9e9e9ffffffffffffffffffe9e9e9 -ffffffffffffe9e9e9ffffffc9c2c4e9e9e9e9e9e9d6d6d6e9e9e99b9b9be9e9e9b3b3b3c9c2c4 -c9c2c49b9b9bd6d6d69b9b9be9e9e9b3b3b3c9c2c4c9c2c49b9b9be9e9e9818181ffffffc9c2c4 -c9c2c4696869d6d6d68181819b9b9b9b9b9bb3b3b3696869b3b3b3696869b3b3b39b9b9b9b9b9b -9b9b9b514e4fb3b3b3514e4f9b9b9b514e4f9b9b9bb3b3b3010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f696869696869696869818181 -b3b3b39b9b9b818181e9e9e9b3b3b3b3b3b3e9e9e9b3b3b3c9c2c4b3b3b3d6d6d6e9e9e9c9c2c4 -d6d6d6b3b3b3e9e9e9e9e9e9c9c2c4d6d6d6c9c2c4d6d6d6c9c2c4c9c2c4e9e9e9e9e9e9ffffff -e9e9e9e9e9e9ffffffe9e9e9e9e9e9e9e9e9e9e9e9d6d6d6d6d6d6d6d6d6d6d6d6c9c2c4c9c2c4 -c9c2c4e9e9e9e9e9e9e9e9e9e9e9e9ffffffffffffe9e9e9ffffffd6d6d6ffffffe9e9e9e9e9e9 -ffffffc9c2c4ffffffd6d6d6ffffffe9e9e9d6d6d6e9e9e9b3b3b3e9e9e99b9b9be9e9e9c9c2c4 -c9c2c49b9b9bffffff8181819b9b9b696869c9c2c49b9b9bffffff818181c9c2c49b9b9b696869 -818181696869e9e9e9514e4fffffff514e4fb3b3b3d6d6d6010101 -010101f50237f50237f50237f50237f50237f50237514e4f6968696968696968699b9b9b9b9b9b -8181819b9b9b9b9b9b9b9b9b8181818181818181818181818181818181819b9b9b9b9b9b9b9b9b -9b9b9b9b9b9bb3b3b39b9b9bb3b3b39b9b9b696869818181b3b3b3b3b3b3b3b3b3c9c2c4b3b3b3 -b3b3b3b3b3b3c9c2c4b3b3b3d6d6d6b3b3b38181818181818181819b9b9b9b9b9b696869514e4f -6968699b9b9b9b9b9bb3b3b39b9b9b9b9b9b9b9b9b9b9b9bc9c2c4b3b3b39b9b9bb3b3b39b9b9b -b3b3b39b9b9bd6d6d68181819b9b9b9b9b9bb3b3b39b9b9b9b9b9bc9c2c49b9b9bb3b3b39b9b9b -b3b3b3b3b3b3c9c2c48181816968696968699b9b9b9b9b9bd6d6d66968699b9b9b696869302f2f -818181818181d6d6d6696869c9c2c4514e4f9b9b9bc9c2c4010101 -010101f50237f50237f50237f50237f50237f50237696869b78794818181818181818181818181 -8181819b9b9b9b9b9b8181819b9b9b8181818181819b9b9b818181818181818181696869818181 -696869696869818181696869696869302f2f0101019b9b9bc9c2c4c9c2c49b9b9b9b9b9b818181 -8181819b9b9b8181818181819b9b9b6968699b9b9b9b9b9bb3b3b39b9b9b696869696869696869 -8181819b9b9b6968696968698181818181816968696968696968696968696968699b9b9b818181 -6968699b9b9b818181514e4f302f2f818181818181818181696869696869302f2f6968699b9b9b -818181696869696869696869696869818181514e4f514e4f696869010101514e4f696869514e4f -696869696869514e4f696869696869818181818181302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f696869818181696869514e4f514e4f -514e4f514e4f514e4f514e4f514e4f514e4f696869696869818181818181c9c2c4696869302f2f -302f2f302f2f302f2f302f2f010101010101302f2fb3b3b3d6d6d6e9e9e9818181302f2f302f2f -514e4f514e4f514e4f514e4f010101514e4f818181c9c2c49b9b9b9b9b9bc9c2c4818181696869 -818181d6d6d6818181514e4f696869514e4f302f2f302f2f514e4f302f2f302f2fb3b3b3818181 -8181818181816968696968696968696968698181818181819b9b9b696869010101696869818181 -514e4f514e4f514e4f302f2f302f2f302f2f010101302f2f302f2f302f2f514e4f302f2f302f2f -302f2f302f2f302f2f010101302f2f302f2f010101010101010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f696869818181696869818181 -9b9b9b8181819b9b9b9b9b9b9b9b9b818181696869696869696869818181d6d6d6b3b3b3818181 -9b9b9b9b9b9b818181818181302f2f0101016968699b9b9bb3b3b3ffffffb3b3b3818181818181 -9b9b9bb3b3b39b9b9b9b9b9b302f2f6968699b9b9bb3b3b39b9b9be9e9e9ffffffe9e9e9302f2f -514e4fd6d6d6b3b3b39b9b9b9b9b9b8181819b9b9bb3b3b3696869302f2f302f2f9b9b9b818181 -6968699b9b9b696869818181818181696869696869696869696869696869514e4f818181c9c2c4 -9b9b9bb3b3b39b9b9b9b9b9b818181818181514e4f302f2f302f2f010101302f2f010101010101 -302f2f514e4f514e4f514e4f302f2f010101010101010101010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f696869696869696869514e4f -696869696869818181696869696869696869302f2f514e4f696869696869696869818181818181 -9b9b9b9b9b9b696869818181696869514e4f696869696869818181d6d6d6d6d6d6d6d6d6c9c2c4 -d6d6d6d6d6d6c9c2c4818181302f2f818181e9e9e9d6d6d6696869696869514e4f696869514e4f -c9c2c4c9c2c4d6d6d6e9e9e9d6d6d6c9c2c4c9c2c4b3b3b3514e4f302f2f010101514e4f818181 -818181696869818181696869696869696869696869514e4f514e4f6968698181818181819b9b9b -c9c2c4e9e9e9d6d6d6b3b3b39b9b9bc9c2c4696869302f2f302f2f302f2f010101514e4f818181 -9b9b9b818181696869818181302f2f302f2f302f2f302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f514e4f514e4f696869514e4f -302f2f514e4f514e4f696869514e4f696869696869514e4f696869696869696869696869514e4f -514e4f696869818181818181696869818181514e4f302f2f6968698181819b9b9bb3b3b3b3b3b3 -b3b3b3b3b3b39b9b9b8181819b9b9b818181818181c9c2c4514e4f514e4f302f2f302f2f514e4f -6968699b9b9be9e9e9d6d6d6c9c2c4b3b3b39b9b9b818181818181514e4f514e4f818181818181 -514e4f696869696869818181696869514e4f696869514e4f302f2f514e4f696869696869818181 -9b9b9b9b9b9b9b9b9b818181818181818181696869696869514e4f696869514e4f514e4f514e4f -514e4f514e4f514e4f302f2f514e4f514e4f514e4f302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f514e4f514e4f302f2f514e4f -696869514e4f302f2f514e4f514e4f514e4f696869514e4f514e4f818181818181696869302f2f -514e4f8181819b9b9b8181818181819b9b9b818181696869818181818181818181818181696869 -8181818181818181819b9b9b9b9b9b9b9b9b6968699b9b9b696869514e4f514e4f514e4f514e4f -6968699b9b9b9b9b9b9b9b9b818181818181818181818181818181696869818181696869514e4f -514e4f514e4f696869696869696869696869514e4f696869514e4f010101514e4f696869696869 -696869696869514e4f696869696869514e4f302f2f514e4f696869514e4f514e4f514e4f514e4f -514e4f514e4f302f2f302f2f302f2f514e4f514e4f302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f696869514e4f514e4f514e4f -696869696869302f2f302f2f696869696869514e4f302f2f696869696869818181818181818181 -8181818181818181818181818181819b9b9b9b9b9b818181818181818181696869818181818181 -8181816968698181818181818181819b9b9b9b9b9b9b9b9b9b9b9b514e4f514e4f696869818181 -9b9b9b8181818181818181818181818181818181819b9b9b9b9b9b818181696869696869514e4f -514e4f514e4f696869514e4f514e4f514e4f696869514e4f696869696869514e4f514e4f514e4f -696869514e4f302f2f514e4f696869514e4f514e4f514e4f696869514e4f514e4f514e4f696869 -818181696869514e4f302f2f302f2f302f2f302f2f302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f514e4f696869514e4f514e4f -302f2f696869696869696869696869818181696869696869696869514e4f696869696869696869 -8181816968698181818181818181819b9b9b9b9b9b8181816968696968698181818181819b9b9b -9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b818181818181b3b3b3818181818181818181818181 -8181818181816968698181819b9b9b9b9b9b9b9b9b8181818181819b9b9b9b9b9b818181818181 -818181696869818181818181696869302f2f302f2f302f2f302f2f514e4f696869302f2f302f2f -302f2f302f2f302f2f302f2f514e4f514e4f696869696869696869514e4f514e4f514e4f514e4f -514e4f514e4f514e4f514e4f514e4f302f2f010101010101010101 -010101f50237f50237f50237f50237f50237f50237514e4f696869514e4f696869696869514e4f -514e4f514e4f696869696869696869696869818181818181818181696869818181818181818181 -8181818181819b9b9b8181818181818181819b9b9b9b9b9b8181816968698181819b9b9b9b9b9b -9b9b9b9b9b9b8181819b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9bb3b3b3b3b3b3 -9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b9b8181818181819b9b9b9b9b9b818181 -8181819b9b9b8181819b9b9b9b9b9b818181818181696869818181818181514e4f696869514e4f -302f2f302f2f302f2f302f2f302f2f302f2f514e4f514e4f514e4f696869514e4f514e4f514e4f -514e4f696869696869514e4f514e4f514e4f514e4f514e4f010101 -010101f50237f50237f50237f50237f50237f50237514e4f696869696869696869696869696869 -6968696968698181818181818181818181818181818181818181819b9b9b9b9b9b818181696869 -8181819b9b9b9b9b9b9b9b9b8181816968698181819b9b9b818181696869696869818181818181 -9b9b9b8181819b9b9b9b9b9bb3b3b3b3b3b3b3b3b3b3b3b3b3b3b39b9b9b818181818181818181 -8181818181819b9b9b9b9b9b9b9b9b9b9b9b8181819b9b9b9b9b9b9b9b9b818181818181818181 -8181816968696968698181819b9b9b9b9b9b8181818181819b9b9b8181818181818181819b9b9b -818181818181696869696869696869818181696869696869696869696869514e4f514e4f514e4f -514e4f514e4f514e4f514e4f514e4f514e4f514e4f696869010101 -010101f50237f50237f50237f50237f50237f50237514e4f696869696869696869696869696869 -696869818181696869696869696869818181696869818181818181818181696869696869696869 -818181696869696869818181818181696869696869514e4f696869514e4f514e4f696869818181 -8181818181819b9b9b8181819b9b9bb3b3b39b9b9b9b9b9b9b9b9b818181696869302f2f302f2f -514e4f8181819b9b9b9b9b9b8181818181818181818181818181819b9b9b8181818181819b9b9b -9b9b9b8181819b9b9b8181818181818181819b9b9b818181818181818181818181818181696869 -696869818181696869696869696869696869696869696869696869514e4f514e4f514e4f514e4f -302f2f302f2f302f2f302f2f514e4f514e4f302f2f302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f514e4f514e4f514e4f514e4f -696869696869696869514e4f514e4f514e4f514e4f696869696869696869696869696869696869 -818181696869696869818181818181696869302f2f514e4f514e4f514e4f696869818181818181 -696869818181818181818181818181818181818181818181818181696869818181696869818181 -818181696869696869818181696869818181818181696869818181696869514e4f8181819b9b9b -818181818181818181696869514e4f696869818181818181696869696869696869818181696869 -696869818181818181696869696869514e4f696869696869696869696869696869696869514e4f -514e4f514e4f514e4f514e4f696869514e4f302f2f302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f514e4f302f2f302f2f302f2f -514e4f696869514e4f514e4f696869696869696869818181696869696869818181818181696869 -696869818181818181818181818181818181514e4f514e4f818181696869696869696869696869 -696869696869696869818181818181696869696869696869818181696869818181818181818181 -696869514e4f514e4f514e4f6968696968696968698181818181819b9b9b696869696869818181 -818181696869818181514e4f514e4f514e4f696869302f2f514e4f696869514e4f696869818181 -514e4f514e4f696869696869696869514e4f302f2f514e4f696869514e4f514e4f514e4f514e4f -514e4f514e4f514e4f514e4f514e4f514e4f514e4f514e4f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f302f2f514e4f514e4f302f2f -514e4f696869514e4f696869696869818181696869696869514e4f514e4f696869696869696869 -696869696869696869818181818181818181696869514e4f514e4f696869696869696869696869 -696869696869696869696869696869818181696869818181696869696869696869696869696869 -696869696869514e4f514e4f514e4f514e4f514e4f818181818181818181696869818181818181 -8181818181819b9b9b9b9b9b9b9b9b818181696869514e4f696869696869696869696869696869 -514e4f514e4f514e4f696869514e4f514e4f514e4f514e4f514e4f302f2f514e4f514e4f514e4f -302f2f010101010101302f2f302f2f696869514e4f514e4f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f514e4f302f2f514e4f514e4f -514e4f514e4f514e4f514e4f514e4f514e4f696869696869696869514e4f302f2f302f2f302f2f -696869696869514e4f696869696869696869696869696869514e4f818181514e4f696869696869 -696869514e4f696869696869696869696869696869818181696869514e4f514e4f696869514e4f -514e4f514e4f514e4f696869302f2f302f2f514e4f514e4f696869514e4f696869696869696869 -514e4f8181819b9b9b9b9b9b818181818181818181696869696869696869818181696869818181 -696869514e4f696869696869696869818181818181696869514e4f514e4f696869696869514e4f -302f2f302f2f302f2f302f2f302f2f514e4f302f2f302f2f010101 -010101f50237f50237f50237f50237f50237f50237302f2f302f2f302f2f302f2f302f2f302f2f -514e4f514e4f302f2f514e4f514e4f514e4f302f2f696869696869514e4f514e4f514e4f514e4f -514e4f514e4f302f2f514e4f302f2f514e4f696869818181696869514e4f696869696869696869 -514e4f514e4f696869696869696869514e4f696869696869514e4f514e4f514e4f696869514e4f -514e4f302f2f514e4f514e4f514e4f302f2f514e4f514e4f514e4f696869818181696869696869 -696869696869818181818181818181818181818181818181696869818181818181818181818181 -818181818181818181696869696869696869696869696869696869818181818181696869696869 -696869696869514e4f514e4f514e4f302f2f514e4f514e4f010101 -010101f50237f50237f50237f50237f50237f50237302f2f010101302f2f302f2f302f2f302f2f -010101010101302f2f302f2f302f2f302f2f302f2f302f2f514e4f514e4f696869696869302f2f -514e4f514e4f696869302f2f302f2f514e4f302f2f302f2f696869514e4f302f2f302f2f514e4f -302f2f514e4f514e4f514e4f302f2f302f2f302f2f514e4f514e4f302f2f302f2f302f2f514e4f -514e4f302f2f010101302f2f302f2f302f2f514e4f514e4f302f2f514e4f514e4f514e4f514e4f -818181696869514e4f696869696869696869818181818181696869696869696869514e4f696869 -696869696869696869514e4f696869696869302f2f302f2f302f2f514e4f514e4f302f2f514e4f -514e4f514e4f514e4f514e4f302f2f302f2f302f2f302f2f010101 -010101f50237f50237f50237f50237f50237f50237514e4f514e4f302f2f514e4f514e4f514e4f -696869514e4f514e4f696869514e4f696869696869514e4f514e4f696869818181818181818181 -696869696869818181818181696869514e4f514e4f514e4f696869818181514e4f514e4f696869 -696869696869696869514e4f514e4f514e4f696869818181818181818181818181818181696869 -818181818181696869696869514e4f514e4f696869514e4f696869818181696869696869696869 -6968698181816968696968696968698181818181819b9b9b9b9b9b818181818181818181818181 -818181818181818181696869818181818181696869696869696869514e4f514e4f696869818181 -818181696869696869696869514e4f302f2f302f2f302f2f010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9 -ffffffe9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9ffffffe9e9e9e9e9e9e9e9e9 -e9e9e9e9e9e9ffffffffffffe9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9 -e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9ffffffffffffffffffffffffffffffe9e9e9 -e9e9e9ffffffffffffe9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9 -e9e9e9e9e9e9ffffffe9e9e9e9e9e9e9e9e9e9e9e9ffffffffffffffffffffffffe9e9e9e9e9e9 -ffffffffffffe9e9e9e9e9e9e9e9e9ffffffe9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9ffffff -e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9e9010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -d6d6d6d6d6d6ffffffffffffffffffffffffffffffe9e9e9d6d6d6d6d6d6ffffffffffffffffff -ffffffffffffffffffffffffffffffe9e9e9b3b3b3d6d6d6ffffffffffffffffffffffffffffff -c9c2c4c9c2c4d6d6d6ffffffffffffffffffffffffd6d6d6d6d6d6d6d6d6e9e9e9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -d6d6d6302f2f818181ffffffffffffffffffffffff818181302f2fd6d6d6ffffffffffffffffff -ffffffffffffffffffffffffb3b3b39b9b9bc9c2c4514e4fb3b3b3ffffffffffff9b9b9b696869 -d6d6d6d6d6d6818181696869e9e9e9ffffffffffffb3b3b3302f2f9b9b9be9e9e9ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffff302f2f302f2fffffffffffffffffffffffff514e4f010101ffffffffffffffffffffffff -ffffffffffffffffffe9e9e9302f2fe9e9e9ffffffc9c2c4b3b3b3ffffff9b9b9b010101d6d6d6 -ffffffffffffe9e9e9514e4f514e4fffffffffffffd6d6d6010101b3b3b3ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffff818181010101b3b3b3ffffffffffffd6d6d6696869010101ffffffe9e9e9c9c2c4e9e9e9 -ffffffe9e9e9c9c2c4e9e9e90101019b9b9bffffffffffffffffffffffff302f2f9b9b9bffffff -ffffffffffffffffffd6d6d60101019b9b9bffffffd6d6d6010101b3b3b3ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffb3b3b3818181514e4fffffffe9e9e9b3b3b3b3b3b3010101ffffffd6d6d60101019b9b9b -ffffff818181514e4fffffff696869010101696869e9e9e9ffffffc9c2c4010101d6d6d6ffffff -ffffffffffffffffffe9e9e9302f2f818181ffffffd6d6d6010101b3b3b3ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -e9e9e9b3b3b3c9c2c4010101d6d6d6d6d6d6b3b3b3c9c2c4302f2fe9e9e9ffffff696869514e4f -ffffffc9c2c4d6d6d6ffffffffffffb3b3b3010101302f2fe9e9e9c9c2c4010101c9c2c4ffffff -ffffffffffffffffffffffff514e4f696869ffffffd6d6d6010101b3b3b3ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -c9c2c4b3b3b3ffffff514e4f696869b3b3b3ffffffd6d6d6302f2fe9e9e9ffffffd6d6d6302f2f -d6d6d6c9c2c4ffffffffffffffffffffffffe9e9e9302f2f302f2fffffff302f2f696869ffffff -ffffffffffffffffffe9e9e90101019b9b9bffffffd6d6d6010101b3b3b3ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -818181b3b3b3ffffff9b9b9b010101b3b3b3ffffffe9e9e9302f2fe9e9e9ffffffffffff302f2f -818181e9e9e9ffffff9b9b9bd6d6d6ffffffffffff514e4f302f2fffffff818181010101c9c2c4 -ffffffffffffffffff9b9b9b302f2fe9e9e9ffffffe9e9e9010101b3b3b3ffffffffffffe9e9e9 -b3b3b3e9e9e9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffe9e9e9 -010101514e4fe9e9e9ffffff696869ffffffffffff818181010101818181ffffffffffffb3b3b3 -302f2fffffffffffffb3b3b3514e4fb3b3b3b3b3b3514e4fd6d6d6ffffffffffff818181302f2f -9b9b9bd6d6d6d6d6d6696869c9c2c4ffffffffffff9b9b9b010101696869c9c2c4c9c2c4514e4f -818181ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffe9e9e9 -b3b3b3b3b3b3e9e9e9ffffffe9e9e9ffffffffffffc9c2c4b3b3b3b3b3b3ffffffffffffffffff -9b9b9bffffffffffffffffffc9c2c4c9c2c4c9c2c4e9e9e9ffffffffffffffffffffffffd6d6d6 -818181302f2f514e4fffffffffffffffffffffffffc9c2c4b3b3b3c9c2c4c9c2c4c9c2c49b9b9b -e9e9e9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9e9e9b3b3b3 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffc9c2c4302f2f302f2f818181d6d6d6ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff514e4f818181 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffff818181302f2f818181ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9e9e9ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffe9e9e9ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4fffffffffffffffffffdd7e8fec2d9 -fec2d9fec2d9fec2d9fec2d9fec2d9fec2d9fec2d9fec2d9fdd7e8fdd7e8fec2d9fdd7e8ffffff -fcabc5fcabc5fdd7e8fec2d9fec2d9fec2d9fcabc5fec2d9fffffffdd7e8fcabc5fcabc5fec2d9 -fec2d9fec2d9fec2d9fdd7e8fffffffdd7e8fcabc5fec2d9fdd7e8fcabc5fcabc5fec2d9fdd7e8 -fdd7e8fdd7e8fffffffdd7e8fcabc5fcabc5fdd7e8fec2d9fdd7e8fec2d9fec2d9fffffffec2d9 -fcabc5fec2d9fec2d9fcabc5fcabc5fec2d9fec2d9fec2d9fec2d9fdd7e8ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -fdd7e8fec2d9fec2d9fec2d9fec2d9fec2d9fdd7e8fec2d9fdd7e8fdd7e8fec2d9fdd7e8ffffff -fec2d9fec2d9fdd7e8fdd7e8fdd7e8fec2d9fcabc5fec2d9fffffffffffffdd7e8fec2d9fec2d9 -fec2d9fdd7e8fec2d9ffffffffffffe9e9e9fdd7e8e9e9e9fdd7e8fcabc5fec2d9fdd7e8fdd7e8 -fec2d9fdd7e8ffffffe9e9e9fec2d9fec2d9fec2d9fdd7e8fdd7e8fec2d9fec2d9fffffffdd7e8 -fec2d9fec2d9fec2d9fcabc5fec2d9fdd7e8fec2d9fec2d9fec2d9e9e9e9ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffe9e9e9 -e9e9e9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffe9e9e9 -c9c2c4b3b3b3b3b3b3d6d6d6e9e9e9ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffc9c2c4 -ffffffffffffffffffd6d6d6c9c2c4d6d6d6ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffe9e9e9302f2f -9b9b9bc9c2c4d6d6d6d6d6d6ffffffc9c2c4d6d6d6ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffd6d6d6010101 -302f2f302f2f302f2f514e4fe9e9e9ffffffb3b3b3e9e9e9ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffe9e9e9514e4f -514e4f514e4f302f2f514e4fe9e9e9ffffffd6d6d6d6d6d6ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffe9e9e99b9b9b -d6d6d6e9e9e9b3b3b3d6d6d6ffffffffffffffffffc9c2c4e9e9e9ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffe9e9e9302f2f -818181b3b3b3818181c9c2c4c9c2c49b9b9bc9c2c4d6d6d6e9e9e9ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffd6d6d6e9e9e9ffffffffffffffffffffffffffffffe9e9e9e9e9e9e9e9e9ffffffd6d6d6 -e9e9e9ffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffd6d6d6302f2f -514e4f514e4f302f2f302f2f514e4f6968699b9b9bffffffd6d6d6ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -e9e9e9c9c2c4e9e9e9d6d6d6d6d6d6e9e9e9e9e9e9ffffffe9e9e9e9e9e9d6d6d6e9e9e9c9c2c4 -c9c2c4e9e9e9e9e9e9d6d6d6d6d6d6ffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffe9e9e9514e4f -696869696869514e4f514e4f8181819b9b9b818181ffffffd6d6d6ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffe9e9e9ffffffd6d6d6d6d6d6d6d6d6e9e9e9ffffffd6d6d6e9e9e9d6d6d6e9e9e9e9e9e9 -d6d6d6e9e9e9e9e9e9d6d6d6e9e9e9ffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffe9e9e9 -e9e9e9e9e9e9e9e9e9e9e9e9ffffffd6d6d6d6d6d6ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101f50237f50237f50237f50237f50237f50237c9c2c4ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101010101010101010101010101 -010101010101010101010101010101010101010101010101010101 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/dubois.gif b/Docs/Books/dubois.gif deleted file mode 100644 index 36e0af7a41d862855bfb9734f693d6e016926ca5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2026 zcmV4AZPA^8LV00000EC2ui0Av7y000F4aL7rky*TU5yCz`B98GB+ zXnGWD$`)|E#>j7~k4B2dLa zr{<|+{gg`2=;+laY;cR;tMoAzxNkOVf`fwvCWM3n4-XA&Q9Cz0L3c)BGYxzJ4}LL% z1p+Msh-@VX0*#0O4FQ^rZ#8i^0s)||KR}cq3@k}6p_rSro@)Zdi;SZUpv5o%g8-k4 zr>BH0h=2hKd0uv_y>`a+>fDWF6Qzc-4@)u7PjEd_2NEGO3ikBgb_X@C*wn$r`Rhu?p zB7^V%xLq(}uF$9K$2g1QHnG5XAYMsBZ~U2pS3o8S2kYEj+*IyB%Left&?*}&jFF~Kr+$rPR4OB=6w=(FP}K-V38)RBGU6I@mY8DMSW=vFGloH0W>4+iD>36O zKev3|I#MMGC|+YJvpZ2vkupX46djYM%%;LFXIGpJ;9#(*xuX0Tg2)CM6lb_|=Z05N zN^BHj(^HD)frhtX|0&_qcRp{c@k)=DET6MT(Y8#L?vQ5W|Lu7kS2aTrkLf8RIS;g z3?D)HfDM9XGf!9~#5m=LEvhLEIwu{FB$L{_2&I@nf>2~OS?-u=ilTlPql!X+wn&9o z_7PTDIJUG>Hn8@{&M}!58C|TNwn{+%k&nh`WOOrTY2t^-4hYyRuO2&^q-xTdjgFxT z8m+QqHoIsx;VNnFksES2W46*LC**$GIykMGJo0<)j-tZ4Ykva*X`E7%UWuzsL5jFHKrm00q;R}LH{zeai--F+=Wx}h;D z;v7?#$K`tSvEI&@vtS(}jB&ZL8ExUT{)_a? zc1tTQv1I3MGrN8(?6X%3RlR& z3p%SPEsUWIRVc$6j*x~n%pnJHsKXvskcU1DA_P^~i~!!|fz=sF0Ot|FP6*M1FKl1| zBosg>DY1d28Av?*(iGPJ#G?TV5XBQCNJAwBka+27*PPj*hE3vhmLi0;X+^-K!P}<1bwuR0N6910DOrzZZskl51B|3 z-tmAxaHAm(phf^>Lmf)AgBoqZ$asuFj)?4JM^s1x`UC(gQ)J2lSfI%T0Dv1tG^8G7 z89)^>0wQ{JKq-HDDTpXBM(h~?BLz^(K+>@~225lL1E~Ob1RyH|AdV`0sfvLJM2S%1 z1R1vYB@}3bnA^NdZjR8ANg4$O*@Om^;%Jn~h*6e6L}Dx@NJ5G|@v7IO576RqI~6M%q{n$)BTAZY>sU;qPh*A3FOt{J>5UVrG;y{fgZ zer;<+1M5-15_YbJJ*-_5tJu6Uwy}I2EMx`Sg;q`$v68(kW-F`N5bCwFpVe$=FFV@F zmKL(7ZER{4yV}FHmawl4Y;65H+r8EnueYshZsoe$xAvB;zfEg!%{ttU7FVOky=ZbN zy4;607opFWh38{C3sKHem#mq+t_7nD(CKP-mfrm?0Jz)9ZH`sE@z~}O>VaPHW|omJ zXm5Hysm#laWCim5pnb>$k4CijgK(4SzGUmk3Xd4I&`?HyTkIx z$=%#p*V^9j?eBz^r0q&nA^8LV00000EC2ui0Av7s000F45XecZy*TU5yB;9egk))+ zXsWJkOG@SF&U9_BFe%@B@1wcU?nf-vf+AzD!DPmo(5Py7k~A2FtXAuYG8vDscuX#v z#f&Rs&4#ky??%FbP0ZkXpn3DqqmRXpZ137CWawBV_rn`%%HGK^Z!gmP+cfxXAn*boLnXZ;8 zg}l^_N-I|;FbtM@uK>Oc3ghJE;|2y{)xJEASGctyoD-FiE#eC3>eZ*$!v7BJblW0> z)-YpqQZz{SfS;)c>~84U67ZFXTzO2GnQ-%vwLJBy=p3}+gTbXLh=ZbE-AZi0RaTq*Ke=8Eaq95X_ygU zvVbO~m1eH8<;&#|CuSze!XOdo3@Fe{x{5}hc2eVcd8p~vs_I6Ue#;q}XV!*XQ_W{} zk?h$xY6nzZASiAD4`RR;%j-Ar6oLZ|S6Qq9qR{)UI)85Z<%PJ%8zb7zeXB-00a2%s z#hjOz(4xmRDIff$Z7k737;s1ierEbWa5m8Y9a2pmxj#x+4i z3$3NwOAMJ|K#C{XvduRH9)&^!2r42(l!-v}92Hz?(b-2SP`OkHURKH75Jw$a%&>Rg#eiPJ9+>s24o#1c#nI9m+&f6Ur&u ze2_Y7X`ygr%8f=sw2;&T@WGczQ@ml<&t3DqG#`&TcpB0OVG3a9ovEtYU=)cO%78;h zLRreC!1AeSEpOW8D>Z2zyGWXd8CoX)U~>KnCMhzK_UsG?u4U5@XB?>`gRQpt?F*bH zF{2E%j>~GNE@W$17}d^b?zOIpccPB;vJk6M%z9X^nHk!P)q?q|5UqH#DpBy0Rfg*D z!=_q8;lEiSnD79QmX}csE36r)wrdSMF~B6v?1_eg~4@*sQoHHBp zm@Il|B2?J}2$cW;#Z2=+0%CccvcX}?Is@6o0nB3BBS7+z+YGEJH@jemJ@!irEbx&n z2`J8Y+I?W0n@?hcOE}$z&(OF3CdF;uigCFFRmcNuG&H!mh35wG>Z>mu3y#{W#(j+7W^$iRpu1VsyL%v2(YQSB~?N;(0g705P|3mN#%t5^EU)T;5=?N&n z{OJH=GX@pEvvB-{nri(9++~3OdpOrHt?H$=k~#GfNI!Ld)P$Fh4G+%CpHl)Tz-yGL zfWVP}g%-%b20HM85R9M%e=p$&)VfDG1i7n9O8lFcMGo0rX zrzAVcOlX=CkhmOW3KKv_WqL9J2iT!48F|KI3e%Y4Or}5o=uUzP)Sl5yXbcZP&rYr~ zg?ZeiFt7PRE9TPwijxe$I0rh=gnIOxo`j_$H+oDv@bjVbEC449NzsZf(Vz>(B`P=i z%7T7$nKn(RIO&jpi()j7ylg1}py)wf7So(Gy{S$Q%1nPIRh)LP=TC9j(i9T4l!bIB zO-E|ToHiAp96jnONy<=E&Y`J!6lx5ic*j(dagku{s8X9s*19@1pyOmfNqcI@LNc_D z)x0ViD*^1#S8O8FjB}I#U~QQ~O=^^*0i7#k8;eiJ zl5?TP1f*mGQd!LA^PDW~W*rZSOEZ>LuCSD)M;mL}#g10Bs0@fUi3!ins!@=3+@mNH zTUOD&lDCcj6=+=1mzrH#)U8u|q$U@+TxgoMoJf6aTuTaFdvdh2QPmnP8w$fb%NzR%^GmAS;El6>j<}ac$l0fw!Q3(peFuzrd zU`6Nuh@T6_#EzAfXV&5kk%`sGZkDK|oTDyFJli^_7LKpuYHWpyB2(Zn3@u_PpLlhtz+=DP;EJ|9o)yM3NBVgrv zIc_9wGlX-5xouuS+2URsAagDbPlv<6QuJrPA2tXDvPJt}oGu*Vi zHmKEy*TU5yAEI>j$~<; zKuQ8<>yltB&vZ>o@vDm|JN7=7YNxXqk1||{XzKldDCdw_LRxJ&>dN=zcAbT(wrV>Z z7-utMeO{v(Aj$Xy{Q~d2Ijn3xFAxZ32n&5@aRPcgLU)XfLttZ9l801cj+cyKcyp6i zaynjin4_6gA)QE{IXk4Sn0ly2N&!TVuD5kR4Gbo01+lV-T9=x*qa+Om1`W*3$p$09 zNy4?p)|+9^&dthXz@OFE;wk{!1O(jBw9+x)pyT6tB5u3|^}p=x)bH@u1|83QOiEsfHYSf-de zWj+v_pyPv@9&4_Vsr5xyYl?n&3j@MUrl3VweZ&AD2GB&3P!h5S#z-RtP>6;Z`osoF8Ae#*g!0TqLsBv*03nH$tmlZ2 zhFQ`_0#FrV(<$i<^I3vS0?=4kXsI=wdR*Od;4w8m)SY*gRM(Ui4Nf^m5O0Ag+BAt= z2@i#4PPxjM4JC5s400^-n1pJQ6I+_-0e4CwYw|g#K7Y>G!x{@Dn&=u>$~h>ZGE{NG z8qAzy>2b~^w@8|g-XH*yl8(SYcIPnj<_gh_w@ZJKbPB11B#cUG0|Rz}s$4@P$7)5c z()nqmv64zatrGdQ5R+#5*Xt}umZTm3u_J)>3tMJXD1wEsyxHp^HdKn$2@i|~2Lc0- zG{6G^Brre$>OQbQwmEFeZKTVb18p>mp{u}R~(Pq(@e3oN9 z8L+?_gM_=lx2U=N^2P)hup+gY0w`xdWy(Kny4=aB>3f>W+W{$oszY$=3`2 zs|?vi4g%gfyKD1Kr*}v@2+>zh{p_{_#kiutci;8*FryO#`M763_`mLo9rUh8vYLd8 zTnO;p*d}(m;N8y#;~|@l2BLuCU}X(;`A=P-wgv?xr#E#eP6b71G^ly+2+?Vp3TrSt z8Z1M6E3|>*2GznE%!dXuoZ%64v_l;3h=5IM|Z`iqMJ@S_&d22N-`^Iw$Y%rwvG#p3WY zWDgL)VxU$*laW#Xln8YtJ;zzeL8`2gB5UOJ-uM9QB{K#(GO0K-dQdiYw45Kks7NQ6 zM!XFuEMU~ABMrJzmnzhw?JMI<*|$iO(ez&dP-))gNXnijG#06}f;sys%sF;X0RxR* zE&rvXeD0K`PK{bvyn_gEf z*rHj5u!c9xn0QuLy*f&cSpm%95^p%7-yKwE{n%hHI^f03c(G$2-~h*(7{VWBM~LG# zU>ke!QkMc?scyXC91n7eVk2>Y7j`aEJwR9uAhL#yj797vdBfRpz`qvu0862xq4X(< zk4;Qv%C57;e-tPgnLGee{mTJE-s=>bD&+x`d9Er|^0}&s<~9>R%TGSXo8yes05nc? ztfZL#7nz90JMR#8dPbSxKna2w*Z5qP8uXX7$iC~bWwU7Wokzl)E;2e=hPYERG!w8) zpy<@aafb7z3*9)JVD$h3AgJ1k$e35#ImKAy-RJ^bL{>|W&WkP;CS@IEPGi;6nv-62 z&q9b{Vpxl(M(&k~T~;mT%3u{25M0c7Sza`W!C~y6H%N zZl2^cv2`J8T=w9QbT2Y1T*$?9>~1rH_!RbOCSOOJBpH_`v3p{ diff --git a/Docs/Books/in_21.txt b/Docs/Books/in_21.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/Books/manual.eps b/Docs/Books/manual.eps deleted file mode 100644 index 8bb88345060..00000000000 --- a/Docs/Books/manual.eps +++ /dev/null @@ -1,1221 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /opt/local/x1/work/bk/mysql/Docs/Books/manual.eps -%%CreationDate: Sun Dec 31 14:30:17 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 294 383 -%%EndComments -%%BeginPreview: 100 132 1 132 -% fffffffffffffffffffffffff0 -% 800000000000000000ff7c0010 -% 8000000000000000007fde0010 -% 8000000000000000003fef0010 -% 8000000000000000000ff7c010 -% 80000000000000000007bbe010 -% 80000000000000000001cef810 -% 80000000000000000000fb3c10 -% 800000000020000100007ffe10 -% 80000025130509400a603fef90 -% 800000000000000000000f7bd0 -% 8000000000000000000007fdf0 -% 8000aaaaaaaaaa55550543def0 -% 800100002410009012549cf770 -% 800024200041000100000079b0 -% 8001014a948855244924921ef0 -% 80002800201200011000040f70 -% 800102524540955422aaa007b0 -% 80002400800a52aa84000401f0 -% 8001089414954a4951492200f0 -% 80002101205250025510040070 -% 80010424454a82a894a2a00010 -% 80002088895410012544040010 -% 80010a11152924921490900010 -% 8000204224a201004aa2040010 -% 800109085554522a0484500010 -% 8000204149208040a2a0840010 -% 80010514aaa214890924100010 -% 800020229244410022a1240010 -% 80010a44aa88882a4488440010 -% 8000200a949112408822000010 -% 800104a4a50220091144940010 -% 8000210a94a404a02008040010 -% 80010824aa08a1050521240010 -% 8000224a929008204804440010 -% 80010415542292491150840010 -% 800120924a8400822202100010 -% 8001092aa910a4104048440010 -% 800110124a2209248a02040010 -% 800102aaa904400100a8a40010 -% 800124124a4892a82901040010 -% 800108aaa88100024024240010 -% 80011109251225240a40840010 -% 8001202aaa204000a08a100010 -% 8001051249050a540410440010 -% 8001104aaa4820012122040010 -% 80010214921109484840a40010 -% 8001288aaa824002020a000010 -% 80000129242415289090440010 -% 80012405558880010422140010 -% 80000894921024a42104800010 -% 80012102aaa288008848240010 -% 8000042a4940112a1211040010 -% 80012082aa4a42004082440010 -% 80010a11254008520924140010 -% 80012044a9294100a240840010 -% 800104889550142404a9240010 -% 80011011249240892120040010 -% 80012282155409104a85440010 -% 800104244924a02204a0100010 -% 80002088055505049549240010 -% 800109115124a0482902040010 -% 80002220045554814a90440010 -% 800104452089252aa924940010 -% 800020800912aaa52401040010 -% 80010914a22001284148240010 -% 80012200044488020812440010 -% 80010452908022a4a240040010 -% 80011080021550000409540010 -% 8001220820414a2120a2040010 -% 80010442890a54840000440010 -% 800129fffffffffbfffc940010 -% 800101fffffffffffffc000010 -% 800101fffffffffffffc040010 -% 8000bfffffff9ffffffdf80010 -% 800001ffffff9ffffffc000010 -% 800001ffffffdffffff8000010 -% 800001ffffff4ffffffc000010 -% 800001ffffff4ffffff8000010 -% 800001ffffff67fffffc000010 -% 800001ffffff7ffffff8000010 -% 800001fffffffffffffc000010 -% 80000186109470bdc41c000010 -% 800003d2f3bc979dbafc000010 -% 80000b927b9db7cf3efd000010 -% 800013d65296b0a57ebc400010 -% 80000bc6fbbc77b33ef9400010 -% 80000396f3bdb7f93efd000010 -% 800001da539492b99adc000010 -% 800001fbbfeffdffe6b8000010 -% 800001ffffffffdffffc000010 -% 800001ff7bbb933b9ff8000010 -% 800001fe73b9d7bbbffc000010 -% 800001fe739cf7bbbff8000010 -% 800001ff335a5739bffc000010 -% 800001fe9b1b37b5bff8000010 -% 800001fedacbb32cbffc000010 -% 800001fedaebb92c93f8000010 -% 800001fffffffdfffffc000010 -% 800001fffffffffffff8000010 -% 80000000000aab000248000010 -% 80000000000124000000000010 -% 80000000000090000000000010 -% 80000000000040000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000040000000000001000010 -% 80004200000002004240000010 -% 80000022110410240004400010 -% 80000000400000000800000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000010000004000000010 -% 80000000200202000020000010 -% 80000109000000004040000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 8002aaaaaaaaaaaaaa90000010 -% 80000000000000000825540010 -% 80000000000000000000000010 -% 80000000004020000000000010 -% 80000000020100100000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% fffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 368.503937 translate -279.169649 -368.503937 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 132 8 -% Transformation matrix -[ 100 0 0 132 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102 -010102c6c8cdffffffececefececefececefececefececefececefececefececefececefececef -ececefececefececefececefececefececefececefececefececefececefececefececefececef -ececefececefececefececefececefececefececefececefececefececefececefececefececef -ececefececefececefececefececefececefececefececefececefececefececefececefececef -ececefececefececefececefececefececefececefececefececefececefececefececefececef -ececefececefececefececefececefffffffc6c8cd010102010102010102010102010102010102 -0101021c2026969aa13b424a0101020101020101023b424ae2effaffffffffffffececefececef -ececefececefececefececefececefececefececefececef010102 -010102ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffe2effa1c2026010102010102010102010102 -0101020101021c2026777f88777f881c20260101020101021c2026ececefffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffff5d636c010102010102010102 -0101025d636c1c20260101025d636c969aa13b424a010102010102010102969aa1ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffadb4bc010102010102 -0101023b424a3b424a0101020101023b424ac6c8cd5d636c0101020101020101023b424affffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe2effa1c2026 -010102010102010102777f88777f88010102010102969aa15d636c010102010102010102010102 -c6c8cdffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -777f880101020101021c2026777f8867a3d11c20261c20265d636c5d636c777f88010102010102 -010102777f88ffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffadb4bc0101020101020101023b424a5d636c5d636c0101021c2026adb4bc969aa11c2026 -0101020101023b424affffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -969aa1c6c8cdffffffc6c8cdadb4bcadb4bcececefececefc6c8cdc6c8cdececefffffff969aa1 -adb4bcffffffd7dde5777f88d7dde5ffffffc6c8cdc6c8cdc6c8cdffffffffffffffffffececef -969aa1ececefffffffadb4bcadb4bcd7dde5ffffffc6c8cdd7dde5ffffff9ec8e8969aa1ffffff -ececefc6c8cdffffffd7dde5c6c8cdc6c8cdffffffececefc6c8cdd7dde5ffffffffffffffffff -ffffffffffffececef1c20260101020101021c20265d636c1c20260101020101025d636c5d636c -3b424a010102010102010102c6c8cdffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -777f88c6c8cdffffff969aa1c6c8cdadb4bcc6c8cdffffffadb4bc969aa1d7dde5ffffff5d636c -777f88ffffffffffff777f88ffffffffffff969aa1777f88adb4bcffffffffffffffffffd7dde5 -777f88ececefffffff969aa1c6c8cd777f88ffffffc6c8cdc6c8cdffffffc6c8cdadb4bcffffff -d7dde5adb4bcffffff777f88c6c8cd969aa1ececefececef5d636c777f88ffffffffffffffffff -ffffffffffffffffffffffff777f880101020101020101023b424a3b424a0101020101023b424a -5d636c1c20261c2026010102010102777f88ffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -d7dde5ffffffffffffffffffd7dde5d7dde5ffffffffffffc6c8cdadb4bcffffffffffffc6c8cd -c6c8cdffffffffffffc6c8cdffffffffffffececefececefececefffffffffffffffffffffffff -c6c8cdececefffffffc6c8cdc6c8cdd7dde5ffffffd7dde5ececefffffffd7dde5d7dde5ffffff -ececefd7dde5ffffffd7dde5c6c8cdc6c8cdffffffffffffd7dde5adb4bcececefffffffffffff -ffffffffffffffffffffffffffffffc6c8cd0101020101020101020101025d636c3b424a010102 -0101023b424a777f880101020101020101023b424affffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffff3b424a0101020101020101023b424a5d636c -0101020101025d636c777f88010102010102010102010102010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffadb4bc3b424a777f88777f88969aa1777f88969aa1777f88969aa1969aa1777f88 -969aa1969aa1969aa1969aa1969aa1969aa1969aa1777f88777f88777f88777f88777f88777f88 -777f88777f88777f88777f88777f88777f88777f88777f88777f88969aa1969aa1969aa1969aa1 -969aa1969aa1969aa1adb4bcadb4bc969aa1777f88969aa1969aa1777f88969aa1969aa1969aa1 -969aa1969aa1777f88969aa1969aa1969aa1969aa1adb4bcadb4bcadb4bcadb4bcadb4bc969aa1 -969aa1969aa1969aa1969aa1969aa1969aa1adb4bcc6c8cd5d636c010102010102010102777f88 -777f881c20260101025d636cadb4bc5d636c010102010102010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88969aa1d7dde5adb4bcc6c8cdadb4bcc6c8cdadb4bcc6c8cdadb4bcc6c8cd -c6c8cdadb4bcc6c8cdadb4bcc6c8cdadb4bcc6c8cd9ec8e8969aa1969aa1adb4bcadb4bcadb4bc -adb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bc -c6c8cdadb4bcc6c8cdc6c8cdadb4bcadb4bcadb4bc969aa1adb4bcadb4bcadb4bcadb4bcadb4bc -adb4bcadb4bc969aa1969aa1969aa1969aa1adb4bc969aa1969aa1adb4bc969aa1adb4bc969aa1 -969aa1969aa1969aa1969aa1969aa1969aa1969aa15d636cd7dde5d7dde5010102010102010102 -5d636cadb4bc3b424a0101021c2026969aa15d636c010102010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5e2effa9ec8e89ec8e8b6daf59ec8e8b6daf59ec8e8b6daf5b6daf5 -9ec8e89ec8e8b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5 -b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5 -b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5 -b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5 -b6daf5b6daf5d7dde5b6daf5d7dde5b6daf5ffffff969aa1adb4bcffffffffffff3b424a010102 -0101021c2026969aa1969aa11c2026010102777f88777f88010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf584b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd9ec8e8 -9ec8e89ec8e89ec8e884b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1adb4bcffffffffffffffffff777f88 -0101020101020101025d636c969aa13b424a0101025d636c010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1969aa1ffffffffffffffffffffffff -c6c8cd0101020101020101023b424aadb4bc5d636c010102010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd -84b7dd84b7dd84b7dd84b7dd84b7dd84b7dd84b7dd84b7dd84b7dd9ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1adb4bcffffffffffffffffffffffff -ffffffffffff3b424a010102010102010102777f883b424a010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd84b7dd84b7dd67a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -84b7dd84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88adb4bcffffffffffffffffffffffff -ffffffffffffffffff777f88010102010102010102010102010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d184b7dd84b7dd84b7dd9ec8e884b7dd9ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1969aa1ffffffffffffffffffffffff -ffffffffffffffffffffffffc6c8cd010102010102010102010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd -84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd84b7dd67a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1adb4bcffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffff3b424a010102010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffff777f88010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cc6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88c6c8cdb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd84b7dd84b7dd9ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cd7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cd7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8b6daf5 -9ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cd7dde5b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88c6c8cdffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff969aa1d7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa969aa1d7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececefb6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef777f88d7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cd7dde59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff777f88d7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cd7dde59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff777f88d7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff777f88d7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cd7dde59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff777f88ececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff777f88ececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ffffff777f88d7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88d7dde59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa5d636cececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa5d636cececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d19ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cd7dde5ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d184b7dd9ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef777f88ececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff5d636cececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88ececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88ffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef777f88e2effaffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88ffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88ececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88ececef9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e884b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -84b7dd84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d184b7dd9ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa777f88ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88ffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e884b7dd84b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d184b7dd84b7dd84b7dd84b7dd84b7dd67a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d19ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88ffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd84b7dd67a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d167a3d167a3d184b7dd84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88ffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8b6daf59ec8e89ec8e89ec8e884b7dd84b7dd -84b7dd84b7dd84b7dd67a3d167a3d167a3d167a3d167a3d184b7dd84b7dd84b7dd84b7dd84b7dd -84b7dd84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef5d636cffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8b6daf5b6daf5b6daf5 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef5d636cffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e884b7dd67a3d19ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef5d636cffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e867a3d167a3d167a3d167a3d1 -84b7dd9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8ececef5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef5d636ce2effa9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8b6daf5 -b6daf59ec8e89ec8e8b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5 -b6daf5b6daf59ec8e89ec8e8b6daf5b6daf59ec8e884b7dd67a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d184b7dd9ec8e8b6daf5b6daf59ec8e89ec8e8b6daf5b6daf5b6daf59ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8e2effa5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef5d636cffffff9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -b6daf59ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8 -9ec8e89ec8e89ec8e89ec8e8b6daf584b7dd67a3d167a3d167a3d167a3d167a3d167a3d167a3d1 -67a3d167a3d167a3d184b7dd9ec8e89ec8e8b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5 -b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5b6daf5 -9ec8e89ec8e89ec8e89ec8e89ec8e89ec8e8d7dde5777f88ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef5d636ce2effa84b7dd84b7dd84b7dd84b7dd9ec8e884b7dd1c20261c20263b424a -3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a -3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a3b424a -3b424a3b424a3b424a3b424a3b424a3b424a5d636c5d636c5d636c5d636c5d636c5d636c5d636c -5d636c5d636c5d636c5d636c3b424a5d636c5d636c5d636c5d636c5d636c5d636c5d636c777f88 -9ec8e89ec8e89ec8e884b7dd84b7dd9ec8e8d7dde55d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef5d636cffffffb6daf5b6daf5e2effab6daf5e2effa9ec8e80101023b424a1c2026 -1c20261c20261c20261c20261c20261c20261c20261c20261c20261c20261c20260101021c2026 -0101020101020101020101020101021c20261c20263b424a1c20261c20261c20261c20261c2026 -1c20260101021c20261c20261c20261c20261c20261c20261c20261c20261c20261c20261c2026 -1c20261c20261c20261c20261c20261c20261c20261c20261c20260101021c20260101021c2026 -b6daf59ec8e89ec8e89ec8e89ec8e89ec8e8ececef777f88ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffececef3b424ad7dde5c6c8cdc6c8cdc6c8cdc6c8cdd7dde5c6c8cd1c20263b424a010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101023b424a010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101023b424a3b424a -ffffffffffffe2effae2effae2effaffffffffffff5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffff777f88777f88777f88777f88777f88777f88777f885d636c0101021c2026010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102777f88ececef010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101023b424a1c2026 -777f88777f885d636c5d636c5d636c5d636c5d636c5d636cffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffececef1c20261c2026010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102adb4bcffffff1c2026 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101021c20263b424a -ececefd7dde5d7dde5d7dde5d7dde5d7dde5c6c8cdffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0101021c2026010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101023b424a5d636cadb4bc969aa1 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffececef1c20261c2026010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102969aa1777f88969aa1ececef -010102010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffe2effa1c20261c2026010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102adb4bc777f88777f88ffffff -3b424a010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffececef1c20261c2026010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102777f88adb4bc010102010102ececef -adb4bc010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffececef0101023b424a1c2026 -1c20261c20261c20261c20261c20261c20261c20261c20260101021c20261c2026010102010102 -0101021c20261c20260101020101020101021c20260101025d636c5d636c0101020101025d636c -777f88010102010102010102010102010102010102010102010102010102010102010102010102 -0101020101020101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0101023b424a3b424a -3b424a3b424a3b424a1c20263b424a3b424a3b424a3b424a3b424a3b424a1c20261c20263b424a -3b424a3b424a1c20261c20261c20263b424a3b424a3b424a1c20261c20261c20261c20261c2026 -1c20263b424a3b424a3b424a1c20261c20261c20263b424a3b424a3b424a1c20263b424a1c2026 -1c20261c20263b424a3b424a3b424a3b424a3b424a3b424a5d636c3b424a0101020101025d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffd7dde5010102010102777f88 -e2effa777f88adb4bc010102010102c6c8cdadb4bc777f88c6c8cd1c2026969aa1c6c8cd777f88 -adb4bc3b424aadb4bcadb4bc777f88c6c8cd1c2026777f88c6c8cd777f88777f88010102010102 -d7dde5adb4bc969aa1c6c8cd010102777f883b424a0101020101021c2026c6c8cd1c2026010102 -3b424a969aa1777f88adb4bc5d636c3b424aadb4bc777f88adb4bc777f880101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffb6daf5777f88010102010102777f88 -d7dde5010102c6c8cdc6c8cd010102d7dde5777f880101021c2026010102969aa1ececef010102 -010102010102ececef777f880101021c2026010102969aa1c6c8cd010102ececef777f88010102 -ffffff5d636c0101025d636c010102c6c8cdffffff010102010102010102c6c8cd0101025d636c -ffffff1c20260101021c2026969aa13b424affffff0101021c2026777f880101023b424a3b424a -b6daf5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffb6daf567a3d167a3d1777f88010102010102777f88 -c6c8cd010102969aa1c6c8cd010102d7dde5969aa1010102010102010102969aa1d7dde5010102 -010102010102d7dde5777f88010102010102010102969aa1adb4bc010102d7dde5969aa1010102 -e2effa5d636c010102010102010102777f88ffffffececef010102010102777f88010102ffffff -969aa10101020101020101020101021c2026ffffff0101020101020101020101023b424a1c2026 -67a3d167a3d1d7dde5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffff67a3d167a3d167a3d184b7dd777f880101020101025d636c -ececef5d636cadb4bc1c2026010102c6c8cdd7dde5777f88c6c8cd010102777f88ffffff777f88 -adb4bc010102c6c8cdc6c8cd777f88d7dde5010102777f88c6c8cd5d636cadb4bc010102010102 -e2effaadb4bc777f88969aa1010102777f881c2026ffffffadb4bc010102777f88010102ffffff -5d636c0101020101020101020101021c2026ffffff777f88969aa15d636c0101023b424a3b424a -84b7dd67a3d167a3d167a3d1e2effaffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffe2effa84b7dd67a3d167a3d1777f880101020101025d636c -d7dde5ffffff969aa1010102010102d7dde5969aa11c20263b424a010102777f88d7dde51c2026 -1c2026010102c6c8cd777f881c20263b424a010102777f88d7dde5ffffff5d636c010102010102 -e2effa777f883b424a3b424a010102969aa1010102010102ffffff969aa15d636c010102ffffff -777f880101020101020101020101021c2026ffffff3b424a3b424a3b424a0101023b424a3b424a -84b7dd67a3d167a3d167a3d1e2effaffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffe2effa9ec8e8777f88010102010102777f88 -adb4bc1c2026ffffff3b424a010102d7dde55d636c010102010102010102777f88c6c8cd010102 -010102010102d7dde53b424a010102010102010102969aa1777f883b424affffff1c2026010102 -e2effa3b424a010102010102010102969aa11c20260101023b424affffffc6c8cd010102c6c8cd -ececef0101020101020101020101021c2026ffffff0101020101020101020101023b424a3b424a -67a3d184b7dde2effaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffadb4bc010102010102777f88 -d7dde50101025d636cececef1c2026d7dde5adb4bc3b424aadb4bc1c2026969aa1d7dde5010102 -010102010102ffffffadb4bc5d636c969aa13b424a969aa1c6c8cd010102adb4bcececef1c2026 -ffffffadb4bc3b424a969aa13b424ac6c8cd5d636c010102010102969aa1d7dde5010102010102 -d7dde5adb4bc1c20265d636c777f885d636cffffff3b424a3b424a969aa11c20263b424a3b424a -e2effaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1c20263b424a3b424a -3b424a1c20261c20265d636c3b424a3b424a5d636c777f88777f883b424a5d636c5d636c3b424a -1c20261c20265d636c5d636c777f885d636c1c20263b424a5d636c1c20261c20265d636c3b424a -3b424a5d636c5d636c5d636c1c20263b424a3b424a0101020101020101023b424a010102010102 -0101025d636c969aa1969aa15d636c3b424a777f885d636c777f88777f880101020101025d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffd7dde51c20263b424a010102 -0101021c20261c20260101020101021c20261c20261c20261c20263b424a1c20261c20263b424a -1c20261c20261c20260101021c20261c20261c20261c20261c20263b424a3b424a3b424a1c2026 -1c20261c20261c20261c20263b424a3b424a3b424a3b424a3b424a3b424a1c20263b424a3b424a -3b424a1c20261c20261c20261c20263b424a1c20261c20261c20261c20260101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -0101020101020101020101020101025d636c5d636c0101020101020101021c2026777f88010102 -010102010102777f88010102010102010102c6c8cd3b424a0101020101025d636cadb4bc010102 -e2effa777f88010102010102777f88d7dde50101020101020101025d636c010102010102010102 -d7dde5777f880101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -010102010102010102010102010102adb4bcffffff010102010102010102d7dde5c6c8cd010102 -0101025d636cffffff1c2026010102010102ffffffffffff0101020101023b424a969aa1010102 -ffffff5d636c010102010102777f88ffffff0101020101023b424affffff1c2026010102010102 -ffffff777f880101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -010102010102010102010102010102969aa1ffffff5d636c0101021c2026ffffffc6c8cd010102 -0101025d636cffffff777f88010102010102777f88ffffffd7dde50101021c2026777f88010102 -ececef3b424a0101020101025d636cd7dde50101020101025d636cffffff777f88010102010102 -d7dde55d636c0101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -0101020101020101020101020101025d636cadb4bcd7dde50101025d636cadb4bcc6c8cd010102 -1c20265d636c5d636cd7dde5010102010102777f88010102ffffff969aa11c2026777f88010102 -e2effa5d636c0101020101025d636ce2effa0101021c20263b424a5d636cd7dde5010102010102 -ececef5d636c0101020101020101020101020101020101020101020101020101021c20265d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -010102010102010102010102010102777f88010102d7dde5adb4bc5d636c5d636cececef010102 -5d636cd7dde5969aa1ffffff1c2026010102969aa10101021c2026ffffffadb4bc5d636c010102 -e2effa5d636c0101020101025d636cd7dde50101023b424ac6c8cd777f88ffffff1c2026010102 -e2effa5d636c0101020101020101020101020101020101020101020101020101021c2026777f88 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -0101020101020101020101021c2026adb4bc010102777f88ffffff1c20261c2026ffffff010102 -969aa15d636c010102d7dde5969aa1010102adb4bc0101020101025d636cffffff777f88010102 -e2effaadb4bc010102010102adb4bcd7dde5010102969aa15d636c010102ececef969aa1010102 -d7dde55d636c0101020101021c20260101020101020101020101020101020101021c2026777f88 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -0101020101020101020101021c2026d7dde5010102010102777f880101023b424ad7dde55d636c -c6c8cd010102010102777f88d7dde53b424ad7dde51c2026010102010102969aa1777f88010102 -3b424affffffc6c8cd777f88d7dde5c6c8cd3b424ad7dde51c2026010102777f88ececef010102 -e2effaadb4bc3b424ad7dde5777f88010102010102010102010102010102010102010102777f88 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c2026010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -1c20260101020101020101021c20261c20263b424a0101020101020101020101021c2026010102 -0101021c2026777f881c20260101021c20260101021c20260101020101020101021c2026010102 -1c20261c20261c20263b424a0101020101020101020101020101020101020101021c2026777f88 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cd0101021c20261c2026 -1c20261c20261c20261c20260101020101020101021c20260101021c2026010102010102010102 -0101020101021c20260101020101020101021c20261c20261c20261c20261c20261c20261c2026 -1c20260101020101020101020101020101020101020101020101020101020101020101021c2026 -0101020101020101020101020101020101020101020101020101020101021c20260101025d636c -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6c8cdc6c8cdc6c8cd -c6c8cdc6c8cdc6c8cdd7dde5c6c8cdd7dde5d7dde5d7dde5d7dde5d7dde5d7dde5c6c8cdd7dde5 -c6c8cdadb4bcc6c8cdc6c8cd969aa1777f88777f885d636c777f885d636c777f88777f885d636c -777f885d636c777f885d636c777f88adb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bc -adb4bcadb4bcadb4bcadb4bcadb4bc969aa1969aa1969aa1969aa1969aa1969aa1777f88c6c8cd -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffff9ec8e867a3d167a3d184b7dd84b7dd67a3d184b7dd -67a3d167a3d184b7dde2effaffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffe2effa67a3d167a3d167a3d167a3d167a3d1 -67a3d1b6daf5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffb6daf567a3d167a3d19ec8e8 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe2effaffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffd7dde5b6daf5e2effaffffffe2effaffffffffffffffffffececef -ffffffffffffe2effaffffffb6daf5e2effaffffffd7dde5e2effad7dde5d7dde5d7dde5e2effa -b6daf5ffffffffffffffffffffffffd7dde5b6daf5e2effaffffffffffffffffffffffffd7dde5 -ffffffffffffd7dde5ffffffffffffececefffffffffffffd7dde5d7dde5e2effaffffffe2effa -e2effaffffffffffffe2effaffffffe2effad7dde5ffffffffffffe2effae2effae2effaffffff -ffffffffffffffffffffffffe2effaffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffd7dde59ec8e8ffffffffffffffffff9ec8e89ec8e8ffffffd7dde567a3d1 -ffffffffffff67a3d1ffffff84b7dde2effaffffff9ec8e8d7dde59ec8e8e2effaffffffe2effa -84b7dde2effaffffffffffffffffff9ec8e8b6daf5b6daf5b6daf5ffffffffffffe2effa84b7dd -ffffffffffff84b7ddffffffffffff84b7ddffffffffffff84b7ddd7dde59ec8e8e2effa9ec8e8 -e2effab6daf5b6daf59ec8e8d7dde5d7dde5ffffffe2effab6daf5b6daf5ffffffb6daf5b6daf5 -e2effa67a3d1ffffffffffffb6daf5ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffff67a3d19ec8e8ffffffffffffb6daf584b7ddffffffe2effa67a3d1 -e2effaffffff84b7ddffffff9ec8e8ffffffffffffb6daf5e2effab6daf5b6daf5e2effae2effa -9ec8e8ffffffffffffffffffffffffb6daf5b6daf5b6daf5d7dde5ffffffffffffffffff84b7dd -e2effab6daf584b7ddffffffffffff84b7ddb6daf5ffffff9ec8e8d7dde5b6daf5ffffff9ec8e8 -9ec8e8d7dde5e2effa9ec8e8d7dde584b7ddffffffffffff67a3d1e2effaffffffffffff84b7dd -e2effa9ec8e884b7ddffffffe2effaffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffff9ec8e8b6daf5e2effad7dde584b7ddd7dde5ececefd7dde5 -84b7ddd7dde5b6daf5ececef9ec8e8e2effaffffff9ec8e8e2effa9ec8e8e2effaffffffe2effa -9ec8e8ffffffffffffffffffffffffb6daf59ec8e8ffffffffffffffffffffffffffffff84b7dd -ffffffffffff84b7ddffffffb6daf59ec8e89ec8e8ffffffb6daf567a3d1d7dde5ffffff9ec8e8 -d7dde5b6daf5e2effa9ec8e8ffffffe2effa84b7dd9ec8e884b7dde2effaffffffffffff67a3d1 -e2effaffffffe2effa67a3d1b6daf5ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffb6daf5e2effad7dde5b6daf5ffffffe2effa9ec8e8e2effaffffff -d7dde5ffffffb6daf5e2effae2effa84b7dde2effa84b7ddd7dde59ec8e8d7dde5e2effae2effa -9ec8e8d7dde5b6daf5ffffffffffff9ec8e8d7dde5ffffffe2effaffffffffffffe2effa84b7dd -ffffffffffff9ec8e8d7dde5b6daf5ffffff9ec8e8b6daf5b6daf5ececef9ec8e8e2effa9ec8e8 -d7dde5b6daf5d7dde59ec8e8ffffffffffffd7dde5b6daf5d7dde5b6daf5ffffffb6daf5b6daf5 -e2effab6daf5ffffffb6daf584b7ddffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffe2effaffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe2effae2effaffffff -ffffffe2effae2effaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe2effaffffff -ffffffffffffffffffffffffffffffe2effaffffffffffffffffffe2effae2effae2effaffffff -ffffffe2effaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe2effad7dde5e2effa -e2effae2effad7dde5ffffffffffffd7dde5e2effae2effaffffffe2effaffffffffffffe2effa -e2effaffffffffffffffffffffffffffffffffffffe2effad7dde5d7dde5d7dde5d7dde5d7dde5 -e2effae2effae2effae2effaffffffe2effad7dde5e2effaffffffe2effaffffffffffffffffff -e2effae2effaffffffffffffffffffe2effaffffffe2effaececefffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffd7dde584b7ddffffffffffff -ffffffb6daf59ec8e8ffffffffffff84b7dde2effa9ec8e8e2effab6daf5ffffffffffffb6daf5 -84b7ddffffffffffffffffffffffffffffffe2effab6daf5ffffffe2effaffffff9ec8e89ec8e8 -ffffff9ec8e89ec8e8ffffffffffff84b7ddb6daf5ffffffececef84b7ddffffffffffffd7dde5 -84b7ddffffffffffffffffffffffff9ec8e8b6daf59ec8e8d7dde59ec8e8e2effaffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffff84b7ddb6daf5ffffffffffff -ffffffd7dde5b6daf5ffffffffffff9ec8e8ffffffb6daf584b7ddffffffffffffffffffd7dde5 -9ec8e8ffffffffffffffffffffffffffffffececef67a3d1b6daf5ffffffffffffd7dde5b6daf5 -ffffffd7dde59ec8e8d7dde5ffffff9ec8e8b6daf5e2effaffffff9ec8e8ffffffffffffececef -84b7dde2effae2effaffffffffffff84b7dde2effad7dde5d7dde59ec8e8e2effaffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffb6daf59ec8e8ffffffffffff -d7dde59ec8e89ec8e8ffffffe2effa84b7ddffffffe2effa84b7ddffffffffffffffffffd7dde5 -9ec8e8ffffffffffffffffffffffffffffffffffffe2effa84b7ddb6daf5ffffffd7dde5b6daf5 -ffffffd7dde59ec8e8e2effaffffffb6daf5d7dde5ffffffffffff9ec8e8ffffffffffffe2effa -84b7dde2effaffffffffffffffffff9ec8e8e2effad7dde567a3d1d7dde5ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb6daf5e2effae2effa -9ec8e8ffffff9ec8e8d7dde5d7dde59ec8e8ffffffe2effa9ec8e8ffffffffffffffffffe2effa -9ec8e8e2effae2effae2effaffffffffffffffffffe2effad7dde5e2effaffffffb6daf5b6daf5 -ffffffd7dde59ec8e8ffffffffffff9ec8e8b6daf5ffffffe2effa9ec8e8e2effae2effab6daf5 -9ec8e8ffffffe2effaffffffffffff9ec8e8e2effad7dde5d7dde59ec8e8e2effaffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffe2effaffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffe2effaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffd7dde5ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102d7dde5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -c6c8cd969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1 -777f88777f88777f88969aa1777f88969aa1969aa1969aa1969aa1969aa1969aa1969aa1777f88 -777f88777f88969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1 -969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1969aa1adb4bc969aa1 -969aa1969aa1969aa1777f88777f88969aa1adb4bc969aa1969aa1adb4bcadb4bcadb4bcadb4bc -adb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -e2effad7dde5d7dde5d7dde5d7dde5d7dde5d7dde5d7dde5d7dde5d7dde5d7dde5d7dde5d7dde5 -c6c8cdc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdd7dde5d7dde5c6c8cdc6c8cdd7dde5c6c8cd -adb4bcc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdadb4bcc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdadb4bc -c6c8cdc6c8cdadb4bcc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdc6c8cdadb4bcadb4bc -adb4bcadb4bcadb4bc969aa1adb4bcc6c8cdadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bc -adb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcadb4bcffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffd7dde5e2effaffffffffffffffffff -ffffffd7dde5e2effae2effae2effab6daf5ffffffffffffffffffffffffb6daf5ffffffffffff -e2effaffffffffffffffffffe2effaffffffe2effaffffffffffffffffffe2effaffffffe2effa -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff9ec8e8e2effaffffff9ec8e8d7dde5 -ffffffb6daf59ec8e8ffffffe2effa9ec8e8ffffffd7dde59ec8e8ffffff9ec8e89ec8e8ffffff -e2effaffffffffffffffffff9ec8e8e2effa9ec8e8e2effaffffffb6daf5b6daf5ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff9ec8e8ffffffe2effa9ec8e89ec8e8 -e2effa9ec8e89ec8e8ffffffd7dde5b6daf5ffffffb6daf584b7dde2effae2effad7dde584b7dd -e2effaffffffffffffffffff9ec8e8e2effaececef9ec8e8b6daf59ec8e8b6daf5ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffb6daf5e2effae2effaffffffb6daf5 -b6daf5e2effab6daf5e2effae2effab6daf5e2effae2effad7dde59ec8e8d7dde5ffffffd7dde5 -b6daf5ececefffffffffffffb6daf5e2effaffffffffffffb6daf5e2effab6daf5e2effae2effa -ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffe2effaffffffffffffffffffffffffffffffffffffffffffffffffffffffe2effaffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102ececefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102d7dde5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102d7dde5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102010102010102010102010102 -010102010102010102010102010102010102010102010102010102 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/manual.gif b/Docs/Books/manual.gif deleted file mode 100644 index fff578e33124ba0e3f92649e1ddf5af8ae7c77b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2575 zcmV+q3h?zuNk%w1VPpV=0J8u9|Ns910Ro=L=x3wRmYShmV{C-C-Nwkx;_v#l+Vwj^ zN_T&V93UpGw7l%>@7LYsA^8LV00000EC2ui0Av7!000F4Fvv-(y*TU5yFP#;j$~<` zXsWIba9j+bObP;osdVpr@BhG{aOguYER4nC7+|!7k|%LWty&9|!m%Km5TF66bxbZd zXtRLgfR!kM(XxC_HBOWgLR$jz#p!^7J_`~_0}KoW1%wg{eqn-cJ#uT(!WMLqX1_>8j+sKiCM~_PXLW&%z@#9BP97}#wiAoeolOCV# zQL?4Mo`yp-K6u76RH>fNaJ6(vw5TYbp->vdbTTF?m>&!DGl;Q?o(UFzutFd}KmxB` zzlKdfwyfE+Xw#})d-g#Bx7MA7 z8Evu-Iv_T&<;$2e`(6BnAPt*Xr|8v8`mcf0s8N?z%(#cK1!*Mr7`^&1>H)ZO>)ws~ zbZG?Gv{n>NxprX#ypt=}t$MIw&Oi!=CPLdd^5wn_pI+V@@#1VijLGIvz4UeE&J&;K zoqqGDob7;=&%B=fYV_XU4~eg}IO+PkwU=4{asqa>7&36+6~ug&aW_DL0|uBMfI-iWL43B6%*7SYnLF=|X239AVQ%IGknNs#i=b8z&DX3vzooT3MecjWv%vb;|`~Oy5X#> zBD$%fuzL9=uh02PDzLf^OKf1)ydx?95xJ&X=(4Oi`|GQN`lTwheL29&n9x3u*tXmX z;3l|3NTr^v<#u(hon)@NYrE!t3vakOaz}5yPTu;YWtQf)FP8n5isNPMmisQC)QOw# za`Yl_D!M{M`*3m*Pke8>!6plFx#bj$EM@^uIj6vfm1FI(uXd>Hk>?c{GQ~ky{Gz^8 zu7{YnBDehC%e67Lv&IZ_yjsaTUaI5*JyQojZ6)(5EXpY_V8h0FJ#F2*B-@u_(>Zl~ z^oAV9$sur4_=~01FqiybYSRv#w!w|D4d!-dV#jAWbKhwmM&#C;Qid12Wmw%3kh zjgD4ftF%7E=c!eShyuU|FZ}St7eBlr$R}Tn@`@|~CtnW~pu6YNlZ8M6T&aP`_S|pZ zL=0u%0M0j3eK zeo0sW^VVmDU<~kp6G+7aA=m^3{G%WJU=qvZ@I4Av0uvsbKqBU#w#2C;gd1@{2n*rA zGL*0gC-h(glmGzx9dLvkq}%0U2tjN_ff63Xp$l~gIqj9N2?LDb7AB$)3JQ@7FZ9Fk zGDt=e)S!R_ z&n^#8 zM>o#-tu_D$cmc4bHL!psY}OE-+{}$P88`*55R#ZR3_$emAe{#o;~H-`0s;ODG0fmBR@7ZSLn4j7^UR9+LA zZU6ui>WKlaGF7gg3F{XG=z_cw))8jhqyxgJO6f6TpoN92MM3EUuv%c4W*jD16`@LN zW`Yp06e|KMD3vJO1bmw1Clx$f0YdCV5h|3*7aG|FYGNU^tzCm76#80hR%3{q{VH7x zQBA>SGoD!gcqJt)3rk8gz>HUkg+SX7)+CS+vGiDO6H2Rw=oN$&?PJ0<7Sat~q}MJg zgl7AiD9caEfwmk-;!_Jj*74DGe7}RiamSe4xr$GO;??hgH4s*8iuJn%zQ_AY!3zvx z5Pr`%z%`P(2o5K8DMo>cvEmwGK?tBX$hnRIWcrY6wYZw-& zV;cAP$A>L3kcZ3=&bq}0-h6@$u%`+HVDNf8IC7M=af2uH1IbrI@-OyRQ5JV@2;$m- zyB;ur8;K~E!eCRlHrO<({f>)ee=YP~W0iLqKo$tJ7 zNB7y)bB^ySTm>%+fq#4UHW6g%O)l#XxpQzbmw%ybXNS887FIU@)a~wfpBn)} zwiS3)A?H_n`pz=m_70$|YIC`3&YpCDoHxw_u&5ajO-1+);PNy=PaM_`7=Vo7lI*83 zSI-_qtcd-Kj@=4Ds&ZES;+ywwB0Gr0G> zoasKtT+v=>_5M(PHJm@(U2h~0yxuR4I1yOgY^Iwl z%qkc2u#Mhh#Sa131{$-rS4`@g;~Ol4pRwhIU~HpbZ|VE%xLcmU5A+o9CI|yuX=w=9!si-g$rXjQ=7(7w5?JKmvvV82>N* z`SYLoube>tnLoeBfB*SC;f($HJpq3I9{c@!d~|$#^v?wPGx}$2Y;64JpI^U5#|QuX z9QipsJUsT}*Wl3Lz`(%ozMtQ}|M;fW_V@Sy>HhVzd+^hzPk)||yzlLO-}AovT~Aln z+u!#G-@JbP{P~OD^6wo_JD;?-KYrXcR`vCv`q91n55_L_x7=-Qx_h^wv1zQZU#V1$ zo&7X&{?pL;k9QRHqxm1l@;=?Ut@wKWZEbB`&COc%#e1V!AF8Wss;X*!9_abC|NU6% z`-+OHk(9SrF3ZX zxuJ_VS6FCi-reZUamlOx z-n1ch1a951A$ACEIqshswLWf;-W(ORaSS~CPHP$_-yI@150RS&$#)0I&4c8oZ3J!a~EBheoVizB)K0biZA4 z(2@`(D6By97A;zuY_WZj{}TUzB?LRu&o3y4o9gWw zW-FatF~|9C8w}SjH4k!ha&vOY05%gD{Ko~r7zg99ae$0aq%riYBAR6d-hfL7E;`Ee zLkA~EtE9)GqmLLnCX35;w$Hpf%`H|NW?58>oAC>L^HZtF2}^-YnD3o^=pi3VgB*RT zq>nE6w&$7p&>pY>!h^ULj&H>z28hvsgcJZwbO8?t#Ux-nACrhuAX>(>2e}JHD@ZgZ z3S6ehyKE1XaZD_x99D?aU_C3LAbD3>chgj>_^{+^?{rnJeUNni;Pg!wH*Ky;N=e-h zPYMVjgbAmp;^}i1R}tVHJ&QYQU!FJxNJB20)k`wDPTu(bV0YiIx|ZVXDO>8v zh@Kg@8M6n?+)1|`Xe=*T@u|;l%oh$BygdX z#z`VClrK?x(M`_ydyCc|Sp?DbEk3S2xgi95pRZU0F!1SP=edX#-(Vf`CPR(+`Lyfw zV}!)$(}ztEUTkvi{Kw6`o3EQ+Bi0*pv`-fUSIy?KwcBqKMrH0wfY?59H4Jx(9X zWR2ripUaPW|0*r2dSCkaa_!|0u~+0Y>-eHO?6|&)8*dNxRo=V)yzi>oyC}Y@4RYIZ zt#fvG{PmZyFSb-M9e9eGZWHYDwKovjdrr6c;MSYB&MhRNn5;&n=Yz`u`270jmMgS@ z({o5)N@Ps8@4aM>OHW@n$0J1BT6(p4Hcz2yqTLhUm@Rw4Sums_Z8VrGmjx|&P<5!H zYP|oHB6em#19q#KcJBk#rpD{xf-xou=%!14u#IeFyd~45M!#&!H&t*Q+)~_i=G_@( zhdYAiy(#{tcgBvhS%C0*=3y*7a!d%-h7be8Tv$oSu( zv<2nC0W;IvOb<*?NDO|31SWU+O?zDvz0_r?O}0s6;L<&z@MC%RV#AMl(PX2fY9Mb= zJQp|3eKb~o)A?BvdDN+`#*~WA)jXm<9aDGT*B!g=pL6NPxoZ^9!J5ZuQ%9RgV%8t+ z)%2{DPi|gecC7!(a`{+Ge(2U$YsPWh9`B`O&J74=IDXW2FLjAok2^Hf?(1n<&=+r- zHt(bCf&_LFrMW_ioKKIe$Q`={386BG*X+gg!AMkhZJKRcB*O=%eXp-LY%b7j0c1IK zU&T>RftdDK*667&kk}4r=x??A;nV{*NFs?fi$?-ETIzxfFL;Ie`P}hXiEB;6CmWMy znp>w6IaaJRxxY;1HlreaSD4Qn>nFzK>&;@S=$p;bFf!9!!}QI|`I)pGa^=*w1bu;LBS$0$Gc55GI6z?H9H2CKDLgQB=tkKUN%!<& zxzDuQSgOf-Q!XhzWrm4P#umv1wi6M%DXRUlZdkX8MyN95nz9Nyx~J8JD{}{YB-1nELd zS6Zr3YliRqB2)H0`2~(mjhK~s*T-R;?`@P4KzDwb*Rbf?XZr8X1D@}?j;t$sM2o^{ zj{726o7Vem-zQRXq`xk2hq|T>Cs{ccB{+CDli)y6!Gs`u20hNK#b^3c~OgVq6mByxP_8-pw%yQ2q(^iet+jKSO z?=)3RdofBKt^9`i$&^NIHGKDbT?YevXBfX0s`OOEB)IQ0v=^h8wFE;W^|9+#)cAYI zza81z>|^{QZ@u0mT_A=&&OL+Ls)`x<9Bk#%mY`9zj6<_hG0r%Nt?0Gyo%xtTB^Oo$K)fI?k2Bb zZ5o*@eVycwxlsj+tZiQW?oTMxun6G2}ng5y|*-#{;^0hv^l4Dt$_6@D;(O0f{(Z!C-BTrw$ zlepBAj)>MP4JG5EbZ00sYgba*)B#!3f+DZS%Ez~uIZkc2S7Q^hB!}n(;7l8)6mH<5 zUAPZ21~?09gF{9uQ#@NpUv~DTO}!lEHCd}&?u@%nE#FID`!(|DE}OLJzCd1D7V<#1 z1~R@JDJ=v7XhEMXy37xP7t2#k<4sYIydAth2PBCuSN7~Ve$uhelr5@J8o$@jOvLJR zPxmO+c8zfUFVfL{YM!m+s;`(O?j+3ltb+hrcNI#BhqqF1b?_)U9kTsU@k7oO8fT2V<*S&p zlu!1+cMuhJi(X z%K~bOjJA)*s*Gm8)kGz6jh_u0ZXdQ1PGVT7$*~m+x7*utG16!~n9ZZU#@S0hSdFGa zLt4p8EjdQRc`I`p(xN0?$XCp`e0BGrj5CTcW)dVCK3QF9=Oc4`jQO@*F!)$uXDMJj z)6l)<1t!;f%bqlXKhRK_kDVGjT{?8ivKpmn(9wUYf(mNX{j ze8dyy3ZSBlIh#y39TU(p5;yzsA!9(X*t{?&ht@+&dDIPJS^(GhT?}L-gH~#o z=wAub+sLDWokQw`I~pWT89b9m-tR-PCNfL1)7rLA;%h0r3eqGorP(~PBiPo0M@`_f zIw${gRYDmNaH&#K#~LjJ(W=70~T8**VZdz{xUaWe76&0*alM@|Q4kv5Y#0AX$p(u2egq zrY>#vTa-zQ8&^|Ts>u$3?8K+M&1Yf6&Igal10v3A3_mQ~C(%+I+9iJ{kd=<=J044`E)q*Q>E$dD==xhO=U=9iR#l8bz_3ZMlz=QF|jpk=vP zAq_(2J%aTaXRGnmA8~d&50-27IU4Klz>~i}JX}WGE1>@a5MrFmRABI3Eo)8_%RHZX zl7P>NVO#@Wkt5||IG@6jUK7DOsWzR$lR#V?m(^k_hf<}-@$%S9M`T!y}F4K zTIN~;noLkLwP=gz@}+S#a#92V4HO~2c-H93j~1j*jAZdB!D^aFPBGxqN(Ar;HC)7} z+KMQi2^1>3^Y$s`Ss|JSDgjq&^8?iglG`xO zWrE^*^U^IYbFVersb&iKU@Dl{1=fdy@HLD!1Atf@&Ep}*N09-m8--%Hj7#?8qi5vs zRXN!oM{og>CW5T+YuBt`Hw}muAUF?>1;Ad2Wzb7!N14VNQDUY6Hx$8yFQM?S_EByq89{k8DQwC zX(a&85g@zx)B=DU;z3qiq<{xQ;czaFcmoj4Mal>|BqNt#a1n+S5Xf;p^Df42QZs7= zNHMQg6=-0=WxvNbhXH4Z$EedtkK9B}jhWRVO1ub~p=Q3~!KW~EJw^=!V2cPAs~P)6 z%2GAM*`09$&;d@ls;T;bmKBT0Kt?aX;NpoW7$7IGJJYqK{W!7<0B4!10GAg5w1@{+ z5(vRZ!cW1TC48K(@P^eh<(0O|=GIV*<0-l7B1ouG301zi67GzDPPtD**H962FtD8}Vd zO+%>wy&`DbWK$itkn$y$?IVLW;mjk8nLA#h|Ef`Mzz_rAh@;tZG*L#r!E1@f(PPO_ zl^QMtS8V0<^Kv)>=$LbPG)7Hg)eERwxAW`fh~)0TBR6vd&!XUkbD4F$zC$Z2`yoR(#Rmg=)F ziqvokhE#_mp`}Rit0#M38D^;2V_NospUh@1^Y+V^%>SvCa=IIzd6UmfB*1ixdIP|m zCC%5wuyzk*E@Zgj@cG5)GC;d@E%7)v4asKdF)>>#S)}_$A4DN4L@R>V#6eagwEdenA;~F2nAJnX{u1$*| z3;FM>~7 zTlWb$V*;ufpS)X(EcR%s=hDp8jGKa?SQEwIjO$T&gEOJrJa1@ZX2tHp_(@q;BXJpsRg_N)5kKf1lW=yCbi9L#O zJhYG()>CKPbNCW^x*u}k(iYuU)@smL8QGSA>@^fzfNqSKxcSi8Ywu@GNG$#~LP$v@ zI<5)OUM9^-PG0dD@)j~iJsAF6@(dp2ET^~=SB2`Tu`N%rwG*ef*Cv`XETheersZF5 zQ=e^9;%&kGQl%WNCE#o^dP9q3sgWxAL`<_8eSOhMX0^QH%TJ zw;5+zRXHN1pq7yaCS-{be6Qhq)*Woyx3d)#2MuYO8bk`1JA%{)S+5iXs%E{Kz3qFo z2$79_7hi5)e+bd;xlxECl>p5Z+#*En)uUCp#MNj%nk|IIU*D8q56@!75iNby=-@KW zmpi)B@PFFKmpYHFW122t)(d|g_UPa65MB8jIftR%+M2hm$h%fVpLOLl_nlOTW^xdH z4*j@0wV02_94tGdhLtyA8Na*~mtSvfsk<}c|A!O05$FJL^k`?s+0J`!US>}FuHIX8 zdL4RBjE;YXuFGJ9Tfg6pk0PgeH%@C?B7z!wZQAt+?IK}Si5f0#c~SRu^v=?UQh?+M zkpTCx5FG=}>(=|@V-MH;1g1fq{B^a=j>;9S*>kMS+te)spA4)*N@tfoKe4&pYE`LK zdtul?eapZTLHA?Z_9K&B@a2C!U;a2`R?`qITEu^(w{n>rz*IHn0xUU6J|Lw-q<>%nIo$45-w-v^;A7Ja>o- zwOUacT3l$5H>v#g-e4WSp6U~g=e-V0GB~(=Ge4@KXl-L(Ri3atZ(MejDs3N~CC+^BeIx|!mT91oPv#yVnUilt$(P-+dSbfX< zs1v7Wq@8k&t%!V;9@($~Us)fj8`qw?B6Nmz=#>aT{$S=Lf+Jc#=uqTMH4gd5G~t<$ z9=LoJ1wSvDLUCFySXInF^tjbG_k&3`8+=OCX`Fk{_DQi%^i8u2-dfR(o=M^EUGK_* z)U6cn;JF3V!yKEtjN_}0Pch38&~y}3`T7?#?L20S3iJav7C>O$#=E`-??Oqa4P#3t z$)cC%)>8i|;|9~v?wBj>Ui6X3($WV>uIVSkd5UyBAKu*ty|9?gMLMgTZb)*?0FX=y za5~n&^)Xr=ndUd{vROALBs72hBwG*w@ht!#7Y^87n^h+fev{-{9V_I|os)n3Q!Brz z%B(%Q<}K*FOTr?WdvLSmBfR}yVFf+GlW7GDbAz0^X6D!fm$!O>M!uKr z0x>DTSDgaF!x5_;>}({urRjPRo^_S==%Jq>LHvsXpOdps@vgRqCr5TuK++U4H)!Zx z>LDki$h786ql#hjY_NzL`~d`*83b-$ooEmk(?tTd8xv-{*m5DcVN!(rT8}ECndKNb zcR%c>Og!r9o9=U@!Y4g4(Xeq!+SdG;NIo*dJ3zXz4?K9)X_E$_o!Nw0S`mA4Sf#F1p+6rb;V zVx^}jC3g|;*apNiQX#qSx>E`!c;>Z`0{Zb9*}>37Xt+sDN9g~y=^)!wtN(YmA-$56 z@xQhm#RpratT|#&2BzRq1JkOL%Sm+XYn+umG*Uv<3yOJU$PGJ^CGs=?HKsY;JB-zz z%2uY>!vXdW)3XO2poS-pKKwCr;8CFSjrpHzc33f;>ZS4{(KXzt<7=6p{tP*7-*j|1 zXdlPq*OIV{6unhOItp5VX`NY7p>AoOaYu~le5ZR+A<;zod!f$Uqkr}L-sTy8lsQZr zkEAHm6x`-dr(|jU4kU6S-{;io3h$*F?|s+hs?9Z1D`HbqkAMR*w9AGwGaPe`XgMsL7e}_UAUQ{yv>aV6z>M-CuJ!>U5n8 zb(%&4FR7w(lLO4HqZ9``I@8(GDHLNGDdV3kh@A*1#zWwcUlEBJJ#x~LZ?BtTw3+Q3 zGh=c;esF0KgBv|!Y5Z7C^U4esQ1r*$3sg4Gfmkmu$^aLuexJ(= zTcxg_R0*bj5b1O*I-6SMCtDyRK?pXkT(h)z3UB> zIJ?Lf!8N%Rglx|C%)spPD*2oe{z9wu*_orkPp^IXnH$#nDfmK>)0AwrZ<3w;>u(ORRpQ<`@<=L+=D%G~2s7 zQ}@+d{ZsOVj)B)h9TRmV(`VA`C65lRm3(n8`X=*j`EfA1v(Q6t5!1@g3pqG*zrJd( zjm6B0gM!ZWdL=QGDH8EizD=RtS&N3$GXuQ7Z!^jf`|(STBtCeWPC|cgUq7YDy~i>; zlDTqrTFzB>n)MFD)>s~Ss_G@pv5LgrlBb;3R{P$qDF1$JiE`QyKVu=Y{(-oYe2!G` z!DIN@!@swxzWwjetPA?j)d&0%3k~XGd^tkE7F7w1fA_*c1Y{r^D0Zy-xWvux?y=pN z)aMciIr+S;*bggRap}{dfA>7Ta>U`n29LPaX-7M%8wZa^*2S$Ie*U!9v+B|gkNBv` zw>s;cc2?%p^(~$E;@QJS$I1eaEwNKqKW}ezs=9J^%U0{ZU%a9X%kE6uy8Ypvmpy*F z3Ll=`y3_gAtFLUQf-aA3yXJ{Wfll(e9~0jsjN&)r{mymc`E&aICJRY^@JPXzIoeHT zx2SwvP79Dh00%UaUNM!8r?5q0$W(*X8_xMI&W?CA!_J|F1hnC4Utcfn^}e^8OLrX; zvK9-xO*hI@=HeK04OXvbi+u*#({CUP*E>2}6Ukg*kM&aVqYM4pO0v(8VCOxx=$w@K z%xN4RmgXST>^J45=*&~gjevma3V7tI5;?>B`8H1Nt8VWCjQ)PBe$e~9U;XahYBtr7 zKq5ib)eci_iSJE9T`=5VuZIh0AR`i9BPDZlAo)cl$@H;Kd&^3%9-;s+lmF$EYjRe;g3fI2uxOPQo5 zsB_c+oLM`!w(QRrO9G&YVu^uF2zvlXS0I4WT5rCwk)^OU5~DA(0b~9M31twYCKJIk zmPDGwSYV_kO_A5l!XP%0GWwZh6qd>rlC;sJZ$7E|0V(aHDYKGNs{>sktz8RTK%=$O zu_pl4hzmXgvWpnv9%M2|s;lDUTh(dZKsN?R=gkiaxk=*#5*L5~K*MU;GOxJo>L#aSKOlBjmyj#|4Qhkb5J w%ZSh3yG~bAc-3U}{QW*Yq8GQl%?`S^DLvjPJqMHvC@M@}<;7G@JZRni4<9@Gv;Y7A diff --git a/Docs/Books/msql.txt b/Docs/Books/msql.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/Books/prof.eps b/Docs/Books/prof.eps deleted file mode 100644 index 13cdb24afb1..00000000000 --- a/Docs/Books/prof.eps +++ /dev/null @@ -1,1167 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /opt/local/x1/work/bk/mysql/Docs/Books/prof.eps -%%CreationDate: Sun Dec 31 14:30:51 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 298 372 -%%EndComments -%%BeginPreview: 100 126 1 126 -% fffffffffffffffffffffffff0 -% fffffffffffffffffffc010050 -% ffbf7bffbefbfffffffd552a90 -% fffffffffffffffffffc004030 -% fffeffbffbeffffffff9bb5b50 -% d555d56aaebaaaaaaaad46a490 -% ffffbffffbeffffffff8100930 -% d555eaaaaedd5555555aa4a050 -% ffff7ffffbbbfffffff4000910 -% ab5bd6b5aef76b6b6b6caaa250 -% fef6bdef7bbededededdaabdb0 -% 57dff7bdeeebfbfbfbfbffef70 -% fd755def7bbeaeaeaeaf56baf0 -% 57dff77bdeebfbfbfbfafdefd0 -% 7d76bddef7bededededfd7bb70 -% efddef75adedf7b7b7b57deef0 -% 5a22108a521208484c6ad75dd0 -% fc000f000000000008e075cbb0 -% 56007fc0000000000bf0cfc770 -% 7c00ffe0000000000bfc6e23f0 -% ec03faf00000000009e0c86350 -% 5a03e0500000000009c86e26f0 -% fe0380380000a8000d80cc0bd0 -% 540328500003be000c226a26f0 -% fe034018000d61800886d643b0 -% 54073ad8000bc2a00d82f54370 -% fe06eda8001f00a009e55f13f0 -% 540728d80015c0900f77f576b0 -% fe024aa0001f80680ddd5feff0 -% 54029410001700d80830e002b0 -% 7e028940003c00300ce84203f0 -% ea016d4000102a6c098c640350 -% 5c009280001e88380d846413f0 -% fa015ea0000d802408a4640370 -% 5e00a140000d00080ca06103d0 -% 740056000004880408006402b0 -% ee00a9400004a2140c686003f0 -% bc01b5600001440c0840620370 -% 6a01ae40000154180da46203d0 -% fe07f8f0000161000fafc20370 -% 543fc7fe000050000fef7ffef0 -% 7fffffffe00081400d5dd557b0 -% ebfffffff800a2000ff767c5f0 -% 5ffffffffe0054800afdcfe350 -% fbffffffff8054000dd76263f0 -% 5fffffffff80d4000d09c42370 -% 75ffffffffc169000a176483d0 -% efffffffffc214000d52c20370 -% 5dffffffff0010200d25a283d0 -% fbfffffffe0040180b1566a370 -% 5ffffffefc00c0020c97dd7fd0 -% f7fffffe780088000d9abebeb0 -% 5dfffffff80024000b67ff4ff0 -% f7fffffef7ffffffffdf6fbd70 -% 5d555555aed6d56db575daefd0 -% f63c21e31f11619f08c867c2f0 -% 5c0223f23510311988846fe7b0 -% 762027f3219021b08904cc32f0 -% ec4022022310510089446837b0 -% 5e2825a31491119a8894e2e2f0 -% fa5020a2019021000c805027b0 -% 5da0228304108184085460c2f0 -% 775022820410310508d8c8a7b0 -% eea721030a10a98808d06055f0 -% bdaa2142171035178d74c15350 -% 6f4fe46353d15fb4eb0760a7f0 -% fafadfffffbff6ffdffedffd70 -% 5fdfbb5aad76bdd5baedfb57d0 -% 7575f6f7fbefefbf77bbaefd70 -% efdf5fdeaf7abaf5eeef7bdbd0 -% 5d75f577fbdfefbf7dddeef770 -% fbdf5d4a0c4454c2a6677bbef0 -% 5f76f42b65cdce591c66deebd0 -% 75dddce2644c64dd466df7beb0 -% ef77b9a665cf32954527bdebf0 -% 5dddf4c94cc866496da5eb7ed0 -% fbbb5fffbfb7ddf7fb7b5fd7b0 -% 5f77f6aaeafef7beafdffafdf0 -% f5eebdffbfabbdebfaf55faf50 -% 5f7defab75feef5eafbff5faf0 -% f5d7bafeef57bbfbfb6abf5fd0 -% 5f7defaddbfdeeaedeffebf570 -% f6ef7ab3b15b7bfbb7d5bebfd0 -% 5ddbdf06e1f7deb77d7f6beaf0 -% 77beb5c7b5bef7eeefd6febfb0 -% eef7ff4dfde55abbb56fd7eb70 -% 5dbd558751a43061031d7d7ef0 -% fbebff8dc3071c71c337d7d7d0 -% 5f7f5a8771c50c51607d7d7d70 -% 75d5f78dd3471871e0efdbd7d0 -% ef7f5ec761c69c61b0daf77d70 -% bdd6f78dd3471471e87fbeeff0 -% 6f7ddd4731c61c514c2aebdab0 -% fbdbbb8521450a008c1fbefff0 -% 5ef777105492aeb7554b77aad0 -% 75beeefffffffbfdfffeedffb0 -% efebdddbaaad56af555bdf55f0 -% 5d7efbbefffbfffaffd77bff50 -% fb01af77aadf5aafda8ed6adf0 -% 5f19fbdd7fb5f7faf7edfffb70 -% 7599061a94298815094c8817d0 -% ef1124c9912899c8c888cdcef0 -% 5d9738c499f5cc8c9dccc89db0 -% fb1d29cc99a489d9c88ccc97f0 -% 5f9b3ca971c8dc8c8ccc8abd50 -% f5169458094484888888c40ff0 -% 5f7f7ff54fffbfffffffbd0ab0 -% f5ebd6a9cd5b75556d55f1cff0 -% 5f7efdfc5ff6efffdfff5c5db0 -% f6d7afaff55fdd5afab5f7fb70 -% 5dfd7afb5ff57bf7afef5daff0 -% 77afefaef6bfdf6efaddf7fab0 -% eefabafbbdeab5dbafb75d57f0 -% 5c005756d6addb6d756db6ed50 -% fa003dfdbdfb77dbdfdb7dbff0 -% 5e086f57edaedd6b757febeab0 -% 74043bfd7a512b1a8b42bf7ff0 -% ee026eafdffff6fffeffebd550 -% bc7f3bfaf5ad5fd557ad7ebff0 -% 6ec06d575b76eabbbd76d5d570 -% fa0037adeddbbd6ed6ddaf77d0 -% 5e766d7f5f76ebfbbdf7fadd70 -% 74003ed5b5adb6aad6ad576bd0 -% ee006b7aed6d6dedbdbaedb770 -% 5c003ed7bbdfdf5feb77bb6df0 -% fffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 357.165354 translate -283.464567 -357.165354 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 126 8 -% Transformation matrix -[ 100 0 0 126 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c095754520d0c095754520d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c095754520d0c090d0c090d0c090d0c090d0c095754520d0c09 -0d0c090d0c090d0c090d0c090d0c095754520d0c095754520d0c095754520d0c090d0c090d0c09 -5754520d0c090d0c090d0c090d0c090d0c095754520d0c090d0c095754520d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09575452 -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c18d8b8eb8b3c1b8b3c1b8b3c1 -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c18d8b8eb8b3c10d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c095754520d0c095754520d0c095754520d0c09 -0d0c095754525754525754520d0c095754520d0c095754525754525754520d0c095754520d0c09 -0d0c090d0c090d0c095754520d0c090d0c090d0c095754520d0c095754520d0c095754520d0c09 -5754520d0c090d0c095754525754520d0c095754520d0c090d0c095754520d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09575452 -b8b3c18d8b8eb8b3c1b8b3c1b8b3c18d8b8eb8b3c1b8b3c1b8b3c18d8b8e8d8b8eb8b3c1b8b3c1 -b8b3c18d8b8eb8b3c1b8b3c1b8b3c1b8b3c18d8b8eb8b3c10d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09575452 -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1 -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c10d0c09 -0d0c09b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534 -b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534 -b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534 -b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534 -b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534 -b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534b01534a6385a -b8b3c18d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8eb8b3c18d8b8e8d8b8e8d8b8e8d8b8e8d8b8e -8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8eb8b3c10d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5c -b8b3c18d8b8e8d8b8e5754528d8b8e8d8b8e8d8b8e8d8b8e5754528d8b8e8d8b8e8d8b8e8d8b8e -8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8eb8b3c10d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5c -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1 -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c10d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5c -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1dfd9dab8b3c1b8b3c1dfd9dab8b3c1b8b3c1b8b3c1b8b3c1 -b8b3c1b8b3c1dfd9dab8b3c1b8b3c1b8b3c1b8b3c1b8b3c10d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5c -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1dfd9dab8b3c1b8b3c1dfd9dadfd9dab8b3c1b8b3c1dfd9da -b8b3c1b8b3c1dfd9dab8b3c1b8b3c1b8b3c1dfd9dab8b3c10d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5c -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1 -b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c10d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104b -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c0d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104be16e8fe16e8fe16e8fe16e8fe16e8fe16e8f -e16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8f -e16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8f -e16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8f -e16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8f -e16e8fe16e8fe16e8fdd0046e02c5ce16e8fe16e8fe16e8fa6385ab01534e16e8fe16e8fe16e8f -e16e8fe16e8fe02c5cdd0046d7104ba6385aa6385aa6385aa6385aa6385aa6385aa6385aa6385a -a6385ab01534b01534dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9dab8b3c18d8b8e5754525754528d8b8edfd9dafdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e16e8ffdfdfddfd9da5754520d0c090d0c098d8b8efdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046d7104b5754528d8b8e5754525754520d0c090d0c09575452dfd9da -b8b3c1575452575452dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfddfd9da8d8b8e5754520d0c090d0c090d0c090d0c090d0c090d0c09575452 -dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e16e8fb8b3c10d0c090d0c090d0c095754520d0c09b8b3c1fdfdfd -dfd9dafdfdfde16e8fdd0046d7104b8d8b8e8d8b8e0d0c095754525754520d0c09575452b8b3c1 -fdfdfddfd9da575452dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdb8b3c15754520d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -575452dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e16e8f8d8b8e0d0c090d0c090d0c090d0c090d0c09575452575452 -dfd9dafdfdfde16e8fdd0046d7104bb8b3c15754520d0c09575452b8b3c18d8b8e8d8b8e8d8b8e -fdfdfdfdfdfd8d8b8edd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfd8d8b8e0d0c090d0c090d0c090d0c090d0c095754525754528d8b8e5754520d0c090d0c09 -0d0c09575452dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e16e8fdfd9da0d0c090d0c090d0c090d0c098d8b8e8d8b8eb8b3c1 -fdfdfdfdfdfde16e8fdd0046d7104bdfd9da575452575452b8b3c1fdfdfddfd9da8d8b8e575452 -b8b3c1fdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfd5754520d0c090d0c090d0c09575452b8b3c1b8b3c1dfd9dadfd9dadfd9dab8b3c18d8b8e -5754520d0c098d8b8efdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9da -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e16e8ffdfdfd0d0c090d0c09575452b8b3c1dfd9dab8b3c1dfd9da -fdfdfdfdfdfde16e8fdd0046d7104bb8b3c1575452575452575452dfd9dab8b3c1dfd9da575452 -8d8b8edfd9da8d8b8edd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -dfd9da0d0c090d0c095754528d8b8eb8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dadfd9da -8d8b8e0d0c09575452fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdb8b3c18d8b8eb8b3c18d8b8e8d8b8e -8d8b8e8d8b8edfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5c8d8b8e575452575452b8b3c1b8b3c1b8b3c1dfd9dadfd9da -fdfdfdfdfdfde16e8fdd0046d7104bb8b3c15754525754528d8b8edfd9dafdfdfdfdfdfd8d8b8e -b8b3c1b8b3c1575452dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -b8b3c10d0c090d0c098d8b8eb8b3c1b8b3c1b8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dab8b3c1 -b8b3c1575452575452dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdb8b3c18d8b8e5754525754525754528d8b8e575452 -5754525754525754528d8b8edfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cdfd9dab8b3c18d8b8eb8b3c1b8b3c1dfd9dadfd9dab8b3c1 -8d8b8edfd9dae6a5b7dd0046d7104b8d8b8e8d8b8e8d8b8e8d8b8eb8b3c1dfd9dafdfdfdb8b3c1 -dfd9dadfd9da8d8b8edd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -b8b3c10d0c095754528d8b8eb8b3c1b8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dab8b3c1 -b8b3c1575452575452dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfd8d8b8e5754525754525754525754525754520d0c09575452 -8d8b8eb8b3c18d8b8e5754528d8b8e8d8b8edfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfddfd9da8d8b8edfd9dab8b3c1dfd9dadfd9dab8b3c1 -5754528d8b8ea6385add0046d7104b8d8b8e8d8b8e575452575452b8b3c1b8b3c1b8b3c1b8b3c1 -dfd9dadfd9da8d8b8edd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -8d8b8e0d0c09575452b8b3c18d8b8e5754525754528d8b8eb8b3c1b8b3c1b8b3c18d8b8e8d8b8e -b8b3c18d8b8e0d0c09dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdb8b3c15754525754525754525754525754525754528d8b8edfd9da -dfd9dadfd9dab8b3c18d8b8e5754528d8b8e8d8b8edfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfd8d8b8e0d0c09b8b3c1b8b3c1dfd9dadfd9da8d8b8e -5754528d8b8ea6385add0046d7104b5754528d8b8e5754525754528d8b8e8d8b8e8d8b8edfd9da -dfd9dadfd9dae6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -5754520d0c095754528d8b8e575452575452575452575452575452b8b3c1575452575452575452 -5754528d8b8e575452dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfddfd9da5754525754525754525754520d0c095754528d8b8edfd9dafdfdfd -dfd9dadfd9dadfd9dab8b3c15754528d8b8e8d8b8e8d8b8edfd9dafdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e16e8fdfd9da5754520d0c090d0c098d8b8edfd9dadfd9da8d8b8e -8d8b8e8d8b8ea6385add0046b015345754525754525754525754525754528d8b8edfd9da8d8b8e -b8b3c1fdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -5754520d0c095754528d8b8e8d8b8e5754528d8b8e8d8b8e8d8b8eb8b3c18d8b8e575452575452 -8d8b8e8d8b8e575452dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfddfd9da5754525754525754525754520d0c090d0c098d8b8edfd9dafdfdfd -fdfdfddfd9dadfd9dadfd9da8d8b8e8d8b8eb8b3c18d8b8e8d8b8efdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046d7104ba6385ab01534b01534b01534b01534a6385ae16e8fa6385a -a6385aa6385ab01534dd0046dd0046b01534b01534b01534b01534a6385ae16e8fa6385aa6385a -b01534a6385ae02c5cdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -b8b3c15754528d8b8eb8b3c1b8b3c18d8b8eb8b3c18d8b8e8d8b8eb8b3c18d8b8e8d8b8e8d8b8e -8d8b8e8d8b8e8d8b8efdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdb8b3c15754525754525754520d0c090d0c09575452b8b3c1fdfdfddfd9da -fdfdfdfdfdfdfdfdfddfd9dab8b3c15754528d8b8e8d8b8e575452dfd9dafdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -dfd9da5754528d8b8e8d8b8eb8b3c1b8b3c1b8b3c18d8b8e8d8b8eb8b3c1b8b3c1b8b3c1b8b3c1 -b8b3c18d8b8edfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdb8b3c15754525754520d0c09575452575452b8b3c1dfd9dadfd9dafdfdfd -fdfdfddfd9dadfd9dadfd9dab8b3c15754525754525754525754528d8b8efdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5ce6a5b7e6a5b7e6a5b78d8b8e5754525754528d8b8ee6a5b7 -e6a5b7e6a5b7e16e8fdd0046d7104be6a5b7e6a5b7e6a5b7e6a5b78d8b8ee16e8fe6a5b7e6a5b7 -e6a5b7e6a5b7e16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -dfd9da8d8b8e8d8b8e8d8b8e8d8b8eb8b3c1b8b3c18d8b8eb8b3c1b8b3c18d8b8eb8b3c1b8b3c1 -b8b3c1b8b3c1fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfd8d8b8e0d0c09575452575452b8b3c1dfd9dadfd9dadfd9dadfd9dadfd9da -b8b3c1dfd9dadfd9dadfd9dadfd9da8d8b8e0d0c095754528d8b8eb8b3c1fdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfdfdfdfd8d8b8e575452575452575452575452b8b3c1 -fdfdfdfdfdfde6a5b7dd0046d7104bfdfdfdfdfdfddfd9da8d8b8eb8b3c1dfd9dadfd9dadfd9da -fdfdfdfdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdb8b3c18d8b8e8d8b8e8d8b8e8d8b8e8d8b8e5754525754528d8b8e8d8b8e8d8b8e8d8b8e -b8b3c1dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdb8b3c15754525754528d8b8eb8b3c1b8b3c1b8b3c1dfd9dab8b3c1b8b3c1 -8d8b8eb8b3c1b8b3c1dfd9dadfd9dab8b3c15754525754525754528d8b8efdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfd8d8b8e0d0c09575452dfd9dafdfdfd8d8b8e575452 -b8b3c1fdfdfde6a5b7dd0046d7104bfdfdfdfdfdfd575452b8b3c1fdfdfdfdfdfdfdfdfddfd9da -dfd9dafdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfddfd9da8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e -b8b3c1fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfddfd9da5754525754528d8b8e8d8b8e8d8b8e575452b8b3c1dfd9dab8b3c1 -8d8b8e8d8b8eb8b3c1dfd9dadfd9dab8b3c1575452575452575452575452fdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfd5754520d0c098d8b8efdfdfdfdfdfdfdfdfd575452 -8d8b8efdfdfde6a5b7dd0046d7104bfdfdfddfd9da575452dfd9dafdfdfdfdfdfdfdfdfddfd9da -b8b3c1fdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfd8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e5754525754525754528d8b8e8d8b8e8d8b8e -b8b3c1fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfd8d8b8e0d0c095754528d8b8e575452575452b8b3c1dfd9dadfd9da -b8b3c1dfd9dadfd9dadfd9dadfd9dadfd9da8d8b8e5754528d8b8e575452dfd9dafdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfd8d8b8e5754528d8b8e8d8b8edfd9da8d8b8e8d8b8e -b8b3c1fdfdfde6a5b7dd0046d7104bfdfdfddfd9da575452b8b3c1dfd9dafdfdfdfdfdfddfd9da -b8b3c1fdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdb8b3c18d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8e -dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfddfd9da5754525754528d8b8e8d8b8e8d8b8eb8b3c1dfd9dadfd9da -dfd9dadfd9dadfd9dadfd9dadfd9dadfd9dadfd9dab8b3c1b8b3c18d8b8edfd9dafdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfdb8b3c18d8b8e8d8b8e8d8b8eb8b3c1b8b3c1b8b3c1 -dfd9dafdfdfde6a5b7dd0046d7104bfdfdfddfd9da8d8b8eb8b3c1b8b3c1fdfdfdfdfdfddfd9da -dfd9dafdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdb8b3c18d8b8e8d8b8e8d8b8e8d8b8e8d8b8e8d8b8eb8b3c18d8b8eb8b3c1 -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfd8d8b8e575452b8b3c1b8b3c18d8b8eb8b3c1dfd9dadfd9da -b8b3c1dfd9dafdfdfddfd9dadfd9dadfd9dadfd9dadfd9dadfd9da8d8b8eb8b3c1fdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfddfd9dab8b3c1b8b3c1b8b3c1b8b3c1dfd9dadfd9da -fdfdfdfdfdfde6a5b7dd0046d7104bfdfdfddfd9da8d8b8eb8b3c1b8b3c1fdfdfdfdfdfdfdfdfd -fdfdfdfdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdb8b3c18d8b8e8d8b8e8d8b8e8d8b8e8d8b8eb8b3c1b8b3c18d8b8e8d8b8e8d8b8e -dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd8d8b8e8d8b8eb8b3c18d8b8e8d8b8eb8b3c1b8b3c1 -b8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dab8b3c18d8b8e575452b8b3c1fdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfdfdfdfddfd9da8d8b8e8d8b8eb8b3c1b8b3c1dfd9da -fdfdfdfdfdfde6a5b7dd0046d7104bfdfdfdfdfdfdb8b3c1b8b3c1dfd9dafdfdfdfdfdfddfd9da -fdfdfdfdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfd5754525754528d8b8e5754525754528d8b8e8d8b8e8d8b8e8d8b8eb8b3c1575452 -575452fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd8d8b8eb8b3c18d8b8e5754528d8b8eb8b3c1 -dfd9dab8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dab8b3c1575452575452dfd9dafdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cfdfdfdfdfdfdb8b3c18d8b8eb8b3c1b8b3c1b8b3c1fdfdfd -fdfdfdfdfdfde6a5b7dd0046d7104bfdfdfdfdfdfdb8b3c18d8b8edfd9dafdfdfdfdfdfddfd9da -dfd9dafdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdb8b3c10d0c095754528d8b8e5754525754525754525754525754528d8b8eb8b3c1575452 -575452fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdb8b3c18d8b8e8d8b8e8d8b8e8d8b8eb8b3c1 -8d8b8e8d8b8e8d8b8edfd9dadfd9dadfd9dadfd9dab8b3c15754528d8b8efdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046e02c5cb8b3c15754525754528d8b8e8d8b8eb8b3c1b8b3c1b8b3c1 -dfd9dafdfdfde6a5b7dd0046d7104bfdfdfdfdfdfdfdfdfd575452b8b3c1dfd9dadfd9dafdfdfd -fdfdfdfdfdfddfd9dadd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9da -8d8b8e0d0c090d0c090d0c095754525754525754525754525754528d8b8eb8b3c18d8b8e0d0c09 -0d0c098d8b8eb8b3c1dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9da8d8b8eb8b3c1575452575452b8b3c1 -b8b3c1b8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dab8b3c1dfd9dafdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046b015340d0c090d0c090d0c098d8b8e8d8b8e8d8b8e5754520d0c09 -0d0c09575452a6385add0046d7104bfdfdfdfdfdfddfd9da5754528d8b8edfd9dadfd9dafdfdfd -dfd9dafdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdb8b3c18d8b8e5754520d0c09 -0d0c090d0c090d0c090d0c090d0c095754528d8b8e8d8b8e8d8b8e8d8b8e5754520d0c090d0c09 -0d0c090d0c090d0c090d0c095754528d8b8eb8b3c1dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd8d8b8eb8b3c18d8b8e8d8b8e8d8b8e -b8b3c1dfd9dadfd9dab8b3c1dfd9dab8b3c1dfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046dd0046b01534b01534b01534d7104bd7104be02c5cb01534b01534 -b01534b01534dd0046dd0046dd0046e02c5ce02c5cd7104bb01534e02c5ce02c5ce02c5ce02c5c -e02c5ce02c5cd7104bdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104b5754525754520d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c095754525754520d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c09575452575452b8b3c1fdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdb8b3c18d8b8e8d8b8eb8b3c1b8b3c1 -b8b3c1dfd9dadfd9dab8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09575452b8b3c1fdfdfd -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd8d8b8e8d8b8e8d8b8eb8b3c1 -dfd9dadfd9dab8b3c1b8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046b015345754525754525754525754520d0c09575452575452575452 -575452575452b01534dd0046e02c5ce6a5b7e6a5b75754520d0c090d0c090d0c090d0c09e6a5b7 -e6a5b7e6a5b7e16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09575452 -b8b3c1fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9da5754528d8b8e8d8b8e -b8b3c18d8b8eb8b3c1b8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a5754525754525754520d0c090d0c090d0c09575452575452 -575452575452a6385add0046e02c5cfdfdfd8d8b8e0d0c090d0c090d0c090d0c090d0c09575452 -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c09575452dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdb8b3c15754528d8b8e8d8b8e -8d8b8e8d8b8eb8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a8d8b8e8d8b8e5754520d0c09575452575452575452575452 -575452575452a6385add0046e02c5cfdfdfd8d8b8e8d8b8e8d8b8e8d8b8eb8b3c1575452575452 -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c098d8b8efdfdfdfdfdfdfdfdfdfdfdfddfd9dab8b3c18d8b8e5754528d8b8e8d8b8e -8d8b8e8d8b8eb8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a8d8b8e8d8b8edfd9dadfd9dadfd9dab8b3c18d8b8e8d8b8e -8d8b8e575452a6385add0046e02c5cfdfdfdb8b3c18d8b8edfd9dadfd9dadfd9dab8b3c1575452 -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c09575452fdfdfdfdfdfddfd9dab8b3c1b8b3c18d8b8eb8b3c15754525754528d8b8e -8d8b8e8d8b8eb8b3c1b8b3c1dfd9dadfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a8d8b8e8d8b8eb8b3c1dfd9dadfd9da8d8b8e8d8b8e8d8b8e -575452575452a6385add0046e02c5cfdfdfddfd9da8d8b8e8d8b8eb8b3c18d8b8eb8b3c1b8b3c1 -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c09575452fdfdfddfd9dadfd9dadfd9dab8b3c18d8b8edfd9dab8b3c18d8b8e8d8b8e -8d8b8e8d8b8eb8b3c1b8b3c1dfd9dadfd9dadfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a8d8b8e8d8b8eb8b3c1b8b3c18d8b8e8d8b8e8d8b8eb8b3c1 -575452575452a6385add0046e02c5cfdfdfdfdfdfd8d8b8e8d8b8eb8b3c1b8b3c1b8b3c1dfd9da -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c098d8b8edfd9dafdfdfdfdfdfddfd9dadfd9dadfd9dab8b3c1dfd9dafdfdfdb8b3c18d8b8e -b8b3c1b8b3c1b8b3c1dfd9dadfd9dadfd9dab8b3c18d8b8edfd9dafdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a8d8b8e575452b8b3c1dfd9da5754528d8b8eb8b3c1b8b3c1 -8d8b8e575452a6385add0046e02c5cfdfdfdfdfdfdb8b3c18d8b8eb8b3c1b8b3c1b8b3c1dfd9da -fdfdfdfdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -b8b3c1fdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9dadfd9dadfd9dadfd9dab8b3c1fdfdfddfd9da -dfd9dadfd9dadfd9dadfd9dadfd9dadfd9dab8b3c18d8b8e8d8b8eb8b3c1dfd9dafdfdfdfdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a8d8b8e575452b8b3c1dfd9dab8b3c18d8b8eb8b3c18d8b8e -8d8b8e575452a6385add0046e02c5cfdfdfdfdfdfd8d8b8e5754525754528d8b8e8d8b8e575452 -dfd9dafdfdfde6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c098d8b8e5754520d0c090d0c090d0c090d0c090d0c09b8b3c1 -fdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9dafdfdfddfd9da8d8b8e575452dfd9dafdfdfd -dfd9dadfd9dadfd9dafdfdfddfd9dafdfdfdfdfdfddfd9dab8b3c1b8b3c18d8b8eb8b3c1fdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385a8d8b8e8d8b8e8d8b8edfd9dab8b3c18d8b8e8d8b8e8d8b8e -575452575452a6385add0046e02c5c8d8b8e0d0c090d0c095754528d8b8e8d8b8e8d8b8e0d0c09 -0d0c09575452a6385add0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c09dfd9da8d8b8e0d0c090d0c090d0c090d0c098d8b8efdfdfd -dfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9dafdfdfdb8b3c18d8b8e8d8b8e8d8b8eb8b3c1 -8d8b8edfd9dafdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfddfd9dadfd9dafdfdfd -fdfdfdfdfdfde6a5b7dd0046a6385ab8b3c18d8b8e5754528d8b8edfd9da8d8b8e575452575452 -0d0c09575452a6385add0046b015340d0c090d0c090d0c090d0c098d8b8e8d8b8e8d8b8e575452 -0d0c090d0c090d0c09dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015340d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c095754525754520d0c090d0c090d0c09575452b8b3c1dfd9da -dfd9dadfd9dadfd9dadfd9dadfd9dadfd9dadfd9dab8b3c1dfd9dab8b3c1b8b3c1b8b3c1b8b3c1 -b8b3c18d8b8edfd9dadfd9dadfd9dadfd9dadfd9dadfd9dadfd9dadfd9dadfd9dadfd9dadfd9da -dfd9dadfd9dae6a5b7dd0046a6385a5754525754525754525754528d8b8eb8b3c18d8b8e575452 -0d0c09575452b01534dd0046b015340d0c090d0c090d0c090d0c09575452b8b3c18d8b8eb8b3c1 -8d8b8e0d0c090d0c09dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bdd0046d7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bdd0046dd0046dd0046b01534b01534d7104bd7104bd7104bd7104bd7104bd7104b -b01534b01534dd0046dd0046dd0046b01534b01534b01534b01534b01534d7104bd7104bd7104b -d7104bb01534dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046d7104bd7104bd7104bd7104bdd0046dd0046 -dd0046d7104bd7104bd7104bd7104bdd0046d7104bd7104bd7104bd7104bdd0046dd0046dd0046 -d7104bd7104bd7104bd7104bdd0046dd0046d7104bd7104bd7104bd7104bdd0046dd0046dd0046 -d7104bd7104bd7104bd7104bdd0046d7104bd7104bd7104bd7104bdd0046dd0046d7104bd7104b -d7104bd7104bd7104bdd0046dd0046d7104bd7104bd7104bdd0046dd0046dd0046dd0046d7104b -d7104bd7104bd7104bdd0046dd0046d7104bd7104bd7104bdd0046dd0046dd0046d7104bd7104b -d7104bd7104bdd0046dd0046dd0046d7104bd7104bd7104bdd0046dd0046dd0046dd0046d7104b -d7104bd7104bdd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cdfd9dafdfdfddfd9da575452575452575452 -5754528d8b8edfd9dafdfdfde6a5b7dd0046e6a5b7fdfdfdfdfdfd8d8b8e0d0c090d0c090d0c09 -0d0c09b8b3c1fdfdfddfd9dadd0046e02c5cdfd9dafdfdfdb8b3c10d0c090d0c090d0c090d0c09 -575452dfd9dafdfdfde6a5b7dd0046e6a5b7fdfdfdb8b3c18d8b8e8d8b8e575452575452b8b3c1 -fdfdfddfd9dadfd9dad7104bd7104bdfd9dafdfdfd5754520d0c090d0c090d0c090d0c098d8b8e -fdfdfdfdfdfde6a5b7dd0046e16e8ffdfdfddfd9da5754525754528d8b8e8d8b8e8d8b8edfd9da -fdfdfdfdfdfde16e8fdd0046b015348d8b8eb8b3c15754525754520d0c090d0c09575452575452 -b8b3c1b8b3c1e16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfddfd9da8d8b8e8d8b8eb8b3c1 -8d8b8e575452dfd9dafdfdfde6a5b7dd0046dfd9dafdfdfddfd9da0d0c090d0c090d0c090d0c09 -0d0c090d0c09fdfdfdfdfdfddd0046e02c5cfdfdfdfdfdfd5754525754528d8b8e8d8b8e575452 -0d0c098d8b8efdfdfde6a5b7dd0046dfd9dafdfdfdb8b3c1b8b3c1dfd9dab8b3c1575452575452 -fdfdfdfdfdfdfdfdfdd7104bd7104bfdfdfddfd9da0d0c09575452b8b3c1b8b3c15754520d0c09 -fdfdfdfdfdfddfd9dadd0046e16e8ffdfdfdb8b3c1575452b8b3c1dfd9dadfd9dab8b3c18d8b8e -fdfdfdfdfdfde16e8fdd0046d7104bb8b3c18d8b8e0d0c095754520d0c095754520d0c090d0c09 -b8b3c1dfd9dae16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfdb8b3c18d8b8edfd9dafdfdfd -fdfdfddfd9dadfd9dafdfdfde6a5b7dd0046dfd9dafdfdfd8d8b8e0d0c090d0c09575452575452 -575452575452dfd9dafdfdfddd0046e02c5cfdfdfdb8b3c1575452fdfdfdfdfdfdfdfdfddfd9da -575452575452fdfdfde6a5b7dd0046dfd9dafdfdfddfd9dadfd9dadfd9dadfd9da8d8b8e575452 -fdfdfdfdfdfdfdfdfdd7104bd7104bfdfdfd8d8b8e0d0c09dfd9dafdfdfdfdfdfddfd9da0d0c09 -dfd9dafdfdfde6a5b7dd0046e16e8ffdfdfd5754528d8b8edfd9dadfd9dafdfdfddfd9da575452 -b8b3c1fdfdfde16e8fdd0046d7104bb8b3c1575452575452b8b3c1dfd9dadfd9dab8b3c10d0c09 -575452dfd9dae16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfd8d8b8e8d8b8eb8b3c1fdfdfd -fdfdfdfdfdfdfdfdfdfdfdfde6a5b7dd0046dfd9dafdfdfd8d8b8e5754528d8b8e8d8b8edfd9da -dfd9da8d8b8edfd9dafdfdfddd0046e02c5cfdfdfddfd9da8d8b8e8d8b8eb8b3c1b8b3c1575452 -575452575452fdfdfde6a5b7dd0046e6a5b7fdfdfddfd9dadfd9dadfd9dab8b3c18d8b8e575452 -dfd9dafdfdfdfdfdfdd7104bd7104bfdfdfdb8b3c18d8b8edfd9dafdfdfddfd9dadfd9da575452 -dfd9dafdfdfde6a5b7dd0046e16e8ffdfdfd8d8b8e8d8b8eb8b3c1dfd9dadfd9dab8b3c18d8b8e -dfd9dafdfdfde16e8fdd0046b01534b8b3c1575452b8b3c1fdfdfdfdfdfdfdfdfdb8b3c1575452 -575452dfd9dae16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cfdfdfdfdfdfd8d8b8e8d8b8e8d8b8eb8b3c1 -dfd9dadfd9dafdfdfdfdfdfde6a5b7dd0046dfd9dafdfdfd8d8b8eb8b3c15754525754528d8b8e -8d8b8e8d8b8efdfdfddfd9dadd0046e02c5cfdfdfddfd9da8d8b8e8d8b8eb8b3c1b8b3c18d8b8e -8d8b8e575452fdfdfde6a5b7dd0046e6a5b7fdfdfddfd9dab8b3c1b8b3c1b8b3c1b8b3c1575452 -b8b3c1fdfdfdfdfdfdd7104bd7104bfdfdfddfd9da8d8b8e5754528d8b8e8d8b8e8d8b8e8d8b8e -dfd9dafdfdfde6a5b7dd0046e16e8ffdfdfdb8b3c18d8b8e8d8b8eb8b3c18d8b8e8d8b8e8d8b8e -fdfdfdfdfdfde16e8fdd0046b015348d8b8eb8b3c1b8b3c18d8b8eb8b3c18d8b8e575452575452 -8d8b8edfd9dae16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5cdfd9da8d8b8e8d8b8eb8b3c18d8b8eb8b3c1 -b8b3c1dfd9dafdfdfdfdfdfde6a5b7dd0046dfd9dafdfdfdb8b3c1b8b3c1b8b3c18d8b8e8d8b8e -8d8b8edfd9dafdfdfddfd9dadd0046e02c5cfdfdfdfdfdfddfd9dafdfdfdfdfdfddfd9dadfd9da -8d8b8e575452fdfdfde6a5b7dd0046e6a5b7fdfdfddfd9dadfd9dab8b3c1dfd9dab8b3c18d8b8e -dfd9dafdfdfdfdfdfdd7104bd7104bfdfdfdfdfdfdb8b3c1b8b3c1b8b3c1b8b3c1b8b3c1b8b3c1 -dfd9dafdfdfde6a5b7dd0046e16e8ffdfdfdb8b3c18d8b8edfd9dab8b3c1dfd9dadfd9dab8b3c1 -fdfdfdfdfdfde16e8fdd0046d7104b8d8b8eb8b3c1fdfdfddfd9dadfd9da8d8b8eb8b3c1575452 -b8b3c1dfd9dae16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046e02c5c5754525754528d8b8e8d8b8e8d8b8edfd9da -dfd9dafdfdfdfdfdfdfdfdfde6a5b7dd0046dfd9dafdfdfddfd9da8d8b8e8d8b8e575452b8b3c1 -b8b3c1fdfdfdfdfdfddfd9dadd0046e02c5cfdfdfdfdfdfdfdfdfddfd9dadfd9da8d8b8eb8b3c1 -b8b3c1dfd9dafdfdfde6a5b7dd0046e6a5b7fdfdfddfd9dadfd9dab8b3c1dfd9dab8b3c1b8b3c1 -fdfdfdfdfdfdfdfdfdd7104bd7104bfdfdfdfdfdfddfd9dadfd9dab8b3c1b8b3c1dfd9dadfd9da -fdfdfdfdfdfde6a5b7dd0046e16e8ffdfdfddfd9da8d8b8e8d8b8e8d8b8e8d8b8eb8b3c1b8b3c1 -fdfdfdfdfdfde16e8fdd0046d7104bb8b3c1b8b3c1dfd9dadfd9dab8b3c15754528d8b8e8d8b8e -dfd9dadfd9dae16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015345754525754528d8b8e8d8b8e8d8b8edfd9da -dfd9dab8b3c1dfd9dafdfdfde6a5b7dd0046dfd9dafdfdfdb8b3c18d8b8e8d8b8e8d8b8eb8b3c1 -b8b3c1fdfdfdfdfdfddfd9dadd0046e02c5cfdfdfdfdfdfdfdfdfddfd9dab8b3c18d8b8e8d8b8e -dfd9dafdfdfdfdfdfde6a5b7dd0046e6a5b7fdfdfdfdfdfddfd9dab8b3c1b8b3c18d8b8e8d8b8e -dfd9dafdfdfdfdfdfdd7104bd7104bfdfdfdfdfdfddfd9dab8b3c18d8b8e8d8b8eb8b3c1dfd9da -fdfdfdfdfdfde6a5b7dd0046e16e8ffdfdfdfdfdfd5754525754528d8b8e8d8b8e575452dfd9da -fdfdfdfdfdfde16e8fdd0046d7104bb8b3c1b8b3c1dfd9dadfd9dadfd9da8d8b8e8d8b8e8d8b8e -b8b3c1b8b3c1e16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015345754525754528d8b8e575452b8b3c1dfd9da -8d8b8e5754528d8b8efdfdfde6a5b7dd0046dfd9dafdfdfdfdfdfd8d8b8e5754528d8b8eb8b3c1 -dfd9dafdfdfdfdfdfddfd9dadd0046e02c5cfdfdfdfdfdfdfdfdfdb8b3c1b8b3c1b8b3c18d8b8e -b8b3c1fdfdfdfdfdfde6a5b7dd0046e6a5b7fdfdfdfdfdfddfd9dab8b3c18d8b8e8d8b8e575452 -8d8b8edfd9dafdfdfdd7104bd7104bfdfdfdfdfdfddfd9da8d8b8eb8b3c1b8b3c1b8b3c1b8b3c1 -fdfdfdfdfdfde6a5b7dd0046e16e8ffdfdfdfdfdfd5754525754528d8b8e575452575452fdfdfd -fdfdfdfdfdfde16e8fdd0046e02c5cdfd9dafdfdfdfdfdfddfd9dadfd9dab8b3c18d8b8e575452 -575452b8b3c1e16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046b015345754525754528d8b8e8d8b8eb8b3c18d8b8e -575452575452575452b8b3c1e6a5b7dd0046dfd9dafdfdfddfd9dadfd9da8d8b8e8d8b8e575452 -b8b3c1fdfdfdfdfdfdfdfdfddd0046e02c5cfdfdfdfdfdfdb8b3c18d8b8e8d8b8e575452575452 -0d0c09dfd9dafdfdfde6a5b7dd0046dfd9dafdfdfdfdfdfddfd9dab8b3c1b8b3c18d8b8e575452 -5754525754528d8b8ed7104bd7104bfdfdfddfd9da5754528d8b8e5754525754528d8b8e575452 -8d8b8efdfdfddfd9dadd0046e16e8fdfd9da5754528d8b8e5754525754525754528d8b8e8d8b8e -dfd9dafdfdfde16e8fdd0046e02c5cfdfdfdfdfdfdfdfdfddfd9dab8b3c18d8b8e5754528d8b8e -8d8b8edfd9dae6a5b7dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104b5754525754528d8b8ee6a5b78d8b8e575452 -575452575452575452575452a6385add0046e6a5b7b8b3c1b8b3c1e6a5b7e6a5b7b8b3c1575452 -575452e6a5b7dfd9dae6a5b7dd0046e02c5cb8b3c18d8b8e8d8b8e8d8b8eb8b3c18d8b8e0d0c09 -0d0c090d0c098d8b8ee16e8fdd0046e6a5b7dfd9dae6a5b78d8b8e8d8b8eb8b3c1575452575452 -5754525754520d0c09dd0046d7104b8d8b8e575452575452b8b3c15754525754528d8b8e575452 -0d0c098d8b8ee16e8fdd0046a6385a5754520d0c098d8b8eb8b3c18d8b8eb8b3c1b8b3c1575452 -0d0c09575452a6385add0046e02c5cdfd9dadfd9dadfd9dab8b3c1b8b3c18d8b8e8d8b8e8d8b8e -8d8b8edfd9dae16e8fdd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e16e8fe16e8fe6a5b7d7104b -e02c5ce6a5b7e16e8fe16e8fdd0046dd0046e16e8fe16e8fe16e8fe16e8fdd0046dd0046e16e8f -e6a5b7e16e8fdd0046e16e8fe6a5b7e16e8fd7104be02c5ce16e8fe16e8fd7104bd7104be16e8f -e16e8fe02c5cdd0046e6a5b7e02c5cdd0046e02c5ce16e8fe16e8fe6a5b7e02c5cdd0046e16e8f -e16e8fdd0046d7104be16e8fdd0046dd0046e16e8fe16e8fdd0046dd0046e16e8fe16e8fdd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dfd9dae16e8fdfd9dae16e8f -e02c5cdfd9dae02c5cfdfdfdd7104be02c5cdfd9dad7104bdd0046dfd9dae16e8fdd0046dfd9da -e16e8fd7104bdd0046e6a5b7e6a5b7d7104bdd0046e6a5b7e16e8fd7104bdd0046e16e8fe6a5b7 -d7104bd7104bdd0046dfd9dae16e8fdd0046dfd9dae16e8fdd0046e16e8fdfd9dadd0046e16e8f -fdfdfde16e8fdd0046e16e8fdd0046dd0046dfd9dadfd9dadd0046dd0046e6a5b7e6a5b7dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e6a5b7e6a5b7e6a5b7e02c5c -e02c5cdfd9dae6a5b7e16e8fdd0046e6a5b7e6a5b7dd0046dd0046e16e8fdfd9dadd0046e6a5b7 -e6a5b7e16e8fdd0046e6a5b7dfd9dae16e8fdd0046e16e8ffdfdfde6a5b7d7104be02c5cdfd9da -dfd9dae02c5cdd0046dfd9dae02c5ce02c5cfdfdfddd0046dd0046e02c5cfdfdfdd7104be16e8f -e16e8ffdfdfde16e8fe16e8fdd0046e02c5ce16e8fdfd9dae02c5cdd0046e6a5b7e16e8fdd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dfd9dae16e8fdd0046dd0046 -e02c5cdfd9dadfd9dae16e8fdd0046e16e8fdfd9dadd0046dd0046e6a5b7e6a5b7dd0046dfd9da -e16e8fdd0046dd0046e6a5b7e6a5b7dd0046dd0046dd0046e02c5cdfd9dae16e8fdd0046d7104b -e6a5b7e6a5b7dd0046dfd9dae02c5cd7104bfdfdfde02c5cdd0046e02c5cfdfdfddd0046e16e8f -d7104be16e8ffdfdfde6a5b7dd0046e16e8fe16e8fdfd9dae6a5b7dd0046e6a5b7e16e8fdd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dfd9dae16e8fdd0046dd0046 -e02c5cdfd9dae02c5cdfd9dae02c5cd7104be6a5b7e16e8fe16e8fe6a5b7e02c5cdd0046dfd9da -e16e8fdd0046dd0046e6a5b7e6a5b7e16e8fdd0046e16e8fe16e8fe6a5b7e02c5ce02c5ce16e8f -e16e8fe16e8fdd0046dfd9dae16e8fdd0046e16e8fe6a5b7e02c5ce6a5b7e16e8fdd0046e16e8f -e02c5cdd0046e16e8fe6a5b7d7104be16e8fdd0046e02c5cdfd9dadd0046e6a5b7e6a5b7e16e8f -d7104bdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bd7104bdd0046dd0046 -dd0046d7104bdd0046d7104bd7104bdd0046dd0046e02c5ce02c5cdd0046dd0046dd0046d7104b -d7104bdd0046dd0046d7104be02c5ce02c5cdd0046d7104be02c5cd7104bdd0046d7104be02c5c -e02c5cdd0046dd0046d7104bd7104bdd0046dd0046e02c5ce02c5cd7104bdd0046dd0046d7104b -dd0046dd0046dd0046d7104bdd0046d7104bdd0046dd0046d7104bdd0046d7104be02c5ce02c5c -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104be02c5cdd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bd86427d86427 -e02c5ce02c5cd86427d86427e02c5cdd0046dd0046dd0046dd0046e02c5cf9f302f9f302d8ac0f -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bd86427f9f302 -f9f302f9f302f9f302d8ac0fb01534dd0046dd0046dd0046dd0046d86427f9f302f9f302f9f302 -d7104bdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046dd0046dd0046d7104bd8ac0fd8ac0fd86427 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046b01534d86427 -dd0046dd0046dd0046dd0046d7104bd86427dd0046d7104bd86427d86427e02c5cdd0046dd0046 -d7104be02c5ce02c5ce02c5ce02c5cdd0046d7104be02c5ce02c5ce02c5ce02c5cdd0046e02c5c -e02c5ce02c5ce02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5ce02c5cdd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046dd0046dd0046d7104bd86427f9f302d8ac0f -dd0046dd0046d7104bd86427f9f302f9f302d86427d8ac0ff9f302f9f302f9f302d86427dd0046 -e02c5cd8ac0ff9f302f9f302f9f302d7104be02c5cd8ac0ff9f302f9f302f9f302d7104bd86427 -d8ac0ff9f302f9f302f9f302f9f302a6385ae02c5cd8ac0ff9f302d8ac0fd86427dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046dd0046d86427f9f302f9f302f9f302d8ac0f -dd0046e02c5cd8ac0ff9f302f9f302f9f302d86427b01534b01534f9f302f9f302f9f302e02c5c -dd0046dd0046f9f302f9f302f9f302d7104bdd0046dd0046f9f302f9f302f9f302d7104bdd0046 -d7104bd8ac0ff9f302f9f302f9f302d7104bdd0046d8ac0fd8ac0fb01534dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046dd0046dd0046d86427f9f302f9f302d8ac0f -dd0046dd0046b01534f9f302f9f302f9f302dd0046dd0046dd0046d8ac0ff9f302f9f302d86427 -dd0046dd0046f9f302f9f302f9f302d7104bdd0046dd0046f9f302f9f302f9f302d7104bdd0046 -dd0046d7104bf9f302f9f302f9f302d8ac0fd86427d8ac0fb01534dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302d8ac0f -dd0046dd0046dd0046f9f302f9f302f9f302dd0046dd0046dd0046d8ac0ff9f302f9f302a6385a -dd0046dd0046f9f302f9f302f9f302d7104bdd0046dd0046f9f302f9f302f9f302d7104bdd0046 -dd0046dd0046e02c5cf9f302f9f302f9f302f9f302b01534dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302d8ac0f -dd0046dd0046d7104bf9f302f9f302f9f302dd0046dd0046dd0046d8ac0ff9f302f9f302a6385a -dd0046dd0046f9f302f9f302f9f302d7104bdd0046dd0046f9f302f9f302f9f302d7104bdd0046 -dd0046dd0046dd0046d8ac0ff9f302f9f302f9f302d86427dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046dd0046e02c5cd7104be02c5cf9f302f9f302d8ac0f -dd0046dd0046d7104bf9f302f9f302f9f302dd0046dd0046dd0046d8ac0ff9f302f9f302a6385a -dd0046dd0046f9f302f9f302f9f302d7104bdd0046dd0046f9f302f9f302f9f302d7104bdd0046 -dd0046dd0046e02c5cd8ac0fd8ac0ff9f302f9f302f9f302e02c5cdd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427 -f9f302f9f302d8ac0fdd0046dd0046dd0046e02c5cf9f302b01534d7104bf9f302f9f302d8ac0f -dd0046dd0046dd0046f9f302f9f302f9f302dd0046dd0046dd0046d8ac0ff9f302f9f302a6385a -dd0046dd0046d8ac0ff9f302f9f302e02c5cdd0046e02c5cf9f302f9f302f9f302d7104bdd0046 -dd0046d7104bf9f302a6385add0046d8ac0ff9f302f9f302f9f302d7104bdd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302 -f9f302f9f302f9f302d86427e02c5cd86427f9f302f9f302b01534d86427f9f302f9f302f9f302 -e02c5cd7104bd86427f9f302f9f302f9f302d86427dd0046e02c5cf9f302f9f302f9f302d8ac0f -e02c5cdd0046d86427f9f302f9f302f9f302d8ac0fd8ac0ff9f302f9f302f9f302d8ac0fe02c5c -d86427f9f302f9f302d7104bdd0046d86427f9f302f9f302f9f302d8ac0fe02c5cdd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bd8ac0fd8ac0f -d8ac0fd8ac0fd8ac0fd8ac0fd8ac0fd8ac0fd8ac0fd8ac0fd86427d8ac0fd8ac0fd8ac0fd8ac0f -d8ac0fd86427d8ac0fd8ac0fd8ac0fd8ac0fd8ac0fb01534d8ac0fd8ac0fd8ac0fd8ac0fd8ac0f -d86427dd0046dd0046d86427d8ac0fd8ac0fd86427b01534d8ac0fd8ac0fd86427b01534d86427 -d8ac0fd8ac0fd8ac0fd86427e02c5cd8ac0fd8ac0fd8ac0fd8ac0fd8ac0fd8ac0fd7104bdd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046b01534dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bdd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427d86427dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046e02c5cd8ac0fd8ac0fd8ac0fd86427d8ac0f -d8ac0fd86427dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302d7104bdd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046d86427f9f302f9f302b01534e02c5c -f9f302f9f302e02c5cdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104b -dd0046dd0046dd0046dd0046dd0046dd0046d7104bdd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046d7104bdd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bd86427d86427dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046d7104bdd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302dd0046dd0046 -f9f302f9f302d86427e02c5cd8ac0fd86427d8ac0fd8ac0fd7104bd7104bd86427d86427d8ac0f -d8ac0fe02c5cdd0046dd0046d86427d8ac0fd86427d8ac0fd86427d86427d7104be02c5cd8ac0f -d86427f9f302d8ac0fdd0046d86427d8ac0fd8ac0fd8ac0fe02c5cdd0046d7104bd86427d8ac0f -d86427d8ac0fd8ac0fd86427d8ac0ff9f302d8ac0fe02c5cdd0046d7104bd86427d8ac0fd86427 -d8ac0fd8ac0fd86427d86427d8ac0fd8ac0fe02c5cdd0046d7104bd86427d8ac0fdd0046d7104b -d86427d8ac0fd86427d8ac0ff9f302d86427dd0046dd0046d86427d8ac0fd86427d8ac0fd86427 -d86427d7104bdd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302d7104bd86427 -f9f302f9f302a6385af9f302f9f302d8ac0fd8ac0ff9f302a6385ad8ac0ff9f302b01534dd0046 -f9f302f9f302e02c5cd86427f9f302d86427dd0046d8ac0ff9f302d86427d86427f9f302f9f302 -d8ac0ff9f302d8ac0fd8ac0ff9f302a6385ae02c5cf9f302d8ac0fd7104bd8ac0ff9f302d8ac0f -b01534d86427f9f302d8ac0fb01534d86427f9f302d8ac0fdd0046d8ac0ff9f302f9f302b01534 -d86427f9f302f9f302b01534d86427f9f302d8ac0fdd0046d86427f9f302f9f302dd0046d86427 -f9f302f9f302a6385ab01534f9f302f9f302e02c5ce02c5cf9f302d8ac0fb01534d86427f9f302 -d8ac0fb01534dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302d86427d8ac0f -d8ac0fa6385add0046d8ac0ff9f302d86427d7104bb01534d86427f9f302d8ac0fdd0046dd0046 -d86427f9f302d8ac0fd8ac0ff9f302d86427dd0046d8ac0ff9f302d86427dd0046f9f302f9f302 -b01534b01534b01534a6385ab01534d7104bd86427f9f302d8ac0fdd0046e02c5cf9f302d8ac0f -dd0046e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046 -e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046d7104bf9f302f9f302dd0046dd0046 -f9f302f9f302d7104bdd0046d8ac0ff9f302a6385ad86427f9f302d8ac0fdd0046d86427f9f302 -d86427dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302b01534b01534 -b01534dd0046dd0046d8ac0ff9f302d86427dd0046dd0046d86427f9f302d8ac0fdd0046dd0046 -d86427f9f302d8ac0fd7104bf9f302d8ac0fe02c5cf9f302d8ac0fb01534dd0046f9f302f9f302 -b01534dd0046dd0046d7104bd8ac0fd8ac0fd86427f9f302d8ac0fdd0046e02c5cf9f302d8ac0f -dd0046e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046 -e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046d7104bf9f302f9f302dd0046dd0046 -f9f302f9f302d7104bdd0046d8ac0ff9f302a6385ad7104bd8ac0ff9f302e02c5cd8ac0ff9f302 -b01534dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cf9f302f9f302dd0046dd0046 -dd0046dd0046dd0046d8ac0ff9f302d86427dd0046dd0046e02c5cf9f302f9f302dd0046dd0046 -d86427f9f302d86427d7104bd8ac0fd8ac0fd86427d86427b01534dd0046dd0046f9f302f9f302 -b01534dd0046dd0046d8ac0ff9f302b01534d86427f9f302d8ac0fd7104be02c5cf9f302d8ac0f -dd0046e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046 -e02c5cf9f302d8ac0fdd0046e02c5cf9f302d8ac0fdd0046d7104bf9f302f9f302dd0046dd0046 -f9f302f9f302d7104bdd0046d8ac0ff9f302e02c5cd7104bd8ac0ff9f302d86427d86427b01534 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046d7104bd8ac0ff9f302f9f302d86427dd0046 -dd0046dd0046e02c5cd8ac0ff9f302d8ac0fd7104bdd0046dd0046d86427f9f302d8ac0fd86427 -d8ac0fd86427dd0046e02c5cf9f302f9f302f9f302f9f302f9f302d86427d86427f9f302f9f302 -d86427d7104bdd0046d8ac0ff9f302d8ac0fd86427f9f302f9f302d86427d8ac0ff9f302f9f302 -e02c5cd86427f9f302f9f302e02c5cd8ac0ff9f302f9f302d86427d86427f9f302f9f302e02c5c -d86427f9f302f9f302e02c5cd86427f9f302f9f302d86427d86427f9f302f9f302d86427d86427 -f9f302f9f302d86427e02c5cf9f302f9f302d8ac0fd7104bd8ac0ff9f302f9f302f9f302f9f302 -d8ac0fdd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046d7104ba6385ab01534b01534a6385add0046 -dd0046dd0046d7104ba6385ab01534a6385ab01534dd0046dd0046dd0046b01534a6385aa6385a -b01534dd0046dd0046e02c5cd8ac0fd8ac0fd8ac0fd8ac0ff9f302f9f302a6385ab01534b01534 -a6385ad7104bdd0046d7104ba6385ab01534dd0046b01534b01534d7104ba6385ab01534a6385a -b01534a6385ab01534a6385ab01534a6385ab01534b01534a6385aa6385ab01534a6385ab01534 -a6385ab01534b01534b01534a6385ab01534b01534a6385aa6385ab01534b01534a6385aa6385a -b01534b01534b01534b01534a6385ab01534a6385ae02c5cd8ac0fd8ac0fd8ac0fd8ac0ff9f302 -f9f302e02c5cdd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046f9f302f9f302dd0046dd0046dd0046f9f302d8ac0fdd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046d8ac0ff9f302d7104bdd0046dd0046d8ac0f -f9f302b01534dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046e02c5cd8ac0fd8ac0fd86427d86427d86427b01534dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5cd8ac0fd8ac0fd86427d86427d8ac0f -b01534dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046b01534b01534b01534dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046b01534b01534b01534dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046d7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bd7104bd7104bd7104bd7104bd7104bdd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bdfd9dadfd9dadfd9dadfd9dadfd9dadfd9da -dfd9dadfd9dadfd9dadfd9dae16e8fe02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5cd7104bdd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfdfdfdfdfdfdfdfdfdfde6a5b7dfd9da -fdfdfdfdfdfdfdfdfdfdfdfde16e8fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfdfdfdfdfdfdfdfdfdfde6a5b7d7104b -e6a5b7fdfdfdfdfdfdfdfdfde16e8fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5c -e02c5cd7104be02c5ce02c5cd7104be02c5ce02c5cd7104be02c5ce02c5ce02c5cd7104bd7104b -d7104bd7104bdd0046dd0046d7104bd7104bd7104be02c5cd7104be16e8fe02c5cd7104be02c5c -e02c5cd7104bd7104bd7104be02c5cd7104be02c5ce02c5cd7104bd7104bd7104bd7104bd7104b -d7104bdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfdfdfdfdfdfdfde6a5b7fdfdfde6a5b7 -b01534e6a5b7fdfdfdfdfdfde16e8fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046e02c5c -e16e8fe16e8fe02c5ce02c5cd7104be16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8fe16e8f -e02c5ce16e8fd7104be02c5ce16e8fe16e8fe16e8fe02c5cd7104be16e8fe02c5ce02c5ce02c5c -e16e8fe16e8fe16e8fe02c5ce16e8fd7104be02c5ce16e8fe02c5ce16e8fe16e8fe16e8fe16e8f -e02c5cdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfdfdfdfde16e8fdfd9dafdfdfdfdfdfd -e6a5b7b01534e6a5b7fdfdfde16e8fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -d7104bd7104bd7104bd7104bdd0046d7104bd7104be02c5cd7104bd7104bd7104bd7104bd7104b -d7104bd7104bdd0046d7104bd7104bd7104bd7104bd7104bdd0046d7104bd7104bd7104bd7104b -d7104be02c5cd7104bd7104bd7104bdd0046d7104bd7104bd7104bd7104bd7104bd7104bd7104b -d7104bdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfde6a5b7e02c5ce16e8fe02c5ce02c5c -e02c5cb01534e02c5cfdfdfde16e8fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bdfd9dae02c5ce02c5ce02c5ce16e8fe16e8f -e6a5b7e6a5b7e6a5b7fdfdfde16e8fdd0046e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5cd7104b -e02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5cd7104be02c5ce02c5ce02c5cdd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bdfd9dae6a5b7dfd9dafdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfde16e8fdd0046d7104be02c5cd7104bd7104bd7104bd7104be02c5c -e02c5ce02c5cd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104bd7104be02c5ce02c5c -d7104bd7104bd7104bd7104be02c5cd7104be02c5cd7104bd7104be02c5ce02c5cd7104bd7104b -d7104bd7104be02c5ce02c5ce02c5cd7104bd7104be02c5cd7104bd7104bd7104bd7104bd7104b -d7104be02c5ce02c5cd7104bd7104bd7104be02c5cd7104bd7104bd7104bd7104bd7104bd7104b -e02c5cd7104bd7104bd7104be02c5ce02c5ce02c5cd7104bd7104bd7104be02c5ce02c5cd7104b -d7104be02c5cd7104bd7104bd7104bd7104bdd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfdb8b3c15754525754525754528d8b8e -5754525754528d8b8efdfdfde16e8fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfddfd9dab8b3c1b8b3c1dfd9dadfd9da -b8b3c1b8b3c1b8b3c1fdfdfde16e8fdd0046dd0046dd0046dd0046e02c5ce02c5ce02c5ce02c5c -d7104be02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5c -e02c5ce02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5cd7104be02c5ce02c5ce02c5ce02c5ce02c5ce02c5cd7104be02c5ce02c5c -e02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5ce02c5c -e02c5ce02c5ce02c5cd7104bdd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfde16e8fdd0046dd0046dd0046dd0046d7104be02c5ce02c5ce02c5c -d7104bd7104bd7104be02c5ce02c5ce02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5c -d7104bd7104be02c5ce02c5ce02c5cd7104bd7104be02c5cd7104be02c5cd7104be02c5ce02c5c -e02c5cd7104be02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5ce02c5cd7104bd7104b -e02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5ce02c5cd7104bd7104bd7104be02c5c -e02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5cd7104bd7104be02c5ce02c5ce02c5c -e02c5ce02c5ce02c5cd7104bdd0046dd0046dd0046dd00460d0c09 -0d0c09dd0046dd0046dd0046dd0046dd0046d7104bfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfd -fdfdfdfdfdfdfdfdfdfdfdfde16e8fdd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd0046 -dd0046dd0046dd0046dd0046dd0046dd0046dd0046dd00460d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -0d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c090d0c09 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/prof.gif b/Docs/Books/prof.gif deleted file mode 100644 index 8bb86295ab7eeaaae0caec73b9df651c5b80a278..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2942 zcmV-^3xV`UNk%w1VPpV)0J8u94Gan007m`&{rU3(jf;-g5KG~1kFXUq=B2mTWGALL zTHo2)xU<3FEL>MqQrN5yA^8LV00000EC2ui0Av7u000F45XecZy*TU5yO$0SUgK1n zVhUE{`DG3x&oe>aHWu!n!}~nc>eo}bUL=N1wp2EoN(ORDtx{sQtX3vDc)#GVcuX#v z&t`>_z_zvDa48@_uiNkVynfH`^BYbMZ-Q`f5`Kt@ii>!FTaPn`jFXg=0gf{ZGMYD> zk#m-zqI;N|o1Cbba-*!RmyocMuCtT{4Y#af*9`#$3g_tPUcsPs4Fd4-@&cL!J_HN%`uqI-`v?IH&>KNO z9>4;Ee1Op8gWa8X{1(`=;2@vBix~9*G$1Dh19}4g43uLdV#mh?4jkHnsE@%B6BaYd z^tX`!i;5x3xfHPm9s!l^_Sw9W5a!II{{k+cz~*Dl0w`n9v-c689bqixmB6x~tCA1} zk;;pSaiahb3^Z93S-_b2=WY?L=-`2lQT4@=s$I`3IrlJaUh zx-BI@In3$p%&+%=#0_llQoU13794z&R>0w(jvq!AL_=?7oEZxP!TXgBXLy6Bs%1z( z!N|g`<)&V#k1ysYZUEeFsadgCd$yClvv~@-Z-j;0=(So0tG*qweYnlMe5_`?`SiNf zu2Ct$u5ElDXpYZ@0Pb|W&jSy=X?A<%#S@kPLIB`n7kqAn)tNb9C}4m(bTs&2I0}$6 zTu}3@$AlAWw2{$xXn|zcdH~LYpDX&A*Ax?z8HkZvB^`DkLqI5q+a(C(m|cztu*D++ z1Q_t6NEbpjk3?;37{v@S@fCw>yTM1BiI@1KnNtVZWrJRJ%~fSfaNLt*fbzJNmy%x9 zNab`QJjr32K&&YMSn&t~X8{Anq)DAcep%cgV%j$o zU%+_EfXR(ZS_n4zvnxI*71%@iq zvEoIm7L^A~&?gAj*|ix+C+hbVMT3Csus;cIsTO7J1@J`ywt(SI0|gwgO95UY^pe6H zh<6dRhh@TLXTAtiu@y;>+>}>7a|Y0Svo&`BjtHENcDYH83+LHsYhYtN;adAMl?vGQ9Ncqio#dD;_E0K8pO;l$;(8?GBb;I^$H z_9a7wi}C7dOT?6j0>bLwa$RY!26PfBbUNA>3nO&e1oAZe$u!`zziY-@*vB03G_=Kl zVP5hD%NEGMaxn0L5PV?o4gkS*L^Bxj}wH&EPRSiP7YuL0!55!no~`+ zzT(65SO6Yh5)+{S0=u;T;0qosqX$oR(j|eoq-SAaixN^Wg0w&}03LH)70VSioK(pr z0vZ<=KNr7vgwZD3QVyI1vN2FS#VtK+(;M~E6e_uiQxeHXl{z&ZINeY^B@#dwXV;bH z1%z&B%!f!0aK?DJWdVyk*z%61Iyae#4LY1+AS@}W8O$k+@dL~t)z_0HF2P)JN##Q> zr@KAYAUd~#h`j7UOH0j8lkm!d56y^=p234H_JPkCQE8`0weLphfg7@tDWGGO#)iQ1 zqOii4&SD{vS=ZD_&mbvG#d&jL#*9^$SQ0wb-LRHQWGC@dCy+rA0yb)-OswkJyUe5o zI&fOdx%O$w?9o#HRB$tpK%sD>f@Y>K@!a8oFv9?bMhIZCVZa^{G_5ZMQILBCXpL|Q zE{NXB09&h(fkeX3+Tg=^cd!`&fF!pc${L4aspk))v%NF+)HQWIx067gi_soMj~ zl6EjQ^>m1vje>?){ostTnl*uEO)Kxz%GM~h^{r*~12qs}iyjfl8gvknNc3t8YOstN z8LQ+6Ppka)N0&7K&4d)f%I@{1IU!P4=#Znu z9&8ajx`k+E=H;@zuYVQT=x(v_#T zB5w>Qv0Xj9kY*^ng$p~VUt8c;zYe4e%sNQIauC=S7HY<6-)h$SGME?+elRd1Ea9Ln zcow#(upTHJ)C45p79LLUB?d5n2WS`%99CfhNKE1fXpjyoCh>ev495#EBE}{T>H{8- z02+sN5;)ew0eVcr9v2|Q{KZ8%a&ZY=u#Cy39Yv5kT;dMKH~|k}agQ62Wf^ms#YgTk zi7S+49*ZKycbIY=VqE1flQ;ohV6lb3Ob0p_K+H7T@rx~iW;>{P%`J`)i|f#3BGWkl zhb{pBi+Su~R`eOrRengI>r7%okD1Z~h~c3}%;G&qSrmV!%cK=uX*zV-H;9%ore`c> zA}7Pfiug0k8ZhcXoBGnJ&h)C?v12(q8rF$WGp#8&>0DcS0I2TrU=xk(0O0x6qM)^w z8xZ3m%lXJ!=5&e4!RB7KnA)oDwuluRiaYQ4+~~$~y3y@ob`x3MaNaST)y-orvwOz$ z1$J6Jjf_Y8nB057w~sx1=F{4n(Ps9sv<0r+1y@_z<5nRa7#>tt9NEI@GOwKE@>ciDP0aEvznjq>7Wl?x9AgEvILivi^3zEF z4DKG=9LFUFI;|gY=Mr1n#Va;(m#sa3rw1U$S0D2Mh`#iv^Lyt5P`7Vv9Yco#7iGB+}lj|xzoJVss_5*SB&wsx`XW&wE5X{9CbxMpzEpDpt;Q+_r}*< z?vN)nrSpvJrhl2=HO>Ra?I3tgpWWm!*C5+({d8MA-tl&iJl=JkWtbfu^O@K2n|WR0 z7)G7s+J5tuDUb57D?7$+_At?bf92x8S=vk&bEG#Ijsu{&929!7^TR{JPv80A_d@f}A^zrz-}whuHj4GVh*Bdu$861V428b_S=igdaDMCkv5a~Df9K%~ z6$XGC#(w{XA_Q1~zqSYww15oQfDZV85ZHijMMD4cSi5k67?^}+xZzy!K!Seofi5^}A80}g1T*c0U^8fg5(IE0v@Z8?0RO~-eLz_4MT6Nu zSbYUp(|`-rV1$Gvgn(5EAs7Bt)hqz#eZ#aP+BpSED7F`&J3>bq?=3hAYWHI=MhIoSy z)P;ALh=hnjAvhk{VTNbea6wf|Nb?a;REHO6h%>{9pO}GoXosE%hmC?Og8KkPfLMxH o*ody^Uw7z=ve=4^NQa)tiUa0%sHhJ>ScwDJIlvf<9}ocmJ3n`QB>(^b diff --git a/Docs/Books/prof.txt b/Docs/Books/prof.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/Books/pthreads.eps b/Docs/Books/pthreads.eps deleted file mode 100644 index 183b792c639..00000000000 --- a/Docs/Books/pthreads.eps +++ /dev/null @@ -1,1212 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /opt/local/x1/work/bk/mysql/Docs/Books/pthreads.eps -%%CreationDate: Sun Dec 31 14:31:11 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 296 383 -%%EndComments -%%BeginPreview: 100 131 1 131 -% fffffffffffffffffffffffff0 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000008000000000000000010 -% 80000020000004028000000010 -% 80000044110004020000000010 -% 80000010511325224989251010 -% 80000083111249024099082010 -% 80000020000020200a00000010 -% 80000000000000000100002010 -% 80002000000000000000000010 -% 80004000000000000000000010 -% 80020800880000400808830010 -% 80002008000102100000048010 -% 80000009400100000008500010 -% 80020000000092406000008010 -% 80100008404000000008080010 -% 80002000080140400200022010 -% 80420008400000044849008010 -% 80004800000141410000140010 -% 80000000000000000000000010 -% 80020000000000000000000010 -% 80100000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000004000000000000000010 -% 80000004000000000000000010 -% 8000000d000000000000000010 -% 8000000c080000000000000010 -% 8000000d947000000000000010 -% 8000000f68a000000098000010 -% 8000000ca87800000000000010 -% 80000007208000000000000010 -% 80000004a1cc00000094800010 -% 80000001564200000000000010 -% 800000065a4200000000000010 -% 8000000b604400000005c00010 -% 8000000d904200000080000010 -% 8000000b784100000000000010 -% 8000000d466600000000000010 -% 8000000d846200000000000010 -% 8000141d223600000000000010 -% 8000fb9f932c000100a2ca0010 -% 80034e9ea13c00029002000010 -% 800ef79b2934000b3000000010 -% 8017570c919c0008e5baac0010 -% 802eed0c91980005c000000010 -% 8017ba4f8da8000a8000000010 -% 8015c4ad034c0012036d700010 -% 800f725f42e40027004a500010 -% 8007d4bb802c00280000000010 -% 80036836ac14004b8000000010 -% 8007dead180800910000000010 -% 8006ffdfba0e01480000000010 -% 8003dffd370405b00391000010 -% 80015dff7f0605e00028000010 -% 8002afdb360209600000000010 -% 80058fb7e90611b00000000010 -% 800abdff7401010802e4e80010 -% 800557eff40340b00000000010 -% 80010fbeac8281c00000000010 -% 8006abfb770182400164000010 -% 800d5fefd40286c00000000010 -% 8035ebfff50504f00000000010 -% 807f7d5dd3f94d800000000010 -% 8005d7a7bed60d000000000010 -% 800bbfffed7fdb000000000010 -% 801ef77f76b5fe4000d3a00010 -% 8035adebaf7f7e000000000010 -% 800b6f7f7eebda800000000010 -% 80005aefdbdf740402ab400010 -% 80005f7b7ef5b0000090000010 -% 8002d2def7bb80000000000010 -% 8000ab75beee20040000000010 -% 8002aa8437b4011002a8000010 -% 80055500d5ea01000000000010 -% 8000014012a804000000000010 -% 80000a9a04e000000000000010 -% 800024a0000000000000000010 -% 8000552a400000400000080010 -% 800092ec8000000001de580010 -% 8000553e040000000000000010 -% 8000a4b4420000000000000010 -% 8000aaa1040000000154a80010 -% 8000552c580000040000000010 -% 80001ca2a00000080000000010 -% 80001faac00000100179b00010 -% 80003bffc00000800000000010 -% 8000dfdb400013000000000010 -% 8002af76d00110000000000010 -% 800dfeedd56880000000000010 -% 80375bfb280000000000000010 -% 802af7dec41200000000000010 -% 8035feba7c4000000184000010 -% 802b5bf54900000003cfc00010 -% 800d6fa97000000003c9400010 -% 8003b77f8000000001cf400010 -% 80005ab9000000000008000010 -% 80000240000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% 80000000000000000000000010 -% ffffffffffffd4924924924930 -% edb6db6ddddb41249249249250 -% dbedf6df7776d4492492492490 -% febf5fb2dddfa1224924924930 -% d5ebf579b77554881209249250 -% ff7eafd19d15c1202040092490 -% d5d5faffb77b504a9515524930 -% ff7f5faafdd6ca9040a0049250 -% d5d5f5ffab7fd125150aa92490 -% ff7f5f55ffd54448a251124930 -% fffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 368.503937 translate -281.300715 -368.503937 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 131 8 -% Transformation matrix -[ 100 0 0 131 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7 -fffffffffff7fffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffff7ffffffffffff -f7f7f7fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7ffffff -f7f7f7fffffffffffffffffffffffffffffffffffffffffffffffff7f7f7ffffffffffffffffff -f7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffff7f7f7ffffffffffffffffffffffffffffffffffffefefeffffffffffffff7f7f7 -fffffffffff7f7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffff7f7f7fffffff7f7f7fffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7ffffffff -ffffffefeff7fffffff7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff -efefefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefefffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7ffffffff -fffffff7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffff7f7f7ffffffffffffffffffffffffefeff7 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffff7f7f7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffff7ff -ffffffffffffefeefffffffffffffff7f7f7f7f7f7ffffffffffffffffffefefeffffffff7f7f7 -fffffff7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffff7f7f7fffffffffffffffffffffffff7f7fffff7ffffffffefeeffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -d6d6dee7e6ef9991aaffffffffffffffffffffffffefefeff7f7effffffffffffff7f7f7ffffff -fffffffffffff7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffefefeffffffff7f7f7fffffffffffffffffffffffffff7ffffffffa8a8b5a8a8b5fff7ff -f7effff7efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffefefefffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefeeffdedef0 -979ca9d6d6eb796e82f7f7ffffffffffffffffffffd6d6d6dededed6d6d6f7f7f7e7e7e7f7f7f7 -d6d6d6fffffff7f7f7f7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffff -dedede81897cffffffffffffffffffffffffffffffd6d6def7f7f7fff7ff555682e7e6ef7e7b9c -fffffff7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffefefefcbcec5d6d6d6efefefffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7c7b7c -cbcedbb7b3c4d6d6eb9c9fc0ffffffefefeff7f7ffd6d6ebd6d6eb67687ccbcedbffffffdedde7 -7c7b7cf7f7ffefeff7d6d6ded6d6ebefeff7efeff7d6d6ebe7e6eff7f7ffffffffdedef0efeff7 -d6d6de7c7b7cffffffdedde7efeeffe7e6efd6d6ded6d6ebf7f7ffffffff7e7b9cd6d6dea8aac6 -e7e3f7f7f7ffefeff7d6d6deefeff7ffffffe7e6efdedde7ffffffefeff7ffffffdedde7efeff7 -efeff7e7e6effff7ffffffffdedde7efeff7ffffffe7e6efffffffe7e6efdedde7fffffff7f7f7 -e7e6efffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffff7f7f7fffffffffffff7f7ef -fffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff7ffe7e7e7c8c5d5 -efeff7848e9bd6d6eba5a5a6cbcedb979ca9ffffff9c9fc0bac6d8848e9bcbcedbffffffefeff7 -7e7b9cf7f7ffffffffa8aac667687ccbcedbc4d3ed5556824c5299efeff7dedef05556829c9fc0 -c4d3ed7e86b0d6d6de52457ac4d3edb7b3c47e7b9cd6d6ebfffffff7f7ff796e827e86b0bac6d8 -7e7b9cefeeff9c9fc07e86b0c8c5d5d6d6eb55568252457adedef0d6d6ebbac6d85556829c9fc0 -a8aac67e7b9cffffffdedef07e7b9ccbcedbd6d6eb9c9fc0e7e3f7848e9b9991aaffffffbbc1c8 -9991aaffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffff7fffff7fffff7fffff7fffffff7f7f7fffffffffffff7f7ffffffffffffff7c7b7cdedef0 -bdbdbda8aac6efeff7efeff77e7b9c7e7b9cefeff79c9fc0a8aac67e7b9cbac6d8d6d6dea3c4da -67687cd6d6ebf7f7ffbac6d867687ccbcedbffffff7e86b0555682bac6d89c9fc0555682c4d3ed -b7b3c47e7b9cd6d6eb412f549c9fc0efeeffbac6d8cbcedbf7f7ffffffff67687cffffffdedde7 -67687cffffffbac6d8cbcedbbac6d8a3c4da9c9fc0557085dedef0d6d6eb7e86b0555682979ca9 -d6d6eb9c9fc0ffffffd6d6ebc4d3ede7e3f77e7b9c7e7b9ce1eeffbac6d8ffffffd6d6dea8a8b5 -c8c5d5fffffffffffff7f7ffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffff7f7f7fffff7ffffffffffffffffffffffffc6cecef7efff -979ca9ffffffdedef0dedde7979ca9979ca9bbc1c8ffffffa8b9bda8a8b5bac6d8bac6d8cbcedb -9c9fc0cbcedbe7e3f7d6d6deb7b3c4dedef0ffffffbac6d8a8aac6bac6d8a8aac6a8aac6d6d6eb -a8aac6bac6d8e7e3f7979ca9e7e6efd6e6ed9991aabac6d8f7f7ffffffffa8b9bdf7ffffefefef -a8aac6ffffffefeff79c9fc0c8c5d5b7b3c4c4d3eda8aac6efeff7b7b3c4bac6d8b7b3c4bac6d8 -efeff7cbcedbf7f7ffefeeffe7e6efeff7ffb5bdbda8a8b5deedeed6d6ebffffffdedde7848e9b -e7e6effffffffffffffff7ffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffff7f7ffe7e7e7e7dde7dedede -d6d6d6cddadadae0d6efefefe7e7e7fffffffffffffffffff7f7f7fffffff7f7ffffffffffffff -fffffff7f7fffffffffffffffffffffffffff7f7fffffffffffffff7fffff7f7ffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffff7f7fffffffff7f7fff7f7fffffffffffffffffffff7fffffffffffffffff7ffff -f7fffff7f7f7f7fffff7f7ffffffffb7b3c467687ce7e6efffffffffffffffffffffffffffffff -f7fffff7f7fffffffffffffff7fffffffffffffffffffffffffffff7ffffffffffe7e6efa8a8b5 -dedde7ffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffe7e6efe7e7e7efefefefefef -e7e7e7efefefe7e7e7f7f7f7dedede9a9291d6dedefffffff7f7f7ffffffffffffffffffffffff -f7f7ffffffffffffffffffffffffffe7f4f7f7f7f7f7f7f7f7fffffffffffffffff7f7f7ffffff -fffffff7fffffffffffffffff7fffff7fffffffffff7f7fff7f7ffffffffffffffffffffffffff -f7fffff7f7f7ffffffffffffffffffffffffe7f4f7fffffffffffffffff7ffffffffffffffffff -fffffff7fffffffffff7f7f7f7f7fff7ffffa8a8b5deedeeffffffffffffffffffffffffffffff -fffffffffffff7f7fff7ffffffffffefefeff7fff7ffffffe7f2edffffffffffffffffffd6d6de -d6d6defffffffff7ffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffefeff7e7e6efd6d6d6f7f7f7 -f7f7efbdbdbddededec6c6c6a5a5a6efefefaeadadd6d6d6ffffffefefefdedde7cececee7e7e7 -dededed6d6d6d6d6d6cecececececee7e7e7e7f2edcddadacddadacdd8ccd6d6d6f7fff7ddeade -dededec6ceced6d6d6deedeee7f2ede7f2edd6dedec6ceced6d6dededde7bbc1c8efefeff7f7f7 -ffffffe7f4f7cddadad6d6d6c6c6c6d6dededededecbcec5dae0d6fffffffffff7fffffff7fff7 -efefefd6dedecdd8cce7f4f7fffffff7f7f7ffffffffffffd6dedec6cecec6c6c6d6deded6d6d6 -c6ceced6dedefffffffffffffffffff7f7f7f7fff7cdd8ccc6c6c6cdd8ccb7bcadf7fff7f7f7ff -efeff7ffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffefeff7b5b5b5efefef -f7f7f79b9c9cf7f7f7f7f7f7b5b5b5b5b5b5ffffff9b9c9cc6c6c6c6c6c6e7e7e7d6d6d6dedede -f7f7efdedededededecbcec5f7f7f7cececeb5b5b5d6dedeefefe7f7f7f7b5b5b5d6d6d6c6c6c6 -e7f2edf7fff7d6dedecececeddeadec7c6bcdededef7f7ffc6ceced6dedef7f7efe7f4f7aeadad -f7fff7bcc8bcc7c6bcf7f7efcddadab9bdb5cdd8ccf7fff7efefe7efefe7fffffffffffff7fff7 -dededeffffffbdbdbda5a5a6ffffffffffffffffffe7e7e7b5bdbdefefefdeedeeb5b5b5bbc1c8 -ffffffcececea5a5a6e7f2edf7fff7ffffffaeadadddeade9fa89c7c7b7cefefe7bdbdbde7e6ef -fffffff7f7fffffffff7f7ffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffff7f7fffffffff7f7ffbbc1c8ffffff -f7f7f7bdbdbdffffffffffffdededea5a5a6ffffffffffffc6c6c6bdbdbdefefe7d6dedecec6c6 -fffffff7f7ef898c8caeadaddae0d6bdbdbdb5b5b59fa89cc6c6c6ffffffbdbdbdefefefdedede -cdd8ccffffffcdd8ccefefefffffffcececed6dedeffffff9a92919b9c9cf7f7f7fffff7e7f2ed -e7f2edcdd8ccb5b5b5ffffffcbcec5b9bdb5efefe77c7b7cdae0d6ddeadef7f7f7fffffff7f7f7 -b5b5b5efefefe7f2edbcc8bce7e6effffffff7ffffffffffa8b9bdfffffff7f7f79a9291dedede -c6c6c6ffffffb5b5b5aeadadffffffa8b9bddedede7c7b7cb9bdb5c6c6c67c7b7ccdd8cce7e7e7 -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffefeff7b5b5b5f7f7f7 -ffffffaeadadffffffffffffdededebdbdbdffffffffffffbdbdbde7e7e7cec6c6efefefd6dede -ffffffdae0d6898c8cffffffcdd8cca5a5a6d6dede898c8cbbc1c8ffffffdededef7f7ffefefef -c6ceceefefefc6cecefffffffffffff7f7f7efefefffffff848e9b9b9c9cefefefffffffefefef -f7f7f7dededeaeadadffffffcececec6c6c6ffffffd6d6d6f7f7f7cececef7fff7ffffffefefef -b5b5b5f7f7f7ffffffbdbdbdbdbdbdffffffffffffffffffbdbdbdefeff7f7fff7a8a8b5ffffff -d6d6debbc1c8ffffffa5a5a6c6c6c69b9c9cdededeffffff9a9291bbc1c8aeadadffffffefefef -fffffffff7ffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffd6cdd7bbc1c8efefefd6d6def7f7ff -ffffffaeadadffffffffffffdededec6c6c6ffffffffffffbdbdbdc7c6bcefefefffffffdae0d6 -ffffffefefe79b9c9cfffffff7f7f7efefefffffff81897cb5b5b5ffffffbbc1c8d6cdd7c6cece -efeff7f7f7f7c6c6c6ffffffffffffd6d6dee7e6efffffff898c8c7c7b7cf7f7f7dedede9a9291 -ffffffd6d6de9b9c9cffffffaeadad7c7b7ca8b9bddededeefefefe7e7e7fffffffffffff7f7f7 -7c7b7c898c8cffffffe7dde7d6d6defffffffff7ffffffffb5b5b5ffffffefeff7848e9bffffff -e7e6efd6cdd7fffffff7f7f7efeff7c6b9c6d6d6d6ffffffffffffdedede898c8cc6c6c6f7f7f7 -fffffff7f7f7ffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffe7e6efefe6f2efeff7b5b5b5efeff7 -f7f7f7b5b5b5f7f7f7ffffffc6cecebdbdbdffffffffffffc6c6c6e7e7e7fffffff7f7f7e7e7e7 -ffffffe7e7e7898c8cf7f7f7fffffff7f7f7ffffff9b9c9ccececeffffffefefefe7e6eff7f7f7 -fff7ffefefefbbc1c8f7f7ffffffffefeff7efefefffffffb5b5b5cececedededea5a5a6bbc1c8 -ffffffe7e7e7c6c6c6f7f7f7f7ffffe7e7e7e7dde7dededeefeff7fffffffffffff7f7f7c6b9c6 -ffffff898c8ca5a5a6ffffffbdbdbdcececeffffffffffffb5b5b5fff7fffff7f7b5b5b5ffffff -e7dde7dededeffffffffffffe7dde7ffffff979ca9dededee7e6efffffffffffffdededecbcec5 -fffffff7f7f7f7f7f7fffffffffff7ffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffefefefcbcedbf7f7ffc6cecefff7ff -ffffffaeadadffffffffffffd6d6d6aeadadffffffe7e7e7efefeff7f7f7ffffffffffffdedede -ffffffe7e7e79b9c9cfffffffffffff7f7ffffffff7c7b7cbdbdbdffffff979ca9e7e7e7dedde7 -bdbdbdffffffd6d6deffffffffffffe7e7e7e7e7e7ffffff898c8cbdbdbd81897cefefefffffff -e7e7e7efefefc6c6c6ffffffb5b5b5aeadadefefeff7f7ffd6d6d6cececeffffffe7e6efaeadad -e7e7e7fffffff7f7f7ffffffc6c6c6c6c6c6ffffffffffffbdbdbdffffffefeff7b5b5b5ffffff -e7e7e7bbc1c8ffffffdedde7dedde7e7e7e7e7e6efbbc1c8848e9befefefe7e7e7e7e7e79b9c9c -fffffffffff7fffff7fffffffffffffffff7ffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffc6cece898c8cd6d6ded6cdd7f7f7ff -f7f7f7616f61e7e6efdededeaeadadc6c6c6ffffffaeadadcececeffffffffffffffffffbbc1c8 -ffffffe7dde77c7b7cffffffefeff7ffffffffffff796e82bdbdbdffffffd6cdd7ffffffe7e7e7 -d6cdd7f7f7f7bbc1c8efefefffffffe7e7e7e7e7e7ffffff898c8ccececea5a5a6f7f7f7f7f7f7 -bdbdbdf7f7f7d6d6d6efefefbdbdbdaeadadf7f7f7aeadadf7f7f7aeadade7e7e7b5b5b5efefef -9fa89cdededea5a5a6a5a5a6ffffffb9bdb5cdd8ccffffffa5a5a6f7f7eff7f7f79b9c9cefefef -bdbdbda5a5a6ffffffa5a5a6c6c6c6c6c6c6f7f7f7bdbdbddededea5a5a69b9c9cefefef9fa89c -fffffffffffffffff7fffffffffffffffff7ffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffefeff7f7f7f7ffffffcececef7f7f7 -fff7ffa5a5a6d6d6d6c6c6c6a5a5a6f7f7f79b9c9cc6c6c6ffffffffffffffffffe7e6efe7e6ef -ffffffefefefa8a8b5f7f7f7f7f7f7fffffff7f7f7aeadadd6d6d6ffffffd6d6d6e7e7e7dedede -efefefffffffe7e7e7e7e7e7f7f7f7cececeefefe7ffffff9fa89ccdd8ccaeadadfffffff7f7f7 -cbcec5ffffffd6d6d69b9c9cbdbdbdaeadade7e7e7aeadadc7c6bcb5b5b5dededeaeadaddedede -d6d6d6ffffffc7c6bccdd8ccffffffcecececdd8ccdae0d6aeadadfffff7f7f7f77c7b7cc7c6bc -dae0d6dedede9fa89cc7c6bcffffffaeadadcec6c69b9c9cbdbdbdd6d6d6dededed6d6d6dedede -fffffffffff7fffffffffff7ffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffdedde7b5b5b5d6d6d6c6ceceffffff -fffff7dedde7efefefefefe7f7f7f7b5b5b5d6d6d6fffffffffffff7ffffffffffdeedeeffffff -deedeef7f7f7fffffff7fffff7fffffffffffff7ffffffffe7f4f7e7f2edf7ffffe7f2edf7fff7 -f7f7f7efefefe7f2edf7ffffefeff7efe6f2fff7fff7f7efffffffdededefffffff7f7eff7f7f7 -f7f7f7f7f7f7ffffffdedededededeffffffe7e7e7ffffffc7c6bce7e7e7f7f7f7efefeffffff7 -e7e7e7efefe7fffffffffff7efefe7f7f7eff7f7efdedededededeefefe7efefe7cdd8ccfff7f7 -fffff7d6d6d6c7c6bcfffffffffffffff7f7bdbdbdf7f7f7fff7fff7f7f7dededed6d6d6ffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffc6c6c6dededed6d6d6f7f7f7 -f7f7f7a5a5a6efefefdededef7f7efffffffffffffffffffffffffffffffffffffffffffe7f4f7 -e7f2eddeedeee7f4f7f7fffff7fffff7ffffffffffefeff7efefefdeedeee5ffffe5fffffffff7 -efefefefefe7e7f4f7f7fffffffffffff7ffefeff7f7f7f7e7f2edfffff7efefeff7f7f7f7f7f7 -f7f7f7fffffffffffffffffff7f7f7e7e7e7efefefefefeffffffffffffff7f7f7f7f7f7f7f7f7 -fffff7fffffff7f7f7efefefefefe7efefeffffff7fffffff7f7efdededeefefe7fffff7efefef -dededef7f7efffffffffffffffffffffffffffffffefeff7e7e7e7efefeffffff7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffff7f7f7ffffffe7e7e7bdbdbdf7f7f7 -ffffff9a9291e7f2edfffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7 -fffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffe5ffffefffffffffff -fffff7fffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffff7f7f7cececee7e7e7ffffff -ffffffaeadadcdd8ccf7f7f7f7f7fffffffffffffffffffffffffffffffffffff7fffff7fffff7 -fffff7fffff7fffffffffffffffffffffffffffffffff7fffff7fff7ffffeffffff7fffffffff7 -fff7fffffff7fffffff7fffff7fffffff7ffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffffffffff -fffffffffffffffffffffffff7f7ffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffdededebdbdbdd6d6d6c6c6c6 -b5b5b5c6c6c6d6d6d6f7fffff7fffffffffffffffffffffffffffffffffffffff7ffffefffffef -ffffeffffff7fffff7fffffffffffffffffffff7fffff7ffffffffffffffffffffffffffffffff -fff7fffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7efefefefefef -efefeffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffff7fffff7ffffef -ffffeffffff7fffffffff7fffff7fffffffffffffffff7fffffffffffffffffffffffff7ffffff -fffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffff7f7f7f7f7f7fffffff7f7f7ffffff -fffffffffffff7f7f7fffffff7fffffffffff7fffffffffffffffffffffffffff7fffff7fffff7 -fffff7fffffffff7fff7f7ffe1eeffeff7fffffffffffffffff7fffff7ffffffffffffffffffff -fffffffffffffffffff7fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -f7f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffff -f7fffff7ffffefffffe1eeffc4d3edbac6d8effffffffffffffffffffffffffffffffffffff7ff -fffffff7fffff7fffff7fffff7fffff7ffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffff7fffff7ffffffffffffffffffffffffffffffffffffeffffff7ffff -efffffefffffcee0ef285297a3c4daf7ffffeffffff7fffff7fffffff7f7fffff7ffffffffffff -f7ffffeffffff7ffffeffffff7fffff7fff7ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff7f7ff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffff7fffff7fffff7fffffffffffffffffffffffff7ffffefffffefffff -e5ffffe5ffffa3c4da4f6c9fa3c4dae7f4f7f7ffffe7f4f7f7ffeffffffffffffffffff7ffffff -effffff7fffff7f7f7efeff7fffff7f7f7efffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffff7f7fffff7fff7f7f7fffffff7f7ffffffffffffffffffffffffffffffffffffff -fff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffff7fffff7fffff7fffffffffffffffffffffffff7ffffefffffe5ffff -e5ffffc4d3ed1550782852976784bda8a8b5e7f4f7fffffffff7efded6ccdac7abfff7eff7fff7 -f7fffff7f7f7fffffffbefeffdefe7fef7e7fff7efffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffff7fff7f7fffff7fff7f7fffff7ffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffff7fffff7fffffffffffffffffffffffffffffff7fffff7fffff7ffff -f7ffffcee0ef1426574f6c9f8ba1c79991aac7c6bcded6cceee1c3e6c196b99f9bdac7abfbfbde -fffff7fffffffce6eed7ad9dd6aa8afdcfc4fff7efffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffff7f7f7f7f7f7fffffffffffffffffffffffffffffffffffffffffff7f7ff -fffffffff7fff7f7fffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffff7ffff -f7ffffd6dede1426572f537967687c9d716f9d716fa38457f6cdabc28268e6c196a2763ffbfbde -fef7e7ded6ccc38a81bf4d3ed66b42d6aa8affffeffffffffffffff7f7f7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffff7ffe7dde7dedde7a8a8b5d6d6ebdedef0c8c5d5b7b3c4ffffff -f7f7fffffffff7f7f7fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffff7fffff7fffffffffffffffffffffffffff7fffff7ffffefffffeffffff7 -ffffffd6dede1e1f3a1e1f3a4d48538040497d3d30a16d56c18040c48756bf4d3ed2a46af2ebd6 -eee1c3a16d56a16d569e2e11bf4d3ee18855fdd0ceffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffff7ffffffffb5b5b5cbcedb67687cd6d6dee7e6ef67687c67687cffffff -f7f7fffffffff7f7f7f7f7effffffffffff7ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffff7fffff7fffffffffffffffffffffffffffffffff7ffffefffffefffffef -fffff7efefef7a68703f3235804049c28268e78673a0563f954713c18040954713f6cdabfdffe7 -fdffe7d7ad9dbf4d3eb62b10b62b10f13f3df3ac92fdefe7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffefefeff7efffe7dde7f7f7f7ffffffd6d6dec8c5d5ffffff -fffffff7f7ffefeff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffff7fffff7fffffffffffffffffffffffffffffffffff7ffffefffffef -fffff7ede8de9d716f9d716f804049bf4d3ed7ad9df3ac92c28268d7ad9deee1c3fdffe7f7f7ff -b7b3c4c38a81a13e30d66b42f3ac92c28268d6aa8afbfbdefff7effffffff7f7fff7ffffffffff -ffffeffffff7fffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7 -fffff7fffff7fffffffffffffaeef7ffffffffffffffffffffffffffffffffffffffffffffffff -fff7fffffffff7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffff7fffff7fffffffffffffff7fffffffffffffffffffffffff7fffff7 -ffffeffdefe7ddcacb846a4ca16d56e88683a13e30e886839d716fc6ceceffffffcee0ef8ba1c7 -616cbf804049a00d08d6aa8afff7f7bab69da16d56f6cdabf2ebd6efefe7f7ffffefffffffffff -ffffefffffefffffeffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffff7 -fffff7fffff7fffff7ffffffffffffb5b5b5e7dde79b9c9cefefefbbc1c87e7b9c9991aa7e7b9c -bac6d8bac6d8848e9b9991aae7e3f7a8a8b5c8c5d5f7f7ffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffe7f4f7f7ffffffffff -efefeffffffffff7fff3d2dac38a81e88683e78673bf4d3ec6b9c6677e83677e836784bd1e4253 -9991aae78673a00d08c38a81ffffeffbefefd6aa8aa0563feee1c3fffffff7f7f7f7fffffffff7 -ffffefffffeffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7 -fffff7fffff7fffff7f7f7f7ffffffdedde7efe6f2e7e6eff7fffff7f7f7efeff7dedef0efeff7 -fff7fff7efffdedef0efeff7fff7ffefeff7f7f7fffffffff7f7ffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffff7ffffffffff -f7fffffff7ffc8c5d5796e827a6870c38a81e886839d716f9d716f557085477285557085677e83 -fce6eee88683bf4d3ebea476ffecd0ffffffc38a81bc6a39f6cdabfdefe7fffffff7fffffffff7 -fffff7fffff7fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffefefeffffffffffffff7efffffffff -f7f7ffe7e3f7fffffff7f7fff7f7fff7efffffffffe7e3f7f7ffffffffffefeff7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffff7fffff7fffffffffffffffffffffffffffff7fffff7fffff7ffffefffff -f7ffffdeedee6175a76175a72f537967687c7e7b9c9d716f5d324bddcacbffeefffff7f7efefe7 -fdefe7e88683812d0dbea476ffffeffef7e7d2a46ab55d18e28e67fdcfc4fff7ffffffffffffff -fffffffffff7fffff7fffffff7fffffffffffffffffffffffffffffffffffffffffffffff7ffff -ffffffffffffffffffefeff7f7f7ffdedef0dedef0f7f7f7c8c5d5efefefffffffefefef796e82 -979ca9848e9b67687c67687cbbc1c8efeeffefeff7efeff7c6c6c6f7f7fffffffff7f7ffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffefffff -efffffcddada142657506fb66784bd4f6c9f2f53799991aac28268a0563fc38a81fce6eeffffef -ffffefe2c9b9661b0cbea476fbfbdefdffe7f6cdabd66b42e18855f2ebd6fce6eeffffffffffff -fffffffffff7fffffff7fffff7fffffffffffffffffffffffffffff7fffff7fffff7ffffffffff -ffffffffffffffffffffffffffffffbbc1c8efeff7a8a8b5e7e6efb5b5b5ffffffefeff7979ca9 -e7e7e7ffffffe7e6efa8a8b5dedde7ffffffa8a8b5e7e6effffffffffffffffffff7f7f7ffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffff7fffff7fffff7f7fff7f7ffff -f7ffffcee0ef3f70b43f70b43f70b41b6ea38ba1c76175a77e5640b62b10a00d08f3ac92e2c9b9 -f2ebd6e2c9b9812d0ddea372fff6b6fdffe7eca872ef883abc6a39fdcfc4ffffffefeff7ffffff -fffffffffffffffffff7fffff7fffffffffffffffffffffffffffff7fffffffffffffffffffff7 -fffff7fffffff7fffff7f7fff7ffffffffffffffffffffffffffffffffffffffffffffffffffff -f7f7f7e7e6effffffffffffff7f7fff7f7ffffffffe7e6effffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffff7fffff7fff7effff7effffff7ffffeffdffe7fdffe7fdffe7fffff7ffffff -f7ffffdeedee2852973f70b43f70b41b6ea33f70b46784bd9d716fc28268d66b42bf4d3ebf4d3e -ffffefdac7ab812d0dd66b42e6c196ffffffdea372b62b10b55d18fdd0cefff7ffffffffffffff -fffffffffffffffffff7fffff7fffffffffffffffffffff7f7fff7fffffffffff7ffffeffffff7 -ffffeffff7efffffffffffffeff7fff7f7fff7fffff7f7f7fffffffffffffffffffffff7e7f4f7 -fffffffffffff7f7f7fffffff7f7fffffffff7f7f7fffffffffffff7f7ffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffff7ffffffffffffffefefeffffff7 -f7f7effffff7fef7e7ffffeffef7e7ffecd0f2ebd6ffecd0fbfbdeffecd0f2ebd6fffff7fff7ff -f7f7ff9c9fc01534701b6ea3616cbf3f70b41b6ea3e1eeffc38a81e2c9b9ffeeffbf4d3ed66b42 -d6aa8af2de95954713b62b10bf4d3efffff7c28268b62b10d66b42fdcfc4fff7ffefeff7ffffff -f7f7f7ffffffffffffefffffeffffffffffffff7f7ffffefffffeffef7e7ffffefded6ccfbfbde -fbfbdefef7e7fffff7fffff7fffffff7fffffffffff7f7f7fffffffffff7fffff7fffff7f7f7f7 -fffffff7f7f7fffff7f7f7f7f7f7fffffffff7f7f7e7f4f7fffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffff7 -efefe7ffffeff2ebd6dac7abdac7abbea47683814ea18b74bea476a38457d6aa8ae2c9b9fce6ee -efe6f21426571a378a2852973f70b47b8dc86784bdeff7ff9d716fe88683fdd0cee2c9b9a13e30 -ef883afff6b6e18855bc1111f13f3dc28268d66b429e2e11e28e67f2ebd6fff7ffefeff7ffffff -f7f7f7fffff7fffffffffffff7fffffffffffffff7fffff7fbfbdefdffe7dac7abbea476ffecd0 -fbfbdefef7e7f2ebd6f7f7eff7fff7f7ffffbcc8bce7f2edfff7efffffffffffffefefe7fffff7 -ffffffffffffffffffffffffffffffefeff7fffffffffffff7f7f7efefeff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffff7f7fff7effffff7fef7e7 -fdffe7c7c6bcbea476846a4c81753383814e626e1f626e1f81753383814ea2763fa16d56fff7ef -a8a8b50000211a378a2852971a378a2852974c5299b99f9bc38a81e88683d7ad9df3d2dab55d18 -bc6a39e6c196e6c196a00d08f13f3ddd250fb62b109e2e11dac7abfff7f7fff7ffffffffefeff7 -fffffffffff7fffffffffffff7fffff7fffff7f7f7fff7eff2ebd6dac7abd6aa8aa38457ffffef -eee1c3f2ebd6ffffffefefe7fffff7d6dedecdd8cc616f61ded6cc9a9291aeadadcdd8ccaeadad -4d48539b9c9c898c8c272522b5b5b5ffffff898c8cb5b5b54d4853bcc8bcf7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffefffffefdac7ab -bab69d83814e83814e817533626e1f817533817533626e1f42500d605622605622846a4cb99f9b -a8a8b51426571426571a378a1a378a5058b05058b0c38a81c28268c28268d6aa8af2ebd6e6c196 -954713bea476f3ac92a00d08d30f15dc0c02b70d05c48756f2ebd6fff7fffff7fff7f7fff7f7ff -fffffffffff7fffffffffffff7fffff7fffffffffffef7e7fbfbdebea476d2a46ac28268c28268 -fffff7bab69da18b74fffffff7f7f7deedeeffffffaeadadefefe7c7c6bccdd8ccefefefcdd8cc -a5a5a6cececeb5b5b5898c8cdededeffffffc6c6c6cececeaeadadefefeffffff7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffff7effffff7dac7ab83814e -5c553b5c553b626e1f626e1f42500d626e1f55884455884442500d27381342500d5c553be2c9b9 -d6d6eb142657153470285297616cbf1a378ac4d3edb99f9ba0563fe88683d6aa8afdd0cefdd0ce -812d0de28e67ffecd0c38a81cc0004dd250fb70d05d7ad9dfffffffaeef7fffffff7f7ffffffff -fffff7fff7effff7effffffffffffffffffffffffffffff7a38457dea372c28268a13e30a13e30 -c38a817d3d30846a4cfffffffffff7f7f7fff7fffffffffffbefefffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffff7fffff7ffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffff7ffffefc7c6bc846a4c7e5640 -42500d5c3f1b42500d626e1f626e1f43711e626e1f55884443711e42500d273813bab69defefe7 -ffffff8ba1c71426573f70b4a6c8eb506fb6142657c7c6bcb99f9b9d716fe78673fdcfc4f3d2da -a13e30b62b10f3ac92c38a81860002dd250f9e2e11e6c196ffffffffeefff7f7fff7fffff7f7ff -fffff7ffffefffffeffffffff7fffff7f7f7ffffffc7c6bca16d56f3ac92e28e67c180407e1006 -812d0d661b0c9d716fffffff7c7b7cbdbdbd616f61101715efe6f23f32353f3235545656bbc1c8 -272522979ca95456569b9c9c7c7b7c979ca99a9291101715e7e7e7ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffff7fffffffffffffffffffffffffffffffffffffff7effffff7a18b74846a4c605622 -5c553b413d1242500d817533626e1f626e1f43711e1c4e0e42500d43711e413d12eee1c3fbfbde -fff7f7e7e6ef1426571426578ba1c7a3c4da000021aeadadffffff9d716fa16d56fdd0cefdcfc4 -a00d08b62b10e18855f6cdabb62b10b62b10bf4d3ee2c9b9fffff7fffffff7ffffeff7ffffffff -fff7f7fff7effffffffffffff7ffffffffffffffffd7ad9ddea372a0563fd66b42a13e30812d0d -a13e309d716ffff7fffff7ffe7e6efdeedeeefeff7e7e7e7efefefe7e6efe7e7e7efefefffffff -e7e6efefeff7efefefefeff7efeff7f7f7f7f7f7f7dededefffff7f7f7efffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffff7fffff7fffffff7fffffffffffffffffffffffff7efffffefa18b747e564083814e -42500d27381342500d413d12626e1f626e1f626e1f626e1f8c611b817533b6a042b6a042bea476 -bea476bab69d796e821e1f3a616cbf555682555682d6e6edfffffffff7ffa16d569e2e11f6cdab -9e2e11b62b10d35113f3ac92dea372a00d08bc6a39ddcacbfffffff7ffeff7fff7f7fff7ffffff -ffffffffffffffffffefffffeffffff7fff7fdffe7bea476e28e67e78673e88683a0563f804049 -9d716ffff7fffff7fffff7f7ffffffefeff7f7f7f7f7fffff7fff7f7f7f7ffffffefefefffffff -fffffff7f7f7ffffffefefefe7e7e7f7f7ffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffff7fffffffffffff7fffff7fffffffffffffffffff7efffffefbea47681753383814e -1c4e0e43711e103a155c553b5c553b817533a38457b6a042b6a042d2a46ad2a46ac48756ebc07c -a38457a3845710171552457a9991aa412f54c4d3ede1eefff7f7f7fff7fff2ebd6a0563f9e2e11 -b62b10b62b10d35113e28e67d6aa8a9e2e117d3d30ddcacbffffffeff8eeffffeffffff7ffffff -fff7fffffffff7ffffe5fffff7fffff2ebd6e6c196c18040da8539eca8729e2e11a16d56d7ad9d -fff7f7fff7fffff7ffffffff979ca97c7b7c101715c6c6c6616f613154499a9291000000272522 -898c8c616f61ffffff4d48535456564d463cbbc1c8ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffff7fffffffffffffffffff7f7ffffefffffefffffef7da572 -1c4e0e103a1543711e31653542500d626e1f817533b6a042d2a46ac48756d2a46adea372a2763f -8175337e564027252252457a1e42532f53799991aa9a9291e2c9b9fce6eefffffffffff7a16d56 -c28268a13e30a13e30a13e30b99f9ba8a8b51e1f3ad6cdd7fffffff7ffeff7ffeffffff7fffff7 -fffffffffffff7ffffe7f2edffffefbea476a2763ffcdf6ae18855da8539a0563f8c611bfffff7 -fff7effffffffffffffffffffff7ffffffff7c7b7ce7e7e7545656898c8cc6c6c6a5a5a6616f61 -aeadad898c8ccecece3f32359b9c9c616f61d6cdd7ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffffff7efefe7fdffe7f2ebd6 -2b67201c4e0e1c4e0e2b67202b672043711e626e1fb6a042d2a46ae28e67eca872c48756c48756 -817533413d123f32355570850000212445383f3235a18b74b99f9bf2ebd6e2c9b9ddcacbd7ad9d -fbefeff2ebd6846a4c7a6870c6b9c67e86b0142657b5bdbdfffffffffffff7fff7ffffeffffff7 -fffffffffffffff7effdffe7fff6b6ebc07cc18040ffbc38bc6a39b55d18bc6a39c48756eee1c3 -ffffeffffff7fff7f7f7f7f7fff7f7efefeffffffffffffffffffffffffffffffff7f7f7ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffff7fffff7fff7eff8eeddeade -558844103a151963201963202b672042500d626e1f817533bc6a39eca872f3ac92eca872f3ac92 -a16d56492717616f6167687c67687c846a4c7e5640a16d56bab69ddac7ab605622817533d7ad9d -fbfbdefff7efffffffc6b9c64c5299477285477285a6c8ebeff7fffffffffffffffffff7f7f7ef -fffff7fffff7ffffeffbfbded2a46ab6a042ffbc38da8539b55d18a2763feca872a38457846a4c -fffff7fdffe7f7f7eff7f7eff7f7f7efeff7fff7f7fff7fffff7ffefe6f2fffffffffffff7f7f7 -f7f7f7fffffff7f7f7efefeffffffffffffff7f7f7ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffff7fffff7ffffffffffe7f2edddeade -7da5721c4e0e103a151c4e0e2b672043711e42500d5c3f1b812d0dd66b42c28268e78673e18855 -c282685c3f1b0000004d48537a6870a16d56e6c196bea47698ae892b672042500d817533e6c196 -fbfbdedeedeedeedeee1eeff8ba1c72852976784bda3c4dacee0effff7fffff7f7fffff7f7fff7 -fffff7ede8dedac7abbea476c18040ef883ae7a330b55d18b55d18ebc07cbea4765c3f1bdac7ab -fdffe7ffffeffffffffff7f7fff7f7fff7f7fffffffff7f7fff7fffffffff7f7f7fffffff7f7f7 -fffffffffffff7f7f7f7f7f7ffffffefefeff7f7f7ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffff7ffffeff7fff7ffffeff8eef7ffef -566f421d4f261c4e0e2b67201c4e0e42500d413d12661b0c661b0c7e10067e10067e1006bf4d3e -bc6a397d3d305c2e355d324b661b0ca13e307e1006fdd0ce83814e27381343711e83814e7da572 -7da572deedeed6e6edefffffcee0ef3f70b42f5379153470bac6d8fffffffffffffffffff7fff7 -f7f7efded6ccd6aa8aa0563fda8539da8539de9d2ede9d2eb6a042f2de95fff6b6dac7abffffef -fef7e7fffff7fffff7fffff7ffffffc7c6bcb99f9befeff7fffffffff7ffffffffffffffffffff -fffffffffffffffffffffffffffffff7f7f7ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffe7f4f7f7f7fffffffffdffe7 -cbcec560562242500d413d12413d12413d12492717661b0c7e10067e10067e10067e10067e1006 -7e1006661b0c7e10065c2e359e2e11860002a0563fd7ad9d5c553b3f3235316535315449336b4d -103a15e5ffffe5ffffeffffff7ffff9c9fc02852974f6c9fd6e6edffffffffffffffffffffffff -dedede81897cd7ad9d954713954713d35113b55d18bc6a39fdf5abfdffe7fbfbdefffffffffff7 -fffff7ffffffffffffefefefffffff7c7b7c5d324b7c7b7cd6cdd7bdbdbd898c8c9b9c9cefefef -cecece81897caeadadb5b5b5fffffffffffffffffffffffffffffffffffffffffff7f7f7ffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffff7fffff7fffff7fffffffffffffff7fff7f7fffffffffff7effbfbde -fbfbdea384577e564083814e846a4ca38457a2763f812d0d7e10067e1006860002860002860002 -a00d08a00d08a00d087e1006a13e30860002c38a81a384572d00001e1f3a1e1f3a142657142657 -52457affeeffefeff7fffffff7ffeffff7f77e86b02f5379c4d3edf7ffffe7f4f7f7ffffffffff -dedede5c553bc38a81812d0d9e2e11812d0d812d0dc18040eee1c3ffffeffffff7ffffffffffff -fffffffffffffffffffff7f7ffffffddcacbddcacba18b74ddcacb7a68709b9c9c9a9291deedee -b5b5b5c6b9c6cececed6d6d6fffffffffffffffffffffffffffffff7f7f7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffff7fffff7fffff7fffff7fffffff7f7fffff7fffff7f7fff7effdffe7 -d6aa8ac18040c18040a16d56c48756c48756eca872a13e30661b0ca00d087e1006860002a00d08 -a00d08a00d08a00d08a60003a00d087e1006d6aa8ab99f9b7e56405d324b52457a52457a52457a -e7dde7b99f9bb99f9beff8eeeff8eeffffffa6c8eb1550788ba1c7efffffe7f4f7ffffffefefef -796e82ffeeffd6aa8a812d0db55d18954713812d0dc28268fdcfc4fffffffff7fffff7ffffffff -f7f7fffffffffffffffffffffbefeffff7effffffffff7ffffffffe7e7e7fffffff7f7f7ffffff -f7f7f7fffffffffffffffffffffffffffffff7f7f7fffffffffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffff7ffffefffffeffffff7fffff7fffffffffffffce6eefbefefdac7ab -c282688c611bb55d18812d0d8c611be18855e28e67a13e30a00d08661b0c860002a00d08b70d05 -b70d05b70d05dd250fd30f159e2e11661b0c5c553b5c553b5c2e359d716fa18b749d716fd7ad9d -9d716ffdd0ced7ad9dfffff7efefe7ffffff7e86b01534706784bddeedeee5ffffe5ffff848e9b -e7dde7ffffffbab69d661b0cb55d18954713812d0d804049a18b74fff7fff7f7fff7fffff7ffff -f7f7fffffffffffffffff7f7fff7effffff7fdefe7ffffffdededefff7f7ffffffffffffffffff -e7e7e7f7f7f7f7f7f7fffffff7f7f7fffffffffffffffffffffffff7f7f7f7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffff7ffffeffffff7fffffff7f7fffff7ffffffffffffff846a4c -a0563fc18040da8539b55d18da8539b55d189547139e2e117e1006a00d08860002a00d08a60003 -a60003b70d05bc1111bc11117e1006413d125c3f1b4927177d3d305c2e35817533626e1fe6c196 -eee1c3fbfbdefce6eeede8def2ebd6f7ffff8ba1c77b8dc8155078a3c4dae5ffffa8b9bdd6d6de -fffffffff7ffd6aa8a661b0cc18040f2de95eee1c3a16d567a6870e7e6effffffff7f7ffffffff -f7fffffffffffffffffff7f7ffffff5456567c7b7c7a68703f32353f3235e7f4f7aeadad3f3235 -d6d6d6bdbdbd1017152725224d463cf7f7f73f3235c6cecef7f7f7ffffffffffffefefefffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffff7fffff7fffff7fffffffffffff7f7fffff7ffffffffa38457 -a38457bc6a39b55d188c611bb55d18e7a330b55d18954713a00d087e1006860002a00d08b70d05 -b70d05b70d05bc1111a600037e1006413d1242500d413d12492717413d12817533a38457bea476 -e6c196eee1c3fef7e7fff7f7f7fff7e5ffffe5ffff506fb62d707fcee0ef677e83e5fffff7ffff -fff7ffffeefffdffe7d2a46a605622ebc07ca2763f846a4c9a9291fff7effffffff7fffff7ffff -fffffffffffffffff7fffff7ffffeff2ebd6fffff7fffffffffffffffffffffffff7f7f7ffffff -fffffff7f7f7f7f7f7f7f7f7f7f7f7fffffff7f7f7fffffffffffff7f7f7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffff7fffffffffffffffffffffffff7f7fffff7fffef7e7 -eee1c3ebc07cb55d18de9d2ede9d2ef5bb36ef883ad66b427e1006860002a00d08a00d08a60003 -b70d05bc1111b70d05a00d08661b0c60562260562242500d43711e43711e83814e42500dbea476 -eee1c383814edae0d6fff7efffffffe1eefff7ffff6175a72d707f6784bdcee0efe5ffffe1eeff -ffeeffe7dde7ffecd0b6a0428c611b8c611b7e5640fdd0ceffecd0f7f7effffff7fffff7ffffff -f7fff7fffff7fffff7ffffeffff7efffffffded6ccefefefd6deded6dedee7e7e7efefefdedede -efefefffffffffffffffffffffffffefefefffffffefefeffffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffff7fffff7fffff7f7ffffffffded6cc -a0563f8c611bc18040b6a042b6a042de9d2ede9d2ed66b42b62b10860002860002a00d08a60003 -a60003b70d05a00d08a00d08661b0c5c3f1b81753343711e1d4f2643711e558844605622846a4c -846a4cbab69dffffeffffff7f7f7ffefeeffffffff6784bd4f6c9f2d707fd6e6eddeedeeffffff -fff7ffcec6c6492717817533b6a0425c3f1bbab69dfffffffffff7ffffeffffff7fffff7ffffff -f7fff7f7f7efffffffffffefefefe7ffffff545656cecece848e9b67687c81897cdedede616f61 -c6c6c6fffffff7f7f7f7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffff7f7fffff7fffff7ffffffffffefe6f2d6d6de7a6870 -7e56407e56407e56408c611b8c611b817533a13e30a13e309e2e117e1006860002860002a00d08 -a00d08a00d08a00d08a00d087e1006492717626e1f626e1f83814e558844817533626e1f817533 -a38457bea476fffff7fff7f7fffffff7ffffcee0ef4f6c9f6784bd477285ddeadedeedeeffffff -ffffff9a92917e5640d6aa8aa0563f8c611bc38a81ddcacbfce6eef7fffffffffffffffff7fff7 -fffffffffffffffffffffff7fffffff7f7f7ffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffff7f7f7fffffff7f7f7fffffffffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffff7fffff7fffff7fffff7ffffdedde77e7b9c5456567a6870 -5d324b7a68707e56409d716f5c553b7e5640a0563fa13e30a13e30a13e30a00d087e1006860002 -8600028600027e10067e1006661b0c413d122738132738131c4e0e1c4e0e7da5727da57283814e -b7bcada18b74ded6ccdededecee0efc4d3ed8ba1c76784bd677e83a3c4dabac6d8fffffffbefef -b99f9b5c3f1bb99f9bb99f9b5d324b8040494927175c2e35cececef7fffff7ffffffffffffffff -ffffffffffffffffffffffffffffffefeff7f7f7f7fffffff7f7fff7f7fff7f7f7fffffff7f7f7 -f7f7f7fffffff7f7f7f7f7f7f7f7f7fffffffffffff7f7f7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffff7f7ffffefffffffffff677e831e1f3a412f54142657 -52457a3f32355456565456563f32355c2e357e5640804049804049a13e30a0563fbf4d3ea13e30 -a13e30a0563f812d0d661b0c7d3d30413d12273813103a151c4e0e2b6720a5c2a77da572616f61 -616f61545656545656557085477285677e83a6c8eba3c4da6784bde5ffff677e83f7f7ffefefef -5c3f1b7e5640846a4c5d324b7e7b9cb99f9ba5a5a69fa89cdae0d6e7f4f7f7ffffffffffffffff -fffffffffffffffff7fff7f7fffffffffffff7f7f7fffffff7ffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffff7f7f7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffff7fffff7fffffff7fffff7ffffbac6d8a8aac6bac6d8bbc1c8 -5556825556822f5379412f544d48534d48534d48535c2e355c2e355d324b5c2e35804049a16d56 -a16d56a16d56846a4c5c3f1b413d12273813273813316535336b4d316535336b4d1d4f26566f42 -2445383154493154491659532d707f2d707f2d707f2d707f477285a8b9bdcbcedbffffff9991aa -5d324b7e5640846a4c796e82a5a5a6fff7ffffffffddeadee7f4f7f7ffffffffffffffffffffff -fffffffffffffffffff7f7f7f7f7f7fffffffffffffffffff7f7f7e7f4f7fff7fff7fff7ffffff -f7f7f7efefeff7f7f7fffffff7f7f7fffffffffffff7f7f7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffff7fffffffffffff7ffffffffffffffff8ba1c77e86b0 -4f6c9f2852971534702f537952457a412f5452457a412f54412f545d324b3f32353f32355c2e35 -3f32351017154d463c3f3235413d12103a15103a151d4f261d4f26336b4d244538315449315449 -677e83616f611e4253336b4d165f35165953165953165953165953315449616f61898c8c3f3235 -1e1f3a616f612725227c7b7cffffffddeadee7f4f7a3c4dadeedeeffffffffffffffffffffffff -fffffffffffffffffffffff7ffffffd6d6d6dededef7ffffffffffffffffffffffffffffffffff -fffffffffffffffffff7f7f7fffffff7f7f7fffffffffffffffffff7f7f7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffff7ffffffffffffffffffffffff8ba1c74f6c9f285297 -5058b05058b04c52994c52994c529915347052457a52457a52457a1e1f3a1e1f3a52457a4d4853 -1e1f3a2445383154492445382445382738131d4f261d4f26273813616f61677e83316535272522 -9fa89c81897c616f61336b4d0a4438165f35165f35336b4d2445381d4f261d4f26103a15101715 -315449272522272522a8b9bda8b9bd90aaaaffffffa6c8ebe7f4f7fffffff7fffff7ffffffffff -ffffffffffffffffffffffffffffffbdbdbdefefef7c7b7c272522898c8c898c8cefeff7898c8c -616f61616f614d4853dedede7c7b7ca5a5a6ffffffa5a5a6f7f7f7ffffffefefefffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffff7fffffff7f7ffffffff7e7b9c52457a6784bd -4c52993f70b4506fb6285297616cbf4c52995058b052457a1a378a52457a52457a1426572f5379 -1e42531e42531659531550781d4f261d4f2642500d558844316535316535616f612725224d463c -315449566f423165353165351d4f26196320103a15315449244538315449316535101715103a15 -0a4438244538103a15677e83d6e6edd6dedef7ffffeff7ffeffffff7fffff7fffff7ffffffffff -fffffffffffffffffffffffffffffffffffff7f7f7dededebbc1c8d6dededededeffffffdedede -d6d6d6cececec6c6c6f7f7f7d6d6d6e7e7e7ffffffdededefffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000f7fffffffffffffffffffffffffffffffff7fffff7fffff7fffffff7f7ffb7b3c46175a7 -5556826175a74c52994c52994c52995058b0616cbf4c52992f53794c52992852972f53792f5379 -1534701550781550782d707f165953103a153165357da572315449316535315449244538273813 -4d463c2445382445381d4f262b67201963203165351d4f26336b4d244538316535165f35103a15 -3165351c4e0e677e83a3c4da848e9bd6e6edeffffff7ffffeff7fff7ffffeff7ffffffffffffff -fffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000f7fffff7fffffffffffffffffffffffffffffffff7fffff7fffff7fffffffffffff7f7ff -f7f7fff7f7ffcee0efa6c8eb7b8dc8506fb62f53792852974c52995058b0285297285297153470 -1550781550781550781534700a44380a44381d4f26336b4d244538244538244538244538315449 -566f422445383165353165353165351c4e0e2b67202b67201d4f26165f351d4f261d4f26336b4d -316535558844e7f2ed90aaaacee0efeffffff7ffffe7f4f7cddada979ca9deedeeffffffe7f4f7 -fffffffffffffff7f7ffffffcbcec59a92917c7b7c2725229b9c9c7c7b7c7c7b7c244538fff7f7 -4d48537c7b7cffffff616f61898c8cffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000f7fffff7fffffffffffffffffffffffffffffffff7ffffeffff7effffff7ffffffffffff -fff7ffdedef0efeeffa3c4da5058b06175a74c52995058b05058b04c52994c52994f6c9f285297 -2852971550781550781550781659530a44382d707f336b4d0a44382d707f0a4438244538336b4d -336b4d3154491d4f26336b4d196320316535196320316535196320336b4d558844316535244538 -f7ffffddeadef7fff7fffffff7fffff7fff7efffffefffffdeedeed6dededeedeef7f7ffffffff -f7f7f7fffffffffffffffffff7f7efffffffcecece9a9291e7f4f7b5b5b59b9c9cfff7ffaeadad -9b9c9ccdd8ccffffffc6c6c6c6c6c6ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffff7fffff7fff7effffff7fff7ff -efe6f27e86b07e86b04f6c9f4f6c9f7b8dc87b8dc86175a74f6c9f5058b04f6c9f506fb64c5299 -2f53791550782f53792f53791659531659530a44381659530a44380a4438336b4d0a44380a4438 -165953165f35165f35165f35165f35336b4d558844165f351d4f2631653555884498ae899b9c9c -fffffff7f7efefefefe7f4f7e7f2edf7fff7eff8f7f7ffffffffff979ca9f7f7ffeff7fff7f7ff -ffffffffffffffffffefefefefefefffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffff7f7ffffeffffff7fffff7ffffff -ffffffe7e3f7d6d6eb6175a78ba1c74f6c9f4f6c9f6784bd7b8dc84f6c9f4c52996175a74f6c9f -2f5379555682477285477285557085677e83477285477285315449165953336b4d0a4438165f35 -165f35165f35165f35165f35316535336b4d5588442b6720336b4dbcc8bca5c2a7a5c2a7ffffff -f7f7fff7f7efffffffffffffffffffeff8f7d6e6edbbc1c8e1eeffa8b9bdf7f7fff7ffffffffff -ffffffffffffffffffffffffdededecbcec5c7c6bca5a5a6dae0d6b5bdbdd6d6d6b5b5b5d6d6d6 -cececef7f7f7dedededededeffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffeffffff7fffffffffffffffffffffffffffffffffffffffff7f7ffeff7fff7f7ffff -cee0ef7e86b06175a76175a76784bd4f6c9f6784bd6784bd6784bd6784bd4f6c9f6175a77e86b0 -8ba1c7979ca9979ca9848e9b90aaaaa8b9bd90aaaac6cece616f61244538244538165f35165f35 -165f3519632019632031653555884455884455884481897ceff8eedae0d6dae0d6f7fff7f7ffff -efffffffffffd6e6ed7e86b0cbcedbffffffbbc1c8898c8cdeedeef7fffff7fffff7fffff7f7f7 -ffffffffffffffffffffffffaeadadaeadad898c8c272522d6dede7c7b7cb5b5b54d4853cecece -d6d6d6ffffffcecececececeffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffefffffeffffffffffffffffffffffffffffffff7fffff7fffff7fffff7ffffe1eeff -848e9b7e7b9c7b8dc87b8dc86175a77b8dc88ba1c76175a76175a77e86b05570857e86b0bac6d8 -f7ffffffffffffffffffffffdededeb5b5b57c7b7c7c7b7c898c8c616f617da572558844196320 -1963202b67202b67202b67202b672043711e7da57283814ec6c6c6fffffff7ffefeff8f7efffff -d6e6edbac6d8cee0ef677e83b5bdbdffffffffffffffffffffffffd6e6edf7ffffffffffefeff7 -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffff7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffff7fffff7fffffffffffffffffffffffffffffff7fffff7fffff7fffff7fffff7ffff -bac6d8bac6d8cee0efcee0efcee0efe1eeffcbcedbbdbdbdcececea5a5a6a18b749d716f9a9291 -dac7abdac7abe6c196e6c196e6c196ffecd0f2ebd6dac7abded6cc616f61ddeade7da5727da572 -558844336b4d2b67205588445588447da572a5c2a7cbcec5dededefff7ffffffffefffffffffff -cddada557085fffffffffffffffffff7fffff7fffffffffff7f7fffffffff7f7ffffffffffffff -fffff7fffffffffff7fffff7fffff7fffff7fffffff7f7f7fffffff7f7f7f7fffff7f7f7ffffff -fffffffffffff7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffeffffff7fff7ffffffe2c9b9d6aa8af6cdabdea372c48756c48756dea372 -e28e67c18040da8539da8539c48756f2de95f6cdabeee1c3e2c9b9c7c6bcb9bdb581897cdeedee -a5c2a755884431653531653598ae89cdd8cceff8eeffffffffffffffffffffffffffffffffffff -f7ffffa8a8b5a8a8b5fffffff7fffff7fffffffffff7fffffffffffffffff7f7f7fffffffffff7 -fff7f7fffff7fffff7fffff7fffffff7f7eff7f7f7fffffffffffffffffff7f7f7ffffffffffff -fffffffffffffffffffffffffffffffffffff7f7f7f7f7f7fffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -f7f7fffffffffff7f7fff7eff2ebd6c28268c48756e18855954713d66b42e28e67c48756e28e67 -d2a46aebc07cebc07ceca872eca872ebc07cf6cdabdac7abeee1c3fbefefb7bcaddae0d6f7ffef -ddeadea5c2a7bcc8bca5c2a7bcc8bcdeedeeeff8f7fffff7ffffffffffffffffffffffffffffff -ffffffe7e6efc6cecec6cecea8b9bdfffffff7fffff7fffff7fffffffffffffff7ffffffffffff -fffff7fffffffff7effff7f7ffffffffffffffffffefefefd6dedeffffffffffffffffffffffff -fffffff7f7f7f7f7f7fffffffffffff7f7f7ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffff7f7f6cdabc38a81c18040d66b42d66b42da8539e18855e18855e28e67c48756 -a2763fa0563fa2763fd2a46adea372e6c196e6c196d6aa8affecd0ddcacbfff7efcbcec5ede8de -b7bcadeff8eeddeadeffffffcddadaddeadeefffffffffffffffffffffffffffffffffffffffff -fffffff7ffffffffffdeedeed6e6eda8b9bdcbcedbffffffeff7fffffffff7fffff7f7f7ffffff -fffffffffffffffffff7f7effffff7dededec6c6c6cddadaffffffe7f4f7d6d6d6aeadadcecece -f7f7f7fffffff7f7f7f7f7f7b5b5b5c6c6c6a5a5a6efefefffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffff7ded6ccc28268c18040e18855da8539d66b42ef883ada8539da8539bc6a39954713 -9547138c611ba0563f812d0d8c611beca872d6aa8af6cdabe2c9b9f2ebd6fffff7c7c6bceff8ee -ddeadeefefe7f7ffeff7fff7e7f4f7e7f2edffffffffffffffffffffffffffffffffffffffffff -fffffff7fffff7ffffffffffffffffdeedeeffffff979ca9d6dedeffffffffffffffffffffffff -fffffffffffffffffffffff7ffffff9fa89c7c7b7c5456564d4853e7f4f79b9c9c616f61272522 -616f61aeadadbdbdbda5a5a6bdbdbd3f3235616f61e7e7e7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffff7f7efe2c9b9c28268e28e67bc6a39da8539ef883ada8539d66b42b55d18b55d18bc6a39 -a0563fa13e30954713661b0c954713dea372e6c196f3ac92f6cdabeee1c3c7c6bcb7bcadb7bcad -eff8eef7ffefefefe7fffffffffffffff7fffff7fffffffffffffffffffffffff7fffffffffff7 -fffffffffffffffffff7fffff7ffffeff7fff7ffffd6e6edcee0efd6d6ebf7ffffffffffffffff -ffffffffffffffffffffffffffffffe7e7e7efefefcddadad6dedefffffffffffff7f7f7e7e7e7 -e7e7e7f7f7f7ffffffefefefffffffd6dedeefeff7ffffffffffffffffffefefefffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffff7 -fffffffffff7ded6ccbc6a39e28e67da8539d66b42da8539da8539ef883ada8539da8539c48756 -b55d18661b0c812d0da0563fbc6a39dea372ebc07cf3ac92f6cdabf6cdabffecd0ffecd0a18b74 -ffffeffff7effffff7fff7fff7f7f7fffffffffffffffffffffffffffff7fffff7fffff7fffff7 -ffffeff7ffeff7fffff7ffffffffffeff7ffefffffffffffe1eeffbac6d8e1eefffffffff7ffff -fffffffffffffffffffffffffffffff7fff7d6dedefffffff7ffffe7f2eddeedeefffffff7f7f7 -ffffffffffffdededef7f7f7efefeff7f7f7f7f7f7f7f7f7f7f7f7ffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffff7fffff7 -fffff7ffffffeee1c37d3d30bc6a39c48756e28e67e18855bc6a39c18040da8539bc6a39c18040 -c48756c18040c48756d2a46adea372c48756d2a46aebc07cd6aa8ae6c196f6cdaba18b74d7ad9d -fbefeffffff7fffffffffffff7f7fff7f7fffffffffffffffffffffffffffffff7fffff7ffffef -fffff7f7fff7fffffff7ffffe1eefff7fffff7ffffefffffffffffbbc1c8efeefff7ffffeff7ff -fffffffffffffffffff7f7f7ffffff9fa89c000000cddada898c8c9b9c9c9b9c9ccecece4d4853 -dededeffffff7c7b7c9b9c9c9a9291c6cece545656d6d6d6fffffff7f7f7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -f7fff7f7f7f7ffffffded6cca0563f846a4ca16d56a38457c48756c48756c18040a2763fd2a46a -c18040c48756c48756c48756d6aa8aebc07ce6c196bea476d6aa8abea4767e5640a38457fff7ef -fff7effff7f7fffffffffffffffffffffffffffffffffffffff7fffffff7fffff7fffff7ffffef -f7ffefe7f2edf7fff7efffffefffffefffffe1eeffffffffd6dede67687ce7f4f7ffffffe7f4f7 -fffffffffffffffffff7fff7f7fff7fffffffffffff7fff7ffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fff7 -fffffffffffffffff7efefe7ffffffbab69d4927175c3f1b5c553bbea476a38457c48756d2a46a -a38457c48756dea372dea372c28268bea476bea476d6aa8a846a4ca38457a18b74fdffe7fdffe7 -ffffeffffffffffffffffffffff7ffffffffffffffffffffffffffe7f4f7fffffffffffff7fff7 -e7f2edffffffe7f2edefffffffffffdeedeeeff7ffcbcedb67687cefefeff7fffff7ffffffffff -f7f7fffffffff7fff7ffffffefefe7dededeb5b5b5f7fff7a8b9bdc6c6c6b5b5b5c6c6c6efefef -e7e7e7c6c6c6b5b5b5dededec6c6c6dededef7f7f7efefeffffffffffffffffffff7f7f7ffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -f7f7fffffffffff7f7f7f7effffff7a5a5a62445382445382725223f3235413d125c553ba38457 -c28268c38a81c38a81c38a81a384577e56405c553b5c553b83814ef2ebd6fdffe7fdffe7ffffef -fffffffffffffffffffffffffffffffffffffffffff7fffffffffff7fffff7fffff7ffffefffff -efffffffffffffffffffffffdeedeecddadacbcedb557085e7e7e7ffffffdeedeefffffff7f7f7 -fffffff7f7f7ffffffffffffdae0d6b5b5b5616f61dedede545656616f613f32354d4853fffff7 -aeadad2725224d463cd6d6d65456567c7b7cffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -f7f7fffff7ffffffffe2c9b9bab69d9a92914d4853412f543154491e1f3a1e1f3a4d48534d463c -4d463c4d463c3f32354d463c4d48534d4853272522244538b7bcadfffff7eff8eeffffeffffff7 -fffffffffffff7f7fff7fffff7fffff7fffff7ffffefffffdeedeeeff7fff7ffffffffffffffff -ffffffdeedeea8b9bdd6dede979ca9979ca9bac6d8f7f7f7e7f4f7eff7ffffffffffffffefefef -fffffffffffffffff7fffff7fffffffffffff7f7f7d6dedeffffffd6dedecececec6c6c6ffffff -f7f7f7bbc1c8e7e7e7ffffffdedededededeffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffff7ffffffffe7e3f7f7f7ff -fffffff7efffa5a5a6a16d56a16d569d716f4d4853412f542f53791426571e42531e42531e1f3a -1e42532f53791e425316595314265716595347728531544990aaaabcc8bccbcec5fbefeffff7ff -fff7fff7f7ffefffffe5ffffe5ffffe5ffffe5fffff7fffff7ffffffffffefffffa8b9bd979ca9 -a8b9bde7e6ef2f5379848e9bcddadad6e6edffffffefffffefeff7fffffff7f7f7ffffffffffff -f7f7f7fffffffffff7fffffffffff7efefeff7f7f7ffffffefefefffffffffffffffffffffffff -efefeffffffffffffff7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffff7f7ffffffffffffffefeeff -a8a8b59991aa9d716f7d3d30a0563f846a4c67687c1e42531e1f3a142657155078153470142657 -1550781b6ea31b6ea31b6ea31b6ea33f70b44f6c9f47728590aaaa90aaaa90aaaad6e6edffffff -fffffffffffffffffff7ffffefffffefffffefffffa8b9bd677e836175a7d6e6eda3c4da7e86b0 -557085bac6d8cbcedbd6dedeffffffe7f4f7eff7fffffffff7fff7f7f7f7f7fff7fffff7fffff7 -fffff7fffffffffff7fffff7fffffff7f7effffffff7f7f7e7f4f7fffffff7f7f7ffffffffffff -f7f7f7efefeffffffffffffff7f7f7fffffffffffff7f7f7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffdedef0a8a8b57e7b9c -55708567687c7a6870812d0d5c3f1b5c3f1b5c553b4d4853142657153470155078153470155078 -1a378a1b6ea31b6ea31b6ea31b6ea34f6c9f153470165953557085557085677e83848e9b848e9b -677e837e7b9c6175a75570854f6c9f848e9bcee0efcee0efbac6d890aaaaa8aac6a3c4dacee0ef -cee0efd6e6edfffffffffffff7ffffeffffff7fffffffffff7fff7f7fff7f7f7effffff7ffffff -fffff7fffff7fffff7fffff7fffff7fffffffffffffffffffffffffffffffffffffffffff7f7f7 -f7f7f7fffffffffffff7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffff7fffff7fffffffffffffffffffffffffffffff7ffffdedef07b8dc86175a75058b0 -5058b05058b052457a5c3f1b661b0c7e56405c3f1b3f32352445381e42531e1f3a1550781b6ea3 -1550781b6ea31b6ea31b6ea31b6ea3315449616f61a5a5a6898c8c83814eb99f9bb99f9bcec6c6 -c8c5d5d6d6decddadacddadaa3c4daa6c8eba6c8ebbac6d8bac6d8bac6d8c4d3edd6e6edeff7ff -fffffffffffff7fffff7fffffffffffffffffffffffffffffffffffffffffffff7ffffffffffff -fffffffffffffffffffffffffffffffffff7fffffff7f7f7fffffffffffffffffff7f7f7ffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffff7fffffffffffffffffffffffff7ffffffffff8ba1c74c52996175a7616cbf -616cbf5058b04c52995c2e35846a4c492717605622605622413d122445383154491e4253142657 -155078155078155078165953336b4d566f4242500d83814ed6aa8ad7ad9dc38a81c38a81ffffff -ffffffffffffcee0efa3c4daa6c8eba3c4daa3c4dabac6d8cee0efe7f4f7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffff -f7f7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffff7ffffffffffffffffffffffffffffffffffffeff7ffa3c4da52457a616cbf616cbf -616cbf616cbf5058b05d324b3f32355c2e355c2e355c3f1b4927175c553b5d324b4d48534d4853 -412f5427252231544927381383814ea18b74bea476a384575c553b5c3f1b4d463c4d463c898c8c -a8a8b5bac6d8a8aac6a8b9bda6c8ebe1eeffe1eeffeff7fffffffffffffffffffff7fffff7ffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffefefefffffff545656000000e7e7e7ffffffbdbdbdcecece272522 -fffffff7f7f7f7f7f7f7f7f7f7f7f7ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffff7fffffffffffffffffffffffff7ffffffffffe1eeff6175a76175a74c5299 -7b8dc8616cbf5058b05556827a6870412f543f32355c2e355c553b5c2e355c2e358040495c2e35 -7d3d305c2e35a16d56c48756a38457c18040c28268a18b74a18b749b9c9c4d4853848e9ba8b9bd -bac6d8d6e6edeff7fffff7fffffffffffffffffffffffffff7ffffeff7ffffffffffffffffffff -f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffff7f7f7efefefffffff545656000000000000000000e7e7e7a5a5a6616f6167687c -1017155456564d4853000000a5a5a6ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffff7fffffffffff7fffffffffffffffffffffffff7ffffeff7ffcee0ef7b8dc84f6c9f -616cbf5058b0616cbf7b8dc84c529952457a67687c4d48533f32355c2e355c2e355c2e35804049 -804049a0563fbc6a39e18855c48756c28268d2a46a9d716f5c553b4d463cddeadeffffffefffff -effffff7fffffffffffffffffff7ffffeeffffeeffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffc6c6c63f3235000000101715000000a5a5a6e7e7e7101715efefef -616f61272522b5b5b51017159a9291ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffff7ffffffffffffffffffffffffffffffdeedeef7f7ffeff7fff7f7ffa6c8eb -7e86b06175a75058b05058b0616cbf4c52994c529967687c555682412f54412f547a68705c2e35 -5c2e358040495c2e357d3d30661b0c5c2e35661b0c846a4c9a9291fff7f7f7ffffe7f4f7e5ffff -e5ffffeffffff7f7fffff7fffff7fffff7fffff7ffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffff7f7f7ffffffd6dede3f3235101715616f61f7f7f7d6d6d6000000272522 -3f32352725229b9c9c9b9c9ca5a5a6ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffff7fffff7fffff7ffffffffff -ffffffa8aac6a3c4daa6c8eb5058b07b8dc85058b05058b06175a74c52995058b04c5299616cbf -52457a412f54412f5467687c9a92919d716f9a9291fce6eeffffffffffefeff8eeffffefffffef -fffff7fffff7fffffffffffffff7fffff7fffffffffffffffffff7f7f7f7ffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffd6d6d6f7f7f7f7f7f7ffffffd6d6d6545656ffffff -f7f7f7efeff7f7f7f7efefefffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffff7fffffffffff7ffffeff7fff7ffff -eff7fffffffffff7fffff7ffe7e3f7a8aac6a3c4da9c9fc09c9fc09c9fc09c9fc09c9fc09991aa -7e86b09991aa7e86b0c6b9c6ffeefffffffffffffffff7fffff7f7fffff7ffffeffdffe7ffffef -ffffeffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffff7f7f7ffffffffffffffffffffffffc6c6c6e7e7e7efefef -bdbdbdbdbdbddededee7e7e7e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffff7fff7ffffeffffff7fffff7fffffffffffffff7fffff7ffffefffffef -ffffeffffff7fffff7f7fffff7fffff7fffff7fffffffffffffffffffffffffff7ffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffff7fffff7fffff7fffff7fffffffffffffffffffffffffff7ff -fffffff7f7fffff7fffffffff7fffff7fffff7fffff7fffff7ffffffffffffffffffffffffffff -fffffffffffffffffff7fffff7fffff7fffffffffffffff7ffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffffffffffffffff7fffffffffffffffff7ffffffffffffffffffffff -fffffffffffffffffffffffffffff7ffffeffffff7ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffffffffff7fffff7fffffffffffffffffffffffffffffffffffffff7fffff7 -fffff7fffffffffffffffffffffff7fffff7fffff7fffffffffffffffffff7fffff7ffffffffff -fffffffffffffffffffffffffffff7ffffeffffff7ffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffff7fffff7f7fff7f7fffff7fffff7fffff7fffff7fffffffffffffff7fffff7fffff7 -fffff7fffff7fffff7fffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffff7fffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffff7 -fffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffff7ff -fffffffff7fffffffffff7fffffffffff7fffff7ffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffff000000 -000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffff7fffff7 -fffff7fffff7fffff7fff7f7fff7f7fff7fffff7fffffffffffffffffffffffffffffff7fff7f7 -fff7f7fff7f7ffeeffffeeffffeeffffeeffffeefffaeef7fbefeffce6eefdefe7fdefe7fdefe7 -fce6eefbefeffce6eeffeeffffeeffffeefffaeef7fce6eefaeef7faeef7faeef7fff7efffffef -ffffeffffff7fffff7ffffefffffeffdffe7ffffefffffefffffefffffefffffefffffefffffef -ffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffef -ffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffef -ffffefffffefffffefffffefffffefffffefffffefffffef000000 -000000fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4fdcfc4 -fdcfc4fdcfc4fdd0cefdd0cefdd0cefdd0cefdd0cefdd0cefdd0ceeee1c3fdcfc4fdcfc4fdcfc4 -fdd0cefdcfc4fdd0cefdd0cefdd0cef3d2dafdd0cefdd0cef3d2dafdcfc4fdd0cef3d2dafdd0ce -fdd0cef3d2dafdd0cefdd0cef3d2daf3d2daf3d2daf3d2daf3d2daf3d2dafdcfc4eee1c3fff6b6 -fff6b6fff6b6fff6b6fff6b6fdf5abfdf5abfdf5abfdf5abfff6b6fdf5abfdf5abfdf5abfdf5ab -fdf5abfdf5abfdf5abfdf5abfdf5abfdf5abfdf5abfdf5abfdf5abfdf5abfdf5abfdf5abf2de95 -fdf5abfdf5abfdf5abfdf5abfff6b6fdf5abfff6b6fff6b6fff6b6fff6b6fff6b6fff6b6fff6b6 -fff6b6fff6b6fff6b6fff6b6fff6b6fff6b6fff6b6fff6b6000000 -000000bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111 -bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111a00d08bc1111b70d05bc1111bc1111 -d30f15b70d05bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111bc1111b70d05 -bc1111b70d05bc1111d30f15bc1111bc1111d30f15bc1111bc1111d30f15b70d05ef883ade9d2e -de9d2eb6a042de9d2ede9d2ee7a330e7a330de9d2ee7a330e7a330de9d2ede9d2ede9d2ee7a330 -e7a330de9d2ee7a330e7a330e7a330de9d2ede9d2ede9d2ede9d2ede9d2ede9d2ee7a330de9d2e -de9d2ee7a330de9d2ede9d2ede9d2ede9d2ede9d2ede9d2ede9d2ede9d2ede9d2ede9d2ede9d2e -de9d2ede9d2ede9d2ede9d2ede9d2ede9d2ede9d2ede9d2e000000 -000000ee000cee000cee000cee000cee000cee000cee000cee000cee000cee000cee000cee000c -ee000cee000cee000cf7000ff7000fee000cf50f10f50f10f50f10f50f10f50f10dc0c02f7000f -ee000cf50f10d30f15d30f15d30f15f50f10ee000cee000ceb0000f50f10ee000cee000cf50f10 -f50f10dc0c02ee000cdc0c02f50f10f50f10dc0c02dc0c02dc0c02dc0c02bc1111ec8311ffa21c -f3a015e7a330f3a829ffa21cf3940bff9403f3a015f3940bf3a829f3a015ffa21cffa21cffa21c -ffa21cec8311ffa21cf3a015f3a015f3940bffa21cf3a829f3940bf3a829f3a015f3940bffa110 -f3940bf3a015ff9c08f3940bff9c08ffa110f3a015f3a015f3a015ffa110f3a015ffa110ffa110 -ffa110ffa110ffa110ffa110ffa110ffa110ffa110ffa110000000 -000000ff0008ff0008ff0008ff0008ff0008ff0008ff0008ff0008ff0008ff0008ff0008ff0008 -ff0008ff0008ff0008f7000ff7000ff7000ff7000fff0008ff0008ff0008ff0008ff0008ff0008 -f50f10f50f10d30f15dc0c02ee000cf50f10f70000f80900ff0000ff0000f70000f80900ff0000 -f70000f50f10f50f10f50f10ee000cf50f10f80900f70000f80900f50f10dd250fec8311ff9403 -f3940bf3940bf3940bf3940bff9c08ff9c00ff9c08ff9c08ff9c08ff9c08ff9403ff9c08ff9403 -ff9403ff9c00f3940bff9403f3940bf3940bff9c08ff9c08ff9403ff9403ffa110ff9c08ff9c08 -ffa110ff9403ff9c08ff9c08ff9c08ff9403ff9403ff9403ff9403ff9403ff9403ff9c00ff9c00 -ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00000000 -000000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -ff0000ff0000ff0000f70000f70000f70000ff0000ff0000ff0000ff0000ff0000ff0000f50f10 -dc0c02dc0c02b62b10d66b42f13f3df70000f70000f80900eb0000f70000ff0000ff0000ff0000 -ff0000eb0000eb0000f50f10f80900f70000eb0000eb0000f80900dc0c02dd250fec8311ff9403 -f3a829ffbc38f5bb36f3940bff9c08ff9403f3940bf3940bf3940bf69d04f3940bff9c00ff9c00 -f3940bffa508ff9c00ff9c00ff9c00ff9c00ff9403ff9403ff9c00f3940bf3940bec8311ff9c08 -f3940bf3940bf3940bff9c08f3940bff9c08ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00 -ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00000000 -000000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -ff0000ff0000ff0000f80900f80900f70000ff0000ff0000ff0000ff0000f70000f80900f70000 -ee000ccc0004bf4d3efdffe7e78673dc0c02f70000dd250ff50f10eb0000f50f10dc0c02eb0000 -f50f10f13f3ddd250feb0000f50f10f13f3df50f10f13f3df50f10dc0c02dd250fec8311ec8311 -f5bb36f5bb36fcdf6af3940bec8311f3940bffbc38f3a829f3a015f3a015f5bb36f3a829f5bb36 -f3a015f3a015ec8311f3a829f5bb36f3a015f3a015ffbc38f5bb36f5bb36f3a829f5bb36e7a330 -f5bb36e7a330ffbc38f3a829f3a015f3a015ff9c08ff9c08ff9c00ff9c00ff9c00ff9c00ff9c00 -ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00000000 -000000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -ff0000ff0000ff0000f80900f80900f80900ff0000ff0000ff0000ff0000f70000f80900f80900 -f50f10dc0c02b62b10ffffefe78673dc0c02eb0000e88683f3ac92f50f10d30f15dc0c02d30f15 -f13f3dfdcfc4e88683e78673dc0c02e18855f13f3de88683f13f3ddc0c02cc0004ef883af3a015 -f3a829fcdf6affbc38e7a330f5bb36f3a015f5bb36fcdf6afcdf6ade9d2ef2de95fcdf6af2de95 -fcdf6ade9d2ede9d2efcdf6aebc07cec8311de9d2ef2de95ffbc38f2de95fcdf6afcdf6ae7a330 -f5bb36e7a330fdf5abffbc38f3a015f3a015f3a015f3a015f3a015f3a015f3a015f3940bffa508 -f3a015ff9c08f3a015ff9c08f3a015ff9c08f3a015ff9c08000000 -000000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000f70000 -f80900ee000cd30f15f13f3df13f3ddc0c02ee000cf13f3df13f3df50f10ee000cf50f10d30f15 -dc0c02f13f3df13f3df13f3ddc0c02f50f10f50f10f13f3df50f10ee000cdc0c02ef883af3940b -f3a829f5bb36f5bb36f3a829f3a829f69d04f3940bf3a015f3a829f3940bf5bb36f3a015f5bb36 -f3a829f3a015f3940bf3a829f3a015f3940bf3a015f5bb36f3a015f5bb36f3a829f5bb36e7a330 -f3a015f3a829f5bb36f3a829f3a015f3a015f3940bffa500ff9c00ff9c00ff9c00ffa500ff9c00 -ff9c00ff9c08ff9c00ff9c08ff9c00f3940bffa500f3940b000000 -000000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -ff0008ff0008f7000feb0000ee000cee000cee000cf7000ff7000fee000cee000cee000cee000c -ee000cdc0c02eb0000dc0c02ee000cee000cee000cff0000ff0008f80900dc0c02ec8311ff9403 -ff9c00f3940bf3940bff9c00ff9c00ff9c00ffa500f3940bf69d04ffa500f69d04f69d04ff9c00 -f69d04ffa500f69d04f69d04f69d04f69d04f69d04f69d04ffa500f69d04f3940bf3940bf3a015 -f3a015ff9c08ff9403ff9c08ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00 -ffa500ff9c00ffa500ff9c00ffa500ffa500ff9c00ffa500000000 -000000ff0000f70000ff0000f70000ff0000f70000ff0000f70000ff0000f70000ff0000f70000 -ff0000f70000ff0000ff0000ff0000ff0000f70000dc0c02f80900eb0000f70000f70000ff0008 -ff0008ff0008f7000ff7000fff0008ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -f70000ff0008f70000ff0000f70000f70000f70000ff0000ff0000f80900dc0c02ec8311ff9403 -ff9c00ffa508ff9c08ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c08 -ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c08ff9c08ff9c08 -ff9c08ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00 -ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00000000 -000000f70000f70000f70000f70000f70000f70000f70000f70000f70000f70000f70000f70000 -f70000f70000f70000ff0000ff0000f70000dc0c02dc0c02dc0c02dc0c02dc0c02f70000f7000f -ff0008ff0008f7000ff7000fff0008ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000 -ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000ff0000f80900dc0c02ec8311ff9403 -ff9c00ff9c00ff9c00ff9c00ff9403ff9c00ff9c00ff9c00ff9c08ff9c08f3940bff9c08f3940b -ff9c08f3940bff9c08f3940bff9c08f3940bff9c08f3940bff9c08ff9c08ff9c00ff9c00ff9c00 -ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00 -ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00ff9c00000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/pthreads.gif b/Docs/Books/pthreads.gif deleted file mode 100644 index 3dcd86b2c419b7c55fdd6693a8e504b025870b37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8463 zcmWkyXH*kg7rm1@nIw~hE;XUq5QBoEf({)N9|4h~fB_p~c|lRZf&-z07*qrmG>9M~ zK7&$3L5C`e@`44iVZZ`DQGx~R`S|u)XRmwry6gPfXWzAsmyf68{K$1c3MK&1{2vn< z&FEzP)(lN(CMGnalfvl#<;mOVB>nu^|7T+8&Hsf-j7~ls{WhWbILRL;Mm0Z2M}K^r z_&qwL8Lu1qGBG--k52sldSP^QR5PL+`t)IRbm-UHj{_eypWgS5zWvny;p2zl{-L*{ zLz8$l@#4S!-nSn<4zv!v80zm=_y3>!e=ED6s(L@)f7-1Y{nVe|JE{EJ_UmO#Z}0p5 z-n+fM{r8?e?d|OyzjxtY-`%zcAA0XSesQO3@ODF2_p|Qq?ym0kj_&TKw=Q&dbab{q zdfR-gqodmy;H%o2kzQHWxew)Ajxan>?*T_I<~F0%uT|3VGtXDylIP!7nt_7cS1F_BB#V8rs7sz23Ho4Zgq z4UlxKgQr@Vo0=`;>g&z|lMqan&HoSop9KJGfQDi0t&lfMVeJ`Vor)4yz_nOfu+?By=Dcqc@JWQX{dznC)q>dBS4 z=Z~4(uC-7ep@Y{{h2VT(mEVGZa9RDOf9v=Oa?G-aoKhv5O*&Snj~0=2XJmwB^Ts;Z zvypcO)W=>dGfse$+OF2N&7i>gQ@lj1pXIy3ZI9!i^h)@#Q(1V=03A=KE{wZ6g9Osf zQH|q=RfG#Yt9tgCy)ieS)GyV?;}sfzsMsr1M+lClx|n!Gi~~`dp9Wjpt`M1dg&|{D zmX)#h8L5ef4hc6CdAAtTkLR>^Y8!I#Os36D&vjLzQ9l2aWE}Nl~Ok!qWcD)AVcp`02q7CH9^+<+N zD~<6d;gr>cCbA`6=pFSkf}2{4A+|-mtt`{C+&q8Dn}lAFu+6@gBw>RdKz71yfcR?E z8utezl}+7Pb6$V0UWqK3-c0+6v9h15bx&z+QsXtUt;~y|37*ev-G43kNs!2$t9Um% zbSHhr8zZC<+NtdjQsIJou$K1?BpFsE04Z;J(OW6cK&o`(VBbUpV#gnlGWfWJtmQ;t zsdUdxN-1agb8ahdZZs8xOrL`k+M0`DS2*4kCj%kO9-`<|v5Au&#wpMh!Dt$f2GZ<% z+>vq@ZtFdc0k4BCaN^SL@pU9p-b^Q6E6Kx6o@7XMAEQv5qak-lkfH(pkR8BNO?YLB zRJwIaWCd^6SvGDs^Ywra9MV}o;-@*WewZB6=;;WSi+L^Vr2sTr#@xj{3=-@GSLt>D z0^E=(B_GWL>9RT8V6zer_|#oR%ZdOgH+5fkuH7SZE}5HVnBJkv)LR};N>TU)>(u%y z$y~RgX+njnDT+aep@gf5dz_0QV4`_u< zDR_TschSLiFLukEtX}^8hKjBCMMB&K5n)sx%FM&71c?8MKyDFL$*A-}q}w0uS9+1MI1(DoMUwPNB#9s+0?qm$q&%tsKKZfT|v(08&J@%S&8_gKwY=cw_T8 z5?k{Pf159Nym#GFkNn%0QemwGHAPmQ+KvPSDb9y|-R{bL{WUzmhu!e&{?s#RSY`Qx zn22W!d1y}d64l@X>njZ0gL~Ipmfs1CaolBF*Hr6fP6z)CjX$#4eDM$7dQ=D~EIyzQ zGiuC-58u^T&$NjAZhEgpNin;-%pBt4l9dxa-F0JNg^S^)2@%+j@j$ z1Ij~UN@(<~nrlC7{-Bt6R>_C0D=&xL)e2tyyJ@ptR35bJ(>MR*;(_`$o$p(1)0w!@$Xc@p{IofXc?{30Gi=M~=BbOJgDY9C zv}ps8ys#33;EYW+oOs_2&7^37#r$jczv46cU07aVQ1@m=+w4RPkm4eBZ#kw-tHhIz z#>+{zLWJ{i-LZyW-z_-3cO-tI4N+BRm@6gj`l~RUiVtub749{+31C9@y;l0i*56i~ z*Jxu`uO`^dA$<(bEO`P{Soj)k2vV7G6OZV9_=hWO7HJP3a7&X6*P zy;6Po=Gs};@{p0ZkCx^q&G)AA*=RK#t7<{yfNK3P3C5~kaY-5lm=e*Ge7^CR5;e{8 z7mG+b?%A%!gzqktNa`vvvifXDK*xm0N=f70i-jIDF+s9(RWfP@2*JEDX~fO(Hoi~x z20b}x&n8c5+y~!l&n|>cpai7^ZZDi$k{Qd2Br#x!HqJ*E!g6RUMm3WV+eVQE=FSJ2 znWl=A9|zBH53B8U=V8Ux-+onDY??*dBjW^#&GmY)6pM&hm(B1iL37OEts-Ns3yK$mLwakjrwW zg#>mNLK08fJT>!{0)bTUEiq$Xu%4)AO{7&AdX>x~HY_YJ)OM|BRLgF7dYsY z2B&EC0ZRZm=u!FN^#TyOjWQPw;W0oW8v}kA{k#Y%7BlNq=|yS=0_cB0st9K7Bx1uc za)n00@Fghk`N$0kODUr;Wcuq}bd;X}B1~C_F-S_1B>=I*a}^45wrEw1kew!E{E#>t z;nE&(sm=y^J^7R~Gk-AqGO7u}OT7@jU zk6kB5%9ZSKCA$@)ER=D^RIIZq)I~(Uq@b_kljrc!eQGFOgx+yLy)^PyjtK~LE%&oRnr5p^Gz@tKc)kuw11qaZj|YIKy(3Y2qF`K&Y* zBUJ(a!kwcELRAy+c`>V1hQ3f`&wqlxP%_^sNh}$dCdo;XQU3tv6KcjBocvzGlB&rK zb%;BE_3NGK3#cGmOuHmzH1g3#Ipbj}$yya+%C`+kB1O5IjB1fh(zZDm@DM&YBw-fw zWiMnX4rkPekQ8jvHS{PU@)JX@E0{KN{iEY#rG#}(MBSi3PYNkO45+x6+p~s>fjEMW zE9jRn))`HL*MEXpRI$#cq*K#Hv5W2>A}UGA9&=$}q;wC$y~u{1?VJN^rVx zc!W!_z>F-_$h~((`!JeP&U)wr-A@&sbO1^NMy86YR5QY5nF;>zDT1>cF#8m+M$S0` zm_W#Gk+IXxL@ceD#SlpjD$xlgvr~2GM#Jf?Vp@?1sh4xQ`Url=@+Lh4C% zMvjtnKOb;p;6{(skf%rYgl3A72?hJvWYcSm2od$-55`x(JY{|4G@s@pW|b+aFK8eL zu&xN10a(PUX1uu_Y{lReGPr_ZL|}~bTtLBB8g-Odsr30Z`^TeW$X7^n_i!YYM^xMc z|ICAP0jd$QE7c5NjJ`)+Sw>J;Vv@Cxl%$Lb6_Iz>9DpPw4+BQBidKOme_?c$j6xA^ zWXKee`TE}WqPW8HBt3|XK{OF_2%Jkij()*7pOw`Y6pTA!^cBWw6msS$8RJT3u@XKg zCfTUgT;{UJgi{ZYp+y?S_DmVPTS89}lc&fiyXg_`p?Vf|wk1!+hC)4xgwi29`A&v@ zC8|vp)f#U`l{n{;lG>_9J8^cigtPn2szep5T2{n^jKbB-n-b(uA4DNQL!55p0`wH0 z5+Y=LSxYI9(}FER_58J_)~!c`(xc*&=P^bRA2rG52l;58{Jbn503pRq4ZF#aGzFZwmg*@E>Whh;->01tn@+)K zd0fV6{9FXV{GvcVDeoxsdb1~$jf@^SO5MxRSdZS`;@*7`^h#MGNiE(~L zqbJnx2_^LepBye;8K}i66bGYx#y(5h7txJDjCF`utK6=)+W<7_k*k=z$|U#R6BmDP z)Z3efToRX5$g6Hn=8FQo!{n$jv|q*kEJIZyj^KT^FTc=SLb4QsB)}MuQBfgnkvr`R zmobmOsZzY4zx`T^ig95a-SHV+j8lKfIZxDJ6sL#=j0!Eb#UIxHlW_hgQ*je-q=XUu zfa6kh@~aG;@S%G>2MiI|-HtSf$Z{2M)y#(|N?M1CQY1sNZ_qyl@_g%tab-hJy-N2q9ZFl!7s9 zB+NN#sO{QZHvw2!M|R#peih($Fw(eTrc0MY3s8`Q4H-8Zt{juF4tBL(upv|;q)CD{ ziILVqB#Ix-RO%NLFl`ho=yJ+e)kzhfc4ypzsx~00=C_C`nY$TwfccMfJ&P7LzLMl5 zpA2(lOBiCA*?RDLW9MoP-p43cWgjpGRm;{@g}B{y)npmxotQJOF1LBc2vft0xMT+|B?)K9Wz-!} z&`yB%E<)QxoVQ|1vNdn2`)og6?{QZ3w>c8If-@rHbV-i2sL{6)W*f$8R3jI#!LJhv!l!Tfm)~NnBjb$o0Cn5S>EyC5?MG{Iv=3*$lrgUsGp`6~caz{(%D&Rc zKGmfBSv=ZrU?>43x4@HCPl_97C5af-D%Kd6-9?~}@1d{6$KI;ZUm6*EbkZ0S&X5Fc z#-8;7L?K6;3HD2M|4W>$5Hdy;9EF_o%;kBg@P5U5k)3#dM05B~M?WqPesD2|kg3Lm zO>@e!QSI$N|-05$eANYEo8@K4y zL#}fX#dK_YdQ&=knnX+((Di zm!osv{&vkc&%ZaG{parcagvdYdX*T0QPzVGtm;4P zPco+2DQ1)@s~Km%UHLi&W#xY68Jc(Ud>^pRkXg)B{Flg93E)W-hB-PB)`KrXY~Yhq?n` zCcx9$I?Oe@w&?ImE6Yd=xd`n~kBrMC_+vc^=FMwyH)Ecep`QeQo|Y?F&0OjlHFd*4 zkQPA-6q42gp;qi%KQVo-g1T5T@7wFZ1LGCM`eOGW#-`l~g^KY4eI%a?r5+e!I^aiEZ4EesAUp+!}4=BpSr@z()iClGL3*2gI4kPgcj zTr)%l_HBEKn12ej8IuLJ>yRz!#Q6g+SyTbE_o5iE*;LnQOCO@laeX zePdFkbBr2P$4bhuSbS0|p)Lh^R36-z*z+^L?#>}SzpI@NTvt^RnVgPVIr3Y8o$EI|7dXrt%3pq064hw7_?wCc>A)(` zY@X!}$VaolC7#?MvLqXk#Q?74!n8EHlQLsQ7uq=NoViN0LA!wV#8OLX9!c@3F-Xc} zStrJyWinN(#g-E!E*~dx4F!V6iazW{lHr|Kr%kQx+PD_wnGo<}g;E%i`#Ph&WHvM9 zB_IM z{7B~m@KC$dRFYQm>fd>P>|0r0!5fL?ZeQS;pGM$n|w+Ae+#p;fCrBP0_xy6hV*(J*}e8M?E z*Rzty^;_Iy`6^oT$=|DZ|HDkr;=ezA-=MeUN5&w`>{|^WdiO4DI;CUUI+o6vyt8yY zfZ@c!V+imnp4}3p5arQ`J8Tu^uD$+ST>F3fS~54rhMPY2I2N+uUFoL=`nCG|b{Hcy z)n>*fYL@xgmhTVf2*0PKgx~4?;NXw$UM$mY50vY>D%L|cmI&Q>V&7n-lksl;W2k&qax_8}l-i-A0!{U6?FZ?O5%}c#Q@ptZFkIr>Rq)}&i4bl za*&nZGHNgG{?NI4Z*=gcj?d;Fpe???vw{|?)UDATi&ouF9=CABw#KZyuxd(8Z|$6Dmzec9`SE>ut-bu>*7fq$ zhF^N?9iv@nDKnp=I`!l!!fo60Plg#;>Nm8eZi`F*$@@F-@wLb8w!0n=u(t;m7{0jo z&(7=5!eineUw_SQGx>O9k$N;2j)HnZ0|wwkHcX-kd{us333QyhQM zv`&|>tgOcj|ESX(e+kgd;xQvhBh7T8@0MAlr!3WJow;@);l4rBk#ydFAS%#e%D?ex zM@nSmPKab=$Qmh~P}TMa`y+@_REs78Mu@7nRLwMc`f zExhpL?g5ee!Jd&f3k$A2+}*#U@^l_+=FpSdkFI(y2yy{fNU7nCX`U$;d6E9#k{`Eo zsi{}0GG>Me=<+|UI=;WsW*!|tY=Tm*ggU+3u%?;a8#FJwc}vW;(p8W4Z1{R)Y~=Mi z(KiE9MeV$C5tX)DYIufdHjQzH{YPAMdZ(rH`$cKSz5`G1cDtZoK8mHr+_0tvl4Nt* zVrue`>gl#<9_v*zyN`gR%1J`kPI$(-wU<9KA8&;Lh7Zo}KV|VzKb{ML~v^{&m)R z;>!(t_z-J@(e4`^ kr|V+}*h}^-*w^;uoY(&UR^HsxTi^fnQhL*SG6^jD9}(I25C8xG diff --git a/Docs/Books/pthreads.txt b/Docs/Books/pthreads.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/Books/realmen.eps b/Docs/Books/realmen.eps deleted file mode 100644 index c04e3fd8ffa..00000000000 --- a/Docs/Books/realmen.eps +++ /dev/null @@ -1,1167 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /opt/local/x1/work/bk/mysql/Docs/Books/realmen.eps -%%CreationDate: Sun Dec 31 14:31:25 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 298 372 -%%EndComments -%%BeginPreview: 100 126 1 126 -% fffffffffffffffffffffffff0 -% aaaaaaaaaaaaaaaaaaab7b5550 -% d5555555555555555555add4b0 -% aaaaaaaaaaaaaaaaaaaeff6b50 -% d555555555555555555556aab0 -% aaaaaaaaaaaaaaaaaaabaf5450 -% d5555555555555555556feaa10 -% aaaaaaaaaaaaaaaaaaaaa548b0 -% d5555555555555555556aa9210 -% aaaaaaaaaaaaaaaaaaa9542450 -% d5555555555555555552254a90 -% aaaaaaaaaaaaaaaaaaa89a1030 -% d555555555555555555054a7b0 -% aaaaaaaaaaaaaaaaaaa92a0ad0 -% d555555555555555555054a550 -% aaaaaaaaaaaaaaaaaaaaaa4af0 -% d55577d5555555555550fd5490 -% aaabdd7aaaaa90a24aabfe5530 -% d556b7ad55554a489551fb5490 -% aaabd4b6aaaaa55252afef2d10 -% d556ab5d55552aad5553feaa30 -% aaadd556aaaad552aaabfe5490 -% d5576aaaabaaaaed5557dd5530 -% aaadaaaaaaaaaaaaaaabfeaad0 -% d556d55557aaaaeaaaabfa57f0 -% aaadaaaaaaaaaad55555fd5570 -% d5576aaaabaaabaaaaa9eaabd0 -% aaadd55556aaaaeaaaa9fd56b0 -% d556aaaab5db76b755527556b0 -% aaadd555ef76adddaaa8955510 -% d5576aaabadd7b775554555650 -% aaadaaaad7ab56d55551555a90 -% d556d555555555aaaaaa2b6d10 -% aaadaaaaabaaaaeaaaaadedab0 -% d5576aaaaaaaaaaaaaad6bee90 -% aaadd55557aaaaeaad52b7bbf0 -% d556aaaaaad555aaaab7fff770 -% aaadeaaaab55556ab7fffffff0 -% d557555eaaaaaaabfffffffff0 -% aaadd5aaaaaaad5ffffbfcbf70 -% d556aabd5555557ffff7fd7fb0 -% aaabff6aaaaaabfffff51dd970 -% d55555dab55557fffff6fcd570 -% aaaaeeb555aaafffffedbb5570 -% d555555555555ffffff7fffff0 -% aaaaaaaaaaaabff9ffdffffff0 -% d555555555555ff6fffffffff0 -% aaaaaaaaaaaaaffaa495084970 -% d55555555555abf76dbabb5b70 -% aaaaaaaaaaaaabf76db3ad5ef0 -% d55555555555557ffafffffff0 -% aaaaaaaaaaaaaaaffffffffff0 -% d555555555555555fffffffff0 -% aaaaaaaaaaaaaaaa57fffffff0 -% d555555555555555a8555f5c10 -% aaaaaaaaaaaaaaaaaba856dab0 -% d55555555555b555555557b750 -% aaaaaaaaaaaaaad6aaa817aef0 -% d55555555555555555552b7bb0 -% aaaaaaaaaaaaaaaaaaa82fd550 -% d5555555555555555554935bf0 -% aaaaaaaaaaaaaaaaaaa817d550 -% d55555556d556d5555544b5d30 -% aaaaaaaaaaaaaaaaaaa817d510 -% d55555555555aad55554ab6c50 -% aaaaaaaaaab6ad56aaa80baa90 -% d5555555555555555554abd630 -% aaaaaab5aaaaaaaaaaa8155d50 -% d5555555556ad5555554abaab0 -% aaaaaaaaaaad5ab6aaa826aff0 -% d555555556d555aad554aaaab0 -% aaaaaaaaaaaaaaaaaaa856d770 -% d5555555b555555556d4ab55b0 -% aaaaaab6aaaadaaaaaa82ed650 -% d55555555556ab555555575d10 -% aaaaadaaaadaaab6b6a85db450 -% d5555555555555555554abfe90 -% aaaaaaaaadaaaaaaaaa92fda10 -% d555555b55556d5555595efeb0 -% aaaaaaaab55aaab6b6aa5dea90 -% d55556d55555aad55554bfdf70 -% aaaaaaaaaaaab5556aa977f5b0 -% d5555555556aaaaaaad56edb50 -% aaaaaaab6aad55b5555addf6b0 -% d555b55556d5aaaad6abb7dab0 -% aaaaaaad55555b555aaafff510 -% d55555556aaaaaab555756ea50 -% aaaaaad5ad555555556afff510 -% d555555aaaab6aad6aadabdc50 -% aaab6b55556d556aad56def510 -% d5555555aaaaab5555aab7ea50 -% ad5aaaaab5aab555aab76dddb0 -% d56aad5556ab56aab555bf7550 -% aaaad5adaab55556aaaad5fab0 -% d555555555556ab555576fead0 -% aaaaaaaaad56ad556b6abb7b50 -% d6d5555555aad5aaad56d7ea10 -% aaab6adab55aaab55555bdf550 -% d5555555aaaaad56aaaeabac10 -% aaaaab5555b5b5aad555dffa90 -% d56d5d6b6d56aab55ab6aaed30 -% daaaaaad56daad56ab5527b610 -% d5aadb75b56ad5aad5569aed50 -% aab6aaaaab56aab5556a2b5bf0 -% d555555555555b56ad5494aa90 -% fffffffffffffffffad5115bf0 -% fffffffffffffffffb5a4ed6b0 -% f7ffeff7ffbfbff7f56a9114b0 -% f488305512616c147aad14b510 -% f6b7b7baf7effff7fb55551410 -% fffffffffffffffff56d16f490 -% fffffffffffffffffaab55a210 -% d5555555555554952b6da54a50 -% d5555555555555b56aaadff510 -% db6db6db6dadb6aad6d77455f0 -% d5555555556aaad6aab5a92ab0 -% dadb6db6db5b6d5adb56d2ad50 -% d6aaaaaaaaaaab6b556b71aaf0 -% dad6db6db6d6daad6aada54a90 -% d55aaaaaaabaab55adb5749510 -% d6ab56db6dab5ab6b555a91630 -% dadab55555556b5556da505490 -% d5556db6db6dad6daaa94aaa10 -% d6b6aaaaaaaab5aab5b4105690 -% dad5b56db6db56b556a8a52ab0 -% fffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 357.165354 translate -283.464567 -357.165354 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 126 8 -% Transformation matrix -[ 100 0 0 126 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000 -00000048b33423ad2331bf0d22b50b31bf0d25b52129bd0822b50b23b50021bd0821bd0821bd08 -21bd0021bd0821bd0021bd0821bd0821bd0821bd0821bd0821bd0821bd0821bd0829bd0821bd00 -21bd0021bd0021bd0021bd0021bd0021bd0021bd0021c60021c60018bd0018c60018c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c600 -18c60021c60021c60021c60021c60018c60021c60018c60021c60018c60021c60021c60021c600 -18c60021c60018c60021c60021c60021c60021c60021c60021c60021c60021c60018c60805974b -06aa6d02946f06aa6d00955f04787005775608911a08911a05983505974b00955f00955f06aa6d -06aa6d43b66d43b66d6ec36843b66d25a75822a63223ad23000000 -00000031bf0d31bf0d31bf0d29c60029c60829c60029c60021c60029c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c600 -21c60018c60021c60021c60021c60021c60018c60021c60018c60021c60021c60021c60021c600 -21c60018c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c60800955f -06aa6d00955f00955f00955f0577560c751808911a08911a05983505974b00955f00955f06aa6d -06aa6d23a57923a57925a7586ec36850bf4f25a75848b334000000 -00000029bd0831bf0d31bf0d29c60029c60029c60821c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c600 -18c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c60018c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60805974b -00955f06aa6d00955f00955f0c751808911a185d2829312926642208911a00955f05775605974b -18a2753da88306aa6d25a75843b66d6ec36850bf4f409651000000 -00000031bf0d31bf0d31bf0d29c60829c60029c60029c60029c60029c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c600 -21c60018c60021c60021c60021c60021c60018c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021bd0800955f -02946f00955f00955f05775608911a059835333631293129253021188a0d05974b00955f05974b -43b66d43b66d25a75825a75843b66d649e6a649e6a409651000000 -00000031bf0d31bf0d31bf0d29c60829c60829c60829c60029c60029c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c600 -18c60021c60018c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60800955f -00955f00955f00955f05974b059835239a3a3336312530212931293e822705974b18a2753fa46b -43b66d43b66d3fa46b48b33489bc5aafb869a89971a58f55000000 -00000029bd0831bf0d29c60829bd0829c60829c60829c60029c60029c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c600 -21c60018c60021c60021c60021c60021c60021c60018c60021c60018c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60018c60018c600 -21c60018c60021c60018c60021c60018c60021c60021c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c60805974b -05974b05974b06aa4705974b059835239a3a4d5d572530212931293e822705974b3da88362a788 -4eb58850bf4f3fa46b91bf3bafb869ddc17eeab65ef3b50f000000 -00000031bf0d31bf0d31bf0d29c60829c60829c60829c60829c60829c60821c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -18c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c60018c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c600 -18c60021c60018c60021c60018c60021c60018c60021c60018c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c60807aa32 -05983507aa3205983507aa3205974b25a758649e6a4b572e637e2405983523a57970b68c70b68c -70b68c649e6a89bc5a91bf3bddc17eddc17ef8af56f5bd00000000 -00000023bf1131bf0d31bf0d29bd0829c60829c60829c60029c60829c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60018c60018c60021c60018c600 -21c60018c60021c60018c60021c60018c60021c60018c60021c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c60806aa47 -05974b08a62907aa323fa46b3fa46b43b66d649e6a63c74d6a92543da88370b68c88ad9788ad97 -88ad97abb37eabb37ecbb062ddc17efab77bf8af56f5bd00000000 -00000029bd0831bf0d31bf0d29c60829c60829c60821c60029c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -18c60021c60018c60021c60021c60021c60018c60018c60018c60021c60018c60021c60018c600 -21c60018c60021c60018c60021c60021c60018c60021c60018c60021c60018c60018c60018c600 -18c60021c60018c60021c60018c60021c60018c60021c60018c60021c60021c60021c60018c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021bd0850bf4f -6ec3686ec368649e6a6ec36870b68c649e6a70b68c62a78870b68c88ad9788ad978bc1a38bc1a3 -a1ad9ea1ad9e88a87acbb062d9ac7bfab77bf5af30f5bd00000000 -00000029bd0831bf0d31bf0d29bd0829bd0029c60829c60021c60029c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c600 -18bd0018c60021c60021c60021c60021c60021c60018c60021c60018c60021c60018c60021c600 -21c60021c60021c60021c60018c60021c60021c60018c60021c60018c60021c60018c60021c600 -18c60021c60021c60018c60021c60018c60021c60018c60021c60021c60021c60021c60021c600 -18c60021c60018c60021c60021c60021c60021c60021c60021c60021c60021c60029bd08afb869 -d9ac7b85c17685c17685c176649e6a4eb58862a78862a7884eb58862a7888bc1a38bc1a3a3b8af -a1ad9e929b9c8f8f7ab88d5bd9ac7bcbb062f5af30f3b50f000000 -00000029bd0829bd0831bf0d29bd0829c60829bd0829c60029c60021c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c600 -18c60021c60018c60021c60021c60021c60018c60021c60018c60018c60018c60021c60018c600 -21c60018c60021c60018c60021c60018c60021c60021c60018c60018c60018c60018c60018c600 -18c60018c60018c60021c60018c60021c60018c60021c60021c60021c60021c60021c60021c600 -21c60018c60021c60021c60021c60021c60021c60021c60021c60021c60021c60029bd08ddc17e -ddc17eabb37eabb37e85c17670b68c3fa46b23a57918a27506aa6d4eb5888bc1a3a3b8afa3b8af -a3b8afa1ad9e88ad9789bc5acbb062d99755eab65ee4ac2c000000 -00000029bd0829bd0831bf0d29c60029bd0829c60021c60029c60029c60021c60821c60821bd00 -21c60021c60021c60021c60021c60021c60021c60021c60021c60018c60021c60018c60021c600 -18bd0018c60021c60018c60021c60018c60021c60018c60018c60018c60018c60018c60021c600 -18c60021c60018c60021c60018c60021c60018c60021c60018c60018c60018c60018c60018c600 -18c60018c60018c60018c60021c60018c60021c60021c60021c60021c60021c60021c60021c600 -18c60021c60018c60021c60021c60021c60021c60021c60021c60021c60021c60021c608ddc17e -fdca81ddc17eabb37eabb37e88a87a62a7883da88323a5793da8838bc1a38bc1a3a3b8afa3b8af -a3b8afa1ad9e83959818a2754096516a92547f8a518b873b000000 -00000029bd0031bf0d31bf0d29bd0829c60029bd0829c60829bd0821c60821c60021c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60018c600 -18c60021c60018c60021c60021c60021c60021c60021c60018c60018bd0018c60018c60018c600 -21c60018c60021c60018c60021c60018c60021c60018c60021c60021c60021c60021c60021c600 -18bd0021c60021c60018c60021c60021c60018c60021c60018c60021c60018c60021c60018c600 -21c60018c60018c60021c60018c60021c60021c60021c60021c60021c60021c60029bd08abb37e -fdca81ddc17ed9ac7ba8997188a87a88a87a7d957862a78870b68c8bc1a38bc1a38bc1a3a3b8af -8bc1a3a3b8af62a78800967b06aa6d00955f05974b278c56000000 -00000029bd0829bd0831bf0d29c60029bd0029c60029bd0029c60029bd0021c60021c60021c600 -21c60021c60021c60021bd0021c60021c60021c60021c60021c60021c60021c60018c60018c600 -18bd0018c60021c60021c60021c60021c60021c60018c60018c60018c60021c60018c60018bd00 -21c60021c60018c60021c60018c60021c60018c60021c60018c60018c60018c60018c60018c600 -18c60018c60018c60018bd0018c60018c60021c60018c60021c60018c60018c60021c60021c600 -18c60021c60018c60021c60021c60021c60021c60021c60021c60021c60021c60029c608ddc17e -fdca81d9ac7bd9ac7ba8997191875d818c647d95787d957870b68c88ad978bc1a38bc1a38bc1a3 -8bc1a38bc1a34eb58800967b00955f06aa47409651497651000000 -00000029bd0029bd0829bd0029bd0029c60029bd0029c60021bd0029c60021c60021c60021c600 -21c60021c60021c60021c60021c60021c60021bd0021c60021c60021bd0021c60021bd0018bd00 -18c60021c60021c60021bd0021c60021c60021c60018c60018c60018c60021c60018c60018c600 -21c60018c60021c60018c60021c60018c60021c60018c60021c60018c60021c60821c60821c600 -18c60018bd0023bf1131bf0d31bf0d21c60818c60018c60018c60023bf1129c60821c60021c600 -21c60021c60021c60021c60021c60021c60021c60021c60021c60021c60021c60029bd08d9ac7b -fab77bd89076b88d5ba58f557f8a51816e5a818c647d95787d957870b68c88ad978bc1a38bc1a3 -8bc1a38bc1a362a7883fa46b25a75825a758278263497651000000 -00000029bd0829bd0831bf0d29bd0829bd0029c60829bd0029c60821bd0021c60021c60021bd00 -21bd0021c60023bf11239a3a29846d347382347382347382296e87296e87296e87296e87347382 -29846d239a3a21bd0821c60021c60021c60021c60021c60018c60018bd0018c60021c60021c600 -18c60021c60018c60021c60018c60021c60018c60021c60021c60018bd0063c74d70d75610c600 -10bd0023bf1163c74d63c74d63c74d21c60818bd0085c17621c60063c74d50d03810c60018c600 -18c60018c60018c60018c60018c60021c60021c60021c60021c60021c60021c60021c608d9ac7b -fab77bd89076906a58493e28493e28344833493e284b572e818c6488a87a70b68c4eb5884eb588 -4eb58870b68c62a788649e6a89bc5a7f8a518b873b927820000000 -00000029bd0029bd0831bf0d29bd0029bd0829bd0029c60829bd0029c60821c60021c60021bd00 -21c60023ad23296e87315aad315aad315aa5315aa5315aa5315aa5315aa5315aa5315aa5315aa5 -315aa5315aad296e8725b52121c60021c60021c60018c60018c60018c60018c60018c60018c600 -21c60018c60021c60018c60021c60018c60021c60021c60021c60010c60063c74d63c74d25b521 -63c74d70d75670d75685c17650d03810bd0031bf0d8bc1a350d03850d03863c74d50d03870d756 -50d03863c74d50d03870d75650d03821c60021c60021c60021c60021c60021c60021bd00cbb062 -d89076906a58333631222929213129253021213129222929344833818c6488ad974eb5883da883 -109c8423a57906aa6d48b334cfad02cfad02e4ab00e4ab00000000 -00000029bd0829bd0029bd0829bd0829bd0029c60829bd0021c60829bd0021c60821bd0821c600 -23ad23296598315aad31629c31629c31629c315aa5315aa5315aa5315aa5315aa5315aa5315aa5 -315aad31629c315aa5296e8721b51821c60021c60018c60018c60018c60018c60018c60018c600 -21c60021c60018c60018bd0018c60018bd0021c60021bd0021c60010bd0050d03870d75670d756 -63c74d50bf4f70d75670d75650d03810bd0050d03863c74d70d75650d03870d75670d7566cc951 -70d75670d75650d03885c17631bf0d21c60021c60021c60021c60021c60021c60021bd00d9ac7b -d8907633363125302129312929312929312929312926393125302160604288a87a70b68c23a579 -06aa6d06aa6d06aa6d90b112cfad02cfad02f5bd00f5bd00000000 -00000021bd0029bd0829bd0829bd0821bd0829bd0821c60029bd0021c60821c60021c60021bd00 -287b7b315aa531629c3163a5315aa5287b7b23ad2322a63223ad2323ad2323ad2323ad2321a427 -27826331629c31629c315aad278c5621c60018bd0018c60018bd0018c60018c60018c60018c600 -18bd0018c60021c60021c60018c60018c60018bd0018c60021bd0010bd0050d03863c74d63c74d -63c74d50d03850d03863c74d31bf0d23bf1150d03823bf1170d75670d75650d03885c17670d756 -50d03870d75648b33470d75621c60818c60021c60021c60021c60021c60021c60021bd00b88d5b -7f5a5822292929312929312929312929312929312929312925302160604288a87a70b68c3da883 -109c8406aa6d05974b90b112cfad02f5bd00f5bd00f5bd00000000 -00000022b50b29bd0829bd0821bd0029c60021bd0029c60021c60029bd0021c60821c60023ad23 -3163a531629c3163a531629c315aad27826321ce0018c60018c60018c60018c60018c60018c600 -18ce00239a3a315aa531629c296e8723bf1118c60018bd0018c60018c60018c60018c60018c600 -18bd0021c60018c60018bd0018c60018bd0021c60021c60010bd0050d03870d75629c60810c600 -29c60818c60021c60018c60021c60018c60021c60021c60021c60018c60025b52170d75663c74d -29c60818c60021ce0018c60021c60021c60021c60021c60021c60021c60021c60021c600b88d5b -5c4c512229292931292931292931292931292931292131292530217f8a518f8f7a70b68c23a579 -06aa6d06aa6d05974b90b112cfad02e4ab00f5bd00f5b500000000 -00000029bd0829bd0829bd0829bd0029bd0829c60021bd0029c60021c60029bd0821c600299452 -315aa53163a531629c31629c315aa529846d21c60021bd0018bd0018c60018bd0018c60018bd00 -18c60021b518296e87315ab52963a623ad2318c60018c60018bd0018c60018c60018c60018c600 -18c60018c60018c60018c60021bd0018c60021c60018c60018c60021c60021c60018bd0018c600 -18c60018c60018c60018c60018c60018c60018c60018c60021c60021c60029c60031bf0d29c608 -18c60021c60018c60021c60018c60021c60021c60021c60021c60021c60021c60029c60091875d -333631253021293129293129293129293129293129253021493e2891875da8997170b68c3da883 -18a27518a275239a3a8e8c16cfad02e4ab00e4ab00f2ad00000000 -00000023b50029bd0831bf0d29bd0829c60029bd0829c60021c60029c60021c60821c600278c56 -3163ad3163a53163a531629c3163ad29846d21c60021c60018bd0018c60018c60018bd0018c600 -18bd0018c60022a632239a3a239a3a23bf1118c60018bd0018c60018bd0018c60021bd00278c56 -287b71287b7123ad2321c60018c60021c60018c60021c60021c60018c60018bd0018c60018bd00 -18c60021bd0018c60021b518287b7b34738229846d23bf1118c60021c60018c60018c60018c600 -21c60018c60021c60021c60021c60021c60021c60021c60021c60021c60021c60029c60091875d -3336312530212931292931292931292530212931292229296a5922a58f558f8f7a88a87a3da883 -25a75825a7584096518e8c16c2920acfad02e4ab00e4ab00000000 -00000021bd0029bd0829bd0029c60021bd0029c60021bd0029c60021bd0021bd0821c600278c56 -315aad3163a53163a531629c3163a529846d18c60021bd0021c60018bd0021bd0018c60018bd00 -18c60018bd0018c60021ce0021ce0021c60021bd0018c60018bd0021c60018c60021c608287b7b -3152ae315aad22a63221c60021c60021bd0018c60018bd0018bd0021c60018c60018bd0018c600 -18bd0018c60018c60023ad2331629c3152ae29659818bd0818c60021c60021c60021c60021c600 -18bd0018c60018bd0018c60021c60021c60021c60021c60021c60021c60021c60029bd00a47953 -3336312530212931292530212931292931292931292530216a5922a58f55a8997188a87a3fa46b -3fa46b3fa46b617e3e637e24927820927820966b1d927820000000 -00000021bd0029bd0829bd0029bd0029c60029bd0021c60021bd0029c60021bd0021c600278c56 -3163ad3163a53163a531629c315aa529846d21c60021c60021bd0021c60021c60021c60018c600 -18bd0021c60021bd0021c60021bd0021c60021c60018c60018c60018bd0018c60018bd00287b7b -315aa529659821a42721c60021c60018c60018bd0018c60018bd0018c60018bd0018c60018bd00 -18c60018bd0018c60025b521296598315aa5296e8721bd0818c60018c60018c60018c60021c600 -18c60018bd0018c60018bd0018c60021c60021c60021c60021c60021c60021c60021bd00b88d5b -5c4c51222929253021293129253021253021213129493e2896733ab88d5ba899717d95783fa46b -3fa46b6a92546a9254617e3e3b54533b5453244d50244d50000000 -00000021bd0829bd0029bd0829c60029bd0029c60029bd0021c60021bd0029c60021c600278c56 -3163ad3163a53163a53163a53163a529846d21c60021c60021c60021c60021c60018c60018bd00 -18c60021c60021c60021c60021c60021c60018bd0021c60018c60018c60018bd0021c608287b7b -315aa5295aa522a63218c60018bd0018c60018c60018bd0018c60018bd0018c60018bd0018c600 -18bd0018c60018c60023ad23296598315aa5296e8721bd0818c60018bd0018c60021c60018c600 -18bd0018c60018bd0018c60021c60018c60021c60021c60021c60021c60021c60021bd00b88d5b -7f5a582229292530212530212931292931292530216a5922a47953b88d5ba89971649e6a3fa46b -649e6a6a925468725168725149765126642218605c244d50000000 -00000023b50029bd0829bd0021bd0021bd0029bd0821c60021bd0029c60021bd0018c600299452 -315aad31629c3163a531629c315aad29846d18c60021bd0018bd0021c60018c60021c60021c600 -18bd0018c60021c60018c60021c60021bd0021bd0018bd0018c60018bd0018c60018bd08287b7b -315aa52963a622a63218c60018bd0018bd0018bd0018c60018bd0021c60018bd0018bd0018bd00 -18c60018bd0018c60023ad23296598315aa5296e8721b51818c60018bd0018bd0018bd0018bd00 -18c60018bd0018c60018bd0018c60021c60021bd0021c60021c60021c60021c60021bd00cbb062 -d890763336312530212639312530212931292530218c5e20a58f55b88d5ba58f55649e6a6a9254 -6a92547f8a516872516060423b545318605c244d500d5549000000 -00000023b50029bd0829bd0029bd0821bd0029c60821bd0021c60021bd0021c60021c600299452 -3163a53163a53163a531629c3163ad287b7121c60021bd0021c60018c60021c60021c60018c600 -18c60021c60021c60021c60021bd0021c60021c60018ce0018c60018c60018c60018c600287b71 -315aa5315aa522a63218ce0018c60018c60018c60018c60018c60021c60018c60018c60018c600 -18c60018c60018ce0021b518296e87315aa5296e8721bd0818c60021c60018c60018c60018c600 -18c60018c60018bd0018c60021c60018c60021c60021c60021c60021c60021c60021bd00b88d5b -fab77b906a58333631253021253021213129493e2896733aa47953a58f5591875d649e6a6a9254 -8b873b8b873b687251497651244d503b54533b54533b5453000000 -00000029bd0029bd0829bd0021c60029bd0829c60021c60029bd0021c60029bd0021c600299452 -315aa531629c31629c3163a53163a529846d21c60021c60021bd0021bd0021c60021c60021c600 -18bd0021c60021c60021c60021c60023bf11299452299452299452299452299452299452296e87 -315aa531629c29846d299452278c56278c56278c56278c56239a3a18c60023ad23278263278263 -278c56278263278c5629846d296598315aa529659829846d27826329846d27826329846d29846d -18b51818c60018bd0018c60018c60021c60021c60021c60021c60021c60021c60021c600cbb062 -d89076d89076906a58493e28493e28333631493e2896733aa4795391875d818c647f8a517f8a51 -7f8a517f8a516060424b572e9278208e8c16c2920ac2920a000000 -00000022b50b29bd0829bd0821bd0021bd0021bd0029c60021c60021bd0021bd0818c600299452 -3163ad3163a53163a53163a53163a5287b7121c60021bd0021c60018c60018bd0018c60018bd00 -18c60018bd0021bd0021c60018c60025b521296598315aad315aa5315aad315aad315aad315aa5 -3163a53163a5295aa5315aad315aad315aad3152a5315ab527826318ce00239a3a315ab5295aa5 -295aa5315aad3152ae315aad315aa531629c315aa53152a53152ae315aa53152a5315aa53152ae -189d2e18c60018c60018bd0021c60018c60021c60021c60021c60021c60021c60021bd00afb869 -fab77bd9ac7bd89076a2826791875d816e5a8b873b91875d91875d7f8a516a92547f8a517f8a51 -7f8a517f8a514d5d57637e24c2920acfad02e4ab00e4ab00000000 -00000021bd0029bd0829bd0821bd0021bd0021bd0021bd0029bd0021bd0021c60021c600299452 -315aad3163a53163a53163a53163a5287b7b18c60021bd0018bd0018c60018c60018bd0018c600 -18bd0021c60021c60021bd0021c60025b52131629c315aa5315aa5315aa5315aa5315aad295aa5 -3163a5315aa5315aa5315aad315aad315aa5315aa53152ae27826318ce00239a3a315ab5315aad -315aad295aa5315aa5315aad31629c31629c315aa5315aa5315aa5315aad315aa5315aad315aad -22a63218c60021bd0018c60018bd0021c60021c60021c60021c60021c60021c60021bd00afb869 -fdca81d9ac7babb37ea899718f8f7a818c64818c64818c64818c647f8a516a92547f8a516a9254 -7f8a51816e5a497651927820cfad02e29602e4ab00f5b500000000 -00000021bd0029bd0829bd0821bd0021bd0021bd0029c60821bd0021bd0021bd0821c600299452 -315aa53163a53163a531629c315aa5287b7121c60018bd0021c60018bd0018c60018c60018bd00 -18c60021c60021c60021c60021c60021b518278263287b71287b71287b71287b71287b71296e87 -315aa52963a6287b7b278263278263278263278263278263239a3a18c60022a632278263278c56 -278263278c56278c56278263296598315aa5296598278263278c56278c56278c56278c56278c56 -18b51821c60018bd0018c60018c60018bd0021c60021c60021c60021c60021c60021bd00afb869 -ddc17eabb37eabb37e88a87a8f8f7a818c647d95786a92546a92546a92546a92546a9254687251 -687251576d67497651927820cfad02e4ab00f5b500f5b500000000 -00000022b50b29bd0821bd0021bd0021bd0021bd0021c60021c60821c60021bd0821c600299452 -315aad31629c3163a53163a53163a5287b7b18c60021bd0018bd0018c60018bd0018bd0018c600 -18bd0021c60021c60021c60021c60021c60018c60018c60018c60018c60018c60021c600287b71 -315aa5295aa522a63218ce0018c60018c60018c60018c60018c60018bd0018c60018c60018c600 -18c60018c60018ce0021b518296e87315aa5296e8718bd0818c60018c60018c60018c60018c600 -18bd0018bd0018c60018bd0018bd0018c60021c60021c60021c60018bd0021bd0021c6006ec368 -abb37eafb86985c17688a87a649e6a3fa46b278c56278c56278c5642863d3e8227617e3e497651 -49765127826318605c8e8c16c2920acfad02e4ab00f5b500000000 -00000022b50b29bd0829bd0821bd0029bd0029c60821bd0821bd0021bd0021c60821c600299452 -315aa53163a53163a53163a53163a5287b7b21c60018bd0021bd0018c60018bd0018c60018bd00 -18c60021bd0021c60021c60021c60021c60021c60018bd0018c60021bd0018c60021c600287b71 -315aa52963a6239a3a18c60018bd0018c60018bd0018bd0018bd0018c60018bd0018bd0018bd00 -18bd0018bd0018c60021b518296598315aa529659821b51818c60018bd0018c60018bd0018bd00 -18c60018bd0018c60018c60018c60018bd0021c60021c60021c60021c60018bd0021bd0043b66d -06aa6d43b66d43b66d06aa6d06aa6d01877b02946f047870057756186d16186d163e8227497651 -2782632782630c5a6c637e24c2920ac2920ae4ab00e4ab00000000 -00000023b50029bd0829bd0029bd0029bd0021bd0021bd0021bd0021bd0021bd0021c600299452 -315aad31629c3163a53163a53163a5287b7b21c60021bd0018bd0018c60021c60018bd0018c600 -18bd0021c60021c60021c60021c60021c60021c60018c60018bd0018c60018bd0021c600287b71 -315aa52963a622a63218c60018c60018bd0018c60018bd0018c60018bd0018c60018bd0018c600 -18bd0018bd0018c60025b521296e87315aa5296e8718b51018c60018bd0018c60018c60018c600 -18bd0018c60018bd0018c60018bd0018c60021c60021bd0021c60021bd0021c60018bd0006aa47 -06aa6d06aa6d06aa6d06aa6d02946f02946f057756057756185d2825463b25463b185d28247952 -27826304787018605c4976518e8c168e8c16c2920ac2920a000000 -00000023b50029bd0021bd0021bd0021bd0029c60021bd0021c60021bd0021bd0021c600299452 -3163a53163a53163a53163a53163a5287b7121c60021c60821c60021bd0018bd0021c60018bd00 -18c60021c60021bd0021c60021bd0021c60018bd0021bd0018c60018bd0018bd0018c600287b71 -2963a62963a6239a3a18c60018bd0018c60018bd0018c60018bd0018c60018bd0018c60018bd00 -18bd0018bd0018c60021b518296598315aa5296e8718b51018c60018bd0018bd0018bd0018c600 -18bd0018bd0018bd0018bd0018bd0018bd0021c60018c60018c60021c60021c60018ce0010c631 -25a75806aa6d06aa6d06aa6d06aa6d05974b05974b0d5549244d5025463b25463b0d5549057756 -04787004787004787004787018605c3b54533b54534a4e50000000 -00000021bd0029bd0829bd0029bd0029c60029bd0029c60021bd0021bd0021bd0021c600299452 -3163a53163a531629c31629c315aa5287b7b21c60021bd0018bd0018c60021c60018bd0018c600 -18bd0021c60021c60021c60021c60018c60021bd0018c60018bd0018c60018bd0018c600287b71 -315aad295aa5239a3a18c60018bd0018bd0018c60018bd0018c60018bd0018c60018bd0018c600 -18bd0018c60018c60021b518296598315aa529659818b51018c60018c60018bd0018bd0018bd00 -18bd0018c60018c60021c60021ce0018ce0018c60021c60021bd0018a80818a80818a80808911a -08911a2479520577560d55490d5549104821266422263931213131213131213131183e33183e33 -0d55490d55490d55490d55490d554918605c0d5549244d50000000 -00000023b50029bd0029bd0829c60029bd0029c60021bd0829c60021bd0021c60821c600299452 -3163ad31629c3163a531629c3163ad287b7121c60018bd0021bd0018bd0018bd0018c60018bd00 -18c60018c60021b51821b51823ad2321bd0818c60018bd0018c60018bd0018c60018c600278263 -29659829659822a63218c60018bd0018c60018bd0018c60018bd0018c60018bd0018c60018bd00 -18c60018bd0018c60021b518287b71296e87287b7118b51018c60018bd0018c60018c60018ce00 -18c60021bd0018a80818a8080c7518186d16266422184418103521103521182121182121181821 -181821181c18181c18182121181c18181821101821181821102121102118102121182121182121 -182121182121182121182121182121182121182121182121000000 -00000023b50029bd0029bd0021bd0021bd0021bd0021bd0021bd0021bd0821bd0018c600299452 -3163a53163a53163a531629c295aa5287b7b18bd0021bd0018bd0018bd0018bd0018bd0018bd00 -18bd0021bd08287b7b3163ad29659822a63218c60018bd0018bd0018bd0018bd0021bd0018bd08 -18bd0818bd0818bd0818bd0018bd0018bd0018c60018bd0018c60018c60018c60018bd0018bd00 -18bd0018bd0018bd0018c60018bd0018bd0018bd0018c60018ce0018c60018b507188a0d0c7518 -185d28184418182921182129181821181821181821182129182121182121182121182121182121 -213129182921182921182921182929182921182121182921182929182121102121101821182921 -182929182921182121182121182121182921182921182921000000 -00000021bd0029bd0029bd0029bd0021bd0021bd0021bd0021bd0021bd0021bd0018c60022a632 -3163a531629c31629c2963a62963a6287b7b21c60018bd0018bd0018bd0018bd0018bd0018bd00 -18ce0022a63231629c3163a529659823ad2318c60018bd0018c60018bd0018c60018bd0018c600 -18c60018c60018bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018c60018ce0018c60018a8080c7518185d28182921182121181821 -181821182121182129182921182921182121182921182921182121182921182121222929576d67 -6c76721829211821211821211821211821211829211021216c76727d81826c7672364742102118 -1821211829211829211021211018214d5d57707d7b101821000000 -00000023b50021bd0829bd0021bd0021bd0021bd0021bd0021bd0021bd0021bd0018c60021b518 -296e873163a52965983163a53163ad287b7b18bd0021bd0018bd0021bd0018bd0021bd0018bd08 -22a632296e872963a63163a5287b7b18bd0821bd0018bd0018bd0018bd0018bd0018c60018bd00 -18bd0018bd0018c60018bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018c60018c60018b5070c7518184418182921181821181821182121182121182921 -182921182121182121182121182121182121182921182121182921182929081821707d7b4d5d57 -1018212131291821212131292131312131291829290c1716818c8c39494f7d81826c76720c1716 -2931311821211829293336311021216c7672576d67102118000000 -00000023b50021bd0029bd0021bd0021bd0029bd0821bd0021bd0021bd0018bd0021bd0018c600 -239a3a315aad3163a531629c3163a5296598296e87296e87296e87296e87296e87296e87296e87 -3163a5295aa53163a52963a6189d2e21c60018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018c60018b507186d16103521181821182129102121182921182921182121182121182121 -182121182121182121182921182121182921182121182921182121182121293131a3b8af5f6266 -636f6b6c76724a4e50839598707d7b4a4e50102121182121929b9c84948c636f6b222929576d67 -84948c333631576d67929b9c39494f818c8c263931182121000000 -00000023b50021bd0021bd0821bd0021bd0021bd0021bd0021bd0021bd0021bd0018bd0821bd00 -21c608278c562963a63163ad3163a53163a53163a5315aa53163a53163a53163a5315aa5315aa5 -2963a6315aa52963a6239a3a21c60018bd0021bd0018c60018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018c60010bd0018bd0018bd00 -18c600188a0d184418181821182121182921182921182121182921182121182921182121182121 -1821211821211829211821211821211821211829211821211829291821212639317d81824d5d57 -6c76726c76725f6266929b9c2131291821211821213336318c9794929b9c4d5d57263931929b9c -333631636f6b6c7672818c8c39494f8c9794222929182921000000 -00000023b50021bd0829bd0021bd0021bd0021bd0021bd0021bd0021bd0018bd0021bd0018bd08 -18c60021c600239a3a296e872965982963a63163a52963a6295aa53163a5315aa52963a62963a6 -296598287b7123ad2321c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -188a0d182921182129182921182921102121182921102121182121182921182121182921182121 -1821211821211821211829211821211829211821211829291829211018214a4e50707d7b364742 -7d8182636f6b576d67636f6b1018211829291018215d727c84948c364742929b9c4a4e50929b9c -22393e84948c818c8c707d7b576d6784948c182921222929000000 -00000022b50b21bd0029bd0821bd0021bd0021bd0021bd0021bd0021bd0021bd0018bd0021bd00 -21bd0018bd0021c60021c60025b52121a42722a63221a42721a42721a42721a42721a42723ad23 -18b51018c60018c60018bd0018c60018bd0018bd0018bd0018bd0018bd0010bd0010bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0010c60022b50b -103521182121182921182121182921182121182921182121182921102118182121101821182121 -1829211821211829211821211821211821211829211829212229290c1716636f6b4d5d570c1716 -364742182921222929222929182121182921182921293131263931222929293131213129333631 -213129213129213129182929222929222929182921182929000000 -00000023b50021bd0829bd0821bd0021bd0021bd0021bd0021bd0021bd0018bd0018bd0018c600 -18bd0018c60018bd0021bd0018c60018c60018c60018c60018c60018c60018c60018c60018c600 -18c60018bd0018bd0018bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018bd0018c600 -18bd0018bd0018bd0018bd0018bd0018bd0018c60018bd0018bd0010c60010bd0018c600188a0d -182121182929182921182929182121182921182929182121333631839598636f6b5f6266102121 -1821211821211821211821211829211821211821211829211021184d5d57636f6b182921102121 -101821182121102121182121182921182121182121102118101821182121102118102121182121 -182121182121102121102118182121102121182121182121000000 -00000022b50b21bd0829bd0821bd0021bd0021bd0021bd0021bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018c60021bd0021bd0021bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18c60018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0010bd0018bd0010c60018a808 -182921182121182921182121182929182121182921102121364742929b9c182121a3b8af293131 -182921213129182121213129102121182921213129222929222929263931293131102118293131 -293131213129293131293131222929293131182929263931293131213131213131293131102118 -29313122292926393133363122393e263931293131182121000000 -00000022b50b21bd0821bd0821bd0021bd0021bd0021bd0021bd0021bd0018bd0018bd0018bd00 -18bd0018c60018bd0021bd0021c60018c60018bd0018bd0018bd0018bd0018bd0018bd0018c600 -18bd0018c60018bd0018bd0018bd0021bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0010bd0010bd0018bd0018c608 -186d161818211829291829211821212229292229290818215f62668c9794576d67707d7b6c7672 -7d81825d727c636f6b707d7b3647425d727c707d7b6c7672738085818c8c636f6b39494f7d8182 -818c8c636f6b8c9794818c8c7d8182929b9c4d5d57929b9c7d81828c97948c9794576d674a4e50 -8c9794576d678c9794707d7b6c767273808539494f182121000000 -00000022b50b22b50b21bd0021bd0021bd0021bd0021bd0018bd0021bd0018bd0018bd0018bd00 -18c60018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0010bd0018bd0018bd0010c600 -18bd00186d161821211821291829211829212131290c17167d8182576d6722292910182184948c -4d5d57364742707d7b636f6b707d7b636f6b7d81823336318c97944a4e50293131707d7b818c8c -3b5453707d7b707d7b818c8c707d7b7d81823647428c9794707d7b7d8182818c8c4a4e50929b9c -36474239494f929b9c1021182639318c9794182121182921000000 -00000022b50b21bd0829bd0821bd0021bd0021bd0021bd0021bd0018bd0018c60018bd0018bd00 -18bd0018c60018bd0021c60821c60021c60818bd0018bd0018bd0018bd0018bd0018bd0018c600 -18bd0018bd0018bd0018bd0018bd0021bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018c60018bd0018bd0018bd0018bd0018c60018bd0010bd0010bd0010bd0018bd00 -10c60018c600188a0d184418182129182129182121222929a3b8af3647421021182131298c9794 -102118364742707d7b6c7672293131929b9c4d5d5721312984948c0c1716636f6b818c8c929b9c -3647427d81824d5d57636f6b6c76725f6266636f6b5f62666c76724d5d5784948c3647428c9794 -3647424d5d57576d671021215d727c636f6b222929182121000000 -00000023b50021bd0829bd0821bd0021bd0021bd0021bd0021bd0021bd0018bd0018c60018bd00 -18c60018bd0021c60021bd0021bd0821bd0018c60018bd0018bd0018bd0018bd0018bd0018bd00 -18c60018bd0018bd0018bd0021bd0018bd0021bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0010bd00 -18bd0010bd0018c60018c608188a0d104e17182921212931364742293131182121222929213129 -1821211821213336311829294d5d57636f6b8c97943b5453182121182121222929293131222929 -182921222929182929182121213129182121182921182121182929182121182921101821293129 -222929182121182121182121293131182121182121182921000000 -00000023b50029bd0829bd0821bd0021bd0021bd0021bd0021bd0821bd0821c60018bd0018bd00 -18bd0021c60018c60021bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018bd0018c600 -18bd0018bd0018bd0018c60018bd0021bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -18bd0018c60018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -10bd0018bd0018bd0018bd0018c60018c60018a8080c7518104e17103521182121181821181821 -1821211829291821211829216c7672364742576d67333631102118182921182121182121182121 -182121182121102121182121102121182921182121182121182121102121182121182121102121 -182121182121182121182121102121182121182921182921000000 -00000022b50b21bd0829bd0821bd0021bd0021bd0021bd0021bd0021bd0021c60818c60018bd00 -18bd0018bd0018bd0021bd0021bd0021bd0018c60018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0010c60018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0010bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018c60018ce0021c60018b507188a0d0c751810601b -103521182921182129182129101821252f39182121101821182121182121182921182921182121 -182921182121182121182921182121182921182121182121182121182121182121182921182121 -182121182121182121182121182121182121182129182129000000 -00000022b50b21bd0821bd0821bd0021bd0021bd0821bd0021bd0821bd0821c60821bd0818bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c60018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -10bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c60018ce0021ce0021c600 -18bd0018a808188a0d0c7518186d16104e17184418103521182921182121182121181821081821 -081821081821081821081821081821101821102118102121182121101821081821101821101821 -102121182121182121102121102121182921222929253021000000 -00000022b50b21bd0821bd0821bd0021bd0821bd0021bd0821bd0821bd0821bd0821c60821bd08 -18c60018bd0018c60018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -18bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018bd0010bd0018c60018bd0018bd00 -18bd0018bd0010bd0018c60010bd0010bd0018c60018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018c60018ce0021ce0018ce0021ce0021c60018bd0018a80818a80818a808188a0d637e24 -966b1d8c5e206a59226a59226a592234483325463b1829311829213448334b572e4b572e4b572e -4b572e23395122393e6a59228e8c16c2920acfad02e4ab00000000 -00000022b50b22b50b21bd0821bd0818bd0021bd0821bd0021bd0821bd0018c60818bd0018bd00 -18bd0018c60018bd0018c60018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018c60018bd0018c60018bd0018c60010bd0018c60010bd0018c60010bd00 -18bd0018bd0018bd0010c60018bd0018c60018bd0018bd0018bd0010bd0010bd0010bd0010bd00 -10bd0010bd0018bd0010bd0018bd0010bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018c60018c60018c60021c60010c60090b112 -f2ad00f2ad00f2ad00d0780ac2920a88a87a29846d184d65263931266422637e2418a808637e24 -816e5a2345692345696a5922e4ab00e29423e4ab00f5b500000000 -00000022b50b21bd0821bd0821bd0021bd0821bd0021bd0821bd0018bd0818bd0018c60818bd00 -18c60018bd0018c60018bd0018c60018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018c60010bd0018c60018bd0018c600 -18bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018bd0010bd0010bd0010bd0018bd00 -10bd0018bd0010bd0018bd0010bd0018bd0010c60018bd0018bd0018bd0018c60018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0021bd0018bd0090b112 -e29602f5af30f5af30bf912e8b873b91875d649e6a18605c2339512931310c751808911a239a3a -655d513b5453234569584b42927820c2920ac2920ac2920a000000 -00000022b50b22b50b29bd0821bd0821bd0021bd0821bd0021bd0821bd0018c60818bd0018c608 -18bd0018c60018bd0018c60018bd0018c60018bd0018bd0018bd0018c60018bd0018c60018bd00 -18bd0018bd0018c60018bd0018bd0018bd0018bd0018c60010bd0018c60018bd0018bd0018bd00 -18c60018bd0018c60018bd0018bd0018bd0018bd0018bd0018bd0010c60010bd0018c60010bd00 -18bd0010bd0018bd0010bd0018bd0010bd0018bd0018bd0018c60018bd0018bd0018c60018bd00 -18bd0018bd0018bd0018bd0018bd0018c60018bd0018c60018bd0021bd0021bd0018bd0090b112 -f8af56f8af56f8af56f8af5689bc5a649e6a7d957818605c224255293129185d28059835239a3a -4d5d573b54534e5c70184d6539494f3647425c4c514a4e50000000 -00000022b50b21bd0821bd0821bd0021bd0021bd0821bd0021bd0021bd0018bd0818c60818bd00 -18c60018bd0018c60018bd0021c60818bd0018bd0018bd0018bd0018bd0018bd0018bd0018c600 -18bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018bd0018bd0018c60010bd0018c600 -10bd0018c60010bd0018c60018bd0018bd0018c60018bd0018bd0010bd0010c60010bd0018bd00 -10bd0018bd0010bd0018bd0010c60018bd0010c60018bd0018bd0018bd0018c60018bd0018bd00 -18bd0018bd0018c60018bd0018c60018bd0018bd0018bd0018bd0018bd0021bd0018bd0091bf3b -f8af56eab65ef8af56f9b4667d95783fa46b8f8f7a29846d184d65252f39185d28059835189d2e -5f62665f6266687251655d513b5453244d50687251655d51000000 -00000022b50b21bd0829bd0821bd0021bd0821bd0018bd0021bd0018bd0818c60018bd0818bd00 -18bd0018c60018bd0018c60818bd0018bd0018c60018bd0018c60018bd0018bd0018bd0018bd00 -18c60018bd0018c60018bd0018bd0018c60018bd0018c60018bd0018bd0010bd0018c60010bd00 -18c60010bd0018c60018bd0018c60018bd0018bd0018c60010bd0018bd0010bd0018bd0010bd00 -10bd0010c60010bd0010c60018bd0010c60018bd0018bd0018bd0018bd0018bd0018c60018bd00 -18bd0018bd0018bd0018c60018bd0018c60018bd0018c60018bd0018bd0021c60010bd0091bf3b -f9b466eab65eeab65ef9b466a899713fa46b649e6a576d67184d65252f39185d28059835239a3a -576d67655d517f5a58816e5a816e5a4a4e50606042906a58000000 -00000022b50b21bd0821bd0821bd0018bd0021bd0818bd0818bd0821bd0818bd0818c60818bd08 -18c60018bd0018c60018bd0818bd0018bd0818bd0018c60018bd0018c60018bd0018bd0010c600 -18bd0018c60018bd0018c60018bd0018bd0018bd0018bd0010c60010bd0018c60010bd0018c600 -10bd0018c60010bd0018bd0018bd0018c60010bd0018c60010bd0010bd0018bd0010bd0010bd00 -10bd0018bd0010c60010bd0010c60010bd0010c60018bd0018bd0018bd0018c60018bd0018bd00 -18bd0018bd0018bd0018bd0018c60018bd0018c60018bd0018c60018bd0021bd0010bd0091bf3b -fdca81f9b466fab77bfab77bd9ac7b88a87a818c64649e6a184d65252f39185d28059835189d2e -5f6266655d51816e5a906a587f5a585c4c514a4e50606042000000 -00000018b51022b50b21bd0821bd0821bd0818bd0821bd0821bd0821c60823bf1118bd0818bd08 -18bd0818bd0018bd0818bd0018bd0818bd0018bd0018bd0018bd0018bd0018c60818c60018bd00 -10c60018bd0018c60018bd0018c60018bd0018bd0018bd0010bd0018bd0010bd0018c60010bd00 -18c60010bd0018c60010bd0018c60010bd0018c60010bd0018c60010bd0010bd0010bd0018bd00 -10bd0010bd0010bd0010bd0010bd0010c60010bd0010c60018bd0010c60018bd0018bd0018bd00 -18bd0018bd0018bd0018c60018bd0018c60018bd0018bd0018bd0018bd0018c60010bd0091bf3b -fdca81ddc17efab77bfab77bd9ac7ba8997191875d649e6a234569293131185d28059835239a3a -687251655d5184603a96733a9b643884603a84603a84603a000000 -00000018b51021bd0821bd0821bd0018bd0821bd0818bd0821bd0821bd0818bd1018bd1018bd08 -18c60818bd0818c60818bd0818c60018bd0818bd0018bd0018bd0018bd0018bd0018bd0818c600 -18bd0018bd0018bd0018c60018bd0018c60018bd0010bd0010bd0010bd0018c60010bd0018c600 -10bd0018c60010bd0018bd0010bd0018bd0010bd0018bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010c60010bd0010c60018bd0018bd0018bd0018bd0018c60018bd00 -18c60018bd0018c60018bd0018c60018bd0018bd0018bd0018bd0018c60021bd0010bd0091bf3b -fdca81fdca81fab77bfab77bd9ac7ba89971a58f55818c643b5453252f39185d28059835239a3a -687251816e5a5c4c519b6438c2920ae29602e29602e29602000000 -00000018b51022b50b21bd0821bd0818bd0821bd0821bd0818bd0821bd0818bd1018c60818bd08 -18bd0818c60818bd0818c60818bd0818c60818bd0018bd0018bd0018bd0018bd0818c60018bd08 -10c60018bd0018bd0018bd0018c60018bd0018bd0018bd0010bd0010bd0018bd0018c60010bd00 -18c60010bd0018bd0010bd0018bd0010bd0018c60010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010c60010bd0018bd0018bd0018bd0018c60018bd0018c600 -18bd0018c60018bd0018c60018bd0018c60018bd0018bd0018bd0021bd0021c60010bd0089bc5a -fdca81fdca81fab77bd9ac7beab65ecbb06296733a91875d385777212931185d28059835239a3a -636f6b5f62665f6266966b1de29602cfad02f2ad00f2ad00000000 -00000022b50b21bd0821bd0821bd0818bd0821bd0818bd0821bd0818bd0818c60818bd0818bd08 -18bd0818bd0821c60818bd0818c60818bd0818c60810bd0818bd0010bd0018c60018bd0810c600 -18bd0010bd0018c60010bd0018bd0818bd0018bd0010c60010bd0010bd0010bd0010bd0018c600 -10bd0010bd0010bd0018bd0010bd0018bd0010bd0018bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018c60010bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018c60018bd0018c60021bd0021bd0010bd0091bf3b -fdca81ddc17efab77bfab77bcbb062d99755bf912e91875d4e5c70212931185d28059835239a3a -816e5a6c767239494f966b1de4ab00e4ab00f5b500f5b500000000 -00000022b50b21bd0821bd0821bd0821bd0818bd0821bd0818bd0821bd0818bd0818bd0818bd08 -18c60818bd0818bd0818c60818bd0818bd0818bd0018c60010bd0018bd0010bd0010bd0018bd00 -10bd0018bd0010bd0018c60018bd0018bd0018bd0010bd0010bd0010bd0818c60018bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0018bd0018bd0018bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010c60010bd0010c60010bd0010bd0018bd0018c60018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018c60018bd0018c60018bd0021bd0021c60010bd0089bc5a -fdca81fdca81fab77beab65ed99755e29423c2920aa58f55385777252f39185d28059835239a3a -7f8a51818c644e5c70966b1de4ab00e4ab00f5b500f5bd00000000 -00000018b51021bd0821bd0821bd0818bd0821bd0818bd0821bd0818bd0818bd0818bd0818bd08 -18bd0818c60818bd0818bd0818bd0818bd0018c60010bd0018c60010bd0018bd0010bd0018c608 -10bd0010bd0018bd0010bd0018bd0018bd0018bd0010bd0010bd0010bd0010bd0010c60018bd00 -10bd0010bd0010bd0018bd0010bd0018bd0018bd0018bd0018bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010c60010bd0010c60018bd0010c60018bd0018bd0018bd0018bd00 -18bd0018bd0018bd0018bd0018bd0018bd0018bd0018bd0018c60018bd0021bd0010bd0091bf3b -fdca81fab77bf9b466f9b466f8af56e29423c2920aa479534e5c70293131185d2805983521a427 -816e5a91875d4e5c708c5e20e29602e4ab00e4ab00f5b500000000 -00000018b51022b50b21bd0821bd0821bd0823bf1121bd0818bd0821bd0818bd0818bd0818bd08 -18bd0818bd0818bd0818c60818bd0818bd0818bd0018c60010bd0018bd0010bd0018bd0010bd08 -18bd0010bd0018c60018bd0010c60018bd0010bd0010bd0010bd0810bd0010bd0010bd0010bd00 -18bd0010bd0018bd0010bd0818bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010c60018bd0010c60018bd0010c60018bd00 -18bd0018bd0018bd0018bd0018bd0018c60018bd0018bd0018bd0018bd0021c60010bd0091bf3b -fdca81ddc17ef9b466f8af56e29423d0780abf912ea58f554e5c70252f39266422059835617e3e -816e5a6c76724e5c706a5922e29423e29423f2ad00f2ad00000000 -00000022b50b21b51818bd0821bd0818bd0821bd0818bd0821bd0818bd0818bd1018bd0818bd08 -18c60818bd0818c60818bd0818bd0818bd0818bd0810bd0818bd0010bd0018c60010bd0818c608 -10bd0818bd0818bd0818bd0818bd0818bd0818bd0818bd0810bd0818bd0818bd0818bd0018bd08 -10bd0018bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0018bd0010bd00 -18bd0010bd0018c60018bd0018bd0018bd0018bd0018c60018bd0018bd0021bd0010bd0091bf3b -fab77bf9b466f9b466f8af56cc742dd0780abf912ea282673b545325463b637e248b873b8b873b -8b873b7f5a584e5c705c4c51b0702eb0702eb16f14b16f14000000 -00000021b51821b51821bd0818bd0821bd0818bd0821bd0818bd0821bd0818bd1018bd1018bd08 -18bd0818c60818bd0818c60818bd0818bd0818bd0018bd0810bd0018bd0010bd0818c60810bd08 -18bd0810bd0818bd0018bd0818bd0018bd0018bd0010bd0818bd0810bd0810bd0810bd0810bd08 -18bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0018bd00 -10bd0010bd0010bd0018bd0018bd0018bd0018bd0018bd0018c60018bd0021c60010bd0091bf3b -fab77beab65ef9b466e29423e29602e29423b88d5b91875d39494f4b572e927820b16f14b16f14 -bf912e906a587f5a585f62665f62664a4e502339515c4c51000000 -00000018b51021bd0818bd0823bf1118bd0821bd0818bd0821bd0818bd1018bd1018bd1018bd10 -18bd0818bd0818bd0818bd0818bd0818bd0818bd0810bd0018bd0810bd0818bd0010bd0818bd08 -10bd0818bd0810bd0818bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0810bd0810bd08 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0010bd0018bd0010bd00 -10bd0010bd0018bd0010bd0010bd0018c60010bd0010bd0018bd0018bd0018bd0010bd0091bf3b -fab77beab65ef8af56e29423d0780ae29423b88d5b91875d39494f8b873b9b6438b0702eb0702e -b16f14a479537f5a585c4c51655d517f5a585c4c515c4c51000000 -00000018b51022b50b23bf1118bd0818bd0818bd0821bd0818bd0821bd0818bd1018bd1018bd08 -10bd0810bd0810bd0818c60818bd0018bd0810bd0018bd0810bd0818bd0810bd0818bd0810c600 -10bd0010bd0818bd0010bd0818bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0018bd0010bd0010bd0018c60018bd0010bd0018bd0018c60008bd0091bf3b -fab77beab65ef9b466e29423d0780abf912ea282676c7672244d5096733a9b64389b6438cc742d -cc742da47953906a58655d515c4c51655d517f5a585c4c51000000 -00000018b51021bd0823bf1118bd0818bd0818bd0818bd0818bd0818bd0818bd1018bd0818bd10 -18bd0818bd1018bd0818bd0810bd0818bd0010bd0810bd0018bd0810bd0818bd0810bd0018bd08 -10bd0018bd0010bd0018bd0010bd0018bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0010bd0010bd00 -10bd0010bd0018bd0010bd0018bd0010bd0018bd0018bd0018bd0018bd0018bd0010bd0091bf3b -fab77bf9b466d89076d99755d0780a8b873ba28267347382244d5084603a7f5a588c5e209b6438 -cc742da479537f5a587f5a5884603a7f5a587f5a585c4c51000000 -00000018b51021b51821bd0818bd0818bd0818bd0818bd0818bd0818bd0818bd1018bd1010bd08 -18bd1018bd0818bd1018c60818bd0010bd0818bd0010bd0810bd0018bd0810bd0018bd0810bd00 -10bd0010bd0018bd0010bd0018bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0818bd0010bd0010bd00 -10bd0010bd0010bd0018bd0010bd0018bd0018bd0018bd0018bd0018bd0018bd0008bd0091bf3b -f9b466f9b466f8af56e29423966b1d6872518f8f7a287b71224255637e24906a5884603a8c5e20 -b0702e906a587f5a589b6438cc742dd0780ad0780ad0780a000000 -00000018b51022b50b18bd0818bd0818bd0818bd0818bd0818bd0818bd0818bd1010bd1018bd10 -18bd1018bd1018bd0818bd0810bd0818bd0810bd0018bd0010bd0810bd0010bd0810bd0010bd08 -10bd0810bd0010bd0010bd0810bd0018bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd00 -10bd0018bd0010bd0010bd0018bd0010bd0018c60010bd0018c60018bd0018bd0008bd0091bf3b -fab77bd99755f8af56cc742d8b873b818c646c76720278812242553b545368725184603a96733a -816e5a5c4c51655d51b0702ec2920ae4ab00e4ab00f5bd00000000 -00000018b51018b51018bd0818b51018bd0818bd0818bd0818bd0818bd1018bd0818bd1010bd08 -18bd1010bd1018bd1018bd1018bd0818bd0810bd0810bd0010bd0010bd0010bd0010bd0810bd00 -10bd0010bd0010bd0010bd0018bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0018bd0018bd0008bd0091bf3b -f8af56f9b466d99755d9975591875d8f8f7a287b710c5a6c184d6518605c4976516872514d5d57 -4a4e503b54534a4e50966b1de4ab00e4ab00f5b500f5bd00000000 -00000018b51018b51018bd0818bd0818b51018bd0818bd0818bd1018bd0818bd1010bd1018bd10 -10bd1010bd1018bd1018bd1018bd1018bd0810bd0810bd0010bd0810bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0810bd0018bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd08 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0018bd0018bd0018bd0008bd0091bf3b -f8af56f5af30e29423d99755a28267707d7b287b71184d6518605c244d50224255244d50244d50 -244d503b5453224255966b1de29602e4ab00f5bd00f5bd00000000 -00000018b51021b51818bd0818b51018bd0818bd0818bd0818bd0818bd1018bd1010bd1010bd10 -10bd0810bd0810bd1018bd0810bd0810bd0810bd0810bd0810bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0810bd0810bd08 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0018bd0018bd0008bd0090b112 -f5af30e29423d99755a899718f8f7a5d727c184d6523456922425523395125463b22393e25463b -18605c244d50224255966b1dcfad02e4ab00f5b500f5bd00000000 -00000018b51018b51018b51018bd0818bd0818bd0818bd1018bd1018bd0818bd1010bd1018bd10 -18bd1018bd0818bd1018bd1018bd1018c60810bd0810bd0810bd0810bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0810bd0010bd0810bd0010bd0010bd0010bd0008bd0010bd0008bd00 -10bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0010bd0018bd0018bd0000bd0090b112 -f5af30e29423bf912ea89971707d7b18605c234569234569244d5022425522393e21313125463b -244d50244d502242556a5922c2920ae4ab00e4ab00f5b500000000 -00000018b51018b51018bd0818b51023bf1118bd1018bd1018bd1018bd1018bd0810bd1010bd08 -18bd1018bd1018bd1018bd1018c60818bd1010bd0818bd0810bd0810bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0810bd0810bd0010bd0010bd0010bd0008bd0010bd0008bd0010bd00 -08bd0010bd0008bd0010bd0010bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0000bd0090b112 -f5af30e4ac2ca58f558f8f7a5d727c184d65184d6523456922425522425523395126393125463b -3b54533b545339494f584b42b16f14d0780ae29602e29602000000 -00000018b51018bd0818b51018bd0821b51823bf1118bd1018bd1018bd1018bd1018bd0818bd10 -10bd0818bd1018bd1018c60810bd0818bd0818bd0810bd0810bd0810bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0018bd0010bd0010bd0010bd0010bd0010bd0010bd0810bd0810bd08 -10bd0010bd0010bd0010bd0810bd0810bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0018bd0008bd0090b112 -cfad02bf912ea89971649e6a184d6522425523456922425522425522425523395125463b244d50 -3b54534a4e506060424a4e505c4c5184603a8c5e209b6438000000 -00000018b51018b51018bd0818b51018bd1018bd1018bd1018bd1018bd1018bd1010bd0810bd08 -18bd0810bd0810bd0818bd1010bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd08 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0810bd0010bd0810bd0010bd08 -10bd0810bd0010bd0810bd0010bd0810bd0010bd0010bd0010bd0008bd0010bd0008bd0010bd00 -08bd0010bd0010bd0010bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0000bd004cb50a -e4b210a58f557d95784e5c70184d6518605c184d6523456922425523395122393e25463b25463b -3647424d5d57606042655d5160604284603ab0702e9b6438000000 -00000018b51018b51021b51818bd1018bd1021b51818bd1018bd1018bd1018bd1010bd1018bd10 -10bd0810bd0810bd0818bd1010bd0810bd0810bd0810bd0810bd0810bd0010bd0810bd0010bd08 -10bd0810bd0810bd0010bd0010bd0010bd0010bd0010bd0810bd0010bd0810bd0010bd0010bd00 -10bd0810bd0810bd0010bd0810bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0008bd00 -10bd0008bd0010bd0010bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd004cb50a -bf912e88a87a4096510b627c18605c18605c18605c184d6522425525463b22393e25463b25463b -4b572e606042816e5a606042655d5184603ab16f14b0702e000000 -00000018b51021b51823bf1118b51018bd1821b51818bd1018bd1018bd1018bd1010bd1010bd10 -10bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0010bd0810bd08 -10bd0810bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd0010bd00 -10bd0010bd0810bd0810bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd08 -08bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd004cb50a -91875d3fa46b0b627c05775605775604787018605c18605c184d6525463b25463b183e33266422 -36474260604284603a60604284603a84603a8c5e209b6438000000 -00000018b51018b51018b51021b51818bd1021b51818bd1018bd1018bd1018bd1010bd1010bd10 -10bd0810bd1010bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0818bd10 -10bd0810bd0810bd0810bd0810bd0810bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd00 -10bd0810bd0810bd0010bd0810bd0010bd0810bd0010bd0010bd0008b50810bd0008bd0010bd00 -10bd0008bd0010bd0808bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018bd0010bd0048b334 -3da88302788104787005775605775618605c057756184d65244d5022425525463b263931344833 -4b572e60604296733a84603a966b1db16f14b16f14cc742d000000 -00000018b51018b51018bd1818bd1021b51818bd1018bd1018bd1018bd1018bd1010bd1010bd10 -10bd0810bd1010bd1018bd0810bd0810bd0810bd0810bd0818bd0818bd0818bd0810bd0810bd08 -10bd0810bd0010bd0010bd0810bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0810bd0810bd0010bd0010bd0010bd0010bd0008b50810bd0008bd00 -10bd0010bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010c600239a3a -0278810478700478700478700c5a6c18605c0c5a6c184d65184d6522393e22393e263931263931 -4b572e84603a96733a9b6438c2920ae4ab00f2ad00f2ad00000000 -00000018b51018b51018b51018bd1818bd1018bd1821b51821b51818bd1018bd1010bd1010bd10 -10bd0818bd1010bd0818bd0810bd0818bd0810bd0810bd0810bd0810bd0810bd0010bd0810bd00 -10bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd0008b50810bd0008bd0010bd00 -10bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0018c60006aa47 -01877b00967b01877b01877b0478700478700b627c0c5a6c23456922425522393e22393e25463b -4b572e84603a96733ab16f14e29602e4ab00f5b500f5bd00000000 -00000021b51821b51821b51818bd1818b51818bd1018bd1018bd1018bd1018bd1018bd1810bd10 -18bd1010bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0010bd0810bd0010bd08 -10bd0010bd0810bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0808bd0010bd0010bd0010bd0010bd0008bd0010bd0810bd0008bd00 -08bd0010bd0008bd0010bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00898800948400898801877b01877b0478700478700c5a6c23456923456923395122393e263931 -4b572e617e3e9b6438b16f14e4ab00f5b500f5bd00f5bd00000000 -00000021b51821b51821b51818bd1818b51018bd1818bd1818bd1018bd1818bd1010bd1018bd10 -10bd0818bd0810bd0818bd0810bd0810bd0810bd0810bd0810bd0010bd0010bd0010bd0810bd00 -10bd0810bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd0010bd0010bd0008bd0010bd0010bd00 -10bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010c60006aa47 -00948d00948400898801877b01877b0478700478700b627c184d6523456923395122393e25463b -4b572e60604284603ab16f14e4ab00f5b500f5bd00f5bd00000000 -00000025b52121b51821b51818bd1018b51818bd1018b51821b51818bd1018bd1010bd1010bd10 -10bd0810bd0810bd0810bd0810bd0810bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd08 -10bd0010bd0810bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0810bd0010bd0810bd0010bd0010bd0008bd0010bd0008bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010c60006aa47 -00948d00948d00898800898801877b0478700478700b627c0c5a6c23456922425523395122393e -3b545360604284603ab16f14cfad02f2ad00f5bd00f5bd00000000 -00000025b52125b52121b51818b51018b51018bd1821b51818bd1818bd1018bd1010bd1018bd08 -10bd0810bd0810bd0810bd0810bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd08 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd00 -08bd0010bd0010bd0010bd0008bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948d00948d00948400898801877b0278810478700b627c0c5a6c23456923456922393e22393e -3b545360604296733a966b1de29602e4ab00f2ad00f5b500000000 -00000021b51821b51821b51818b51818b51018b51018bd1818bd1818bd1018bd0810bd0810bd08 -10bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0810bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948d0094840094840094840089880278810278810b627c0c5a6c23456923456922393e25463b -364742655d5184603a96733a966b1dd0780ad0780ab16f14000000 -00000018b51021b51821b51821b51818bd1821b51818bd1018bd1018bd1010bd1010bd0810bd08 -10bd0810bd0810bd0810bd0810bd0810bd0818bd0810bd0810bd0810bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948d00948d00948d00948401877b0278810478700b627c0c5a6c234569234569233951263931 -39494f655d5184603a96733a9b643896733ab0702eb0702e000000 -00000018b51018b51021b51821b51821b51821b51818bd1018bd1018bd1010bd0810bd0810bd08 -10bd0810bd0010bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0008bd0010bd0010bd0010bd00 -10bd0010bd0010bd0008bd0010bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010c60006aa47 -00948d00948d0094840094840089880278810278810b627c0b627c184d65224255224255233951 -39494f655d51816e5a96733aa479539b64389b64389b6438000000 -00000021b51821b51821b51821b51818bd1018bd1818bd1018bd1018b51010bd1010bd0810bd08 -10bd0810bd0810bd0810bd0010bd0010bd0010bd0810bd0810bd0810bd0810bd0810bd0810bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0010bd0010bd00 -10bd0010bd0010bd0010bd0808bd0010bd0010bd0010bd0010bd0008bd0008bd0008bd0010bd00 -08bd0010bd0008bd0010bd0008bd0010bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948d00948d00948400948d0089880089880278810278810b627c234569224255233951224255 -3b54535f6266816e5a96733aa4795384603a9b643896733a000000 -00000018b51021b51821b51821b51818b51818b51818bd1018b51018bd1010bd1010bd0810bd08 -10bd0810bd0810bd0010bd0810bd0010bd0810bd0010bd0810bd0010bd0810bd0010bd0810bd08 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0010bd0010bd0008bd0010bd00 -10bd0010bd0010bd0010bd0010bd0810bd0010bd0010bd0010bd0008bd0010bd0008bd0010bd00 -10bd0008bd0010bd0008bd0010bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010c60006aa47 -00948d00948d00948d00948d0094840089880278810278810b627c184d6523456922393e224255 -39494f655d51816e5a906a58906a5884603a9b64389b6438000000 -00000018b51018b51021b51818b51018b51018b51018b51018b51018b51810bd1010bd1010bd10 -10bd0810bd0810bd0810bd0810bd0810bd0810bd0810bd0010bd0810bd0010bd0810bd0010bd00 -10bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0010bd0010bd0010bd00 -10bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0008bd0010bd0008bd00 -10bd0008bd0008bd0010bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948400948400948d00948d0089880089880089880278810b627c23456922425522425525463b -3b54535f6266816e5aa47953bf912ee29423e4ab00f3b50f000000 -00000018b51018b51025b52118b51018bd1018b51018bd0818b51018bd1010bd0810bd0810bd08 -10bd0810bd0010bd0810bd0010bd0810bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0010bd0008bd0010bd0008bd00 -10bd0008bd0010bd0008bd0008bd0008bd0010bd0010bd0010bd0008bd0008bd0008bd0010bd00 -08bd0008bd0008bd0010bd0008bd0008bd0008bd0008bd0010bd0008bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948d0094840094840094840094840089880278810278810b627c234569233951233951224255 -3b54536c7672816e5a96733acbab21e4b210f3b50ff5bd00000000 -00000018b51023ad2325b52121b51818b51018bd1018b51018bd1018b51010bd0810bd0810bd08 -10bd0010bd0810bd0010bd0810bd0010bd0810bd0010bd0810bd0010bd0008bd0010bd0008bd00 -08bd0010bd0010bd0010bd0010bd0010bd0010bd0008bd0008bd0008bd0010bd0008bd0010bd00 -08bd0010bd0008bd0008bd0008b50008bd0010bd0010bd0008bd0008b50008b50008bd0008bd00 -08bd0008bd0008bd0008bd0008bd0008bd0008bd0010bd0008bd0010bd0010bd0010bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948d00948400948400948400948400948d0089880278810b627c23456923395126393125463b -3b54535f6266816e5a96733ae4ac2ce4b210f5bd00f5bd00000000 -00000018b51021b51825b52118b51018bd1018b51018b51018b51010b50810bd0810bd0810bd08 -10bd0810bd0810bd0810bd0010bd0810bd0010bd0010bd0010bd0008b50808bd0008b50008bd00 -08b50010bd0010bd0010bd0010bd0010bd0008bd0008bd0008b50008bd0008bd0008bd0008bd00 -08bd0008b50008bd0008b50008bd0008b50010bd0008b50010bd0008b50008bd0008b50008b500 -08b50008bd0008bd0008bd0008bd0008bd0008bd0008bd0008b50010bd0008bd0010bd0008bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0007aa32 -00948d00948400948400948d00948d00948d00948d0089880b627c23456922393e22393e224255 -184d653857775f6266927820cbab21f3b50ff5bd00f9c800000000 -00000009a70818b51018b51018bd1018b51018bd1018b51010bd0810b50810bd0810bd0810bd00 -08bd0010bd0010bd0010bd0810bd0010bd000baf1407aa320aa92110bd0008bd0010bd0008b508 -08b50810bd0008bd0010bd0010b5080aa92110b50008a6290baf1408b5080aa9210aa92110bd00 -08b50808b50810bd0008bd0008b50008bd0008b50010bd0008b50008bd0008b50008bd0008bd00 -08bd0008b50008bd0008bd0008bd0008bd0008bd0008bd0008bd0010bd0010bd0008bd0010bd00 -10bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0006aa47 -00948d00967b109c843da8833da88362a78800898800948d0278810b627c234569233951224255 -3857773857775f626696733acbab21e4ab00f5bd00f5bd00000000 -00000010b50810b50818b51018b51018bd0810b50810bd0818b51010bd0810bd0810bd0810bd08 -08bd0008bd0010bd0010bd0810bd0010bd000baf1405974b08a6290baf140aa9210aa9210aa921 -0aa9210aa9210aa9210aa9210aa92108a62910b50005974b0baf140baf1408a62908a62908a629 -0aa9210aa9210aa9210aa92108a6290aa92110bd0008b50008bd0008b50008bd0008b50008bd00 -08b50008bd0008b50008bd0008b50008bd0008b50008bd0008b50008bd0010bd0010bd0008bd00 -10bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0007aa32 -00948d109c8462a78888ad9784948c8c9794839598287b7b008988296598234569184d65385777 -4e5c705d727c385777606042cbab21cbab21f3b50ff6cb11000000 -00000009a70818b51018b51018b51010b50818b51010b50810bd0818b51010bd0010bd0810bd00 -08bd0008bd0010bd0010bd0010bd0810bd000baf14059835189d2e07aa3208a62908a6290aa921 -07aa3205983522a63208a62907aa320aa92110b5080598350baf1407aa3208a629189d2e07aa32 -08a629189d2e08a629189d2e0598350aa92108bd0008b50008bd0008bd0008b50008bd0008b500 -08bd0008b50008bd0008b50008bd0008b50008bd0008b50008bd0008b50008bd0010bd0010bd00 -08bd0010bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0007aa32 -109c844eb58870b68ca1ad9eabb37ea899717d81825d727c0b627c0c5a6c234569184d65184d65 -4e5c705d727c3857773b545384603abf912ec2920ac2920a000000 -00000010b50818b51018b50710b50818b51010b50818b51010b50818b51010bd0810b50810b508 -10b50010b50008b50010bd0810b50010bd0010b5080baf140baf140baf1410b50810b50810b508 -09a70818b51010b50810b50810b50808b50810b50808b50808b50810b50810b50808b50808b508 -08b50808b50808b50008b50008b50008b50010b50008b50008b50008b50008b50008b50008bd00 -08b50008bd0008b50008bd0008b50008bd0008b50008bd0008b50008bd0010b50008bd0010bd00 -08bd0008bd0008bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0010bd0007aa32 -23a57970b68c88a87aabb37eddc17e91875d4b572e4096516a925442863d42863d49765142863d -4d5d575d727c5d727c4e5c703857774a4e507f5a5884603a000000 -00000010bd0018bd0018bd0010bd0010bd0010bd0010c60018bd0810c60010c60010c60010c600 -10c60008bd0010c60010bd0010c60010c60010c60010c60010c60010c60008bd0010c60010bd00 -10c60008bd0010c60010bd0010c60010bd0008bd0010c60008bd0008bd0008bd0008bd0010bd00 -10bd0010bd0008bd0010bd0010bd0010bd0008bd0008bd0008bd0008bd0008bd0008bd0008bd00 -08bd0008bd0008bd0008bd0008bd0008bd0008bd0008b50008bd0008b50010bd0010b50008b500 -10b50010b50010b50008b50010b50010bd0008bd0010bd0010bd0010bd0010bd0010bd0007aa32 -3da88385c176afb869eab65efab77ba58f5540965163c74d70d7566cc95150bf4f42863d63c74d -4976515d727c5d727c5d727c4e5c706c7672816e5a96733a000000 -000000186d16186d16186d16186d16186d16186d16186d16186d16186d16186d1610601b10601b -186d16186d16186d1610601b10601b10601b185d2810601b10601b10601b10601b10601b185d28 -10601b10601b185d2810601b104e1710601b104e17104e17104e17104e17104821104e17104e17 -104821104821104821104821104e17104821185d28104e17104821104821104821104e17104821 -104821104821104821104821104821104821104821104821104821104821104821104821104821 -103521183e33103521188a0d08bd0008b50008b50008b50008b50008b50010b50010bd0007aa32 -3da88388a87aafb869eab65ef9b466a8997142863d63c74d70d7566cc95148b33442863d50bf4f -4976515d727c5d727c5d727c347382385777584b42606042000000 -000000182131182131182131182131182131182131182131182131182131182131182131182931 -182131182131182131182131182131182131101829102129102129101829182131182131182129 -101829182131101829102129182131182129182129182129182129102129102129182131182129 -182129102929101821102129101821101821101829182129182129101821101821182129102129 -182129102129102121102129102129182129182129102121101821102129102129102129182129 -1829291829291018290c751808bd0008b50008bd0008b50008b50008b50008b50010bd0007aa32 -3da88385c176cbb062eab65ef9b466a58f5542863d42863d617e3e42863d42863d42863d48b334 -687251738085738085385777707d7b4e5c7039494f4d5d57000000 -000000182929182929213131364742182929102929102929102929102929213131102929102929 -18292910292921313126393110292118292939494f36474222393e25463b213131102121102929 -25463b18292936474221313110212110292918292910292910212121313125463b102929182929 -1029291829293b545321313136474239494f10292118292910212136474239494f102921182929 -10292121313122393e29313122393e18292910292925463b364742182929213131263931213131 -1029291829291021290c751808bd0008b50008b50008b50008b50008b50010b50008bd0007aa32 -23a57985c176afb869eab65efab77ba58f5563c74d6cc95150bf4f63c74d63c74d63c74d6cc951 -497651738085818c8c7d8182b88d5bb88d5bbf912ebf912e000000 -00000021313118292939494fa3b8af707d7b636f6b7380855d727c6c7672738085738085707d7b -707d7b707d7b738085839598707d7b364742707d7b84948c818c8c839598818c8c818c8c707d7b -929b9c18292983959873808584948c6c76726c7672707d7b839598738085818c8c818c8c213131 -818c8c818c8c818c8c22393e929b9c929b9c818c8c929b9c3647427d81823b5453576d67576d67 -3b5453364742a3b8af929b9c929b9c839598818c8c7d8182839598929b9c818c8c738085818c8c -1021211829291821290c751808bd0008b50008b50008b50008b50008b50008b50010bd0007aa32 -18a27588a87aafb869cbb062f9b466a58f5548b3346cc9516cc9516cc9516cc9516cc9516cc951 -4976517d8182a28267d89076cbab21e4b210f5bd00f5bd00000000 -00000021313118292939494f636f6b576d67636f6b8c9794818c8c818c8c7380858c97947d8182 -8c9794707d7b818c8c707d7ba3b8af4a4e503b54536c7672636f6b6c76727d8182738085707d7b -707d7b222929576d67707d7b6c7672636f6b5f62664d5d57707d7b4d5d57576d676c7672213131 -707d7b5f6266364742293131636f6b576d67636f6b636f6b222929576d67364742293131213131 -2131293336313336314d5d576c7672636f6b5f62663b54535f62665f62663b54533647424d5d57 -1021212131291021290c751808bd0008b50008b50008b50008b50008b50008b50008b50007aa32 -00967b649e6a88a87aafb869cbb06291875d40965142863d70d75670d75670d75670d75670d756 -617e3e7d8182a28267d89076e4ac2cf6c329f6c329f6cb11000000 -000000182929182929212931182929182929182929182929182931182929182929182929182929 -1829291829291021291829294d5d57213131182929102929102129182929102121102129102121 -182929182929102121102121102121102121102121102121102121102121102121102121102929 -102121102121102121102129102121101821081821102121102121101821102121102121102121 -102129102129102121101821081821101821101821102121101821102121101821102121101821 -1821291021291018210c751808bd0008b50008b50008b50008b50008b50008b50008b50007aa32 -00967b25a758649e6a88a87aabb37e7f8a5142863d42863d42863d42863d42863d42863d42863d -4d5d57a28267a28267d99755f5af30f6c329f6cb11f6cb11000000 -000000182129182931182929182931182931182931182129182929182129182931182929182929 -102129182929182929182929102121102129182929182929182929102929182929182929182929 -102929182929182929102929102929103521182929103521102929213129103521103521103521 -213129103521213129103521103521103521213129103521103521103521103521213129183e33 -103521103521103521183e33103521103521104821103521103521104821103521104821104821 -103521104821103521188a0d08bd0008b50008b50008b50008b50008b50008b50008b50007aa32 -00948402946f299452649e6a88a87a7d9578707d7b29846d027881296e8723456918605c497651 -818c64a89971d89076bf912ef5af30f6c329f6cb11f6cb11000000 -000000188a0d188a0d08911a188a0d08911a0a980808911a0a980808911a0a980808911a0a9808 -08911a0a980808911a0a98080a98080a98080a98080a98080a98080a98080a980809a70809a708 -09a70809a70809a70809a70809a70809a70809a70809a70809a70809a70809a70809a70809a708 -00b50009a70800b50009a70809a70809a70800b50009a7080aad000aad000aad000aad000aad00 -0aad000aad000aad000aad0008b50008b50008b50008b50008b50008b50808b50008b50008b508 -08b50008b50008b50008b50008b50008b50008bd0008b50008b50008b50008b50008bd0007aa32 -00948400948402946f18a27570b68c62a7888bc1a33da8837380858395988395983da883839598 -a1ad9ea1ad9ed9ac7ba47953e4ac2cf6c329f6c329f6c329000000 -00000008b50808b50010bd0010bd0010b50010bd0010bd0010bd0008bd0008bd0008bd0008bd00 -08bd0008bd0008bd0008bd0008bd0008bd0008bd0008bd0008bd0008bd0008bd0008bd0008bd00 -00b50008bd0008bd0008bd0008bd0008bd0008b50008bd0008bd0008b50008bd0008bd0008b500 -08b50008bd0008b50008bd0008b50008b50008b50008bd0008b50008b50008b50008b50000b500 -08b50000b50008b50008bd0008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50007aa32 -00948400967b00967b01877b00948d0089880278810278810b627c0c5a6c0c5a6c0c5a6c3e8227 -816e5a91875db88d5bb0702ec2920ae29423e4b210e4b210000000 -0000000aad0009a7080aad0010b50010b50009a70810b50008b50010b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008bd0008b50008b50008b50008b50008bd0007aa32 -00948400948400948401877b01877b01877b0278810b627c4976518b873b8b873b2479523b5453 -687251906a58a47953a4795384603a966b1db16f146a5922000000 -0000000aad0010b50010b50010b50010b50010b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50007aa32 -00948400967b00898800948401877b01877b047870cbab21f9c800f9c800f9c800e4b2108b873b -816e5a816e5a816e5a816e5a906a589b6438b0702e606042000000 -0000000aad000aad000aad0008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50000b50008b50000b50008b500 -08b50008b50008b50008b50000b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50007aa32 -00948400967b01877b01877b01877b04787090b112f9c800f5bd00c2920a927820cfad02c2920a -8b873b6c7672816e5a816e5aa28267906a5884603a655d51000000 -0000000aad000aad0010b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50000b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50000b50008b50008b50008b50008b50000b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50007aa32 -00948400967b01877b02946f01877b278263e4b210f5bd00cfad029278206a5922cfad028e8c16 -bf912e816e5a816e5aa28267816e5a5c4c516060424a4e50000000 -0000000aad000aad000aad0010b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50000b50008b50008b50008b50008b500 -08b50008b50008b50008b50000b50008b50008b50008b50008b50008b50008b50000b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50007aa32 -02946f00967b01877b01877b01877b278c56f9c800cfad02c2920a8e8c168c5e20c2920acfad02 -cbab21816e5aa28267906a58a47953b88d5b9b6438bf912e000000 -0000000aad000aad0010b50010b50010b50010b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50000b50008b50000b50008b50008b50008b500 -08b50008b50008b50000b50008b50000b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50000b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50000b50023ad23 -109c8401877b00967b01877b01877b278c56cbab21c2920af9c800c2920a6a5922e4b210f9c800 -cbab21816e5a816e5a906a58cbab21e4ac2cf3b50ff6c329000000 -0000000aad000aad0010b50010b50010b50010b50010b50010b50010b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -00b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50000b50025b521 -649e6a02946f01877b02946f00955f00955f8e8c16f5bd00f9c800cfad02cfad02f5bd00f6cb11 -b0702e906a58655d5196733ae4ac2cf6c329f6c329f6c329000000 -0000000aad0010b5000aad0010b50010b50010b50010b50010b50010b50808b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50000b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50000b50031bf0d -91bf3ba58f553fa46b3fa46b409651649e6a6a9254cfad02f5bd00f5bd00f9c800f5bd00c2920a -cc742da4795384603a8c5e20e4b210e4b210f6cb11f6cb11000000 -0000000aad000aad0018b50710b50010b50010b50010b50010b50010b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50000b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50000b5004cb50a -cfad02cbab21cbb062bf912ecbab21cbab21cbb062cbab21cfad02cfad02e29602d0780abf912e -e29423cc742d84603a8c5e20e4b210e4b210f6cb11f6cb11000000 -0000000aad0018a80810b50010b50010b50010b50010b50010b50010b50008b50010b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50010b50000b5004cb50a -f5bd00f6cb11f5af30e4ac2ce4ab00cfad02e4b210f6c329e4ac2ce4ac2ce4ac2ce29423e29423 -d0780ad0780ab16f14966b1de29423e4b210e4b210f6cb11000000 -0000000aad0010b50018a80810b50010b50010b50010b50010b50010b50008b50008b50010b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b500 -08b50008b50008b50008b50008b50008b50008b50008b50008b50008b50008b50000b5004cb50a -f5bd00f6cb11f6c329f3b50ff5b500f5b500f5b500e4ab00f3b50ff3b50fe29423e29602d0780a -d0780ad0780ad0780a8c5e20b16f14c2920abf912ec2920a000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/realmen.gif b/Docs/Books/realmen.gif deleted file mode 100644 index 41cb7d0e5ae66b7a1f9e7447c93fd9ec07a1ee45..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7910 zcmWkyc{tOLAOCE#(>5E$oEeHCjVN~`a@UX?Ip)flmLs?3mUBdIO(bVc?sCkTT#YUY zO$puWLZ$q^zdzou=lwkI*Xwyd&+B=;|9P8PoX|e%=>sGHTLAEPBJp=u?B*nXX)s}P znDlEL_|<;yeW&~OoijiCfS-5B-#dhUb^r^_u{GUyCfQ!AcX6xDs^40GtihT)-2qK) z3H0Y@R-1t8ma5djOOs8+M=jumVuyL=rThWCE4?nk4{bw+{WDsMUl+>1z6PduW_v%d z$*7O1FTF_RY8RAOFk6MYbIuOrt7R7#4i%uN1E)@QWF!}r+{| zd{It40WN3S z#wR9arRx#Kh`HIK#4*IN+MvLK)3`Bp;us)5fG3P0NPUPfMk-+pVAIt|eE@C@LF_}| z#(@1DL}DL6=p)GAjHbuOwqDpn=))2E5X26`{##Dh!gLX1|4jk84#9#bSzI4Zz5~GZ zAqX7=$~9a07J1x%+72AyMg%j^iO>NLz7z^;JdgN~U#F26;)3fyl>2DoIso9mjTI@^ zf~1MHik=CEhz zwE%=lHAEdrG5ZWqn3F=&C8eB4-a-J^Vu8XG$Mb&K?y{F%oGdQcf(tJgCMhZ=c|(h> zfFcj2*jUZ5BoD81&=M`B*o(lG3|}`}R0#r<9!sMct9!SQLekZ}Zz@FFA@U^%nV6HV zbak%^l6M`+wLhj2{zE!Mb#>x@4Vj43 zA`(gJawHOgq)zxh5^*FFjzlC7)d@rrfk?y=Nx1(bfgnX75QsPe2}d9z2t>4)C;$Me z{}u56TL2Kdz%EkCoXr|cMu;f8jCM$E!p^_mCS4!s#tB)iN) zO~>0Mt`F@pCyG@)8#R$_H!YNF`6)y8s1kLTcDsCK2b55ic4wIH&!MPgY1{hbL~?FH$(*TN^8kH{Z!o|Wrx0!@BeO=F05X&tIqgm{d2nFp389yqSp7Q2iS+Z zEE%Hl%h2_gv|kCM=jSXI>}u`Qf7i`a)Q_HG8vgp42+kA__j7EB7Z0-;xZlxl-EjZV zxr$ozy}PKH49Bl;jQmF!Uq>LRAh@V?mCgMGzb_ScUVfZ7cDTs20q91M&V8h3%QY}; zhm!Q-c!K~$mdT*lQ?!;&+xw>NyCnJh>GgzYTXpySS^D{l*aH;22~w`z$p|Wh#xYW6 zXU$R^y4;HA(tq`|dq*xrbkB*BQ*c9AVj=rDQj@JTBp^a#3?hXzaSX7?Kl|r+2cP^E zhZwg+yAau#C;OQ05l&Dj#)r3tRp+u~FjQSeBI*d6%YmTAZ~3}CcCf8XGx|MVQ>_;Y zm-BOW0Ig(+7xD!N;XM4X0M;in5wTC7GYGTk!q&h`ex73HHXw9X*T(|a4asE zfA#eoUm&PPe@C&{Jx2V3g+008A<5){SGejepP_M4T0q=6i33iYR4MxsT8Bu0k8CQE zL{Ge9bCT@}KQix{JgrWtpcFpzVQ_LII00E2@9Qv3(v=Q! z3x8gjD$;gX+Dxr)@rE8R@zrZ9RbQ@xij9&(Q=?SzSsEBEdOA1m$-`uB97CW{#Xvl3%e9k~yEdIo%q&3NeY8Y&uhLwfPe^460}y86tdxV6awi8(X%%#KIS z7n!L$A+uSw2#|+4&1A<*9SXpxK3*EgZ>kglHJs;R$Bm?Ky9wJv&1@QhFvVLhpd|}u zd`WJx0w5+&_ZyWmBWt%@%<=~ZapDO-%blH~ zd>Rj5;^FoOs3wyN&J5=w19BrYb97!*XNk}A1dM1HsWN^N1tkzKa@ZJIdhUw5rd>j5 zcT(dVbL0t zCoa=zSOSdiy3Dill6-tqPQ1a`gHqtFGg89OgzpZxB9fw>?0AWVe!YK?kXyb--%BsE z2Fvw)gI1-0u+{=lCA6{l1Pi7ma2I;7M@8^!g`d16(qh0r+r`ilayTB3HURip9=$`K zP`Yeaq9#NA!tO+TkGTW{qAwrxnX z^`)R|Z-PnYZS{Hu?%Cd(8V~mf8@+t7J0_P{ehLe51b$eJ!F~qG!q4fg>n0L3*&>0%B*#1|5w}3x=z57 z`$pzRmAtyMXuZ!%zkY|Rr&N1*Ad-cDy?;KYgabal zFpwexsUD;(LzJGeLBg)I%+JkychjME)qith$t~B?|JbG327jCA8ciiJCVgMMCw33+ z4Y@cx_425RMyFV8-tDOD-M1j353hX4`e%aD^Pci^iIPO^f2X19aj#tRQ6{WaVP8M^YLrf0U*f6GoM)5vl6g#GLcN$0gbbP;vz*^FVMh zldDEN^S9B{8U4)JL0Y6I>x!@g5BzNLnwDkoUp@L`mu9b@1g{!eT39S|&kI)C{SHqw zEh=uAU;|5SlT~-SwtDC6ZmmbhZu&Wi%eH&_5GR^PrR~$!!Hegf7UP8PtD9|0DYcQ) zj!tcpjaqeV6!*>N-z>A0$Dq7t0}z>?j0bw} zFA61$%WOtmFwhUN2p!2&sv$LYCa&r2Yw&_`EZY`(px<> ze5QV(#2D?DpqJR_n~w1dj!`eRuzzu|UXIW^s?a+I_8lMlj|t(D6aG=LKl#{KxP(fE zP|7NlyXm$S3C-qNJ&e>;RT5N46D*_)j~0hLf}gp>M}J_(Y%$_dgjho-p|?Dso{xxR zqBU@^hq6)1R7f5tUW<>ZWP!O%$ZJ}ZMF;+~qVT_UfolxG)tja{t4F(eg6wO7n%Y6_ z2jDaZ!8a@+WPN}!@lFC8AqKq=!AfATSEEO4(ZR+*16$w*Y=V(%B9{r(YIrEm}pNj#*&Yyk~8ntt|Ev^*{SC@7TFtxY&$s>_@*O`Ra&~@Dml! zqqh;!bDCO?R6%K_*w&-5uVf*43{;X?W>30MFCW3D#cek47=Jm}lx?ABHo2 zYv*Z2rEN#01&%{=shO>jLhVjMSSpr}OMJ&pu6~StO~r0gu^Z-B*SE3iyH~{N&~SWuVl!NKe^>bUvaX3gH+4)!`$= zw~N%65KACKnI)h`EqX{TQsWkJ>G^@24D-^US*PL(M2;&H_J|hWQjGn_5~$>2cc_qF zGRBitl*bZCC_%r)!E{(?PhN>9OW-m0nk5s`sg2>Xz}vD|HC*gcQNBVo-RrfgQ%xQ- zz0e~1%p*d|db!9g zX3-l$o-@K;av1LyRhZ{j%)FHrN{61N3N8UcAITW0-3^_HEzB1-Q;mg=h|JBH$F_+j zh7n?S*p|r;5?Swpzm?$2HiW}U^G0jRer)6`fpTW$;+H6qPmjj(DG8N)%r-whLNQ9u zJRffvb)zJMK+2Qz)WB^e%$LHVe^m!iSX@PDbr%9UX3 zMBV+TT&p5kpqkb6O4&kS6$H=#5S69~2ef(a?0S+3N0t?;!SB8k`UK@gSodY~ERB z{Voonzy_6M)`XV#jFv~Ar1geyyCz%iiBA2cE|E!8ss#KKL*d z-Bm6?p$Q`5e4I7lGKu||is+F)?Jt$#r>RZiJK53B1GvZm=MQ(;mezM90T>NHkcUiZ zg1P0WBsLuM5qYAnaTn;4QHQRVM`N?2@y%(URGRc$2bszZpFY40n+Kt1yZx1*cl3Z0 z`d|Yt_%Kayor`WDBcQ>8_sC#*YCppTM$Yc94C-}S9ChTuPV-<+710^HAKM+zju~3B z=O_H#tVT{uK`t~yCfJxvoQoA7*-1t_F`!XGt%-x|PSJAoG8tWL1q)Z{t&kkQA~oQ>GjT_C zkm)kn^>JJ{ds;ZSW9kE_FK)yDH#OWV5RaSiq6!56X&dHD**C+&%iHT0dpd&an}eq_ z^tHURr+s>-ft*1<__b_pYKY!rVs8q!2kYNFxW6Nrjj2kWTDQ%o60x-}_gxqrEw>+2+}1)k&K5claUIL#dOg{~#&Tpc}X067WEAFND z%`aNBa$5j-4oDXVYosnb;b0_8T^42gRPlG9w!TgCAQrrjAFZ}*GM66?V?Q@P0#7i2+vBDy^%ezALX-baG}|mc>R$e^#54M|JR=Rd zt+4cX8uRoZ_9erX%RqZ^A^m!zmu+CaWS*PB{Oi7Pbk+RA6z^fnqDduex)1ctt#gsG zL z`;duWsAfK@gaM@(j)qZT6+vsWQ%^he=gs<8o1~w$ke*pr-8+@Lj8}sn=Ykah_!JMF z5Q15xFMYm*zQcyQ=OVp!8PFpJ&@evKf2OA4Ox(&j%3Le6G2N>Kqh7%aziHz~k zV>C=xALcdv)*U*m1c#`Zf*AdSHXE+y8@?E`nas3a4*NW8k^AA&%m>gkG#mF(Mhr7U zS$KxS9wT8N$oAYle=N+kt+ic`*9!ll`dX}>E zz8~``0p>;XsdSrg-GW{quX?c7TCwXEGoLOk^L#4c*neMS-4IP2WD}MD*1a)y;&U<= z?!_5$9*XeYQ?--^jU6!(2Zcr?C0x#`DwDa`QE*o6fh`gGyYJ5czH{1OtWlHBJF9d{;0;6jR2Vsrv1}-`?i=dzd_SKkAFeMUFR?GFs}hj`LP~9 z+=P+Z_q^q`+RKv>ufAVc{@&;@W^{e)s>iP>`VXCxe`4t{Q!bo)=JWt~6(DoO15lmDO9q za>n^}j(!Ve5wwv^dksUKOCl^;Bmd@mt6}F`dGtg6b>r!IrW)17mp`I(?K;2T=73ec zChsx9HPjkGR7ykik*6fT^bYtBVQ>;A^@C7xYv=vN!Hl-IOfUCYhBhd7(*M}5<@-hj z6T503JY3AeG|#g3jeOCDas%F6*8Yk~2Qp7JxUNYQq>v^|t_Ps|v7QIY@GYcPf-gB> zB~|QO`7l;&eLhdeaECvPJG#S6&V%A-^MqDkE2QMT|Iu{&-Z0iG?3BWT@5h^7a+Fq5 zP`fbx3PGF2G!dpMth{9&4<;QbJw>iI&()mMz9Oj64eWiQ-_4YNLNz)H(Y%<)3r$Z@Sr8 z7SjHy?kv3*s<;@!$v@|MaoF^zTf}psU!{xJ%d0l7r{KTZ;t$5tK?Ma#++qs@mT-ye?W%=H?qCvv;+#c(ba=T~_IV ziu2qa#j5kmrLYfC1^w{K^Zox^N^7d~e^&)?6U=17he(PQwOvLM@9SQ*KJYz;L5AbW z;cp{gA}LzcbR4Bs4!+-sR-G!UWb79RABq~uJpP%lgPv|-60-w_>WOgi&~YMq?{fZN zro`uN`RpeaX6ZkqhHQ;erB0WeK>F&wGbs&_s*exf@546u8oOL=_NC9eE_oRq{0}7X z?iSn>DXp6!IB;1meJ%f_%*DiT6<6v|D%mnpwzN~G=QvVD^TMsG6z7Jx8OVu)L1~d(C4mJe)Lf>(U~~oKU8?j#8;VEeZ`?HwCF0sSJk`csIgStwb&Y( z48qx5w~zr7L4enNa022q0D@5(LRgsRyOgEakP;mzx0E({5K-C+RGt9{C}|*Vtid*AC404h_MA%Cyn4N7alfLgIyIT$ zg|sS3)sV1Fm)ippNyH_qty!pO{(5{vY}Ef4vge8e;>lhPmjW_DCGP(?Sc`oJ5f#|X zb3XUv`pd<-BW^LXIoKaHDoPZvJ39^2OGAb%Bx7ZVGNWIF)&0pPXOo&9`CSrlpFZ|E0Q$4kd+LUZS}E3X(n#+CvR; zsr<&NuFANzKPwPEwfV5KtM3zT?KeZTb^|0a&w-h9lWX{Z$apFv)cJkJ+S>P?^{2P? z$*QM3QI-XZ%>x1m9O!p0O~7CykpKog;-4(+EqN;v163XWS$7Q(q*0Qt-eur}#Rd%c fDFk=!{>;Y6R!O diff --git a/Docs/Books/realmen.txt b/Docs/Books/realmen.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/Books/sql-99.eps b/Docs/Books/sql-99.eps deleted file mode 100644 index df55f1ad06b..00000000000 --- a/Docs/Books/sql-99.eps +++ /dev/null @@ -1,1248 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: GIMP PostScript file plugin V 1.06 by Peter Kirchgessner -%%Title: /opt/local/x1/work/bk/mysql/Docs/Books/sql-99.eps -%%CreationDate: Sun Dec 31 14:31:42 2000 -%%DocumentData: Clean7Bit -%%LanguageLevel: 2 -%%Pages: 1 -%%BoundingBox: 14 14 288 383 -%%EndComments -%%BeginPreview: 100 135 1 135 -% fffffffffffffffffffffffff0 -% ffffffbddb55b6db5555aad6d0 -% d555556b6efb6db6fbbb775b50 -% efffffdedbaedb6dad6dad6df0 -% daaaaab5b6f5b6db56d6dbb6b0 -% ef7fffeeedaf6db6fb6db56dd0 -% b1a2aabb5b7adb6b555b6edb70 -% c0419f60e1d06dadad2d556db0 -% a48895a040a25b76f71b4bb6d0 -% c78c9b664ce7e6894934c65b70 -% a1188ec648a2810041100016d0 -% e08c9b644ca6992248a244cdb0 -% b8540c1040e389264c104c0b50 -% d60c9a1060a5182248a0440ef0 -% ac488bfe596391264897ccfb50 -% 60c08140c1b0412241104002d0 -% a160a5b1a6d046664188421370 -% bfbefeef7b6ffbbd8ef7bde5b0 -% 6ad5ab5ad6daad6acb556b56d0 -% b77b75af6db76b5756ddb6bb70 -% 60d6dc4adb6dbdedbab76dd6d0 -% a03db49db6db6b5ad76ddb7bb0 -% a6634c8b6db6d6b76db6b6ad70 -% 622104929b6dbb6d5adbdb6bd0 -% a04ca49136db6ddbb76d6ddeb0 -% 60c0a4892db6d6b56dbbb6b5d0 -% a44104993b6dbb6edad6db6f70 -% 624f30886ddb6db5b77db6dad0 -% a600044c5b6edadb6dab6db7b0 -% e561924476db6db6db7edb6d70 -% 5fbf7fbedbb6db6db6d5b6dfd0 -% 756ad5606d6db6db6dbf6db570 -% dedfbfd9dbdb6db6db6adb7fd0 -% 6bb56ab776b6db6db6ddb6d570 -% b557feeadb6dbdb6dbb76dbfd0 -% 6aec95bab5db76edb6dadb6ab0 -% d6ab6b55556eedbf6db777ffd0 -% 75dadd5b6adbdefadb6ddd5570 -% aaaaab7556bdb5ef6edb37ffd0 -% bf6efaab55eb7ffdddb66d5550 -% 6abbabfeff5fdffffbedbbfff0 -% ab6efe95aab57bb7ff76eeaab0 -% 7555abad6d6efeed5feab5ffd0 -% aaaaaab5b6bbfdbbb5fddf5570 -% 6ddddbab54eafbd6eeb575ffd0 -% b5555ad6a9bbf6bfbbefdf5570 -% 6dddabb5abeffdeffeabfdffd0 -% b6b77eff76b5eb5fdfbdf75570 -% 6dadabaacbaff6ffff5f7effd0 -% d56dbeffae1bdbbfffbfafaab0 -% 6baad2aa9a97f57ffebf7ffff0 -% b575aeff6c3fedfffeffd5d550 -% 6badd5555957f57ffdffbfffd0 -% d6db7bfe747feb7ffaffd57b70 -% 7dbed6aad1d5fd7ff5fff7afd0 -% 57ebfff9a57df5ffebffeb7ff0 -% e95aaaab69d6f57fefffffd5d0 -% 5756afeac379aabfdffffff770 -% faed75578fd1777fafffffdad0 -% 5555afd52ab2debf7fffc16dd0 -% ed7aeaae97e06b5ebfff3f5af0 -% 5bd7bf5a2e84bfaeffff45aff0 -% 777d6ab55da1edbd7ffebef5f0 -% ddd7deda7b0abfa2fffd255ad0 -% 6abab574deb3ef5dfffa955550 -% d54feda9b52abd6bfffaaaaab0 -% 6add5ad2fc4ffed5fffa8d5550 -% 6db7f3a5a9957b5bfffaa35550 -% d7faaea7fa26f5557ffd4aaab0 -% 6debd54d52e9f73efffca19550 -% d7faaf57e5036dd75ffa955550 -% 6eabb51eaad6dabffffea8aab0 -% dad55d75c90b557fdfff285550 -% 7cd5b45f16adbbdfafff552950 -% 76aaf576b51b6f6f4bff2a1550 -% ffc9a8de4276dabee7ffd50d50 -% b77eebbaa8adb7ff52ffe28b50 -% 7ef3a2f48a76debdb9ffea52b0 -% ffeaabd952db7bfb6d7ff52150 -% 6dd7a77335b6d6f6d75fe888b0 -% 7fdd4ee4c2dbbfedbbbffe5250 -% ff569dcd576d75fb2feffb0810 -% 6dad77a94adbefd65bebff5350 -% ff5bff5597b77fbd06f7ff8950 -% 7e7bff122d6dd7ea6bfaff5550 -% aad75feebbbf7f58b1f57eb550 -% 556ebfc456d5dff34bfbbd7a90 -% 8aab5fd57b7f7ea4a7eebbfd50 -% b0556398d6d6ffea8fdb57fa90 -% 7f895d32bdfdfd415fb6eff5b0 -% ff7a9265eb5bff961fefb9efd0 -% 6eaf7d535efffaaa7fbafeebd0 -% fe1ddb4bf5d7ff14bfeffeb7d0 -% 797bff57dbbff45a7fdaafbfd0 -% 6c5f579fef77fd28fffcff6fd0 -% fdf6bdebfbeff463ffd52fb7f0 -% 7cbe577feebff9aafff25adbd0 -% effcaefdfdffe2a7ffe907b550 -% 7efa55d7efbfea8bffd257fed0 -% f7f8a97fbbffc557ffa49fab50 -% 7ff355ddff7fab1fff8f2fffd0 -% 6fe57377f7ff8c7fff285f7dd0 -% fdcbeaddbfff32bffd557fefd0 -% dfa6dfb7fffe48fffe54bfffd0 -% 7bcfb57eeffcaafff8b2fedab0 -% 7faaefd7fffd51fff525fffad0 -% edffbabf6ff8a7fff293fdb450 -% 7fed6ffbfff2cbffe8a7fff290 -% fbbefab7ffe557ffc32fbec930 -% 6fb5d7ff7fca8fffad4fffd250 -% 7ebfbd6fffd6bfff551eff9490 -% ed6aebfdff8a2fff0abffd4230 -% 7fbbbfdfff257ffeb47fff2950 -% d5576b7bfe58bffc297ffccad0 -% 7feddffffd557ffd52fefaa150 -% f6bfbbdffcd1fff8a9fff9aad0 -% 5ff7fffff96bfff2a5fff54bd0 -% ff6ffffff2c5ffe993ffe297d0 -% 6dffbffff557ffd2a7ffd74dd0 -% d55fffffe50fffc68fffaa2fd0 -% 557f7fffd55fff955fff955fd0 -% 557fffffacbfff363ffd34bfd0 -% d77bfffbeabffaa977df527f50 -% c97d6db75abb7a556ed5557fd0 -% 537b6b7d6aeefaaadbead57df0 -% 557b6ff5aadab65575dd55ffd0 -% d57ffdfd77fff9abdff557ffd0 -% ddfffffdcbfff287fbe997ffd0 -% 7beffff757ffe5afffd64effb0 -% 7fbdfffdcfffca9fffd52fff90 -% edfffeffdfff952fff9a5fff30 -% 7bb6ffffffff4a5fff353ffe50 -% efffffbf5ffe9abffea8bffc90 -% 7ffffffffffffffffffffffff0 -% fffffffffffffffffffffffff0 -%%EndPreview -%%BeginProlog -% Use own dictionary to avoid conflicts -5 dict begin -%%EndProlog -%%Page: 1 1 -% Translate for offset -14.400000 14.400000 translate -% Translate to begin of first scanline -0.000000 368.503937 translate -272.965879 -368.503937 scale -% Variable to keep one line of raster data -/scanline 100 3 mul string def -% Image geometry -100 135 8 -% Transformation matrix -[ 100 0 0 135 0 0 ] -{ currentfile scanline readhexstring pop } false 3 -colorimage -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000 -00000052526b4a526b4a526b4a526b4a526b4a526b4a526b4a526b4a526b464a604a52634a526b -52526b4a526b4a526b4a526b4a526b52526b52526b52526b525a6b52526b525a6b525a6b525a6b -525a6b525a6b525a6b4a5a6b5a5a6b525a6b525a6b5b5a735a636b5a636b5a636b636373626b73 -5a636b626b6b626b6b6b737a74767882858c7476786b737a6b6b725a63735a636b63636b63636b -626b7363637363636b6b6b726b6b72626b6b626b736b6b72626b6b626b6b626b73626b6b747678 -6b6b727476786b6b727476787476787476787476787476787476787476787476787476786b6b72 -6b6b726b6b726b6b72747678626b6b747678626b6b7476786b6b726b6b72747678626b6b6b6b72 -626b6b6b6b726b6b7263636b626b6b63635f5a5a5a626b6b000000 -0000004a526b52526b4a526b4a4a6b424a6b464a60464a60464a60464a604a4a6b4a526b4a526b -4a526b4a526b4a526b4a4a6b4a4a6b4a4a6b4a4a6b4a526b464a604a526b4a526b4a52634a5263 -52526b525a6b525a6b4a526b525a6b52526b525a6b525a6b525a6b5a636b525a6b5a636b525a6b -525a63525a6b525a6b5a636b5a636b5a636b5a63735a636b52636b525a63525a63525a6b5a5a63 -525a635a5a6b5a5a635a636b5a636b5a636b5a636b5a636b5a636b5a636b5a636b5a636b5a636b -63636b5a636b5a636b63636b63636b63637363636b63636b63636b63636b63636b63636b636373 -63637363637363636b6363736363736363736c6373636373636373626b73626b6b6b6b72626b73 -63637363637363637363637363636b5a63735a5a6b767984000000 -000000525b735b5a735b5a73525a6b52526b52526b52526b525a6b52526b525a6b525b7352526b -4a526b4a526b4a526b4a526b4a4a6b424a6b4a526b4a4a6b4a4a6b4a52634a526b4a526b52526b -525a6b52526b525a6b525a6b525a6b525a6b525a6b525a6b525a63525a6b525a63525a63525a63 -525a63525a63525a63525a63525a63525a63525a63525a63525a63525a63525a63525a63525a63 -525a6b5a5a6b5a636b5a5a6b5a636b5a5a6b5a636b5a63605a636b5a636b63636b5a636b5a636b -5a636b5a636b5a636b63636b635a6b63636b63636b5a636b5a636b63637363636b5a636b5a636b -63636b63636b5a6373636373636373636373636373636373636373636373636373636373636373 -5a636b5a636b5a63735a636b5a63735b5a7352526b686b7d000000 -0000005b5a73525b735b5a73525b735b5a735a63735a63735a6373525b735a5a6b525a6b525273 -4a526b52526b4a526b4a4a6b4a4a6b4a4a6b4a52634a526b4a526b4a526b52526b525a6b4a526b -52526b4a526b525a6b525a6b5a636b525a6b52636b525a6b525a63525a6b525a6b525a63525a63 -525a6b525a63525a63525a63525a63525a63525a63525a6b525a63525a6b525a6b525a63525a63 -5a5a635a636b5a5a6b5a636b5a636b5a636b5a636b5a636b5a636b5a636b63636b5a636b5a636b -5a636b5a636b5a636b63636b63636b63636b63636b63637363636b636373635a6b63636b5a6373 -5b5a735b5a735a637363637363636b63637363636b6363736363736363736363736363735a636b -6363735a636b5a636b5a636b5b5a735a5a6b525a6b686b7d000000 -000000525b73525b735a63735a6373525a6b525a6b525b735a6373525a6b5b5a73525b734a4a6b -4a526b4953744953744a4a6b4a4a6b424a6b4a4a6b4a4a6b4a52634a526b4a526b52526b52526b -525a6b525a6b5a5a6b5a636b5a636b5a636b5a636b5a636b525a6b5a636b5a5a6b5263635a636b -525a6b525a6b525a63525a63525a63525a6b525a634a5263525a63525a6b525a6b525a6b5a5a63 -5a5a6b5a636b5a636b5a636b5a636b5a636b5a636b63636b63636b63636b5a636b636373636373 -63636b5a636b63636b63636b6363736363736363736363735a5a6b6363736363735b5a735a636b -63636b6363735b5a7363637363637363637363637363637363637363636b63637363636b636373 -63636b5a636b5a63735b5a73525a6b5b5a7352526b686b7d000000 -000000525b735a63735a63736b737a8789958789956b737a52636b5a6373525a6b686b7d82858c -7679844a526b4a526b4a526b5252735b5a734a526b4a526b4a4a6b4a526b52526b525a6b525a6b -525a6b525a6b525a63525a6b5a636b525a63525a6b5a636b5a636b4a5263525a63525a6b4a5263 -525a6b525a63525a6b525a63525a6b4a5263525a6b686b7d5a636b4a525a5a5a6b5a5a6b5a5a6b -5a5a6b5a636b5a636b63636b63636b63636b63636b6363735a636b63636b6363735a636b63636b -63636b63636b63637363637363636b63637363636b6b6b7282858c686b7d63636b636373636373 -63637363637363636b63637363636b5a5a6b6363736363736363736363736363736363735a6373 -5a5a6b5a63735a636b5b5a735b5a735b5a734a526b65637f000000 -000000686b7d5a6373949d9eeae9ecffffffffffffffffffa4a8ae525a6b949d9ef6f5f8ffffff -ffffffcacad15a6373464a60b7bdbceae9ec686b7d4a526b52526b525a6b525a6b5a5a6b5a636b -5a636b525a6b9ca0a3eae9ecf6f5f8b7bdbc626b6b52636b525a639ca0a3eae9eceae9ecb1b2b4 -52636b5a636b525a6b5a636b525a63878995eae9ecfffffff6f5f8a4a8ae5a5a6b5a636b636373 -6363736363735a636b636373636373626b73636373626b73626b73636373636373626b73636373 -6363736c6373626b736b6b726b6b72686b7d5a52619ca0a3ffffff87899563636b636373636373 -6b6b726b6b7263637363637376798482858c686b7d6c6373626b736363736b6b72626b73636373 -5a5a6b5a637363637363636b5b5a735b5a7352526b686b7d000000 -000000686b7d686b7ddedfe2f6f5f88a9e9c82858cb7bdbc878995686b7df6f5f8f6f5f882858c -a4a8aeffffffb1b2b43e525acacad1ffffff6b737a4a526b525a6b525a6b525a6b5a5a6b5a636b -525a6b878995ffffffd4d7d5b7bdbcffffffb7bdbc4a525a949d9effffffd4d7d5b6c8c1ffffff -a4a8ae525a635a636b525a6b6b737affffffeae9ec878995b7bdbccacad1525a635a636b525a63 -525a635a636b6363735a636b5a5a6363636b5a636b525a635a636b6363735a5a6b5a5a6b636373 -63636b5a5a6b63636b63636b5a5a6b6b6b725a5a639ca0a3ffffff82858c635a6b65637f635a6b -5a5a6b5a5a6b6b6b7252525fb1b2b4ffffff76798463636b6b6b726363735a636b5a636b636373 -6363735a63736363735a5a6b5b5a735b5a73525273686b7d000000 -0000006363736b737affffffd4d7d55a5a6b5a63735a6373525a6b9ca0a3ffffffa4a8ae4a5263 -52636beae9eceae9ec4a526bcacad1ffffff6b737a4a526b5a5a6b525a6b525a6b5a636b5a6373 -4a525acacad1ffffff626b6b393f41d4d7d5ffffff525a63cacad1f6f5f85a636b464a48dedfe2 -eae9ec5a636b5a63734a525aa4a8aeffffff8789953e525a4a525a5a5a63525a63626b739ca0a3 -a4a8ae7679845a5a6b626b73949d9e747678767984a4a8ae76798463636b949d9e9ca0a36b6b72 -626b6b8789957476788789959ca0a376798452525f9ca0a3ffffff8789955a5a6b5a5a6b82858c -9ca0a382858c636373626b73b6c8c1ffffff8789957679846363736b6b72949d9e8789956c6373 -5a636b6363735b5a735b5a73525b735a5a6b52526b686b7d000000 -000000686b7d5a6373dedfe2ffffffcacad182858c626b735a636bb7bdbcffffff949d9e525b73 -525a6bdedfe2ffffff686b7dcacad1ffffff6b737a525a6b525a6b525a6b5a636b5a636b5a6373 -4a525ad4d7d5eae9ec626b73525a63b6c8c1ffffff626b73dedfe2dedfe25a636b5a636bd4d7d5 -ffffff6b6b725a6373525a63cacad1ffffff7476785a636b6363735a636b6b6b72eae9ecffffff -f6f5f8fff7ff8789956b6b72ffffffdedfe2eae9ecffffffeae9ecdedfe2ffffffffffffb1b2b4 -6b6b72ffffffeae9ecf6f5f8fffffff6f5f86b6b729ca0a3ffffff878995525a6bb1b2b4ffffff -f6f5f8ffffff949d9ecacad1fffffffffff7ffffffdedfe2747678eae9ecffffffffffffdedfe2 -6b6b726363735b5a735b5a735b5a735b5a7352526b686b7d000000 -000000686b7d5a636b767984dedfe2ffffffffffffb7bdbc525a6bcacad1ffffff878995525b73 -525a6bd4d7d5ffffff6b737acacad1ffffff6b737a525a6b5a63735a636b5a63735a636b5a6373 -4a525acacad1ffffff6b737a525a63dedfe2ffffff626b73d4d7d5f6f5f85a636b5a636beae9ec -fff7ff62736c5a6373525a63dedfe2f6f5f87476785a5a6b626b73525a63a4a8aeffffff878995 -5a5a63f6f5f8dedfe263636bf6f5f8eae9ec6b6b72b1b2b4ffffffb1b2b4626b73ffffffdedfe2 -5a5a6bf6f5f8eae9ec626b6b82858cffffffa4a8ae949d9effffff82858c747678ffffffa4a8ae -393f41d4d7d5fff7ff6b6b72b6c8c1ffffff949d9e626b73cacad1f6f5f85a6360767984ffffff -a4a8ae5a5a6b6363735b5a735b5a735b5a7352526b686b7d000000 -000000626b73686b7d5a63735a636b878995dedfe2ffffff949d9eb1b2b4ffffff878995525a6b -525a6bd4d7d5ffffff6b737acacad1ffffff7679845a6373525a6b878995eae9eceae9eceae9ec -a4a8ae767984ffffffeae9eceae9ecfffffff6f5f85a636b878995ffffffdedfe2dedfe2ffffff -eae9ec626b73626b73525a63dedfe2ffffff7679845a636b626b73525a63d4d7d5f6f5f8747678 -52525fcacad1ffffff747678f6f5f8cacad1464a609ca0a3ffffff82858c5a5a5aeae9ecdedfe2 -5a6360f6f5f8d4d7d55a5a6b626b6bffffffb7bdbc9ca0a3ffffff767984949d9effffffcacad1 -b1b2b4dedfe2ffffff747678b1b2b4ffffff7679845a5a63eae9eceae9ecb1b2b4b1b2b4ffffff -cacad15a5a6b6363735b5a735b5a735b5a735a526b747678000000 -000000626b73626b73626b6b626b73525a6b6b737affffffb6c8c1a4a8aeffffff949d9e525a6b -5a6373eae9ecfff7ff5a636bcacad1ffffff6b737a525a6b525a63747678dedfe2d4d7d5dedfe2 -a4a8ae4a525a878995d4d7d5b1b2b4dedfe2dedfe2626b6b525a63949d9ededfe2b1b2b4eae9ec -d4d7d55a5a6b626b7352525fcacad1ffffff7679845a636b626b7352525fdedfe2f6f5f8747678 -5a5a63cacad1ffffff767984f6f5f8d4d7d552525fa4a8aeffffff8789955a5a63f6f5f8dedfe2 -5a6360fff7ffd4d7d56363736b6b72ffffffb7bdbc9ca0a3ffffff767984a4a8aeffffffdedfe2 -dedfe2dedfe2dedfe2747678b1b2b4ffffff82858c63636bf6f5f8f6f5f8dedfe2eae9ecdedfe2 -b1b2b45b5a735a63735b5a735b5a735b5a735b5a73686b7d000000 -000000626b73626b738a9e9c7679845a636b82858cffffffb7bdbc6b737affffffcacad14a526b -82858cffffffcacad14a5263d4d7d5ffffff82858c767984767984686b7d4a52634a5b62525a63 -525a6b5a636b525f5a3e525a878995ffffffa4a8ae525a636363734a525a3e525a949d9effffff -949d9e525a63626b734a525aa4a8aeffffffa4a8ae4a525a686b7d5a5a63b7bdbcffffff747678 -4a525adedfe2f6f5f86b6b72f6f5f8d4d7d54a525aa4a8aeffffff8789955a5a63eae9ecdedfe2 -5a636bffffffcacad152525f747678ffffffb1b2b49ca0a3ffffff767984878995ffffff878995 -464a605a636b63637352525fb7bdbcffffff7679844a525af6f5f8d4d7d552525f52525f525a63 -63637363637365637f65637f5b5a735b5a735a526b686b7d000000 -000000626b73626b73f6f5f8ffffffeae9ecfffffffff7ff82858c4a5263cacad1ffffffeae9ec -f6f5f8ffffff9ca0a33e525ad4d7d5ffffffffffffffffffffffffb1b2b4525a63636373626b73 -5a636b767984eae9ecdedfe2ffffffd4d7d563636b525a6b82858cdedfe2dedfe2ffffffcacad1 -5a63605a636b6363735a636b5a636beae9ecffffffcacad1eae9eccacad1747678ffffffdedfe2 -cacad1ffffffb1b2b463635fffffffd4d7d54a525a9ca0a3ffffff8789955a5a63f6f5f8dedfe2 -5a636bf6f5f8f6f5f8b1b2b4d4d7d5ffffff82858c949a91ffffffdedfe2878995eae9ecf6f5f8 -b7bdbcd4d7d5dedfe25a5261a4a8aeffffffdedfe2b7bdbcb7bdbcffffffcacad1b1b2b4eae9ec -82858cb7bdbceae9ec7679845b5a735b5a735a5a6b747678000000 -000000626b735a636b767984a4a8aeb6c8c1b7bdbc767984525b735a63734a5263949d9ecacad1 -b1b2b4eae9ecffffff76798482858ca4a8ae9ca0a39ca0a3a4a8ae767984525a6b5a636b5a636b -525a6b626b73cacad1d4d7d5a4a8ae5a636b5a636b525a6b747678dedfe2d4d7d5a4a8ae5a6360 -5a636b5a636b5a636b63636b525a636b6b72b7bdbcdedfe2d4d7d59ca0a352525f82858cd4d7d5 -dedfe2a4a8ae6b6b725a6360b7bdbca4a8ae5a52617b8a84cacad17679845a5a63b7bdbcb1b2b4 -63635ff6f5f8eae9ecdedfe2eae9ecb1b2b463637363636bcacad1fff7ff949d9e6b737adedfe2 -f6f5f8eae9ecb1b2b46363736b6b72dedfe2f6f5f8d4d7d5636373b7bdbcf6f5f8f6f5f8dedfe2 -82858cf6f5f8cacad15a5a6b6363735b5a735b5a73747678000000 -000000626b735a63735a636b525a6b4a52634a5b62525a6b525b73525a6b5a63734a52634a5263 -3e525a6b6b72a4a8ae686b7d4a52634a52634a52634a52634a525a525a6b5a636b525a6b5a636b -5a636b525a6b4a525a4a5b62525a635a636b5a636b5a636b525a6b4a525a525a63525a635a636b -5a636b5a5a6b5a636b5a636b5a636b5a5a6b52525f525a63525a6352525f63636b525a6352525f -5a5a635a5a6363636b63636b52525f5a636b63636b635a6b525a6363636b6363735a5a6363636b -63636bf6f5f8cacad152525f626b6b63636b63637363636b5a5a6363636b636373635a6b525a63 -63636b5a636b5a5a6b6363735a5a6b5a5a6363636b5a636b6363735a5a635a636b626b7352525f -878995ffffff686b7d5a5a6b635a6b5b5a735b5a73747678000000 -0000005a63735a63735a63735a63735a63735a63735a63735b5a73525a6b525a6b5b5a735a6373 -5a6373525a6b4a5263525a6b5a5a6b5a636b52636b5a636b5a636b525a6b525a635a5a6b525a63 -525a63525a6b5a63735a636b5a636b5a5a6b525a6b5a5a6b5a636b5a636b5a636b5a636b5a5a6b -525a6b5a636b5a636b5a5a6b5a5a6b5a636b63636b5a636b5a636b5a636b5a5a6b5a636b63636b -63637363636b5a636b63636b63637363636b63636b626b736b6b726363736363736b6b726b6b72 -63635fffffffd4d7d5635a6b6b6b726c637363636b6363736b6b726c63736363736c63736c6373 -63637363637363637363637363637363637363636b6363736363736363736c63736b6b725a5a63 -7b8a849ca0a35a5a6b5b5a735b5a735b5a735a526b686b7d000000 -0000005a63735a63735a63735a636b525a6b525a6b4a5263525a6b5b5a73525a6b525a6b5a636b -5a5a6b5a636b5a6373525a6b525a6b5a5a6b525a6b525a6b525a6b626b737679845a63735a636b -7679846b737a52636b5a636b5a5a6b5263635a5a6b5a636b525a6b5a5a6b5a636b525a6b5a636b -5a636b5a5a6b5a636b5a5a6b5a636b5a5a6b5a636b5a5a6b5a5a6b5a636b63636b5a636b5a636b -63636b63636b63636b63636b63636b63636b63636b63636b63637363636b63637363636b6c6373 -63636ba4a8ae82858c6363736c63736363736363736c63736363736363736c6373636373636373 -6363735b5a73636373635a6b635a6b63636b6363735b5a7363636b636373636373636373636373 -5a5a635a5a6b6363735a5a6b5b5a735a63735a5a6b686b7d000000 -000000626b73525a6b8a9e9cdedfe2dedfe2eae9eccacad1767984525a6b525b735a63735a6373 -525b73525a6b5a5a6b525a6b5a5a6b5a636b5a636b5a636b4a525acacad1ffffff5a636b82858c -ffffff949d9e52525f5a636b5a636b5a5a6b5a636b5a636b5a636b5a636b5a636b5a5a6b525a6b -5a5a6b5a5a6b5a5a6b5a5a635a5a6b5a5a6b5a5a6b5a63605a636b5a5a6b635a6b5a636b5a636b -63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b -63636b5a5a63635a6b63637363637363636b63637363636b63636b63636b635a6b5a5a6b5b5a73 -5b5a735b5a735a5a6b5a5a6b5a5a6b635a6b6363735b5a7363637363636b63637363636b63636b -6363735a636b5a5a6b5a5a6b5b5a735b5a735a526b686b7d000000 -000000626b734a5263949d9effffffd4d7d5cacad1ffffffeae9ec686b7d525a6b525a6b4a5263 -4a5263525a6b5a636b525a6b525a6b4a52634a52635a636b4a525acacad1ffffff5a6360878995 -ffffff8789954a525a5a5a6b5a636b5a636b525a6b525a635a5a6b5a636b5a5a6b525a6b5a636b -5a5a635a5a6b525a6b5a5a635a5a6b5a5a6b5a5a6b5a636b5a5a6b5a5a635a636b5a5a6b5a636b -63636b63636b5a5a6b63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b -63636b63636b63637363636b63637363636b63636b63637363636b5a5a6b635a6b635a6b5a5a6b -5a526b5b5a735a5a6b5a526b5a5a6b635a6b5a5a6b635a6b63636b5a5a6b63636b63636b635a6b -5a5a6b5a5a6b5a5a6b5a5a6b5a526b5a526b52526b686b7d000000 -000000686b7d525a63949d9effffff949d9e2b423ab7bdbcffffff8789954a5263686b7d949d9e -8a9e9c5a6373525a6b626b7382858c8a9e9c878995626b734a525acacad1ffffff5a636b878995 -ffffff949d9e6363737679845a636b525a6b626b737679845a63735a5a6b5a636b5a636b5a636b -5a5a6b5a636b5a5a6b5a5a6b5a5a6b5a636b5a636b5a636b5a636b5a636b5a636b5a636b5a636b -63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b63637363637363636b -63636b63636b63637363637363636b63636b63636b63636b636373635a6b635a6b63636b5a5a6b -5a5a6b5a5a6b5a5a6b5b5a735b5a73635a6b635a6b63636b63636b63636b63636b63637363636b -63636b635a6b5a5a6b5a5a6b52526b5a526b52526b686b7d000000 -000000686b7d4a5b62949d9effffff949d9e464a60cacad1ffffff82858c6b737aeae9ecf6f5f8 -ffffffdedfe25a6360949d9efffffffff7ffffffffdedfe24a525acacad1ffffff5a636b878995 -ffffff767984b1b2b4ffffff7476784a525a949d9effffff82858c4a525a5a636b525a6b5a636b -5a5a6b5a636b5a5a6b5a636b5a5a6b5a636b5a5a6b5a5a6b5a5a6b5a636b5a5a6b655a605a636b -63636b63636b63636b63636b63636b63636b63636b63636b63637363636b63636b636373636373 -63636b63637363636b63637363637363636b63636b6363736363736363735a636b5a5a6b5b5a73 -5b5a735a5a6b635a6b635a6b5a5a6b636373635a6b5a5a6b63637363637363637363636b636373 -5a5a6b5a5a6b5a5a6b5a526b5a5a6b52526b524a6b686b7d000000 -000000686b7d525a639ca0a3ffffffdedfe2d4d7d5ffffffdedfe24a5b62cacad1f6f5f84a525a -767984ffffff9ca0a3525a638789953e525aa4a8aeffffff6b737acacad1ffffff5a636b878995 -ffffff82858c767984ffffff9ca0a3464a48b7bdbcffffff626b73525a6b5a5a6b5a5a6b5a636b -5a636b5a5a6b5a636b5a5a6b5a5a6b5a5a6b5a5a6b5a5a635a5a6b5a636b5a5a6b5a5a6b5a636b -63636b63636b635a6b63636b5a5a6b5a5a6b63636b63636b635a6b5a636b635a6b63636b63636b -63636b63636b63636b63636b63636b63636b63636b63636b63636b635a6b5a5a6b5a5a6b5a5a6b -5b5a73635a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b635a6b63637363636b63636b5a5a6b5a5a6b -5a5a6b5a5a6b52526b5a5a6b5a526b52526b524a6b686b7d000000 -000000626b734a5b629ca0a3ffffffdedfe2ffffffeae9ec626b735a636bf6f5f8eae9ecb1b2b4 -b7bdbcffffffcacad14a5b6282858ca4a8aecacad1ffffff747678cacad1ffffff5a6360878995 -ffffff8a9e9c464a60ffffffcacad13e525aeae9ecd4d7d5525a635a636b5a636b5a636b5a636b -5a5a6b5a636b5a5a6b5a5a6b5a5a6b5a5a635a636b5a636b5a5a6b5a636b5a636b5a636b5a636b -63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b63636b -63636b63636b63636b63636b63636b63636b635a6b63636b635a6b5a5a6b5a526b5a5a6b5a526b -5a5a6b5b5a735a5a6b5a5a6b5a5a6b5a5a6b5a5a6b635a6b63636b63636b5a5a6b635a6b635a6b -5a5a6b5a5a6b5a526b5a526b52526b525273524a6b686b7d000000 -000000626b734a5263949d9effffff82858c9ca0a3ffffff82858c5a636bfff7ffeae9ecd4d7d5 -dedfe2d4d7d5a4a8aeb1b2b4ffffffd4d7d5d4d7d5ffffff6b737acacad1ffffff5a636b878995 -ffffff949d9e393f41cacad1eae9ec63636bffffffa4a8ae4a52635a636b5a5a6b5a636b5a636b -5a636b5a5a6b5a5a6b5a5a6b5a5a635a5a6b5a5a6b5a5a6b5a5a635a5a6b5a5a6b5a5a635a5a6b -5a5a6b5a5a6b5a636b63636b63636b63636b5a5a6b635a6b635a6b63636b63636b635a6b63636b -63636b63636b63636b63636b63636b635a6b5a5a6b5a5a6b5a5a6b5a526b52526b52526b52526b -5a526b5a526b5a526b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b635a6b5a5a6b5a5a6b -5a5a6b5a5a6b52526b52526b52526b525273524a6b686b7d000000 -0000005a63734a52639ca0a3ffffff8a9e9c4a5263ffffffdedfe24a5263f6f5f8d4d7d53e525a -3e525a464a60525a63fff7ffcacad1393f41878995ffffff6b737acacad1f6f5f8525f5a878995 -ffffff8789953e525a878995ffffff949d9effffff7b8a8452525f5a5a6b5a636b5a5a6b5a5a6b -5a636b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a636b5a636b5a5a6b63636b5a636b5a636b -5a636b63636b63636b63636b5a5a6b63636b63636b5a5a6b63636b635a6b63636b63636b63636b -63637363636b635a6b63636b5b5a7363636b635a6b5a5a6b5a526b5a526b52526b52526b5a526b -5a526b5a526b5a5a6b5a5a6b5a526b5a5a6b5a5a6b5a5a6b5a5a6b635a6b5a5a6b5a5a6b635a6b -5a5a6b5a526b524a6b52526b524a6b525273524a6b686b7d000000 -00000065637f4a52639ca0a3ffffff9ca0a33e525aa4a8aeffffff878995a4a8aeffffffcacad1 -b1b2b4eae9ec82858cdedfe2eae9ec949d9ededfe2ffffff7b8a84b1b2b4ffffffb7bdbc949d9e -ffffffdedfe282858c52525feae9ecdedfe2eae9ec5a636b525a6b5a5a6b5a5a6b5a5a6b5a5a6b -5a5a6b5a5a6b5a636b5a5a6b5a5a6b5a5a6b5a5a635a5a6b5a5a6b5a636b5a5a6b5a5a6b5a636b -5a5a6b635a6b63636b63636b63636b63636b63636b5a5a6b635a6b63636b635a6b63636b636373 -63636b63636b636373635a6b63636b63636b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a526b5a526b -5a526b52526b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5b5a735a5a6b5a5a6b5a5a6b5a5a6b -5a527352526b52526b524a6b52526b52526b4a4a6b686b7d000000 -0000005a63734a526b767984cacad17679844a526b5a636bd4d7d5a4a8ae4a525aa4a8aeeae9ec -eae9ecd4d7d56b737a767984eae9eceae9eca4a8aed4d7d57679846b737aeae9eceae9ec767984 -cacad1ffffffa4a8ae3e525a9ca0a3ffffffb7bdbc52525f525a6b5a5a6b5a636b525a635a5a6b -5a5a6b5a5a635a5a6b5a636b5a5a635a5a6b5a636b5a5a6b5a5a6b5a5a6b5a5a635a636b5a5a6b -63636b63636b63636b63636b63636b63636b635a6b63636b635a6b63636b63636b63636b63636b -63636b63636b635a6b63636b63636b635a6b5a5a6b5a5a6b5a5a6b5a526b5a526b5a5a6b52526b -5252735252735a5a6b635a6b5a526b5a5a6b5a5a6b5a5a6b5b5a735a5a6b5a526b5a5a6b5a5a6b -52526b525273524a6b52526b524a6b525273524a6b65637f000000 -000000525a6b5b5a734a526b464a604a526b525a6b4a526b4a5263525a6b525a6b4a525a525a63 -525a63464a604a5a6b3e525a4a526352526b3e525a464a604a5263464a604a5263525a634a5263 -464a60525a6b5a5a6b52525f5a636bffffff949d9e4a525a5a5a6b5a5a6b5a5a63525a6b5a5a6b -5a636b5a5a635a636b5a5a6b5a5a6b5a636b5a5a6b5a63605a5a6b5a5a6b5a5a6b635a6b63636b -5a5a6363636b63636b63636b63636b63636b63636b635a6b63636b635a6b63636b63636b63636b -63636b635a6b63636b635a6b63636b5a5a6b5a5a6b5a5a6b5a5a6b5a526b5a5a6b52526b52526b -5252735a526b5a5a6b5a5a6b5a526b5a5a6b5a526b5a5a6b5a526b5a5a6b5a5a6b52527352526b -524a6b524a6b524a6b524a6b524a6b5252734a4a6b686b7d000000 -000000525b73525b73525a6b525b73525a6b525a6b525a6b5a6373525a6b525a6b5a636b525a6b -525a6b525a6b525a6b52526b525a6b4a526b52526b52525f4a526352526b52526b4a526352525f -5a636b464a60b7bdbceae9eceae9eceae9ec63636b525a6b525a6b5a5a6b5a5a6b5a5a6b5a5a6b -5a5a635a5a6b5a5a6b5a5a6b5a5a635a5a6b5a636b5a5a6b5a5a63635a6b5a5a6b63635f5a5a6b -655a605a5a6b63636b5a5a6b5a5a6b63636b5a5a6b63636b63636b63636b635a6b63636b635a6b -63636b635a6b63636b635a6b5a5a6b635a6b635a6b5a5a6b5a5a6b5a5a6b5a526b5a5a6b5a526b -5a526b52526b5a5a6b5a526b5a5a6b5a5a6b5a526b5a5a6b5a5a6b5a5a6b5a5a6b524a6b52526b -52526b524a6b4a4a6b524a6b524a6b524a6b4a4a6b686b7d000000 -000000525b73525a6b525a6b5a5a6b525a6b525a6b5a636b525a6b525a6b525a6b4a5a6b525a6b -525a63525a6b525a6b525a6b4a52634a52634a526b52526b4a52634a52634a526b52526b52526b -5a5a6b4a525a82858cb7bdbccacad174767852525f5a5a63525a6b525a6b5a5a635a5a6b5a5a63 -525a6b5a5a6b5a5a635a5a6b5a5a6b5a5a6b5a5a635a5a6b5a5a6b5a5a6b5a636b5a63735a6373 -5a6373635a6b635a6b63636b63636b635a6b63636b63636b63636b635a6b63636b63636b63636b -63636b63636b635a6b63636b635a6b5a636b635a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b -5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a526b5a5a6b52526b52526b52526b -524a6b524a6b494a73524a6b524a6b52526b4a4a6b686b7d000000 -000000525a6b5a636b52636b5a636b525a6b5a636b525a6b525a6b5a636b52636b646b635a5a63 -525a6b4a526b52526b525a6b4a526352525f4a52634a5263464a604a52635a52614a526352525f -525a6b52526b4a52634a525a3e525a52525f5a5a6b525a63525a63525a635a5a63525a635a5a6b -63635f5a5a6b5a5a635a5a6b5a5a635a5a6b5a636b5a636b655a605a636b5a5261794e457c4626 -794e45655a605a636b63636b63636b63636b5a63735a637363636b63636b635a6b63636b635a6b -5a5a6b635a6b63636b635a6b635a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b -5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b5a5a6b52526b524a6b525273524a6b -524a6b4a4a6b525273524a6b524a6b524a6b464a60686b7d000000 -0000005a5a6b5a63734a52639c7e3c62736c525b734953745a5a6b4a5a6b7274429b9218646b63 -4a526b4a526b494a734a52634a4a6b424a6b424a6b464a60494a733e525a7b7a314a526b4a4a6b -525a634a526b5c63509b9218807c45525b73525a6b525a6b52526b525a6b4a526b5a636b464a60 -727442635a6b5a5a6b5a5a6b5a5a6b5a5a6b655a60655a605a636b5a5a63a92b0cd31f00b11700 -b11700a6342163636b5a5a6b635a6b63636b794e45794e455a526163636b5a6373635a6b63636b -635a6b635a6b635a6b5a5a6b63636b635a6b5a5a6b5a5a6b635a6b5a5a6b5a5a6b5a5a6b5a5a6b -5a5a6b635a6b5a5a6b5a5a6b5a5a6b5a526b5a5a6b5a5a6b5a5a6b52526b52526b525273524a6b -524a6b525273524a6b524a6b4a4a6b52526b4a4a6b686b7d000000 -0000005a636b5a6373525f5a9b921862736c5f735a807c455a636b49537476612c646b63525a63 -646b635a6360807c455a63605b6b51807c45646b5a52525f807c454c524d7b7a31525a63807c45 -525a6b52526b52634a7b7a317b7a316b7366807c455a5a6b807c455a5a6b807c455a5a6b727442 -8c86225a5a6b5a5a6b635a6b5a5a6ba63421d31f00c630115a6373a63421c21e00b11700d31f00 -b224009f1a00655a6063636b5a6373794e45b11700b117009f1a0081250c794e455a5a6b63636b -63636b635a6b63636b635a6b63636b63636b635a6b5a5a6b5a5a6b5a5a6b635a6b635a6b5a5a6b -5a5a6b5a5a6b5a5a6b5a5a6b5a526b5a526b5a5a6b5a526b52526b52526b52526b524a6b524a6b -5252734a4a6b524a6b524a6b524a6b52526b4a4a6b686b7d000000 -0000005a636b5a63735c63508c8622646b5a7d7a249b9218626b6b4953747b7a319b92185a5a5a -9b921872694676612c7b7a317d7a249b92188c86225b633a9b92187274425d6b3f7269469b9218 -646b5a525273555a429b9218807c45535a4c8c86227b7a31807c455c63509b92187274428c8622 -8c86225b5a73655a605a6373794e45e22300d31f00c63011a63421ca2a009f1a00b22400d31f00 -b224009f1a00794e455a6373794e459f1a00b117009f1a009f1a007d15009f1a00794e4563636b -635a6b63636b635a6b5a5a6b635a6b63636b635a6b5a5a6b635a6b5a5a6b5a5a6b5a5a6b5a5a6b -635a6b5a5a6b5a5a6b5b5a735a5a6b5a526b5a526b525273524a6b52526b524a6b494a73524a6b -524a6b524a6b4a4a6b524a6b5252735252734a4a6b686b7d000000 -0000005a636b525b735d6b3f9b9218807c455d6b3f727442646b5a4953745d6b3f807c45424a6b -9b92185a636b8c8622807c455b633a76612c5d6b3f5b633a5b633a7b7a315d6b3f7d7a249b9218 -7274429c7e3c5d6b3f8c8622807c45646b5a9b9218575a33807c4576612c9b92187b7a315d6b3f -7b7a31635a6b5a5a6b5a5a5ae62f10e22300d31f00e22300d31f00a92b0cb11700d31f00c21e00 -9f1a00794e456363735a5a5a9f1a00b11700b117009f1a009f1a009f1a00b11700794e455b5a73 -635a6b635a6b635a6b63636b5a63735a6373636373635a6b5a5a6b635a6b635a6b5a5a6b635a6b -5a5a6b5a5a6b5a5a6b5a5a635a527352526b5a526b52526b52526b524a6b525273524a6b4a4a6b -525273494a73524a6b524a6b524a6b5252734a4a6b686b7d000000 -00000063636b525b737b7a317b7a317b7a3176612c7b7a316b73664953747b7a31778469535a4c -9b92187274428c862272744276612c7d7a247b7a315b633a7d7a247b7a3176612c7d7a24727442 -4a525a525f5a5b633a7b7a317d7a247b7a318c862263635f76612c7d7a24807c45555a427d7a24 -7b7a31635a6b5a636bc63011e223009f1a00e22300e22300a92b0c9f1a00d31f00ca2a009f1a00 -a634215a637363636b81250c4c1b0d4c1b0d4c1b0d9f1a009f1a00b11700a92b0c6b5a6b63636b -6c637363636b6363735a52617732237732235a52616363735a6373635a6b63636b5a5a6b63636b -63636b525a6b7b8a846273634a525a5b5a735a526b5a526b524a6b52526b525273524a6b524a6b -524a6b524a6b525273494a73524a6b52526b4a4a6b686b7d000000 -000000626b73525a6b726946525a635d6b3f5c63505b6b515a6b5c495374575a339b9218726946 -555a42575a338c8622726946555a425b633a555a425b633a9b92185a5a5a7b7a31575a339b9218 -63636b525b734c524d9b92187d7765575a339b92185d6b3f9c7e3c4b52429b92185a5a5a8c8622 -9c7e3c525b73a63421ef1800c21e00c21e00f422009f1a009f1a00d31f00d31f0081250c50451e -4a3e40525a6b7732234c1b0d060f10060f1025161881250c5b341b81250c4c524d393f412b2821 -393f414a525a5a526b773223b11700b117007d1500773223655a6063637363636b635a6b63636b -5a5a6b74767894a5926380665263525a526b5a5a6b52526b524a6b525273525273524a6b524a6b -525273524a6b4a4a6b524a6b4a526b5252734a4a6b686b7d000000 -0000005a636b5a63735a6373626b6b4953745a6373525b73626b6b6b7b6252526b42526b525a6b -4a526b4a526b424a6b4a526b4a4a6b424a6b494a73575a33726946424a6b464a604a526b424a6b -525a6b525a63525a6b52526b52526b52525f4953744a5263525a6b525a6b4a4a6b5a5a6352525f -495374794e45a63421ef1800e22300e22300a92b0c9f1a00d31f00d31f00a92b0c7c46262b2821 -1821184a3e404c1b0d0d16182a31292c39292a33202a31292129212129212b28212b2821212118 -1821101821102d2718b11700b1170081250c81250c7d15007d1500773223655a60636373635a6b -63636b94a5926b89665b6b515b5a735a526b5a526b524a6b52526b52526b524a6b4a4a6b524a6b -494a734a4a6b4a4a6b4a4a6b524a6b52526b4a4a6b686b7d000000 -0000005a636b525b737274429b92187d7765495374495374727442807c45495374525a6b4a526b -4a526b4a4a6b4a526b424a6b424a6b52525f494a734a525a4a4a6b4a4a6b4a526b535a4c807c45 -7b7a31646b5a494a73525a6b525a6b495374525a6b52526b52526b5252734a4a6b7b7a31626b6b -794e459d7a66a5523aef1800f42200ef18007c46267c4626d31f00c21e0050451e3940311a1610 -555a4250451e212118394031394031394031394031394031394031394031394a3a3940312e3734 -2c39292b28212121182d27184c1b0d7d1500a92b0cc21e009f1a00c21e00794e455a637363636b -525f5a5a6b5c5f735a5a636b5a52735a5a6b5a526b52526b52526b52526b524a6b525273524a6b -524a6b524a6b524a6b524a6b52526b4a4a6b464a60686b7d000000 -0000005a636b525b735d6b3f7b7a31807c456b7b62646b5a8c86227d77656b7b62646b5a646b5a -646b5a807c455a5a635c6350807c45494a73807c4552525f7274425a52614953744b52429b9218 -9b9218646b5a807c4563636b646b5a807c455a5a6363635f5a5a63807c4563635f5d6b3f726946 -84635f949d9ecd4825ef1800e22300f42200794e455b6b5176612c7c4626394031251618100810 -3940312b2821394031415240394a3a3940314152404b52424b5242535a4c4c524d535a4c4c524d -4b5242464a4841524039403121372e1826222b282177322381250c5b341b5b5a73636373626b6b -6b80755b6b515a636b5a5a6b5a5a6b5a526b5a5a6b52526b52526b524a6b525273524a6b52526b -4953744a4a6b524a6b52526b52526b4a4a6b464a60686b7d000000 -00000052636b4953747b7a31c0852f5f735a8c86227b7a317b7a31807c458c86227b7a318c8622 -807c458c86227b7a317d7a248c86227269467b7a317269468c8622807c45494a73464a489b9218 -9b92185c63507b7a317274427d7a249b92187269467b7a317269465b633a8c86225d6b3fa5523a -94a592bc7a65f42200ca2a00e22300c630115b6b517269465d6b3f555a42212118101010181818 -1008102e37344c524d4152404152404c524d535a4c535a4c52634a5c63505c63505c63505c6350 -5c63505c63505a63605c6350535a4c4152402e37341826221826220d16182129215a6360646b63 -5f735a5a6b5c5a5a6b5a5a6b525b7352526b52526b52526b52526b4a526b52526b524a6b4a4a6b -52526b4a4a6b4a4a6b4a526b4a526b4a526b424a6b686b7d000000 -0000005a636b525b737b7a319b92185b6b519b9218807c457274425d6b3f9b9218807c45727442 -5b633a9b92187b7a315b633a5b633a7d7a2452526b555a429b9218807c45494a734b52429b9218 -8c862263635f8c86227b7a315b633a5d6b3f72744276612c727442807c45807c457d7a249a9680 -9a9680f42200d31f00a92b0cc630117269465b6b515b633a5c635041311d100810181818212118 -212921535a4c555a424b5242535a4c52635252634a535a4c5b6b514b52424152404c524d495a4b -535a4c535a4c525f5a535a4c5263525c63505c6350485a424152402a3320394a3a495a4b627363 -6273635b5a735a637352525f7732235a5261525b7352526b52526b52526b5252734a4a6b524a6b -4a526b524a6b4a4a6b4a4a6b4a526b4a526b464a60686b7d000000 -0000005a636b525b735d6b3f7d7a247b7a317b7a315a636b7b7a315d6b3f8c8622525a637b7a31 -5b633a807c454a525a7b7a315d6b3f7d7a24646b5a575a337b7a314a4a6b494a73555a4276612c -5b633a7b7a317d7a247b7a3176612c7b7a317b7a317b7a317b7a317b7a318c86228c8622a5ae97 -e62f10e22300a92b0cb2240077322352634a7269467269463949291008102121211818182b2821 -495a4b5c6350535a4c535a4c52634a535a4c535a4c52634a495a4b182118181818394a3a394a3a -4152404152404b52424152404c524d4b5242535a4c5263525c63505263528789956380664f6b50 -2e37344a525a5a52619f1a00c21e0081250c5b341b5a5273525b7352526b52526b4a4a6b4a526b -525273524a6b4a4a6b4a526b4a4a6b4a4a6b464a6065637f000000 -0000005a6373525b735c63505d6b3f52634a7b7a31807c455c635052525f7b7a31807c455c6350 -4a525a8c86227274424b52425d6b3f474a369b9218464a488c8622646b5a494a734b524263635f -464a48555a428c862272744252634a555a424b52429b92187269468c86229c7e3c807c45cd4825 -f42200b22400b22400e22300c63011555a42726946474a36100810212118182118212118415240 -5c6350526352535a4c52634a526352535a4c52634a4152402c3929212118060f102b2821394031 -394a3a464a483940312e37344152404b52424b5242415240495a4b5a63605a6b5c6b8966535a4c -2a31291821182d271881250cb117007d15007d15007d15004c524d494a735252734a4a6b52526b -4a526b4a4a6b4a4a6b4a4a6b4a4a6b4a4a6b424a6b636373000000 -0000005a6373525b73525a6b525b73525b73646b5a5a636b525b73525b7342526b525a634a526b -52526b464a604a4a6b4a526b4a4a6b494a73424a6b4a4a6b424a6b4a4a6b464a604a4a6b4a4a6b -4a4a6b4a4a6b464a6049537452526b5252734a4a6b4a4a6b464a60a5523a8cb0a1bd734ff42200 -ca2a00b11700bd734fc63011f42200a64b235f735a474a36181818212118101010181818394a3a -5a6b5c5c635052634a526352535a4c52634a535a4c3940312c3929212118101010101010212921 -3940313940311010100808081010102c3929495a4b495a4b62736c525f5a5f735a495a4b5c6350 -5a6b5c4b52422a31292121182d27187d1500b117009f1a007d1500773223524a6b4a4a6b52526b -4a4a6b4a4a6b4a526b4a4a6b4a4a6b4a4a6b464a6065637f000000 -000000525b73525a6b525b73525b73525a638c8622626b6b525b73646b5a525f5a727442495374 -4a526b494a7352525f424a6b727442726946726946424a6b424a6b424a6b4a4a6b4a4a6b4a526b -4a4a6b52526b52526b52526b5b5a7352526b52526b525273794e459ca28fb7937bf42200d31f00 -9f1a00a5523aa1c1b7cb543bef1800f42200c63011485a422121211818182121212129214b5242 -5a6b5c5a6b5c5c63505c6350535a4c535a4c2c39292121183940311818181818180d1618101010 -2121212c39290811081010101010100718102a31295a6b5c8aa0946273635f735a181818101810 -4152405c63505263524b52422a31292b28214c1b0d25161881250cd31f00794e4549537452526b -4a4a6b4a4a6b4a526b4a4a6b4a4a6b4a526b464a60686b7d000000 -000000525a6b4953745a636b7784695b6b519b9218525b734a526b9b92185b6b518c86226b7366 -52525f807c454a526b424a6b7d7a248c86225d6b3f5a5a6363635f52525f52526b5a5a634a526b -4a4a6b524a6b524a6b4a526b52526b52526b495374794e459d7a66a5ae97e62f10e22300b22400 -c63011b1b2b4a1c1b7b7937bf42200e22300f422004c1b0d0d16182121182121214152405c6350 -5b6b51646b635b6b515a6b5c485a424b524227272c1018101818181826221818181818181a1610 -1010101010100808081010101010100008052e37345a6360627363587b4e4b5242071810000000 -0808082a3129535a4c5c63505c63504152402129210d16180d161841311d464a6052527352526b -4a526b4a4a6b4a4a6b4a4a6b4a4a6b4a4a6b464a6065637f000000 -0000005a63734953747b7a318c86227274429c7e3c5a6373464a608c86227269468c86227b7a31 -7274429b921863635f424a6b5b633a9b92187274427b7a318c86225b633a8c86227b7a315a5a63 -4a4a6b52526b524a6b52526b52526b495374655a609d7a669cada5cd4825ef1800b22400b22400 -b09f93a1c1b7b1b2b4b6c8c1cd4825f42200f4220081250c0d16182b28212d27182b2821526352 -646b5a627363646b635f735a535a4c485a422c3929212121181818181818181818181818101010 -1018101010101010101010101010101821185a63606b7b6b587b4e4c524d2e3734101010001008 -0808082e37344c524d4b5242535a4c5c6350535a4c3940312129180d1618181818393f41524a6b -52526b4a4a6b4a4a6b4a4a6b4a4a6b4a4a6b464a6065637f000000 -0000005a63734a526b7274425d6b3f7b7a31587b4e52527342526b7274424a525a5d6b3f5b633a -8c86229b921863635f463d7b575a339b92187b7a318c86228c8622575a339b92187d7a24494a73 -4a4a6b4a4a6b4a526b52526b4a526b524a6ba5523a94b3a5cb543bf42200c63011b11700bc7a65 -a1c1b7a5b4a5b6c8c1bc7a65f42200e22300c21e002121182121212b28212b28212b28214b5242 -5f735a6273636273636b736652634a212921212118182118181818181818181818181818101010 -1818181010101010101010101018104a525a62736c5f735a2f4231394a3a212121081108101010 -0808082129215263524b5242415240495a4b5263525c63504b52422c392918181827272c525b73 -4a4a6b4a4a6b4a4a6b4a4a6b494a734a4a6b464a60686b7d000000 -0000005a63734a526b7b7a317b7a317b7a31807c45495374464a607b7a315c63507b7a315b633a -7d7a24646b5a4a4a6b424a6b5b633a7d7a248c86227b7a31524a6b575a339b92187b7a31494a73 -4a4a6b4a4a6b52526b4a4a6b495374a5523a8a9e9cbc7a65f42200c63011b11700bc633ca1c1b7 -a5b4a5b6c8c1b09f93f42200d31f009f1a002d27180d16182a31292d27182b28212b2821415240 -6273636b73666b73666273635a6b5c212118181818181818181818181818181818101010101010 -0d1618181818181818001008525f5a9ca0a35f735a485a42080808101010101010101010081108 -101010080808394a3a5a6b5c5263524b5242415240535a4c526352535a4c394a3a21291827272c -3e525a494a734a4a6b424a6b4a3e40524a6b424a6b686b7d000000 -000000525a6b525b734b52429c7e3c525f5a5c6350495374494a735d6b3f807c45555a42535a4c -4b52429b9218525273424a6b535a4c555a42535a4c76612c807c45464a48575a335c6350525273 -52526b4a4a6b524a6b495374794e459d7a669ca28ff42200e22300b11700a64b23a5b4a5b1b2b4 -a1c1b7b1b4a2e62f10d31f00b224005b341b39492939403125161825161841311d2b2821394a3a -5f735a6b73666b73666b73665f735a2e37340d1618181818181818101810181818181818101810 -1010101018100808084152409cada56b896652634a071810101010080808071810101010101010 -1010100718101010104b5242646b5a6b7b6b525f5a415240555a4252635252634a4b52422c3929 -1821182e37344a4a6b4a3e40b117009f1a004a3e4065637f000000 -000000525b73525b734953745a6b5c495374494a734a526b52526b424a6b4a4a6b4a4a6b494a73 -524a6b424a6b4a4a6b4a4a6b4a4a6b424a6b494a73464a60424a6b4a4a6b4a4a6b494a734a4a6b -4a4a6b524a6b495374794e4584635f9cad9ce62f10e22300b22400c63011a5ae97b1b2b4a1c1b7 -b6c8c1cd4825e22300c21e007732234e52345b633a587b4e4f6b502a33202b2821182118182622 -646b5a6b73666b7b6b6b73665f735a415240181818212118101810181818101810101810181818 -1818181010102129215a6360788c7b5f735a182118080808101010071810100810101010101010 -0718101010100808081821184152405a6b5c8aa094646b63415240495a4b525f5a52634a535a4c -41524021291818262281250cb2240081250c7d1500794e45000000 -000000525a6b494a73807c459b92185a63605a5a63494a73424a6b494a73494a73424a6b424a6b -5b633a63635f463d7b424a6b424a6b463d7b464a48646b5a463d7b4a4a6b4a4a6b4a4a6b525273 -4a4a6b4953745a5261a5523a8cb0a1cb543bf42200b22400b11700b7937ba1c1b7a5b4a5b6c8c1 -cb543be62f10c21e0081250c4e52344e5234516b3d76612ca64b232c39292b2821181818182110 -646b5a62736c6b7b6b6b73666273634b5242182118212118182622181818181818101810101010 -1818181010106b737a7384765f735a21372e080808101010080808080808071810101010101010 -0808080718100718100808082a3129394a3a535a4c6273630d16182a332041524048634d526352 -535a4c4b52422e37341821184c1b0d531100531100a5523a000000 -0000005a6373424a6b8c86224953745d6b3f9b92185b5a73807c45494a73807c4563635f52525f -9b921863635f807c454a526b646b5a5a5a638c8622726946494a734a4a6b4a4a6b5252734a4a6b -4a4a6b5252737c4626879488bc7a65f42200c630119f1a00bd734fa1c1b7a5b4a5b6c8c1b7937b -ef1800ca2a00a92b0c474c294e52344e52345d6b3fcd4825f422005b341b0d1618081108415240 -6b73666b73666b7b6b6b73666273635c6350212118181818181818182118181818181818181818 -080808525f5a7384766b8966394031081108101010101010081108080808080808101010101010 -081108100810080808060f101010104152404152402c3929101010081108101810394031485a42 -5a6b5c526352495a4b41524021372e1818180010084c524d000000 -000000525a6b494a73575a339c7e3c535a4c9c7e3c3e525a8c86225c63508c86227b7a31727442 -9b921852525f7d7a245d6b3f8c86227274429b9218646b5a494a734a4a6b4a4a6b524a6b524a6b -495374a5523a7d8476b7937bef1800d31f009f1a00a5523a9bb5ada5b4a5b6c8c1b09f93e22300 -d31f00a92b0c5b341b4e52344e5234474c29b09f93b7937bf42200f42200a92b0c4a3e405a6b5c -5f735a6b736662736c6b7b6b6b73665a6b5c2a3320101010181818181818212118182622101010 -393f4162736c778469485a42071810101010101010101010101010101010080808071810100810 -0718100808081010100808080000001818182f42310808080808081010100808082a312962736c -4152405b6b51525f5a52634a495a4b4152401818184c524d000000 -0000004a526b5252733f33657d7a247274425a636052525f9b92185c63505b633a76612c5d6b3f -5d6b3f63635f9b9218726946555a427274425b633a646b5a494a734a4a6b4a4a6b524a6b495374 -794e4584635f94a592e62f10e22300a92b0cc63011a5b4a5a5b4a5a1c1b7b7c7b2e62f10d31f00 -b224007732233e52314e52343e52319d7a66b6c8c1b6c8c1cb543bf42200f42200cd48254f6b50 -6273634c524d4b52426b80756b7b6b6273634152401818181818181818181818181818182e3734 -646b636b7b6b4f6b50181818101010101010101010101010101010071810101010060f10071810 -10081010101008080808080827272c2e3734394a3a2c39292121211018100808080010086b8075 -6b7b6b495a4b5a6b5c5b6b51526352495a4b415240646b63000000 -0000005252734a526b5a63607b7a317b7a317274425d6b3f8c862272694676612c5d6b3f7b7a31 -7b7a317b7a318c86225d6b3f7269465b633a8c8622646b5a494a73494a734a4a6b495374655a60 -9d7a66949d9ecd4825f42200b22400b22400b09f939bb5ada5b4a5a1c1b7cb543be22300ca2a00 -81250c3e52314e52343e5231726946b7bdbcb6c8c1b6c8c1b1b2b4e62f10f42200f42200a5523a -48634d4a3e403940315c63506b807562736c646b5a2a31291818181818181018102121215a6b5c -6273635f735a2129210718101a1610101810101010101010101010101010101010101010071810 -1010100811080d16185c63507a8c7284947b8c947b8c947b7d84766b73665c63502a31292b2821 -5a6b5c5a6b5c5263526273635a6b5c526352394a3a6b8075000000 -000000525273424a6b76612c9c7e3c3e525a7b7a315b633a9c7e3c535a4c555a42535a4c575a33 -9b92184b52429b92185c63505a5a5a464a489b9218646b5a494a73524a6b494a735a526ba5523a -8a9e9cbd734ff42200c63011b224009d7a667b8a84a5b4a5b6c8c1bc7a65f42200ca2a00a92b0c -474c294e52343e52315b633ab1b2b4b6c8c1b7c7b2b7c7b2b6c8c1b09f93f42200f42200a63421 -495a4b394a3a464a48394a3a62736c6b7b6b6b7b6b4b52421821181821180d16185a636062736c -6b89662f4231181818181818101010101010101010101010101010101010101010101010101010 -1010100718106b736684947b788c7b858c757784697d84765b6b515b6b517784697a8c726b7b6b -5c63504b5242495a4b5a6b5c6b7b6b2e37340000005a5a5a000000 -000000494a73495374424a6b494a73494a73494a73494a73424a6b494a73494a73494a73494a73 -463d7b424a6b494a73424a6b494a734a4a6b424a6b494a734a4a6b4a4a6b495374a5523a879488 -bc7a65f42200ca2a009f1a00bc633c7679849cad9ca1c1b7b7937bf42200ca2a00a92b0c50451e -474a363e5231474c29b09f93b6c8c1b7c7b2b6c8c1b6c8c1b6c8c1b7937bf42200cd4825464a48 -2c3929464a48464a48394a3a4c524d7384766b7b6b5f735a2e37341821184c524d7476786b8966 -415240101010181818212118181818101010101010101810101010101010101010101810181818 -0718104b52428c947b858c758c947b8c947b6b7b62525f5a535a4c535a4c535a4c5b6b515b6b51 -7784697784695b6b51495a4b394a3a0718100000004a525a000000 -0000004953744953744953744a526b494a73494a73495374495374494a734a526b4a526b4a526b -52526b52526b4a526b4a4a6b495374494a734953744a4a6b4a4a6b495374794e457d7765949a91 -e22300e22300a92b0ccd48257b8a848aa094a1c1b7b1b4a2e62f10d31f00b224005b341b474a36 -4e5234474c299d7a66b6c8c1b1b2b4b6c8c1b7c7b2b6c8c1b1b4a2f42200d31f004e5234394a3a -1008102c3929474a362c39292e37346b7b6b6b7b6b6b7b6b485a422b423a949d9e6b7b624f6b50 -1821181818181818181818181018101018101010101010101018101818180d1618101810071810 -3940316b89668c9c7b8794888c947b7d8476646b5a5a636052634a5a6b5c6b7b62535a4c5b6b51 -5c63505263526b7b626b8966555a421818180000004c524d000000 -0000004953744a4a6b494a73494a73525273494a734a4a6b4a4a6b424a6b494a7349537442526b -4953744a526b4a4a6b4a4a6b494a734a526b4a526b4a4a6b494a73655a60a5523a8a9e9ce62f10 -e22300b22400c630117d77657b8a84a5b4a5b6c8c1cd4825e22300b224007732234e52344e5234 -39492984635fb7c7b2a1c1b7b6c8c1b6c8c1b6c8c1b1b2b4e62f10f422007c4626394929476336 -5c63502b28212c39292121184c524d6b7b6b6b7b6b62736c6b7b6b8789955a6b5c5f735a2a3320 -18262221212118181810181010101010101010101010101010101010101010181010101027272c -6b7b626b7b6b9ca28f9ca28f84947b94a59284947b646b5a646b5a849473646b5a5f735a6b7366 -646b5a495a4b5b6b517784695f735a6b73662c39295a5a5a000000 -000000495374494a733ba1683ba1683ba1683ba1683ba1683ba1686b7b6276612c7c4626a5523a -655a60524a6b4a526b4953744a4a6b49537452526b4953745a5261a5523a8a9e9ccb543bf42200 -b22400b2240084635f6b80759cada5b6c8c1bd734fef1800c21e0081250c474c294e5234474a36 -5b633ab1b4a2b6c8c1b7937be62f10b1b4a2b6c8c1cb543bf422007c4626394929474c293e5231 -516b3d2a33201818184152406b7b6b62736c6b7b6b6b7b6b7b8a847384766b7b622c3929101010 -1818181821182121211818181818180d16181a16101018100d16181818181010101821185f735a -7d847677846984947ba5b4a5889e8a8c9c7b84947b6b7b6b778469646b5a6b7b6b788c7b858c75 -7784697784695f735a6b7b626b73666b7b626b7b62879488000000 -000000495374494a733ba1683ba1683ba1683ba1688cb0a1526363738476b09f93cb543b794e45 -5a2586524a6b52526b525273494a73524a6b4a526b525273a5523a7b8a84bc7a65ef1800c63011 -9f1a00a5523a6b8075949d9ea1c1b7b7937bef1800ca2a009f1a00474c294e52343e52314e5234 -b09f93b6c8c1b1b4a2cb543be62f10e62f10bd734ff42200a92b0c394929474c293949293e5231 -212918181818394a3a5f735a646b636b73666b7b6b6b8075646b636b7b6252634a181818181818 -1018101818181818181818181821181818181010101818181818181018101010102a3320738476 -7d84767a8c727a8c72a5b4a5a5ae978c9c7b7d84765b6b517d84766b73668c947b8c947b849473 -858c757a8c727d84766b7b6b6b73666b7b626b7b62949a91000000 -0000004953745252733ba1683ba1683ba1687a9487686b7d393f415a52618789957476785a2586 -4b188a5a5273525273495374494a73525273495374794e457d77659a9680ef1800e223009f1a00 -cb543b8aa0948aa094a1c1b7b09f93e62f10d31f00a92b0c5b341b4e52344e5234474c299a9680 -b6c8c1a1c1b7cb543bb1b4a2b1b2b4e62f10f42200e62f104e5234474c29474c293e52312a3320 -1818183940316273635a6b5c646b5a5f735a646b635a63606b89665f735a62736c4152400d1618 -2121210d16181010101010101818181821181818181818181818181818181010102e37347a8c72 -858c7584947b788c7b8c9c7bb7c7b29ca28f8c947b646b635f735a6b7b6b84947b8c947b84947b -858c757a8c727a8c727a8c727784696b7b62646b5a879488000000 -000000495374494a733ba1683ba168626b735a63737679844c524d6b6b726b6b72393f41767984 -733f73524a6b5252734a4a6b525273495374794e459d7a6694a592e62f10e22300a92b0ca92b0c -8794889bb5ada5b4a5b1b2b4cd4825e22300b224007732233e52314e52343e52319d7a66b6c8c1 -8a9e9ca5523abc7a65a1c1b7a1c1b7b7937bd31f00f42200c63011394a203e52312a3320101810 -2a31295a6b5c5b6b515a6b5c5c63506b80756b737a6273635f735a6b7b6b6b7b6b6273632a3129 -1818182121181818181818181018101010100d1618181818182118212118181818394a3a858c75 -7a8c728494738c947b858c75a5ae97b7c7b2a5ae978c947b646b5a6b7b627a8c728c9c7b84947b -84947b858c75858c757a8c727a8c727a8c726b7b62949a91000000 -000000495374494a733ba1683ba1683f33654c524d5a5a6327272c393f41393f41393f41464a60 -cb543b733f734953745252734953745a526ba5523a8a9e9ccd4825ef1800b22400b117009a9680 -8794889cada5a1c1b7cb543be22300c21e0081250c4e52344e52343e5231794e45b1b4a294b3a5 -84635fbd734fa1c1b76b8075a5b4a5a1c1b7bc7a65d31f00f42200a634212f4231101010182118 -5c63505a6b5c5a6b5c5a6b5c6273638794889cad9c5f735a5263524152406b7b6b6b7b6b5c6350 -2121211821181821181818181818181818181818181010101818181821182121211818185b6b51 -889e8a84947b8c947b84947b8c947bb1b4a2b7c7b29cad946b7366646b5a77846984947b8c947b -788c7b858c757a8c727a8c727a8c727a8c726b8966949a91000000 -0000005252734953746b89666b7b62393f41464a4818262241311d2624102e37344a3e403e525a -bd734f794e45495374495374525273a5523a8a9e9cbd734fef1800ca2a00b11700bd734f8cb0a1 -9cad9ca1c1b7bc7a65f42200ca2a00a92b0c474c294e5234415a31575a33b1b4a2a1c1b77d7765 -cb543b9ca0a36b736663635f738476a5b4a5a1c1b7bd734fe22300a92b0c101810101010415240 -646b5a5b6b515a6b5c5263527384769bb5ad587b4e5b6b51394a3a3940314152406b807562736c -4b52421818181818181821181821181818181818181821181818181818180d1618182118394031 -8c9c7b8794888c9c7b8794888c947b889e8ab7c7b2b1b4a29cad946b73665a6b5c7a8c72889e8a -8c947b84947b858c75858c757a8c727a8c72778469949a91000000 -0000005252734953749c7e3c84635f393f41464a48393f412b282127272c393f413f3365464a48 -bc7a656b5a6b494a73495374794e457d77659a9680ef1800ca2a009f1a00a5523a6b8075889e8a -a1c1b7b09f93e22300ca2a009f1a0050451e4e5234476336474c299a9680a1c1b77b8a84cb543b -b09f938aa094747678949d9e9bb5ada5b4a59dbdad9d7a66e2230077322310251b2c39295a6b5c -5b6b515a6b5c5b6b516273635a6b5c6b7b625f735a415240394a3a394a3a3940314c524d6b7b62 -627363394a3a0808081818181818181821181818182121212121182121212129211821184b5242 -8c9c7b8794888c947b8c947b8c947b84947b9cad94b7c7b2b1b4a26b73667d8476778469858c75 -889e8a8c947b84947b849473858c757a8c727a8c72949a91000000 -0000005a5273495374a64b23bc7a653e525a393f4182858c6b6b725263525c63502f4231526352 -9d7a664b5242495374794e4584635f949a91e62f10e22300a92b0cc630116b80757384769cada5 -b1b4a2e62f10ca2a00b224005b341b474a364e5234474c299d7a66b6c8c17b8a84a5523abc7a65 -7a94877476787384769cada5a5b4a59dbdad9a9680d31f00a634216b7b625f735a6b7b625f735a -5a6b5c5b6b5162736c5a63606b7b6b587b4e415240394a3a394a3a394a3a2c39292129212a3129 -4b52425c63502a31290010080811081010101010101818181818181821181826222b28212c3929 -4b52428c947b8794888c947b8c947b8c947b84947ba5ae97b6c8c1b1b4a27d84766b7366646b5a -84947b8c9c7b84947b84947b7a8c72858c757a8c72949a91000000 -0000003e525a424a6b733f73733f737679846b6b72a4a8ae6b7b622b50203ba168587b4e3ba168 -6b89666b89662b5020516b3d94ad9ccd4825ef1800b22400a92b0c84635f7a94879cada5a1c1b7 -cb543bd31f00b2240081250c3e52314e52343e5231726946b6c8c18cb0a1794e45bd734f9bb5ad -7b8a84738476878995a5b4a59bb5ad94a592c63011e62f105d6b3f5d6b3f587b4e587b4e5f735a -5f735a587b4e7d8476738476587b4e5c63504152401818181018102c39292a31292a3320182118 -3940314152403940311818180811080718100808080010080811081010100d1618182118212921 -1829185c63509ca28f889e8a8c947b889e8a8c947b8c9c7bb7c7b2b6c8c1a5ae978c947b858c75 -7a8c7284947b8c9c7b84947b849473788c7b7a8c7294a592000000 -000000214231214231463d7b4b188a5a2586a4a8aeb7bdbc4f6b5b2b50203ba1688494736b8966 -94af9494af942b50203ba168cb543bf42200b22400b2240084635f7a948794a592a1c1b7bd734f -e22300c21e0081250c474c294e52343e52315b633ab1b4a28cb0a17d7765cb543b949a91738476 -7b8a847a94879cb5a59bb5ad94ad9ca64b23e2230076612c516b3d5d6b3f5d6b3f5d6b3f5d6b3f -5d6b3f5d6b3f476336485a42395229516b3d5f735a5b6b512f4231212918212918182118212918 -627363949d9e6273634152401821181818180d1618101010101010071810081108071810101810 -2129212a33207784698c9c7b8c9c7b8794888794888494738c947bb7c7b2d4d7d59cad9494a592 -8c9c7b77846984947b8c9c7b84947b84947b7a8c7294a592000000 -0000002b423a214231463d7b5a2586733f73e62f10cb543b9d7a662b50203ba1683ba1683ba168 -3ba1686b89663ba1687d7a24f42200ca2a009f1a00bc633c7b8a84879488a1c1b7b7937be22300 -ca2a009f1a00474c293e52313e52314e5234b09f93a1c1b7738476cd4825b1b2b47a9487738476 -6b8075a5b4a5a5b4a59dbdada5523aef18007c46264f6b505d6b3f516b3d5d6b3f5d6b3f516b3d -4f6b50476336394929394929516b3d516b3d516b3d516b3d5d6b3f213218101810182118535a4c -5f735a7b8a84b1b2b47384765263522b2821212118212121212121212121182118182118181818 -2129182c3929788c7b9ca28f8c947b8c947b84947384947b8c947b8c9c7bd4d7d5b7c7b29cad94 -8c9c7b788c7b5f735a84947b8c947b84947b858c75949a91000000 -0000002b423a2f4231393f414a3e407732234a3e404a3e40415a292b502094af9494af948c9c7b -94af9494af943ba168a92b0ce223009f1a00a634218aa094a5b4a5a1c1b7b09f93e62f10ca2a00 -a92b0c50451e3949293e5231394a209d7a66b6c8c17a9487bc633cbc7a659bb5adb1b4a27b8a84 -94a592a5b4a59dbdad9d7a66d31f00a64b23516b3d5b633a516b3d5d6b3f5d6b3f516b3d587b4e -4763363e52313949294763365d6b3f5d6b3f476336474c292129181018101821184b52425f735a -646b5a5f735a889e8ab1b2b47784695c635018211818181818211821212127272c2a33202a3320 -27272c2c3929535a4c646b5a8c947b84947b84947b8c947b8c9c7b8c9c7b9cad94d4d7d5cacad1 -9cad946b7b625c63507784697a8c728c9c7b858c75949a91000000 -0000002b423a2142392142392142311742362142311742361a42241a42241a42241a42242b5020 -5d6b3f587b4ea64b23ca2a00a92b0ca92b0c9ca28f7b8a849bb5ad9bb5adcd4825d31f00b22400 -5b341b3949293e523139492984635fb7c7b28cb0a19d7a66bc633ca1c1b77384769bb5ad9bb5ad -a5b4a59bb5ad949a91ca2a00c630115b633a516b3d5d6b3f5d6b3f516b3d516b3d5d6b3f476336 -395229394929415a31516b3d516b3d52634a3e52312942180718101018104152405b6b51526352 -5a6b5c5f735a646b5a8aa094b1b2b46b7b6b495a4b101810101010182118182622182118212121 -2129212a312921292121292152635294a5928c9c7b949a919ca28f9ca28f8c9c7b9ca28fd4d7d5 -d4d7d59ca28f8c947b525f5a646b5a7d847684947b949a91000000 -0000002142392142392b423a2142392b423a2142312b423a214239214231174236314222a5523a -8aa094cb543bf42200b22400b2240084635f94ad9c9cad9c9dbdadcb543bd31f00b2240081250c -394929474c293949295b633ab1b2b49dbdad7d7765cb543ba1c1b79bb5ad9cada57384769cada5 -9cb5a594ad9ca63421e223005b633a5d6b3f5d6b3f516b3d516b3d516b3d5d6b3f4763363e5231 -394a3a395229415a31415a313e52313e52313142220811081018103940315b6b5152635252634a -5c63505a6b5c5f735a5f735a889e8a8cb0a16b7b6b4c524d071810080808080808101010101010 -1018101818182b28212a31292a3320646b5a9ca28f889e8a9ca28f889e8a8c9c7b8c9c7b9ca28f -b7c7b2d4d7d59cad947784697d84766b7b626b8966949a91000000 -0000002142392142392142312142392142312142392142312142312142312142317c4626879488 -bd734fef1800b224009f1a00bc633c52636b94a592a1c1b7bc7a65d31f00c21e0081250c394929 -394929394929474c29b09f939dbdad6b7b6bcd4825b1b4a287948862736ca5b4a59cad9c949d9e -9dbdada5523ae223007c4626516b3d5b633a516b3d5d6b3f516b3d5d6b3f516b3d415a31394929 -395229415a31415a313e52313e5231394a201018100811082a31295c635052634a52634a52634a -52635252634a5a6b5c646b5a646b5a788c7b8794886b7b6b4c524d081108080808080808080808 -0808080811081010101821182a33202a33208c947b889e8a8c9c7b8c9c7b9ca28f9ca28f9ca28f -9cad94b7c7b2d4d7d5a5ae97858c755c6350646b5a949a91000000 -0000002b423a2f42312142392142312142392142312142312142311742367c46267d84769d7a66 -e22300ca2a009f1a00a5523a788c7b7a9487a1c1b7b7937bd31f00ca2a009f1a00474c29394929 -394929394a209a9680a1c1b7879488a64b23b7937b94b3a563635f62736c94ad9ca5b4a59dbdad -9d7a66d31f00a64b2348634d5b633a516b3d516b3d516b3d516b3d516b3d476336395229394929 -415a31415a31415a313952293e52311821180808082129215c635052634a52634a5c635048634d -7c4626e62f107269464f6b5b6273634c524d394a3a7384766b7b6b535a4c181818080808080808 -0010080811080d16182129181018105c63509ca28f8c9c7b9ca28f94a5929ca28f9cad94a5ae97 -9cad949cad94b7c7b2d4d7d5b1b4a28c947b7a8c72738476000000 -0000002b423a2142312b423a2142392142392142312e37341742364a3e409d7a66889e8ae62f10 -e223009f1a00c630117476787b8a849dbdada5ae97c63011d31f009f1a005b341b314222394929 -3142227d7765b6c8c17a9487a5523abc7a6594b3a562736c646b63889e8a9cada59cb5a58c947b -d31f00c63011476336516b3d516b3d5d6b3f516b3d516b3d5d6b3f485a423e5231394929415a31 -415a313e52313e52313e523121321808080818211852634a52634a52634a52634a48634d794e45 -cb543bef1800d31f00a63421794e452a31292121182c39296b7b6b6b7b6b525f5a101810080808 -0811081010102121182121182a33204b52424b5242394a3a778469a5ae97a5ae97a5ae97a5ae97 -9cad949ca28f9cad94b7c7b2d4d7d5b7c7b28c947b949a91000000 -000000214239214239214239214231214231214231174236394031a5523a8cb0a1cd4825f42200 -a92b0ca92b0c9d7a666b80759cb5a5a5b4a5cd4825d31f00b11700773223314222394a20314222 -794e45a5b4a56b8075726946bc633c9bb5ad6b80756b7b6b949d9ea5b4a59cada594a592c63011 -d31f005b633a516b3d5b633a516b3d516b3d52634a516b3d4763363952293949293e5231415a31 -415a313e5231415a293142220808081018104b524252634a555a42535a4c52634a555a42cb543b -b6c8c1bc7a65d31f00f42200e223004c1b0d1818182516182b28216273636b7b6b5c6350212921 -1821182129211821182121182129212129212c39292c39292942216b7b6ba5ae979cad94a5ae97 -9cad94a5ae979cad949cad94b1b4a2b7c7b2b1b4a2a5b4a5000000 -0000002142312b423a2142312142312142312142392c3929a5523a8cb0a1bc633cef1800b22400 -9f1a009d7a666b737a767984878995733f73c63011a92b0c81250c3142223949292b5020575a33 -b09f937a9487949d9ea63421b1b4a287948862736c889e8a9cada59cad9c8cb0a1a5523ad31f00 -7c4626516b3d516b3d516b3d516b3d516b3d516b3d4763363e5231394929395229415a31415a31 -3952293e5231394929081108081108415240535a4c485a42555a42535a4c485a42a64b23b1b4a2 -9bb5ada1c1b7bc7a65c21e00e22300e62f105311001a16101a16102b28215a6b5c6b7b6b5c6350 -2a33201826222b28212129212121182129212a33202c39292e37342a33206b7b6ba5ae979cad94 -a5ae979cad949cad94a5ae97858c75849473a5b4a5b7c7b2000000 -0000002b423a2142392142392f42312142311742365b341b949a919d7a66f42200ca2a009f1a00 -a5523a686b7d4b188a4b188a4b188a4b188a4b188a4b188a3f3365393f412b5020474c299a9680 -a1c1b77b8a84bc633cb7937b8cb0a1525f5a646b639cada59cad9c94b3a59d7a66d31f00a64b23 -4763365b633a516b3d516b3d516b3d516b3d516b3d3e52313e5231395229415a313e52313e5231 -3e52313949291021100000002e373452634a555a42555a42535a4c48634da64b23b7937ba1c1b7 -a5b4a594a5929dbdadbc7a65d31f00f42200c630111010102121181008102e37346380666b7b6b -5a6b5c27272c0d16182129181826221821181818182129182129211821185b6b519cad949cad94 -9cad94a5ae97a5ae978c9c7b7a8c727a8c72849473a5b4a5000000 -0000002f42312142312142311742362142392e37346b8075949a91e22300e223009f1a00a63421 -7d84763f33654b188a4b188a4b188a4b188a1906351906351906351906353f336584635f9cada5 -94b3a5bc7a65bd734f8cb0a16b807562736c7a9487a5b4a58cb0a1858c75d31f00c63011476336 -52634a5d6b3f516b3d516b3d516b3d516b3d3e52314763363e52313e52313e52313e5231395229 -395229182918000805101810485a42555a42495a4b535a4c48634d7c4626bc7a65b6c8c1a5b4a5 -9cada5738476879488a1c1b7b7937bd31f00d31f004c1b0d101010251618394031627363627363 -6b7b6b5a6b5c2a3129071810101010181818101810181818101810394031778469889e8a8c947b -9cad94a5b4a5889e8a7a8c72858c757a8c727a8c72949a91000000 -0000006273634f6b5b495a4b4152402b423a4f6b5b949a91cd4825ef1800a92b0ca92b0c7d7765 -494a735a25865a2586767984733f733f33651906351906351906351906351906354b188a767984 -84635fbd734f7b8a8462736c525f5a7b8a84a5b4a594ad9c949a91c63011ca2a00555a42516b3d -516b3d516b3d516b3d516b3d516b3d415a313e52313e52313952293e52313e5231395229395229 -2a33200008050811082c392952634a495a4b555a4248634d575a33cb543bb6c8c1a5b4a57a9487 -646b637476785a6b5ca5b4a59dbdadb7937bef180081250c060f102b2821294221535a4c627363 -6273636273635f735a2a31290811081010101818181010102c39295f735a778469858c752a3320 -41524084947b84947b858c757a8c72858c75858c75949d9e000000 -0000007a94877a9487788c7b7384766b7b6b6b80756b7b62a5523a7c4626a92b0c84635f5a636b -5a2586463d7b4f6b5b6b7b6b7d7765646b63393f41190635100810190635190635190635190635 -cb543ba5b4a58aa094646b6394a5929cad9c9cad9c8cb0a1a64b23d31f0076612c476336476336 -516b3d516b3d516b3d52634a485a423952293e52313e52313e52313952293952293e5231314222 -081108080808182110415240485a42555a42495a4b4b5242cb543bb1b2b49cb5a56b8075646b63 -6b8075879488788c7b949d9ea1c1b7cd482581250c0010082121182a33202f42315263525b6b51 -5f735a5f735a627363627363394a3a1018101010102129185b6b515f735a5f735a3940312a3129 -2129212132185f735a7a8c727a8c72858c7584947b9cad9c000000 -000000a1c1b7b1b2b49dbdad9cad9c949d9e7a94877b8a846b80756b80756b89666b7b6b5a6b5c -5b5a73495a4b5b6b516273636b73666b73666b7b6b415240190635190635190635190635a63421 -9a96806b8075a5b4a58aa094949d9e9cad9c8cb0a19c7e3cd31f007c4626516b3d516b3d516b3d -4763364763364763364763363949293e5231395229395229395229395229394929394929071810 -001008101810213121485a42485a42485a42485a42a63421b1b4a2a1c1b77384768aa0949cada5 -5a636094a5929bb5ad9dbdadcb543bb117000800081818182a33202c392952634a52634a495a4b -52634a5a6b5c627363627363627363495a4b182118555a426b7b625c63502a31292a31292a3129 -2c392921291839403184947b84947384947b889e8aa5b4a5000000 -0000006273636b80757a94878aa0949cb5a59dbdad9dbdada5b4a59cad9c8aa0947a9487788c7b -7384767384766b80756b7b6b6b73666b73666b7b6b6b7b62858c7574767819063581250cbc7a65 -94b3a562736c6b7b6b9cb5a594ad9c94ad9c9d7a66c21e00a63421516b3d575a33476336516b3d -476336516b3d476336395229415a313e52313e52313e5231395229394929395229102110000805 -101810182110394031485a424b5242495a4b7c4626b7937ba1c1b7b1b2b4889e8a6b80757a9487 -646b63a5b4a5a1c1b7bc7a65c21e001810070808082a33202c3929535a4c52634a495a4b4b5242 -495a4b48634d4f6b505f735a627363627363526352394a3a4b52422a33202129212131212a3129 -2b28212c39295f735a6b7b626b8966858c75a5b4a5a5b4a5000000 -0000002e37342c39292f4231394a3a495a4b4f6b5b6b7b6b788c7b889e8a94ad9c9cad9c9cad9c -949d9e94a592889e8a7b8a84889e8a788c7b6273636b7b6b7384768aa09484635fa5523aa1c1b7 -62736c6273637a94879cad9c94ad9c879488c63011c63011575a33476336476336476336476336 -4763364763363952293e52313952293952293e5231395229394a3a395229182918001008101010 -1821181829184b5242485a42495a4b7c4626bc7a65b1b2b4a5b4a594a5929bb5ad879488738476 -a5b4a5a1c1b79a9680e223004c1b0d0000082b28212c3929485a4252634a535a4c485a42415240 -4b5242485a42485a425263525a6b5c6273636273635b6b512e373418211821292127272c213121 -2129215c63505f735a6b7b623940312c3929849473a5b4a5000000 -000000274a3721423921423921372e1826221531212a3129394a3a394a3a41524048634d4f6b5b -6b89667384767a9487949d9e9cb5a57a94877b8a847384766b7b6b6b7b6bbd734fa5ae97738476 -62736c6b7b6b9cad9c949d9e8aa094a64b23d31f005b633a516b3d52634a516b3d516b3d516b3d -516b3d3e52313e52313e5231394929395229394929394929395229294221001008080808182918 -1821102f4231535a4c495a4b4e5234cb543ba1c1b7a5b4a59dbdad6b7b6b879488a1c1b7a5b4a5 -a1c1b7a5b4a5e62f105311000000081821182129212f423152635248634d495a4b4b52424b5242 -415240415240485a42495a4b4b52422a31295263526380665f735a415240212921182622182118 -4b52426b7b625f735a555a421818182a31292a3320738476000000 -00000021423921423921423917372b071810071810526352949d9e889e8a7b8a84794e455b341b -394031394031394a3a4f6b5b62736341524052634a5a63606b7b6b5f735a788c7b9cad9c5a6360 -5c63509cada594a5928cb0a184635fe223007c4626516b3d516b3d516b3d476336476336476336 -415a31394a3a3e52313949293e52313949293952293952292b5020081108001008102110182118 -182118415240485a42415240a64b23b1b2b4a5b4a5a5b4a57384766b7b6b738476a5b4a59bb5ad -a1c1b7cb543b9f1a000000001a16102129211829181821102f4231485a424b5242415240415240 -4152407c4626794e45274a371821181a16102121184c524d627363627363495a4b212921394031 -6b89665f735a5b6b511818181018102c39292a31296b8075000000 -000000214239214239274a372b423a153121415240949d9e94ad9c9dbdadb7937bca2a00ca2a00 -9f1a0039492921321821372e485a42485a42393f414b188a463d7b6c6373626b7394ad9c6b8075 -7a948794ad9c8cb0a19d7a66d31f00a92b0c393f4147633647633647633648634d516b3d476336 -395229485a423e52313e52313e5231395229394929394929101810001008101810212118102108 -2a3320535a4c415240a63421b09f93a5b4a594a592738476646b6362736c94a592a5b4a5a1c1b7 -bd734fb11700000008101010212918212918212918212921213121415240415240415240415240 -4e5234c21e00c21e0081250c7d15000d16181a1610181818415240627363627363526352394a3a -555a426b7b622121180718101018102a3129213121747678000000 -0000002b423a2142392b423a214231394a3a889e8a94af9494ad9c9ca0a3c63011ca2a009f1a00 -50451e394929394929213218394a3a394a3a3f3365463d7b463d7b4b188a4b188a767984889e8a -949d9e8aa0948c947ba92b0cc21e001906351906353f3365476336476336476336516b3d3e5231 -3e52313952293e5231395229395229394929395229182910000805071810182110182110182118 -415240495a4b7c4626bc7a65a1c1b7a5b4a5889e8a646b635a6b5c7b8a849cada5a1c1b7b7937b -d31f001810070808082129182129182129182129211829182a33204152404b52424152404e5234 -a634219d7a66b22400e22300f4220081250c1a16101a16101a16102e37345a6b5c6273635a6b5c -394a3a2b282107181018181810181021372e2a33206b8075000000 -0000002142312142392142392142317c462694a59294ad9c9cb5a5cb543bd31f00b224005b341b -214231394929294221646b5a6b7b6b3f3365463d7b463d7b463d7b5a25864b188a4b188a82858c -8cb0a1889e8aa63421d31f0027272c1906351008101906354c524d516b3d516b3d415a31395229 -3e52313952293952293952293949293e5231294221000008081108182110182118182110212921 -41524050451ebd734fa1c1b7a5b4a594af9462736c7a948762736ca5b4a59dbdadb09f93e62f10 -5311000000002121182131212129182129182129211829182a31294b5242415240415240a63421 -9d7a668cb0a1949a91c63011ca2a00f42200b117002d2718212118251618485a425f735a5a6b5c -5f735a415240182118071810101810212921212921747678000000 -0000002142392142392b423a1742367c4626b7937b9dbdadbd734fd31f00b2240081250c394929 -3e5231395229575a33b09f93788c7b767984463d7b463d7b463d7b463d7b463d7b4b188a4b188a -65637f84635fb117007c4626190635100810060f101906353f3365516b3d415a313e52313e5231 -3949293952293952293949293e52313142220010080008051821101821181821101018102f4231 -474a36cb543ba5b4a5a5b4a5a5b4a57384766b8075788c7b94a5929bb5ada5b4a5cd48257d1500 -0000001818182129182129182129182129182129181829182a332041524041524081250c9d7a66 -8cb0a194a5928cb0a1949a91a64b23c21e00f4220081250c060f10394a3a5a6b5c4f6b505b6b51 -5a6b5c5f735a535a4c213121071810212921182918747678000000 -000000274a37214239274a371742364c1b0dbc7a659a9680d31f00b2240081250c2f4231153121 -21372e3949299a96809bb5ad62736ca5523a9d7a66463d7b463d7b463d7b463d7b463d7b5a2586 -4b188a4b188a7732233e525a3949290000081008101906354b188a4a525a3952293e5231394929 -3952293952293e52313949292b5020071810000805101810182118182110182110182918394a3a -a64b23b09f939bb5ada5b4a5788c7b6b80756b80759cad9c9bb5ad9dbdadcb543b9f1a00000000 -1010102129182129182129181829182129182129182129182b28212b543e773223bc633c8cb0a1 -949d9e9cad9c949d9e9cad9c9cada5bc633cc21e00c21e005b341b495a4b48634d52634a526352 -5b6b515b6b515a6b5c4f6b502e3734182118182118738476000000 -000000214239214239214239214231181818c63011e62f10ca2a00a92b0c2a332017372b174236 -1010107d7765a5b4a59dbdad9a9680a5523aa1c1b76b737a463d7b463d7b463d7b463d7b463d7b -463d7b5a25864b188a4b188a5a25863f33654b188a4b188a4b188a3f3365395229394929395229 -3952293949293952293e523118211000000010181018211818211018211818211021372e7c4626 -b7937b9dbdad9cada5889e8a62736c788c7b879488a5b4a59dbdadbc7a65c21e00080008080808 -21291818291821291821291821291818291818291821291818262241311da64b23949d9e94ad9c -94ad9c94ad9c9cad9c9cad9c94ad9c94b3a59d7a66c6301181250c2b543e535a4c48634d495a4b -485a4252634a5a6b5c5a6b5c5b6b51394a3a10251b7b8a84000000 -0000002142392142392142392b423a10251b4c1b0da92b0c81250c2d2718072219182622071810 -794e45a5b4a59dbdad9ca28fa5523a9cada5738476495a4b6b7b6b686b7d463d7b463d7b463d7b -463d7b5a2586463d7b5a25864b188a4b188a4b188a4b188a4b188a2b50203949293e5231395229 -3949292b50203952292129180008050811081821181821101821101821100722195b341bbc7a65 -a1c1b79cad9c889e8a5a6b5c6273637b8a849cad9c9dbdadb7937bd31f00251618000000212118 -2129182129182129212129181829182129182129181826222d2718a92b0c9ca28f94ad9c9cad9c -9cad9c9cad9c9cada594ad9c9cad9c8cb0a1b09f93a634211531212a3320394031495a4b394a3a -394a3a415240495a4b4f6b504f6b5b5a6b5c4152407b8a84000000 -000000214231214231214239274a3717372b0722190722190722190722190d1618060f104a3e40 -a5ae979cb5a59cb5a5bc633c9a96807a9487646b636b80758aa09494af9482858c733f735a2586 -463d7b5a2586463d7b463d7b4b188a1906354b188a3f33652a3320394a202b5020394a20314222 -3142222b50202a332000100800100818211010251b18211018181810251b2d2718cb543ba1c1b7 -94a592646b636b80755a6b5c6b7b6ba5b4a59dbdad9ca28fe62f10531100000000181818212918 -2129181829181829181829181821181829182129211829189f1a00b7937b8cb0a19cad9c5a6b5c -8aa09494ad9c8aa0949cad9c8cb0a19ca28fa634212a33202131212131212131212f42312f4231 -394a3a394a3a394a3a41524048634d587b4e4f6b5b949a91000000 -00000021423121423121423921423121423110251b1018100d1618072219060f102d27189ca28f -9cb5a5a1c1b7794e459d7a668cb0a1525f5a6273638aa094889e8a8a9e9c7d7765d31f007c4626 -495374463d7b5a25864b188a3f33654b188a4b188a2b28212b50202f4231314222294218294221 -2942182942210811080008051018101021101018101821101021101a1610a63421a5b4a59cb5a5 -646b63788c7b5a63606b7b6b949d9e9cb5a59bb5adcd48257d1500000000182108212918182918 -21291821291821291821291818291821291810251b81250cbc7a658cb0a19cada5889e8a627363 -62736c73847694ad9c9cada59cb5a5bc633c41311d2131212a33202129212c39292131212c3929 -2f42312f4231394031394a3a394a3a2a3129485a42949a91000000 -0000002142392142392142312142392142312142311531211531210722191818188c947b9bb5ad -9dbdad858c755b341b788c7b4152402c392948634d7a94878aa0947d8476c21e00c63011415a29 -415a29476336485a42393f41393f413f336527272c2b5020314222294218294221314222294221 -314222101810000805101810182110102110182110182110071810a63421b09f9394b3a59cb5a5 -889e8a4c524d94ad9c949d9ea5b4a59dbdadcb543b9f1a00000008101010212918182918212918 -182918212918182918182918212918153121531100bc633c8cb0a19cad9c94a5925263527b8a84 -738476949d9e94ad9c94b3a5bd734f4c1b0d1531212a33202131212a31292c39292129182e3734 -2f42312f42312f4231394a3a2129211a161018181882858c000000 -00000021423921423121423921423921423121423921423121423917372b7d7765a5b4a59cb5a5 -94a59277322348634d485a4221372e394a3a5263525f735a889e8aa63421ca2a00575a33415a31 -476336476336476336415a29415a31394a202b5020314222294221314222294221294221314222 -18211000080508110818211010181018211818211008211081250cb7937b9dbdad889e8a738476 -9dbdad889e8a7b8a849cb5a59dbdadbc7a65b11700080500080808212918182918212918212921 -21291821291821291821292115312141311dcd48258cb0a19cada59dbdad62736c738476788c7b -94ad9c94ad9c94b3a5bc7a6581250c17372b2a33202131212131212a33202131212c39292f4231 -3940312f42312b423a2b28211010100d16181018107b8a84000000 -000000214231274a372142392f423121423921423921423117372b794e459cb5a594b3a59cb5a5 -7c46264b52424152402c3929394a3a48634d4f6b504f6b507c4626d31f0076612c415a31415a29 -415a29415a29476336415a313949292b5020394929314222294218294221294218294221213218 -00100800100818211018211810251b1818180722194c1b0dbc7a659dbdad8aa0949cb5a57b8a84 -7384769dbdada5b4a59dbdadb7937bd31f00181007080500182118212918212918182918212918 -2129181829182129181829182b2821a92b0c949a919dbdad6b736662736c7384766b7b6b8aa094 -9cad9c94b3a59a9680a634211531212131212131212a33202131212131212c39292f42312f4231 -2f42312f42313940319f1a0081250c81250c2d271882858c000000 -000000274a37214231274a3721423921423121423121423121372ea64b239cad9c9dbdad794e45 -555a42394a3a2a31292f423148634d4f6b504f6b50474c29c21e007c4626476336415a31415a31 -415a29415a314763363952293142222b5020314222294221314222294221314222213921001008 -001008101810102110102110181818082110251618bc633c9bb5ad94ad9c646b636b8075a1c1b7 -7b8a84788c7b9bb5ad9cad94e62f10531100000008181818212918182918212918182918182918 -212918212918212918182622a92b0cb7937b94b3a59cb5a5879488495a4b5a6b5c788c7b9cad9c -94b3a5a5ae97a634212d271821312121292121321821372e2131212c39292f42312f42312f4231 -2f42312c392981250ca5523ac63011ca2a00ca2a009a9680000000 -0000002142392142392142312142312b543e2b423a21423117423681250cbc7a65858c755b341b -4f6b504f6b50394a3a4f6b504f6b504f6b504b52429f1a00c63011476336485a42476336415a31 -415a31415a29415a293142222b5020314222294221314222294221294218294221101010000805 -071810102110182110101810102110101810a63421a5b4a594b3a594a592627363627363889e8a -9dbdad949d9e9cb5a5cd48257d1500000008101010212918182918182918212918182918212918 -21292121312115312181250cbc7a658cb0a1889e8a9cb5a59dbdad646b5a8aa0949bb5ad9cada5 -9cb5a5a64b2341311d1531212a33202131212131212129182a31292f42312b423a3940312f4231 -2f42317d150084635f8cb0a1879488a64b23ca2a00b7937b000000 -0000002142392142392142392142312b543e214239214231174236213121a634217732234f6b50 -2e3734485a424f6b5048634d4f6b5048634d81250cc63011575a33415a31476336415a31415a31 -415a29415a292b50202b5020314222294218314222294221314222314222102110000805071810 -10211010181010211018211807181081250cb09f9394b3a59cad9c788c7b6273636b7b6b889e8a -9cada59dbdadbc633c9f1a00000008080808182918182910182918182918182918212918182918 -2129181531214c1b0dbc633c94b3a59cb5a5889e8a6b80759cb5a59cad9c8aa0949cad9c94b3a5 -bd734f5b341b1531212a33202131212131212129212131212f42312f42312f42312f42312b423a -4c1b0da5523a8aa0948aa09494ad9c949d9ea5523ab09f93000000 -000000274a37274a37274a372142312142312142312142391742360722194c1b0d5c6350485a42 -394a3a2b423a4f6b505263524f6b505b341bca2a0076612c415a31415a31415a31415a29415a29 -415a312b5020314222314222294221314222294221294221294221213218001008001008101810 -101810102110182110072219531100b7937b94b3a59cad9c94a5925a63605a6b5c8794889cb5a5 -94b3a5bc7a65ca2a001008100808081821101829182129181829182129182129182129182b2821 -1531212d2718cd48259cada594b3a594ad9c9cada594a5926b80758aa0949cb5a594b3a5bc7a65 -81250c1531212131212a31292131212131212129212e37342f42312f42312f42312f423141311d -a634218aa0948aa09494a592949d9e8cb0a19bb5ada4a8ae000000 -000000214239274a3721423921423921423921423121423917423681250c794e4548634d2c3929 -2c39294f6b505263524f6b5050451eb117007c4626415a31415a31476336415a29415a31476336 -3952292942212b5020314222294221294221294221294221213921001008001008101810102110 -0d16181821100722194c1b0dbd734f9dbdad94ad9c6b8075638066646b636b8075949d9e9dbdad -9a9680e22300181007080500181818182918182918182918212918182918212918212918153121 -2b2821c630119ca28f9bb5ada5b4a5889e8a6b80759dbdad949d9e788c7b94b3a59a9680a63421 -1531212131212a33202a31292129212129212131212131212c39293940312f42312c3929a92b0c -8794888a9e9c94a59294ad9c94ad9c94af9494ad9ca4a8ae000000 -000000274a37214239274a372142312142392f42311742365b341ba5523a4f6b5b2f4231415240 -495a4b4f6b504f6b504b52429f1a00a63421476336415a31476336415a31415a314763363e5231 -2b50202f4231314222294221314222294221294221294218081108001008101810101810102110 -18211010251b1a1610a5523a9bb5ad94a5926b807562736373847687948894ad9c9cb5a59cad9c -e62f10531100080500101810182910182110182918212918182918212918182918212918153121 -a92b0cb7937b94b3a5788c7b6b8075788c7b495a4b7a94879dbdad9cb5a59cad9ca64b232d2718 -21372e2a33202a31292a31292131212131212131212129212131212c39292e37347d15009d7a66 -8cb0a194a59294ad9c94ad9c94ad9c949d9e9cb5a5b1b2b4000000 -000000274a37274a37274a37274a372b423a174236394031a5523a788c7b48634d2f4231415240 -4f6b504f6b50495a4b7d1500c63011415a29415a29415a31415a31415a31415a31415a292b5020 -314222314222314222294218294221294218294221101810000805101810102110101810182118 -182118071810a63421b09f9394b3a562736c6b7b6b62736c62736c8aa09494ad9c94b3a5cb543b -7d150000000010101018291818211818211021291818291818291818291821291815312181250c -bd734f9bb5ad7b8a8462736c62736362736c889e8a62736c9cb5a594b3a5bc633c4c1b0d17372b -2a332021372e2c39292131212129212131212129212131212a33201531217d15009d7a668cb0a1 -94a59294ad9c949d9e94ad9c94ad9c94ad9c9cb5a5a4a8ae000000 -0000002b543e2b543e2b543e274a37274a37274a37a92b0c9a96804f6b5b495a4b48634d526352 -48634d48634d5b341bca2a00575a33415a29415a31415a31415a31415a31415a292b5020314222 -314222294221294218294221294221314222182910000805081108102110181818102110182110 -08211081250cb7937b8cb0a194ad9c788c7b62736c6b7b6b7b8a849cb5a594b3a5bd734fb11700 -0000000808081821181829181821101829182129181829182129182129181531214c1b0dcb543b -94b3a59cb5a59cad9c5a6360788c7b6b807594a5929cad9c94b3a5bd734f4c1b0d17372b213121 -2131212131212a312921372e21292121312121292121312117372b4c1b0da5523a8a9e9c94a592 -94ad9c94ad9c94ad9c94ad9c94ad9c94ad9c9cb5a5a4a8ae000000 -000000274a372b543e2b543e2b543e2b543e773223ca2a00a5523a6b80754152404f6b50526352 -4f6b5050451eb117007c4626415a294763363e5231415a31415a31415a292b5020314222314222 -294221294218294218294221294221213218001008001008101810182110101810181818082110 -4c1b0dbc7a6594b3a594ad9c889e8a9cada58794886b80759cad9c94b3a5bc7a65c21e00181007 -0000081821101821101821181829181821181829182129182129181826222d2718cd48259cad9c -9cb5a5788c7b889e8a9dbdad62736c788c7b9bb5ad94b3a5b7937b81250c1531212b2821213121 -21312121312121312121292121312121312121312117372b4c1b0da6342194ad9c9cb5a594a592 -94ad9c94ad9c94ad9c94ad9c94ad9c94b3a5bc7a65b7937b000000 -000000274a37274a372b543e2b543e50451eca2a00a92b0cb224009d7a6663806648634d4f6b50 -474a369f1a00a63421476336415a31415a29415a31415a29476336395229314222314222294221 -314222294221294221294221294218080808000805101810102110101810182110072219262410 -bc633c9bb5ad94ad9c8794885a6b5c6b80759cad9c9cb5a594b3a59ca28fc63011531100000000 -101810182118182110182918182118212918212918212918182918182918a92b0cb09f9394b3a5 -a5b4a57384765a63607a94879dbdada5b4a594b3a59a9680a92b0c182918213121213121212921 -2131212a31292131212129182129212129212131212d2718a92b0c9ca28f788c7b6273639cb5a5 -94ad9c94ad9c94ad9c94ad9c8cb0a19a9680a634217b8a84000000 -000000274a37274a372b543e2b543e773223b22400a92b0cb22400b224005b633a4f6b50485a42 -81250cc63011415a29476336415a29476336415a29415a313e52312b5020294221314222294218 -29421829421829421829422107181000080508110810211010181010211010251b1a1610a63421 -9cad9c8aa0947a94876273636b80757a94878aa0949cb5a594ad9ccd4825531100000000101010 -18291818211018291818211018291821291821292121291810251b81250cbc7a6594b3a5a5b4a5 -94a59262736c7b8a84646b639cb5a594b3a59cad9ca64b232d27181531212a332021372e213121 -2129212a312921292121312121292121312118262281250c9d7a6694b3a56b8075525f5a62736c -8aa09494ad9c94ad9c94ad9c9ca28fa64b23294221878995000000 -000000274a372b423a2f42312b543e2b543e81250cb22400b22400b2240081250c4b52425b341b -c21e0050451e174236274a372b50203e5231415a29415a312b5020294221294221294221294221 -29421829421829422110210800080508110810181010181010211018181807181081250cb09f93 -9bb5ad788c7b4152406b80755a6b5c94a5929cb5a594b3a5cb543b9f1a00000000080808182110 -18211818211018211818211018291818291826241010251b7d1500bd734f94b3a59cad9c94ad9c -7384766b7b6b788c7b94ad9c9cada594b3a5bc633c4c1b0d182622212921213121213218213121 -2a31292131212131212129212132181826227d15009d7a6694b3a57384765a6b5c6b8075738476 -8aa09494ad9c94ad9c8cb0a1a64b2341311d21372e879488000000 -0000002b543e2b543e274a37274a37214239415240a92b0ca92b0ca92b0c81250c531100c21e00 -5b341b17423621372e17372b17372b17372b17372b1a422410251b0d1618153121213218294218 -294218294218212918000805080808101810102110101810182110082110531100b7937b8cb0a1 -7384767a948762736c5a63607a94879cad9c94b3a5bd734fb11700000008000805182110102110 -1821101821181821181829181829102129181531214c1b0dcb543b8cb0a19cada5a5b4a5627363 -7b8a845a6b5c9cb5a59cada594b3a5bd734f4c1b0d182622212918212918212918212918212918 -21312121372e2a3320213121153121531100a5523a94ad9c8aa09462736362736c7a948794ad9c -94ad9c94ad9c94b3a5bc633c5b341b17372b2c3929879488000000 -000000274a372142311742362142391531210718102624109f1a00a92b0c7d1500a92b0c81250c -07221910211010251b21372e17372b17372b17372b17372b10251b060f10001008081108060f10 -1021102a33200010080010081018101018101021101818180821104c1b0dbd734f8cb0a19cad9c -6273634152405a6b5c6b80759cad9c94b3a5b7937bca2a00181007000000181818182110182118 -1821101821101821101829182129181826222d2718a634219ca28f9cada59cada57384765a6b5c -889e8a9bb5ad9cad9c94b3a5b7937b81250c182918212918182918182918212918182918212921 -1531212129182a33201531212d2718a634219cad9c94ad9c7b8a846b80755a6b5c8aa0949cad9c -94a5928cb0a1bc7a657732231531212a33202c3929878995000000 -000000153121464a485a52611818180d16184c524d4a525a21211881250cb22400b22400182118 -0722190811080d16182f4231394a3a21423117372b17372b17372b072219071810080808001008 -0808080718100808081018101018101018101018101021101010107c46269cada5879488738476 -9cada56b807562736c94a59294b3a59ca28fc63011531100000000101010182110182110182110 -182110182110182118182118212918182918a92b0c9a968094b3a59bb5ad788c7b738476738476 -7b8a849cad9c9cb5a5b09f93a92b0c182918182918212918182918212918212921212921213121 -2129212131212131212d2718a92b0c949a9194ad9c7384765a6b5c5a6b5c7384769cb5a594af94 -8cb0a19a968081250c2139212131212a31292c3929879488000000 -000000153121a4a8ae82858c8794882e3734a4a8ae7d847682858c4c1b0da92b0c2d2718072219 -10251b10251b3f33653f33653142223940312e373418262215312117372b071810081108081108 -0718100811081010101021101018101818181021101018104c1b0d7d847694ad9c8aa0946b8075 -7384769cad9c94a5929cada594ad9ccd48257d150000000010101018211018211010251b182110 -1821181821101821102129181531217d1500bc7a6594b3a59cad9c889e8a646b63646b6362736c -9cada59cada59cad9ca64b23262410153121212918182918212921182918212918212918213121 -21292121312118262281250c9d7a669dbdad7384766b807562736c8794889cb5a594ad9c94ad9c -9ca28fa634212a33202131212131212131212c3929878995000000 -0000001531219ca0a34a525a949a91393f41878995393f41949a9100100818262208211010251b -07221910251b27272c3f336510081018291821291818211807181008211010251b060f10071810 -0808080808081018101018101018101018101021104c1b0d555a4273847694a5927b8a8494ad9c -7384767384769cad9c94b3a5bc633c9f1a00000000080808182110182118182110182110182110 -182110182118262410072219531100bd734f8cb0a19cad9c9cb5a5646b638794886b7b6b738476 -949d9e9cb5a5bc633c4c1b0d182918212918212918212918212918212921212918212918213121 -2131211531217d1500bd734f9bb5ad7a94875a63605a6b5c6b7b6b94ad9c94ad9c94ad9c94ad9c -a64b2341311d1531212a33202131212129182c3929879488000000 -0000001826229ca0a34a525a949a912e3734949a914a525a8794880010081531210d1618072219 -0722190722190d1618190635190635190635182622182110182918071810060f10071810071810 -0010080808080010081018101018100718102624107c462648634d788c7b7384765263526b8075 -9cad9c7a94878cb0a1bc7a65b11700080500080500182118182118212918212921182118182118 -1821181821100722194c1b0dcd48258cb0a19bb5ad4f6b5b6b7b6b6b8075525f5a7b8a84a5b4a5 -94b3a5bd734f5311001531212b282121292121291818291821291810251b10251b1829182a3320 -17372b4c1b0dbc633c94b3a58794884c524d7384766b80759cad9c94ad9c949d9e8cb0a1bc633c -5b341b1531212a33202131212131212131212c3929878995000000 -000000072219a4a8ae747678879488393f41949a91464a48878995072219182622072219212918 -a5523aa5523a2a33200718100d1618190635733f73190635071810071810001008001008001008 -0811080010085b341bbc633c5b341b1a16105b341b4f6b5b5b633a9d7a66525f5a6b7b6b7b8a84 -889e8a9ca28fb7937bb11700181007000000101010102110102110101810102110182110182110 -2b28217c4626a64b23a6342194a592949a91bd734fbd734f72694662736c7a9487889e8a94b3a5 -b7937b7d15003949297c462607221921291810251b2129181829187c4626a5523a41311d153121 -4c1b0da92b0cb7937b9cb5a54f6b5b7384766b807594b3a594ad9c94ad9c8cb0a1bc7a655b341b -1826222132182131212131212131212a332018211882858c000000 -000000072219b1b2b4b6c8c182858cb1b2b48794884a525a87948807181018262207221941311d -a5523aa5523a7c46267c46267c462650451ec0852f41311d5b341b7c46262d27187c46267c4626 -001008181818bc633c2624101a1610a634217269467269467c46269c7e3c7269469d7a669d7a66 -9d7a66c0852fcd4825a64b237732232d271876612c5b341b50451e7c46267c462610251b102110 -41311dbc633cbc633c9a96809cb5a56b80759c7e3cbd734f646b5ab7937bb7937b9ca28f9ca28f -a6342150451ebc633c7c462650451e41311d50451e1829182b2821bc633c7c4626a5523a41311d -bc633c84635fbc633c858c759d7a6684635f9ca28fbc7a659cad949a9680b7937b81250c213121 -213121213121213218213121213121101810071810949a91000000 -00000010251b9ca0a37b8a84b7bdbcd4d7d57476784a525a8794880010081826220722192b2821 -c0852f7c46267c4626bc633ca5523a5b341ba64b2341311dbc633ca5523a7c4626a5523a262410 -060f10262410a5523a41311dbc633ca5523a727442a5523a76612c84635f794e459d7a66bd734f -7d7765cd48255311005b341b7c4626262410a5523a7c4626a64b237c4626a5523a212918102110 -41311dbc633cbd734fb7937b9cada58aa094794e45b7937b9d7a66bd734f9d7a66bc633cbc633c -7c4626a64b237c46267c4626a64b237c46267c46261021102d2718bc633ca5523a76612cbc633c -bc633c9d7a669c7e3c464a48bc633c9d7a66bd734fbc633cbd734fbd734fa64b232132182a3320 -2131212131212131212a3320182118000000101810878995000000 -0000001826229ca0a3626b6b82858c4a525a82858c464a4887899500080510251b07181041311d -a5523a060f1050451ebc633c5b341b41311dbc633c5b341bbc633c7c46262d2718a5523a071810 -071810081108a5523a7c4626bd734f9c7e3ca5523a9c7e3c773223bd734f76612cbd734fbd734f -9c7e3ccd48255b341bbc633c41311da5523abc633c76612ca5523a50451ea5523a2a3320082110 -7c4626bc633ca64b23b7937b94a5928cb0a19d7a66bd734f7d7765bc7a65889e8acd4825bc633c -7c4626a64b237c462676612c5b341bbc633c3142221821182b2821bc633c2129184c1b0dbc633c -9d7a669d7a66bc633c726946bc7a658c9c7bbc633cbd734f778469bc633c50451e1826222a3320 -2a3320212921213121212918001008000000181818879488000000 -000000182622a4a8ae4c524d949a912e3734949d9e5a636087948807221921372e153121182918 -41311d1826220722195b341b5b341b0718105b341b41311d2d27185b341b2624102d2718081108 -0718100010084c1b0da64b239a9680646b5a7c4626575a3339403184635f7d77659d7a66a64b23 -9f1a005b341b5b341b5b341b5b341b41311d7c462641311d41311d41311d50451e10251b4c1b0d -7c46269d7a669d7a66b7937b6b7b6b7b8a84858c759a96806b7b629ca28f9d7a667732237c4626 -2a33205b341b7c462641311d41311dbc633c18211021291821291850451e7d1500a5523a726946 -bd734f646b5a9c7e3c9d7a66bd734f9a96807269469c7e3ca64b23773223314222213121213121 -213121213121212918081108080808000000212918949a91000000 -00000015312174767827272c6b6b72393f41879488767984393f4117372b2b543e274a37274a37 -174236153121071810071810072219102110071810072219072219001008001008001008081108 -001008262410b22400b11700a5523a6b807548634d415240535a4c889e8a8aa0949a9680c63011 -181007080500001008071810071810071810071810102110102110182118102110262410a92b0c -949a9194ad9c9cada56b807562736c6b7b6b8aa0949cb5a59dbdadbc7a6581250c102108102110 -18291010211010251b1821107c46265b341b10251b21291810251b262410a634219cad9c8cb0a1 -94ad9c7b8a8462736c8aa0948a9e9c94a5928cb0a1bd734f4c1b0d153121212918213121213218 -213121213218071810000000080808001008773223b09f93000000 -0000001826225a5a635a5261464a485a5a5a464a48393f41464a481a4224274a37214231214231 -274a3721423115312107181010251b07221910211007221921372e213921072219081108071810 -060f107d1500ca2a00b22400b117007732234f6b505b6b516b7b6b94a592889e8ac63011531100 -08050010101018210818181818211018211018211018211026241018211010251b81250cb7937b -8cb0a19cad9c889e8a5a63605a6b5c7b8a849cad9c94ad9c9a9680a92b0c102110212918212918 -212918212918212918212118182110182110212918182918262410a92b0cb09f9394ad9c62736c -788c7ba5b4a5889e8a7b8a849cad9c8cb0a19d7a6681250c1531212a3320213121212918212921 -2132181018100000000808080010084c1b0da64b23b09f93000000 -000000274a372f42312142312142312142312f4231214231214231214231214231214231214231 -214231274a37274a3710251b07181007221907181007181010251b274a37214231153121102110 -060f100010087d1500b22400a92b0c7d15005b341b5b6b51788c7b8cb0a1cd48257d1500000000 -08080810181010181018210810181018211018211018211018211010251b7d1500bd734f8cb0a1 -94a5926b7b6b6b7b6b6273636b807594a5929cad9c9cad94a63421262410182918182110182110 -1821101821181821182129181821102129181829181018109f1a009d7a668aa0947384764c524d -5a6b5c7a94879cada59cad9c8cb0a19a9680a63421182918212921213218212921213218213121 -1821180000000805000008052d2718b224009a9680a4a8ae000000 -0000002b543e2b543e2b543e274a37274a37274a37274a37274a37274a37274a37214239274a37 -274a37274a37274a37274a3710251b07181010251b10181007221921423121423121423121372e -15312110211010181081250cb117007d15007d15005b341b889e8abd734f9f1a00080500000000 -10181018181818181818211018211018211018211018211010251b4c1b0da5523a8cb0a19cad9c -8aa0945a6360738476889e8a94a5929cad9c94b3a5a5523a4c1b0d10251b212918212918212918 -21291821291821291818211021291821291810251b7d1500bc7a659dbdad646b63525f5a5a6b5c -62736c94a59294ad9c94a59294a592a64b232d27181531212a3320213218213121213121212918 -0010080808080000002624109f1a009d7a669dbdad9ca0a3000000 -0000002b543e2b543e2b543e2b543e2b543e2b543e2b543e2b543e274a372b543e274a37274a37 -274a37274a37274a37274a37274a371531210718100718100718101531212f42312142312f4231 -21423110251b0718101818187d15007d15007d15007d1500a63421b11700181007000000000805 -081108101810101810101810101810101810182110102110262410a634219cad9c9cad9c9cada5 -6b7b6b889e8a62736c94a5929cad9c94b3a5bd734f81250c1531212a33202129182129182a3320 -212918182110182918182110212918102910531100bc633c9cb5a5788c7b525f5a62736362736c -94a59294a59294a5928cb0a1a5523a4c1b0d153121212918212921212921213121213121081108 -08050000000808211081250ca5523a94ad9ca5b4a59ca0a3000000 -0000002b423a2e37342c39292e37342e373421372e21372e2e373421372e2e37342e37342f4231 -2142312142312142312b423a21423121372e21312118262218262227272c2b423a2f42312f4231 -2e373421372e10251b0d16181826224c1b0d7d150081250ca92b0c4c1b0d060f10101010101010 -101810181818101810182118212118212118212918212918a634219a968094a5929cad9c879488 -62736c627363788c7ba5b4a59cb5a5b7937b81250c1531212a33202131212131212a3320212921 -2129182129182129212129181829184c1b0dcd48258a9e9c889e8a738476525f5a5263529cad9c -94ad9c9cad9c94b3a5bd734f4c1b0d2131212b28212129182129182a3320213121101010000000 -08080807181081250ccd4825a5b4a594ad9c9dbdada4a8ae000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000080008000000080008080808080808080808000000000000000000 -000008080808080008080500080008001008000008000008080008001008000000000805080808 -0800080010080000000805000808080808080808081008101a1610101810101010181818101810 -101010101810212118182118182622251618100810081108101010101010101010101010101010 -10101008110810101010101007181025161841311d1826220808082a31291821182129212e3734 -2a31292e37343940314c1b0d081108101010101010101010101010101810101010000805080808 -0808081a16104c1b0d4a3e40495a4b4c524d525f5a393f41000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000 -showpage -%%Trailer -end -%%EOF diff --git a/Docs/Books/sql-99.gif b/Docs/Books/sql-99.gif deleted file mode 100644 index a1f3b7403e75b0e8e566b2c8877ffd104019b9a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13038 zcmWlfcTf{s7r-}VcT>sIs}P#f4M-O;^ib4*s5CKD0|5<1rRoOKP|&ELpr8Q(!S;fJ zVhe%CgGpC6by3QSF-D+f2?DEvgdLmTwf6)Rvdk7PgdS zR|?lQuMa2^u3ab0sTJGsYO?3Ha?fN0tSuGt&^2g9SmnB`;;@g;PH}pi+IUN8JtBt zc1i|2E`yhm#Ea$4%Sz(JWn_G@0g{u7k~93{GUAewcySp~Nl6)T$whH1lBT6}Vb~x; zH*R`8DT9@g%Hl@xs23W%ECBQ7Z}iWeNmi-}th8C4V=7aWx29u>t~ z80XpTObJSI42(;4b9~@B4_kJa zrC*ePk1-Gx$n=YJ^oyc9v*}6p;=N{oz@FkaKWJ8zPqL@EAJcvQoUGZw?#{vf?!h+J z!G4ax*4Dx9j=?5wKAzDg8;yg#gWPAh_&J&d+f^C@);@05e%4NN=uYmA#y-y0?$*{G zCNbtzX9w$9vs_$fnHWy5I8MJNi*N<()s~PJ+e`Ik+9f#_eM%8n#H;1hM8=4!o^7`zh z7vA>RXw&W4oeOj3fw^N#*c|7UjZ)&`i1`h^>jR!k-dSz2zoE+e{K|FD{I%LkPt3nZ zNAB{;A-xZtB#*i!5tilTe%9`EU%Q?#JZGiOmAV<9IknQS2QP2RonKawe4_XD?KOW! z{En6N?K)p^zP~l+)`#IMk|HZN$D(122sZwDYfNeF#{e7SM3DSu4)-AcPw&UiJN#eY zz7sKZ^YpF{!z0zy8&lurtsK7g`Q(k_nz<2~+6|?jOujojyP-X@)kfe2e)}ALx1ujA z!Xhs*!ffWl5vyBtpPLeX3L@98enPlx+B7nnv98M0`*vA%mV=1GHW?pTp#KJHifQOmiJ0tK z3>E`qMhdLx6xmBmMspj0VV@akv9drID0Zp3VJ3#sJFuhHjpGM^2j6v$MAmtAf{Wsq z1q2xAmuD^%{y|^tUCv6|K4ZKxwn;L@#DrmRQhGJkjp?ogJlFt$YqtPUy`0kCT~=-Y z2gL#oQ!*mqhz$UM8x$RQ0N*cHVou)ccxqZQ*}yXn^oZO(BTf_4MOnok6>o`ST>yaj zn%<|?;}2pV*nC*ia}Xoj#c}`}dxHQ>L*vE+to*vIHQh_K=>V|7f}u1$V8BFEnxt>A zj!lo3fUv=DPJ|(y@-gJX3REdr=tddE!t+_dUF5*4N&#iogEtpwbyb=wqc=;$79C5B z042slj&~-MPL6sQygvdeF!=b7lEX_3*v!c9gY~n45Q?*?1=~*tfxn;LeCk?skf;RW z^4?zQOReJM0&JSV{!U!6?#tC5-c4S-Lz+xGK=yieF!cIa%-i=?Zp+e?=T;(9bf$iW zW}XruPgyf8aR%DU0G?Igid(|Who3K1@tqI5J<0tCh#MgV8~!}-@#10q@W>p)C3{Az zhUh8(RYer;{#jkK=E!cwKWh)@^bO7X_4X5O<>Z;~$hJoRO90&b>8&N+Kt2e(NYZs~ zov$tfaBj4MceIj2L&`q5KJ@`Tgb;r@eaU2xGq$ZtbH!x+-mRalLJT-ej6vpD6=uYk zbJ>dS0N@DBBTfdi_ z=Nh17$71CX9X4@j2B7~v>LyK&)&yT-(b~C&M^4FzacUBNLszhJYE=W#L4#QuqQZB! z181#I$;(5^o9x64r#F39!TszlcAT%(F#&A74RnfeKjWO<(t+p%J(R*ob2?an8hpQc ztLuVvo0aE{B`dVm6ydj{_w&fnFkOl1N&ptS(m*H=*b|Ha?|tUZUcuq%TN$3rr2pXN{5nUJB_sN3Ut>AEk*+9X{Em zfmFkTWccfl@YC2%w~5Q>;i{?`kJ(LZvse2Ddul7ki}u}B{p-4xRTq;L%`qWW+XkOw@5nFETy(V#}kck?&!W>^Rw_Zp5#_A?qN^&GEPH=_XduY>Q`^AFplyXhC@)-6lRg?$@+PQ1R0l&#wy z|8yZYDca+Gh1b^O^O39T+0Mdq9`61+ztcEvyUaPs4K@IuX{d;@Dm}k(8$7yz|HZ6>TQ>hE4Ws{y?b|I|4{m*q{XRVKXKVPw-{Zx4QTRsGY^FSd6xTdP!}TgyHcR#xb#vpI%u=))%zq3%_ z$j>B_yuru*=9vxMbnn2a7bWCR2r+qbD=eCQ_&F~c0UWq#b_9zO;T9lB)7 zHC3!JWfIrg0U(8ccg?`BrS0^3tR04a#=!shgYnI6Ij&1BXPfosr(O!T${&wd>_4(< z&#n1yZFls>kA+YEzUW8@A{{F+(>I*@fxEh7vHImVhuOf`Lf#$iz6TUfR>q*;;YZ|; z-t*1+ncr{PR2{BqBkz8)y*u$*fZknfX}hiQR$-!rpr&eL&T_o!dEa!^crWyxP8wI6 zU+I}L@S0jvb`;rSdTiGw@{h3SUAHd$ zoi`5J7|&D6iSY=2B|^+b!3`*wi{NtsC`bWrL-5TgeglHHD1ccgJ{rNVl?%*N__=7} zT7bAy4QBwv4kmf0jC2Zsw+z6q_mfX6VZTBC{LbtExOn^0;!Vi9oj&Ud2cWqMFcQEm zMTjf_R}SD3IS`8>oXdn6N_?gaWGKK*DBNOih}>9WC*QDBO{|lFiI^P^T6MP}L^@0= zQS7KtY*F$@dW2EhXh9o%%>Yz0apU=j*(ZQD2`RpVm+!n(B{@VgdjN z=SNs=yskxQp&YL+RaXSdtYQ%SR&B%bG*Ty>*dimQr4fQqe6pHosk_Upr<%n9D>%4i zGD4w@P|qapWRs3+$sbU{QHIWWcJts5@-Z!0rKAX(sP{CKHuc61wRnXbPGy2C>4fkd z)zE|Li&r)XRicO~1vrXi zY^;nRpu-gal+7fbm+4Gu$@jJ7E?IMzhPa1AXlAzVk(0W#ChPJC*pyQM-O)6x+X<=MTa&w3sai$jcN!D7w3nL)19wJkk(TwZ~tW z9Xqeqd56%x(shP8w6)H(TN=<>i;q|9Xcb4-u>0?GsB=q+6`H=fM~2RC;H`YfU%tPT zO)Ncyi`Jr?oPC*7vc20hgc81C*gD-=NxScv5xUhdMFDiqm6!YJj46(CP!P!>?m?+q zwT=co{eg3$Jel?zrQ~Yyi#5bgTG~%KRjldgQcyo4v>`qz<_ds<0#?rOX@quPM!nC5leKtWE@6j~qS<)* z9h;`*oLI}#$>rb|D~T#L?T4JU%)d4LC;2f#dp8}bx_hyw;~VHA76aU*Al_ru%mr|1 z8j^m_g}IEak^H9R7~NfbP@jn}RKvYWELjT>C4>4`Idl-ka3>SU95arR>i7VbfDWlCtPnz%_y5OcO|;*gqi3E2q#fSQoUC@wH2 z_C3H9B7|NxMAM$rp+k-n!WSV~EiCiWwo}*LlOqOv33D&-Vs;&olae*0;hyTPd_vl$E8R@8m0~EA4*fJE zwQ8YkHZ=S|=am9npuMw5Lv;Lg-k|bQlnfWIrIa6}{Z!v9Bkx zQ`>V6p?yP1mt!8}$%fy_j`U9*q?O5V0b268=xg%)6W>tUPd@FdtYesYO{*pE(12?g z#4au6+Awj|6M`>?;L9Y<1%yn}bT5W)9;rCoeS2;t=%aqT6Fr4!u9(X=o|BIpR$w}v z;Wjq;{z?4yv-nhm8o#Ss!={~4m*3sGzpO{kX4Dg>)ALF|KC@cTjJNdII zc7sxekC8)XuR+^bP$mKy{EIJ^X?_gD3pJSg4`G@XAj<%J%i)6v=^zJ3K!Fk$I935I z(jH-Q@QaYUb+wcP4xXn~MV-0%U3s_cAZ-Mt9AjS6%4t8?C}EQZA=4RI!*ng)rmZG$ughzQ3-j;v9tJC9|b;-PQA}Ky@o%$hCyaBCOSFLlxy9e zYuEL2w&f|{fQP#pdFP8PRVxzErwD=>V0$Vx815zN3A znSyf=ESaGOuaR2Sq?FY61P!pojC2g84J%2*C?%ZneFvRF=i_;rCxglV{V}I$>9q4o z+)NaE?i`rQhg13ZR4F6+m&?u)4)3q z4vZYv;E4)g`DQ@w2G?`Q8?oHFa!Vt+u*e<4v(U!4E z*KBt2guF2G->tR|fB$T{(|tu{X*Tv^gehF)wqUc-np^QXHycb{^uFF)0}`a5m7e>p zyH0lwu+0%)x=nZt#jh=|?`Yq~9!uP2RabMRv@NYy9$H!FiL zOE>B}y+3ldAahfM%%(iv^mFxg1IIJ#18(&a;xo)GFX8pwBe%+H%&O16GBtc zdgQO{{VG=-7Dt%PR%)xL^!k!uKifUB&X$6!2lms8ESp~*FyJk`F5L1mGZ!Dq<$U8>TTlJlic&?T|f39@5 z+^h*R>${}_8H6@F7e0d zip>`EMr>{3`XEp`GvMRZp`~XxUTIzt!xY@pXR(w5ud`hO;dpAvLfGH<;y_J6>B;Oc zPJ9}sZlO&9#Y0|fGkTPXZnHNC3ryxfHr|9Z0y4r=ikaz-k|qpX@s8lcZh9HNaC1qz zQDv&(N{fQy?pO4aU&oDBrR-!+fGd_Lc&`3nO*_SiH5vvvzTwz5`sZo!NwdOz7u5%% zs#Yv~iDPHDBH`nqbEaBenp9@Rl?$Wk1^1s|cC#-^9W`}3oATQ~3aL4tdRCrTI&e~K zx@aL&aAe%hH|mJ%R6N1G-)zF}a(#s5k026hv$8|tSf&xcDNj|(!T8XEHqf%B->zZ# z_z)IDos?p#Obhv=7(&2A2*pFym`-x)Y8(?=baHSF|1@r$X_grKqhm(-i<^=O!nFtE z=HC9=yZ6Tsjn?geZf7e*3-lN?S+?z85f;2fC&@LM-NCOZmby6IJj8pORt`sU>)k3CID;=Ql7bS!SZ@Vt5h}pAs)Dw0 z){3S=+3D0wxh3JgoRB;+MxE83>ZM8331O!}6jjiSBdxOwigR2Zb0F&G#m3`}N+8z* zL+#>s8ml8s1~g%=>9L!VYO%)sb1?7A=%jy{Hu$Iuwfi!48(X^4=5?f5z1!0FgP2)5JIh2os({KZI%Jl5hZM3*YPY|DGfYS zz@K&IsdL`P8vUnfhF4^802?FrFTrfF=AgPW(~OGHkeK<82EE_#&+8UX$#F9$Pz;4{ zF)wcva*{8$cYH8EDz(sL8DZdk*()I>L5|^Xf3!F+2!=f6ab%PU1{(<|OdF)Q-`?$+ z@1|uHWBR%l;(3~n)8r50F7y4DUZyQv! z+b6H2M9G!xZZ^jpz0z*gpmj9oqPlGwz`%19V*~`@jv$1nuB~Mee}t~2GWC+jSj%rR z$oxIyuK#08fC}J<6KI z7fOPd8?mg$Xp8@Po!yobO3;pvIp(jyd#MKO>VhJpZ9+`@6d2<5eVYO)X%JP$v~p`D zub^Bsx`<%0N$6gpCx&d-#l$b<*91CXclP(y^vnSm0jhMFT9gF5*W-o0ondfrXi45WgNtf7AfNyaHL1EB$^^E*KnT2E+Zp#u zF6@}R{7*sXcGF=8vF_5jnfE&X#n3oY%cqheDA~ve>~l**t=Hm=1KMb9Bcg(Wn^I~o zfR|}<^yNGZHDy#UY{8-Q(f&JE9$v8g#uQn*+)R(IAHX09agJDP@v1Y=XWZ9b*wH5F z&Hv(SHp~q76dp>t*R}?vv6ObsrnS*O)A8OcjiFpdS-8&34Iz~ zf6&7L+v8Bn2|CFmulbELby?+3|9c9BOXL`j_qd9Wf?6As0rCj_@SH~j)b#>E-+?tl zNtS;MTGzRr}{q#!!wg4tJ=gje_$%u!YQa1y(8D%J?Z3GZ^PN`uX23P@?~ zX?X9bEr|ctO(_+y$(YVMkM*2(Q_mpUoDwD!u7<figXop~= z;mS#jtMUSJ2AH$=?U?0#2eI`Y#u_KqJ}#6785V1+xbk4|I`KN0soiSSi$Z(A3%W;` z#N#d2#z$Dyx6Qguf!75aE6b}06e+qC zMX_dDJJM;Dq{0;vUtCaWlsyW)>eiBT^7fgO zxJ9^R|6gHbBTjd7efZC&fw~p+7|@RSY5pESXe6X#sa)lv5Y9J?O!n*qzba!BY}p8C z#C5aP?58LMaj4LTi~p~RnYhWTBTiB=SF&QdRcypZO``W~F+VS2?b8Htjc}!}r}1t) z6)*IXS9Kq(PSgsyBT%kP-2N}YvP1w&=Vx-noJLWkbgmg)uomk?qYF&w7&BFm1pzaw zzY645&EjInD!^c(IPcvkLP*WTKoedBCT40uBC02M-@r19 z?#KCsfF8ZV^j-c8CUkuO%56MUI|*ht9^Wt_iYkNnYA8o)91jRRH3AFmQ35*ehDVi& z47K25ZGi&_aK=l|Jz*2Q!>M(dgSbL1S?w#~Focl=&_>hOoJ+Sa1p+_A*LzHute{0q za4okgWM@8q<|4jvC|9DYIlQ6EF1-;dl}Y>of$a<2ib>ImM(|p&Xs*iCNsb}2 zao!UQDj(bCac9j9hCi>Z)F`1YK#yB>sH#c# zEnJDJ+kQjNPqup~RTTOKN6Ez>}I=f<7Qgjc9&WV+yLGiIGle=&FAwEeCEBzXjTn_iT} zokbl1SZXnMQWTkRDKeqjQ;UuFU2-F|JGBv7%UQNoDk<**iBgoH73eYj=>!Z#CWufk zIfg%x35dDVt`h4=QBYG&x?4SqfYC!R*1pGB zeDIR?Hcu(yn20kRp#6Q4ip6k=FTAD%W|g1>CDu%3itzV1aM;DtdrmLKg$_(=!kt;% zDhm}l@kx*+hfFh}+=&5>VlYt#MNj_IKCcVN*u;jpoGc-rEE%ngHOVOT>v?I49|XaISEX@447Xq2TP} zp}xmO+LJ|$_;n-T7dwFk7qvYz-$*X1l*Kzg5nsF`&XQt#^U=Nz%z}9*mN$y)>yl6P zJ>no@o)jtZU6$c+>G;w198EQ0G9^kKmfa{aOufx0AhsDAtLxo&; zE&C>d9*`Pr zz-jOhuXMnz8^eVvA947ar4C>e8(-b_^s>jue|;%jRze9IUc-ggu_WXnwC0_W8H$qS zm$RamPdWdwopFJ^1lmRRiH2*j2&y(fZBO+(HU$_INCT~WL-{bwR;xgsXwae)x%7;WP+C5zXYm*f7mfu~nB3CUwW-s{l zs0vZ-Cpc7R^*?!45B>cE?pOoOQUmAHg*4`p3>1uxgK|+}0&8(}LbV}YxLg_hT9iJk z?Qur`)3h#TY2(9n^^)Zy=rsDU_ry-*0#=MCiz$+*1yAnwK~|HGX|>Z-Y}7<6O4u{- zqEnGjW`I;KxE(`;OHBbb&@?Vo^K!NJerx?K5#zuGaD?jW9`tPOMt zgx5|$%ChBNTC4$+W5mH%u+J3!-NRFh^Q71!UNTL2fAdo?Umn!(1bXu1NtU7w(E^Bi znkNI>oi1(v^lG^V$DHh`O2s8A7FEXy9cG3_iYL+)>8}<`O1ii_sQ~i**QRkqUKpak z3NGBdG{0XQI01Z{WU@O2rbkA(4rfi`Ye4Sj75$9hDOq+=vqSL}7`jkxF< zx9Yr+;V+95=eH+k^2MZv|8CX+kor|+Ckt~LYX;!Y2fmn!wL_{g+*fU6eYJFdQY_s-2j zyae{@hejejwJ);^#{}@gRl;ZDbV+CC(Ans6_1LwqPveFFGu0(irp81r+A!%BZ;+F( zfNUmHRu|tow{Q9Th50!pkhW8tBY)K&_~G+r^wfLs>(UR?D6@qLwt449l|0tl&iNe( z?XR0~9)Ie(^d?aSOax=->^|LQc!N56^UD!W?;Nreu&!O+kffhR>LZdT*8~403 z(RpVzBFZ}w;f1_|8`EMZp~m$&*}H>s-vRb9%msG=v%ve6mLL0G&zLrz7 zY64s|6Wd#f&T7QWmI6fwm-9>5tK{Nqo-bGRW4A4NWaRsSsKu;kgtFzEQx)F%GI+Hb zjO9Zv8SokhiD>m?VL#k<5?;d`skxWFPM#a)xYuV{UtO~V`m?~U;a(mp)ae2$KVheH z`;lj&Ib!v6z+Z)|KDz(Hi2j57cL5`*XjPUtV+zh^i$b`P5{)p%M3S`#EaJfBQrOB< zEM5r@yN3|6na2L!={N0g!{ywCm z66$I|V~t2x1@i&Ix|bsj7a__spH<^8h-YRk+8bD+H`;wn>>!btnijrLFa{(?HvGKa zG%5joA-LWtao;w|6?+WzhV2`yGu^mh zN?D-t#6FP5IDE?4bmcuSpe%i$<=4y`t!FBJeu}JrRi{Tc^LqpIsDp9jq+j2f=3L27 zezxuHp{cN&fOVZNy(~MR5!tu9*6jRq72iJnu=#U+nVG-$7n7!-wu^Am=f8Is@88_^ zFR%V8^Ap1+yw+twlB`iX(Bv9*e5l}8`0J~2ytcql*5}d-v1iUHm&~1Ut(kJr9YrY= zxx68u&$Zgzo_clL1&?#=Z40V@^ggfl`M}&3W>l|{iKy0{NSJ9)W`=n7QO|_U{zH?R z5TY(12%#ibXoKJxOq)%#dezZdmuD%rZ7TwOM=z4SeQ#pO#`W3(xBXuur~#j9=}Y`9 zhUMrKCWPCtDF1%DdV0Dz*%sgQp|og=Pgv@}CBtmr0SVQepd03+cl_j&^2fc?$j>Ss z!CG0}$+@_x!s)<5@2p)P+o-->V<9c*AUoV^!PhU(=4-pW4dJCKSqwpf6aU0%g>AE#x4lM%vvUpL!`F>`>y#6-5K9B`%~|( zy4g=NGZrP?tB<{4RPXs|lYa0BTkQ7x(`kzRP=ZUe-#xb87<}z4`-1L_5rk}ilf~_s zqP==yw`tC@%vf8UH9KUWj=fINuEpObKGS@b{oQvB8DR~ON%OTHRF|_~+G@Se_w3so zumYTw68N+|c*u|mRBg1j6S9M?KEK_5WA*vOm7D#aNyxy8k&8JC)UlLw9hEqp>ADp&d(cF` z>^81DW47m8q+-jQ+LReXW*n1I46(BK*rIt8y+ybDo;EMO?q<~+ijAFd{YCM%D<5V0w-S};pmo{dV;^ovAz1oRE*^2c)qV`?AzWSx?$n|+Ye7A3$ za=1Q;g{WqsqqQu(RvhiaRg3|(L`euQ!6E@10hxKh{F!g$ivHH4tCb-%*iK zJcnZ0%O4+B|j%zY`?28Uhu2VTNM!)--nYjg~H;$1GMs(P@7k*-5M7*##RQ@TGj}@ zwQbdp+!2=bVnR%_VdCZmU}`h&C=JX{)D_2GwEU%&%w1a`q6BE_rfwsUN27p}8Svb+ zxB2CdT5C#1K((1>dPXnQt>vhXT6_c~Ud=t^*o5bnU%RGcXBC!Ea(MY!wC0pdLE*xtZDj_hiuJFR+sUBOfWF!z5xN{Iac diff --git a/Docs/Books/sql-99.txt b/Docs/Books/sql-99.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Docs/MySQL-logos/mysql-01.gif b/Docs/MySQL-logos/mysql-01.gif deleted file mode 100644 index 773453f8dd7a99ce553c17412326bbc626254ecc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4097 zcmX|=e_T@c_s8E?QLlh-K~yv?P%0^#uvtpF0z^gBrL6iWv(m6%QVp|hE}TQXDk>Ef zm1|V^1G7HSu%xv<9~T&+wPjkH*(^n~Y_%FLTejNQ@BMr~kH`0qdmry}?m4e}&hwmi zN@{W(FMlV91g`*?ot=eY7(oy^oz7%3*=#nC$CF4TQmIrXlgZ_Bg+ftWT&z;5P!!c_ zwR*kYU@(|WCbQXWwOTtnJDpBvUtizg;NZx}$mHbY@4x@v=X8z?4o;4YbXu)ulgVl} zJ3Bk|TCK@o(4wdclT#>UQmGje!km~Qri}eSp)hH+1{CG8*{DLHlFLmfsxL0qDimfE zHK|kvtPGjVia9ZlN~OgDFeQn^q)-^-a#SkS%Va9dl*)C7-lWD+8 z!h$iA$+WWB209%@5Iuqz5X6KaC=6?1*aX97>;Qls00RIf0L%bbu{RwtpsK;aJ`9Fl zuQizrDisDmE|W?BOAe!mvHX9u7>xh&#t=H4gPomy*eEcH*fg-Q7z~)mf53Eh4q^x5w}Mo6d2nM@3TnNC+Ahy+2T0Kfns0MG$o0>B1<2Y?U&2>>zx zx>#wf^!6bvE6E%$zgk0{Cf@RdHYU|XED+M6#^#>=NI0tHpKnP$Nac$g80D;5 zIQo@n=tE8GjbrcSA2Z}hD^{H(riYFvx{Z}+Qcy_Y3@4(ymN+l&apWHb*Y>Me1$&Jz zPu)Dh$o?Sn+J)A;U&kzLTld4-9YZJ9do2=a5cd7*CDl;}&KIQa6@*4hzR0w?Q>kG$ z_N*h0@1sZN&u^J&WJ&Z3V}3l?FZ)n2d{YtoL&0gOM^;tx{^gN^JNCpmMY042wWcOT z6KcMUvY9O0$(*25+u4tN?^t*5OwSCTtWthsT$vW>SbBEYJMmEKib7>$;vD5N((GU3 z6U&@}%Uh1Uys;(@ewy1Y+V*wslCY3;Is_OY22j+()@!2x!%+a^{jnC8`1!3{1<;u!G-x3 zBvt!IX6RDF;%VDbs5H@76)wBQa!Zn!yx82a__U~CZpB1ap5n|W!_Pbu9FR0rq``Fu z?&&~$XgpkdHEmG>;-u|qVD*Gic0alA={n8V;0pN6!*kIaMTrMDRG0d6}D$th|T+8fIKF%i+)j{tNw~|sl7W()J8doUnByBX{wNMHIZb=ufoS& zni8cUp#eQ%jI-|QCR#~;4}OPVu=pFsC;B6@+dH2=D?B`RjgYV++nz}9y`jcYlV)rK zuxN(Uk1W5`T7j$zwR;j*it}+emP?6JlU=j?F7lcLsF@;Y#a#`^K=K_VW+@^>vRWAH zQji>)OQtGmu{|P0TKMw_==bW@oP`q=1ftt+^Y!4_y5MqwEkuAGz?I_{yTa`F#oI5& z``X@!y6`HUPMCebWa)zEi(G@``0P__*OH1Jo@^=H;hp8-8`=N&BiE}&{?jAjO@BRs zc`Y>`W?hJtrbc&m+}iT_>V&CP8_n~nxTqne1OH}>oK`Bmf)qSe4@szA-f>rax1K46 z#eCd%DT3$azgM{4&&c>x)6JlZ{D&nQb*e?5xgVo{1V50!`Z#Z`xQ7HL0yw>j*Jk;OYPrTz35 z|3FJgHRqS|+4{}4ar!KA>wCQe#I2m>gGXrI@8#Lk2yK0g(T#P9^cZ;m>W5#vD@bMD zyKTD}m5Dr#JQZgc+gljZMb!_SrBKb>D&8Y7&0w2i-_4XWRaYYu3> zgnPf_^V$+)+sw%bG)u_0~jav!S$7`Qe+kzp*H5aQZ=j@$PGdE7{ z|8%zFf!3SvSn|slv2fx6RpgimCU77^Zr7Y=8n5^eJ5*-z46=)#L@V!-a?+*eLtWt4 zMW(wokL^nv_Vz-0da`Fjg$CcS!Qi+hMwl&lP zmfG{M%bR0)>T(L>La#J%3g)ZE_NG2$utLQTBhQmR?TDa{GQ5_!rU37s#Xk5)fZWs=KgWqYb774{n#x8 z(VwF1T>`@A;>G>;NH-Fs{*}L)VHr|;#ayF|kx$2tn)?-kXDy{PPO=R0DyK>5y% zcQ0Q2+v{|++Q)OLs}aV3oXTR3?tC0UO*bX6@a2TumaAXC6{qatHiAS~SJ;I}Y4-}{ z21)BBjmcH%_2l}8>mPZBrTXto_k&q$QWCEYR>(!S#gaQD2Fr~{o;?v zG9I?<(tPCF7>K&QjaN4AhkLt%;$~Zy>Dwou0*|>5+%I%1+#NH^?_EgTt}a?*PuuhF z@b4}aEJ`S93_SUnVP2q41Z;HR+Z=yblb!ll+NnNM_Rn2s^MS{9cKsfjNB4OS$|~#I zCvHnJ*dK>Sf1ke{U#j*9*cvDAp^$PjFV{EB0Gu=*J}tc(yztwJ8_Y)a2XEz*S;s;A z5yQ~F;Xr!F-##Z^x!-r!zWiv+EKZ>*o!L>wx%ZKtDDCSPIW*ytx7l6;o)*HU)rn&P zZ8o2f@=;~W3;Khte;{%u;p0Vl8gGkw;bnVK3BEb_&L!Jyge6kD8+3W>wN>pX8q;p1 zT@5}cij9wY>*F6|`yX2j^3RBIiln!xd%p|**HXe83wg+!OmG9L&PSI=xU5d6TUMurrj2Db2C>@+ z9|DAH3%;zdK|ze5`(sPG9W4I+T8gEOm)EvYk)5W80-xB(q6m(O-Z6L z8~(M$=aVr?3X>r5B0lG&PVm#(`w7oM&JEp>>&g%A)oGl%SLkY^Fd{5I)>pEfr#MB-`RZ#fb(&hG|7`f8dm^@@O-?>E4gwqzbooCb8= zegmIy-ALRNcdX@f*;|ybX$G%$K_MsRLzZHD^GvAtV2M2S={N*hxmy?BOpcfV>!~*49 z%?}wwsvG^aOvcJ`R$5Jo=4h!5pB-*#l6FJUPb!0sl&&v?=*rfub=X$t2UTl!K4~5P X6*_zE*l=xYm>QB?K0X|bfcXCf7+Sc@ diff --git a/Docs/MySQL-logos/mysql-02.gif b/Docs/MySQL-logos/mysql-02.gif deleted file mode 100644 index 12d984b55e0e4d7bd793e1320f7492edae882f95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4811 zcmXX{30MYSv8`!W&)mj>tqSe+0YsG5&8LbO-Y5w`1{?9XWpLgDO?%aFcbMBnU z*^|-~h08!9cnLr#6cUL2$i??xvcPdYGd*3Ol%$bJY;rl3lw^=dD2c?Klw=Z# z%p#FZByx*H6pm9UY6gG;z(J2@6J^%gD6P{$k189L-re2R)a35!YNhCcR-@6VoK9O` zUw0^U$7Z9U=|iDzl}gdm<2D#H6h%MMuxPkiiqe?PDvd^d=MMGqCDq++=(mL%b=U0%A^bnE}01Bau#ug^s9 zAU$19cg*Xh+-{S@;qK`%yWN!6>*(&bb#az9pI3GVY(|G706w*2z=AIrK z4Tetk^-(k!I_YjQINg-PNjcnR%3*W%=nXc?*4pF^=?#7V()%yrH2<^;Xkuv&ySjQb z8m&sDvDuvT`X;*TW}0DIBTafey_ar^a%(gOilUX$XEwW?&K{esi=tX_Tx2%4n$2Af z$771RqtVzXs*j>*)yd7~kVK+MN}@@o*>0s7M$vQtZ~!C#$N^9QpaDP&z`tzUG^&?o zQ=eATnyzS7$eSdz9B>Lp>C1rvo7)*O8CofGpG0Irfu_|<^U+P2yC^fQh>%7_d7FAD zbCbzHb+yuY%7oGjff4i#{&yAt8UhgsjrE<;3?@4)F}ExL${Czksj&ggIvO7l5nt3F zBq64iSGFW=dLhJY;{j#l5_cArpo|v(F0-5;)@pqC=6Sp*^7HW+P^^7AWTdT`jDNVj z_;-kBm8Ffyzq%)b$;mvtx3e+)U{0+{nr`n*POlT;`@J;}7KiVu#*^pod_WvlyE3I| zRO5_c>fP-xOl4nvJQvo-NVAHuUjsEYyg4JtwEKaEYFClfY&1cQRm5&%8x+ZyEnDhd zdfWfda>m1-Ls-!ZN4IES;9%|6V&|z{FsJ5+1cxUkVj)HUHLVtX|!d1bp2bs1AS zl3YQ&CO)A!r3OlK9IKchURlbBcUh;nxGbuuoEH8FUccG!ljVYI1G;`Cwq;yPvnXk_)kqAh>EDMAgI(e2(i3E`eAwXr2qyoZ z0HG2}=Y(Gp4sQvT3wHIp0PeQ>+Zo;wE|4_7A&7O!60dT2u0QO`8BL>KI9DPGE35^< zLgV!8kNB&jzl=>N^py>p`7;Mi@Q2r+Y4LK^a;dE@9gE3%%Hb24r6^;6FyvB(yI?Db zud*FuFb>+K41U~?s#MgDf5%|#HQFITGrSYWs}enc`FYhjEMiynbrD1Lvuf*x;|ZxH zQU`I2nan}oUSJRD{O^CzYNND*&&w~W;902?jA7K|y%+gX|0xFRfb3Z3u*8MNi}4rN z<$@uu6QDYwD%VCNNT2yE#P%~b z^oNdMrV`UQ?5t|WWs=Dj@kZhv5}|+I@P+duLsSFCaCRKSkDjXuciT)v$9WM|cw zz4l*3E?;Y92?7>1 z(?ik%=;=B4!%BKD7X+T7l?&%jeDD{^$?~CLB#|~mHg$zc%m}wm9Gl>qx_aHU-Qf-7 z`>olQvP%)59|p*a9ii_xyt?*zWdFhO&p8(UN*@YEElfvVO+!;V#aRuTsutcIv@^G9 zbVR{56Zzb!Yjp1u{`pScp{uT%srw~Si>&jc2cjDzkBwGWZ-Mq7sQcn(I``XC)1ZgO zs?T0MJ4o;kt2ZuYfAG_uLs{bvYwESv(JUI9+lw-0D1k>t)^fwy&JYH<3e`dBefnf6hXhnO{?tRp(= zqILV;QoJj*E82RqDtDb_?)8OB6JCq6p*sJz^_L^Vif(;pyiY)J4@;xrCb| z^9}y*z%8Zye}U$-_VXypie6|Rc}Bi< zdwYC(voT8#%E-=}(h#kr2QWhgt(6vj+y4of{@^&t32bEuf*QsVA1p?t$6IK_eBoig zN@Z}S5?upe@s_f{jA*Sd-4wZpTpwS~`Q8uW{^>=BUa$yPi8>;-Ot+QT6XNsG%J-Lr zO}WnLl&BU>RkqC7_O~bi;nppN&+4r6BFmwyb9XbvfMliKi(|;h#+XQ(F>9c3<#**u z9Pgt|>3A3bbD>&fL|G;m5p~9H(Sh;CU!!w8?c#ei;A37#On$=!@nPBh9W77etz|ho zrxe-Coe5$1>GJ40J3ILgWwIJ%hNb)^9OKx-W#bj^3S3}Ck?+fp9~lxUu2RaNuwOzl zV#2v#rTE?+?kgfwf0wK@b`D^yBgm9M7=QltyQ$fV@^LQzW?ekEuuC2v?eWxViE{C&{Q;DbdDY=gpmdo13EMuxN8t$JwYH=HE?%xYeA0i?K+gZzx zbY!5k6E3dhP;4UPlQ zB;(0{!`MNSKvMFvID9IFpRvSoGs5EcM4xbh$vE;>4Ib&hblPBX;nxB9tPY3{Ez3~z zI>gw+DrBRN&ys}iJjh-A)o|twQ40aR2_$5T1%g7P#mIX_BCqXnEL~-E06syYw`HJ0 z4852s4ElL5$T)r5;uj%Y=(+|tvaz3C8_)I>e$<kdmym<{8KuAh;XAzLyyXxAFD8Lsd^I&K8NX z#be+?Z1a^t96ww^Am19XuRPc*HUBxvWBXASfmirppN=+k_Ah=6^oZK7&YSnP7~xBw-PRcf~B;Gnqx?#I{ndH}F< z-v&xoc;Eoo!LfktdrBjq5#rjRhdG1ix!6UtfCI>Sl6Bj&?-Mcj*@!U<;r>pTyLjcI z12Okr!df-<%rfmh$-izCf&e&B0Es(C3VLz=tet3n9`dzOF!S)V2R^|)`vD+B zFXkg}gWO&}rl}p+1dU$xl|*sf;Jt#~u=9WPW7VMGhIr@=vEYUpI~hua!u(*3i~mGD zR8+ezwZEdb5G%V6P#n(0**m&Ke=7&DEyh&>KbY#n zO~2)xYJ>`0$f)f|p`Be&UuRL*fgrHz_;*R+X@aHKIoEpFFLxg8JB&=Uv**<bZ5G!v_z1bDnCXr_)eGmpK%&sr;P_)d+eU7uD1WcQ`K z*}F}Lh29ME@XPzMtv>1Nmmo7MvmM*({vVD6ks3Q#nOnu z9lNEz7F}PTzrii2O32?FRq&@zV4q)LKVQJw)^c%RA*)i?jcvPx73vCfSBAGjM59z~=Dve}`0OOfKl7fYr1lP4#O(ZiRO219NT(-*H)Ja|a*%AG*GOK>z>% diff --git a/Docs/MySQL-logos/mysql-03.gif b/Docs/MySQL-logos/mysql-03.gif deleted file mode 100644 index abb16f2aa592021a54f84b63e246854522708757..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 716 zcmV;-0yF(bNk%w1VORhk0JHx9|NsBq-rmN>#*~zlLPA0zAtAl3tM)Qp#wa zC|OEE>%MR-&vb3y@1U#!?z6GpPayQ!bUdRBC;%J|1{VM@&<%)1R{#*G?q<{QG#f)s zlrZko01zY)(XC=ZuPX|KXsb=A`xSabbAEIMG-ga_TL=jWY>Wv+0E2{uQUi4bcYXzd z0|kTx1cy6kI9mgHU5yA%ta5at1ATQ@O_;GRpqYUJgh!=`FI!y(iwRK2jscKS2fL#! zo6!<}wk@GAzcq+tQU;9!u5UyGtmCZ+2!5kIpL&yiFtl}n+oVY?TLx?ajR^z%H9FAb zz?%Tz2AVTaiNLiz_gXOg<07JrZu*=cIKYgR0Z0h{ntVhiun{Pjrw)v+HnL0*MaHT9@i%_os^cEO`SqE6Yj&R;En#!n$x&t7=P1QrGAyYal zUv!P;D<-}(5(WbO=SZz10ay_P$Qcrgv|WU*ywo?gqS+Z3=i)?`6Inu&F8Bf9x#y0a zS$SP@f+2K4*s@J!CK24z0A0ZYVWfQ%rH!S;c%yV(a4kSrduFLT6cE_lD@X)CZj4b= z5+_^n==jYfg&tYV!fz?1JX1iFe*v#1?xkgGi=<%r)pD`=3Kw4bkS`zx>T(N=Eq+eN z!HA$l?1anHfRKOFc`3jf*!iiVTmZhRKS3B5D;O5C#G29H3q=9)PFI`s3T;#c$lM( yIx65Iirr*rh%3ne diff --git a/Docs/MySQL-logos/mysql-04.gif b/Docs/MySQL-logos/mysql-04.gif deleted file mode 100644 index e207e1790f75fe447abd91582ebab6b4575c7174..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 909 zcmV;819JRFNk%w1VORhz0OJ4v00000{{X!)G0t;y-rnB5t*s#;A;!kWwEzH=l$8Jf z|3X4SYin}=0000000000A^8LW00031EC2ui09XJn000F3Fvv-(y*TU5yZ>M)j$|nz zh=rOL>ayip$?zo8^@pEn&i}mLE^vDhT`435*;^`)Kv40wnnI^WtJRt8Ms-3j)vFal z&s$p<-2`WwRc291lLLq4VP{wG+Rti%Gi!r)Mj?1+TUc;}aczczB6^2xT!cYwOe#-b zKA$;ypra#|q^GC>1gosAuCK7Mva__cwzs&sy1T6myuZM~y}qjl#>dFX%FE2n&d<=u z2@J#p(bvVw*4PKz*U!_{-^!l?$pfe`t0(`;jH75)k9Z6 z!2tvU)X`%AprJzs1{SC@W^jSSiwq`qV|cNlfoA^y$_1n+07b!)2)ZfY*wN#<1P%>A zyl6mU0s|cvEC5LjU^IFOCfY+G;2hC~4R5JB`guyXvA-V>yvsbr!PUx&kN?7)97E0nxoh1qisf)7s66D=#Kv>QLic zp5lzrD^QStiv*TY3@|qUApyLa{T67s;4Q_+#ztd2hI(0D$>#(NAb>JqZF2=m&PIZF zb4!m5=Cvje7p`KuS-0&)hY(?B%?4cv1}nIvI;g)5IPF-K0Am0jjXT5|nKnYa(@Rdb zCU`(?^yk(7j%sx^GL`_+)*p{t+$zo1@%{$jSO>T#00GYlAlWuEwFFOblHsRcYyKqH zO=q%!^&D8BnREfi^!TLj?e*l|ypcED>x9fi_nxyh!?aw^f}RAMl`2;Mr3>9=2&?QAKHh3Z^Jo0O?l zHII4|eb-P%sttLJknq$)m1JK6z!gp|u4th#)qSWYGrE1~W=DO>hY?HK;VGm}4<+;3 zhXJLgprk*>q@*z>wv^F*^F=ylWR+f1KsXF+x}X9D{OIL}?!+o9PD)N%>NtZUQ$T}= z-s&f*z6Q%0c$qr1K&qwMDy*8rHVQp>=x!PX_~x8Q~=?zrTZ jYi_w&QKRmkhh(q-K-7{x(KKzh+c}Q&cs$e7(>AM>Wf;5F z%Gqo-mbEerOVb{b#YP~HyB(-Bdycf2!hq?IfH@G>Ffl-ljO9~$QzBER%^#` zn_6vGtGzgGRjEuU%3zpXr6N(3#V`s*tr%uN5E?~oLLb8z6g46UC)C0SL98&$KoAQ- zRtO>hFaTf#zytsZ00jUI00RIEfE5560ABC(+#K)mcm))aq>M(B!C)i^gH9*#5n8Rz z>lLPRZuhhRO_H=gFJwRvMvn8^?E)ENv$^$pK`)5)G%a9z3-1Xh#P>Ly9nWMUYG z)9Z~wR029h*$f7XB!z5T0H6S10H{}hS*_9 zi$F92F%ZBZpoIYm0}2K-3>XA(2yhYFIX&*hF)xNtYLvqeT8+9egi)hz6ed*&r$Ss9 zY{y^@gIy?OLm@i~aVX@1fEory7?=>iBEX6O8v^Vo@G>+d$nzB)(a6B%Pkue%*13}Ryo-*<%Y)~OA0udO*u?$C=SeD`uNau0S zxj3)Q>Y{{%jkJy7y&j%4F?N>sxTj4zNbqP&| zG}46Lz*07vWGE9&8Yv@T;^zb_FF(!eb$Z^*YjG_Q_VgdI4*)(OMySDWe*!=}SPCgJ zy4(6J(BkNioZamMweZ{8h^gX^+eZ-WLwQ%*xuM3eLviqYqm0pdDr(WbCz#DPoBGK9mcjq zR4f`>80@HOm4T?J*$$uk5n08B!^L-+!Z1g)@6S+yG-lK7`q#ILvs&b)>@(&cmj3(= zn(L5OZ&x?%89Kk3l9z$W)Z^iQI2Hetb+(id9kY`&kY?eUOZz2{6Y=l?4ZS?xCOOFOY=pJ1{DXJ~mZ&Z$+=hva)3U&tf1>m@)$(f374Y z@v5DJ5>Q-D%GQEzk>pBG$6?f_JV}Y3)&&QBECrL2sOnC%D8iB-D-ErtuXU`w+JZY3 zu_0TRZ3Kxg&A$(yX!}v5mM4k*-YZf5Bnnbgh-D#R<>Y$H^9Pw&n|Zb_N9c6A8qklQ{1ib4I6L6#p@LOIGz*aEGI8jg{lU{HyU=; zp+iw3ZB)Ct$XBtV;@WV+V19jB`VQ%}BdUXkf-}DUvGdTRNam9B;1Hh<3j0%ec^bZ07jVG3n-Ew0A@n zeS`h*xdt{!%a~jgxwE%}#nsOwJIlEKl7Q|fej(NJ zPyLl#MA7wxVQDO+s?GoJx1wA{5fqvpx$)8íKr!=k9>?2DRS5%5y17|Ga&^rqq zV=03pdBOg#@J7)+vnnvuQHMk5;{z2=w2q!VyzZOmZr4<+Q`RHu0!2qo|8Zhyf7a(; zP%{epTg|XwMXm8@EY{|dkeRQM$Tj87)t$j0M@s}jzCI@nBvi#$Jsl4&Gr%TQvw^8Sa z)HfnY(&q4x!$A5FSm5fG+?;=hNeV^^Lt5%B5v5z}a(db$vyqx&9e%D!ylN|yuaWF_ zeBIzIi@dVCZ^wKXR45;icV?u>`KhGFy!>eC;-Z=*rGE9vKP3ee0Y^xEJA{u^u4vA) ztQA*K^D!31#qq%?NcnZhpNf5V?U~q-{dC#;pGAb8>M97A=TWIGelij^$0hblVSz)QmTBMsAD$b!9OhX?aJS!cuSw=6Li2QW3r%O1AQMptVxM_0oRNb zz6j_^NKvi75-^MQOG;)l4Sk;1M!#5<}6WMEA&p6Xrw%7!<#<Ff?OQ2j{# zK5<}PcQV?$6spJ`qe24znd;vb=+mN$e2km5TZbPs-Fn3;k6z5)sU2;4uxnMq{fnFS d509Rme|13vk}v=O diff --git a/Docs/MySQL-logos/mysql-06.gif b/Docs/MySQL-logos/mysql-06.gif deleted file mode 100644 index c660e1d1f4f464fedcd6877e3a1705166bcb4552..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3082 zcmeH`>sQk07RP^F{dqx=r0@=!7t~4%P0|X{)F=x{&9EAj9Pf^)lNswwps47tXTNy%-ru$NXFqGNwZry?`jg|& z0)fCX0IaR8fgp%Rqj5MKfj}Sg_ONgnu5boaX8YnGzptMYzWwF36rTZ=xnx> z$&@e{awb#CU?`YOIfEgg(G(1ZltvR#sd5@kLZwO#0hKBtlci*`$j3+G<0Cb^M52^P z6cGp#0zrhsNpLt38Z81rJ^%;-pb7v)004lX55P9~|J(m;14^aR>+fNI-vR)x0uazH zTqf=*1lM^S?Uyw?C_y{ZMB%rt_WcvLE%jypt!od@;e*TU_TFwBxZr;1#?gV>l1DY( z?7{sn;$cV=%*NP$aYJEAv7J{q9WSOg0H&@i-O{#(5>t$Olu{f7D>mO|Sx-Uzyb=40Pj2Q_!r9H;W5YaY`-2BKy0#P5FW=G4FsC)F!i~q6PPPtRgv^ z%>^h{ycJ7^U7je$Ihzq~MWMxRzOgaye5aiuZo_I<#-=xG+DJeHypYu5JSUOLR zy~hbcn%-@)wBi0f=8hVCKj~>IJTn@M=bRoZ0XKi-QIRaEuM%QL!9SIYnab2yOs!2) z-?Kq$x9(7cH}BpZ=JUmFt487GE9)gnEI_O6GBWjOjDP451CoOA1)~(GBk$<>UR!t3 zB%*H4*i{Wdg)9+U_Llhe)Z&z$?X5esO)+rdSz7x*D3-!QSnc=bMMe2kFHng?ykaAQ zGQQs40pC-M`4U>o$FK5+-p$$LqIy(X@@eL!@l;C+q#4!X(o-Rh!AGZjaM;^WK3Rn5 zdBOfh7hU3h5FMTJ=BBg)cUAxaFub<0FGe|NADNl`=u)w1dMyq_TUVVAv(G)zngJVg za!^K<=fyR367yD51)ZhL{uxmmH)x`$Yu~8@&LjJNoCkYYP8NWS7iw}QtEboA7H0`s zM@+=`A~#i7_FE^9_uR31cfjF0xT!nk-9$EE#(nIb_%nCvMi^Fex*28{ekF3FE3YF0 z!C7RAU(gB(^>n@wmm3V`q6OGooq41z7~>BhuOO)AQ3JrQbS}^2BjHFu@)dKJk_$#& zIsmrn#h;s~1k$QA3acMPp9GW;n6-ZJoF z0K8w=ML-7u1j|4=Jn?*kM{u|rbHgQYy9w1aj1>3b%i+!)n)3%Ht^*#vhiRToj|*Y* zlo|6ziYWG0xSMmF6?u+QCM2Nqo(DV9MtPeyni`$l+JokbrFngiE(Pe~%>Q(UfPokC zrEN{j^%RJk%``wBFxJq*(5T$j)P^=LyyI}+V*H$|&HS$3nY4}a;u{duY7~%<72)OoP7yUTK@Dq@%r-7euJ;O@KR6&V9J3#14J}xWe?O()AAxz z9a$AUdKrh~LOq~R&j}vfF>5@fZDu_3xG7>Yi})PL+PO7jf1DA#ImE?#-?fe6e=SBi zt>YB}Ce&-A|@T zS&*SJ7vKkS88k4ubC61bS|qog*uZ*$SSbS50aXQCxsUVqZaD!3Wx!PgZ=pA=+cYJk z%WTKyws|lHO?nE43%dSbu=dMI(@ZyAL=Q-TaF zEtL+>6Iw|V5EM%ZJv9Uv%}r(dQQfkB4uc$ZGXJI1=?TJB4BU!Hzhib<3CkX0BS}h# zeSi94uJ^x+Ez|guxgdLu1)H{}Lnas`b zwBtRvYw|0Kn&dBepQK4BPc$Q*YqY=oidT_D@jZU!aJ=v!=9*`;{AlW6F{XFg;qyp1 zlXNzY*te^1p41VMTaaW`ziswS7%5xYULPaXt4^~6Cw`j3d#Cosj;4hr(8c<@QPhRb zLkGLDUU&X4Hr-(E`*+{lGTw52kS5iUygX#=4~!V;G*cS0tAAa6BKzxR^xeh? z{X$fTI;gm&(_PKl8q}p~HeNP2(tcWW`^6;Y!spE1ht-Su%^QcBHCCtd-!{X8h_aYS zR{U=JB-2W-R|%ThuBnjRbBDf8`)_X@?+7J)pR{4hF6Y~>zg8xS>Y1;63!aQuZ$7U7 z3EoYjbxhxDTSWhMSMF1jzblydd)~2~eJRM>FE3|~wI8xw7!BwM8f}{)q$s)rl0N76;bo1L$la_%O`nqR6+*0|yjF4P!*uAA9 z>CQ4n|Bnr4*!P$Iv3=ok%*!)16-l3DZUJx8>aiovKP=y~SY04HetjJ$`lLE||9#EK V*O`E|KSs~p|Jb~xf(rlv{{`JJy08EM diff --git a/Docs/MySQL-logos/mysql-07.gif b/Docs/MySQL-logos/mysql-07.gif deleted file mode 100644 index be309d0de1cead248854a8455717d8b2056290cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4209 zcmc(hiC5C;_s2g7C?Yl=5fsf5RAey=OjNQaK~cmsM6@I|6?3C0l@^OK7gAGnT(B~+ zP$9LV(UfU*zAj0&8CKfVOnxmZothb!X|r#`{FuMuch7U~dENJYpL@>poO924!oouX zm?_7A4ZtVh-$0lT0s#U5XwD#r0{|QXfinXRM*si<0zm*lf|&^f3J6kgIEoo46gmjf z2?V+s=yWE5z@$)^W?(Ye6bhS8XPbe|=20j-I-SR4^32TR37AX)n=LSdKp>(}L`9i}Adrj2a*0GPmCDVfT&@5B1)Z)Ci4;<)LMBs~6@@|x07?Wx z34%%-PDvmrDHJ80u4FQmY_^ieQ;Nk(i9{)tD&=ye*{oEmKv0FlsR#rWg`%RiAomi}sNOV%EPA1dI#H+%H@K9Q(TEbfy?`lQl6nXFGP?^7uHwAwzMuFu@<>oZ8D z2ARwtlN;o6gF<0YDh*nlL9aKMTL#0ZTt2E$j4G9*TJ5M#H>%f<_VtaL_0iD@rE)^0 zn$T(|bh-(>exk2$!eE$~n3&XRCw00>y?(N+^5OOPct*0%<$>cKXY^cnDhTf5SCyN0C)qOYF zr|JXfxbN<@9V@yc>?x(5hzOfdS5ac@oUzRDa}AyKky(v3&TYJAa_+hD^N!!^7v0ZF zTtao#M18vVwx=Br6TGtqAnan8t)Ghg^47^-O(0{^ZTJMn{U=2=gHbu28hc?pmDRTO zKI#tjmS#my@#38|;?_kxdA6+9bz|<$n~)7(ECJ_;8()g-3wyjCsKbw>hcx}@im*KJ zneh7Umb9#XBIbRU$A{U;)bsJWgGjArXHf^vIfQ8IP5sWH1;x3;Z}30VW#Xr>wRh`Q z3or6J(c1Eb04@zv*io*8m-tq^%5g2b+?{?PURdS38zT=|_AQ2B*mV)-?!sF68UF(P z_tnK;@_G!6Qh52%1qpw-jY_wr;jAL`q7MtTaQ2A^}c+iwau&X zBpKe9RZ|x*T#=#kn;S09xf@W+u@n=jr|&^p~KPBmGz1KqAz_Dj}(i?isl@ zv-&_>ioGrF4c&0#O;~Qk71A@e=JC?jY{hK3*u@(3JrfKe2Z5HFUsLbxt{V>LDLJ3J zwr8JNdhNKg?T@pWYac3aziG!_J#gZrW)k~mtJBe^D3$-qa`!q@;Gm%ax5t4bYDleO zp6zJ+c;{WBn zSh!H0H)M?FM1@3$*kX%Dx>x%SZ1wV{4)KUPfBO3I-EP0f%9PTcf6{yB+Q-$=91_N^ zq;AD`B4`*3&dt4BrF&1C4Z=-bncb~{@oFqJxaqgmxj8wYZMe_1S5g1jxyoqGr5;2T zKD^MmyVOZvUbpHgt^|$U0X(_qME;PviAZL&z_Ew$f=M)iECir#NItJy~U}$%gkf~J`sPiC z9By~==`-FeC#*<0JHCA#GHPEldN79%GI2t{wm$pR`A`lfEm$L3x&LknloOD0)G;dd ztZ%Llx(t&(cV&8aR&`cw8m(d{9{}Z3ET|8ZZ{b=t18Q^;H;wyPs0%@_Gr}|ZHL%0T zD6jI1Pq>%Wm`rt%)yhocp;qR>3$F&?HVD=2i=RI{HT8^5oH&#BX#DSj+Km|OOpcyv zVdG{zRRl}6a(|23zB8^(4DzGCp1;3+@%@ROzt1|`S+^j&Z3ZnldtO-YKm=DSTEw(;pOLzsY0GyU(s+>KySR&9*e!Si=POuLHl-Fu+$r@v zWV~?{hKFhJu>xu;ij$nYL;bk%k9@68l_<3Pe0=$Mnqq#C>5AC&ahY6mip)n;o_9WYFTQAn>9D$0<< z0j1u%!jG=MQk<1!!WFWjg4(z3HTr3sqW{`8)kq$r#@twFuEyn_DMq#IuXG0eAyY-% zt7WYACL$*-+A@$#TKB4DaE)IYLNh*?)_P^f3eU@M8h-$_ORdta2WzcX5n60la3Qm4 zBt>@ps@<(D7P>}#oiU5EZ%BNXA9KBV7)C7a2(9#3u+c;oBe#LjgK@Z{@W0{quFnRI z_v)P|y$Ai$?hc?f6+#ZLgh39evsga(&Pq>en`37vu~f7L`QbOmdzy~t)HKJe+50KM z=La*;^j?2_jljLGc>3TBG8z?WXNh40NDybU8WYp&T*S(&DLIFI1+33(_G!wlP2X86 z9;TSyZrOv`s@;{vDg6Ki`qi~V!lCHvfe9|7UmC~WcS=kz9>@RL&TMf=v%a_(2@ejd z0l7TEhFQoiRET^UR^#??Ymxf6I*`(c2#*_l`1_aM4m=8GU)QPjyX&hKzd}g!DpBng zn1(N>Q1-+tr`Z;TMZ{kA5&Wr#)5d2OWn@U)m$e<5FG`Q8az8iJ{4(1vf@*p88AsM*d zxYE`9x~eGtfO8Qpm=@Jqd5X^hI|9O2?Yn<$)!TWGKTeHY?@(9PuYZ}CxIWx9k(*hN zd(-|wp`mV;7TWgft8bXUg*XKjhql6BK5yL4!Y&IAvZ#)YUve-&gDeiZ-}~xRj}PAXODp?hLjCI{K|$^= zR{qqhZ!BV+?KiMIKNm;-B)r?h4Q(%8yTzA@cYGhgD&!o&ylgq&0OTgXBR2GX| zIB*eII#L*4%)$d@FRd~Hl9G&xR>Gk?H*cbSd^qnKr}-dn+Hrp&`eiOcr-rBFEswRw z5c;9f$$r+_jsL4(_dtKRGuO-d1O0~?B$^98i}^M~unnCTtpL+MJi$a1Z=D{q8K)s) zYb=FR)^!UudkfL}eq^vcT;78a@!`pMI5&uFOS9n9kW2L&^RzK#_VB%n0a{W}Rb7ll zEwEwl7Opl)x3>6bY_Or9kdbV=Q4>%zP^?Ra$Kp5btFe69&5oFdD@)At;Xk6S!ajo$ zYIpwS9UMJAOnWHZ&Gu~=h^P@MA1+^(dbHr^HWOpdk>UB^xE$2?_!VOVR&@Q!%{}n8 zZbUvGo^1?Bp!te&f@}n-!Ce+ue6qEjg<@(0oDM~}6?+NxPic|C;}r#a>EVp6`B0aG zJ-Naz_TfXK`fJ@~rAhwipjL~@$b}rvn1=-is3>HQQL#=sYxSQFZo*7%5}Y3KX> z)qJ44#jk?3m8V%h4kZ>stU*XXzlywX?ZVNGOC<%3ZTzqg%@RYNz|(VEtf+&r*zA(M zk^Xc3VaTDLx}b%b*hnt5RMfesjochA4WwsW^T9typFWJ+-jI#*_c?nqwKe%8OWxht k?iSR}cDVFj>wki}@=m9&!ZUw@5qOF6Le2)v4-EwVAI^$1OaK4? diff --git a/Docs/MySQL-logos/mysql-08.gif b/Docs/MySQL-logos/mysql-08.gif deleted file mode 100644 index 3d5b21356550d20e4bca9ab61a0a7f1f1027bec8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1595 zcmc(e`%}|L6vfw8feKcwqgJp5LZvE?L3c!i;(Hh#&~H1r$Yb1TiYBIGrj+L@HJUtIpI;BQllk-Sm&>{wqJ!<1phFb8PR;+SwuIc8j}1!&L$YQO|8D8got25k_7X)cOl6C6qiBZPxJ z*a{a)C?$*%4sHPgYK%}u7$Y3w07@9#e16_3us{ilmw;-%e=r!0t&=1lk9`;`@nG~|9J zuU)UuRdpTrh`6nl$#q?&6TTgYPK~MVuJEz^Xwyie!@WwYJjooz`hlR+D<*qR_fD)` zQMJ0#`EO-moxFaN%D>sxq--yB-G9O@yXbX5S&ZSxai8MY$A|n=7qSiSYP-J7h?;2n zBhlkd`=oI$Z^B!CdS=LX3MgMYE8?1F?mCUDGF7s@Te5^Syee^h(t1i>EdAcr<-5|u zfgQxHHLkm=F{bN@by00h|JAs^?)Q$)i)ydQw0v>ppO&}JFX}(GAM^B190=M|m)o+Z zwO2cN<`_2Jz3lz|?BGoIrQL15Ywu{*v{v+AY?S3W$PWG*WEnVRs-Z<|s+T9Jq^0H`Kzrj>L+f%3285Z-0 zbO&ba9MT`QJrJ@l?^f~L$gy;b3cnK7??xHVBK?(9rA0o)t4cJN>}%-KOWV`+ zfiHK~jX5d{L-y)bmul5VC220z>NmGtbZtqaE*0c%$;MrZBSwc~LAKcsG@+sIiw3OiVK4;6DmS=~&;xE?!ygV%`ys>BNhS-7^2Yc^bun(O9}u=6|v`HhW7lss7Jf)#^fLDn(lqj*r>XH8Rxs(;AHS| zE(rR%?``4uC~bV?LYH?cwOgfZ=(;8_J*Q{lQ>AB_s=VH0Om5g@dbBIMIO*~3R-@|=__J{#Cp14SGe%=l82y~;G}geAu#}qYycvuGiFzq&@O^7`^Lrg6 zvhKypqkc)WA4kH9L|5B#eW>g*;nJa?Pzp8I-re@90JyCR-OW8EcpXL5@^TowTGXL4I-TXjv%mZh&3bK_&;(yfmB z)ZG*EYlXSjSL{P0b47h=mt;S*&wIvYREswJ(+l(RC+S|GbCCl z8>zVnjGd$9MO~;*;)-F$CY0>X)GIvPcPTlgZQWbjmR9cFOHX^=%KalEZ!K*G=a*nk z1tt_0SF|=bM#U7Au5<6LCs&F@t6#Z~CrD=n=`|D1-Z9@_yT9Asu~3r5>v(#JlUF2| z72kYQJ8~zC@?BQRdG7t+=;e>&Xy^VheWPS}g~NYxP0phvwbtK}FuC&T+U?A&HlbwO z#O9#6wds*_G*WoB$LSP)?eFCc4cE_@#f3%+I-Yb1mR8IFdwswtcUwxx;GqNkc zZ@%vxlG*d(;bq`jdG)_9c8>}gS)G0Fv~+aFKHM!V`#@*()OXb|ez=p~F!8@7|3Ah2 zIdRZmU%)|kKn740K_>2HL-lQ213am?pVg`Xh8!YsO>(-LH-G zxd+5I%EMuq3yZajdc@-WRwHMrBkcnxWa$D=rqg@tGcwaN0<55&Bs_7jc&g3oFvlq9 zN(i_fEMy0$+Xb$*M(E*Rl@O}fUCoo0>P2qdW1`o&YJt`0C?4?EfmKn1vP4Nz?FWkf zHQhyb@49$#MvsrVVcpG_7LqRQ*JJTSBO8C#B)=a(Q6H?ZG_W^wavhHuMDgbDbagdPHD^-5C&7+l_{9JZ0Vh zFU!@v)kP127og{f9z7AbA=|`POfOU|;PiBFm@7q#P&A4pI-kMJ3e3aN86j4SK%h5l zX&I;VwwRNhz`j}}4H;aO#;GIwGwbsho{Bp*Fl=@14#A|sso5$ z@NKdaL-*cp?R%`Ivu((+uXsDdSAD(D;hD=NzC_g&N347-K4qCFaIq>gK2QLF*=-54_85bq6!X%;iU zWoDP6gEg>lK9z6x1V|gU5RG=k!8W?8cIoOi_j|*L)`tTi``>|#35UOGuxzmM^$3?$ zk!G3GIkiuN;PbLF_5q+beaex*;b{~6m+i_2vEvCwXNH6ma0ph0gPiuPb0orAX!7Fd zs|=L@Nax08qWIuk(1^<=*EGA*(SkLhm*XNa*muV)o4{B=2Z)0CRs-zIezbta3%*-IN z8fk7V;Wn*AACY4wVpeyH^iLVi0nfQjbXt_38f8pSb9H8tk)0$E@ix$J)ca2}#6KY>LOX3I@=pg;5jwHvX!dR!9HLnU zQHTNyXgv>Oq7-BeX|JJgavhw5est)Kfd+-9x=+0jZ1r){yhgEDq_gJNj<_vE%?UK~ z$)jdMhk^)^G7+By4_bJpX1&p?Z@yG(xRan2ey zP*?WJpdnBRUb=v2ps59%7t8oi7Qqeb1>0`YJGNy`IBb60gA|*eF&3+yNKhqgDGI5} z$%jUF;;U78Qg~G}yVOOBa~D4oi?DHLvC5|&sWS9^p9DxI?vW`caKIpj2??Zvhfmn37mzAHeh*i6Ol67a?9zB6i8qpLOD{&?N~2qvV)cg*n@@*W2_sA>eWDu6}-XTQ^jfGImho8z^ho$*Dols(JI=${a*IYdxA=}@N#?w zc#qF|Og+cwfX_DQ!;k5fp{{XPU^3G$3x2=43m&24jPneaUF2*n($jyP{ zlIPn*?Q#q`(4y?NqG@TYWgR!f#d|pS%(Q1ox%O@f?HXkxVp_YMX93i5x6bND@z@8W zR#_g<&x$*{L;leDtaCvaXD~gqm+q`&Z~A=FNmGD#Tql|S3aE*mbw%0r%RgE~kQlcj zAUXwMQWN(Z*pV)}ts&?b;r>HdfD(4YvRxk8mavT^8a{n)+zrR)h diff --git a/Docs/MySQL-logos/mysql-10.gif b/Docs/MySQL-logos/mysql-10.gif deleted file mode 100644 index 8d0a8551e9ef877cfad151deab5dd906eaaa938a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2455 zcmV;I32635Nk%v~VPpU@0QUd@0001h0001h0Dyo1004l10Du61fWW}O|NsC0|Nj60 z09Q**ot&wgV{IE79&&Mh$e^a1gow<=%Y#u_H8VGxbcCj+!@q=%hJ%dFu(iK+fwY>S zS65;S2MACxHhW}qt7>$dkf3&UiJE$g+pxB{qo$9GlyX*Ll3iyn9U#$xjm)U6ySl~B z&*80sh>LiOoSU*lLr$`7cq=L^oNRe%XKG($kh}x^Oq~d|L!WSdA|fZXaD1zjnyY+_lY5MHN>Z_Pfzqt9!>qE}w!0V) z5XYgW#>d{Ol9telm86M{+n%VrywRh1g`}jq*^rwmBqn=wgPLh|RZ>)GL`r*LY>r`V z)U>&|j+DH8hJ%BZSUf_7d5v;hYKn1zg?y2;lb(~5te20b-ND7yxV}j&F^Oz^3;Z;OkBGtX_^JykO^2|E z&?qpO$3kU*Awy~D(;t?;HVV9B$;BTeR4qlwM5URfBg)ROY~(SBNRLYdQIV2}5uC1uxaA49uTZr74)zKYGunU9|o!-#A#3k zJxI1>&CpdYT}FpAqPfB%7YiqyPC*eO4ht5XF$|WwA}$YLOTz5fiFV|IRAo#uOP@}? zy7lYWvuoeZeS3$Q9>a(KX9diSm=p>YgeO!jo--a{O-+H!URest+%eT0OC(Go z(h-&jvVW(B+IJE2M>*Y9)jh$qo}HQrA#Hh%(;{(XrToO;?;ox9oAssgE6~^XJ&X1D5KwY+?*s&k#&usT{+(A4&s=pe@JllpgcY7C@N~n9unhpSue=_m0>p^b zcoYSUS@A3BRp6Mc$XsTXk`_x_Kxs#!x4ikjqTO7wRK2G{&0y~eSiwf2u~2~ zptLfeqZR>#9EeOqqFA7zAbm8~zJgcC2L ziw+!#_OXd@B|lJ#ggm++g_zAOHUH88DJ?Po zj4n{YNQ{uhLCQgaV4lqiPzq2QzVL-w5Cj(<3B$`?@PevYB7vzXNR!B>kdo1eB`BGO zKkLb(du{<7o6*8%UUA6RNP`b5xMg$(G6M#EYZ30sU0Y%b4-X{a72%11A7H=;bNC^%(G}|OW|qYP3&Th8c^^|gfN0QXps(_ z_@ErS$Up|*Kvy_W` zrG{Tul$y{8BnH3>MJ(7*qO6MapLOXhO=TetA>^SKoq&Qlj9~_j8iXEs+g$~+v$op) z(7FX#p(R*aH$Gu!28444HL9@*R0L%NTS#6cGEj%D+6A}Tp}-Yt%MLRGuuq9c_yxFX7f}YW>Yw^q(WDX56Jo86o*iqx>6>t$aUnZtIO;4z3xA__Ya?+-mlN=_4W(!_1L~Y9$)~!f&lo9 zPpja&IdE|job3l6wSm7>g9F82cLvxl1RDjQG88Olf`txXHUT_~1XF<3)m5!lJ2y8s zH8nLkIjPZT`uqFa+uPgP+G=ZStE;PJGFfqPu~;k?i9{J087V0#LZL7&E>0j2@OZq? z&`=*AA10IO?Ck8|;6Ngg2m}HKgFzyZFc=H~fNzK2_J2bB0)qg6Be3;9|Gy@tF31!K z{d+~MMzoqo^sJszpA2jb^J)8I1?mso_Wb8lE$@(Yyv^`JKCsnVl)L^(XoD*(S?B;} z&iUXi&I4wQG!B89D(WgtA;Aa*tbj$L9pjSXJL5?q z#`U^9g;DUOs>Y^kA&j;#G-EIXVxm9<_w*?=Rn4O;)W~4#@XRQ*{sk9HBXd!-C@SqO zm3}>POG9v33Io?cw<43Q7#JEcus5NDVyKr!1+-(j0__E~bzV*cstA$iyD#jVe(7Mb z8DM^2)#U#$Fvo-zCDML^J@=B*D2a*0p^AniehsRlGV$32cMlT6p zarAdyv+GkNQVguzPOb+MqU;!DB@8zJfr2t~&_T0(rMt7`@SP}LmWH9Ttjw&?(*rgYwdycQ7PMPEw{O6o#=Y_edqFssuJ z@M(ECnp6V8=?!PX$>?$|B&qv-0b&R1b9vNG`X0#>Vw6Xn?9|MJJn68}=9EDLt6Jx0 zh}<$l?2(i%LJ6F%DgiegrGFp~Bv}1^wTbjw@}l2vLZSEcwQ$ubdW{4gGZRr_uB(*>o9AraG^*p3$vF(BKk@|v@Lfjdb)J3Ge zZTCUSK9hk?UT8m6dgbt+Tvv1Al9+=Nx!w?Ax4U5*Tys^%nu+kz`7ub00L~jixTOQG^;O0J>#-O`0XW`AB-Y(g%jk)fnfJfvspWps6=t-UG zqbsa@CH>a+iORHv+Zan*K9_f7BBtkshNWc#JgnzWVUMkN_%=}p6@rJQP z&tY_CjO2@by7dPNO=r^6oXj_V-~jY&Yq*`G-YRV4z0aCv=FP*1Q zLG69?ph1Q`LFdk*2u9GHp6AxU;KLLmDLXSW)E2!4w5lUk|hqm$eLKDK7(v nak6+XoT<|~!s?MT?^-=ulX#5RnjBxM!%77@;8_+D0KEPM{Ag7V diff --git a/Docs/MySQL-logos/mysql-12.gif b/Docs/MySQL-logos/mysql-12.gif deleted file mode 100644 index b045aaf3549454b8cc5b158da1a01b241db65d71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2642 zcmeHG`&-iY0{(ztXzK79nx!Zzm@e>=VwWK*CYcw+3uc11&E_s_T2txF8yYq=({B!q zHZZA{v7p4-Iuulrb|J-N+EYwVO=h;xx#n5N`kwV?oaZ_3^SnR5m*;(xQy8(-qEZkE zR$u_b@XE@{--K;8*lL9>7T9ctjYimDfVEm!qk)x5SfPNWQW%0@u^1K#VSxaytb{8n z;F1zJKObhXU?vl$(_tzVrchuK3C81L91g}}VGITb03Co50E7UD0e}F|0ssSGwXK*f zR)f)Ew%CkjtJYxAXw6cEL8&n-ltxHu5JOrLRfr=Auy_H$PyjYxDAo#uno5B(zeI|` zRRRpPqEcB>p~x>$01Ta#FJ-bICQC|ZLR7k#N{1*^F^M9?lLR=t08bKPag|t{0E4Zx zT5UGl+t60)it%p)W~;?wGZ-vJqgAUlYqb`Q#;jBt6$&E+X(7lU7Hfq z!D2}PzyN>;|HuD$13H}!{}&4Jc93CjqrCkD4FiMte(#+snZ60*9$GM>k|zj1Fo|R1 z)d9nfNB~4UbxD%@KK{0O#PFy~n~xetEhe<$Ab_OJ&z8P_Z!?)onC^LszDr3fcMP9* z|D{_N^l|WSvn4Y(-TjDP&X9o)btI3}=)t*=>?t8j{WollB$+lMcylrbG!rMugWAK- zW_~rbkx(($Y+@IiuW>Hzn19%Wag>PcL`Cb_=eq`pKRx@$SFEIzTaoif)%q%%|D=s>QHq>O!oE2KnVPzle0?F$eD?_ciH$^VRor}xbaady4h_j|LE|cY`(h5?Hpy~ z1TJT1d9zb$LARW5=Pa6BgN5dFZ85b3$?nj4h1`9YM?A_k2{-PyM}y!Wceij_a_iFm zIPgO?dj1gyXQWwRZj-9iUJe`ZZ60imRPQw1PoVBT<3NKAwQHQH^;KgJh zvtVj0+nbEe;OBh_!Qgg4by%S@;5yIy;sPE3s1QVjZ4eo4(J0?GWc_N8vJd$-%1DvRv5Y56Mo z2U()?uBh?8^F^H=s{7<@^}};o*T;U)Vm?_vRr>YbKhG{t4&HPjr;3I>$vyGh-COOj z5rywn^k0YQU9k0KuYUVB{Xfxp{*!A&frXouSAx*%FH6RqCmwHq`g-qE!v5d94~Fd- z)FX)$U4!WgWydGi*bCdJMcrQ)5G#7W^^P^=)r{%-T&ov<8Y)wd{qZ1eTiSdc;X9Xz z1x}3gud$lw%rBf48DbXlo!Bwm%c+=*&3mHK@xv>Z=TcCUcj^X?E?hL0+8Gc9N3T2P z=$zfvgCUPyZP6M9{N~!RtI?d{KnHgoErNUO*NW9AKaZn+?`TQvZ@`LWCZ*{30xv}Au z>JV*Jj)j}161p?dU=4jN=Y<_Quv~vIBGZvy?f+gZrw9}GRI*MIl61@CPC(Oy2sP;0 zsU_+iiA$E1GaZEK#CCg&N#xOoZQhh9-;yhf-}3;~{Js8GIrq5;-97;vck+;j64$dX z1NZq~Gpa#H+XuDv3@EH6JaFP(VaJ8`OVLJirhk&Q`vBw zLHK*iNa!xIBI|VY%hSgNOYLU90iA+vJ)xYtw6wyub16_(?@PBUo`JdIgCNU{lh* zmO6Vp<8&RleNhf(KIqT0J0H`N9yrkFCa-@W^ogBaLvGbqbu^Ck6RVDJACkrgnUmhn zSb_E#06E9ZMG<6$w#cPkQgiCM2LoD7BH%B(a(I@uI~_SwND4~2 zmLDM>&GKfCQcXi|{@CnEtY_HM5Zvy}vf=;S?=Lo8Tcvn9roB%8D=Hwn1%4G3RaXO; z7~YL@#?TA86CV*)Ms`c8C&C+&7OEaRobFs*MtQ`#05=svL7BtQ16XdS>{3XN*6`{+ z{*V{r&5}ImcHk~vUt2hX_NOhQyj7vVX)$6VKaymF+6#quZol!(b}CW(roEnM3V$)t zwLOpS8{PNKjRT;{2T$8Kugpw2AZCjV<9$b$P=MYbI meCl<7M`W45*Q!jmb!WNL;SS;E)WN=W_sacllARFLPRY@L5)Q*vIZUof*Sz@QbmomK?2e`P}G1d z(IPSkYA6U{E77n;i;#y3arr?E0!CXfpkT12FK>MBpZVSSzVn@X=ALtZvtw6i041>k zxB#sV=yW=TLZMcxwOXwPeQGp1tyUqIE777-DU(Q)a=BWekcdPwu~;M&YL!X}g2+T7 zol>b)D8xdcMlMHSSjguq#9}#GS14o%qLs@fLZMh7P@@d!APnnJ7@x0^NQ7LjOemBH z1WFVvlZp6ztwbV6dBkG1NTfs%okYT*Qng~SfX&v3L>xL@#O10H1ZJ^hFswlkK7*kX ziPWeV1YuFBGCp4^5a2fw(hl=EK=_HbZ%|_^SHHX6@lQ|TM5*5SY=(t=hhr>lj z*laeL%pj3;9FCm9;8Q4CHk(5xi%=daRe>sGvt@KTpG?-GTca=rLr5mm2?QOD#vu~b zRH}$frr_}c5=l;>NXTRzmC7OzG$;>+B1Z8P3PL2xQ5onOr6m%TB$Ap$(vV0jJYI*^ ziA01z&=QGM2!io=8U!f`1U1S)AkZO5i*7_9upvl}$8#V^jmK;7cr7}J$HNdLfFL0R zA!rwZ6zCv|had_7Q~+oI&;eiozyg2`00#gr0DJ&o00aOC0YCr{0U!oI0)PwvIRFX( zlmMs!&;XzXK!>(uN<<_V2qmyU!iU9d4#Gmuk|Cfogj5<#p~7SepG4*oNnAXEjVEx_ zYK=yN1`y5Emn8l_eKOgX=t(4BVkH(UL?StwI|Mr2;Ayrch9GU^1CcB5{dC^z69=0tb&rKMqKxQsQSl%ooib=qvbg zCxRdy_}kEKXJb`&E@bHz|FH3T?|HnFnc#540lyp@{m|VT)9ol(@1YMqH-9~_<@mC} z%fH`d#&5})mm`AE^zo1sb#bA)|N7)_j=p(#Dz$W;d9P~o&|{~VpW}D^7=FXnH&lFU z^mdd#=6PpiQDag}{U?=CP;Ud1*?a3>?3o8qIFr`{SL2v$%z@sY#MPb8o+s>0RvVSZ zWxLzAq+GZ-af|gVy0!R)_0zsZczwbZLb1NLYLCbM^X*yfi|%QoNxf&TJ_*_w;>zfl ztJs+T@``6{W5PS7q;kbGkGs7o<8C~KS5l496)1F&&}18by3yQHyh%>d$l@^#{U`n=n}$KB4%*QQUu`c zG``&Xk>|}B?4UQ>YTKY!o%3^tAC{+|JYr$%aXjB8RjFQt(nU`uaNfD^;lY~w#d z9B-3?*=+W$f9oWR=7$}Y2M&$7;NU4W=DQynOa44X(l&y>m7<{ z>y5&B2VwMAZ#H^Y;}w3H5rY_LAs7{_WU4 zoKHkpw{>B8M!Crj=jyG?L7Tr0cx5uR2gYXR7W#i~jI;Q8);HHY_?>gPDR?6d90F?J z%ddmb8&??g0Suc^KY`-Gz&YNeY48m2&g$K6leX}9=Q_{P3M2#RalIdvSAdBd9iD9y zEriFk8l-|FrzOnMeaFAYM-5VO`liOINvYohMv7T zi%~|CFJSRJm%AhM-L9=34JR!fK=*m&@o1zTG&naby{UZK^D-(dpp?*hJL-KJxjN%u zzeiX`2yo5ISj2c_&m6tb5fMu;F^S8O(#Y|t`rG)HjF7>#ctKdy#_}mdG2OECB+Z4p zFdaVucJ3IDR3zTK`c71x@FKQnu39hJB8K`XwrJ+4(fcSXC)kUgI^DOft?om~E7?r& z3CDYLd2VOtFJP>PZBkuFKi%!I!kp=`x#K8vHhPMUJZZEkZX!o~Yg?ywb~-nwIiWHp zC)aYj%B%@%oWkoi{--|N(gg;l$`xB*E?^AS)#WyiT(b3GI%2J$Bz@gx@4mI6QoW$Y z?VdF^OO5-x^~|BQ7VdLkMTQH;yZ{)aGJo8=aE{v0d40tidUoTXt zzqLNiN*;rD7?-PyGMz)+rvi2?sOI-eAu1Lt<#|oHrFAq2{&{=LNn z^i5vcc)EOZ*Su-^$tQNCiSzztkIm0y(q>`MO*moRh0#lMT(e0BS0ZzPG{LY*$HhuL)m?NA=hDAW#IQ0#x%W!bt%-+;;;b#slN3Ns<*PBJ-#g!{jAdQ zlMeumUU(8nSF4^+2MI9XyE`oVP`7Dt4^xzkcRutnU?q5-qboilY<7CKRJOU!7O1Murv>BsWP;uk@KFD_+{Z1@Uz|L)gL z_I1w5b*Y&-kN((-GMG138?go`-&C8X;irz6uDebilv+8BMAm1%9ssK_vfFw;d)P5qOJi7`emm8_@u7!D(#6=7 zsd=D-X%*#L0;1zf{p$)r^gY#@_ZQdO6zscIyGm+B(Df+@NHP0hy&>3Y{~)fkxYfO-5Rjc|%#a$Ky}8Q+6EH!XG7IMoEQT1hS9j}Q%m1#QajUko%0Ox6h(ATb zMPI5qzvW_Wx=8A%zx`sVXGEG6_qg0@xzoyStd#qtP&q39X!kySSgf?1?eKNU*9m#< z#42f&wbU>c^hkzX!rcNIOYk!`puwvC3aa8yZVY&YZJupUcbM zoe23t7`*L<5Z48tLvbU=-1n(MSd%u)cgM|jzyQy`<6V~Q@PmJMLGsgL`x|S_oK)s_ zp;_-@eIE22J1}aIZ{3=u7dQ9%eq<9a+Czo4j`{0J>4_YE+XsWkk?Wca9tIh12y4ag zs`PvudDy}{kshBp;!%)u=deA_d5W?>{%G&|4@uV#Os!qj{&)*D!d1-1 zTP4mF-T!)tU-4(IZQ^{kyLoZH8Rg+Cy_({%zQ!Ssl==Rr_-%x11NP+8`!2)`u5H?@!8QaDL}Z8+Nf-(;X#-bcECs1HKmruw zKnob!D1$^mNkt(Ft+|H56f6di8uXS%CVK#_p%*pOy6$QGEAE%O*YCr#_lNzgXRo!x zckc=aOp}5Qz=Q$pU71kKAjO0VtXhci_!!3o|!vM`_77z`EX+{{qAlL+8^U#3M zPy{xbTgZf&XnGoq!mtsB4G4@Ph@OUMy%C)^tfRp?Z$!;Rv`pAMQ3t|mvtS}Bvj{{~ zY(&XM6p@IWgH-bnDGz=}IxIHBhl}{IPzdvj;B+%$m?wrgQaG|2V#}dGGYW`lMhSVF zQ9(2ngs34{YcgR*BZiv87)%BOrq`QvI+IpwQmaiWl}V{IDilV!+*n<0luC_aF)9`t zi;7U85asjH^mLTRGw^sQhhvD0G_cu*z(50&Y4G;e(`b5gDj3#7kQRb;5Tpk{$B8sV zvJLD&Lm<<@^wxWuuYl+gSPw&b2VE_kU#+0bH6monoX|SWQzZ_m4 zDTf3iP;5&*G>OdgY0tVvRKwhvSux3pn(?S(Eac0of9zmSHQ-80?P(NN_Y$WWx?sP( zBA7XSDURTI{A9r>M;vu2_EO}9$XBx^Ou>!Xv3q{ebsOVVg0XQ5#H zCK9q9KN0ES6PD_@5uEAZQVO5B`Rr>Rytu>NPxL`m&p(x`3;4*rvdJ?k}Hx~b8B9>W>HCjZ- z9f<4RrcN75VC2ORbthrR!1a<F0L39G<

J6+X&7t@OFUmsWLSrk+6f+sfF!h;+GP0w zsL-quG}vCU60l^z-akjawina-ye}nytmXRwX#27**z|mPWLtXA;wbkqEzBt?BD^a; zan2zuZ%_DUzr?f*2lw1A?zH4V-1)JvH8+wszs@<9v*S}r?m*eg$5*#k8a|6!$!t4# zVr;)v>-f_Xzq);l$23|p7w18k$}T7rXHI2Wc{wCS-M1D@IOiwK6$a&BJu0y12t#&H zIw!fE_~j36UEz!>RFcC7bKaCW1`&WL^=E-TgxkSkT`N=A%#x(9W?Zp%jGHwH$O+urF;TU z)N(b;FM{6G3fFQ`@H4G0Uyy2%(hRQ5F3@7Haz_wGXQ!ulI_MNRbnWN0<^FS9=wCh{ zAJDSIUQSEF4~I@0S&zPX(Vi_yt=t0fI3`J5yc9TT8Sy6 zsP%j$fJqDWBnkEOc1^GSQBA$&N;pX{cnO}7)gavjtGwV1E`bBg%HBg~8-^=?oZJ`T z4wzM8zJsf6H#PZaS66!#jM&bIHq)XaLh^h{=@JnG8K8v`S()*3u-KZZA&mQ!-b<-# zuU7x~;q3v1gMBQpkS)vSqgu944C(T}U%s#;Z3#wq#|T}(p_Sp54@^VYNPW$;9az=M zB1DdsxV>zE_O`NJ?~RsicWOA@b8)A_Q@xekYwPG2LmmY^(&N=lZj#}}`E@^h^`3py zUE8(;+H*bfp=h78afh2+6r4(JZ*EbDNAhKA%Ytm0cx7r;a06?@tFfKVEv>IYrHM~U#vQfFt%cAj=dK4=)@Kxd!M+gfa)u?|kg$0C zm>1rmIqyK!A7>$vSIMDpI&Z!2w9S!#wEYChzqYRI|3Uygzw)-rIUM`dxH;ojKIMk! z{KjLAQF{X{5a0fwS%p2=1NFQ5c8c{O<+g9f>y|DGt<}0M^dmP)oOP~*J16t#H`L0b zHh=X7WRL{%W!srDI^6i6wiqz*ZeISk6*bn!&(lNqtEOuF;RE{<3xBujr-ybJoUd^M zj~wK^Dko$~)UPk)QWoJSg#2uOd>q~*Z$LsSlGzGzU~SGl*`guLCV76zc?mDs(u|9B zC~KJLn-M#GvC^MhVON+fO9a&DvTGt_n2|NcUB(VOuG clBzZQ{sJR`W>YBZbC0;c$V^BJ#^FHF-{WckVE_OC diff --git a/Docs/MySQL-logos/mysql-15.gif b/Docs/MySQL-logos/mysql-15.gif deleted file mode 100644 index d70ffec83ddcd1cff6c0791dc5c882b6c89b2a4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2310 zcmeH{`#;nB1IOQ+S)Va%=Cbm21j2k_u-S#YQIN61k_V%_WYM5n_o=BUFyl zMY(j$H=QVQX>PS|QKSnelZyI&k8{qy@csGw`r-BC^M}{t@qF#t?djyqJpdfRw{@_- zzP|kV`||P^#aD&m^N&wI6rVnQTKvz_?7J_sb06N!ufATGef9PAt5>h&-=`gyd;bpP?N>*3qZ&d$5T9c?S!zr4TOa2co0jEsyVaYo{MUP7)sIyyS4lEA9* zVLF_2bD$mE>_2E{XGeYHVOzJu)<@WwW`3J<8eU63Fl*vm7((wW7& zp1cVanH{-Q>UBZqXcD^pM)du7BaH^F{U2DE%%ykavc7~m#&Q1~YC(v7{6uTiGvE6i z=`SXJRSeX`VL{Qwhzphn!bU`VvogeG;yu!pMT^OP9pGayGBSfUNy7GUejhK{4R4Js`N=qTny$(La7fn*1Xi#!*6J%b$B)fb#Wch+lV75= z^ne;PO3O%k8q7)EpzYYBFUM=)fRFdx;o8(z1g;h=NQN&f4ceIlCn%1igIjoSctt+f zYX~aaRz^`Y9Uprrwdkmnyl7d3;=` z6Tjy)VACplWdv|DcBek%NPEdrZzxCXu;e`z35_f1hrggqa>03CtONn+Y?!I zc5?8*cm#^v6ZA+o%llx70gjbS|IjiL1fkY?#tHCt^p&F1ebrO_@gr#7pvy8^I7D&3 zlgm{mvZRIa)}-MPx;aak?W+XRWyrC~+kDSyte2EOJ)=Yq&GLzwbQUbyPi9KanQaJ? zn0=FH?oZ}3lAih8{deZAb@4a(Nn6X+>0I5!=@?6V%c^@Ce2J4*n)3WmCZ%3dBd#uV zWF8L|^$#ry0E==;t@Si{uo5xKVvS*+pmHK?99#i&q?Y}K;r z0{IL@w#qs>t&^{%AnVYS^t2|GsiGMrBiaMq$^u(ejGqUZOhdL+@+Ei=Wvok%o-`au zEr6-V#JFp;P3Aa=#OQ;F9Q+VQOd@!k<*XRHM_OQZMDx@|;v58I%)@&(suzND#m!()Y7u7$N zjXvgg`CDJDjtY(IznO;5RW^mwlwD}v5yAp%D-1;C%3uagpR3gWzA-`506x~owqK&B zvte^yc*}IvP&I+wKolgt^tNMMLO8?1pNc|n*?hEmZlPA1-{!?YO{Ya~-RJz~XIDs4 zGruW&>)1_`JF7SV(hrrWe>Z77%(p%QXt2WI0f{126@JX3NS`(!N!}X!jHBua6OD*` z%IXZf&}`2ReUnWo)};kel&S_Dk0Lc-6ZM1~5DX*Shi!?s>-9ZwfNsdg0e+lu8FXg z!Gm$4=aMrTSx|1+8ujkXf@fmpSUho+;@GXz+mZ<_g#8GygjEs~Pi)}>z1REu;J!D@ TPF;U_ofnKb{*?@afo*>Qg%VrF diff --git a/Docs/MySQL-logos/mysql-16.gif b/Docs/MySQL-logos/mysql-16.gif deleted file mode 100644 index 9b30833dc1dfb09d8bd7d7364cb7947074cdbf47..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19192 zcmb^1g;QHi|3CaBB#>YY?i6<@UaSy2NGa~_?ocQ#4G<`yfg*w8#oeuF8{8@GrMN>W zbs^V}`}_P0&wF2IX3xx?ojGS_&+L3=wRN=Q#YPaNZy0_GD#=1CbW1NdM&cy}ibIS)8aw`NEbt?*ozJ z|G#PSZ>P%7FV|HoH@>A?ZhgzR+{L=w#iiWGr98x^JS3z%>Q+=a`WCtzdkb5RyM-&i zeX#sidA+r9y~{1@dY@Y^^&vj>AtCiqA@x{vJr-M!!`0{C%C9fKRbF3ztG?aGr9H%_ zJtU+(Dx@8aZpUKVakp^o`MCD-{Pyzl_S-S-?R`-pedwq@EV>Ve?aRmY<>&X6-zx8` zzg6FNJD{&`1dATQVMlPdk^EcvBjx2I^|$Ir+HbXw^xf(k8M!qwlaHIp&z~v3RX$T+ zKhxJYGjeNWW@cu&ynMO7e7U`TxxIb4?^fUP$gPp(nOif<%eR)d+S|AK`nE=Hjcm=# zY%Skf-rCwa8W}m7xixdNd~5k=>(L%^iQcD$v0^0m0jM7~aI#dMxr$m!-d%?dLG4I;^xzAne8L_3XLv|C!xr1Vjy zT9|Ho^-{G(xp(qJyU=o@O<%(FdS=~fi{o6%!>Eq>wYR=I4F$Cw4I7;iCtJMC)nLQo z&Ls1%vYpmW11~6Ow0bRrc7{?}w4+73Bo8LB5{ffZk*!DL1**?GSaZL5PM4VEnI}JK zKU;3n8&wwVk-gZcbNkyiw-YdipRP&%D%&d;w6~Wk%paW}8GJPPQaeD5t^51wYPHYv z!h*j)PPPUKad)5JL`8l%8h>mN5dG}W&&$2HZ(iBo_Rimsylfju_*C>B7QQKegf-cY zA?8cmjwO{H+m55ug6^QH&5=9t^zMl}3C!VRJ1^K1pu34&S;$=spO7VmSk2XFUH}&? zn>FSH9$}Dtf8LWjMd`B2B}L^2X{M}#U}a8hw_s607PC-wCA)%9;Sv0> zLWqF+w!(svAinQd9CcW8*3kRo^sEt2EPUQHMDKInJjPdh-ZCY7cHa7q{#fW`&;WGP zQEHd;qGL1s?BeZqg79VM{-KbcjQ@aOZF}gv&+i16p$Z_8x$Z5qvtwa?GjbL;y6 zBqCRMFoW-TS7W!_Sw3Oe>uM0LE%IgPC*_OFyruak7xlD{&%cavsAE6Z{uN_&9K1}Z zyPgnv+bcS-_=Epwd{yB*xVQ7r_j2aG;%Vzl)(>*Ysnd5=K|SlF(-)Ob4#z4N(hR0T z-x#X+$<%Ot6{-5bWuxCRb+eq`GCwUjU6$-wY4^Pn;_|FxJqZ2lvNO`tSmeY%~{ zry6h-g&|S?J1-f%ryuM{?i71@@l_<@_Ke z{L??eswBFGAeQV|6>if{zsEdcfKT?~uN1ehFT*N7TNOP&TlfUkv{a+HG(;0vj~`Ml zcmScafP~TUT=37dftb`XxOUT=L(T$B;VLb+|9lGMGa=hUL$r=YRFeg)F*sSr6fu@r^X*zNP!* zlKOE$=Vrx}S4ax%RXPg1&+~$5N<~c-tq#@&(T0p!3bpvYEGcDsW(86KEo46*s^I;b zsDESS2%P%o%FIwL45F2Ypy$}3{J8=|9$pn(u{tX*{2ZjU-WC@pnC^<4b#&2peaQ-( zI%t?tMP2>A&Rr&VS8J_)sPb+s?+$dv@fxP<@lgO+QFf??>3XOuW}4@7%*W5WuFtD% zkbL+Qz{JlnIHs*%k-rI$ez*{>uyjyJnmXqly;!=@>&{!OJ5H@HRg#cXCG}{cmPK zN*cH(oqWGNo9v4vavzhQo{K5&A*GdORc;~KfKu^=9Ox#232du9u{c9lHkj|KEe{8p zCA#wD4tsk%e$p%(?%yOUd@dhR9YZZ*ULAQ}L9EX-L@5xSSN^O4q6K>gy=u?Vn-VId z2UtI-DQ@e&;SR8bDlNsoBI5lgtA_nR&00_a7)f>1cZSu~lN) zKm3u+2gnuM?dQ43Vh?#nUzJ(?MqftJMPk7QeV-#2r^*1Lr-Q%*czQ$F9H2}W|K z0%{z(k1c2&Na|`wKdo-AzzH5r{36Zy7;e@hgm$^V>r5Tdd=+n^^uT-NV96ATc{~jQ z{O)z|LO9~H_`Mj|#3gJSZMT#Ttes|K$PD9e@-5aUj%E;w8;&FT|fwLkZ+8Koj5DsWl>>#4YOlw|#^oc$O?k z3G-;DhtK%N5(NA97Vz}HpNww_AD-cfK1VJ43%RW{0bf6gM5*HTnW^*txGO2|MMzft zF=2u5+oB>yCY5OwKm7NZKmYMB?x?Z@ZGK{XMtAMXpP_u39D_R)zjtAgu0&vQK<|R0 zfh&>HsA*)I^FuR@j}~tICc29UQOOMCowPw-B)%%c;UFoQC=jU-3KV!nKJiucYo+#a zxnEO8q~*{vq4sA5KQ$ihtI}|Uq<*Kl2#JPpgfH>XN^(7Y$@Sc|JZ|-MCy^8 zUk*oIm0P}l{iNR`=o42Ep`$H)oL77UPd3LvX{61uwoNPm04Z#f%I+d2-GD0zc7|6W z=F(v<-&};g$8GVWH!_oG0s--_W4r)fz2b}aHN=YhRMM5T_ z^)TQuy<%B*%BiPTxwPGveGTw0)7k~Vk%i&TSG{ic*nu?LaLE8>{7aVdxU6u^!Mzuk zys`IjMqi}uMzaZCO^;)A;;l9^Vh2)JgY^#5nq$@BQsPfIxyVb zgJS%}^S8J>Y2~ld%J&X!*B}tuCOQ_ax>EuewJ{3%SKxgr4@CC&KK&n6!Xdb0BEDmw01{H7X&>T>N;jE>@BIztW z*!LAq2vrK_p08C*)p$%n;M8CPx|rIp3c*Zi+-=dWBYD&~N?V!8MU0asI#6Kz*`4w9 zZ{G?Cz``3rwXbbJ=0MFaT7f`fllyIeVz2Nr3=-X(Tx|ssTEf=<){Yo^*mB|&j4^Ot z!MQO|kMifoEq)Gkucy z{7Z%RdZfbXYJnn;&dHKC+z{wfogMxA^n!^0*l?#j{uAc&(Ms7M=Vi{QK;FOw{>8$@fXvM+@6sW-2 zVcf%CMe*7vZMG(m8rG$iCdgOAEELdBQ||skR9VuQ)i9$!G~%+D_?lK`zE2_EoF*80PNwhSH6pgN=1i!~wbUN~v3v#B2oKBjTaH2O)+ zG1$R=xMnNCVcXr^gYT6oQ@&iQ)B&7S)EZNgYOWOnm9WGJijz#@$)n0GK;poea_!X2 z7p>-+?B<#X;wtWN?P5q{xDfR_x5~m)z>Md^$Q6f!Kd&wL%GHgs{le9s6BEoCm$R;9 zlggnvgt)q>vO1STKUPI*wzKB?b!~!bz4Y(g!*d!Ns zjM0irivD+u4${@8rdY+Z?#q%NS%pQyBo_%B_@+Z!RJ-NUrR8e45G~&bZjZX(X?fmS zZZB;^i7|M!UreUp{=VI!%%(eRl53i|zLzNK>tR!wX8Z0@NEd%%+**66E^VW6%aipW zm$8uM-|xU8LQ*;NNf*KY`*5q~mQ{#eBvka}io@+VDJ zGN5nWFta_ob|W<;r{+CvZi2b@{qp3UQ(A*FSQjxQFF|D`E2hHC1ny`j-{td+u5_o{ zLVPqg$~q-=DHtEsjG?P6?`V?`tK#-<6iRHQAC@{oPzItvK}8fnuVv@(#GfWXP1}4T zEii;*zF-lgdb>GL68=-KK>Hx1b@=^xR83i^TiaiohGBiVb#e$i8nqZKR$**%_%2Pc z{PU<@%TKeXW##s+!@)VjpUEK3Bg1yRjI+Ph9P;l4sPz+k9F_7gaoR|I<<~jIbR3-L z35j#$Xmh{t$HhL|l~1b*-HvQNwLkgB{AxJUJ;^hXB;@{yBV|Jok*z#zJ{1E=&m6&k ztPRPkHejJepj8`;5P}2@tWAc)AmyRYO|92|bha(OJI!fZp)MHdABDu1``~SE=x~P2 zU2)?+VUo_pnvQE(=;9an>WrE=o8)V2V@l@IWRV6@ElvWwDfGS4HB_D5_oa9~QtE=j zNk7LU8?C|zs5;e?z53uCACm8BZS^sWJ{#As*!g9>y~s|^;o}&LNYT=x*gJB-2xUQm z2i`5R>{8(HlVjy&RVGmwX<_PIB=B^-$&e(nlYKAP5p*MbKb9iauvAza29>02NbPWe zfie&jFEl7hP<`#apz*c+9rtt6AN8|qPGFe@J+nmTC-fz&pmId zHFSIJgTM?{2)?W1_e-(q;^lH5#T?d9p5-6JABpxiDAzvB@aA4vNOkqedaHl9^G7Jk zy@+nD=iry;XUIZ-4rUL&Z2elB-Eo-$HBu}30fUpnc&k1r|Hx%6uxYTp~*eU1P z0|ew9YOby+x|I#HRhtvOCcK|L&@QSf*63bimf`6sN$8*e1#GrMcb6 zPUF#?%jCbt`11E~SOul&bs^z>W%*Zc&K)zHDaBVO5{f8ZNRw7P-BP|H^WPwE*(MU5 zAj%bQ@Bt75azG-eIk8ld$bGPF69{ny_6e+Kp3?T>=(&MJzzmKVE*CP+EFPN71^nVe zZQo@zRKWOXea_nqvDYoD%ogKoUbos%VdoYnkL->OI&|Jk+~Kq5(PAhf4o`geBs2kJ zt48_yNkT5B+voAR#`tB_&Vq<$|wtv>?1bk9Y`e=J%_wn+xj!5JHie8--WT;tI7MjuadX3l%EdG)4 za$C0Kq=&_a_<1dN+YwQ0?{{lkUYGrM&XlX-z0IdLIzx`;$Mr214yQu)Mk0Oa$zSs$40Unac-6Rs z5;k1~a35yTGT{Aqx2T%P4MM2DRG#lts!N1ck9{%yL-Pn%DAj(ME``4eU@89=?$b zw_W+>wOAeUWZ|WrS(%Kif@d}Wd9cu-;4=R}TZ9A}Yd$r+NK68`+5#{H*I`9yzuagV%j+U_vA0xHHxutX@O9{|MDlCM#5pvQyZUU=*LhZg}NHC6>}t zLUje8YP<7ue}9)sWx$cMi#DN%lbjB59FstuAZL(BHLpt)JCR)mEtQsQLV;*Rn~GZR zLQF9TE{~d8B=NI}nVNeqbcIKefi6?`aKvQfQv7%2P$JZN5A^HJLWD*2mS{JtbKM7W zMM`8Ao2u07p7Lx<36fxICh}AA>r5P8ho(!>@XKXQjAVx~Oo~1;K2Tj7=uOst8=mLG z$ewOfOjl6F#3L^c>n^21b|Rf15`Un(VA{3_4MTiyqO|H8ER6c5LWb2Wm&AuLNK(jy*3%0fWBn~<$E55)k&BzkJz)yl0t z5~1cN6CW;lF$HUQ{79I((fgM(O0sUg^VlS*A?y#TIwx4@?Fbg@E6Ll;c5W-Ml$rj~ zt#vu?t;e%dNm+59p4WcQ+NDWwC(u*X+yZ+mTChlyVN4M{b)@SnI%7D9LfM?dlUxN5 zS3-W*kny0K$!Aa_{AYAAZ=>hgq2)J5;ZF4aV(Ylo0vNYU#w$P zS4>Zg4UhYUyF~-2vr$Ao?YW*hcl&jVRt3_`APz(spZ?;Rip`4ZVCO`c=YNZi9b+Lg z-5VKSzRpwdy-l;V3hkd2wL7b^&YXFS5dD6^Pq5ET-X78DWGEnFRX`Y!YV1(>^Kg^# zBY~`*Mx^n#KOWRo9NZ8O;*(P)7Xhe}4&mtp(-(Zms_y9f|pS;v=WdiN)jUScoRN(;v( z4LY|g8c3xn0XHJPbWZ6M3fFy9OZDyy3ihm2&{}V#4`}h)bkbQ$DYrnwPXy!I$&M=P z9KR4sXxqS%u8L_E-m@peJ|r66pZ2mgVtvEG$W>)T;ou5{2o|Xe89TiguXiN(fLf8I zi{ny(qa+4RF*K>$AUZgZ!smD}f>bM&)3pYymQ4vy+Kx@8EGE*R8f;z9%bZ-)BKQOQFz05mqwRLwSNBR6QR_F=!yo7K@0 z&P2{W+0iHS3kfh#B1|b;prs0+l118!q^dAEW}$8wA2L7JZFXH{sUV@mkXp(`O^*RMWkFK$l`G zhsx~x!+f4v;425mb6CwwM@Ok08=se;zmGbp=uruMcb%zn?H@~I#k@j$x_Vq=t=OHJ zri5@!*B@n#58DL=2t!bTXTDD8g!?IQ@u4+S)^m0^S>dyQ9=_BJ+ z7}5f0sV8+!Y?NoUm}R+0dWoWwMyc)ye(w+9 zHwAzAt(ZwSFco(dlDeEDE-%U>8W?n+Y6F|QTS?h12YeiaWzg(mxtH3mKJ%V)bSTC7 z`=y4by2$lq??zC9PD?*UEm(hJ1X(|ZIQi)wcX)5i1y~gg+jB38vPsuou`U=T^nD8+ zlwjNRR1e-oytJ}aEeF2>(V|cjCshDg`LuX{`d1xeZ3z0-LLzNss z$Vwh+Xd>RY?V_4@htX5R%6m)mAd@6;bD876i0vEa5b-#n1IH6=vr^NCJ$b^H$MUF| zlat8bb_5Mp1iioPe_#8%-^pytY6SDo>%kXHx<_L6@&=(DQ3Jzsl`g~cWT%rL7Owo(cw zMU>43tg$=ym|CgHSxRyqb>sM+T8Cw?Uy?|_ic1hMp3Uzo!QhlZ$j$xDZM)YiLsJC= z_r(g~iOAoALj{zgN`zQ3a7 zQ&nq8B^NQJ>u{`<2&ID zm~CTW00~U3hH;td6oB<%83hlxg@a}wTcGul8c}PhGDARWswDB5`wnyI@E65t7guS@ zwg7Fv35^{qJ!chg*zX#m)_S+Ylu*O4=z_3tg?uvUm-N))1qkgkg0h&CX!XeWI6xAN z{TGU(484?LizOmR*6r2&J+gPj{ckb@lm9ECw|A9dH9_LXG|H~1C{d_0=JWvL)R1j$ zyz51mHM}eut33@JD$W7-tAl@CB|)jxuLU1pQ&cKb5;$t?(a!SZ5>l4T0iCnfIua zOMdJ48^=@a;BxaOD4SL9O-by7V3Y!=3e!mfZ^lHmtqS#;N_(Ju^%zqe7Sm)4Xp)!! zmc40}Zj=zDvBM!F{tXn94R$>pkkD6*0ZugB20T{R z$48`^QS)mLy{SZzRw3fqvT5iez>`A-L!BwtQ$j0=XeXxj4~x^0N?iYx8cG@2DI-vI zCG55tx^q*cE3We8o}|+Y6u-Yt32K3 zc6(1??2#km;J8@5m(-TA91%cqL>$(0^xkY_Qm15|OlC=Rn`fLt)z z9OFB}fPV;4wE-Ts;PN6isaOOE(>#%=YuefBvFWZs()C|SD{U-Y8X^JEk?huo&Hvua z=Fe`mA>WP}hGFLM9QeJuNejWj-YKabITHWC_;!~V<<)nSzJfh*oIONfqfOKtxI{F_(g42 z+^x4m*8oB_*-7;<{o%iub z1zi!lb%I4!W3{g0)@}5^^v)gYjQY)U9nDQuoGTV=6RYFmOn>E>m6!&owG^(7LFWJu z>By?(VUI<0`9D$#Sn|EkMg?rnxpNqn3?=>ko%G|3JKReNZpJeT2bijwoU0G~F;$8i zp0&$I?rO|B^dS=qV9p}ut|shbLHcj5Fr(y#^j~^{s=!6YKz++1 z5}lIJ{YszVnm2$C&>acT_RCCRy27PLVK-~ZS5yX(sHy#m9520iv-KT8vZiON`$I5j zyBQuaKSu|fS47F!axy^{y9xgeNUbKo_IfF z5)yCil)v5_v9L&iHIAPo{b-HO9BmX`mG}EdBxsW)vs{nKzERV41npB#otLCvQyDaFMWUpfmW8VKVp9y0LBH#?PQ_`XvdyMoIPZ zD3W zUb_RQ%w^?;l|0qHE0~51UAK){A})9z*sm*R$82u5(Bx;bm~6~Rtkqp+LM3BEbmlM+ z#{TgmU;Qaeug@ma&7K1-X0e&0bIA2(h=J?(u1ED6&oF6Q2Aq9zTZ)(pDzNfLIE|u9 z!*>npM3f4GHsF3Gc0ZAQ3C~laOatz!)PGZ9=G!GoPn#(l_yJ*d8eHo6Jsq&C_Jj_v zNo@Wv?4wisM=1^GHn+lQ(@|kRScuj(2e-;e3)iTeWFM4Rl-bRkO41TT7ZII&PB7G` zU+k&ag{CsHOD~)LXnt2D%%5@v{UZ-M~RefnSM#>uM)hTBptUhmiCxnM)z7i=mmr z`GZSs0IwxiJuBbzr9Ov$W(G(D9v^G?a#MqTg>xo_+HtqngN+uSUE+b{lfsk+;b4#K z5z04KbBr7P(S#!?V-_qzJEAPvd}I5Aq30&8t}ZJJzG!%ye(cZb#ONS~@EHhaX;r-o z8@q0486MN@_x4^A{n(T#mAU+B_2Tr=JHE$SN1+WTVGTmU3K{toVs)gmWaSk~_3h#_ z6^A>{9hyBQvZurB^khx_k@;`N#Tql@0Eu#3k~MOv_=l~4bQ|1uD}_-$<30YG)7?{O zjh)(;=&=RAdwNsu&GD9R-Mw^L_^eyoVZ^xxyvei%)ge>$qyY?GNnz50w>d zn1rG`0Aq4BhVA~%w16;q?BsBkeQn}FEGoyT)W(*Dziv8&gDe%maq};=HJ6-!o?rBv zkl0g`x$=Ouj(~N7`|R>(>oeCU?2->m4)?Nr9!UpwYF(X3wwz87__~vihyy;9$dWRZ z`J2sn!&S&AEq6{XQ^m=wX~bR@=uMha1@{G!qs7#k{bht)_;8*L|78T&JkvAX$+B2F z?2z4E7yB%-7i2x@(@%UQ`RM9P=@BE-^+AqLcf!eG@jfDE*{qPsIIlCxyPbN@U*xrh z&WEJr)mLe=>v3uhRtGz0bJNC4R#OWTNn2{ZdX{X>U!Dz*WzK}mYF*=PjvoByC!brx z8^yhMn5=XWLNM^>`^?9GS7UPj&RDc@h;ayf^zskP$4a^q=81waqSQ}aZX&;bOTzpK zJ-pAiZ<%$dp7lkeL)9W+zq>cUs#0(1@Av9~?|tS~4x?v}36BZ^?=MaizHJ(WW~Usf zqCsbZekL~Iu?0DI=KvSsEv!E><0#W^d_rPeH^Ks+PF3-m|Sz;zxKD-XsXY)eDBxp&K2wCo0^W>dY%bf}6 zr$3fvma8T!AH&)LPbT5*4A=-~CaXlwX1>#|?|DD{(h&DXASJDowjZTzIx{)k{; z@ZzADi93vhc@ds}h|^z+BTx3oBO^z>Y6eaemc}CGe-py)KaJA}Y`Yuv^sc1J{hJPw zf!z0zkvp{aY^_bptka?JO?3E88)*uFYIC3d{eTIU;Qb--Te0ox7hNUshcMTzyS0r2 zE0?w%l;YtH-&GjQ-{-7;_;eU}_GJDZ>O>Uq`M>DPN3GWx(Oes0I}KL!3EF}z^ld_P z8K}@h{>k64r+;=&T?u=BDl4$22!Usxuq26;vVh0|y1Lx^0edsaEN{0}V@asw5LT@f zC7M`hy@We5tOQ8>Es8$-rJy%`TB&n z-~6#Rbe0E671tH^&BzI#Bb{$>RPI5DA&$H~^65pU7A=EY4jx3(#5eE6Mhl36NDzA( z!O{-Q@JL?GYg0AjG(k7d6M*|_Y=xKWpeI<#l_M~lYJy3fa*aNn_-^h9OY-|n9#-99 zuj~}dv@~K@OL`u|>8C>v!#*0Wvn{b@Y+HE>l=P`}8E4X&E%xWZ8KV&5<6Dq3-#xb6 zyU|K>bgG5kWyLIc+L@UM5Ct5M(pdDytHNYc!*ZIU{J#~wDJeN#Oq%)gXI>sGcYofE z{F0X|Kchp-KagK$W7n@BmQck)%lnOw>J|T%Wle8U!C-#WqCx6sBl^%T5jB@?4Pm1V z(cd3Ub|aPUO<2~qAqttOSo)(l*ou-&9$g46jf*F>^I`I0r30 z*lej9l)F$TWg*8LYlxBBHCYLDv2IjUR=yNC=O&LUSZd>!5PEjN$>p`KsWF5@TBbf; znp^u#`B?b-32EGCMdvo2qwIG;KHy9amO`Kk&whOwc|(@0YuQm0c9KAZN`vJens%&g zKMJQQDp>h50Bqi_1~3b(JkIAItb=?Ir$?-K(YpY}>JyAX@*BH9LMUl<1LBv?roSI% zb(nb7%U=?lELSAwxdlNj%m<|w@U$`>uB>x!q(+I&{tGHTwSCMTIioJe)*j6oan{ZLqmpw@2i!@oE$4(@hDah00mwcYX$fh^>_zXTh~;O_V#v*r(f zk2_rySZ@!iGfYx$i0Rsp_bRheLqCX2KvhU|xF<1Y%6xNYe>dX$_|GpI(N#tTeys9T zLn3$J+wzBWCy>{mt3=f`p>?4Dnl=?7?L}S&ly?EC2z>%^48mF<-j1eId!ZuOG?Jr+ zv>5H^ThTwNEB)*>`W6CB{3Yr(_U3_Ay}V=M$vFs+LXnB&=_B*IldgY)mvly^GYT7M z32s{dz|`8*j<)8gT!(0-X6z)GC|;(< zUj$UmQJo8^7YKS~O&^imz3JL!YfhYERL_^d=v+7XP$Q4YtJo3wXa0v9Z}6m!?}j8O z9>&Tcuh54z5jklN=b|h;pY$|3In{0A&=)M_Opc=bwoL1^=nsa#wGu}1T0_5ca{H~i zNgvVX@>UVG_-1HEN7eJ&0*L$`09dVjBxkKPg~9D-_gLD}_9)zaIs5BDbMBfJHA9xN zQx!z2boW_?zvo%S=-GE)!y812jlp9DYsBpa`owMmxf)3x$&BmdDdE9SG1detBn{Ib zS|;H-pU$>3pnoG*adT&nmzZMipYeV;nO{xy)K2EVeJe~!k22-e0pb+7B zTc(@m5t0Aq=lb_#TUYD=J%{4+o7&=a-kNCQGw!!173Jbs;q;z=bxL>A<;6=gv?4<8 zu^SD&`Fi8^Oua*g@A;4M+@5LqyJw<+UFA5k>5^k?HI?M_ZfF=(N@so@koYvg5=KhSajplj0 z5~oVa1(pM}_y1XB5q-JUZ>Z^)UG0nxDjQ^KsfjQHQNqpH3(l507lFx2COQ-`_TEf3W6%$HhAUsIB>CvVAQ0Duh$Pd><` z6-jmlg6BRF#CgAUaXoc@ZuDqn(K{_+&=zYobJNuQtN(G&@{#nwrX^gJ*>PD0-8_Ad?yTqZWcJOQ0i@9tn0FaOk@mWmNoU^q<=L(Gtebu3z zT*JT8Adcbz^tu*pM{Wt%&mpU{+o~<+HZdFV=uWI*U8ePp%#vlBmI%?0Y(Z4M#e1L)Z?}(*q$Zl!BBI~W4Al;98U3 z*iM4cq?R~NAYt|q@?(`C2TO+&5#ht|*fv44Hv|9086U(c+Ms(^apL-=s9 zg90l8oIf_XKST15{uDrAZZ`x?rIaz?(KIj9G%m#_lkqmg@({XJU|q=fMWz8w=5X^R zQEsWi7gAf>c52+12V zmnEDpCXyh4JhXeKYZiur+(zYuGTrX^&w_;;N?Nc`#JyZz6(eIQ;6rBGhYxKL5V=u< zbtBLN^1`|J`-~~!t89giSn^ygNBeQj6f(^jPJ6a;*Y9K5GTL&IY@rYHgMnG*|JW~4 zhZfO!0Ha1tygB#;m95e;n&&*A=S#$eP(N zcjQFs86~?A^@PqQa+rpolQ>_L^ZnWK%r|W*csxGh7{W8;Qj>*fc-8O4Vm6N<`Nrw2urKo6-7;Y(o#4!1XoA_Z<8}2PAHYPMxB3~E1=6;GQ;lrP88;QZ|HWI@H5_uv0qhLe4us@pF(JQ8K>3Mh!&c52$Z|}o5 zew4D)oFQpa6|xK?2r}@bGCR(ZT`@Y)Bm$a1C+L}r)11EF^=qF%EeXcZRs0roo-V&@ z*y+gA=?R1534Xo+TIh87lL^$JP-w-ZwHu~HtcGglD15iPm}66Wb(SgY)JZJ+DpIIT z!8LC4^n-?14<&`xSb8GQt2I+-`cgSOt@^EkRh=w7K~n=OtCeYgl6NzOSAf!LBp-+&8RTto4mLkYm@v=b9!^#O`9N!dbd%w~BDA;x!V>{Bf zq-l%4bJb>G-&Wnd?R^nb-tTP2?CQ-N@0*$Amf?@${6Y71JJvlJHn#b?mNGNv$64fo zhN05t6VBoc*%L2E(L6*ylpGm0Q!=Pr*W{e=jDF&N`CT`5N26cW4Zv) zI7))y<0@h_#cD}P6ArD!w7V^7XqQobkdC}Kx|bu8N|uYZbG8qBiz zFKp6$O3ujwk&)_M>;FOpCgca^i1<3`Kc%*j`=7Kj#`|u1>J9^H`PCu0ioB zbopLGE+g`>wofbVbgLYxx$ldOhdMV7e}%hjb78UC2f;2hRRsZ7Yu zk8_~`XL#7J*n1BX8-KD>G$y~{G(YIj3NTYf5VcVjoo4g14k6QdTKKr*`S=$nP76tg zE!l<#)fRJ(8h_n)h-AuFa{Bw&TgIfqGajnF1S zC#E%UZfAu65X}y8w9Htv*&rE4qS7jh}1KfWU2z+#(n$Dhzb;>!vB}W-sx& zDeP37lU-tiR{||6ks}dAO@jx}7DrRNh@%B-ll%$F7lZ^#JCw&jsJ4MJ<8{->omT;B z&$vssCN0KFJUY%lSsU^{fDKHOKDQNl$tUbcdU&A^;0!loG}6`Z5>G`!S3-vbl=))% zDZw@l5w?vpffj~auSr7femc(lsA&At5g4vO&42H7OY0t4?dKoq%~WC;fq!P*IbA^R z67T(+r*!L|!{gDxcw$!o#Pk}Fz0Gmi0<&*<>hHs^D6Y~+>vK4Xoh&6!W)s2|^ zhQ$c=BgcuI<3zm&S{|tNJsDxm0`j$|*EC-cr?nGi;{_XGxYn`bpur9)&d0@~Gt!)c z(!+IM5*wOD=nsz?PU$}J3TOD&m53TP*Ry{R{HC17*BBsvPg?!c9oGB7pT`U}@*3>w zJj2_nj7+q+Of+8T`XuXq65C244!!tH=T1(Pl2I4GKOJPN|7~5FkU+xPE?RP6RpLQm zJ+A+WYn8n~e6UGn?(+kNqqOY(<3Az#IxpEgM94l0kUVv&L5mXYIoDQ~voM5w7b43x z^ljyBT{Mt3s=LtSLCjm4tE=%#8!%b5XcK>d9tBZKZRjjES>rD!5q$;qKymUebbXx_e^Ak}6+bx_j&r(Xe>%Ubb&F@>i{E=I{q8v6iSqR4USujm zu8D7AEm*FBmIh6<7q_npb8$uc%BwZG$GptX zJj&zu(=P4Q?X%OO`G!*(f7ivw)7t^oI=}OKx);5;hxc9JH=p|5oz1zFJe|)^$&;8tc$=eIP zvgAF>x4hop{cNuV;gmW4o;kwrudyaM(9_-0t31pb1i_~~+|$Rf6MIS@k$&*o!bRbG zny-(1z_WHLj{}!~YAV9OZd$HKax4J6$2*aWJkVe8+%F%t&pz$HKJ3#y?&m)42Zg~m z+tL~~tj9Y4LcImIVBO#S+s8h(YvQcU)jUPnGdj~~cop7oumXUDiR6oW$1RqQer%;{ z6gU9|MUh7(jH`fq;LJ94P`U;#KO<_Oq{n~!*9RlkzWv|-kYqar<1_1-`OX8xxpV^w z7BqMeVM2uq88$2^@LWWRrCf&v^gOqdV>!h@g$4kQpdp@R)5G?%7{LeuFQr)kzip=y;WO{`e6PPO`B zLIOaM0D1DH3Rf_XBrQgy`1WF4lW$MbwObc2T)BJs_MMAzWx|RbgW*yIXpM~yJ;$OA z){JA@z%D6Qw!APfV7GcpjwJcHWZaX0(@may8FlG%4`eRY5MjXq#T+tF_z3}b?gs=4 z7=>V=!_uu(t4e)ZQ!DYNPopj^esxWU2nV1zZ;Y#1vy758clZ7se0REe$x|Hdy)^h{+6b_!>!2quKw=QQ%OJlB3b|f8*G>Wf&>V#sRIryupoj8 zEwnJE2zWCp0t-rT4!NjAWbP@hkUP=2rJ&$|!2(K9aH&W@g-&y0XWIq!e;ULKQ`n#~iIhbV!B< z%MKU!;8T)DK~KYy(*hU8u~5@G&GMWCf^x7@Fva9)!d6?=-~tR>H8X`oIm{0=^IOuaJK+vks{u_xPHE7dkrHxctQKvoBr6Suya~w@Ky~z1aY}Ir|JL#onnf~r-j{A>S1P`Eg5RT*4s9*ZojRu$*8s7n(K!)^9bI= zG#0aFr9h;qCIuC{Ip;Db;H_QOEZ{(?H-8%CM{**ucYJKwxujoBvCZ4HZhK<=f{UdrGDP)EJ*q>mMR zK5&~P8FDBuwlqnOm;5;Q;Dt{OqRFeN92c_U9DFPpRe2tIvpz@6Ced-;*QW>sD8N>s zIs}db*a~11_6z|xHmN@&@z^}vhc|F)%QeQ-_N?E(AAf~VT5o0d$l| zW0vO`Fc^=?&J5obL&K;dfnciM&E}=EpHwI}1P}_}`es4&eP|6bqS1DqWM*sfl2&Hal7#IfXBPsmI3~jhV_aG*1HoKk=e|RDD0WNSzbYA@ibwy9b zk9St<7#%xkM?b2oco^vjdtz9a7-nZJ8tKeNJW|8LAn;4nYZ(Jc$3}&nZ+1*mB6dP@ zyFca!aT#0O9!J>6PoC0AE7{+Ajz_~Vf`%`j;Ycf2c0;o$aFRTvm#gS?tfV+>KB@p0 zNuFj(R6+}nA)F!~kJ(I$W$_|noTVb$(!PoON05U&UKtTMy|j%DX8DRx%p6vh-x0Hk z&ZG?D6eq&QsS}>MQ_W_wNzH18M=y-rW?^i3Ml@D$Y-Kas;DYHfbdoTh`@smM^5{VOLr>b$ia`@EC}Gs0 z#4|ZYW~Yz`grw(q>O98`(?-~GDUqO^rmDo{Kopu)V>zBewrVH&)y3|1wcFk7ewVx8^=^2{J6`jO7ro_8?|Id0yhj?f zv^EvVVLcO)jno&v^wsZu_nX4}@)yAV?eBa8Oke>Q*uDo=uz?wz;0FJ9!48%%gdaTM z30s)L7e;V~IgDWsZ}`Ip4vCQ>TUuHs7R4!6@rqg8Vi&&{#xa)hjA>kB8{ZhmIo9!x zd5q&n?v<2A@*-M@JY*vm8OcXha*~<6WG6Qn%1@SZl&L&rD_0rISJrZtxx8gBcNxrI z7IT=ZT;j1Nucv8N^P1V*W;eeX&T*FWoatO=JKq`4bso!}H`ixB|Cw{m%k!ZA30>$o z_x3vP+12uZwmL^M`q8?IbfY0%X-Qj}(wEkBra3)nPhS}A68wTkE@>Qmbq*QU<(s6S2X-Zf?oWa|^3ggxwGi^@rio4efU7Pq#+4KsJY8{Xai_PoixZhMCt z-|Wsexb@v{tChf20T=kd30`o69~|KcSNOsi-f)LM9O4m|_{1q*af@G^;QQi0Zi2#b z+z^rDAlHq@KTh(FlU(E_N4d#UesYhu9Of*S`O0bj@|oMb<{`hi&P^rW^O)y+=OX9Z h5IatEBDP%RI9EE)mp*c!C!Oh0cY4#K&bNR706UzmzKj3> diff --git a/Docs/MySQL-logos/mysql-17.gif b/Docs/MySQL-logos/mysql-17.gif deleted file mode 100644 index 5b228496b66857accfbe7ef20699d1330aa24c5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2059 zcmeH``BM{j0L8z%*(968xIlm)8CU^JIEss63syUuaF_s9uu&skYY8z{bb>`>yt+wX zCMwPZTQRgzf}@hss%y2HskYsqmUy)hj|Qr;j?^lmlcH7HaZL4}=uf^M-w*H2`^>yq zx{~~Y7S z1uT{jP5TJKt5R7M3K{?p01N;i0va1#3=<56!T_jHU{GKbfwLHJV8EpSi~RtShQXS2i|=<0!(oN|xF>W9U0T+dLQsRD7_7dZxNpS?dS zv&1#cZ{zD?lPVCE7H_&GQz3^HqLX&XHk!90=vhwEXOKLlG03W0F!L-|<6rxz78ntj zZNPuf`s@@I@N)m}6d4d~cqcF24TrFr8#?r+c-qU%{ogit4c~+xtEvT0$|B# zGZ{T6Bk0pel-`;Y4W#stt6>7GbYK1egLu(eVjisD9D9dXxq6$Q-!(hlFK%e|*w#D5 z5hh9aHcM(2=b0EQntro;;>PrA>yrz|Iku9;QN*rVB)a0y!TMj4vVuHuK0VCuFW^`x z9cS3>Z#8mPS4^l44x>ZSMtaG!%af9qB}o%Q$Wz%JET?UgYb zF!|-073L^ql{-rw>|U5AnqfOtYg+7-&TQXBh#s`#^zjM1Ye&z=RbpSCR6u{$7J$Csld$i2v*JC|L}K#oawpEuZwWc2bHH8n|j^Ju}Xcs zvFJL#a5_tu!DsgOY)o?Z!&RAb?CR`{&xLa(1CNLN!sN7BYYUTgyGdKj*mJVFY)N=J zzbh^Ql1kh}JDe>Kazgu5*2*Is&YlY!5;Ff4Di5=_4vog;vA^<*`oX1!!Ne{^Kar)k zL>0M45NU0FCL*N5HgvMp-6KMzvxDJut~6Nv!_R*_Ug{r+?@(6^?|{*8o;6Lvi*nEh ze}t_Ml>ta>!RP0ANU@%5$g-%>vo*Oz2XI|#rh4nkuCMpx1>R?eB_iPz_QAYWrF9>( z>*NmTNo6|JwTWc2gPfi+7vAkzAX{V2{yw+=X4)wm2FS%#~c~6Q18lg z7uFHnOz2S-Pvoo8c>AKPBgU;OMb_I(IWMHYN12Y6bqIPPSEv`n)@?^ikHfNB3Q5I4 z@qoZ3tnlEIRdnyj&Xn;|d_hhMEo#%+1kEJ!ZHhyAH8pkV7PQ(>jb@D-1-z&G)5~5s pzZv=si}!)u=U?nNJ}?FyVO4TzuSI2NLAvJ;VnS6c&aF!eAoel7~e^kBGrwaB27v1OkOZi5!+e z%OKH`NEGrP2C-(tT9VBCN*5C{gz030w77zSeh1xNw_2l(Jx z5b&=!xd13P1k7>hz{Lsy93U_R!~p?wgP{K;KpbEQ6b5i|Nehdpa?2RniOOCR6F+5S ze?1^ZEjBH^dGcTl4gwCC{{sIz|3Mr$@~{IS2L!?i{+|uvfJuWPs&>MLF)Je10@4a5 zWsI78*~0+eL52ech5`D(5HaV_yS1AW)oz<&W#!h^HsdvNz9Ez+I8Qc^3Pg62(_+Xa zeKz$On~UrBHm}yfl?JxGeZE{bR;`AL^2FlMA+tZuc}K1d?RXVUP+tlv+{e0cwaPEk zY!SbPpLc|~$fasHPsN_n{gFntRNH6j8wgNqPD(r4E$=<3Ui^)8@B=AX6C5h!D8W!tX?lT_ASWeV<#CVSj-fA!$?nU;@%JK(vskLHd z)YJRAg-a9%nZI6UrR}5(E(~~V(Z=7%G}kE+LQdVqWQwczrR#MN+HJRZu#(B*>fImA zBc&Zi+r|yP-F^AOq+~m|wNA4pXu#J!XM|AG)9oO4RE9=76Rj0t z0}p%aygOU9bPBa1s3#{dKXw`;tpD+>p|H`6pxlMP@8q7Xis-K~0;OF?zFW+jMD|ai z@Frn^*hQmNdkmMRDy_tC{kOz|?0nH@-PO)ZYVTxU<6nHNTRe3wz4*izx9NqGd@+uy zC|tm^Jp-xvl`K-n$M>zgHK|c-pdynE9Ny(+k@<0#DdhHwPcn`lW`TG`ag*+Mx;6nD z@(dwaQ|HrSc_EA0%E7J~Sg{Y;7Et5k0%D2A?u3?KX2w2;17D#7Q6l(hUu_%nR}9xT zP-~qp{SI`p2pdpL>_^O~EJz?Wp1b}z;>XxIqnnxP^1z{QbS4#uPIG~^p*GY|EJDLp zSJ|Ivoj#nW^ddc*4KV4`W@r-0#(a;vW*qZV>R$cHl2w|J;OFFL{4O-k^X+(nhjb@W zwqH;G_M0nWELMNzM@&wPWI7(SY;QP0rBd_xwsxJu47eNrHI=(Gx2tz4~Qn0G<~ z)*16WX3p#w9D~@JT`t(sE3)Iy3hD9ld4TJVF3nq)j>z^Jz7T{%hi|K1*Fm<-mn((F zzbtgW5`j?usX_1ms-|)VJ*zkW)+?;ctcbpKxL!UX%g1+4Q6uyTrcmqVohL{8*_ZG!&3fu859&n>|%)y-AL8A!W zVRy!oLZ?6_k3`vepJQ9y`wjn6{ce-H`h8Kut5fx3o)UQXhZ8bH_4MO~Woz~kVo4qW zaf9vDw(fQtwerjnD{tRV)rdTw5vhXW%WXD8BS2U^a)^O=mP@ah$yF;K%T$Fb4;R;7 z^60d?V4<0~VxRz%Re=sgyw(MzGRF0OA3Ib~*HYF0h0$3_VIGq}IICO@hroK_e`8Hn zd)vf)1VwBsr>GWp1}3a!i^zPd29j!REpq}qWUA7@n-9Wqsdafbda)V<;{|5Lpdyzi zM!8Jbb}VgZ6RFk1>Kw=FI@BF&#B;%|>rSgbMwXp+{TOkNdcO9AB|}GmoNIwHQY}tD zccN5#E0OG@VFq)3!Dx}w>zl^BqTc`e2uh_uC>8{fsW4<+H%&u{ROvP}nW7-AXV2x6 zUv;*!0b;~zx8jn(RmK4BQ;k=-I0*-fJ??ecg2@GHaJ;IFSIv78wNpEDGV!ROlv{L| z!kx{dkp>j!bLUNyDHZ->EWKUS^oS9`E0*Au#bdTC3f?u%ZqRAMghXxz4J$E4AGs2V zL_^2)Fo|OKn~!b`LZy@ghxm6yvX?IDxbVAP^qldXl+!s*nJi@*Ww+kHG!0)s4io$Z zda44HzrLy&@vC+M`7 zzRI&!%Y!|S^uER6?d^RFob&Fne1W@^dx|2h?EaO23RgL)^7NEpEy}5+Y2mwvk~9RI z-95ozO|)bRmM-yHgY{#CMRZki`!M|bbH9bG4hsv2_9=+j6V&YTlI)=7PiG>=-gXcP{p>Ak}m?1;F)s0d)ia$&wN88bM1Ib(^E*s zT`bOXY7mps;Dj^LJ>O7`vqO8>6BCuDviF^ZbneDUbVvKzin7#0wS2zXOhj%B*k?q& z8?)rBSBeO{*4Nak3=2 zXRgp^k@kM9w+Dyo!99h@1Ya;UzgR)3C+>sK+|Jhk$#Z4%PETjxHP_xKD5DbJ@q~KM zk41XKVR;pkm({3kygzqc+BD%i>QO*pW`UZVr-I?&Q>x`1>#-*pwlXydahN zer25ceJ_jGs6z<@3nr1~;nCB8{%z;)%q~vsylZQXWk(Pz-D=d1_wm`b7w{+N?mvXd z-Jbo+lw+%c6K|UtP|!}K+s0=`*SIcQW2*NI7n`7B`#hxjlpu!uBmVPm3RG1n-QPRg zJI(pHvgY7E!_6is)z*QdSb{nSMfY_=r(ppiK{`8aO;Bx5YV#MtiV+NJa_wdv5mqMRi1ym=J>xDOPQ5EI2S1>*@<>qP0kCwMjIk8hIvJD8_068fG!ZrIn#5*-P;0O2u&&uz_W=PbDu*1*GX!(IxrdQ3Yf f;SR;brA|}ZEf)CTqdStbunqT0tY_`&vxoiz^-&1e diff --git a/Docs/MySQL-logos/mysql_anim-01.gif b/Docs/MySQL-logos/mysql_anim-01.gif deleted file mode 100644 index f537d60da413ccc7e0d32b95a33636a2a67a57cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15008 zcmZv@e>~Is|NoC+n;-jW?3Zm%TbpK!{b<8>m~A9U%Fm?oD^UnZBgxPC&HM_b@-vD= zsp!}7J1U}5l!~a-QHScBqf_Vfb()D1TKW5^ zQPp07)IcB*!<1nwvDMbvvTD^fuyzR6C=dcs7#SU6G7oNY-L%thr}Kux@rU9ekW3?^ z3<#tQYgE2wO`)!CJp$f<#Wq49S8=#Yrlt)-%d@7Y9hR0IuA54C?=Ii8sVQ<_D;)mN zf-{0dzTxuTZru1ND(ab|;~Q`9dB^piyuCk$guGWM-iCzyqEP%&ajYUY=W6HG&XST_ z=g&V<6?|%KeLMbWd~k4nVsc?ymbzSV;-DGyI_S`iV zAoZ2!z!yy|Ej3#;)?fem>owK1ze`R=I99m}JJ!cco}`=5K=?9-GKb~OGyil9~_ znP%@)*WaOkIJc+KZ7uP%Ncz*hP<@u6B+fc!&*tD=VSCrCRnJkk)(KTtty!a{q2}bX zCRbfta@1dTR9#KST5XM3w=!MnlXuqIT3z>8w));|U9o;;=?S&9r%SHtR!KD~OV;Y@ zh#Q)fx{kMk#DS;vuU{Wg4-5+PdtMTnP#t7ZHa~x0bbFZ0&n-+x-Qs%VGx3A4ch*^7 zj`pdIs-GS)+5Ud29#>O4A#(aX=?w0d1>@lF0&iEYzj%81cyq|za=XBF#ovwjDZjI#Yv=VVn*-9Yg(>zqCuA9;5M+=1L4zPu z(z-|EOob6f>f7k5o|#n@CYa}mWi$%3Mup^uf;l>;>8a~-g@ zpJ|T2rY>Fz>$r6M{=f)Ua_aXf4)wzrLA0BQ35aXR?d7ITbuC^tgI~zBg-k9b%L5-5 znY%iCF-eC)JZ51q8>;=LmJ8{M#k}N!bX_`0_sev(b-{x}Rt8J0{;TJv0G~v~4t41y zk}WNPR|aSnEKz&bJ^$*T5sntkj<_Dea*?>^bO~1RGVef=IycuyV<*Q{k*v?xG?aQa z0I>%8wCnv3-8QX$^W9Tx^BD(E$OUBieMM%yVd^%-^~h)YjU;r#_@7J5lH4yB{^F@) z96kL=%VEmzxz?(ytH@5X?@PzC57{~N7N~9@yuGvsB$}?~ilpwN^jyi){Xp7as(vTt zi)XSfsh_6lk_eg9CtTl!)dVk>r0i?iXhhN9vcn?f2sZQA9{)ARGUv7-8ixXo2YzYT zwG9#S8>zf@$!}smcS5Z^P^5QzHsz3UDFGTn-}AOcES?PVN1ZlJ(|fjk92a&vUQ+5t zD6vn02Cmn6exmDRxhmy!%aG~ui~XIC)#Y`PaW_^u#k210q_)@Y>o)6p62)`D9<8fY zPey#IPhLH%7X&m#?2aS(h7xk`&=KSMJ~p@Tnh3r?rW@4r+I%aP*7ru&d^rfzZJwZv ztoPdK^Ek@v1EiKw3f>^2Yj{@*K0L2EAH2 z#*u+{1(S>2BZjjJpYF*u)&ELC^}kb4R}H2nS2Or41-nkIq#(XPe%w`Q@bTD>Ct|?o ze6o1M1$A4_OgTtW=~Z|Sa-i8nBk ziVhdp_W8QL>W7@tm{uxO)6*cD{*p=_Swc}}klVkp!XDBM((Uup?#{=mtC)7SHWF4+ zW~O$gQJK9MRjnq$n}z>jK@ZFTe|LcGS2w_&*_5VBb4gh8(|d$~S{xY^d-WZq(z%`i zuf9-oK#6)8I-S5Q2wZEl{N7+ZdT29PdYV*$jQwexEa=eo^+Hc){@8Kfxx_!}S2&hW3>YiNZLiQdJtA-D7^jL7RwR(^>N zzixZz?NrXgCz%_x8WScWefqU@T)nIlh9mF3c*8Tz@!2sslmAq_CLpEMTq6s^boi`; zx48e?;$r($D=^fpT)ViwuS@)cQ_xSpWsEMrZ5ou;))-88qvZx`H;Y|o02z6aZ;FF+ z<&BzYs6QqCQqIF)y!FU2SSyf4edIhKEKF#XrJ0^Km2Hd2jmjctOS*gYNR}8XRx!Fo zEl&8WB9Ndy@OoC2z1VtEUx2~|BL08X^mjqW7xX`aRRmd|8lBDKpDl84pUw60I2R`0 zdY~llSOM2jUOTDsWTKW%Z@&0!ani!!-K~)%nFxYJfHS}lJT+b{Oi#}QBXaV{Boz3F zJ(tfHiuk-;BA(eU;Yt1m>6w#U6cVJz<&xXLcqs{q%ph?&ZIC@1$TSp)>u`7wNsXj( z?u`kzx#x+8Xwk`B4gUHzvT`^rCICRk)xixtjk+Lltkx(*j?YTThST3;c+oILcdF7A_XmBbb1kJ?1xH%DWJ~O|3XXyJmwV0>zf*^<3;E{0 zUgH^=uy}M>(n)=kWXla6%!^t-M}vr3FEG)8y-Ia*Y{+2fSf*aJd@PZ=XYpKZCBig# zT;MQzP8K!uHg5CkZrLt@HaRn7PC1(S$IWWxy7>2XL3(L-M7(fEL5fFAcO8x@*EdhO$wZs z%LWT1hEPWfj_dBZB4aQ!3(*LXG^o?X1B$`?LHou4RWpa!186vadbQ$xG zIRgd4dI&C@6^kGwECgjP5}9Mp@Wf;s7G&;llZI=}qc(jETd82@CR1o+J`JLs>lziH z1=WM178Ntyy~&!#(?%)6svl+{q8oozZn$KoQKQ-PXtK_TsJj28`sMqh1lrwd-LEs++8Nh#JB%r@x3<;i zgQOz}SBKLLwkBD`Je{!me5!=IKbpSU6beo}&|@PD8P?wgahpv7?dI z2w}*Coi^aTzSjjQxbF8-mzyNj)Mwo6GT9878tqT#-}eTSH>)rR@`me?)B>l3q-iy* zMrd83Xi(ByuukxHuK3VD+n$aZe5LIn|F^2>q3qJLtDXX(7d`jVc~63U8zyopa$TO{ zj&*!>zFYS>-n7)`*6g#uEpNRn2sA2ND#C&jFz~|!#_n`Dq3B?GK9zrz!51(nyLnNL;cqbyvLj$}Tb$31`n80T9xk<}&44mApZGmnrnpyT>}5YcQ#{u2woo6) z&^bIf`&tclK}rhg%v+a(q%yrlQEpH5F95@Oi&ZB3ZVTR8OmEk_9qJfGZXC}eZW+|y zV^ROHb*#0ABRQW2`9TuUTMZ_`!aI;l;|A=p0S+7DO)J1UA55sAcb3d~T5Nk}I(M{` zy$9nn0r?%JXgVMbzOLXTWPCRAjObG!Q!{c6Ki-8+0<)=K;O18is+V4V%fK2M7rn5# z@n?)vU|4&XBn6)+Ugrw-Lkq-R>R_^-a5_a#Fh8A&u)%8nw_WL|Ay!lX`+rmresMnc zvg~=t=3~PhwQ(o>sOPx26LkzvkB+atYp8B!w*#IjFIw;2(6^<{O`7B`7H*X*c>*CA zy$=h}R`Q;fl9z9URTa~z2gO)gEnhBRvsoCU-7IPleKXa&k;PLq^2~80EF9d`4NeDR zXg7ZB=^}~w-SE9Bwb=X`z-YX7f<*%WbiKI>VDqtH5N1E`4G1J8*SsOEG(iD*9)uF( z(DUS6M@gBTR3io~cEmRRtOY(iO>yc>ED|CYR+V#tHk`ew-Gt+2Su^I zKSZucR^c#om+~=<x{S^aF1-rqz$%iv>4fvvM(3I5OE3Xvq zc-X93m{K?7muTp2=uCMQY`$Z$x)A3cTlA*S?w)aT1JYnCmA7!O zqW81^f?3svRSAj0t!Z02mSzWw(NK+l#tgX_1czPNBG+ z9d{aT5kK7x(#YG=thgg+ukQ(BK zfPf%6g%?jq3YPPuXnu4ai&A-x4Irafs}VGjIW5{8OCvzx;Qj$Cb1;_BjqMvy5ya5r zD-#tLiM)+{+D{-n?=O4`QmNo@G7EWc6trkXL}Ew!Xf$m9BJ>yn46-N>s9xpJ1_q&M zgd|n3RAG+l;vM_|f}@asZmz^`LQ5b3EDWpua!Tz;KWZXdCL5$Cig%pMg+?aj5?Oox z%mMlalvf*}=h8c=Eii^(& zE$(JVFV7AIUv7z9R|^enh&k3DQBmLah!O5{#pmKoNh#yW1RX|UtQ;E5knTk_WQQ>f zDHI4jjK|3|q|y~UcCNS_RzamQPOwgsp^z{ZgI+0OW3iYkm`f{rs^PVc+S*Pmfq)_r zI=Wy&5)4HcynGwe-E#%oM&}DqFwg)L3IYwHX6HZ<$Xif1ghTE`{q*8}wIK%e6|?Z+ zEwS0kd)?x2UaC;JU}-t$XGGW)4kD#U1NWr(a^LUAPWM#3@H9UiXH^g_sU~TveCg}o|&TwHy2!|W<@41vwZ?<+b zP`6-Q@=F2%IjEKKwiPsUOABiL2!9f?R5Tc+8OR{s<=BCW_{|evA(e6wbJTIX)J!Lq~=6aS?R{(R>b#}$IrBg zDihZH2>XGea>Cxerx5L=Sdn2yDO5S1YC>f)4pSJhBBlwz%=PnQGWqbG0KK-B5g;~; zGek9>C5xG7ExE9>ml#qWkPBdqGOEQ^MsYV_<#gCiLvyX$lpn{8%*5OjL(&-&isAY= z3f!vD5T>>BA*ssm8l7pzFtIdF(Heoh8rjK1y`K8zyE)U&Iyj(T2W==fs7xM}G0e3r z#a)pv)5LZkNd6Pr0T~&)u_1n@l+y_zy8cLCSRj2M1uR)7ih1?Si(qj9qlu-Q89mhihQ$UXHWU@yYWla zy%|Pa7msQn^;5<@^Mw_Mrsh%z$?ji@{cDWT|8G=waVu90w3T!vec+?Af>#ufSv;oX z|BN{E+0w$W>Hfqj-oEfB5!Syy4^iMFeq`)uCW}R(CR{N;O+?lrrqSghcLvMdlP%{` zsVo-V(}c=qaABcTdgB?Pl;dfbe9pvBNp2CPczC2sML-oDhXss68B&r7{e+QGaheua zD-HW_JXw6x1lEM}gh{cUSZSvrtV&7-a7J2M$lfZdkb4@YwHu49_Y@P~Jeh*((PoR& zWNG5X4m;CPsH>sgVs8&1)zmfOS6GhK*k=+*_z#)WE-9&5oaHv}EvswkE=Tw$ETilO z^fnsmOf5Hrg7ZcoL&1>nv7s7UX;Va>cj^6}GsgEvG2PW~Q(8ANrqd?|P0~`~I0waA z8dc*gF0(m}@^<7l#QvLeGd_i?&m>{h5&@LVPa7Ske>Z3wMVXc?n{ddqb2J=qV?BRq zYVTOQ3teN7XesPj*(SL2{h2^u#=Wun`lQz>H0Ly3!1`hcr?x*cN^Ijdh%mW)A)l>A zxVqV|Hf!6qq9d06(o_A1w0`}V=|A@Tr{2|j#N>Sdowy^v3<*wlh@-u zi-Qu%;kJ-}R^-178uVQS9_1KmQG`yg!lsbtf{<%*X90!XP%V5 zh??lgc^Z4=LCDrCU%n@Xhy@gPzL=j*^);u&i_HrS*L%x(o-CHTX@)G0%3#HNuy_nE zJbZnVDPx1G$}of6=1Zco3}x*M_Z0CJo*4n?^E{u`!Xi+pX6rFp=BQ!@;qe4XN>~pI znKHd9o+boz5IoJKTu&-Y3*J|3DiUE#c?2!k2;=NK(((y~SCwC~ra0CT57-UXA&JB- zW0$FYS;_D*g@Q8EofFSvB@G76rl;qiLM$oslJR^ajonk_R_I|}Gl~r*zVXAr(08P{ z!g;H|dT{9~B1zn6@$Pmm4v0`J52ZUK!v&U>k$l-IFFL6x=~!V<(0$;5Dg z#UD;ozqOOYa5)nbw*&g~HO9+*amXtMlZcL!u)EaT-9YKFkcr-dCVi;~VWhiT#zO~T ziDoW~j-^5QWu>r|^^J>u`q|^>en^l!vjFzMxFo~5MLUfawD}dh$^FKX`J^gq-Oldn zFF9}`YWninw)jya(uE(9DL-5rVtP89OJW9HGI6c-rgW}x-Cp+F9Wx4S?T!g$W@h&A z&tGG_HTcXE2z-L(O}~v03~hPjh-|dAJGrSX))jl|+~+QH%{_L#V3OlB1^|;WZK-;s z$mwcLO2Be=wlxy@uM(}dvMHnftCW3$rz3xr=+Q=t(@yol8_vYuSrutfmDl;;+Q;|j1#b0&If8&({jTiq_kM}6?(=w5RrtgWe(lGAiar|Vl!}~wJl=N zO95s}fWUw}XVvO%O|lB7!ZSMeV1d3$-^vu{BVdr z)#1nQ*d&;q-=d#}8G(O)xN1z(P#-M`9d=ZIs07X?t?}qcw(B>wCil4L^Y%Do8k0Ug z`#PtYf4a&CPK~Y=%!GWl7@q0MlrPq7V1W`ta;8L2zG~6$It-`OT9o`UV)UQgOAsB zDFbr*%e>4xbG=_0bjH1!F%&||3O7oJf+xUSPsyy>(vr&Hhws-Lwe&e@zu4(rGia0P z*(=9q5x^=d`M(?(-T&jj{B04V_BqzBI55_yWT?GPsXpf?Ugp;UmqNyy70q?VwBw`a z?RR_#xcE~T>Eyk4pI_t|eSLL_$4=pkoP_+8gM7jczA!Sjke6nQ{>saAUEP{iWNQ-OjtwFenb1k#h5UYKY7yF&@p*`KxZx-xQ5Lc+n(gkjUh&s1QKF{7 z?dZ|2MGJI*5)8%iZd+cO0cY6=(-IyA{;X*Wzd>)U>Ne5Q)#oY(zg2zA$n$ffP0V*x zSFir=-+g(AXq{bh3URon{2?{yZQiC&)_^ZvKOr?rW*^pwq z-O&-dFI`kz|URnuMRcK^i@I{Vn38!q$ys$uR- z-NM9+k7Dk;w+YO28hm&xu5kIo1}yfWa7B8ZX#Z81QoLDV1g}-WY)SZ5c!3 zJRbYw^!LQYYjx{R@S`A4`Y4`WnJ13hp3#u6a_MMYu*X2)0I zu`<`8LB%TF(Q5qbpTsd`>hcJiX9dipw$Ic)#dNMmdPnJBccqIJe7WpX7rH zcjN9CJq~vVX6J@q`zl{6>hzK+iv^uelz&L3fr0$1w%4<>`yK^Dp3YeJ3bxzzsM6$! z3CBNbWk}5%3pa2*xopc-8Oq3z$Beu6%dSE5`=Y&$luXXlRq4V9d|y6;uO4a}fo;E( z+6DZYp7esa?c0GVHnU>)Z45oAP@1wM0r`teQSX&U3!>?n2?qzZ-mk--@ge+pKqw>IVlV>x zkoC57GrkLxN-fMnqw&(R_*1814#5tS=>RN*W80{dqR`o9_V|5xPoIl2;iW4bW*D?T zALT`>k|rO3)w$cEVale_79s4|C3*MgUHCq_kF5xP45kG`Ww&LDQTL|qF4^8WWBXw2 z*L$#B>9K4~@j@t5B~b$KOH3lGjI!Ng-^${6$kR^QpCh#?ajU;qYLoao5rvyy%Fy0u z+iZvCo=dtW6ez@1^K$B?gi%S$0>jy%=R1H(FcbG`0Og$Xp{nJKmvOzo}N7qb%)!wI2=I9 zHlr}D^m12?oClrRsiTMqI++S!AXQvE30_T`bNvQey=Z7*ecRo z>s}ha29tvf*6UrkFxGWXO_;Sb{iNWf7L9672?Sr%=t&nZ{<`Kz5Y+9ap1JHV)lzS1EjM{R zAG|U0&o~Y=rJ>5RPwyg7?xpp*>z7s2n$z}!_EE2=gVQ1&_z$Q##?Z9NGPf_b_QJ$< zyVG)cPde=XSMziDk8=JtL|_{l+=l+69Ct^P(%^>473JW~@^4YyJLB%nzhS&Cw4~R6 zc2fcy_YE~$kl*;1${AP~W+RtDr8;pp3VAfDCy#_K6=uX$tmi5i1k$1PD5)a@E=Q%J zePluu1|ZO!R;?1rOWH1YVbCzxD)O;oJP`q=RV5~2w4hRQs+LTEf&U1|v86xy!w)cI zPp6(gfV-b(nYddAJVo2$3iqT3m9f27+K;66zxL4y3dv!Rbv*w4x9MhiAMP4jx&)ry-3 z%jFmMEaV+E7Jdu>cr&l^-~<~TT6|zC!4)f3hTZ?gi+Gy7Ycz1~QnL?u@Qe&nPTC;pAs_ih%<%e4B z-me4wdCaaM`hD6)i$PT6vIVul(T$%Y?{%dNg1lrpQ2H&v_^}$qh%37@KGb zboJ)&#TnO6!|Oy7Ny(Ahru<~iVpCI23A3sdT^P^kKx(jQ?lsOk!@<_BM~T}Z z8n<<&+%cmmY%W`xXC6)3icPN)@=Yfe7J>QT0OU!eX~I zDo9?Z&v9SvQ|KN1Z(~JQ&EX$>3wH2-rmNnkyMnmGRTIsRLU`eh^_xRCtl@y^PcwA)qlFp4$pZJ99uFP?59XZM0Vh=tpf)$0sS_6(JvPGc zq_&I6V8e+?I{pS2#UbnlC`wR^)ziQJ?W}OZ5cV`BWr%fj=JrbhW10EUoB&x zXU9iaT}8*c7uxAqxFU&m9#?>Z>xdCtkVi6r5<6DX`%>HU#1wt&zXay?#>U(9%15<^ z?{J!He}`RrBk7RIFBP=6b|*=M`!_KiqtULmK(g9^ymnoF6MDycZGowO!r0t@NAK=OjERP0C%pdS7qemC}88 ze{fAgUyFPGVKaM|{?k;|mn0<-doJ{%ZXw#DaO{_^CS9gce%Il9O1-3rkcAro@7sIg z;)9;?P`$DT@Z9yp!QG};l-qg!JE!01e^BWIYbR)Tw)TL%TBjU7_-b+k@IOn;Cue|U z@3mT}!DZF!O2QlHsH{j6>bpo_>bYu=p?(Otw>o}MQWAMrJi2NB_En!83_qvKo%CnIKKMRmLsxJji3yBBUY`+M|eo#*_$Y?4I5}0SyBIZRPC+H;AxSAlC3aegYWQW^w9-8-VWFRf* z0nL=?`qLmd>8N8a(J!n2X0F&Wa$;z9N4k~JG+C|9!9+tvf{XwGy^qykB1D*_8aFHV z5XHx_PmpY%UdIjcb{mj6TmZ3tKly3d;@zBjP6mZI^x%y;+$r|DjYSmq*z=NFy77gl zn2hukfrXQC1L9m18MggeTh!d@RXiKTXv=S@`Z&^6(I1O5@u43{@|{gx2U4O@3Js%U zh?b_WH>6qgyWE;)_}f)l#jQ1VWKI-whY$Me<}sK;v_n*AhG{*9q&I%33?LDpKMuw&Zn4JyeD?c z_8rEZS`UE-0X$vbRQlMhen4S zh%bv03fYxpDX;R7m|Mx_b2wZg7z9G^mzoy?1$-WzFXI+b+PCpZXbc6-CD#wu^F>$; z1|$@dN5Gug5jaUk#59Ak*_@tXI2?n;0q8LfxM$+^JPwBilhN2Ozkhvn_}ob@sr@Bo zPQ6K8F={NX%3G%aC+X20ryItTjfAiu%fjj@^;EKc{6y5f>7*=EhD%$Uh1U(w&TsnV zAN|whIpzveqFT+Hx~XiAO;F~tUxiI}Gsz5VLC${t{vO8iXAiovhd!46Xzh23cqf+#J{1^wDVdp;3j+j=*(?#dz@l~5j? z`cduU)Q=0MYluVoxaBtZ6OQ=i_wVcfNx`8j?9=i8<)161A*4ufd@TBYvuBo*hnwkw zX9b$K``jbd(aX?-Z*k@ZCTF&k<;0cCn%vo*A_sxTk>oHe8W4*@LZdu*g0N6?scMh7 zlr2DktE$m_ISHL(n#nsOGsiRlrc6&}Lj%ve=;}4>4R9TB1760vfhFZV%5A+0sMzRcS@mpYFdL1Ibqr^Wio9IKzmI@$Wk7i*|0Ap=8w2SCMb+rLE$tHkXq9XOnk4k~X$=FGwI5U=6=?S-n9H4ZLtY>|m9@)|pg= z-r?!yrAvWzVIiwZz3=363kwrQkXJ9hec+Pv4>KRSl6sCS#rogr_t%mV@-g_@vpVmF zyjaYK5bn!gv!!i5jmY;MPwzkHKOLDk+P!OeVmCde_h&Jel}g^vPGx(g?B?RB!3+!< zlO^Tj(P$u;$72`l=aMRpt*|#n9h%2UZ8^{4v4D0k>{vVI3bh>oUxk5tE?)t7a2Vz` z9-z`_0Gh+OeEZQ|8WoQ(g28W0PxIkm(Cg0tYPTH8 zxKbLb`L4+sI7~SLBrwy{Q?gNL^kFJMFQQU~=CHhcimC{xpuk{7wRLp9IKHU5rU+AA zxZ)Zxc}z-0Q#Iz=1sXF0%_COB(bs{Sv>iPa`E+~&&xg7s%BHg}ez9Abr&iXkSOOKH*SyXE5#cIXRWVJV-S(G+~OkS{clp^8JUH z)R>}@17cJLRYs06|kJaVpy*>&ux^T>G!w%@9qdb19}*`Gwhe(8&`BDM3S z!MWa1xg%M`7cqzZ9T+LO#B(JlsF!}4FttY5ELPbw@J93*dARjbQym*R`)j#(=f^aJ z9d&-Goa2}_K(uJuHDhX0iztJSelE9c>&ea5<-}HHU(PTc&UvnUQeo}kpy!T6LArI+ zZ|gRjduG|g{)e(9JjefiI%Mb5cN^_xDLa!MeLK1Rl~+pMncx7} z3fZpA(1e)mSG4Vg(}sikL3pEGS#pBx=HiA z%hTt>*J5FW(nGpO4E{kq{!=yo%g68qx1Q=-O<7fpHu9OgJm*JaVe6)bTPGjHX0~Mp zJ&5_88gNcrjR@ht{1{^LAZ%B5#(aoK%aF=)<1hktri-{NPcvV#H%}&@M+gv96NDCo zgp4v13z6x7)+zcf6KV+d_<=3^87vmiLO1JZp^A6K$VgPiN=Wxtb|Ow<#pE<9gd-Gi zaERaoWJC+!{pLs-eKv+a_(sg_r{KDxyu4R#-H3^4Cb3e{6c*rx2fd|^fSiK(>CxG`j3u{VRd0pUwu|;UQXJvV>H1~A) zd&%-u>Dl943qQycuD`mzi6OF1CJ|4HJ2R z*69HTT`^6c&Y_)5GL;mXyCx(gBs0It%TX`d&}Y*xktTgXdL2{)6;tjXKGnrrhE~U2 zS{ffmn7(;$XQi=*UkTsX9@P(Nk_RZdsaqz_88#7Vg#-?GQNUQ@7=_K^$gSYl*a9wi@3s56X5a^!G;yT_{+g#8m5SO&16_xdrApF4LpZEG_L9-kvmJ6+GshSx? zj-=yuQ9ccx#Uf#&i-A*#x8Jz0#uU9xYce(Kb>n8VYLDXv?>K1^4u=Mw6F{*)G!iSSR!^O@VQ zKT-0$S4F%Q;z~pHnkc_wO~fheH0@2_zI>^JLBBz$dT|hk);=(izw+sYestt>81i>1 z$a!!3Xr+N(aHKsMO!f_ir1|@+)WH!QOX}&!%h+n)O??u3D(`cOwt;|8eVMnhugVyT zoa(1iWKy6PRG?S2rO;VmWunjTnx9ks@5>ecUYzAV8|sgZ#jbneJRWUWdJz|W=e^Fs zI`_R>FTuhAPNx$gkurPypv!M{!R4}5=-W@yLOfO&6&BbSF5VZmou4lj=DUiwY?9_5 z-6=ROL~KQoIW){JDfS=@VoWB{LJK$uX2CWgzy@gU8+ca(FN!fV_UedU45!ZNh!_F_ zp-M1YamC`H!#oimvAW%nPvfy`GiF~sXJ!NZe(8hNBoXGyYygv7Kz_iyDg~*(3-k##>`cysE=W;?h=4J2NSeoyB zzc=g&7MpZhjz&>s+TUfJKG@Ha&9u5=?M=ZmMf+=rdA#p^NnhT`E)!l#`>N!<+IiUK zq~OlBO{P42v~}Fxv0RffJr^cqY%TKk!-{Bn@E3~@Y6e@}lndT-rbn-okj~QF?#g=F zo!6NLAd38t`r2!mIrq4>uFr&#FNV&lpDq}U`=xSm>wQhEqNEwi$)PbMA;QV^V z-%wL%ux({h%KFra2#vY(Hq=GyBYmqQB<_KA`hlOif~^nYSn1h%B?Tu6G5H{*S7>9S zBS+_R%;)E2b(VbPz;Rz%kMD2T*)Da+wrA5X)H~L`e&O=7_t8Nk@;5m|1FSdw9Klf} zscT~-mJ+jcItnm88hkVW=Ml2^mb@yd@a-O5Zo&%&w#V78-2D0{k!ZTKQ_? z#PCrWtZZXLjMEQKwwyM|8Lz>e-})iS4J#s%71d%50u;m)j0VD`)iv!raje-czreL!z1mzX z<{~e%S9}B{(dsJ67N~2jy6MRAF*=-fV2sCVACr?VBd_f#loD6GnZgxDEtZLJMu}Ed zcU;U<=~(0?+h`;?wSQBOn2v#uY31xwT@r3(`!uk^UQIif6>VISnL`C7k`ty03xa!UKzZ7Xa^N~ z#lC&z-LuPbrYwkL(hCmBcYj^>m+t-)yN87Cr}#&NhWp3t3ZkrA??5@|zn>DgFJga8 m^nt*?o(05F!b8LSBP8Jm;zRfPuL+D-_i%G_m2Gra6a9bnAWmlh diff --git a/Docs/MySQL-logos/mysql_anim-02.gif b/Docs/MySQL-logos/mysql_anim-02.gif deleted file mode 100644 index cfd3e1cfc3e3c76ac402e91b41b4fafbe565187a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21236 zcmeFY*H=?v+x5HBNGJ&b0s#yVIw*ty5kk|D&}*pD4ONh0sM6GgF1>dlG(knAsfehd z2?#16Dk5r7RBVU}c4g!9?LGF%`@Da_x5mgxa*}m$&wE~T{w_;v3$lT~2OtN$Gy!%V zNl8g%Wo11*11|vZlavetfFuA2-L)%TR`xg^A8KF_y??)n3DwHV#@^oLfV)=`jTYp+ z^8^G221e|B0>h)CqT<8D4ndJ+I?0H6Z^`T-zEQL#!@wPVkoel4vb zZS5R8yJ|PL(>^{~$;n;*{sSQ)W08@!V`6f$v#WA*%gV|cN=oYM>)UH;T3T8za5$Zv zotHa0`uh5=UcEX#KEAlP`1!!ncyaB67q)R_44mP|rUN{yQ`QBqrY(g+!#=&Q;ctr8K`6Y7xS7;Lt82a0J z{XL||GEY=9p`79SobTkAB6Fi!djukY6Vo1?{4nxj2tXS8N*3<9p!&7BYhCSmeSDq- z{xmK7S{gjDLBT46%ED^XDv}hQxXrp^St_D24WBM9r=s8Jd+`5cQ%2&S=M%R_1fFcg zJ@#6sixg?Pn;XMg1p?PBxPkfIrSE697F&dm3d?`~zHJnlBqD z8epD6>NPur$njY=^I)Ood&DjW+cCOGl)NO>71+gPyOzGISjfv&ANgKTZbVN~JpSVY zOR^}8tOT`C7yuxsmnSjVeB$^ko@KytrfpfX@`S6NQ{{sR6miufE$-_Zh7A9n?%tay zS_2@AQZ{A5gpgd1SyMaqtLJ%NjDK>}r+>uLPzED-nYiOGnKWcW7kkv}n9T~$7{#Eo zog49k3wxdUp?iP_KAidJew(Fm)UHad<>5onU6WqT(xoFkH_wM|J=0o;bktN^)RJGFwVQYyhdL~DPhgfPcz*Kc5GFtFq2D(6s}l3F zUA%m-cMt!Zop3Sfapdb^Bs}}~v8_kGtj{wm*=3#IpXckZlc$OhpJt%t2cnW*<{bLV zeO0Ibl>53UgYa{$wJPf8o03EOuDm>Z?oQI{{1Z=sxBU;JpuYgq{~`>vvljg;g_HF$ zSIiXh^yKX=GCh44HL_dY_+969C)yE&^Bi!ox9w?dygNKtuL?+H%w2D za4=`O9f&7*`zEE9BtwpyxjLVq*XC45$HwI!En;BWPPccQIop9MH`l4I3$v_qw#?<| zcoq5`JdMS0&y9|rhnSJOYgm1bdWHs0BqKF7tr(&KnTx`BwP2+QSk%pPN7qKq-JEo$ z-@a{ZxMz>95lL3zp`L*-unovS(X8QVG6)buu{OdfR2C@ris5rqjhNmNbB(7xk`7N% zFus+@x8gqn6#10@#xf|ZG9g?3R5c1~ED#gM;qMQ!6yC<_m#;BDt&HZ#>@m)r9f;u$ zXP^hU9{k*pGgauo%4DnjG;O65#cOLlkPb&tIgjPV;hr@i85t8F8vDL_WexZe!+P;H z=C+H^$zyE;F7`#c_)ox{QLE5{5^`W&)CzCPRzS;?$1gwt}bQ zl(O#}G7eeb^(gi{mnk&umz*ByD3p>jKFh;DY_&IPhSW9xJVH6l@`Yc`x)uP=Xy@_i7=%ywUd##HZFnbe zK_INB*jtcl=-w)-KO<2Ox1Hxepr9cJER#NXRCJHd9r%;Okj3`kG`VG7TaMB9c5iuV zLG~-5d#!K^kk`5qWZL@aKKgJ%fQJD5Wp{H^xB=Q6pRoOg>w6+YgWU+}`Px*y~9G1eV=GKDNPq$_xnBA^azGO#6l zW+3<{1B6@`;LH7Bd*_snB@dh`0W9d ze&uw1%1t3-P0(#=s~KV%$z_r=T!xOEp2nhFJBr;g%i*HKI`$ds;WOQNC8F8rk{sL% z;|+@bWWh+LjpNfn9|Q91-_8eNc|J~4DiiO7#zX>XmI7DTQrJ+!8Feplv}k4k=H z(BAd)ZRfe;WMuoqzTx-%4;|D}-nU=vG-)g_l~96A`Z(=%IaQ`enk*AE95pO*X(4e5VrX?yhYH*IjdO zALuX^xZv04eFTep(6Pt{IB@-9{$Jy0EkaVJsulK3UD7V(u z1D1)U$*GmWmOo|&N|n+T}RK0R#sjijl<6L-<`d1Dczhp*xY(O z*WP$XCfrFzh5_hsk1`yg0gbM^oB9bmcdzL|lTJ(abz{S)y2i{@Nf2QIg#bi%r=oY9 zgBFR5pj$-)P>(dV-9kX5*Y4Eza&A&@3;d+8+~EyL_Iy^Mj2OvT2oTwk6C`+MNX=f= zd>aHdjQY8Fb5;~*m^d(CIuElEHTK}(N=Pa!5Q!wjNo>kP3JAdRKP8pD-cvBAmN;Xn zCWlNn^qH|rE*&o@Ro%aQ+Xylt(CCpznKj_#N#vq$`pimVB)pPokJ5~L1GBP)3C;VC z@k5|Fq9(1!S%v{-=F;S#P|hP*HYE4hZ#%R1)d5QvNjU?lp8_lkr>o;Rzh|kIMG}oi zmjQNZ<~=DLcqs8EEc@mnRw)!m_g?uhdBuOgOdf1rC{o4$O4* zDGl&S+pk54%1S<3HO%b^DNHkznd@%a5>{*!z8;NJ2{m663#14;ri-=Tu4{o_A7MjK3*d%CY0{79NmWmdLb5fOXD6c@dWvbzy3wpm zlpcteX#vV#897-nd{zP0_x8}ax+~{f_P}48FOD@#2wWXaX-e?iUOPJ^^)~Y?zp}-Y zh4JkcCtWQ1l4hO`eK%NCcXQkfGxC=HP>ej&-DM|i2i5|R7-`CR%uFAVp1;1wQ&nqV ze0pE>WYehF4Tax%f&p2R<4Wjyj}lLe2JY0&1@Wy7%nP6t`o`(~>bhn_0bsUlN8tn@3b zPnqQF`w6U;q^Ak($@RqPzp8nrV>TY*p%1pX`qGJ8bf&*s8`BPLq}jVHe$(^`$G-^Pw?r*1y1I&U|^FhdSSy;cA0d#kFK)S#o zl2FG0k#a4ivD9+PvLr*<&0-Ffn-t~wXF61C($fO~P;Rx+= zx`xa8WQrnOu-Bu;ZqfkYFU!S@d^fIh*POgWj2qhEu}4wj<(9<9ivnEXY8$3kcM1FBNfDCZ9^@GGL?2^FU!BGW)UXQRJi=W zEE^%Pn@sg(7Er)~N-X!Z7|i-wj@wscH_TFa;5o${Ts~0j^%X(B1%h{dA30Kfo5!<0 z)a9Wr^AAx7b+Z&;jYk2w`&sXcB$ZqPuXhpGiepF9M@5d{_^Z-j52wi z#s}K0xbN<>!gT_=hAzz}L=ut|qKIQsY31>RYFhf(oO~vV@ixa_cnekx!RVI%NE0d~ zNR`$K)QF#<_AzJgXgW9p%6TvUWPy>oGamKrgss_NLC#lvnV{qQ;$o_g#!r5vqRJVi z^O(hCxvqgo-bfd=Ty^Av%?vSJ%+aoAn^q+G7I;_sim)m#dVc;b7)glhFXIb!ivz*2 z=$q%|tFoA5f}MXv$1w&9?EA7Zn)k-@#_ICeg^(y7g zRrFrxskNV}*-EdaM{NXz`-kX|+r&3A-frI4bRT%$UC~1&Nj`z;;BsXi04{Zr(}7`f z0m!?jfiGW)(Jsc{uvm1@@C@#)43EUg>DPO#@*+C-VfHQsKIr|1m)|u~ziA4nm$x_% zEH{T1T0_7QuYbI@cYy3TlGYMieyPusvDWL=%ME;*eQ-JBg)!`rArck0&HX$r`0@Ab ztfkzwFC)4)et$v+J)8QveDveBZ@8cfLt6_jTE~9e@!kf$E}i)J_tz=t|7=>gd34$; z(`QmCLOp!G;Zg_E^8BkVkBE!AFPeneKN799lRhcklzck`TM+z^{QE;x^rO_TPyb|1 zL|fp@A~UHF+L7oOI|sUxcd}twS+ckDaeEd!JtHd|l7kI9DV>%VNQ^s3^6k3N$*8Rh zP76JZxiWZl5Y^Pu%011Djx8)IEA}?rnR)_9L{j~!;h~3DuIDs_wvQJ$9B}?8G;YSm zRv3cbl%Jyx*-(!vEWFT9z%E|9v3#U3)#YW7B})9&KcRVEkCK%Dtm?@-LL;>iHz`T% zX-P*Cc;q#*Hf6uS6073#X($efGqOnBAf`|3D9$TWrAOKn%(k=9BuW2PSzX}&ph|ew?E0h%h2~Dn~y%B2g>s8zz+=b;l#h?8<@`~BQdHK_*1UOgw$qfN5)njWe?hBLTP5TJErn|KtZ{q;@ckT! zqbQ7FigLv*KGqLH^4Bz|q+BbqU|AeCz7HU%NqTq!MJI7=*x*FTTn#sBn8u~ZrW z<$=YOJnu^&xfQKX&E9(=4ubiVSi>LzR>wgEYlV`IQ0Tym(e@5~HRad0D+T2T%q@yQ z`?wnvOYnO&r=oRVW(J6_x|j>vMXst9RLtd>3h8wcN8z0l^C^+bV zd6n@l-dzPQeP^O6yY&=s=&EeT`~=PGQXk_r%nqG!|; zbX@_p%Fp7T$5jm~^1|J|@;JcGkz1=R5?^NM<{Ipauv#ZdMj zx(sUC^fe3P46*rRK$$oi)~&Hy^`PM>!Zj#*m!r;zkT5)?=|GItR)D(1T>uFonLc|Z zZ7rccz!-k08}rE}T?@SjP?e-`^q{ksd|msmwz}@MRe_)1df@ZrlNeG<2_`FgDRIQ{ z+-_5GH(L+k&Ka5fJxIrK5L)mw1nrtGxDqSpr~kn7>il=*V`H&3lEL!FvQ*#Szi3b7 z@GDh3xjxVdYMrK{;)Jl>(1L1 zDx`>bLO)n^l}CLq`e!LJTkH7u8$M_oHDv4lef{71xBo1OjcINF{(R#?!mn?gA1ObP z^&hvl0W&D@qkaEx6YlZZ7CG?45XzrVS}gSMgXsS`ec|RYtrjE=a8)t<;kO$4J0cH{ zdS1BF>7H`UInrs#MT)QM2}gEXSY`wyhq{x#U}$;yX~D#Jf6~F;zV3kfQ-?A**!DJ5GwoX2 z8Ow9A4m$1$u7+-jLN7wbDD&oguI0BY5e_^emn*rm=8YfR|*$vxSx%6OdEbZ=AuD;M%T z4j3){ST-^|ME=2e_UZ0XTFdipU>J--*r{@h8S&vb^@X@JXhj?u0IQdp;;`bTv{RpoHoUyBIN7w-~-DAykW$y6<|3J0e6-#tFzrbJ9VRUKq&PiFg$+$lSBsxAweklOPrFVx^{Rn?xB+2cLQbfRbC>HU zH#1{=&WrYnW$q#KYr)Lq5Yvmi5pR*e0QWQn81+kD;EKk5A`f$KQc(vQIW9!-;KX}XyN-+s9YJ!6 z1l6n4?mj|eUb5~@HHls{eV&+Sci;V>)2J-P*B&z;b`K%%g&*R{13|SHiAbJfmHNR~wO@po&%0;l$(sJ5 zyqNVjmGF$F(DQN`-3clJN$q>u_`0(I`n*?X; z6MCCGOXXYNSM%n%KY07Mxj)~foJg47n2@{i>wEW&<3H~-KBN5jtvJ7b`{!sQ4HUVx*y0E%NZWCFWv8)bz`cKKIAv5)~%? zw@-_n(H<_@54y9Q($X`n z{)tdaYg_A%3WXgaCIpiFdwMSf)zyb(M9@$i+UXlD9nrR7F7zUU?w%wMJ;OV07ub%m zgezIpp(ZT%2K9{Xg56GWq!nyrWFtnnV>n}IY-lGYHs=ytX>dFALHOcQYP``_q$E;O z#jbS{)RLYPOOB%elpcjl01^_k!VaX27l{S%`m{eOjst&_jCvWh@vrE|>9767Ck-}CiI)wo=ydkhPS zmEAMAsL=nMb&Oowkm_WcW$m-O&*>%Kd#XHKv|E9Q2Bizu>bcBLK3c)$o({Pn3ER-K z94rc7sm0O1b=96oz8wDoU;`jHK|zvO%&>k4IXG&#AWt2e0Et8oAef5Tg|brnzFK>i zL}BjQbzKabs!BVEK$Crl_V}NNM{uFlEKSACJ1A9BV&bP*O31St_HQ?IMwK$WCR?P_ zy7eWqVK50FHHI`hW4JRo+tglVa>F-JhC>;3RQ04!q28XqoQbL%&VF<#X--ud_O0g9 zHWv)t$mW6{n&TmGz2VAx{PGJAB#}6xRS7_(2h1Zye_HHlkw=F_)?ldG>~Z-@cUBG` zo>;w?Ux`7r?@m%pqs7e;+4%sO@xoGSH76Z*c}1*ozv%z^RteG-E&ZI5K8Ma=Fn5{jB>-!Tp4hG_!f5+LV8$UH za!?HYHTU=rq?0L3=Si&#f?(F8XpWho)6Dle>vVbr zqniGbhJ{!&GrZe-Uj7!Hl>g>kFzd1t^_aY83|ktS0PoyYz7MhN-7HP<6$|d;t9@b< zt4R~>NpaDmK{mF5w)-hy*JleOo3=B%qo4W1bUo|MNam1^Ye)Cq%2Yw~+-@L`P8F%e zl683j+K^iyyV0Z1oVM+gUY_+?7f?zhit)kU=AwS=-(z3FjDFl9eB9tw|K#&uCYz@C zpKDWd*QfnZN*8{Ao}s-S`qG9OzDdkzZE)V&eacrHc6a{;V>eEQ*5B_d`iy;FZtdq> z|M_J9-K}36jOG;802TnM%9gykN|5VgXSxmd!Je{C|fX?G*Sv7}k(RH-u z%a>boVjM}t_=HZf;i!M-g=+dxAF3WZFxyDA%fXRURCYP|V5QO0I!UC?9pSN;kf=Cd z^uef9uO}RR`_kM1m4Fiwk<`J#F|AB_#R&+25Thc9j4VZ2GM`d?sK158E<+VNJ4s3n z4z-C}ysG*ZEC%HhVsJ`$Tu>Sr6}9?(7G^03QsL{)8O_Sut`~y~6}M}xPNt~HP&f=x z>Mf{_-GD3F;T0eyt)vpi&dj#YfD8iW17Dg83Z~{KwU^YfyV_I)(H?lybiwl7zWv6; z4e0DSX9=(*LwVi|>l3%SNakuR>B`>kK9(S;1OlVT8Uy*Pw9D;I?Mny|g;26IE+OF} z(aBi}zALHW6e90oP#9jm`%3-~@JATdhe%{`VSH6^J37xOmUVFtIWZ#c{EM3w@g{OK z_jjv$F1KNT;nPqo=Pv9rnmeXnq=&@CaNtCI0jX z!KYX>nqQJZ1q-Ng52WcvuTmv;J?WN`*mJ&>6O1wwsR7yO+7k zpu4e%fA8tQV!Vw?vnCcZAjQ6+o+MTN#FZx;BR~>y0ko`2?pqMnx=VnCVTwpGf}fvP zbE@@>0<^BAeT~&h(yq`Wr;1Z#wDW^S!o`O1Qz(W)9Ha@TZldiAk(ern42jd9voO_I zSr;po7~58b+bTvTz2}HfJvH=1I3=6h6^23a?o5<4fCfq~X^hud!Dim_Lv81l3Vbz{ zIR%2?8R)Q}Rzw@Doj+-58*(D3z;Gsl|61KW$m}I^(~E1qb&=MO56?Px*|(wzg~0M< z*dQVp{kCsP^hj;$cqdt=;ZE)#E}+Wx@R7A`RT2ML~ZP3`=5n*#~sY|au zq3&Jswa1zd+}rGfog`y!%MxlF5B>C!&5nNd``bQ3qdzJ#&B8{S8BK_FbwA*rY*<{J z?C){h1;wUf>grE5G&V*ZvCj!3#s!lC&vl*&aXC%ER?|3_F4t#aGwpE1Hs?Gy13g2J zqh9ALL!EksYp?_JnA$pmkcfB|&aIA3aBGh*R;#%VVI+~-*sHV-wl5Be+jkq4)N zOp$!U8cl0iz~Sr%F&1f1;l^9V;*=&K8MJK7)XK&R(pn-K{Wo?%(F%dyC{RL&egz8@ z@?!?@Z0-~SEyQ4`^Qc5ABj@lpF{1%lR%Z^39+oMneE}9E=CSP`p)|8wfi{Q1lru&{;@%aYt-+?8Ik8Xlsec~JmFhZbR(iZDvo^CEWe7V$R zQ@nge{CktBuMP8*K=Q` z9kF$Oxyt9@gTL>(ep@LJWysx_jrDwR`DK>hal~-oVA78lmeSw93cDSEp)CcxuTe&! z5?6r63h1fI_RO;%xMu!77J&;+OUNaegvQkbKO3DHGq#w4F}+yG%>%>2n%L#MY$HGC zr~{Hcrw?kH-IhR{3>Fm^07G$ShwFq*im3uHgYTiO2AgO(0PHcCj*@u8O-JdNa^Gat zNq&E#()}oXJ0ih`!PQ8AKkNl-MZ2wHgo-1=FO;`|@Ld;v#Rqg+1}orm0~}+5al1*( zSuL}@Z)V4@3;o>l;6kv7P_EkJ2ntALzq-N^tkF#OeIR+22~lul;>F-tc;_cg+_&du z0x`G)=0e)qp~Fh$jB2NL-Fx+8Y8rXCJs0=`gV_gDtyJ$?%wi%*TG?arI-Sct+M}aB z=9*gzIJZObYL-W6xep8jlxySDj(`l{w&m#K){q2_!42YqSP=NPX3ytwbjyR|XG)%O=1 zpGprN&pXKaxjt0al?>^8=9luJPk8(1hr1fG(Em*?tp2N9$lqQ2Qu-s#!r#R+33v0@ z$7esQzgqqJVR@ zqtUdwp5F3G8ZMj@nWd*g&WVdBp9$7Ef1$s(4_k>76hv2GGrLe|oYNqYWTg3&THkkC_NZs8o`U&k9 zr5C4_;gq+KYA>8u^RV=+)#8n~9pK?9sToUnib_{>KOl!eo~2F3KF&E^L_ z>WDI#rkh}aeS$tLMsj;bF&K}&HH@AU%94=QUTBiCy?-uQlc3hk15YGRIMFt|yh!h! z%bOb}Qd=&G?=qA$ob{b8alLxui~G-a`Lfqwr?GhiUWJJT|GAdDa=!ExLFS^mAn*F! z6jY5~oJC&rX7|m8BsgL8DbrZWN;nlu!Z&(l5}}~uWQ{T56Fhk7M2Sdxr-8nL zMNki1*s%f;!{$Sh+-6~0*D@NZu*huBqfd_^d>CsYmXsvLO36xP&iMoU`#`Qdq?4|D zm1q_LQx3`o5*NbII4N{0z5@Y|b9p0Wm& z8w9Y1_gR>O4w=TRGr~?+zQOOI8Etk$Y$PIXs_U$uv?)1IX~jAmckjw46`Gjc>};UH zWUZ+We(UY7Ml0v?shFD9aXMgODw4@p-jiF5m3FXt#6EK4ZQF;dY+pJEiX_vK@`Zj) zqk{IxVi?w7ne|aj?FyH0Y2)zYlYEk?q5?vMddw4OJnz#p*C1D?va9@;`?~SzL5ijM zzl0dB#9>N*^u$Mj73<08e&`9omm#@2H(k&7>P%yfz26vZnH(N&_23xW85(^_Et?+T z?YSjSqU;>`4%bt$hHqDcKR)m|`eExKwG$ zPo6xAPNrgtOG1TpT|NI4EWfyV8e^r=}0 zu=RC^jFqe-5x`#o`JtS$Krkf*G!iX;XkC2JdUnSO%sME51iqlaLL1o-qyRz=x=5xM z=9K_&p>D-2e`4G$PHA+F5daF*(*>g`!^8WxQ_z2BSqw)OUQ+EHEXRM1cZx{%X&7yF z2r&asb~z6*v>$=XjpbJ!|9H*M6}0rn;bt*Btjy77=g`oTkc^Wk=15DJ%g5Vb81Q+4 z38JzDPVCs0$(u+MmhKwP)l4d1P%zH_QRGp71@@r^EXEtSz+9^}6Bd|lIeBxqU&jwu zkC(!~yyZs-jDSU&vSB`v)NT*XBD3?9$usfuPGJxgf}e12Pv!LL1a7p-xx-^*9s%coF+@VCK~2vBZtvSUl(q@T!i<8&`BsG1?oA z)^nLG_A-GiA96hY^Ak27{o>5)Z7FjZXEXK@SZAP^#)bSgC!@2-w9yQ}bznSRa{cm? ztkyqS6^R~C+I*A>m<(AZ98b5*5pIfpVlfa3%t9p|q|5v0eXYtp`PvlkchWdF%Q{A2 zu*FpgYgN3k@BO3LVT>M^Oe+V}=F>5c+^+cB8+a-$F>kafHiXVbtO6DU663B497fDU zZS}woDa5Y3wr3S7y?CU{2R0Bh+rGW&Vk2q=EU1J%=sS&CP#3R3@^Jk$VWZz=?Bjat zujt9O&59*e7|KRi?A^%c)HA>im%%B0g}qN&3d zC>0r*rb1u_NR}|8JQjKJJ#{wU<}Rn?rW3ifcmcS=(5B(T^H;&H&IV)a+-pl`t;Kc) zJ;p(sBx4Y^f)#y)VaUY%hf+{zilb4i+G;cxlRfl!*ntk13v9`^=8ej}V8JF8#3FjS z**>$OqgOLt+$ZtmZVZ~dPc|6g?Y zpBbNV;J7pW-;n=r#^*H9GHva0LWyxfq=55X=Yp$39WXVtrhzLMs_l`}VKGj5`G$Jq zM?Ei89-{YOsvDfcN?*kicXC0d`&Howoo7h~Muzrcm`P9LcRSgkK~FFDVl8%V@IOO7 zL7I=h{|aXXU=63E!9t0qA=w2WxT04_lX-S#4jeL8_cHD2`IIICQ;ou_P!eZiCA?8J|$Wh+7?|aD2!LE z5R!l93}zqK;xKB?@bRl7%~(u;HVu+?{lH!Gnn31D#o8%=eweNq zJO3|$PbaQg5wu`>OoqmuJn2$1^L01MOFSBw4+ZHgV zrUsjErRY}NyqQ2Q&vINyEHt7RmO^)~iwr|3Uzly|NbOONR`SjEaDarc{r!dBJTX=c zG>Mz@*}t>h<>jS4IuTG2c}Xfn&;Q~Q&3kC;jvpj7b3#D%-mTpbLow2`Q=z^BJhoue zI22;XvpE`C!*6F99{l{rYfd&{@M3EjA$M11gm3PgedqP$x6+uoDP5EMQM$iA47`5o z0vXC%=T3902*05_%vkEDkt)>hY0km6UteY)-bsO6*V?9ho{}rNw(%hQe;xk!{_jPo zb6~{PvRnP{cCx}716|kigo~yR#n?ciGHF)-N{D|oXo_KJY05$O6He?HWCj)UZ%vMq z&9u$S*9k22KY#ojt2WFACylPBwG1}5owRWbJET|8>F#Mrp6u$b;iiROMqatPK((@q z)>BbYk0q8`p>ZVdqfE^hALLQ8h&4xB^s!6D`faL}C&!eOU_ zu#osq2Vv!(Re=*zQ4zvVz%)}EHb01sfGofeIIx?{ z?R5Bagh;ch!7jq&zYd}Sb)J9vFbP76TunVS?%SQ3bonI=%P{-?9t@d=s1oA7FO`k9 zbV>U@o3$Fg711yI(V*C_9Q+ve|8@|GcL=-jM6@aI6Gp~?%Q8p+??_(r^z<_^%Zhh} z{w*>`8-u>qg~Vh|JO&ed7~FJzB_@ksp!k8Q05O#E%!3fov^|IXWq>X_p$B+)C!izr zZ^QVh6u&erQ7#`CVa7ZF-X%mrXAyDzD}by+IXhfx^V>7C{!?pCxln;mbv}g85--8; z+&Jt4{sFWXB6gOTFNDqs_CQG+bRR6?ME`UL#C6(l z7AP5UP8QROz!Yzk4L|veYSgE!H;ICDhAfyHSv%&UQNtT?)h_trV1ZE9D`_s>#5cQr zD9=&iU;%E)`Q6E25NybR8<5DM6qoO{9>8xmfu9Tj-c_IdhA*^2zFoZhhHdu6k}D5oH@<^n0x7|Ud;vbie@OE zCtobP8s``NOk#ch5SylyFw_LOB;w(!c1=xmMoeoF%qHIq1vv`q=fGN(^=2r73K5+` z0L&bTe(WJqH&UWi$74+19P5rl-H$_t3YqwLG)vM3M;XiMS8FbE?2M z;js6y_yN9L_Y zlz|6c+SRj@R>lXM|4B`^z}nfX{GLbxmCV@z+P^*hHOqzE)fJ(K+Y7#(kUN+v(gfX4 zTHj~B(?Kl!!gxZizx&Jm`q)VBH`3*@s*_8^Rjo;- zrQn^$(+_v_?(OvPppaN=oTVA$hh~Y)!q1IG-@z`ju>ZJ=*8f9)g@zCl z0!WM<`YW)mJ~Sho){1HxYHvRiZBx*5!P%fU>42M|oR&m{@I{*KJqg!-!s|4P_gKzU#9b%^vv|V<#~Nj5zeCG`^i3 z86b2ybO%Y5_DJMOcK0Y{#L*)tYFD&b(h-o$Qt$QbAo4pr< z$P&C95OhpizM!400D41*p_j%*ofd_IMnxqts5nH)i!lcgtS(rRH42+5AoOoqoh|uL z(IE}t#EryQyZL!sf!*U#AsGU3qBvp?$l}f^_0Zq%=}zXZSILH5_eZ*vhC(#p%WuO! zC^Kr{zE(sA0M1A7p_Djc2@#L__L-Llom0%t1N7ClCh4WmDlYH(R?0`--90Rb!&B7E zSbL$^PVCig|K}8hG$A2jCpn=BHA9}e&(Ec|MdNfmsEhr-FQ8wyam1%Dgt}Gy& zpUD{IlgBZ^$mdS4KmsImTL~cL+MAwo^9@@1SVP6D?UQcbow&nbD7qUs2~hxcg{!cR za`WWZ;?fYL+CvauQ2}~kmhzKg`4|AomG_ZdkC8jvfuT@9Xf%tG%ZD#!fo#<{EPlg+ ztr0WX95h7yu=N_Ctl_!gR~?Q#<0LJIVmG3d*DYDl`#tWUyxbkwoL_sM@xW}#xJ=4V zxni^wBGs(!CDmFHvI;v=I@x$qsaIn7RF4ejwWvBpsR8j$WACVVR1b7C)BIYtBJf3f zsi|erY_PQy?V1a~_Z-g7!W?qzPe&&CHjN{}5g1%_!%Jo+Ds=Zlc{s@myXSCmE3oy){u&a2~TRi-CZ)rXAo(+^KR^msPEa76P66t z@NU~#j+psd;7kcjf4O_E&=4<(MQ!zGlp=}M0~^PPq`L|bfU zd-|ZVC;GH)AhEyHb^P!GS5{MNp~sF*OI=w!DqfmW^?vK&Dh`>b;YKX8^s{-GsZWTw^a!__lI~KV7@*aX zugqpPR&(~>p&NRBWKv=H&& zp8Ld!f>>10g+E`HY+qmdX8O=fNFJJE^*4JFQTg%P)7TsKY8w+;+W>Om?zOMNtBw1A zJ$vzDdwcsuG)X|3eST;C-(u)8!4h0cR`TQU!DeE$`$f?zr1g0<3TZ& zIP<6oNJQ9<4{~&J_DR`6IQUVz5gvAYFK$g*e5cwTF0%DyLW_J+z7wH&VTwJ{* zNAApt7Bwht4Vk4YvqPg+_XK8S3kxe2DtV6IL~Wy#;9BVj7%Z zR7PfPu?b?q+T}6iFhfdccH+pac$J;|yhBil6DOG>Uj0J%QiInhE2d_JQu_NlclMWW zI>3p$U&_|J8MoS*TO2p{ruNw=iJ;AxCHVd{Op0Un2@x@KR88jX4UnM0d!-#E(x{{b z$piqF>-VoaiL*g`X6RwimO5j51a$foXEfI1QU3@+Eujh`#3#E3mQcJ6WQyr+ z@=<^{{*{mRipQ{aSXu^y0+x|QkN72=#DfL2wUzMxO1#rFK21ZuKufV8u&E_jt*OO& zj6cI4$}b6c#j0nhQQ=y%T%`khFnVAKqglN+fbTll*-Lk+`=yz$%BQxFM|2JdLh+Lv z&TgtHR*BQEvW$!0q2u2Zoq?KAbX}F`x|M&Ev<9$RBuPBW5^Brz zfFlK?ls$xDU_78~xXfxd8+b#S3nKkhpF3hW$YVi_dj&vQwE2e}g5NWlX|{!(m(q+( zm{JX>8ix!Rs^wM7Hth)8VnEhSp`!n-rl=1^6S}F)NE20W-6&{HH}K3X5DjLg9~Hgk z0fQ+<F7%zR)_u(92ZigIGcNfi);m;d>6TUdd|Um#cl&6jMtcvr_4Q}mO+XxjNeuMVZwiTFK8UEE>d;E`?QYd{C6a9FjUf_YJoLJI)HGa>ip!$oPq?K&N2D1Kv zvd)WZ$27`PrzAN*t>3GxbGfl0bo0I1+MPoILzqsw1)q>Gg7tL0^KxOH&t3PAmmXhH zD!n<8zKA^bEz?DDc`Ne3k-tCGGMkU9A^VH|_6d*4?f((!$k_h#{h8wllg|^|*C8Lm zxj*@=C}x=AW9umgw`IHcUw(Ok9qG;61}Aa_`2Ode9ZEsgXtY#OcWZ=o_)>#jeO&E1 zuk-iR7ap`~23s$FvceoDto0{flNFul+PHl6_Vcdq=Z-!8leJ=oqef&zK%$t@Hg*n< zo=H1wSdu6GnC%JHj#0{lK-g6FNq=IjFUkAtxemYTn!u)dEau{+%L5ltjlC_*nEV3o zk`z6|$|{Dng-$e~_fY7SdzY_r%%jY2kTZrNG+`6hs20HyH)ZO6p zAa?%(=E0FitpjsCJ+z4dsec>CPLS;Xe`g1KFpm3gX9pq_LT0{K(+2jRSWJ}{v3k9- zv#NtGWz_`2%}Qk;q>?7u=-4(O3|@sM@ukfcf}!=R!O%H97ad$o&dP1rjEJ!ZSE;AP z(hPtw2PD-?Xk`szaGZfxFSTFr|Ec5L|C#RpKfdjaX;>T6q>VXVIW!B|TGTeIQJC{O zC~FdhCL`x|a>{9>bWjnMkK>fC)W_8|TSB=q$An5g65U4D#1QAymmr%4gYTZ z+rOQz4KUznEICRkkc)DVj~X&@{qA;Z^w_&>rj3;|3UX?jPyaM33qx?M`E{-6!N&;&wjhA4-rkJSA-vy>YbIz;MZ>SByob;bYEg$J6M!O7jDY zZa&;cYDzHb?hCz%_xwOF16Ocy%7ae!`ZR3M@Y*mBWw;y+t>Dt2U-OtN7o%-w!-3uP ze+&s@tkQ4x3#>YK0$xvzzyNm#l~f|0|E)>}Hmi}bbFjI}P`FD0K@M|hq=%oj!l<*z zUf8MWg>aq`0*vPykwqwD!RvJF($a(uu4t0F)lMP{))_yG=z(jxd0BWxmN-*Hgz&BX zhZUZ+d&<$a+^X!pD#{JsTSmMZK92di*K#$6*jGz}L*SO0;Z~a1#%I%or;NWA=m@g8 z6xar>XhqJTAOTttYce7dfV3+`hECEgfL^;#w)l$v8ff`d6qm9Vzx6%{ob5V>-kb4v zUZv0?;Ei%DY153-FaRGEf5sy$B2}!HaNvd&=#G)j3g2s(nG1&Y285et9Bfz7Y=@>O z=SxdK+e$RI^b$(;_$-ovH_4ztaC`1Aq*X$bxI$B{O0 z$EV&`1KI1JYg|hU8~Ey`^ZpK@*-azr;>N1FfFeWh4XiBwS2|!D0=RZDq>e(Ob zcyD*SD|yVxm1IiiK55}V_#$mH4TMClqX&l|yfGlba28k}sU;!S8&pLPl|3};7Cp>a zOH3{x<+<$LUnwm_;Y+1iNv!)1cf{&v-e?4WHXJYSLL^_I) z@pFuj2N1&QcT_OPdC}E~GF?~DdodAX`_ZHWgO9|7^-Mh~GO_lb>sIRyPG1SVy|Hzy zGuK1=U-$@($FNPeQ)0HgSa4B@py=ln`eHD|V@<7ZaM5{&#raV)Jl9pi@^XKuD73nf z7y_d=qaBjoNWXVv6`e6<&CK-67m7Aq77;Il6Zl$e0yiQi%QSBprw!=DE+NiB` z*1EP&K;CPjH$SSSI$?T4$907U^UKI$P}e%nj@k^04R#}M5)89V#=X?G19j2XlG{Sn zC%9|WfF7xhV7dp*D?w^4QBf;{nV`k4%i7pnl~4fHiWq>CU5(gBtZ<>i6x0-RIQ=4P zV+pVn_QoLB+?(bD#U@Wv51Uj3DZK1!Pm18kb5i$soCMUlMLmN&=do|o2s`8;czHC5 zc7JN`GznGfeXu?vZnH-N<_!)aTpp?ng166Anyh*C zGXP}dmxPJZ5AFxi{cfY1JAZERX zD1dQ`H+9>)pJK#=2FkAvNC%WvfB|ntqR>0}Zc?nXuXM{(IgKfs^@#MBNE3%(cUmIu zF{xdc;!y$seV==~lhEHr0kk-45Po)uhCdevNnRB#4?KLn(6>XL^)DDQc)Bmp8&qP> z-iW?Hh8yW%;b;86C#a8~rAf|y3I!NGNe}ue8?%OorD0j)dxj$6hYkg)9QT}59Qq=U zE!2mNR~49(HfK40h?z=0F83T;5}TiXqinI)uw`G^%m*29iijKPE0H5c^X={_v(3l& zG_67E^v^|gJM{FMy*ufLOr@BP`>xUbOLO|CN7KIFRS$NwKebou4t{(d4V;(H_3com zFFZMQJpF6`j*1`4Gy6>c`)`Y~J~qm3jN2U%*AroVhCVK_u9r78HJnrQCp-M3U@E`a z|4UO(TwV2G-7IV{@?KbBN}t18rKevkSuBqAqsND^lJNTvq-K;x0;il^P6T@RS5#aK z$}dPtmatK)3MTbH6@Iq-JdGcHlyuphae{|;tS&wneiMy)*x1$8e9AMpRq$)B*z+F; zQ^>AxI0~OAOEtzD!yh*$&pc{;OuyaIr}X=O2h*qvSxqzoWNjP>utcLZH1?A~kUAY; zotCboApqw?A8PFpxI>GPrmhnkUUvY6MJtxRy?})k9|S<`bthFrlst$=5QZB+h+MJS zowUe}=j6fBYNy&{%e5NqG7wb8XhYD-&w&%Klx}T#XOq{xQR+_9$?L*;WR)(-rn1Ls zoOqH&gh&h46mWY2C9`@$i>u|{faJ&6!>@WJPcUHBJ6H7vGn7lb=)koWNx6s)X}Jyz z?7}VS53jP#3I;CWV@hVNik%`=qa`Sf0<47Es_YkaLiNd!mY=0UQ4ZQRG43_a{TdmD zudag|ji@A;Z6O7$Do*U14OX~abMc%_I#@6Frz*ZM+nW!@kftW(DRnx+-O`S@8Q(irNC^ltZiikC#xN{9GHN@BSjup4>B_@nxI(5vSmL?vC7fKw zr0E>9vBG#+40*cqNbzRsZURvlM&~? z&#$(}KV5^Oq7!iJxae3m?{EZerxzV}lAVC#9FI%jok--Yz8y-z#YV@l<0!F-snN&S Rcup!fI53du?h^#s_J1htpWy%i diff --git a/Docs/MySQL-logos/mysql_anim-03.gif b/Docs/MySQL-logos/mysql_anim-03.gif deleted file mode 100644 index 6ac6b3ebcc10ad72e73c82cbc275cff50a3e269c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16958 zcmaL8Yg7~G!uLI=B$LU6OcDZtAWp);fI!1Z(V`}kfT*ZJK@m{{qN1V(MMaA`Ie-BX zqoT!gKvY!JsHkYQodi@=wAiAewQW3AZ0+9Y_So9;WpwhYLK0p^7POJjh!!+|dn zfK(l@BpX<}6ev#yHfVv`@ql#-uyYE~kPGZC29C@HP89)7tAMl1f%dh)Ry%OK3i!Ge zxLOH(zX`ap4Y>a$@OT$+;}CGa3AlM0xPKaWeh7GR7I=LTxYr5%)&ab`3jFgn@UaK@ z$M3)&&w#%_K_CAq`t+~B{`X;j|2g6BPfPp%w)gk%@9)3W-|y+~{~P#UA9+7-LQ3Xj ztwx^`7o&o`e+Q6%L|7Ow3W)mm5B~i(0d~KdHl{^EcugbIQ8au#baj#~efZvh`Mv)Wu7CN`HTNn3eoCV|7CJbGqr$Kb#@!v*u9qD8VfD7i)?ZE?$*992h=- z1e;he;LG9ctpkAE5d#Knwarg91M|i-Km(FTAKEZ&-wdCM6~mKvv6GXHf@44dI~Up| z*gK#Vs4z4Y+Ak2tPv$Kid&@Fn@Ad)npxniuw=F1mRQL3d^#t+5=X<(yHfjq5KQH)h zfX^o2DEsY3XtmQ~Fl0r>&kEX|_ny8HT$=qPpm|O7V^Iwl&u;R*w znlSL0I``Vr@yzV#+1Cq}&b?Z@BdHuuVouMa`xPLBqr+*yv~So}XawyzJh@R@B~o7Z zb?HO&^XASN252lN3>;rMQ`>B2VKtCs!{kE!f@$2SI`z32lY--`R686dE6O>`ZryOY z7dX428ylv|vpl(q+K|5C^%^TC4bL7R3mA0&@JT30-3(Z4-#1Cprs(r5EIc@ONpRdM z&4jNx=xkxLhqeQJokKby7upO8hg1`>ZYzpo$1yosPu)6!mW;V*q$}w(>WnNt1B`bS)UY8k1{7`68!!!eBin|C(MwE1j@UyBR zwqe*ofF(~jSLDCCxI@I5QKxs~$Z5R>9Yh3aL4dYv1e!9Erg`e?nX0relVj{ z5%X|P$)0cx6jH6vYZ}pO*wH@Y3S<-vPWAx2cn9fbv4ovI@Rkm}1`hFbwV~U7`P|H_ z3+BdcEEwC@W0XcYHR#|ct1L)KG|@8__{}gw6<@2L8;lI*G5osKdJQi(R6ie{del(j zA5V^-%?-??16L^${3z_kFRC^~l1-ShzC8~1@s|#CnNbyJKTCulFHQJ}9+eK6Ifynj z?Kx2fVSxs9kSWptP+wE6DodBtpzk-``{N{N*mlJ7jbK=vN#5>3<_+G&t0|Wd&E$;u zUXx;@-ju$&J~xImab9{%B1bCn`htYD?Xkvxar4sDG&)K))CzTo)&@-X9em%@AhCMp zCq<~^R|HfbwR)DKloR{q4%U#$Ejzl}%~4B4Hxm)?|5aulfB`8$@c&lkz)fvxx-}|t zb5~Qz&Y%SF`cc)m-&gO4-Hs!dM}E_r0BU+Fu68ba(6L7##N2VJq?RXhR)9#pX%@!k ze6fZzVd;u&n2Vvt>6j8HcnsCtOq3{ha&_x_V)hu)$5|>I*B}b9&7iY zd}X!#UoN|Fa9UH&x$!ng61SjfQHHODwLgumq{G@%CQJBNO6oEovz-+($x3_lsCCD> zOeR}cF?}e&j$)cLr$Q?*8AUU+076bsXtw@#KDYXyO4TClb6I8q(n(FW?5BPB1Jzu{ zQ_*Bv0uWRObGv&!Mnt4l6R+w4`cga=k|v*BVfP)sq|tab1w|!;eI-ItVkM-*3Y6K# zBP05RajOk!%x5W8A0=a*y#S*b+a+WSZ7AhX=L*8-XH6D|HWB916sO*dJ%4Lx3;(*{ z!^~0C%Vqr!iKxObWa>b}W)M#bCEF*ydfT=wb3DSP!oI*?nb4TbIxRccV8M-Y#-RY- z98k-EPz?N$?7pMYN-@)=4)DKdk3BZI#G;!OCv@P>Pc>V^mjekox zCYP@{`Q{-vEc1>Dl_vmWVR@#SfhX_aF!M*)*}kJVYP}oXGAYt}pgUO)p?%lXy2(l1 zsv3nqIe8nXv^ia=LCtnIdtiFGrhK?<>-L;P64114InMloFBTbY(r8HM`QM31k_V%r z1etjoRi=lIkRMtoG_1p;VM!i%e&=sX0Ze#U+OLr7n}&sVL7Dfc9!e)x!gxfr3gSj| zhawAK9%lr2NUaJ+#MQ++@t9VUJmnX3h04;o`-}%fFkylu4%R_&IJ5g@ly2DXMD2iFGDZ;LB zhAS_t7BzvuEPO_tY97pT}ReV&$kW#v#iy=+bOX$)t@7 zxIz&hwXIwZ=+Tm`b5iW1d83xiUW%q7Jh4Q$yK)qdqv!DX+@;HBXeUqglZq?2JkeoY zzECP{*^@q1j1`}}%5Pbe%Ry4WxrjnZO86(Gk|MC!PbTG`H_e?nMJ7V|5}8aQZq9fV zcj!kzhvsw?g860y4<14uS!!^xg)+a|NyzaHqQQ!Ww||;$Q!Ew?rxbQwn{gG5ThOiF z4E|&ja;!Ry%7s+*^Of*;?9Hn*V3}XC?So12^jhtrs%O5G+62iZ3p|Wmdl}sqnfsS? zwvb)z8yJ&BpCZi!n;=ym(;Veo!K`&HQj_NAz&)fcs!2pYN93}#Z+eU2E13V>9n&s5 z^DC+)itJAYm*J^^AEl>XoqDR~Nfc#g3*~P2MT^bHQJ7)6PP0k1?+f{C9o7-&(_h#Z z!m198ODgRO(&~QtHf(IN@O^Ck46z|)_in|3Dkva9oj#0yl){rgU)N#3y%T=gJ}MI3 ze6oJK{TI7%0|Bzmwhk0BeejBiCI^Jx$n~C7UXRJePqJo7u%R7#YdXG2MWI3H?fyrY zG|I>ql0oaU(U63=>ngvxECa^++pZZF=BQ%?WK?)txTvGc!cQp*(@qY^B!3oseV!bL zOkOTG<4L8xKNtr`t4EiqS{-hfU8IJ%@)CoZBX6Qz0z7I;+Zfryt~TKa<7K^?Vmj`z z{cPn@{Bu<3ULp>yFtLQWStj1#pcl;eKKTpt;!z&r5Jyz!Y}-XOsoL`;$7#c!w0}Hz zWoZjNZa!7*G2_UC~~TO95ME&RR=?l*TLv_41w z!rVY~{?X`j+NQ2;gt(`xZCcf};pXyRkKLP&j=Ov)5|3k?CXNpPXt=F+KfYWIZcuyu zSgZYa!4E5<+ObisbaoBzj=mj@1R}PkM_To6BBa@4#D;%%^(2d`Q)vZ5j~+5}IRz>U z-GAg$8ghw$zR=>qO$dA4v&12{DeDx5t)0hcyZQpo-)C1;^X_HAg(Wx zdxlV^mmxq{On7Nex|I;y)t{ATu*OMal9tq*ya@WlKeR1HOMmzS?rs{NyHXU8{8Jk` zNSp!U+mETtoZwIQW6_Z@+uNpH743;l;|0?WsQYZL#)Ns^)s*k3`zq>_gq6MaqD1Z} z{pEGn509btK;4ox3N~u|>$T=T65N0Ig#S{Jc3SjNhNGisUt@AmT~E}OUxSbuaIl%E z3l^fsa>j=Rq44}-IxWg)&Z^k1Le*g{Feih~9;cnfDJ)(+DsPP#TUD-w#o~3edFJHW zjAgTI2#R6Wa+oWYNO{%e^&FXOhZQt#P1!iAV9b6VuVy2Me>zxrVjG1i6gwuvOLk}0 zTWuWJbPg2?(N$Vhax+AN%&pOn5-OG7?wZmHPB59NlIN5e!9=2;d#lb&eg%UU3aQAJ z!dL0nl=CP4R4AhyuAysy4_QqlcMl@u<<(`|=luju9yO%H{%UmP)(rIVo^*`&2=ZA}@oZ-^oNmlhx(OJd7r9oM5wit|4Ml57A`4mFFLl-B}8xh5Z;j z)X+%QyUQ^`Yk1Rp`#{V7jiT_z<6UGOf|I(s{IhcNES%VOZDx# z$+RAveWltj#A^FT-hm6-26EEtdH}a&J>N1ddWq>URP85CtIU2;|A8wM4=L3Hu2mel zVsZ5^4t0hZPwws8U9vx8jz=JBZlriB#=eC`HhSD+TdcH}9}>k(;3pAp`YoI=tHHFQ zqpZ)hW>g)m6$HI;OMi)-B(?<~>LK>5*VUJ|2@)tG zALHlSI|Y%wqi-1e45}N2@kCEsm|^B?ZS{y=S_8#(0~TITs3A{)hiwy~SN{SY2v`Zf zQ2ZfHMiacc)%%{jRb()6ZZ@yq@nuV60x!BC^}QC3KS=6;&);}RVYoxD6?`>gC%{qp zaxG}Qlcb5rPrWs$th%e_kYn|WPU2?uum=S9jUHxetIxh5c+orBL7qWv$K^@yO+-ZF zHT{zCsHCZaA*I8t+)*w27YexO?S(!8$kF-2!KT1|ccQ3e-XX*-y!zBZm0W*VJiKW5 zfTRD2(y6P5S^w0Y7?JRY#hIeY`i-!endoi&?x7a=yN^l)+k2_+1z)fse8%V6>omiz z+M=%AxFRK~-fJ{|E1nxkwCAy8o~{GmMX_%bQ7vyitPqM{ z_i4Wl=_-AJ^4(5|8B;O-oeuc=8~4Uj#E!%VYF7GnPrWcMYS@04PEY1x z-|-EBIss11C$$oMnJsljwj6%)HJgek`p2Jr?E@d}iLdiN@#*#9 z?S0o?cZnw!zq!r%zlMyorv_u;5H2{I+}WJ7se6H=vUfGtl27igo^aw`(Na1s;U{Bz zeMgkwO2MNy)puucmx#?4K5qenEi`cSS{N}*D;qmyx>zFHA>APnuL4lv7$lc74Vk%W zT-Ls9&JM*%*(upFEhZhq!B9S$Ii0uUEU;+~vJE|{RECq`%9E9=h2)q^eDOD{Q43FN zU!YswjCDmvE6CnXQ6}uC9D|9(QjFp4kcmBLkX^^gveB`xSy<&86Q1HS0Sd(J&N7*`Ul?{Poj%&!o|e|KcLI?Rj)#1}N8_0VWR zP*P6%4^HaJmas#j2N&Z>vupcmuWE#VbBt z;j2m;QEz7MSA4NS)m$5??f(3fF3yf__V~~~ak@+*j;i2GeH#cnqiLyTQwi1C#mtRw zl%kxv(v2D|>uBk#yVAb_v*jDaN)e~ztV%YP&gyf>{Q+rGQKo|e+N{6CWs_Ep!fphD zu!Joj9%%%2pdpQ}2}QgrvzyVIi5oWuO(!g9SrE)tABGg70A5 zAM$9piXg&7@;||hIdr6fVTXF2Q&6OBI|TSN-kH9Fbrr;p=o@C=CLF#^gsPzOL|T321d(Z=c*l>B z8kVBdkN~jLvY%Y~HgfK4?!;LK*U#|1lBE@Ny#NF7_*xHCKE$dznNIfo2QtJ4>-aYg;E#(H5eD?JRwv=Q( z^uh%4f9o#XK;E?=q{`%4N`@tG?rDCPlvK+7`8T4vFPK1|ui&Gt_uY#F%1GR1`WI!I zqV!p5T#}lRnLm0xT)2FesTkvnzOeIA#0V^~meiz9(pAmL8mAr0_vV?kLeaYQIdty4 zIR{ea<=3ysG|v*9y(IH(G>^oJ5(qR&mE>SxGRb%p9H-j?7E3%>i+$Q zE=P?S6|*o?DPnOcssb~cjPvyEe1$KrVU9O6paK3b+nkKg>HZNXA4jQ0j213gm6@N^ zb;S?${oNYnIpnge=lu3~{zC?|WTApj$Z~ZaTssKS1%-ufo_=-$K-lzh`8BpALS36A zSG2Pa79Tp8CO2Qk{le5~No>aJsTM0HgGK{#D`e65xsi%b+czIu!4S7}n|CctC*>v6cDuCzhJ!i8dBDb1GY2f5G)X91C;3sDu>L+ zi1!9mk&MFleEZdjn`cs_6^`xf(})JQI?O~^PeePc`kF%{3dU<1eRxxt(+~zMJd4s`aQHMOs;verc(lV?hl;KA+$yqJZ&@29yzPJH>zNPw zw<=^UT@WY;;_XD!e2R~q2BhymOPnuh1uO0nA*eXP?%MoMjfWCEG27`=Z{IFA5#L-V zO#Z?;V+8bSEf%=*#!Re@IDDl~gMNTiuuoFA+QOBlle4)01RrW|D6{p?Ij71!I3VvN zwXC%UK+8{55}%>waL=NS+;H&s^`W)dzxxdRxeG!`yXQwD;*BvLmo%=fLj!Y#EqF+Q z(f>wLCUN3h$3_BTX**SmgFXgtH-B@$LkR%kg zICZG}dpOpn_ZM*!Hu(ry3H$Qb)cSqH9yhS${l&K_s6FZZv`~lp9|{BT_s3qCY-^Sk z?fd)BY^fda^z9q?-&95i4ET?R)D4`Hq6BKuOg`V7bAo!2_=nZU(VZuqK44(|UEtgo z>L4`l?I~{E&J7R3pb3o|_Rm5%m=Hr@EzB7=k)ef zc4@R&%;Q&lF+1;3`p+CuJ;)J?xZmqwadfm&>4#C0kbl(_^^h7fq%9Lga8+HMLlNNz zJX_@iFX^NO9n3ko+0Ktn4hF#ninX*hW`J5p?%I(8psbL-B|6sB*(lwVq1`{eU#>7@ zCW%NH8yEWdejlfP0IqQmP`t2uZz`MtAj^$T$jp`D}2dlc9B$bin@pj4Fd`t zd^NK1=ZZd7-$Wf(Aj^En#LhMm5bpP_P435e8l0$tX<>5w@giAzPEusOi(TKm>iCrC z_G2~#S$w#s7+#bvjGC)%3dw^w9Z81Fy_?ONR8|-^bvq) zLBd;TNWa^N#WCstpw+4RDc-o}ss-P6t!rVomtvB;Rk{j3%Urke}6x~c${>shM3d$cl zEIc9Er^aKYq^@Sd5pN4Ke|wm9StH;R-(%hSDmy=g$z~l~vZJAO{v@JL9R30S~$w(`r8=eI5 z2H>C>i?r$cUBLnd*wM(Z@mzrveW9=|rkO-IBX){5vLagm&Fm9Z7ovfwe#2e(us5|3 zZwq7qEV4yG4WrG6L08Tht|fq3bjIvlp>ow#Z7uhHIBgb477C{rU< zLp>MLfPnX^iBMcKVLtMYcaHipQJJqBeU=4?Cf>ae*_0Y9SgEZK{p+9`))h2b_?g4I zG}vsxW;gbB*uka>ve3Dc&AE^`i(haO)1U3)o^<2oLq28;B6Z0K-hYgA<5AT{ONurq zX;#(rO(eup%~wG?!>&8w0;1MCE5#%aYe(f+@l6jI6ie|VYMno@L7^rMM5oECa`sHxYHfbq z{G&*)k!?;&BCgC`cCzNo9~;+ExmmjTT1+hFd)HVLK~~K!$xB=QWhyd3yE$bKwG9A8 zGMP9FtrYXnttRubG>&1Depdaitn;8(O9B)MnHI(lD5OHp!maI>QqiUSdUG*%z2)*Y z?_uGDE0v1fLf0c1);SNpm&U6SzbLQVK=CVP@G*xl1B(VSbi?%WAhkra7im5HbeeFI zct}FhGDl{4qPR(D(+h5I*yG}&+N{_OB#%_!6hQTC1^t=^)RC^e<^2ip zkZx&Yo8HWqufHp;S5N+4(Os3U5*9%t0aRz>O@0+%#ts2G#^EusB}0uKIhhLy!GY!wf`R7t)p%o3F#9vg7nzQ>fa)54Mj8 zp*5`PcD^pkMj0R!r-r;-Zq;1e;9Ci18c*)$a9HThN!hU%MZE!OqHN%#tKG&YqyP>3 z(}o{a(mI2Qk{lq-qSkG8Chz1Thh{a&IAKn4dtU!&*2QNmW=&c$b03XqR#Duz5*5so zH1OPa)x{m>5w>iN8w=m0G9AaQ-e~KZts5E1NE70A_VfnRl@IGs$yz$;I+)i#R zCOa~RH&EzYUj;O>w%JkAzk=7{Or^zy;#hy#+HR*eRgw`^6T3bm@e zVdIg}zeTa%DG_L_RIjl{+0-F`w*}G~9(OMX_Nf?eJdADrwH*5K;&5~G7xyErv(Mj( zbbE)sbKwgYc2fN`eEFar01|s?3l2Wh(a_yzM?h?n53v!E;A&0rsgZv$#QA4q)g`ua z&vAlX#88}z-H-{r1UjI(iME1+Oz1GHN+#5?W8(7jW+QDP6s?bHsSB#G$*XqXa>f0MMK;( zduTU`XUet45zXqMyfEOM^=??Z9^$STzC**leSJ8LD2k@fGj5?0O83Y~r zop71>b>|&(el*N%YkGQh7`N^GBEu8)nV*6;GjDTzjU%1{YSrhm+viR)!1PmFBH~N3tMfv?ZyoyB5BtbTMEWN)LYAZ z=rUJ5=$*c8o&{xT*$H-oZi3Y>t_PQQd1ijS#!r=CN9|%IBn;PO8|hnsP#Lb5)Aij1 zEJ)};*4f{K6*?&=1YlolQ+bO*U98UrKBYa6$I<7 zQcXUTzz@rQxhfHHnJc9^41K%7os=C?KpU4kp!ss?!8mdVRE&kk&UKa=p1Hhb?v+)B z`e|FeQ>oH7jn<^x42+vp*lSSRmINr2@*b78qLx3+KcV;F`?rq+;>i|nAE~S4P!-<- zDhF>K9--@1fKS*yLBkosjmKu*^U6TAx)O?bXn>1CKb_U2ex|->CI&hNF@q4t(|%3a z`P+kT4fbp5`vK-Q(QtlDs2*HB0PrxVs!pE{5AIfZE1O0;G$*1-5Bqd+O?&4aWaP8T zdVjAMgiXx$b~zH%#qdXTFbFTcj6~4EP5N|JWT%}bJ}CsD?s73c!*&yg(*a%i>! zrCp6Op08ybE2ha94sahjV2;+I@}{Cjr#n^VZJUXZI+X^NNGq}hiRk8CUy36f*Z2Gj zwC5d0(#*6!eOB6o4^>WaH?XT66l>B(+C@aRI5tCk>Dk9P3t;BpV@N&77TFxKtp}in zNWixhXmfBoNG)5N#ES&TMyCteBH_`XN;jxq1B-jT-Nrqr3ta7kW~kAUa?hf&xLS-+ z6=e>F&+h*{Qin#BjniQA_JdO3!3Be9gbF`w;oS*fC_JjD)z}`=sb8`;cWEs5Obi}W z#~Yj(fpEjhb}>6=yM`hhua~6Q3jBT>|MM#=U&8!Gy~QWa+INgoMR^hsL8jgW-q{&Y zhlTov>DK-n>^O)HDynNQj7+-#=O^M=G*8ah;X@(q(x01q2Mm)ScMcBd*^~o2DRdxK zuWqHcp7at{LF^L`wAq)b1tWS$m>cKRpWu|-8v#%IHO#I1YTXZII;e3aWd#~{jdNYe z|6(y4lrbI(J^r(tWIE2w&STgyoq*-WdCq4SiNp7aH+>!V7OSCO!bg?;A6Df*b5I*& z2q+BP#(~5UDLE&y3rli>f`}i0xT=)lr*$Xt!Q*~h^j)5T_2s_Y_%&(z^l+i!3mu0i z#Fov)u$4LxnLc%9K81?C3%`nnp!R|orQqP`e?=?! zowuYr*55et1;|g$b|o@`aQxm*?l5De5P-r9(rQf#D1HVRH>S|R+zE;MEwIV?I(oc? z-{MU{tv=w`Ou(n9Npm`t$L;jVR)J94z<%zz8hM}yOx?3Vs7sH}aAgIC@oUFs_dx5j zg5rkwk_~`vgb$fo?IA&5z1%0RqtJbKjB}P)-}M9V`}`s2C6TUP*SXOfeFp^-iC|kw zmG9u(W~opy8I}j9c4t$o#>8+Zj2N$%3)$%UvYJJO;A|}u%cTp9O zgn9fBKQMmjMwqc^LumPFf*W1vmgdEBjVwj>bCxmha&={RoXr4gI@pyl%BV4R8hR`d zljG)I-h1bT&=*hY?E}r$9r1=1M*SQ_*ceHGSR!Kw3nCc(_iF=7y9NLuX_+n&qSTsr zG1V~53GKG`;DeJk10wtcd*%#4d8T?&gsws6k_T3=%vT32Uz!pn1I> z;u@4)6%pNiqY++IToxCw4gzyTY5IUf}cYU0YQ*zOeHqM?HUpLV_Z7!cZPCb%A~-@=bc?!D&SK$xwVbn!NF zlTha^XVbGh^Rb^?b}cXRX8jGomwC5n+Y=uRw2-$E&@PN`B4q%(j5d#K%+l83T)?SW z7;ezJ*x%8=WH`<2^^sv)^ma28F zg12bscayD&dIM|Ki`)!g)tB?SV4q(bmzJaL4Z&Z3Nb@Cz|B)TqW&U~ZNv~BI-OF}= zd~^E0S1$iwD9sI+yn7L+gCS`o;b>3P(k@-;rS-oXs@^R4c3wDjyKpGc4rE=h2EvO< zawldER*1ZDNIPjVjG!E3StbRW%YaEW#oI$eO9jgDpZn4_n921GqBsSS9BqV9VaY7fOP?N6Llr_egg8krE@oCp%Vqs}|mk zHJmTEIx1Z}F&VyM;Ud58V3{IZDMP_J(hcteF;%91YD7j@m-!TVITb4c zX}cnt8m%@E3q1AHf|F|0jE-CAVPdscHU=i<*ob^8W!SK#M-aVA(TL&g0NK>#*%mJ! zkX=g@KepO@RSL8|iK?gx9%1b1iJij6j!WLL~NvK@a2CT;)wXcjYZviL{>@&Qq3812CWU6rWDnnj7domo_2e9s(30KPlt@;V9kS2o* zT9giSvYGm;EbEe&_i{MLt`YraUXuE*R~kYAhV_%l!6<@j4FnK$i)i~|>&tC7*z!i= zCSn5OHLIvMLm+=X+5ltYk)N zo2L3{pz0zQz>6a_gV=4J`#a$o#{qckh=*RUu`Jzyk_Yz4^Wz(py8FJGx3WTj*<5nJfLBB@s}t$_TJR-yDoN3IAKg z9Bli`{89IRDH43l$uL?}Pa}2QD5tYGl)IkZ18zN@<}J<(nPb@b@5a3v8(yk+0W$x| z7F>dx{<(--GVZgpl$ws?37C5tZj4VoIF8f}=rIhs)buYp=_3zUT2h|#>LHge0x_zo2ch)*R5GN^I)Db8TQ zD~2=c>^m1nRZEyF-_$T$uu+nkEuqSy28#bKFpqgTjd>o;G?;{guLZnaYipbLm8^bI z-?UJ=4YM6qe|p{d^I-TjGxW0&e%w&t{hRjxVR8O1T*a-40}7!ki_665yk;c|G$rA6 zA|_QZQ2s*G%Dw#iFWQbQ9btlZ=`hMF4nshNEFLD3VJ3M4Lsm6aZu5 zV3`QZ1gk5&=!y}W)4gr;X0CS66fX_i>nD+p3RwFUM@T*pZkRNg^1>@qudm%h7OAiHHjf*2!~X_Y@(xfft22V?wNoE$^vxLs*d{r@wQ_~whK@q{ z^~xjul=6=a%%SaG1(|XxuSvD&hP_CJms9tne%`P#GQFiK1MWQ)j<$?ch4Xy6BwuUN$W_{va7#}GkThYce$pDQHvSXN%^Cr1Eb$On6|wj$?0_IgM#--rPqnGR*(I19%1=8-Hg*fT!u3OU28_~g-aONbADFX7^)CNOKqRSlv*ONV%;HBk zIVj#J7tk+7;ye53$TPNiCOp1n>MVgL{aFm+x1u16Z|G)*E;(13e8w&qJJSb ztdMY_e|`#ee>wDNPuoZ_30x8QwmQwtop&Owc<9pwY8#%ej@U(YGyN}8WiBtIb6AuC zVzN8xwsG<8g9|G}LB`(&5sggru}kG&;k@`Ul^;*e-+QF-uwBFQRRboF@Tx%b z+hJ=K9v@$(Ufz;la!k9dafI`V_tFGVJ45pW6Y(H_3po&rYF*=gsNKEb92S`SmPR9+ zrs#mkUh+Yq$`OUILXh7BwK)8FU{`1(L2)G}KP)dglpQ!U(*(=Gy-w|NJK@?{?*#4?^sw zK}*LT%MsX$wv&me$2{}>s|)M=(Z!{FADsR2O2JQQn~u(U_iDVJ_hY75CY3BVE?hEW zi8!LeLCAuc>t0gfF4;AKAYya(L6hM#3EW+Do6n zakW5yJ)vR@W+ExqA5;&0V^@pV&52sByvglapU5~}3fSm`%7H=^#C=W32TlY&S>0(s ztA{cH)lL{6bioVQHllfI&g{c+(5A$n3K1~G`$Er%Xf&#a{d`m12**3=r`TXsgoZyj z7lKXNm+?9P2_-2sX7}4n)QQjxrs`|eV1v6)j@!BLY-Ir!*}_r7F?OSC#faT3H6(XB zA|4yx-E_PSh zp>!)7)LOffmtl~uNwwn*3zZHn}w~i%QIm1DTW!YdPQ33pYm-eP8 z?>&im=YC(UI$z8+F@T`uW1i4I4c~r>T1)z3!HovkN7dZBr0R3#S-x>~nfPCLT40{K zuvRYI3D+*NTUM^7UF935Suy~4#?(BTGyGfCf}XNTgCea{I@ap zzbA`RNzx$pSheATcg$@oyemx#B9J+bfGhcj=Q4ECU5sP1Dw4y>?!9Q7{-EHW8<3(k z)4W(a57AFRd7SjA;}?U-9I7^@5U80}oAYmYm0x1yiMXW;cBL(^oHk*i7Dee&u*J&R z%a{4tChy}*Y+fjB+-wA$n6dTr(TbdNyWp$ma}W{fw~WDr()~*?@i-@D$lq{UD;Ar! z^Y50^7qs_-B|pwaJ;Gf`cxkq~cNa8wg0E6X&h=hW+8Lfeyyg?hg6?md5>E2>s~RC2g1Py!8qq&3J(IKvbXI z+iFNQPAfBjt13)#0i|M}+@6B_h6UlbJy1m=A`4OC;LVf-#&%tk5NPN8$S zayt7r(2H^_E`Hh1MJ{Uev#i89Mx@{4KAC1OwGU26b7yZf7GgXXH~+?y|dFnzQ?q9AU>42K?G| zV8V5GDL3IA4gSh6W+0sZNX@gGkMu zc{E#Y(2oIp^?%9`_ZX*|1&zP*kLItiFRS8eGF9^ZjyzR6SJ`}hF z02ydwP@2hBxamfdt9tzPMbpVEf`fM3CdsaM3@Hymn~wka+y6ki z|JOLuPA_F}U)W-KqcR2xkj51^SZc1J&mm2z6L#-EKREN$xr`UX#)XCkeqiT+DpL07 zv&KwW;)U65JRUlR!x!7dyb>>uAuK93&rDx3(_4Wyc(2ZE!z8jJG9f1wkx7aw3bV!< zau#brOf30YB0aST=F1cvq?lu+IHYt2Si|QcS;aZKsLN8B^d~ZS3Wx|v^;$D;aijYIxLLUBtlqlbOFgQv!;{)K_$zgW zY-V0sxqo=e%LJ=t0DHuwBhY}!HG_mmctJ~gJ(bFz3^eXucyfh~We3zPW$y9!kV{<_6p^nXiPVz8Ys+PHKi#n7P7*Mh=SIhJE4nt1V6NKdC}uJDRGkh zN=Jdgipyfu*6i5*>o2zAI(tv^f_79mXe5vOyZf5|K5Rh?daxn&$@ly|=u-HuEgVtv zU?oHDAC1i$r1OqWtWKB+%g)aG+UmC-OPUKdN2B_XonhBB!yc!@g4p)UjzAEV;f9^V?&kix?tQlR6o-Tec08U_|7g6@Nw$h z@I9#!;?08$YHVnqz6}G9g(FyenaVFZyVOW=sXF@(-%CwfG}}k$Uy-aUq!0Mgyq=$cv|3~cPs9s?f!`a|QP>+^Rb?7G1IK>)AC z(~~aB4sXL***PJ4PSAG@gjo%>#J#b!3&kQ5)Ky9J;Kj!eP6-6i(1Jeo>D_^Vd3s#a zGuNo7J7a&r?*@6vCP{)pbHX1Lnt3q>yZ%am*xta$7M^b+2GxEJup+ERjni?{vv2vK z9n5Rmr}l-(SJHIOOZ+u@F<7$MLs1FY^9Dc>*Y(Q;Lt#4i0OD;&isRI3gnjAldU&&U zEq4H?Za{nU^CXP^X7ZIgpK%pV#uGDZ!F_FYgpxx8 zQpGX|^U5_ePLXudH7BmuaQ>!WOQUgJRmf47^NMX^Q|`2BYH)1HqZXB2OnC> z_cF;Xt;3J+#ZBtw5f+;c>i%l76<|wMtJotR8rJ+PEri&W_y6u~Ya zO{yr03U&|+Iu@+s%&7A+_df5v&hvcB?|jPMYp=D}f30n7YNYjx$9_N=cm@C%6h=mx zppF*Zh8Eo^EwzO}*h!|SZQN*y6$=srLqxHW(o%#Ksv*2)285!8w~}5U<01F zw|6d9tQdl_2~tG_$y_0xi9$p ze+>!A$;lZQ7+B29`7=NNTX*-u!os(ysc+xD0RW)*m-rq-TN}QCrQvpU1TFISr{6K6 zqJSQ-W&Jns_c8(OU;4selP!?)WJbtTpp4Y?^72yG{?5U`vY0nAhjo=CUu<=Y-#H`_ zpJUW!qp2gK#ryT}OOY+(1|lNi{#HKTfdR5&I@vlRT7EhOva-5bx@P-jb98``G7o;4 zPN|5lEU>dWHEn-xyNF0(WtL7rmR~ziTB9r0TynmSr&V1N>($bkw$o(P3pmicv;Bgu z&Vk9{#i6#5IWOsB%gYhdE`fY^o4_&Y_SOYpHgH8G^L?48u84a?w%_w>BE%84xW3tk zn08931eI)^wK-b3?3wLOp2!aWPelQZ6ZsaKlN3yQo2H6YZ91H%dYgX{0SRE6jBKKL z5lW+^$Ah1q`t4qX4P}v#!TNTf2&O9!WraHH8 z*slVz3GigR*W4nkX6o8zObsR5$#X<vU7V$C_5UmHBk-+ z#BlyP9*Rkda(CXLxaMk8Olc!okR2URK6V4X7(Zspi+Z8b2#e~BgFF@v+fwb1iS>AV zX^b{D!^n zC-0z%GCW&VIOK@d{f$=B6up*&pMG}cm@|pE-?uPTzjQ?`Fl$x05hiBRaNMsLJ}%D1 zXG3#Yui=Pz(#`StHa*cXYN@TX$!+feD+hrX&DY(b;F1W?*)>f$c-tz*8(BU%?(Ox+ zd-S58>#>j+2U&OX2P*T?k@1|@r{~XpatOK?ouV&xrcx7wZZK_bIHxv1@jLgl!B#Br z;_I^k0>Xc}Ar43a0)Y58H->80xdG=3fSanm>a}yLGGF=>MKbr|eEJ3m0>PARQDtpq zewwc`Y5vvY{pA!Tou=QT_ujIV38(EB@<<^<90g|D@{W+KL7Y3kI2KOf(cq&z+|i24 zBzhi=RA59!m_ik<9vuaH>jj|@gjJ%4x22$}YIqpj75<0^yZU%bn<2g>fRv5g%vK4Y zhF+_U5Av<&0ko>C2_|*?ssa>sSPxUxlu9Z&lJ)rbt5)NupY?DSsoG!OO*CT6j%wH_ zNfiJ>sdUZB0uhorZ#K^h5mj0GMH%x=Yv$_#1wGeizzY5T+#X?LzU=YHmV&1nn#Q{RlXslB{CVT|GOFQ@#5 zl`PdPbEkJGC2sKIZ~9Z1>&7jCEheRTO8NJAH*`T-PF=U{S(`tr@7+FAh|^r=Xx{7? zM%U+(g8jzrqMo|}B)xP=uH0TV`*2)dsy+)s?%d)M~3aA{rsRUPs2bPW3%H zvSN4NJOcCeGQTc2et0nvKMDuuPd0^41uBthi)@p%Bvo(7 z;C3)1HI_QUocoWOG#%T0u#Z^3`srQ^S@ITVTlC2}$1URGa%3heCjO`}L5_)dqG?p3 zi#NIqKtm+}SQ&ZDwakrtyqroV5_zDzIM@J@Xd?(izBgUy8R0OIdmmf>LpZZ0ppXlN2u zXDM1ODikm*m9+pgR_|m>#R}7ptg_FO5MJJFBvvKbIijfW#3MCnGvunE)A0Uj2k9O% zeERGNDwT^4J;Y=97N)<4kym7eO-)T4akgjB$GV~U8qsFkn44N5_mnY?Ti<^}rxn|3 zpEZjaDX`7oP;4b--LbDj#h`|#VWBuOtD;hRW3XW8kG&wayeexbu+x4LvMynmGzgbV z2_TKeH4Jv#puWX%8)nqUAO~CS$k)aqjuzhY8R@s0e9l&-d9n0+viJR#oEtBtsUca_ zZPokOg>w-T>>m}fE2|!RN2}8)H>xJnV)S|SSOc$8Cp=qrVsx_uWjKMpwJFfu0zw(E z4jX^}!w+_Co5Y=I|GpgibknL&q?CEv4^8Q-V&AGaEG7OhSTfcFIp@<=C5_0KpHG3* zI+taBIt2oOQX+woiV}QOZPPuusQknx>25fus94n`cwp(8qe;@R{oSvm`rixQc2;(u zZdrJDBqokeW3#D__WZ0+GL33pNQQ})L|T5KIhjefEXM`#Sxw=rSRx8;MN08a$vkS4 zryA9ak1r?%aQS!}z#ESvf+P9Ef*3VoB!|ODm}8C4v2lDVN0WeJkGV3b@VN;TO|9M# zMID;}&rTS<#ld5^Vj8)M2m|=9e!(~2mTmE*4Xy&o24E8ZW0n`U3~&}G5g4=lx*NC& zmR+Q`Y!9!Z#gyr4`>XeRlZz2#d!W%Xua0ZDy_LZzGg}~!$Cfmx?t3Do-(SH)s?B#k zYgScaB|lTxVJBxL^(zn+tn4#6QMmmW*~MdpkBXk`(Y=igJg&W|Hz?Qd*!4R85u$#0 zLy1j>n5Q!m?kF<4sn?0FuWJ8I3c$GERj86Jl74Go((tMfuu+r8K503PH>!upJ@}NlmtCGHermQgLweHt>3Ii7v zlr_WS3NC!%hQE9C%acKHu>bex53hH+T|XNClT1Uv-_T0`1ns{Ft|FFc#!8G*YO-Ac z63JSZC#GAy=HG<(2&C&NqgPk4Hx6_rzZ*$0T6r1kim?2n57Cb%a1auo!p<{FwWKp) zI~*OM*@5w}08gh=(DCwkTw9wp&!M@s-HPrCkmPZFd@(MUY8NzosB7Q4sdM%Z`^2YPq&TKs^NeQHaEvXF<%m^& zI1sETp87{H!Qf1Dsft*$t%TbZrA!Rgs}{MGM^AYSVvCs|00(mKqW>=Hf0PKc0|Nv zqyLQ@Vz!Rlu?VhH+Si`DQon9ubUfZjw&OVq9B})IhnP%uB!}e>IKY|NNF+k%OXMc< z#DY0Q21lF2@ND8TK()G>ZeKKwO{G|$BNpH&Y_&5I=WrRg!VB?y5JA*3rx~*?@WyF2 zyuWvPV=o1y`Dm-z*rEHWLYKlPcHo5?fg|ngxxwKyN8BCotephS=2D-l>dl@BbgDku z-iu7|nO1}*Ko6XTRmNz=gLXv6Wn}|-25Y4ZoXzU zo#@DR)kM+QG#Z6?{#>^g+;@g@aVW--IOH!t!7*pxA>!3*SEec6F_dYLI*Y?yIfny5 z0Hj=w(A11r0xcgBaWv)!nuy~A>XO&p-@pBV0w1D4aNQ{SkiT%I=C;y~%>^;gKT2R{3D# z7En{^w5s-T!&c`T7sA@-TP+*SYRt}<{6lDD*7pmyzF(97nw9>?NpNc|hZu?aOd`(T zF3}L|P8KQLtf0CX&OO-O9@TsY;tpK1l^HeQ&#USNauArlejZuL2$##EvxNw~2$#>< z4EoYpNUAos(E6ZXWi|JBItgtrEI`-*$YjEl|_qn_nTpMh+iXKT3 zY4c(XCxfz^olOw%zZWC~$gVFAyS})ke=SbVj*`W559C&%p7*KN3H8Bx67#lD7r=Cd zf46KB*$vtz4NunwE{ga1nSH%3W{XzsKNJ)c4{Saho9Gr8cj!K&T*5h;Xp-rekAXji>iD` z#tL*FJ}*g;D_2q#456f?lK;vn|7! zg_M@E`Cu^Jywb(yxGNA&PgpmGtQ18UR-`*OBrsS^B9p_8WyC{$-9xZBIuC|2Q^qrc zL;L8a3850P#iiUNSM(7x;=>7|v-`~S1Z2G}87^5sUL|s!K+enO5bdLT-$DViD%zQN ztz5pYm7v5;w~T1)8R2&ZshI$cLLhUeB4z-;XlP#A92n#N%LnklTzi(HSrjr-=bcU> zk4Qvi8cdalY^4wk=C(^<^&FV4bu%QMq!M0|pAz-n(^VqVkBEscBxKpCkUjg?gu_)b zN)kHAvwNQ%DX9-TTwMZ0b1cq~AD-Q|{m4IA^7nO&|L>kkXC$sC3V*W%z{)2QZgiDt znMhtTQ*`WD^VP2lK9y}Ne|K6W^(jH>?N@E916NSG_8vlpHK;)Mg$*Glhhu9`bcT^U z#Fv3^*=Q)kw$9cA%}}O?G`9j^J3o%;>n~&>K1?`c1Fy@L9haBEfB@*AGCVnTl;~SD zHp_#2M**TTYmz~~L^}t8-gG)k*;=Sf1c?gp24cqjSIy9;&uzYr=;Wh+jxEra2p-$U z_Mmb5IpM1r8!T`GOsG6pn31txTG9?EY&#u1Hg4RiFr@n4qnt}-HX-v(!Nn&N4}zJ} zqg^Q{JnubH_@?ivERpB7%e;T>bN4~hZLnF%P?B#-y7*_a=8|NSWO*RYUA1WE6aS4d zG}qv-9L8%$X6I{s`?0Zdtq{=0epGYhmYDPD@FDUYzv>g3F>7%*b}R-cNbYK9-ttJs zXkxI*pAXJ~u_!_s|;iHOH(9$m&`@H$?Y21cE z_#eXm_h2jaABbc`*+s@4>k!SgmAsEBb*Hp{IZuKHM^7?zupoh!+it6VT-yD`2KAgy5He&5EUl44p$*3fW_gm57Je#nzAHZRXAxrHJxA$ z%!k?&1btkt8I$Qy#`{|YFR5^|Xk{Q=aA}s=3P4#z-c97zjVz0Cu%CgQL5n| zo;`;$wr76*-Ya5KDTzlBOTLN;t5ML~6PTIXGGrV({9XjN8A!q3(lP2P?WuFGkd&pk z${kP^rbre}yLX}7!^PC)*;{f93MK`zkZzx<{=(R3i}7*YLX&1bS+j4U-?2bLr4Er2 zyxT_Rzk_PItZ=VPs4-Ji{H^O2g%``BuHwNMg_b#^VGk|EiCNQB=`9j6aTs8Jn0cV% zvJYX%V@N1Da>x5oumyGB>_I%NgL$-EU-{P5Orz_N_;ij@tV@yXR1Zf+ojMwan=D}3 z?RPHq8tA#pl?8~jy%b3Ofs(*5Ei}aJ|sYpV1RF^v*4^hz98-u}`9In$ z6*pv2W)y$>nzQ+Zs#H?tv+$_xMK*8gtpcRrE8}UA*ui7=)gOdLk4~Az5#+4uc_-4c zsB+>WmaXa3l#VxxFB$48heXqBzna-}O92ME2IH}}hIRs3yY5`uG4UMNV}h9If0HrU z3(23}?6UW4;EfH}XDcRaSQ17~ig?%4MTsu6;s-CQ@+2QOjb<5>RhKwP!W~Dy->JJI z8TIK*qLt84q1^B%yYe^q|11Cuvd*sX^C7Gt1?{42#g6|*Z zF>L!1-qL}!I|JD-EL83jH9mnTl07yUm!6Tn59aFOcqG$&y+Tg09*U){ee4j+l(Rnm zNEza4O&d%RnniM5U1K1ujqD@ooh{Jg#Np}>2*6qS@4HJx@*knA-(}In@l1*xH-HZ{Js5AJ)AUBP%&xg+T(B8U&bo z8oyW+^%r863e$}}LnqrAM%SwI%a6WZ{kp#VXZmxbdLrJMMd?>2?=>uiJ!kW9e zo`0qId7)HQxoi=^p-GYcGT5S=Sxun6O~E`nkDhI;HwyQZIiNl-DKl?B7*%|IlY(uh z$rc5fGvIBByrZj*%c7Nd`&yYFYr)X|eVQqt^7t-=l6iK{6xbg0d9;WBN&(*aX&Gl`U`fJUl zMeAe-3d7J3Lc1MVc?=~9QD-0y_X`Le)QdJQ|Z*c%MX2=^mhNjkt0a- zP|Jn8mA<6s6K-_FXtZHs)QzEp`8TZ!db|J0d+~MX|C@P9Y9E*Um#>*?tHaE{(YetT zd7tQoG`%V^SJx9wlAJQyu1BIL-dbs&6bZkCtV}%+L9Hu$0^gOn9(bgt;b|FWFpK2~ z!Eks*IEV@e;n6s?QGp4d2M01F*(Td*Z|>|)UiY+2$Q%mb44gplHArJpBaAQ;x>$jN zODq^7V9!Q@9ThBe@a6#NT zFxNoeL-)MwElFWh+9i{oUModq_>7{ezn&C zDeDhF3vajDa5TvGUSt(rsFdo4{0kyfi%)Qa{m!?oq@K?9e{6?&s`zTel=;Wgi^;-9 z=dS(lT;rC_Jyqo=HC9m-JJ6*pI!j&MGaqW~-4J1V&kSRbDnTl+MUEN0r~1Ww7&x&w zuap^}j}Cpfa7~7_DQAy%J$&b3@34D^KDpstSw~mr!{BIJwO7oFxBB+;%kkE4$0yDN zP=5C;&}#ki*6{lp=dtUZSM}hKP~?m6O~R+0PU=mcS8fr09;wBF{~-S_(nHeBo7w*+ zJ@NOxml`*_B7YUAZl_tB4sES!1cWb)M~>Hmxx8tU&43;=Gid`;Gs+ldGIocsSO^W= z12OfoB#3mnV~!qNQCT5@#72P#J5CS9MudV2mJv~pWopL_5D*zX`5e7cB7_3jf{Q$w zL`4&7BEGzxN9+vZ_v^VOb13}cc}jAH7jJ_2WQ8~mH(i~)ns_xil|S)#%yaF<5~K3a z=M#pPCqB1NdU+npbiy6I`ke5-ZaKNnf`>VZ8-=QODTk<^b>a|?cOsJMsyRfkEMa2rgK&3?_EpBzkN#oP8WvospUtVm)MEaSib}DtiT;qsVB% zM<*Ii^tgngE+}2)W&>&b>FJr|m&QGu?RVe!JkS8DuaZww88 zVlO03#CxxgV(a#dxOD1nI5HMK^G0rmJO1U$)~ebJk&)uxRj*wadA7BAu>#OG6xY9& zNu`iJc2z%fDeSTcxfyIao{uvKsuw-ftyQ- zMOWMR_XnJhqnd>WB=9MDW&-G(`y>+~@~_TL(#+xl7IJ6J17mBG#-8xedFQ=&&tbfu z|76jt+}K+$CXF8#{80c<&xaExKT9+5rA5e?!h5UVP#cPwOIU`#eg|F_gBOPr*Q9Ex z5twu>Yl0sE5FMKCHq`(sP&)b8RhcG313p*2l(@y-a>4kjS!SE#7Hbo^28qMio?+85 z^lb6YnzdUEwL=E1&E>nTZpD6C(in&^A&O7rgOq|Wm_lk7&~;t;8g@YFIaLt)l5 zjCr6~-yHCY63HuI;JXO*7X5bS%p$(ofN4@m)76>yZ!&f>%uyR2m1yY;JbwnB$NkHoW8~p_Ezk>wZB(r9z2Gj2S zxycJNEy=7COTnQ+QzlZGAN5N)M{G?oj!}zV&Dj1dHc*)mejp(c=f?}n$iT0cMd>+6 zPyt!6-ax>PFe`_{VFrcb=+(y&xXl}=F6c(;_Tv-xQxmCdwR(U`#St%pe)Kk`Q(@@H zD9wopd*jeE`{(D+sQDzS;c-Fz4?^z^R`7kV`y5O=Qhx2l{p;y8+KZ2Kz{2A%_k-{Q zaR6@NtY2{Q5E`q`|M0b;c!+F6r#p{QHrzQG#h>4_1F*LfgqFxxLTZRC>tD3CgZ0yA> z#;ReW*Yy*-<55fJPKr1l_iK>Q&UoQ(uW0tGM{w2Hf%=WG>(`OagWlU`H1EBk3%;#-;TZ2ASaz5BH&sMxZDGr%= z0rn8u{&d<4KSP^7{=4c6`)@42(zGa3St2$EGm7bC%_CUHb9zs0iLks%HkgJbGe;fe zvs7$e+hganEifXx=AASfYWF7ma}1UMjQ>w6Z7Zp-EaNlRwg2P<_UhUDrEQBnTA4%c z+~fH^{R);HAS9|7K9e3gJtQPEe}owyg;Q)yKwN4(5vJn+Ty#-rKBtVv+g!%sVXMOV znN(sB?8VsRk~(Oq7&>HhOJC7Iph&gH1b}$qCRHT?BH{RsRk-7o z>Z(m-(}o7=u0<9gy;Fo#O+V(5FXlQR%~`!4;mHdSzG@l`sl{yip=oKc@>3V>_F_tOA$Y7&vQ-Jn9hvHz@Yvj(^mLlw=+Lc$9! zqK;+zHS6b0m6e^CK4oKsqi$9!v(#=jdEN7V7_AVcx@l-pr13*`ouIYFwD@q{R9Zwm zPKT=6fb1f=^UgZ`zbBM{NyA6`84GaVpGbhJmK48prpKmtZAi0*u?aq z?d9Ci2`ArcO~wS+>ksu99C9%VSiQ=`jm^!M>f4`UsCubb)|F5>htw$D$ybtydxpVZ z2rOMwuLjG9P20O{bHlaEQ?l779$yxs#pPsvN{(>r$KT|q!1O;6_?)k`KFQ?d9+45Q zfRV9Z4f2^E)_vS~=htWOLf~dzJz?Z-ATTz5673&HkZVO!+8o9!* zuZQHW%-=#(QFvnB86w^lRy_{|hObOc6W5yt1v&h)@cnYH*i7o%a0T|Ca#O@}0J_Bw zZHg8PE0hcp5$ZoE5}&b8Iy*_XdIq~_z>#?oMkry9XcJ`F|6{kC}Q~9 zS>#!nCSEmWh1aT5CR(fC`18nxTaQ^x0I_v(xbnZs0ToZPZtHZEV4E7?MS>u5&T5SG zfvj?8UGb}vBjWad#OZU%65$JXSLrksE1Z#*PKV$lj1(k+#W+mN&dE!NjP#7Du0aUY z7`8uL4f``2h>H0~S2A<4ll5A|9Te@%EjW9fPkz zb|`4Qx293&16+v@9@6gkQy-4{&%Awi)%CF8qvOZB!JkC`JpA1W^(XWxEDcC1O9Wqt z{uGkq)}4w80RALZcH=Te$&efy>tfhx9+1iZ9f5qcBNR zW_9@%SZV9k^%oF`d*C5p9cw3N9vB|YrqRRcMI{UXB$j~agmB+9R#Q|7?4QNhL!>dg z!a*oAI~QNjRqjA5McY&tL=$@hhZ)Tbbk&vUf~HcqkIr(t?MADNMMlx=Sl{Vbb|1;D zz}?X{kQvE+n=(iw!N0!Ya?(PeN3q|(Q^Cz(4ocr$R5VWl#qb!d$&=XwcD!edCu5WM zK2VJwzR_T?gQ;V&%|xbA1rv0uuH?K7Fu)?6rx*YtD6_pX=@M;zVXP!MNd;}Ki>9Z& z8(6Vhc^^!>lVT0m^v?hnl9+q0?aFsQ_0-Q`Y5He@YmA zu_mOfBGopG6?vpSY%t90kR^C3&2H6W=~hcxRoJmZ-8IW6TUdh%0ljHSXSRIjT0J?& zDjAJs2M*0KM0s^m&ZyG5FVmHJZgjIDu&J>LpF@pyQEXrFYSmCiPnBFyNuG@$20oH^ z-;qplh2B?NG8_C$`BqM8UQxrhl1E*hsj94+o@w2_Gya-J*nHwM0f)~BUj+d)@rq$O6v$q21A4tm33DiggqVZ5B2&%VD_SX<@dPX7>A9U0{LeBdmP4Gc5W7 zKBr8eg${cO* zpKQ8`mB>NwPjtNVjxMKL1)SKnIGvV9J&c$snm>Q7w~=_dc6>N@$Y}-5Vx1`3FKCYRf9kv4(!1K?O24;m-MU*gzNNQp%eg@(|v;mce}7gQi8k?JV~sS(Jzk|MS? z94f({oI(a>A6oI=Fq(zsdQ33z_2N@=3tW))6A{M)jm~LQHc=vEseYw#$G|F?tAykx zakpIjdZXS$vP#Nb;o7FB2Evh8*u#d{l=@*>bxEBeWT52{qcFWal0-h^d*J?(;9`#8EDK^KIoUUliMe0t z&y5v)wYrePC8HQvv^kb<5l^~jfLeco{O6C;Q{Z^=pm*g%t&laf3O^sveW0{xt5lbx zphbP`V?*O1qq2DK-iO=JJ{_`d;t6lW4Hgu~x2|v>b)-~H3NYJ{qrYYV*v0l2YV(^f z{Pr~Nle3Ml)S)Q#h570i%0m{E#a~xujB68z&;I`P`_Y)TnoL?n_1C_vxfb%zK`UI|0V3Qf``WAs-!MQ=-`%?ajW# zIA>H2fC3NZ$NT1*=E9y}4!)dAkf*PJj*;JRtFJE7Rxr=n9AT6e8??d%79h^w)e5-X(POHp)fjuGg;YcFvr z$TIbe6;u1!w_Qv4zB}oac~ZQ<0bqO_tBZN-OWr5SuSCi0l2kOPYn(_=BD)d4%_(mH z?DuQkv_!__WM!C9q>s;EgQ+sRbTY9wLEw1=2 zgcK?J%00ZjSY$AfR|i^3H{VGfEAT$xh$3&y%FxmEv-C@GA6=}q*H~eMwDRBV?crZZ z>^!xieA8lU=iNC`b1{qv?aQL7*M~z=M&)WAr#)DOk`T^HbT$C50Za9V4>7Ega@dDs z#uim?+`DIC?Eh%@quG5!n`DYL=6aSll=~@u6v+6kJ-HHmH?eE`;XUJ6JdbOyb9SLR z?YCvlolTbd9yg;P`+{~+yNuOPl_XVWUselW)?h{XV~oz=<-febES~15mD!?1eLhdg zEG21_6u`ma*F4-)TqKS>R3-Yf)$jh`*DJc5F8HSmNUooZpWoRUB?A9yjO!WbzI_fE z%v9Smx7WMioRZwiLe$&xfcw!|uR?T;6RCb$3VP(8|!DpFQ6h zPU{CY=188f8q6}851AY1DBEQ%&b@dmMxuI;zm}e>cP&iA(&nkIIf5lVOw*L;+D*)9wml!p*gJz}RB^@mb@(Z-qcI}T3E8VwgaG8<%atM<~g6)?V0_3Urp< zH@+*~(KU?r6&VnhKc2C7@)xskO|tyWCA^EwpzO=JWFar@SIYJSt_^~zg13(ce$&CB z!wV}LvSbZv4Na3bASroo_PFWLEuf;LS78Dm{rflSd+eqxjPFvSo)#}D^p)c3lI*8l z8Sd+S)ejw8U%xPhN08qkk8p1jAk723-k!mKNJz; U7vQ0OAV$Q_#>SGr+ZNFNe^<(0N&o-= diff --git a/Docs/MySQL-logos/mysql_anim-05.gif b/Docs/MySQL-logos/mysql_anim-05.gif deleted file mode 100644 index 46f288ef71d36c46cf9569bc8741e1f408f6d596..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22962 zcmbq)S5#Bm`|VCIBmn}1j-eL;LlqD`p?9SB5_(5^6Eq1e^xj+OML-Zium%tWMMOG? z3L=Uf6%jppxc(mQ|JIj#?t0lzYd!2S<{Wd*Z+=E5h8mh)zJM|?0Q~2KxcJo8bkO3{ zpEq72Ny<*p^FD39%<&2<%`3Tm{qC#bJJzT58xt~H1Ea6C_lO>`SsK{c>giY+C@Yd6 zpg;FTe?Xz=KVSL(JocYw0q7COl*y%A8t)$7IHJhp`v%nqcJ+q7yB#6_C?@QAf+7Jn zzI#nXeDk;)CdXj>@gc|u1Qs1B6u``y=r;PQH`MDgbrPI}8Qp20og$upe7hv0bX+h2 zTFJ$*eGWH68e;6j(O`789n=wo2b-8BD(jvJ779C;V+ThjU{k`u5O5X(Q47V@18_Gc zHc7G^htcLraYK5f3ZYEcQCZm&>>ennTMMHtyTdIHH&oiymgt49rUmjb*%{ve^Pyz0Fh#$ZJffyd8LJ9v#fc$GJ{Uz=%^};oqk~5TrD+8{^MUNsLlFRmS#k zxhly+EqmMgGLp>c+l->Pgz}m0W66!x_FdrCxm{ueAW03%_>FWn51*042YsapX$Y7V z!H62GI+TZu$9)%6#UBBGRSp@uXjdtldyy0_^2#1rK--((}J!ppV8PG%!=ta}N4iMYu_* z7m+B4y{mjzMg%)aE}#=DQ3dTh8(i8*=TPq_vKrm*+HGAD_i6-qruhGw0H(Gr%eNftzL#^UbEHPm^WmWsTYx&{g!%rMr(Xd=b__ zUCdYJD6ce<&+R=tluS=2+)fN5PmfX^C2_)XfnP^AvJ^%m6$BWCBBW9MTN5wr#x|@^ zJQx+=lp8hdG(sjo?>>@tPz8f)yEBX|cqCSDCWS`W=>irZf_rk`i}bgZgK`5;3%&Pz ze`)J_(@PgrjYuf!kf&=?L4)8i=~_S`Cw}DYk-t$sFoR2C^$g58rPLcXbFw|YcWdxw zAi~et{iMGLQ}&0?2FBA)7=2wjbY0PENs0$a4o4Aax2`1q{faqC1%HZo>a7eoHjDpr z)a5KVx(QOHKcys&Wy*|7839(B)4L{srba1pdfw@)-90Ge%sSgTOR$c8Ut39{GIZxo z(^NjOaN6)W(2!a>-xN^(^+8952`@XehcrJA|FX;gp1M( z+sI=V?o0AnR|#E%u4?tcRC|@962Uz;UBcGVz}!2B%~F}rTMho#)E$0g$kig|8ebhYME7yeY7-9Z!Gvh6dX1mWIbx8EklrEP0G8N9?EC6!1tN zZ+-txTycxOWuLPzJUshA6;{ATXkUdd z9u6+nLG-r70S?cOZ~BQ{YGQ?iSzn}nu9al_3%Ky(gQxDC_nicS1w14c3aH6k?7lq; zh1M4VtF(O4i&Ongu&?e0F2Rpr6n}^w3~0>*R11alpJ4ZDsR`X%xo5uK-QNJD2CtA+ z&(V|t6^pJkc8=q}#qQ;hM6`f1XA!GrnRqE6)3y8sy^Kp6hP+?NE8%ih4A6cpBVX0# zAJ8@Nd$+vY)tOKaJZ25RKznHjJD^6CI(GR#2ng@Q|VV6KSnUsW@@ zZQzLWQLtaPe_r7mh}8b`Md4#vWYSlc_`Q?l; zP8D~O)2I_b&^?> z^>C5G*Z|kKG&~fMYuO1 z>A%Wb)14D{1z*%nYdeQKAJC7Akb+OuhnCQ*fSQB`V>TAe@=HVt?_S?;{&| zXX7JX&Ed9?Y+VO-WJ|6TvWz{79coo8s{%60LPd#DSD3sA8s`U-tp&Vqon-=4z^QWJ z%?$LEwZW-E+ctAJ2yQ;ZPesz593XpoGP>*yHSZ3z8E@tJT+GnjHmZ9p)(pt2P>6$A zAwLAN;7ra_vnB)1zj|pDCiUrN4Z7MRbn|oDw5(e6ZB8GRX?mBY_11lxfp@b#D5-Y5 z=*YW=V;Lvvog;F#m2Y$Vh2w&xmBTO8^)W1jzkT;|7Eg(In|3#VS`9JZF4bnSu2>eV z@q`OdTfa*zF;h2^r%>PFpS;@~9x}eGct!~i|0B2XeGB^GC7Z~PjLS2i;q+1CBehs& zT+wN7?hHrBS%qDU*=uvL0@(Ntcim~ti9r!>o{^bP*Lb@1FE{zCw-r^go#fM<5jck6;zKVLCFLchG)0w=@Army<884K4CSZ3)b z{HX8^-iwfSvNZt9jE2Mc?@@w~87+kwnkZF&aM;YU5#*xx=FX`*jX&JL&Z7fmg?*B; zI;71i>(z*M4<|&O?JL4V{N}P$l#Oy6@b{x56egC$&78K8xF5c0b;0`x&D%vSmm89C=YB zxJ(@bbqfaHx+>2b6T_i4#bs4#MKwnPakTvJx}hBdTojm7CnOEs!3A?vwL1xa|B{}6 zt5!=9xNXm^%CDJO_=&M)_*xePA`zqDO26ZWQ0@M;)j}tKX7*t~zGYYEBkt9ZixS84 zT2@p357B+NU1&6`3;lnmg5FQ0R3c2IhegrIM;ekebU5m9qMhVcZ*<1Qi=f@4vf?qq z{n9AD4C&D)26lXi4+#&|HR!ZNamp)>tHH5wKNupC8WR!|7wGDWgR3HqtVJ(I(qhX1 z_Q*`yMYlLy100LRNE;T`a0R&~9|L7Fay-m3t}>}{?on)QZBj6rksl`C9cyk+z__tx z3WpCVEz04)8>DGsEDpn zsw|aY)gGCeXN%gJ?%IJOL zgpfCj_SAPXiCneZ?ryAM_{jwfuCID?^YZ<(w=n6mc`(qeqkpI^jw()jE|}csa+x7t z;n}?&JVNcGpzYbSDb4Cfqtr*niQfc{T=ThyGvaxmRzk5aG_5v5P#BJN@f)JlCn1No z+KNMOYhPhe>U7%iCp)l!Lo{W}pQtrty;chc!F~<>wEilqyA#Z0UZiY|28`{Q z0s*01uf9maVBDA1g1}Mb3T7GC360%SaLOJW!}s?B;Ac!y@OlBBQ_hZsQ=i{U;CEEH zhuL@9b|h#SShC^0uPI;mR2PCbgKu)G-j_jee1*d{d7T^)F$ZHa3YHu(V6(4>Dr_*B z!&fzC?c}>lBCE%N4TTnqI-V3emhUrv?#Jr?7ytbqDmbI}uc#pT(-9efY*C<|>A>Sr zeNt{I%Ug%UonJ?fJ3mMyWXd*bi3n!n$73QVz0p|uYG_BiWPzTBo5)w;0GO984vP%u z0i{O!+T*yglS1s^KDM#u!6APL!0H613|ipq0wfjN#n@xrDIK{f0adBZb+~x3rsg)T zsM2A)9%e+>jt$!vT{eRSId+`yid`JQv4=qGYBR-cyv+?9F>BZWy{P6<{2kl-UG|Hw zpoxzkEN$UF1k}|bL8i0s-^Ml8T~Ds=;C@@G&`@sjsqHjtkz96Ki3^q??oHunw*()} zSO^5|=+ZKNRGR752~#|uql+{Ua)x<*e-pZ@c< zcpv5EZu$VBP0Bp$>fa*@yHa%S+iu>bggG&$;R8#t2y6Sv^wr|- zVsklp)Y7;w>%BW-je{zm%-7Ec<859J0#-o2=l$`%4Qh>KwX7HLT z>ttaICc+SvAWI5~Tt4<&+_QjpzEaA=N+8}pQcqyzNz#W~73A_-{=L>z-i*(z?9~MS z-GDl7y~S!2vb`yL0!wWH8@J+ou6h8O%@ziMj z#GtHfD`rOXSk#rLIY5`Rcpm+E<3ZWa4Vh!yt$#Tc1m>U7&l3J za91{)K2%hlD3ZzD9k_>ffnI}QOjZTyR~hdkJ`V85zyExXm?{5dN}?k4%d|{;_m}(f z*WQ15K#Ko2I=%PPA4Ia45ytXw(Zy66g~E3h1|Op&a8$0Ok8V-8(K#gAyJX8IS`0vo zAl@&&>ve%crPEGv#cD2N{NYc%y+G-Do*LI2n%Pg2G?d}G*?##UC&XxaI+X2Z)EX! zS>i=k=#bYsHazTlgO@9+?q(yJjoqDhuBIZKIbZL+k9$>m*$Zthm$iM@52UVCwh`eq z?q3InAgP-8@)N9dpn9JN`aNe&(>>{E#$L-f%Y?2#<>0&PKT#wCXX8u`M)WT^4#z-z{`nM=;N?R*ewD+GE%l_|`PmiLyHG!33dLBuC{#I5Y2z(oKj~IJcwhX+sXsiN%t8)}m3&N17U@(#? zn!!>bt%CoU+3-aGZ0v8tuY@WWa3{HG%HHU{1z+o zx)wqq0VP3wGz?fB%|R_T5ALiiGAW<-s`doSzRDNAy|$HpN~`@zO*XW%q+ryY%t;`=NIq zZ|qGTzl{7h;ne>Ck-+hEiPT68Phom%vlmjI6PZcdBg)@qgA9yVn_^v4mj#!*gf|a; z9+SCC(#e$R1kT3Q|TTow{e$;NiN zqYK!&vBks^erq$pG&>7x4RUUvW#Eud!~}xk){Mktx%5IiAKRhb3Zi2xga*q8ug!#K zG^cvOC#R;<$DAf77ulOJ&Q9Zb=<9Gh6nlZ2+p6E^sMs$puk2J3dkGo|tdDD_AgCBG zuRiM2{uC5u#^>PS0|+eksD*#ksMr?_1u5E@uE=v%#$Z{2)juZc=^5_NPDe!8m}%$m zK40p;%b5dqm@{o1bG*_rSxUes^SAbv@`5>=PuEDZj}E{w536!JEX}Fe1f{N=dzc(v z2kB-M5Q6uid+_FGY-ycqIPPTDDO>2cw3G@zIq~+TtbCCOvzv&1H*rtq(m1k(wzRTO zt7pTV|NL-dQ{pxpaq!R<5pZnvD!cNR+7$}BOI+`}_s)jrL6bn|D>}~}nHsqr-{@f6 zLl*a}zx~|LGIpfv`h&}ncg$FI2UqTX7-A<+XX;#rc0LDHl#_w@?|Xk4J(R6J?p+MJ zde^S*;gXS@?ty?84p_l;<+6X9M!o>?VfAbcCN78Rv)T} zfF)2Iz^NmP1e+6sN+ha5gd~Y7vXd3ZqJjVo*7?bY8m!zQx4Es1ufHjm2!P0N9814XBLOBdpAEz=aLw;{oDdgdKB`9FKin?o)mob^ zb3O19src)KrVk2J7$lWt-n-%v8K3ukyP&^HhE?}b!89Q8gAD6wtxLFOR)IsM6*&@o z$beOtOo5+T<^^A4V>~L!`e%N>mNZwQ$FT3({Smtt$qEZ0f>aeK2{5oNj zd_D)PnI)CucA%4iPT@H9VQ|&|(ubjq{{uwfL;oMp>9eBnrE6u3Q;71&e0rMGpUIJv z9uOp^TnWGD6RANFHk0yt=#kc{_7;BTA@}3AYEH>kM3x0RJv9}HQ4hlLdN?KoB4gsA zUNk>MxEZ@&f)_R|4F$q7%&oaisg{1>=KxPHTm}wRed)X(6;}^tM}hBv8?#0J*vfHR z(0L>mtPeFnKii4}UF<`GFrb0*^KkTt+3nkRUN%h#c1*P|W&+5dR(J$t?emxOwSE2T z%P2Od&s-}^N*@%-<#PVs7LUO3h}-g-ad`{Ha2xc?ntdXM5K?+{=%*5ux2}`|6O?ev zB2gdUxTMRqT5<(ijlM*b2UDm7)xeD2z8BM9E6oc6R%67viY3QDC)5IKdGX~YB~BcD z(*Z;edY4x&v~S;czQxA*a)LWirk+-6iO|l=_7Wbx_-eGbt{2HE14}MTn0&Cs=h!V5agX@);BNM*+%6KZ>$b|2h22m_V5(9 z9{TErulpwxju7|y^Rb?Hv`48fetiKAw_R$eD?b&~YmUq=!DP^Gti2|p9iPzVv!tgV zzL4c*->lS~#%)wQjeQIwxdSLZWq=y}(9kssA#s=Gi%pZxL^KOutB+^P{!)IyD&4=p zyO9`In6ePIzyh8`AY04~BPxXADtg-H6GbY;sXi(PV{VbrUS5C3p2`t?F-F0!y<$DY zGQ^7=h9&A~Wj_eI0D`lU#}3{Gt#iYKR@G)SYP{wxJQkeV9`)m?R9)zkter;9oKAf( zM0hp}R-ibzN=+B}IK5+w;ue@`G`=oD1`M>n%T{M6b!@ny$SAtEzSPOr1urZJ?Oj$p zN{$yO^y?4RQ7r4g%Z#XdOh1uoE9XlG679i^iV{)o_LvxBHt%EK)}(9xLYZ5&fxpr2 zJN4qbciB3nDsS-F&FiFhyFs{tfCMW-BNq6Pvi@=CwHl&V^KTJrP_@i%&hhIobHNix z81=m16|f^YEmVIM@HTsC$=W%wn@={FaI@<>r)7JS?|)H*_vF9MsIG*5eW>xe_TMEp z$rpJsaQfC)C80ElQ3{a|iyQy)Swn~;!^F!KNdo8hZC^|0;V>}*imYT<#;tD8u1aE& zJR~h?4L%h6xxgs93@`(PRc8x=@w$e1!Et&7n6Zr=8j%-|q(jm!pjzA7KoCn6Q!gHj zO?3SQZcsxf%>iKw4?{(kwnN%O5|fZ+g#OY?L*}<=wKq&G`-62l!SnUE?0Rt6_AyM3 zNM$fz)kW@pvt4`w=*uvwE*@7Ig!FI+jVyeGIzy!MSE)wAEu;a~rbns~Y<=Vb7_j09 z{Rh8S9doXM7e0OjbqZSA95sYs$9T*OgUjFn-uKO|WZ*h?B|nUD$QEvj31*cQrr3T} zDkFw(u3MWro07rpXJIX9RwL{5nNkU+7r1v+Sze>r3bsdnga6B8S#@}wwOs)Mo40Lg zoNNW@Cw#slbV*0J;gtTWiyoEoVFNhX&X-^n%({2tLAjRYDPn-vWn9%OgMA{WCx*10 zY-^k~?KY-q9cNBr^>62RzEp%=`;=oCKgG%mCvJwnerU<*J#6ykS)HFrD^xQ1$s?B? zzSlg8=)&pCP$%vog^ZDK(`V}&j1z;R3lxf@E2q?ZqM}dV&)bLNU2SaAuoR@#+VNwf z0QgXiW8x_ObR>vw@5$-U7lgACrTVX>1=?A)r~ zR;f7nM1sEYJqb%4ne2;L8>dGg!kIqS1@`+YWQYf&g)KjCdK}>RGUzWBlAQp1iEJ8l znvuB>11r-;|K#-v(Ni?p(*CDInaZ=>e;^S06+?MJviKsk@h1u$bW0OGLn8CZDoy%^ z{9|FHc+o(Awg~?PD)MWoywBBGBN#z9wn)z6vmKxRnd5d zY@VR2K$gFHx!l-1lA6r#rQY$YGN7m_J6JZKQH^TT?he!OXLg=BC@;1Gjcp;dr?r}2 zUA%kshoIR=xK4NV&2Y`Pt~(oy;O2rKNM4WO(g?KiKapsjLD`9PMhL{5qtjNbG5AeK zrx273x|y*WY+WRB7x3swA?SA7Sd_iH-bu3Gy1}rXgNwbesJT>7V9G(h!#J!ah#`MV zm6?gfY}oep@Q~#PyX}2n)!>Ct`a{AwZ?^-!F&qa%*lkE859wbUKD`1Zr!dokB-ZB} zOAc0zv-@9sMwv3KCFk3Uk;~0U$h(cT5Pm?kz+9D^+$YCVslWh8$BYlS#vd-IZ^W#G zeSezpy65||x6O>u;Il9lrLxBOa?(XP zjFH^5jAkoJ1SDg)n4{zL#4~$AFJmnZ5SSeep?PI`MSDA{f~??){Goy{q^U`!4+LFn zWZYnF!w&xA)v&6tEC(2&3|nCmONeJf2Ot&)enIE%Q5(P)A=uiq7fc;UDx9<0wH<`g zK=7`sK>+w7do2JjlqkWjbivDu0WsUCh3O<gXs!sJDV?8UzuFl1V?nBBOW&e|vs!H0Q(TZoM+!ftlh+BP@Dv$a(C1D)D z3#x$2yMmPi@WBs=AMnuvr+=DnvPJ4ZgutKLyjxA0^NaQrSaLYT}=XaOGb`c)9(^%=~-~#@xRCfO`xwMYrtAboI){sHs-FZ@nK8-g&F>< z>0b|a5Gn|-lF&OtksXir;9il4BaL?bv`RBn-wMq+r`fT#X_tFRg0=UBIfPuU@fzTZ?XEirA zLaFuKcuUbVpNm{$M#4A!=xGJ}7 zDa-HSyZg@mi`&;8W-NvbyM_98^8N4tE&_{M+dJ9r`lYnk(9>qa`;$D(&HnfuL3|lY zmuunt<*R9X;sv?`434Sp9fqqND{JI$MHr@V=!EXKx0O`JEt{D&Pp4Afxh;{of0O&`#xeA{Ef*y0;!|b%`j`B)_lBVZRE=V;jt_&# zcWTe{=gR{cfAGAjjsN)LH8WH3=Wa_y_|G>T?H>O|B+T;M{1`x+^d2UWE*NJOYJ_Tl zO`b=6PLSbd7;f{yxG_+06L1`Z${n>=;tQ0%2^Qy=QV081B?d-BIK#}aNC+5>K!Z^M z`UrD994=9bJ-O(jGzeM%hl4Xh&;`wGPN^!OfTChT6cUc@^Wj6b=tJ2v7)=584R;zq z;gyQ#p(!ccn3|z(Zn*x)_59@e%tbbA#*@YdEJPL-gDJt68C*&#CRPfE#=|?GkPzay+)mh>!jP{+^^ML*x)CY1k)Lp-ViQ@pU4k> z5WDBMuOA!i_}ym|+#T;x8yrGU;3)+>ilh$jLUqbj;)rh_s!-)QNBZuk8&BYU?V8wx z&Z45=tsoQ%C!4^^odUeTRc)l4OtJ=HEr1Ohe9R}k?B2;O#JCbk_-dby4w=x7hzLd zt43rbM|%3knLuaq-56(U4IWgUS|3V&sq)oh?dN2pyC<8z8L*4-U$-BPWKV$extbRh zJ_27(@O9^mjWlpqujgzR@;(FlI_+Im27sS0naoQ&^g$=YR)np|25c>z z{t;HXI%B5uqQHiDkyA5o+KaGp=P;Z^;RA&S(=@DXmRpQ$v&PWQF4Avu4X)lp^G2q< zOjDM-u)tGDJ>4wC681MvyjBA&C@h2Qigl-Q@}tvZCY}N>M$?yi^xkK*3!d8@dLX@G z==)OdpS%bk^||lP5UWFYyB3|LI&u2v6H8o(6BM zl@s1P0~>b@f*a6o^EiVHJ6RV?{^@7_E&3@{#oQF%L&51ai1nQn`h2V zu=}X8Bv}7!_apdTC+goxxwSJ2kRamE&he0#Q8U3je+tCX7>B4xyhabBpI;`75P$N4 z&b_gd*C_h}FUo8InGvg7Izp#oifChOmp&XkiMXfm{eKY&zjglA6i0?j0|%vBZ}NlE z@9FltX$a)8tR0CY-c{I(HHvu=W^#^=i*gK{ouMPcQrfx$vfmogP-a@g%7 z8Tb#GtqL&F>N-IDZc$n4uyi>0H5$ePrlLQ}uBv<`H*4~^D$K!lbf^FwN*mVaHq`>| zAm5v=FPXLZ@;QN3N8jT0@^S}F3eU0lSLl@d7WcSfIU+bWgl)9d5a6r;_6mVZ!z(y+M37Qcl+JB?W6RdDu^z|#+-cOkVV z4j_oRuOpxDy2baqs+WVVuDLrQm8f39_V$2fqC(?BU|s|Wrcy_AD&>hLHxf~%8j{xJ z4{xsN1EEeTMWhThPOh`c!U^}Ycq(6R@?0OW2NTki_~*{mTGLsq*3Ap=xt%!D- zi)6su#FjHC3V0K62?0$dr`}dz*7))F#$|a>QdG!b=Pw{*PDEp|JjqsY3V$)Yu9|NQl{gFH&;ej{0D&I<}d{h+>yfYjmHY{8lS=k)wwnOpK z?3sK>oSl1Ml2{9}u}V$MODHf3?Bsi2>}dXD_aq|9-ye>tj!qYN)n5eoTM571hPb_X z!wF!(%kVows@`4gK`hgy9O92d%!BOduG!kEL&?$=5xA$R><{0v9@1%M;_e&PWf`9*{%2e8UxjL# z(Z48D_kIepCglQ!Mx`X73|~CI%ts^}cuOZjwHGP9gYadEZ0Vb2s;rs7}2nq#v<}!i8 zZ7$i^Asw(J45fz3_gB4X$ayXp_L3K}1fDt&anHvu^+Y7CmK#$%-er0o!#1^8f=OXc zQ6La3p2%55VD4)*KV~ zy{LhVlcaTWe!#PAq#Dm&QO43$qaCK^9)Lll)2qHjb1%`-MVSy9x=JA$X6^|Er27-$ySGyp0KhPJHa98s=rRT>4NtZD<{I$el`Gcu##Ehk+ z8M}2Jp*O!UC&*KU1UTZ@C9MeLX5F=UNf#+|AbD^ZBS*w!Th=#)c7<;W12^|rIm<^8 zfk6Wjn`K2)M;cK&S5X`vg}&PVVb6exW8a>}r}K4v#)G98Cin~qy`9&58e2@GGD~kN z%z>-cc{B~iFIi4ab96$|-Ta+1pb;Z^P;ZSr4LxsB6o&)|TmpOXH09!;lcBCyive6C zlaIM&t96E>LPo52E6-kgslrmc&n5{!? ztIEQZ|I#qNrBIIEyZS)W$EFS|FjB*`yu;| zsdB@_(ZY9Vj~`i5K1aD~e9X3@$mBdT+|dxm#N~=Y?5UyMz_Ih7lV@7y&bd`4JwCzz z_p|dl4(cCN$zlAfMg7=wNN$M}7qMwq2&4}4|KxW6dml6AUk<1OM>R5-w9(_H;4z7@ zsb~(QNowHQ2$$K=^ z4`7~K_Xb~tM?|ipAf-4Fr1>0s*?`}%d1ya#j+`1l)WYG#AzjPs9*SqluI^SAs=|+~ zv4PwaRwh}O)&2LExrVR?T=kiS58>)e9v|S1{?;NU+zzh2OJtZmwAXet)P2`4#t<2J{T)h zwu%U0sceR#&GQim?pZ;lrAF|FT210^)Jr`!iH2`q-2#LeS7)}~hMwLK4J_v51j~Gb zeweB^bU$_W-Q~zpAfm1zM*oLNd1@?+EmP`EO_QDB=p(rJIo(Io9n5>jj!?~#L}t(q z1}u;?-v5f-qkx=hz{{gRcJSvoQwr0PcxYHli@mEhW{klf%nL|_IXGRorqg`Zpq+pC zX;{~y4G4nZRK-WTmjQKhQa=aaf%PLpZWj!_T8(pauhO=&^h_g>iH0ee4VrziR-58* z1EeS9_?1dtZS>s^JPb*0VG8(J@r#tjbhbW2^c2Ou(0g3P=izj-Zl^e_N`p$~UyvX6 z=SFN+ID>MRKue4hJd$tBKFt{VmNmUU#CT#O2dJmUc3!@b{b92A{KD^a>UO<70Vcsv zI4!fSt?;qT)c)YED6FzGrg|D=G*tAW3aaI8d+C}mw>+$_=$>mEese~ju)vAxYl)}tAfawDghqE-@$glQ&3 zWkxAEUv37-gG;CHeS0f|;8e;`Hkrl zd~HKVQ@ORf)pD14|a$|L`0-^}#^2z7>~)oJkb1mriKLJK70 zEY4($s3$PLq8^8#lGl~Sd%D;1QQ+b0RH8{L6kBeLT#7gqvtvG9_VH4E*Nt{M6dMudYCqmnrfNc!?}Ybd~~89xc3(_@bA@c`>}9+ zY>vu|;MfmuhxYYPhTXjEspx7Y@P2niNmzT8LGY`;rsxy?^kDTn1NhU_To5{$6^e+6 z{kp++O6P&YaHD*F6*<-?pI4gXB=44ZZ|(X@_$GlBpW3SUBZK!S8vLGz&CQQk$S$V9 zbGRJ5g_ZI&sy{t!aq;@v0mx?Qv4a)AP;7^*I)xv}4&ry#6ZWk&*fmjsY4ZUWu-OS# zNSGVr7%%juEg|D-(P}|f|1ZBKkiRI^krC$=#Rd{i)N=ug*@%HNRna8CQ&fz@15%4c z2}sEtG!=!glcrvttbebxm>u+6qsHiG5DU0?PK}QmfTIpRjRA+IaU0bpAMmTMmlBqR zk|yUf4MoLZ)X>{YojNV9WlPS|i-}dTC!Gv4r$N}beJY5(FPbdO{PHa@_==KJV5Uh? zM1Tt+SX`(>HL95ffH9+u5moeW9iA^$r8fFoBGjQC1+DK2+w)=i_JOxj2_e-(;qUBjnT}ZqUX#P!hHdc4I%NK3am2AF z3&_s4J7Ne;1FMP!-1eUI$c2*zqp1iuT=j5FiAb{KKLnl9D|Q-?oVpEl?zk*StmHqo z-xM^^MFp95e&hCG=v`9Bq9=Yf@7da@m`R$fwRbJjM2iK?cUqYrA8MRRJovRwVX?5C z41g`Cy_KT|2_`yqt9BM9bD$>bF5PVdKwb@^;*@J|EkJ0p=eJ=|RN1K4^t@b*X3UF; z+yxhm{hq)TIO z8Sx>76MivUNxItdIY_S>QLjw}!c$=f{OS8@#9GgPOqA;Z`A+K!npTkbdQ##5~!$mi2FeQ+S2` z*d)?3z`wiXer=E`rM*#-+sc;mZlsl z{la}Va`XB6#Kq7le^71Boe`d?{^UTjy$+)GlQ*K?7f$uv<_#33C4rJ1KhZB(0KrMy ze!K$GsACoMhDSpfG6;2bsC`zLDo`EyW-Ukugn6m4mo&CYyqd(be|~L5lqgItcZahDVkbNV z&ZL!F>D)--QJ8Ez_y87)T8zr^1*w7R|8E4m)H`FX+muxP3AL+(fo^-LJXo55GOp^Z9QN&-~COd zQlSuxV#N7Jl5~(T+I+;o;z_B-wdI#@)_FQ^x!8!zJegUeQCiS8m!z1~0oNt8{)6&5 zDo1ACi*OY4fcaP;SkV>o((U@YP4!`hN=gLbV7_jyN}YpAO^RLZJ56eOP_xF}mcc`O z)_F7f`C>ZPV$Q6c4)J{#J3ECVMJsgt2F!PZL`FY-dYvPp zpMP$b_F|d zGdpw5<`GXVD>S@lrBoM+#Pzq6tgxH=%ORg`9lpBs>GrRKcc1P62>Cr0lsB~RUoHIq zk6Pw3+8Ev(p+n%K0Zord#N3v9-ZzLGm|Rr6xd$KEiLGR;15e02^m_N-O1bW@CewWX zzUc``XaNHT3{^nXP((m5AkbwSS;4erO`cGnT}jW~!1i;= zW!jfN)-A4!#8eFuK4H*Tb$j-9GxWQZW+FG}W)>S#q&ck%z{OkV{yySQS*U^|zBI9d zYJ7$cC2Ykj>RY+8+scxD|GvlNvDV9WxI3%p{t^Nb(*Cw-i@N`HW}=KqOpW{2Crt&3J(UngF@9#w&I$P!y>Z4y*S{{J_0^hI z4KXlPD+)`b4n8Pp_T0C?2f+9BlTtj<*PxRip=kb>XLt89({$y1uREmM41`0Vs%cE) zyYqc70kGTeRRZaypJ!Z3Wask;9A$!Nca7rwG8`V|ye$+>H9P-iW2GaCmL6`VrjYTW zuYis97G@l}p~+OcTR2e@jxyXq-8SOUUa4~Sa7C^Hb8RUhb3>?jj(9}KJIlmSOabF7 z2Zs~QbcMWdP<2x!H#~fOIY;&i@=Y$`<$5FONZnQwgy^f$T=EW1%a*nX6j7_pg73Vn zB{BP}N>WUf{9~co;G3NHjM&;bs)?juY{_D2ZLH7BS#ha=8o)fRp-uALrT&$+cOBQi zy?u9CgxIsuIU*ah(KVrdapTH8=6`WYziE~$%UQ6M(ldVRFg+A<*Eh+5GW?s|pCn>EZ+a5~&#nkhouC`ZE>}o%-02tCEGyBDaGPfnz>& zXIpkx`FjcCbI}4FnoHV=l{aj^Yjm_Jzc}LQd-Weioqsk!8& z0*t5SXAfBMvc!9EhgXB`737%3!WsDUKCPc z;KbpzzqZ~(!QNU-Z{_&rfss*@Wkyr?kEEuvb`Di>a#z*nph+r3CU$`LdHf$@RyFa* z_`D%_mifV(M3xZYQVPKm!G-za3aH|T&_X){DkN&TP89n(PfwJHrcAJs%ewj=At>;^ zy!bU3P@oyI?(E?Ry*{!4%-spA@rYIcUIQA#LLNlsiN8vmqHUi8Bo$3j4Cg77yf~-& zW3@VQVW_{74+1nV-grU*kfkHy)mcc|+OG3X%s=L1 zZGr{LQ0FY8WgxP$zBFI9QG%Kbl3HBLqIJLTPHv}ZsyIb{Xw|5U_!a<4w~hd-e9--) z8L(>lb+uB%w=D%_KeZ0}@>%bab7-}}uqWEI{uO?c|7@53P6ZqV5$ux+_xHCif*?XVxbs3aa4zGO zfkZvI^Zi^OU1dRn+(O(QyFsDgF4+BcG)wW$Q_ne&nYQ1QIH58h!PS;)%CrU2!4EU- z`mj*LdB6{ZA^;2dFMR9eWC`xL;@@=P*!`i0voD|h`FXBIt!L<0OlIVPZT1%WM=^9X z+gAeemd}{uPE{(;1Gt6pM?r%AB4%J_y4M`=^RT5H5*}k%NmW)S5`FNs$c(5zOi@ZM zf1_nR0@roOwSbrAcO|GCp7J`)s!U@6A>E-NQu}qoip65R>8{9LhnK1Z<_RCEoNI!+ z&It+|SJ~;kl@nk(S^`aS^DPrDWx03-oHq1xKrvN)bZd7Bw%bNb@_cRSDJ1r~m2yzX zK#E)u$J*7e)O~TlC(y%D*3!EPO!s3Y2Dd$F35YZhscKzGl?OEO3#2SZCYl`!6@sT- zf^bGIv0)(Vw2&jjc=$*WC@y*rwqKXP{q~#Iu5|=^p~9uZ%#T!;vo~XG5EIOuYi;`p zo634S`ZJgrPL4sY@QEDiOnk_tYY?BLu%NN?KEXkjIL$%E*v)@`x;BSUyW2O1u?IIc zZ%bHee;koE`;Uym_}_MUWF1-mRP~LHcPgeTHQG#9gP)u)#wBgrs4rQZHA8P7KV$&k1Aj8wAqHvEs=hby>)Mr`)VR6CA zyP;THrIb_Jdl@BP*kzo0uS{U@o-@Bn7CCzxp-o&UF}9u(A5$Oa$z?6Hj5=guFWMM( zR`pk}(MF1_(Y=F_@U#z~HNax=V^%%!A{p?}C7ixzm7v$!<55|s{=(PQYRK-&q6sJ3 zVE@PLCS#HEck+-$PyVyIY-51ma9)gHBC%jX)yjd&tF~CXe;eLio_6Tq&7XO%xTGts z>V1d!`TS10V~Gv@&-(0vH|mqWA~9*cVKs-v#qGej01(I0Fho;J$2*(T_Ig5_>Wf>Ltne6^G~8F&U{rV z^c$zfu8H}|I?g9N0vkXd?8eX#9C7Y z##mHETyx0*7H`D(Md$obd)#KZGO-q=QY^fa&ip>4QQmd#E?NRUoWX8}L=1t@b04g< zB$~@C$^xEtYB7c?0Lt^AcG9x!223e%cFsTSlalGK%HY+YWK!pZAZAmCTvv???|yrA z>Qp|bW`r~Qtn=17KajFio5ue+*7b#MUxujcDt7*iRi$HoEXGW_?0~Q+8u9LjvfwZY2 za=gEVVsZ*B55ThV88}T83UOQp---_= zS;Me3=)^!YDid#o2M22d8xZD}PMNq~RcvUu)I)kk(+(4J(5mwqM3}q{@%Tn?bi8zy zfphW9%vOmPbM1O){Vl`wGk~*B-ISwi)5=USh#A)f5o0g{Vy0mA)z(wi@29G{WPxQ? z-~QQO8Zh3&%?Sd;Ti)HVlb6c_-xDB^nV|bO5$bXsHh|rTRYH}M!_esOWv$j?p@Uix zewZ>SMv>_FhSvlzlj>S@qd9qeKXvT0J4Z*~j7IO0+vr-w3;|Jg2c?V$+DvPplJK4- z<1@|Z2C_p2_$_R@Tf~{i5TiRA6$-iKdv!HL$m-P0u_p?wqrztHne(yXW9rA7^K~Vu zc1fC#oM7U)u)i@H#gtwY!S0%nGvd?@a&PM)X;@-vy5BzLyo(Lg`~ohX5wLS|TjIRI zHyx;CpTKSP+VhhQ9w--IDR6i8CxhhV`wlC?Jm#OuyS;beL&+@f7iKp&3(tOOsrH!X z>HWx>eFFSmqfZ4kyFOBlu}4^RI$N8H(71rj6)9-5KZ(+c-V{&6=?P&B<6zvX?fEMQ z3d@|%06kQBG*6cft;c$e69z-SBhOrS@j9L7ywzoee0@pE0dhVfyx6(XV^ua`N8*}g z?s$^O2L{APXDs6EY@p=hgU@9c z4zev|UoDC0U0tVXR5o+^4@W2TOp%b|@9ORa+mpHPOhG-O`h zUvzti_Q3N4bbw}h;9Va`#;5^s3ZlBZXYW?v)f?opHh_fP4A&4 zy>3JqKQcwz0v`girhkx=j%?1o8$sTf87kNsJZK6^*c?|@#hi7Ug9Q@)dKedDdYjrm z>gA621728vylSM|+9E*fPqo0JKi!?YJ(!BoyHo#Dej0csvnf0I`NP{W1Ct7X-Dc%R z4q*;I_~J1j?f2*Q;9Yy1KH0OL5_y!knX&gKSlu5slb@ycj^R@;(vh6jddn2)5Xik` z?wKsDS9(t~y&vjX?%&u)GLE!jCNN+f3sN0cp6Yi$E$&OzQ`6o(wl%f@2CqSA zF%_{MY;P^$ILZes^V{68e$jJt@D z(?>BURIMi_@ctAQ@sv@Y^0r|b_NYS9=1`6kzeI%XZniKv`z^!_MQt!f@{Rt}4GoU-&Kkud~0P z2$M~zz{6)li#)w*uI9zIOfOn0brF-T_DB;bK&V}z_enBh{kW%b@}fOnTPyp*0T(y?Idn6j{ghM=~*$T1CL<|(yz*i^pT z+Eb_97b{xIbT!cHV^Hz<5nG4l&>Gcv#cXv^2E_K0y05JA@W?JfErDF-9*!K>w*s9B zB(U~$OS!p{>k#+&U8CoYXVe{BE0Nj00i_m=$264TsAFptwJ{@=+oPTV>#f0Bw6};x ztJG7Oz`bpas#Bu3DD$S8#EWM8eTh=aQfUPDlAbS*cePEVwraqkCb`t7S%nmydVH9@ zG0;d|8w?Wq1>5jDtG+3r36<(`fsp$Sp|6zCBEbjP&eUfe*`<=cQk_zS70tRyl9zLH z>J~eBXOf+45Co<2*W|EsgPZB~d&G*%jp$@kPdZU1cc$ZBcaQwOop`PM5*t$hZt=s3uZm6gMXKw%!}4sog1HZ64n({yo*o4PV}Q*|0%2A@Lzlc)V?D*X5dv sja3cpNB~RA?!q?xl<&d2UR!_iICkWs)}zz^&%gNJ=Fs8oRhL8m1gHBj0ssI2 diff --git a/Docs/MySQL-logos/mysql_anim-06.gif b/Docs/MySQL-logos/mysql_anim-06.gif deleted file mode 100644 index 3dc283dbfb6d390a513815b0cb76592f92728a50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42606 zcmb@sd0di98!*hihzlqx;s&^cN`|;(Wd?{_Vu87(W?*KfX1G+;u>w@YEz#7-He6HF zLeq}g^5DLgmX(#2+GgvqvW|5+$B*;;-oL*0&-a=6-OSu`&s^IKbIn}Win)ZLo|I@UhY1Z@>iRg5? zTBN3HKmq8Qta%sFMM_Qj7n*4HzonALThY8}8hIiSkEf=KW;Nf`Y95cL6e$V+jwSq? z34~dtS_5E3t%0pUNuQma)c{p0)gsM6%?J@)E|-f$$`#EAk&;dasFj+onsz0RPG3}M zh*zWkg@)E-9$f=mPS-#o5C9q?RVtN0^e?MTthE7uElYLqz9Is8q8ekz6F#a3j|MQP0k*)QgLYN}hl~psO_PBA$l)74__* zN~IJCL;}%-Tqzd_s8p(EoQ89eQnaE0ED%g+FlokX5b-qFHIUU46BA0goUVZ*mvcBA zwR%Fp;mj&kbUIHY5U7-@#fb^EK%~+Trc|vc)r;y0jf^Igs#*EJsFVV^fG1FC>Kxwe zta@d3g~y|-HH>Ryt5z!IN)7iKp{tcDwFWg^(`RK-sS*j~8tK!i)Y*v%5r?N?h{xef zXb^}r^vZc65mhr8Xf%hz9B&`4WDrJ6&fa_DrqKu(|&G*cp%YnUP^c}gBnz@gH49G+aHq*Cd#8lWq) zixabp8o8=8utbD^nb%}Goz9^WsA`c0g{F&|N9RnaCqz8uidrLJ4Y?X|s~2Y%m2wpU zO_BkU698fb07RJisg&KB2m|}5Ays8>4%%w-S-+O5{(PKs!pu-h^co zwPv_v^OnXMM003!+?cZ2WBVn)D$-Czw^z)>Lrd4z8!Wz?bIgd?--zkO@X;|b9Q`Nw z-Pd~Am{>kVLA`@+yIQ5U4++LNl*_^oG+{5r<@2uANrLM!H9qexy@T_4`$o!;$`TJN z2|qaOa$ZMl`Nur{{*cuGRj`N6J%m>2Zf?8%<1gf5HZ$kx*ys7M*wwMBJS_h`y1;fg zXSnb0hJjM^yWFM*_a@|pax>Y9r?{HeMOv7mDs3>}?VZpy(KElA<1ZnaSiSO=1PAJu zdkz!T$`#Sz#01T?_DDv(1Tje%yFM*HX!Vz#f%8&ZeD2go#r4oP#h?8gLxZb_4@Zfq z=H6`9x4~7R;l-ot_LWshW50;eP=jbuC1*94QMFn3>Pt?)(?3rE!~57BDMak)^plxJ zo~+Cqcc;Y^q6yl^$=9xOT#Ph`4~GnIOW+tn#bGM_`-jE!!M@TLgqQk+)JOb*f`=@F zT)nA9v9Dp30@%-wo)8bZdXA;$=79L2rlx7ElxfQ<@4+nZ*W=#?tuU>aY~+?l~z&pP9EjDpo0yn%q{T1TZp& zc1toYTYMkhm;7OSF;Su*4DAp_w4j>U6VUUfhkW?`W}U*6K}!kQ&(~^e-o&7hv5;G6 zFoVnj?%;^_3>oTiXd~(Ki(m`a+(>Uk#mVA+|Op4qMgL^O?34P5Euv zl0H(Uap=T>_KG+_)I*v*?ogu5*Cal)+$!^TqJclAZ*Z$^lo)1E+qbe?mhsBX9z%@n z=pINaa@h?xuW&cCu}yYYoHe}BsB$-tSNy#FTWkNT!;i-+m|^`BHVJZSj)?>|LN94S z-D7QKT`@iQq34RtsJz9$RU!wTr?5F%e8<|w>(`xyyu4BKVl(F<;DU1FPiW|L=jBoI zpd)9{UL^3o*55kRx)e)}~T@OQ?p1>Hst+`nzC4C>+?PnW5Tdh?m7*I2<_o8nn zi%1uqQeGH*kI`n70t%lZdLnL7z3j?~vK^}W4D?$C#U=E@?x6zR5&2lM^d;2O(;1pnF%+x996l{{KW|1{C}l>a^?K?b$9 z$JaNr60kOZj(PC*{UUu_7hoSo3mFMZq+s?mdUbrOii3IX(`4x3rF58d&8WU zW^qrI7z?#J$2Q`1Rg?&1+%X}`;aB;ga<$U4XfCj4L`91#xHAF(s~2*!|GLgHX0)HV zfRLc|&K0lipS!xyj4Eqqc)3W|qb%icFua~=xIolnsV(Rdke0K#2ayfm=Me|5mGHOt!lYBB@**-yFgl+%UFC{msoLJAKFq_1n0CME%0(XJ?;{N+jl$#~iAm-8XmF2fsCs zb3EET>#ae0b2e2YPP$dQZL}aEpw` z_AdeFJvseZa9ZnMHV=d2&;mcz+;rqGV+$}0WvPzLPPEq3JB9l!yW?P+AbWu>zTYCx zVZS7q{uuJx(pqwA?4|97AH$pzt)&;t(Erc+?j(7eeQ*i-aYuwb_d!f(jm#h(mapoZ z{Ww`2=;UQDelRwYz4h5O^3#~w$8>sm%+b7gC`745S2}qaksm_qtmRIE z<2~QE9<|R>ySFiA0d_m1Z*=fe^>h0o!lu9Py&n8F+jkr=MPtCUum(|tQ+d1hzJ)q0 zW-uh6o)gBl8Jk)m^1jgK2-o6Asqt^N?lRzPK24o`5LkLsq+FeO7cmldJu2fQcj^8r zq|eRM)7^c2I=F(1iAE+UKt%C6<5u6wBL{2%J2|3LEAy?V*UB6Sp3Y9#M~AE(zj*fP z?rbc&^HE-j?kYJo+>zJbQL@HZg z?xm=E^|F93ld`i0cjRYTbl;zl!S{o5hmk=*4BZ#o9*977vr=7%90X!dXTjW7$0pVVbsZe=dJ~ zE~t3d8Sl@2*nJU|$o;n}<)=)O&At!UcUrF)K_iWa2B7%(;PxE_Q2$;cF@1tBH94=J zp0l45#VDh|J=|XJQ3VH|LKdnzcZiGj!H~z3r!c5(p)cpN4U^13rucN(7aWmn+um>0 zk99g>P`%y2#GuD0g2H%wqIR*J{M-$bes&ej#P>+&`h z>Izlo?KckU$fVsBmxSD|HgD)?B3HD!^B>u7W}oGwW>98DDH#W zGLTh=In|rl6%}mA?x4Wj<)Hja?xCa7Ecj>WNR^Q(lS;~|%ak-y#qHag{SD4^&MbuUay@Tk?=7Ok z92yTAuNO}2;nWxG_N)ZareFCLS6F7VG5OJT+1h0UFS}sr#cV1_KkTc-c$~M<19t-T zYck(Nqdl0xceFi4-W1fmlc*`aiK?4l6TS$nY4JXhw+uc?z#vyI1Hho|(zEiq)do6A z$F%G)zZ5T4V1Z^a$8c)PJ5#+`Na#h(uWis8$8N3b6LqVP)@LU6fOF%u-|0IR8zi|y z&KMmd;3H(+^dr5MM|=bx9V8>K3QXreqPp;JnIQaY^)R^&fG&vFv%((Pm@)%&yUCwC z@#VX&Jjf~&AY+_sBO)+vIT< zrsx?4?i<8DxJ4z$c9DNGQMLqD1>Y08h;tlg88y((Op_zM&&DR5&P9^s8K1CnNz1^o1@E`GpntpLnJzRHZnQMZjPh$%CX4T6%~ZB+urDB8Q<>Y= z@FZ6DtW5Zt;+x`^ZJ4-@zSXT4vpPOqIbK{*%2106H;mmTPDOEcy%xcKPko7|bY#0z z(c7i!9!H$1xyQQHp%PN!KDNv#6m}PEfDSwx7yr?RO1I#=%|R}s2amv8S>z=;9B~8U zr&ddR=NKJM^moUu#v1?Q{mtmk4wXL@VCNajG<#a6lCB+_)BSC^m!R7s^JUNLpIPoB zZ)wSM*8d+UE`VGag=`5eCWR?lT##2}m-yDx5PMKF;VR15^KhE$)tKgL-+c`(xLvo) zmCvsEo%`Je<6^zJ!oLjPUszJL8oWbjo&G-CVG)t6&%IbQRUi5KTP42VsLiu{#uLZeHlDsY=Val(K)c$nSvhr3`3;8`Yp#!x6NM@oN1#RkZ&7w7L zcf*M(RHW`sL7KPn3e~4zh&y%gedzuoi+%|tcft^@P@L_JN1cA_EB*z-{fUU@vzyF% zf?6WE(a*m+3RhBkAplg&NhS6VhD=U0$P=;56L*IdS=<5??je1MA=MYLiUTm9z24JC zJDggOUVc+mlJyC4z65#wLyT6~S*JOu#|%B?c@9B8l`r6?dk-BIDOo~ z-N7w3EtiRuhMiHvK9m!ut74_eQzbG(^{}<(Mi|BMFZVg7cpjIoPE+SZK-QxjgTAXr z4KKFLL9PFEsv_;#>kr8%l?Bs$Psff3yK_$1=jNIwd$`(~@&JOtP>W~AWCPX57#VqE z&58nv%K^OWb$x}bfw*M&KT$Jt1`xpy3rx=L_C=$<=~mYu7n7w(0`_y|8$;)k z2Bhp<=zKW#)PsWEDW_(EDSBkiuZX0QPVZKgXFkayO|`U)7u4-afH>Vj~p0GjFob#!L5xo_+0eGk&K*Om@rC>oaQss7o=}=N5mb+zb;u7Ma zEn&%-&M!fjq0-RDRzfRC>cc;O^!R*g+4k{pDi2(;FuL(W@__4A$*z8eAoA(Opg8_a@ zrJT-My~`g?3V%)00mb6JX&~jN|s2F{_`P?qACiCx2J;2%1d0_ISVzSKCFM-&(! zIZT{*N65Lici2Q&AJX@l10PvpVED7r$BVO>adfbSy+Jwh9|GKp%ErVl_d1roM7zLlMO#Wn-TY}dG8R(!p2mFF#KV7?D_b@1_J*VwU06V^ zfBe{Os8(N{pQ|+m&OCYl;vJ(fHwWgW{Ben6}8}eR~_4y6&9v@D$bOHlx%MlGlGwz1h(a7q~Z4V=MT+hBg5|Pk@ zE8bk@^a3@;tF1tlBPk_g`aAenjjPsJrLMluzp-3Q6;CMHt)hs@giHB1cLqiT3!(D3dJT}zCxei&)$v&=X-iNsk=>-3g8g!OwBtZ$#Jo!(q^uq?wlk6U_gv3i2W=Yyv+$pQxAp||FoII~w zUou=w3i(<;$Z`fy3|_i%+(1ZcsUj!`Pm=GMGn2?0lNs%^-HxKM;(Ws)0Bkq}Jjm-_fBbESu)$F05LY5Pb-)EVpBDNSl_xYTI zN%%msF;H}T9^4t3fod`o|8jdsfH>Iak+aa6vsk)ISEz&K%f^0JGh^a}`KgzWGaWn* z&q0kh%0O!nW`E%@4zcxJ1}dvJLEhJ4Yqgj*|EV36{{AfV`gWUzTS-3H{BM=H#EsOL z2S%f^))V9ih0|-ZQIOiVd(%!QxUIZt<*IJ=ZIS$3g|2wg>vBN{v!_oz-{^4TTqDs} zs(-aO|M%A>{LR*Dj`If0%I&UwkKojpA}!3c_Vx2JngZa2gNuK+cJ~~p@WXUC9D^c@ zqUi37skTemYx)b^Qmy~A7_EvuE^JxuYelp+u8EM{&FtpZq}~^m&%Fw?8W{Q5Umkn4 zTT5U1`)?}2*(+&FiVI6lytFT-uPPafP4AC5B~i|g!mDO`x^#UIo4zS=9*57{B^c!< zF3;}Un;BvrT#c^|XZ}_s>YH1fAm49*uBpj1^;}R_e(!JE##Si9LKn)m%Cv}-@Enr| z*?Rx9bfe!lN}k~EH&of2Sf!ulb$O*j1b2?_-o25Ug=C}i!?lO>PjcYl+AUsohr5Fk zwg*_U(6B}zGx_%gMmLUVwl<5*3jY~kX;ImhDe69w4&dorSwtRmCGCiC$00O#QXhgK zrEVg`aB&vw%$rSi8x6T0{#v>VK#~~pzkAKSx4=WvPE-Xuy&OB>yq|y z8Gy3S1L66P6ehv!FWMMS(3uo5C4Zw!@<{WpmoZ=)72V+IZ>O(6euWB)>P9)FJ&$ja z_g|`s(Vuarcjw7qZgd9fQ?-r4wmr}r^2Qn2>D3LGL#=x}Co5hAK3kF@nKBGC&zW`k zu^8?V-@Q7zzQE42Wd-Heu}?^j$KEd(W)JX6aFZ?%Tz?YaG;ASPD$8#_U#4YMbI}X6 zcgL85<9q<4t#@eD)_|`5{e2|>S`lx&VNpPUUZ=X}C3shNZC89u&mY>WFr#;y82^uI zdXs#vB?$C}Ic<1Vr#TaKN+i{%a#V`qQskN0-fuGpx)NhS04HkSswrj7VHv&t)vWZ1 zrwC46S$w5mQkre|4=uR#=0|X(>=Nc0PvWg>a3&_UHqJx>eBT|=^gCx;v`MxKC*qfV ziW+>Ip@xe;jH0FWUX=OuNMBqC_CviXKsV*4HxpDEysHN)X*>}eMK}0$#MEuWpFq#p zd0oA3FFpIwtb6(|(QhN36CogJfUFo@+n-H$ckn5a1nt zdwY!FojSbo)+S-}j$?GLnIqT}hR&Y#Nc@MN>J3vSyV~C+?tpHXx6yS9k%$=m?T8of zq44kn_0@WX_Nm_57okGnG+|1x$M#sxr6T+^!S|L|5wZ13F9W2-nPrYyU&m;x0NcRt z4j_!%)KJUCFIE$>O6tAZZFWzrVGyhN9bO=5eG;Ig#p-HSu1mrX%~_#f z`(4HDwz{?BZ@2vR^PW<-z1}zQUC^1IQ}v<#^#6BnoW?rY81(}aQOvp=-eSG?eH6(p zY#M79bV*s_kcZtKv`eEzD{Zrf#Um)g8Q*+`0kYF*SZL#!`irt82q z|JJ@AT&!>E`Q+T5nn(Q!X*ZJWURNkhy&G5=k0FzfV;|+d=d2ihjI+C8c|G^X?dU^y zYW&L!B2!)r`Qg?TDLT4$q|96hZlDbMY`xf0e@mK!8GtG?pT*v?(;v+>DmA#18v2qsVEujjeD*PR z6l2m{nT_$rb}smV9JUS@k3h$~fwG;y-F;*L5dB(}gYOcoJ7aTTDP;f-be*pafBAc^v4Yy2MG5eSFjI5N_hz5q_N@e&6cD0*3|b!Xq~)9#BUJjN z`UoY(OFaI|6Gg3KyGju~}q9cy@DmgGXor*Q<8 zTKKvO`~1Mh<_Es!eZ+LX-Kj~vg08Q($iCQG8o#G2&xPGedOxtut}WpgX0-c46cuh8 zhqynYVKc3O78Ts>ZB>kp$#Lk__F`^Ha|v34H+F2;WzOJVJRow_kIgyi6WjwsI^N;u z9pz6s<;dCf+(*{Q1xNQeKE}_<2wfe$NWm8X7Ia$FC@JPuuX!e*0IOxxt~fPLxK z1#0Y&VPYu1&Ey%4>u?azGgC%-mK7NW#F1xrhQWI!E zY`#9XnXu*JZK)}T)da<36D4(+0}$H5EnN2e6X?(;T?xl5-`j5U=e5tGcxazpIeIQ{ zve$XUSnT-$Uc>TcL^OYlllE^fMqXDK-dKvw##BkoqvCxHJqa6~ zTf0-;nwmL%{A3=p!vjMp~KJ=hldEt(i+ufa&;@q@p2{fou zMn!uW-!!c?!B^^TPn|o;uFu?m4e93EO(Gsr*G^@$AnWdPQN`4X#r5HB7Nu#aNwPY< z%az$U*^Bc3eBEKq!mM<@-3vOkUZlC>4UADsd(GFX&f4#$7YP0CY9F7lo-SBKqIq6K z3a8pW*?%O4?1+!^yVzGU1ZnUFp~(mq0XvwzJ?aIX&(9*+i**^nq!{0q5;BdSBRBe} zPsYJaDJ}4TUkvk26a9E2Vx|TD* zoZ|YbhJS{2*LQ%>3*^VgJk*(Y(IZzs+hrA2-kgVPL%$ zEzoT%ynXt8%M50xS~mp%(6)IgG094SZtr92oS2nvco&}SW7clwy>u>paQ%Z(zLMxf zu5cQsBO3M+L#8@rZ2kZg>idw&JSUj85Re{s8Kl!nWl{c7f_xW1Vt%tO;FAbmodVPk z+9su3n$Tr>l;935_Ix|`5bWWO(>uiz?>8suK3i{fFuuc!(T79ss^Syo{cMagW;5Sw zWkF3m@Wx8@%&+rO!lHYhO%iTGxqa3jH8j&<1{iS}C-=#Hzxsy1dv5v91pLS3K z)H&$@VVVcDToe_-U(6Zd5Bh0ObD_sRG11L9$m{brFjPe7O#}vBwx2KW-|-?)pCI-{ zUIL5^Vjfv7ssV>>B=m#v#9>P=$mNq7WW-ws%W^`b&7EDS;)$Ts6Z@-I1-{)J`SbtQ zvk505kpIO^wlQkBwRZFrr3{@_HWYwS5Vr5Lf4y7R)U99MB5}JXGqZX&JKQ&{3SGTw z%ejJWk}Lv_ZZFGrvadQ}6ObCTkKfByRyO;1?jVjV5gc}s3TlFu4&*;YEh5~0a!)AM zTjed(l^E=aJm*_9J@q)QZ^3H&8NbkTi2OflsHy*u8}D5#sy!S%-E+79)by)Oq+4}C zYu~EM$i`+S$ZB%l8S?$|h}cNgX$mIq@^r#-x|w3%reDb+Q|-5nT3QE?9*bUK&;3P) z{S|wVix)QlvLWjnA9}Ew>y*nX( z;E_>z6uRHGo!+an_m#WEJmEHRdeACV#m`2bGQo_RDLTZ%hFut!?M#(RTo#_olZ^>- z#%#l|Y*x1xq42(2fdR;l&)jvg&kOI=I^1ox=jhn3GhuZd;L1?@_^?6fh3Vbi!X&!* zoYn!=91M{xoXa~FHb%^+v_Opfn46?d{uKPJ??Y7SP&mAhEBx%ct0nw1e*0op%Y93| z=!;Bo%M^cPl@^VgON!Ol?hYr!50cA@UVbq!Ez7E8;x3351`fC4YDq_ZlDMOcYw7WQ zQ2fA(Nj5$*yON-|9%bu$%5(eYA;);T`P+J%{Nl6XavkygW+#~Tb~{V|sf@?Y?#5{x zily@nm<6Y9h;1vik`xiYZ*q(=J=Hi=cP3(zm>*s6xB;J#@x=h?S?qKMf4~nvXKhc2 z99;GMusD|#*+%=IH{-YLYtxcJ%HNtKR}WCPODm;Xt;)IP-;;;PRuRU4RJ4`(_s{p* zHw`mqEklKK&01G;(fx)-y8;~c#cG>Y4!}OejI`1$AB^B@{BZ&s+pJ+90>^9I$IjmD zUG|t_iu@_mTo(`3f}1d%>&4+o*G$h#xk%IJU7s5;2gVqn+na8h2h?mz^0G5wuUT2& zG8P$*xr3kSsQw)v+ZUsCM6CTH?}a#uKSYzz`8g(*zips3yQ~!F55xA(H@qp1G9sI83u3eWx?L2=zOdM z?n)D~Y=UPI=}BnGZFII3S`!Cy1DwXfJ+Ev$$lP#tl(4KiZ;~~qg;mnC#VRkufbH4q z=Zm#Df^5@o^@Ho&B)SpxJ*(D=L2DH}<2x={ln>N`g-7DNrxOyB3C^v=;i_#z{xNIO zDTO|z)rLFRUN(WMkxflOI(2lgqb^9tGyMf1WTMALVYjj|jGSo!U#RkE^Ji&XYd8_^ zwV_hp9UtX|TISS|+X#7j!NJ(7MJS%f%?boCvB54jcz~1ky`v{jCWiMqx!{lt_a00w z!J0It@^_{5*2RXyOti()5F!LT!uB#$okA8dtMZ0F%-fAmAa*a&3`F#9LznJ;zxX*k zs1v+ivqs(rrkK?J;(s3#APx#9wRdf15oY9F`xcnB@C6^k9#tV#$T)5K!QT3N#Lag% zy$n%6umug5>laMaPhS8UUm>0dh)4f+n+L*RFgojFdyFYJVHU8vvV|Q$$OS6UBzO^g zXlM!!TF0_p_zYZ+*ky2w3c;e?5z(((zn)E^dKuDW4;{bLQUCb}gyB zEETakRdpf<0JhY<6j>7&L%^xw<~T8ICz@%%!LdNcWrbog(Bk(F7VQ$f=p_iNN1pDd zbvPmDDuBhbjNvoeazZDs=fndZ<1kb|^Ph^l+P~Ii8DYbrmNKukIKXA2u6p(J=y~*w z?FbLEGh6)xK;_epOy6*I(0Vh7cKX8n0aQ@rk$CYY%g$c&;$1GXU)e|g7zw}KT7Kq#6Z-OhR3CNM$XWkwgpvx2lN9W0AFgHG zguv~_Ve~U1Hd*@{M&li{@jglMCW;GAH~aH@rgCW)BRG`+WlKysd9p4>d|8F;(-P_b z9-sa<**B>~%lp8)sO8wV_o~UEO^VjUzS2|V=xG&xFt2PoKP}%n?fwHKO1-m)06y?(gZ%FL8{d< zCLU!t{i+M$6$S70Cj2n@oMWgceHe)&^||>vhO!twCC#S?&K9&+4bbH&wHGDJMLP^e|Dun4RX4=S$TzyKYZ=Peu-#n-K$Px9Y!aWA4^(T z11xMa>H9E5tt@&cL^%+g-fe9eBA`!IKf$WBkGH zjb50)HYL^rpw?0m53V(Y6|+f&yY6nb;{bs8F{%g6?2af_z5RvK&4s3j)WoZw%)n|+=~7dnfajuqeoVVjq;MEpuMNE497+OG$jyi9%X5rHw1C%`v?|COojNAY^b`rEY#=jax2yHFH1t=rV3-qB5uv?5s?zOZC z7V%iNx9ke`S5#u6WLbpIqMXDGLIuJwd(8wLPXE=SHL3Q})@A4z#n0(4Q#C=~=v<%R zIl#99nEx(O;fZJS=y~@(;`)fG05ih|;p~FBW2(jrBUX$vxGRv*}$5H|YwLD%#ng+IK0++ua4*koqHN|amxkI$Qv7fF4?76 zKE9B=>buc~JVUp%nR?tm-&f1X*N4bCt!K4m>t4|2v)n$daR#&t8xQ_9G&;fR4gGT^ zW#7A#Pu5va(|=UvM|S$BIeaWJ%nnrkC7xC}RaRX!Uc)sT>~kD5L_pKnQIlg{i@};h ziI-C*>p)o4Y~f*fNO=I|_^;2orcd1U2dw$*`_qmWhG@RnunrpA;Zsv(z`Evoj=!C> z!)eg4M#q^=2t%~8a)q-Ou^S8$3#Ij$ix;mpKVSicttq%MirZwaDJIU4f4DA zAmadL0tlPc0UBboThnsvOn#Q5Ou6+Ksn!J+P)Ygx;V={#_7WcJP*J(E_oAb!guD5I z)ZNntUXqxfL42Vl=TOoJh_DW^e+ip{?5`;biWsYfIdMZMKOgPc zNk|sN4dnrHpy~nC-;50_B74mjvL8p@-rQnYnvqkNX$i1D`I~qZ;EsJWG$VEz#l|>HKvV3 z^M?pg3i`MEVP0RvugZ7+BOZ))hUYqbDsMtoad7$w+g8ol@8rgvV%YVAWM?}A>C6q- z%)skHcLJFT99k#WzNKv}rOu(W&MZS0?`5^!9eSF}Io3|j${>uuEzzXSdOhK36YxOC z-=JD_5U597dp*e2;5IY$#uJWL-qLtmYQb7WJXON{qt?l3nP3JMufY||NWq!pa%QiN zyN@i;?+^S&nG#~7Kx$_c`OBw`$?Fw_jtK-hX(V&3Yuy zubN`dyWMhF(m{`kAOlfz*_R%T3vz`|4VSOAv$Wa9YlRlXf<15_gcnYM_HlJ{YC8^) zqvJH&CU3GJ!3At`1^_WH#kuXR$?J5bjMp%vr$K;ZFedmKS#G(fF_g zb}A`HXkoqd#+#n;`S2+(AinM)ldA^lnwb&&>=iuu+f98rGL0 zOK&tNTUNt0JAS*&YldVn)zNRB5!8QlfbM|J1!7gcIc$Ig^Pny6d($A?g?Q##!RyVo8IHt4 z%*RCV6rSi`JDYp*X8DGhxjNt7z)gQ0mR;0sv&~Twe9Ml&#bz;i868lMV?D)VTL zoi5uN8DrPDBr8)#_+5I+#x87DuI@h=!8-D3^5WJs!s>hXM|96Pg#I;^Yg2W1VpA-8 ztY!CIqo8Y;GVLj(I!<}vz&ly}*Wo8tYdH_JLD*N4=RvVU^zAn~N-G`Su&X*3W#f#< zEqPR(rG*}-Tkk9~81(UM+4{Pw4kw26%w<>m^_wJZb%yx=TxjYLPa#VFcy1Z>$Z7ax zPdV8KPIJg;-(q9<x?m?>z#9FC0Lp=^#hw?kuL0k?d~rGzPgAflX(xnmhwuqWFgNf-w;6%)2)QE#DB zdpFG#ya~icQ@l!drm@6Gq9t1YLdN@~`F?l3kb9?h!<@VxS#g8G0GG?02ZKWH5J*bT zh~kbJ+Ktej85x@m4VXRJ_j$++XB!kqDp(S2ad;*)$~NR?Fi(rDM|vQ{_h_b{-hO?O zHesAfOKGz@Uy_8e1vq;E@aXQ>OX%dXyAud0hblY4uyv3QVVv@A?hT z%s^xm?gOrgsieaHbX_uavbVA6@(5f@MO}gD?1>M09d-e5j22hi$`|&_<3TamDak^< zj98&@uOOmh!&y!e`nvNJF3ZU`uM!W6*cROv<8Nb(7-3=A^&|+FyO=`CNJvaWa=V3S4g?J-~^xE#k_#!;We4*(t*?VG00S3jt;0Tb3pVjf#Bi zcVo{ay}gZ3%zCIbSV47y6LM$Lod{v^An*ML$He}fFH2^6DH~_Oqr-?fWUUCNn+7dy zecL%2BaJQiYIu+e%-&Cyue1y#owAehC)XOy;r$!OA{7h^Kor%KM|dtDuAqWxKlx%@Xh z!W|IDQFn`Hz}54;GU^-ZJvQb{2S`R7J1#16fSelb8>;#$?q*~ucaK~%sYc75c{~x@ z8!vXJuEirQ)Fi7Y7oGV(y7g9m*@gia7x8l)t}`Ok-(ElzwyrcV{sb~pc+y1Popq%w z0Q+9J)tXefF=6Qe1dVu`~fs{3{FV}IMI&m5CxHy&>tW{mdGrmJdySW8 z!IX+2?Wko8`XCN+sVN2e2j7eI3DcjUlJ+=IK{`>gt$GX2j;`e&%?kYF=IP4eNlXy+ zP@gX;d(t;tDMsQ{FyekHVuL=jyhjsFS0OHpJL`ozP0ysgoCX^SbCB`*2+JdjVheY4 z_Ia;Lo#%ZLhnmd>_dke#J@bRRh*Cp(I6lNqfukpctGE{1L#!9;f}hO-QqEeTc;Xdt z0wsAzdOXYhhdlQWbAJ*}xJ_^Bm46aQa_-UyMC-;wS;)GpXVaBn3({Pp1!CaD{d5b< zaMc|z;UIomO(%YC*yzLYQjFKbV7FUx*%LrZbZsVeOoYl40juJAD|9uUzV$Lm$h$8V z#y$f%fl6Zalne+9eT7OCWS;V1zx3nt3%wB4&~|`GAC_WKUcRp;M-7Ehsari}K=`Kl zY}W-ICcRn9NaVMhyJ`4@#e6UR*?XY#c6v@gR1o1R@19Ew{w}Lz3H{Z@>v-^b#MSv- zxjk68qa&km0|ElRKLxUk;T3zSMoxQ;*W1@m+8ZgmwS^+M=plM;T45OD*FN>0ha`Gr|i+&?DxZ@_2pIH*(P{VcUeXZ3?HdngcW z8EX=fN$*wv>8;9I#h%lOT<*c${{P3g=l}1VGB*C!o0WwQt#(|@DaY-HF+^su4dz1f zyhj5|bIC3DJT2+jXJWeM8sxFYv=masI`dkXtB#nMvDO5F0wFIBKSWA8|CYUREo43`wWhj^guEk>g6gv(Bx6#J7 zhr%nj>$JIQJ&c1TeryX~6>4Yr#P)vs6#RJ(c$xNhn{_^?=(+m%_2$r$u{*wDTDDz; zuws(y@whvmBc?*0`jP=o?|`oc@W~qwA77be%KY!FP8(ZNgUz1r_Y?v4WnJu4go`KG zJN^Vk%-UiOWN5aoEPATQ@l)0z1D94pcBt#PiuVM#_LspqL?pU3oHFPQWD2@Jw;&Dv zTpb*MjXs;n!2%+P!R!kk4l=N0ZR=6PT!ay7U-TkH1=2`fp_D)F1wi;tE5GTNV&W;p|JS^A(0^ z8L1YgVM+kXar69(7x=5&G5zoXzPm40vHT!&e}wx82w(5C^qe0napfGtMYNPr_t@?R z1szq&BDAYq?rEGwB3_=&ru!=xjT2wUC7T`uwE8=DEQ$yBB|tjMh_}s+pa$IKYg_ap zmQ*KD>Cz>mOdfZDGs4bax}x1O(b@w=CyYX5KgSc3qsxw#ci)nhY66g5o1= z+tZW$Dc5mK*_r~C^4&V}hn|!2R-qV1cwm-_@~pxc^>5=&aZjC$?)w1iLHMQ$Y#&e{ zsHXEiQL)%oRb0JsrnwP<5Qd&VX(R2LgiFa(Cfu`Nu{(!)yj2oFDkEe!jHSm)@?Bp$ z6*8L%W8eKI6x5aOK6o+YcE9k03vJXKX$RD+aMnM_n9B3GWqDsWISD=(^mt@xok~T$ zNTtNiXFK4=ZtC!H$L4<@BPjO{Loauv_8Z1SW=MIOFqys$QNfeH8LAV-zPYfEZQj>H zJA(c++O&@!Psy8d8XO1%#K4JVCaK;7dv;6~xMnE3Ar-YfJ&6t{u&`562ZrW1V}`6X z3hQJD36V=C`+@4E-U#amIR2^WkJ)f(|pndZtO6~N!!>c0COR{ zl(<43LWM`or8;|ojkCNE7%6dm9(B$U;dGTH_s4ZCFc4lsFc~c|PN$nXQq@{UT3~d% zyLvy4sJ&+41k(THkXc-sm>+xb$U(C9L-vbooBxls_xx%)ZU1)DDyugc^zvz!DG?5S@UCSSO)Z2M`q%6%Z8_9YAy##~F6+ z{o89jYwz{!SI_+)eBXSp^SaLS_#EeVfR4(dp+WIh8b|Q4;frJ_=h&uDfITV>({JWJ zPyuFROfprKXQsz0pfg__P(sG@9s6S%W<1-FQvp*^AoP1ajifHXBIvAJL4Wcg`AzO>M znwwIbKK15m2z&ae9c1(loR;Kn!4;FgWNKV3ZIj9YianRR4yTUQqC|*yMA$8j%-9u7 zry|G6p#Q{JG|7zA#(!SWcD^&QyLt?R#bkr@pb*NNm|T`)D5P9}Hk zzdc)vYlm%IP8O?PEXgJ_-Nd5WKr+Fx?3SGM8nOaB#R{yB!{<6Dx6)jGTIPgFaboki z3$G2`T^%lgjm~ifj3a!`WamRnAb#)+oDjmrePqyFtJozQIb)%!hWF0L3GCLf(a zhd6GRkMGedC!p`v(nDvSc!zGfaZARcG}9w&ncua18xYW%1M01II``lSI_MucniNA& zLq@W-D$B+Dmn$pHPN>koa7z3XB!h3J3w9QET<~MR(c01pISAncXP&1jaa$l=^=6@N z>~5<}Da|Mh^D0Lkg%LHn&uo*aV3O}z86pOwF$I7*RoQc6Cfk|lCJE2jX{c8PonbQ6 z%U(qjqeA;rZb}TqQ8VB%!&aUheLsI12)66(GZMkIGBRb!H`q`ZDj@%JDhY0RS+u@$ zOSxcL*=N0wT=jJ1-KM*L;YX8;Zk&7X|K8=rUk@`L-nj6mTY1)h2@tHphB@GprUz1? zg$+A+a-6;$`QUpf&gn=qq&-j|4!9O1U!GVbYMFr#SGC+kdX`99GOAtrufTO}yY9)j zz0G^bxU87opvgc;TWQtF?1KVT@MHH79qC&io7*$`#wicUnV#;r&hlyFsZ()#p1$!Y-cv)Tt-p%96{UqwopftU z6%zA8&z)%gVBL>%TjD6{FmvqErR3P%>MlYvQ;t124&xAPHGk_~ zQsUV4P_j4!L}&-tr5BOOV?o9Y;y~?yVOk;rz!C4kdI|xEOClq=oUXntEHhc5UbedG zO$5l4Wx8Sof7oWNC9pRyVYS>BS4~XKKBOA+_mxB#4n7PqiI^)$Qd9mZ#vj9YVf0)N z+rd>G^=!SENG8LO;5kFqKxfXV2vx2s-B8P0UB?a6vO?2_Z8GDOLRrER#S0g_D)SF- zyNyNa?j~MM#NQC{(H=LKAaj-Nz~r5~gePZ(v?cjlmR|7OJ7H3~A)n{mIrqqevU?=t zHJ%gH7Kl@|&=F3P5%zwRgtj;Vx$}JYz|PZxk3#B@u_O_{n>q2&NKHLaoG9(&_GbXH zq67%yP;{J;0et0LuJ8g_LCTmufp&_G3-I9{?TpUVb+ZUCCltig4Vh&yZydC86U)nW z1*gdd+DSpRYTZL)mmIrQh;hX@r*r&~PVfBjn~9N8D{bU&4-$KzwMig=-Xg85$2Rw| znme`z5IwL{J0Txt6qcS=cwN-9{^-$$+USYq+~;?c5Z%?WM~*5a<2ce|v=c=}xD0ZA za07~oN9_sgn{ur}%;S1=BA)~4HiDEK0;$U}u+XVWeweA;`*+=tYd>x0{LV9>q!+d} zIYSWb&S~x;=CMY*6kOszeXV%ni-@(?<`E1p3pXA?D0Ql#t1bjf$}XE+QJOauHN^3% zB}Vc4oK~4D>W=11ll}PT@e_~E5((E2Fvr%i4F_OtE{mR6lhWbKG!h*HRm^ z6s;eM#5B%Z+?Q}LiPSkHQAVF836-B=9?zTP|m1A5! z2g*`_jA2}9kP26MDu-G7C3v!hDfIyF13-OrWpFC|qt;Xh@?#j*1zT)d1!iFc1D~Of`TQ zSE|9|#;omUg|nODYJYvG0B@2l19N6)VcE_A*TmaO zjTIgt{XiGBTmc`jEI@ZG5}lHiAkX+&LWZ+K;+6-ao=YJ=h{KqUMQ<%!uU5K#l6kn_ zSjb^neM;m6EA!6t#9T?qY*@s1~G&=!Rqxu!)kj&v=P9piYX1njoNXp4{v zEv0}Vv0=24V2tksP>LSh(QU_8kEvD3pbg`1j4EZLBwVm?|FohdLd1TvG&b!g{=Y4_z-rfog(L(8`hqRZf4&q#S>{XyZHV=2}PM$dQB;-i&aj}{cb z%(#0r-Uj)TPS?>*he4389d;dLr9bHJ0o08mpLiSfH&Dz4Z&A^1agSi+;`VrfhEa3u zL&JL{67psA>PA*ZSM=kSLzD_@&X#6F*S>~ub{*3Uz58o!VWpL+u*uxWtgO;i>wu_tXYLTUF!DWjFm?lZgvMD?Fe^h}jwP2+%dv{Q+(3~hM;n>t50t>aF zXF*Rk+*TQ_QsXBfPfXZ|wwhnUgB&p0o2rOvCO4R>Qop&~{>6rnX`q61_wi*P{7_H| z9lwgxpLO+j#6882PNf<%{2ssa#Ez}SkPoU_xj|~of0U4I8JUV+;AZE5GP7VJ7=UvB zoH}4r8HYt~?VpzSC7f#o0j%9E>~nP`ltboZ_?R}gOif=a$D-q`m*mn}HA^(nmq;36 z=P|jsq?Se?=zPX1#s@E&Rut}NZ4VI;EF0HneW_0kwMXHNAD;~!CC}T#9SatN#fSaP zJv7Opf&Gnc<8kBc9psZ(C~A*JP@qvq(^06~8Nv89Lh*cbxy^Az8rmsirq}dQrGq9KVr86z?O7MtpkWse%Y+vh3;?>@+t)gy>-k8oJ?6NDvux~?T zBOa<z0k=<*E6c!_+n&%qTXfgoWRxGLGpCL*j#Qf@#6E zu%sE#4qvTS&=Z+K!U{3~U~a@ZMNW+fOmV+C#KMUI3NP2qhL1*FZ^Vs@h)7U0T$}Mv z3Y3uiW_;1i4$?XGIvy-Ds*x#se(R{^<~U@q)7t3;%;2VW{?w|E(%)a7qvh9Iy7^GV9iWau z8f{icwFSH9qD;cZ&63CH?u3<1B_&AP%CT_-=gw83SidsJ3S$KJgYw0CyL!z%bM&}F zvf_RD8MpYp!%Q>QPac1{HMiCCNF*fyt-l$IO7|ZFr_GY!FWEV4M1>ty3Isz-Dp4`x z3ZF%m&fe&*zsRL3T3`pP7Kz)aClL2C$@fvw=rL&r4 z*Si~qc0A0hK#=45cXF=P6vGCjg{4jgU^5o`%q4b^f`Vk8xpgu-2_XBY;NTru*45NA zonixf&IX&7{amwr)@F8!+7CB!wu|||A{0NB-gkcboyLvqPhBKa#b{^4eH*K9iD8MNwyz@C^C|R1C&G z;@m;Qm-hS(AtKn^KMymn)+0!tBwoO>lawX{&~#@*Z;@63MPkR{0$ zPs(~;Qj3*VVRFIYZO^i6>+3W*Sx`VcP*f|OF|3k-jh1BMmqC|#7n%DGksW-+Cmrl{ zkAiiNQ8_NoV3UWPkn5C51Tb$#n-iyW{psOys1*c$A)%%dP3d@?`rfCq_vC9aG#?+z zCN2#^EZ8s}sPS+U(Og)PI;P>UrlmQT1urGnn=+qh27}bV;Ku=~&gUDaG7iH`F9i`F zS8K3a1T*dg2m|!oEe*P%o?mFy+dKJ957ER6eFB5LZ6`ugp+N0bmy+1^9vDP*VP@{; z-d9O)_WP^GuR7Vg`E0P==1!$O1PIlp*TFLs@NKrWC^x+hpW_Gv7ek!b;j$IskTcA3 zf*6vK%-}4>B>i-~)|s=78+X?V1Dv7iUaMU6FHCh+wBr;6m~CH_QeW~*7I*Ai zual#>#C6OxQ8bf8eMEm{3xI<~G@a-Xz&WwuoU1^zkhIKsxyP*$n-SG@)Miqp1A7Bo zV3%jpnuH1U!)jn4ShwA;xFp(sUxuQ<>1S4piVfYO1?+Yq2MLcm>S${J^M^}$yPkT^ zBT{8nvfz2Ezs(4!`j$BYMov+SvFRIbUfVbU0TsLKojZi_^#=JZm4q_WJ#fuz&p!pC z;{7&*YN*p9tr?zXjD;n9=w6S_7Y7OB)>*=>PGPaPeXQ%FOEHW0^K>Lx7eAhK{_FkUO4Er;@TiSx_aYdv`3*Y& z$5kOEM$U#BsaWd zES#~KkGCYxhLh@P(RFlx0KQ?3d6mDwy5$`^_Plv_{_YZ{{Fjq8HW$$9P)duTGfQ$Ny_xW^}U3dSm3+B;>>Q-%YJJJDE*> zs?@snnQ42cZy(AG94Zx*+mA$7<}dF&j|$i?Qm5|ebYEHLz1(p9>=sYdljjg}#osQc zjc=z$(+&m>K6xy`w!VFIn-@7sMd-)SxkO!9JVT`GFMtQASt3@v4kR*Ddg(2CSwB-?oe*~onmo)&D!$2k4Gj5G!r#F!{2NrD)~_N#`(T}3O*I-$NsSWv!Eq?)$3 z-QyNdZ^0|+drup{T3uJ3!8@-UGhH_=gyWK;qX3x^r__k=Z=Wb5B?ldZC|++`3H~+-vuxeWLtG%I-IK{kuKu^DNWJ>C}FsDaBWeR{0$+oXW|PFVMS2 zbP!2NG-Z#oWyabIWN-#hofNa0wX5mW(X?0S_cQMgYSkFl9kiRx+30Wg7+ybP-wiP;VWxd?8fVUd(Sb5S%3>ZpR!?D^&v_5#Y`D3hRTO->?Ao?na<{s-}X38`C z#4amNsSAXXk*jaqaF%Xc( zyK7_3u8L#g&Yb|(zkb5!S!yJ#r=ayfkF{!1A>}tos5t3tfqpKo=Q^r2N{yc|EbVHu zb_#)5K37z%co{LgfY9lb$~qHN-BJ)-$Wgclsoi-FLaVxKL^Y!(?a+*%SlSK@OkTo^ z!!?M`AA5(J{bZFb|0`CASDF&=Bg1+ik!9(YGtZC_tz9Au*Kg&9CVxbj4&?zV_hMj4 zB`J&Zu2uX-#h<7-Sf9%%ECi=C$^XmtMH7J_!;m@w{iv2kXhY1UiwFi!<9S}FfZR{~ zh85u5ntFc96b`@ME+DhlvaN@--0=0tll3q3cO_lPV-2t%@3t`dt_R8kFl7JnE#Y1ZLTjBjs`(p8pQ@V|0(Xf<_qS2b+w&Qz+1@%^v@Y zwW(FQZG;yE_mD%Zu9UPbG`f`ZYbwJIBifku)Ak_9=SysGg z7p_hr@JB$5iA&F)mVUtbC34ZlQ7|__E$&{7I~v&QVOmXQa=B$>%SXR|Hnu?h(`li@ zOaui`X-j%*^qxC&8WXLyV@GV<>kq z*{W?Hbs@{iA^mEJC|W{&ZijY@;7cJYi17=p=5jl$<=~HQTM;vWN`JKDpiAKIwk0`9 z%r^ygGuh$(gMwQ-DVdgZ;9iraye#UdzhUlEDvrCAL zBe&{-%r03cHjob1+tiRQk{|ft~VtCuk+%rb< zaE#!3f}_eLv?+h?^P`Fj#W9D6o@tHP+Q<0z+GBgs2!9oA-@f~5SV>w7y*jJyXo9J0 zOnfJ^5XZ{D9gsM!)S0#jE#d$a1)^+)rdxiR8QVqDl z_CZ4Iv`nG~sBW=2{c#eDwX&=7{atCF;&JZ{>2{l8`0`4p3qvXf?OFdzzd?Q+uyjv^ z;as^zWnFxCm@%pb$a&S!nQEtODBpY6T+qw3Au>Qn-NRce@^wdM1dk5(f3tg?d3qqX znhP>of$OuAIl8)%N$#K^JVN2GcK?}E$S?P=#lZ>w5p`HcyW3rTw1Mf6JW}B(tSV-V z5-^za*V$-3@@VMVBU3Q|kdLx-=fqeT|7*7|tXNJKCX zw+n&T7g#wX%e})6c>+P&Z8_HY9L!F}NrIWuHPnb0#%$m>U)50(7`QYJ(#J9mm zqx7K$!vhE4+SPIVJ|mokvQOt?1O`e~8E1;=oo<_RL!)o6t2)?!->yB6mpI+P*BX8A zxL6+FiihU@dr0+&3~M=gK3CGxTY>*E+sh2X9R>+WAtHQl`qE4~{LIFaC6?Nqiiuie z+uk2~)YP*p%GPmFwvuGR{?K=fqZgoy3%mCwTW79Ee<31A(LwxWqK<<_OX5neh5FOD z27u$MxgjkzYZE5A&qn*sTeC&>`I_T148wgEu$A}{!OX0^@l}oVi^xLyCNCU+3JM~$ z1~acBf%YU@?f0?}zg*%J&!^{+){x1?8?9VV)4uqW;T@1~^2gop=Pu>x$42aDYu@K6 zSfSyJt{%L9$f}Jl(0#FQ^w77Cj=;vewzK*HE9(PKka8}#k8#s5bSOXbD;z`4{^v5DfTkZ!wykU4WMW z^GPK@=KZGO*7hv84`U7$*I8!J$CVrydFv^aqR$AtZ1X5e-3IS!T}NfZVkkGA%Dx!7 z3RMZw*tmaYOO%lVwfo+}wF(vBwsj4ly8Fmm)UWZrWvJ4oUzfh{*a!?YhL^8$grNNa zXv$A8d1_HpYhr?VL{HUplX7jH(ndzz^vp1xAk9eyAZ1Nqa^uA8k@tK0e$i7pJ6LD? zKD+aXO|653s?oylGqU%hz9X*-@=vA?3jP|&^3YxwL$OkWD0L}FHhvxh*`GZ*#V7F+ zZI3<#)Z{)O6XSQ(>mNlzzI95FHl0+It`z-yPZ!=jrb}NXhBPif2-BDQAzMX#*4H^* zQ+N{U{hd8HV{Y{igaB$X1R*S`f(G+mVb{yOdwqEzk1Ua9^8m@QR_2~o(UlYH*liYC z(%rEZpAvX4=x8WoeN>f)@V&ey*zE0CKvtw~7tlCYmvI+KBr zMD0q?`j}jemk%=wiAHDCYPacFz9CF@Lg7%5rjAO%d|WhK)Dczdm0715AIj2!&R@I} zBaJoD?sk6uFeG|{NGI-`tecV zgq!zO5r<@BF>b=PVL)a}pgj%zUQ5&-wISa7>Xrx*@Vu8;63i8`+gofuEZ4m@7Ny{67k=mRK?@L6l=Mt)vpCw=0sR+Oc9Hsg7)i6`gK zuZ%qhAGci60<;+Jp{;BPKEF#<#9FEHXY${QLFiuu-?eWP-`qC(6W6Os4lFslTWRg; z%{7*uqPb@e>h1{}7f8CkLs2cdE8hsICm`Q8i^4 z60I>}n$k2}kFQTmlykxl2X~SsTBFi9@lKmxGWPCDqk{{PWdg3iupx?-YcOu~ZNT=g zw_XU+;8ui4H`gu3kH{juojyA@QmeP$e{66VpD6J%IMG7k2neZT4I~u9R_gZtO6kcK6Z9~nkrbYADP#t%p-j4 z@nBi}C5{$Z$iGcW@j1zlyql#w`S8wo&lJnpu$HgD^OX@@U8LNouk7fG3~ix-e`o6; zotC#Giu`Opt`=M1?Guih|ECs2nfyM}w}I!$O?JB&dkl?Ui|HFSj2HjeM2n2->Iv57 zk@)2BpcY*!QH_~{^q&HP2Be)SUfmd~O9Q@ImIpUM{_WnNo0H7l=UAoIZXX*PVb`Dw z_%r$ap#MFyaii+YEWR#r@)OMMriAFLxi&q>y#L;D8f--AG=v)Lj6S9g8#7l<8aq17>4_?!ZZKq@OB5%2Q;U2}W=j22N1`0MF%yLK(Mjv>MyxAK^Dd3mq-5Kw;&iJ{- z3YE0lx>GaOO`ZSn+#6p16FR>{9~Clx02I4MS?ilYU3beff6vZi)m%a3Hleu{CdJ`oiRXB5Tn=3Q%>hobfS4D2Wsk^%`0mo) zNP48-h3U( z)sPJrm~R`;H7A-@q%|_jE~E?Z>w9jfY|ci}9P-0n&1qCtK~d>z*Tv>M&FWT<@$xCK zs~iaV9nAO{#9PlzFa)VRkb3@FzuNRSZFcu7dLd$xor}g`O?YxpS!lb^rICwid2=Og z+hawZbYntDckTkM%;nXI;-Xv5lm}Y9K8{S1%f-fQa+eHtWC1EZChxi$JCVEHx$X@4 zA5*}+3Xl8NA~MGDIn?u3kH@%JW1A(xDAXI1@qGqWwM0Ng5{%vnYYki1!Y7YC25$@k zA?#b3mWHi`BQvvF;MQjKs$`aU=9B%}%m(9%1$1Qcmz@F(lyr_n=F{J390yPy)SH4# z1xhSi;qg(Ll^>QBf8va^$9^#lIs9_M>qOhYqRX0-+ZsS~Qf?Xh#%JTk(+SSeBie36~|ZJBfjrKESa*XVDH0zdHX0^GJ`*nX?1 z=Vo9mbo$UNO_URPsWaPI1DmY}I6yj1)Xg^e-&3k;rT;DT<^-0|vW0VR?^IWws+;KB z*Q>=nl>fWU^`thz_kI!C?{wz26??XLEKGb|lC`09jIzb+3@gO}6Lu|ZL zpj6N@EfR%11O?ZJ8{0jr?|H)UYYe>d?zS09T3n4E&5srqp5>lZcTdP64^`}XHKwuu z^1MC6@eI!5N6J(0=1ZsVWi`S8>btO0p7lc)o=!kF-*jtRKWRJXetnB1&CDJ_A?&5X7FjD9oeh5IJHb~x!a=h4B0iFBmZu(*+6^kfaA_RXWS}% zZ9AT^4D2Di)_g3Bd+X`0ujU8x>0SQOz%wrv>Oi^@kvoEvwWif;dMv7eB%og|9Wn{` zhI5<}6S+c$ubf|QMj>!f28pUbobAm$oE~}`#JoRk>tXElE?oswU2oa(V2^sls;t*# zYl|t$MCzs`B!s@LdT)|CP%;aZCa$m@WS(|A8B3GOKoeHunAaXkdK@$+cyh8J|8K6D zd%$+_p@X;)TARAvM**pyxHWSu+gzoO78$fntq*QE)6P27^Glw0NT5fH{E03RdWhPk zla#4C`)ky?S@pXw$P`uVMv%1@iS^9hW!g<~5#*cpF1Dq_*2nQIvqtqp99Nw<>TMUWS9}5g;-_3q*QCD1^Eq)~BJ6Br z=j=nE?eGV*Ni!i6dX_RW>uH+uW6uAj|2c;eTE;JABWhdJ+{SFnpR+ImtnMN6O*#(T z)CJF^546?^{^l(ugG%MP66-gePyJ;?3@kHqWOyvd{@3RF#DQOWBQVHE%lIo#Kj#>n zIGkd=Ej?@L&%b80x)9$-?Sb!I9!$6T=>7fAxM;{60U=0bYWuHwpr5W89EFgJz~7_d zBBNflo>YjykJa~S0K1<6csXAlf8JUl=aWivVg4DwqY-p{lEAJ&(8|yW&v&4BC0TnS8%G}waV*h|*?KRswEtdE9#4tH?74i~e77p7(qdwa4|EQcd33T6Ov^m=LrPM`rxzysgA1b@@kFlxy*+L0KcdC`W4(ewcHjTjImpaSd`@kV1z zR<|+J3$(d?FvXwd8HM9@Cw(KK%s(*z@5gpr40YG|IMb&dbQ$W_0|4Y^n3-nskWsrK zCIY4h<)osheN+?DuN6DItfR^CaCUFXOVKbX!kytSTlK+uq|2Jl&!d{QMwcTGqaE$joF}bg^82vzy|C` zxpkOJhTGX5@T%neYs(<$QOv}?4a?vpM~wp$PyqhvaxZEJMD4K+)qlS)V_!jec6DfO z=OP-AVK|35t`dB*`$Sv(qm9$Aeb$7b5eFf<;4Fx8!>h9AhvnIrq?0e`T2?446xdY! z&2vb_jit;~V$v}oq(@?OjyaETbwx<}xRgul*`IQC4s2?vo&B-*(AEC@M=HQ-j@Khg z**d_?wBqmU*Z-eAEo{e~e zF^IW2m~UMjUI(#^9wxT<=yd7Le)rfby_vVoj(4R8a%juITgu*|zc}n-c|~}1nu{+s z+lT#g{Qj|5I!Byt;nuS^$)9bCez4&mdQA|=$cZDR@ULuYBD_7bv|$GxDq%i`6sGkW zChC<=QdGq|7az==MV$aYE2)68CO}lb(Z=r5WXPad*Wh(oMVK;qtZOxS|>>1-me2)d54>Ra#iSjv$F33#9mK`e+-yG zhdtmliV$VHr9-C0p{o50!&2`8Q*O(0w`Q4OIhWj;VRspCDLeG8k+tw7S9jF0UUht* zCg@ z#)ncY)Sz}Q?BlJOZTvx_q<{M^8u&+$FmA2pD>a6?jkPu8#MQ8k!KkohpDpB~IKla& zlE$4;!RKZ?Eh@A=4iGjIyFBrlX}nxrpMW3NZgFRRzzzJ}dL^`>6#PYlQ3}_~GM-h- zYKnwt4dA<1PsWtCCi?jIZGFu3(R=INg%561n;2|3q@M!r+3i@ThHIcPW(?!g6PT)e z7We35>KM<|gG#w6)b(#4U^)${9}?@b>9uM^bG5YIVXsKuuc*q3OAjfZN9#qDri}F) z8>X%;q<+{`);N=lFJUSdOdmuta)^hnTvO9!Cv#7@mPqY3c-SrUnP|7sl#r@a|I#MI zV$pS%Wcm(N3-Osc&AUKlC)M&Wh?E=E?sM znyYDQEq^V{npz!`AfEOQ6N-8M&tx@w%t5JrqPfUN&&Qrtz=4cbw(&AEW8u(a{bEZ5|shsL_M{dtD~h z%;2dG--e<*YrN?-#~3ZjuYg1#FgW91j~8#n%ytazl$Wb+x#_xp)f~ zsN?8vP6-k?@9tQ~>-BzD9Fl~Y z*6f%S1y3u^*hdr-jQccBYMG;&B-v*F%8E>qJw&lIuwycb>4+;qo)#nYCVV^(yZfUT z&=AnoWObL-Hf(!OxAn~#6mI5-?mw=P*Pr8l}iBICEnfKs_^=TeZ;vxam>|>T*i?K4~6^{JI)h zxs{Bk+k<|4BJa!PdJykqS`l;-uqnwrX>6AJ1eqf=mT78<(sJy~@||~QEMhPT=dChH zTRBsVgICibzopm0%3{e{k6tkCrk2Du>*mo~J(vsZt1>8p$1^(W2)4CJMfOgV7`Ytq zqUb3R=f2p%7^cW&Vl&-(~xkAvH;5qLMw{}VocomUjJ$bfj@%g*S>2HTDMw=D_9e58421*j@ zufM$0bWhMjXpmkL1t=*3n5f_mjhlYVJ+uD(Zrp~vz9x|u0HYN9^J6D zZEnb+E8g7y@v>#z?>c_rQ@FoeF+;_w0=#2F=vY9wTyc-dc#;?pJIbOqapEmdR$_*_ zWfd~3;H?j*Wj@bd&6+`57QJ16Fg-azIoj0WW=WP{kJOiSS{$oi-F1E&ht6ygOxeGC zTP@^x;TE^lL-fXoJ*dENML^Y&V7XoYF|2(V5l}Eqjog1`A;#FQR5eNC0c2mh4}T0L zzShkBr`Fs0B4TqcaiI5+Nh&wf9&W2qtH2qk*m2*z;Y(L?ut(*!6r^@o$zJT3Bqe%F zpHLZObX1SzW2rlD-;ZBvQHF0R@^9-C7d0-0TkB@bLJceh*y1y+#+iNRSUqdO9%odU z4qT+0s+TKHOnnADtGA)wlqVl=EKQTo#^3^7>UJKm{XU*+Rx$EbRPQgB&u#KK|5tX( znIJ8+EOLZnkQk;NByG#8`l(mhk)oPexa%ukDup4S6Kbi-h9C z%Y!MvyviR;7E4jWw@DD@LiB6@rBwkIY~k1YRW zkJN38VQ$6I^!;nN+{a|>JL zN+#}-19w`-{wi0fd#&-Wx6`SQ4m+F^mg%<<&MwaNeM$pgN6rb4>|Z8i69b^+RU%oF z+=_P3`O206dsiEhfrH;-Lmy#azT+c3es0`Wkf26G2Li>vR@5Zx*FcCHNNOn0S@h($f4AYK09WW5(5$ zG^SqY{uh7Jv&4HBMsd5Z3i=S^2-`T4b{BxTIH%)^Ux-e=mhEmqoQ1hg)#{hV|-hp@MNWijg+DH9+T5&9PIYSY3@{7)H7Sh1y-iY3lkUB z<+@2EN|5prBNyg8qGsKis%B65HwsYxDNu7qcU%R|)cnN&)GY>tu@}5tE+1F#gCtF?U(_+o;r-Vy?WUA$0^#NX~+ z-kFEw=q(8Y7n@cLy*3q+-O<*7ZW}TO>ToaUbb(uzo6b`Nqo*6YvL~A~rZQ*iX=>K6 zi3Vy6m;pKI;wq+}9zF9&buS_>iQ?#^vT+m(q-nR>WHQP|oisNkOz9zDC+V7;h-htr z=LLN&EMjxeT;t{l57X;FG+-L2DT*^QU5J8t%gnPc8?=DXs8kV%Jg1>D6#5j0KuzRP zEhUQFy^qEa2UVW4uucJEhF9pC#Xv4~GNH>e1;%tf8g4!hOr2ryrg?*h$epZPejqSYvJYU6?~s$Ysu z#JQS0d&2MAL~;xs-Bc@mV}?4g`QnsnQ@I}zcjtv@$K3Zf{S^G3{hrIwLiH+Ie3W)@ zpx#Xs{%UP>q8cD9)bygUdfIM5mG(;z>8#a;>cxwp7k`Wdw)f^8h&w(#ZgViib+cFe zzmoN5H>*d_Wpo^V6kPnm?^?mwy+s@H$cY52+byAIDAV}1iRmr&J{d=)TEbs$%T=pU zLy}urhh9v5BW}L(4@ZnFKcVb9+(5|c;RC7YTd09 zCCNfQ>LK?6{&M;Emxtmd!1Fn%Qbmp~wWao@Cbn4)J9G`AKWtn6VPH1b@+a@P2~nQn z5>?+vEnyfvbr<=hIH{wkWu+FgvgD~9oPKRW3B%T3`|ZmkeJvU)W+&JMXGgG5?foaQHP+lFc}VW%2<$;wTHiXs z+iaT)|3b#y#iPA6-qJ}v$#>_1x0UZlEi--UVpktNG9u-LN&Fa#m0J<^QD}6*etw`J zQSuR{;x~^Q$CFr1?pJxw<1Weg6?OTxVwaP(25Cz}R<-_y&H1i{A7A7V2fjr2-wgSA zS4|&oVvSIsH>Mr#K=F9h$iz;&cw8HEkY&}#=}_0VbT(@=%6@p_(%rwGTmDLI8^L

v$GnPwu~osj<-{nf415kE>E!*kwRjw zeQVncQ+0IuRM*-2|sVZRM4Y4f*1>k&ZWYWx$dSCRdM@g?F=1ms%~-m8(z^3 z(I(Ww%yDW_#}qxUWC{pw>@zAo;ldLlc54zqJxKrnqD0vR%m|=5&hce!MGD~fbd>($ zT9$dc4C>*ove(zX8NMkjN^98I#C2{yZ>iX3K@yh(MaLY@yBqPh=0y zKsQIQLB^On{tg44DeB7Esyd);m3-p|6j-hdW}J#q4?N~kF)o8`3k?-IO6;}51_aJu z^zj7>aNUhgh|_}@$%*f)jov$&11g6mFS~qeViz_CUGaU~9QLg_bhJ76*3j;v|MSS& z;QzgX=6@Z|H>f+zI^vb4jXhLW+)chtQ*g{QJ;Srk?If;OC+otPWX)f1(gHxcnU~&K z`pNy`_A;ulDUEvw8xw4sxaY-{okrNakDN^pQ4X$sRs^xFtzeM zaQesmwZ++p%aa1mrMcp~;Yy3Ls=&|DyM$Y>tw2szFiTwT;&$g5T-|BX9W#9sWf0p| z?PFQ+^RG)H|MTXFQzO`*6IIm*_>&TB`?$rZG0NXP+jZL7F{%&6n z=2`?_+~uo@uDtoKkFa;TWA@$Ugc{Sgt;a@}wM6Qvj1jvlBdIaCP+wxCe~h2g$-R;b z$BR69(qqL;>9FB#Ik!u5`;@NcFLzaHEn+uhVju2WOKqL)o%XhoylWEG`JEGi?ZqGK z2_)j6-#bn9*%7mzHW~+Z7X*j~?SpYgRlG*vW%D}kJ;5=0hR8%nswZ(+-kD=+Y3%_k zBu32o+FdVS5E9oL*EBON9z4w>vKONf{1CaFw*}pO_Wi|%pC@_^nYNI=q>IFNp18` zbiJmE(`Qip>V-M#wS~^XLL&7)2bTK^${Hu3b3wSmsk}b?sNP*eM5M}lsdS5vhP%WV zBKSoyvXajgzwgfMRj-?H@$SwMp}p0z=oa?(v|MK&gVi^^nzxa3OomB~?3O77 zcg$~1$JX%aAf)!{zgN|85%dY~>B51-$4$3|o6>LxSnEo`>%ZOSP%giG{9*HYHF(E2 z{7}@^0sBI|F2TkuO6tQc;<1F4J2rQpz5}kYhsS5jkz*+C(k2p5 z)sdrmf3oubwc-D2?L5DlPPDI|Kq?SOAPEpkLW@WlQfFQ1q9pEzfov-ke&{zBe0 zQMX|409!{BIpccc#X)n%IjCgzM$X+%xm2(BGr5i;LoQdg|D*i+^3Vp~aGNu>&nXPD zr_<>61>kf#q4hrJTVot}sGU97CNwj=;fPq4sh|Xr@?N@SqFz2%ZM54}Lc8~dIJyop z8&gO^d8)(L&;wr)W;CQOko8@r>A3OvCDaLYWBYlHvmGw@FIwpJ)>w19{B0(2^Lr|m ziPI#EpBF+M|1=Hev=PRGrFM&xGuB^R)h5yQuqU@lj|i~-&xvtZkIM?bj1_c(*2K=;-D1vG%qvU8$|LqH(nA3aJE(58ZW z!7WRXTaX;gv?<(0b)R(}{vCjqR4wAgLrXgd3z{>?<|HOXU5@~E-jnx8zkaeGpK5Tk zZVHUflUy|P%~C&P94-Kg04PzDT5-k;y7k@A-GB`(P=qGds(Mk{6ho|Z-hh7Pe9C=)GXYC^8#1&?0Oy&Q|OYr}O>>akO@+t1Xsr2D95{Q{@Y}*7h z@y~suHJTUHI2LKPBh8wuxIg03uFmwB_g#lPj?p53tO8p*o_AS|I5^qlU3-4})zoFW zdQjn=RqHZ+3i)UNfP9QPqZymX33nW>D)VHOQEfl1?K+caO-+mWa$vln`IPBABS62k z)_Ocpa4n+6#jjz{{ayygzY};t)OF7xJyT~{?BL9`z3+vqL-8MPe#akTa zhAe+sC=SIQ=s8vbfV-!icG%x$Lv~`f(=ML2AMjRF9nIYD_$(Zx*rl~QqB0ALn3DsZ zgR(R7Kw@V7!h}<2H>XxV7bIXhm#!}auwtW>B}Er3pBaY7u3?spF^G6!NH;JdH%+%3an?F~ zn3yD|J^VR|+6yZ|XTzRu0{MQH6zMkn_1wXMK!6&>b~H7cbzW1RNI1BkCARZQ=_#=& zVw?Nf)sx{@Z26Fd5nL|94~A`jxDlg)y_lseCdbksp`;#V>PXzFg7w;*3w)~RXtLj( zvvwENx{EjO_jDViOi#>1-D`dt9c31Z%N(53 z)gv7t$v6LgG6H`7JKDvJ30YuF2n)kf!eJ}TTt=Fv>#iWHh*=?{02ic36m|bH>B;MBUvc>#?tAFR{OKpAl&X5iww8hfF!HP~ zbEVHc>!UlNbT+%|xAWV#99t{gulvofu&_dHfyLt?u`<cXkd4rQ^lVIfS4}+KL3bt-N4l1A9n;; zmy!Wzs>mC4AOzW)B6zTDyrmGVnMzsGChis4Qrl@{gARCOSiDX@tXD^>%-XuQNh9}? zC+K&s;nL!Ol_>i^=`M@Ly;7lmR>DKm95Xj}(1O-qS=wkRUt735XXjblPYXDJpIK%2 zpR7YLqo&Gq?s4C=iaqUD)$l7vU*aYe2$!}j^kHw%UxiAzFQ792B^)5t|tEM@N!nnE3Z#vgrK>-#fI74(5#9<5So^I-PwwVmBzYB`27(w+(4pKNj|r%)^fw~b2Hm#7 zOfP1c?|KqZZmWSs|8bLS@{c4m-B>1;{ZM#LTWjHs{frG13^JP!=8u`5`GAI68*ZWn zc$~p>qY=KoQmB0(8%vbXnHEZ@FIC-Dqm=(_y%K2~uYTeBJ-SOYuO#`4^vJCzG}n&9 zrCx|7^|>ELzN<7;x#@y#s1<^!t>DDsDm82FL5NXO^=!nF_Aeg&CNpB?On>c@NpYns?$8}k&f9sgYg(|VoT{T%(zS50 z?&rHAo6PLzSI#VH`$*_I^7)uW&#yg`C$8sR4ten|=Ifo=@$31&jJ{Yo^7XC?wIxLD zf20M}W00e@h^D86+V*-Y#<3`+Ry3;EF2r15^DPe=qufd(b~xTSZKj(xru)29cOc{p zeGFpGQnP27NDn3=b6kR|5Fy9XQIO`L>Wi(61_wLy5V>qy*_h3dX{O3!SK19JcUm}l z!gX#n=G!eCsIBo>TLEp?WBgTmsmiB~^YyeoS)@I;ez`mrs3U8r|NOc&#u;CTF#N|I zxm=U31}-mP<3uSHU6j-azxJ6(OzbQ#`$|}8HX}C9RWIQ3s?;@u1pTz|>O+m~z=Z3D z7k&I&1105`F@DPEhuEvktUaQcHf^fvq zY~`P)-49B_#7TE=b-g~|F#)`?&Jhqc!X6L=wo>)$Al<#9${rD*xZxmUXmM9B~DecAa;%I|z?sJqOu*__x z4L7IRD~)%;0@0^x(`9v@$mW8}T8h2Jt8Ggl|5;vC<@a z$K=o&sFjuW=kwzdmcVgI6%)kF=xl*e#%e*$<_nZ}51Y-S-Ud59lT}H>e!S%%4KLC8 zT69)aC$us3n5@~v-6z~!FTUHXPvHr7awPcPX)5)4>BrKzsqH_SVVhwvRddwk%RJPH zfd!Odo)la>9qz9-49_V41U5^Nsu;&Ll{qy@EHqN^II?AXh7^IU| z`3Iwd+m*G#mNO*Z%DtJI8_drR>w!&|3*XuG* zoJRePjb4e*Qfk^o_N$rP=!8s&6kAhb9Ze#QZ$CsC0E=-;p+YU$wSAWUoWgfKklY5( zur7~Y-v#G^1(+7w7k0M+e(xGjr&j^-uWORHW^czcGUz%^^O{}Hl{Rw;y^%T7E&Hc* zQ0Q-X{WYj=8^afd>SxXRGsf)U@M*BT4Dp`dOl%YOlYFRm}!J7uHN0aOGRjp~+{ z{U>~3QP&O)(~~wq3h4rqDhWh?i4b`wN2#@EH^N}eT{FYOSx-$##ihuh-iYRE{keYn z{msFgKpaSH05Si4_>rkx?dt6jrQN4oI6d&TMnLtxx7X8A&T^<$oV=F{gfah~Z-N8= zC4cRNP~WjhK5}B{J@rd{sjOxNow7zYU7=Q1?8tAgYPTUeU``C`LbM81y-BQhG2#X@ zm>Pf3WJMZVj_#^U@et7{lxL4Sgtc}q? zmn;so?@Pd#Yd?)wBfjU#T}AKXPtBL?L6p4D8f5s9h_dVrn?SB!fsXm zYIE*vcTP_dYYPotfZpz4J1FZ8HnIhWSLt z_rgwEhVkdFB|XsX2W77dviHLG##1|WX?6jnDjhe8_^}0ZmJ=jK< zKEERzW8M%d4zXBFKK41gn9?|xGivpo&7VN6d}s*-;C~8{an63s&qmDl#46ppE)ik? z6Wl)%?$u*Gx+xz!ZwMk8GzF60OfSzG&&;XKgI}Qh;H2cH0tUIBn~mI8<`{4R$7=5k z3D=(;gy_|9AUpRI+2I%tPiJLA!2Q$|fQ{e=?jh~4>eMsh%{rEr9_*%xx5Q)}8bf_Z zQai^>qf`%D)vlwFK0=RbHZh*wv}?~9Wr3J+yiCEdDLB$GO56|7m>u-@nRWDPO5YiU+3|R4i=>PeR^NTt7HzAl}(DAqq2m{CREfh zN9eOjg=qJ!H<6E?4-*rc>zS2IJp{Xt_)iwziLItVrtryX^Tn+ch*n&W0_l0N)HJFx z$-#M7U*VU_yEmWGo>rS+@m>|@TFQz5Pa0t(=ZWWkros4e1<0WdpyN(9VMI~eu}7&4 zoAd;eUlV8rgihkqv@vuQa99{%yiZ~NV18UKw^N(?&kg&%x(wzB@!n%;3Z+V0D-QM` z3Z`N8F5DN$l>=BpSAaQmdolVJSIT+Wsx^r9-$AihpYk1eo|)l5|| zvHOdI_v3jtVcG!rTOeZ3DjzB)Et$E^)A!usqTK7^Eqzx9TcQL=(k!%fnFnWOHDRg( z$zIil$RxL2ngHUSf|WrE^6b1>bq(Zhg|=s<62c_uBe>H+Zt=>Dk(`I{aJSn!5p+9(61T@Z+q$>gxAK5!7TA{ARxF%p-1woaBi007U2x7ir zC|Mzg{An?u-$%^DBlg-C6 zEUyYQlQ)dJG}b)!r$LR7-gb24r0NoWy>cg+&L*u&AI{#&LZTaZ$NzD*0xq*Un|8Nb zh^K1IR2Gy?Ph_ia?ROj@xH(8~!Skdg*%`&~BgRsrCLfT`{@}?oWzA*=lvey$)}<*7 zgeZ6_P~0M2xdC)H=7kmSQgC1Ft#iG5Q&JL}?Oti1+KXQFsb@VpiiEx11e@*dGii5h zksub^{!4-sgF&#*h?#ptEht>Pn*pAfEE zSIdMvu+H6a2cm8TtnQn;88uUrE-2LcAafmO3^!y{inCawOE&u;^WS{>{ z0hl?ny1m{cI=}VGoSfbi;$DO`yaSMgEiDp!$7yc4=H3x+bX~7PQNy&TbY3t@@8Qs< z2&gOPzG^`8Y6HX2PY-WfL1^VXt@DJV?CN%NIBbDmz<{MRfsVCE>uqbh9xpB4JzFvM zqE*7TNpv2>^L}9;`l$Tcq#-l9#sWm|7Fho+L1YzjY1bDv?hwps^c_@kVtkGjQ3X*ubg{H=2vo)*#2hu(O5 zKWNpDQdGefFvgiJ>XOQrl>UdBWPj=*<$|7lbxq*foN9uQdIhL-`Q1LXKd&w-6=RTk zMLJ{=;k^kR7yB6xCB3#v3N^49t3sN_(Dy!fbeHBRtl}vw6|P=x{s{GVbj@5&0v!Y0 zX;a6!V8>J>Vr)x~B|?qpCW$o|8;M(kk+lJ&+~}U!UbQgUzHH`+LFux#*B@!P0F%f` z+IH>17RT~ZYtw&QWGK}U2kaLTr^q2C9RrOK`>W&k1gza2jlQ14gMi2zE0~scF&zO(67KHhuhy})=7=tH==gXZ7RM{b7kMyYE zQ{@Lgw=zmZ3BgtY@@(+AgdcoAtGk~|kQ~^9QmrEa)*}d$i=-4h=g{8?;wH5#XdIWB z6@sE2O2el`CV@Cepo8+=ZU(CdT#Gqsqg$fSLj$ZqlDz3TK4J`0Y?RWJWoI%mrwS~P z6kiS`owRoky3GWD(|^6As{=2(W9Mq@4}>GUfHUk##Ov zgXB5MhnW)RcoSd%A*nSH5e?pXDj@4s@zojZl4jTi(gsTK?BLp^YzDoRbs^>Lm4vqP zttaut5%(U{UnN`zCA#@e$a9`M3Q0Mj9Q7hysL{z))FwS9*BQuD-<#b`)+m2w^lp(Y zO6>thCL>5ZYB+AP!suh*Y(h6!Vv;A%aWkD!<@(nOrQM;N&Tiwgq62p{bka9pEf+jb zIft7D8nx4>e(ylE))SnbG_`7celZR)O!>^(K33Cs0{#pA=H#o5QOCH*8XC@GZ60&T z0%0*BlY~Z17(NK=i}sy|o!YFCoJkSs+fAc?d|23is0#YuWs-z)rrafS=)Czvrxn%424{M?F&<)Y=!bIA9FiLXu++|9(Flh2bq)?Y==$3FI1QCi0`cS2q zFh5J~k`v@Kgm=p&hC7>vEuiR0V)hbA&;v=l^=Fz4zJ5F>OG3X@qB#yiX689MauRyY zGWlZTJPSfW*nm?oOC!)lhNp@s|Gcb$aF2=vDl^571@@>~_A z0;1+48@3r+el*lCOuA7L-$OetldJhG(QupHhB#@w;*`J?w}yEd7FhRA-wY?h4b+H_ zd;JM8jE#4l84M0o0cb0V13h|KEb3`5*pxOAC;Dr~cWn@}`!$K+OqXm4o-Ze!J#bkJc;;65CHNkVlz?{sf8x_% z-tz14M_wgwUYBx+bqLJme)TDc4BBxULs$EaalkVd&b@=Xx%w7n4vT@>_jAp}b(?_O zku<&WB7t&1%uJpSAJvl{BF1s*44SSJeIpx zf!MlAYWv1dyC=*yq>ioIBZ2yf=nZh?mTcf+Me{-WVuE5 u`E@%FOdPt_>sk}{#`pVQk9gX*r0~#XKcjDxk{!2X`s2$189->s>;C}mE4iKk diff --git a/Docs/Support/.cvsignore b/Docs/Support/.cvsignore deleted file mode 100644 index 8772614a6b6..00000000000 --- a/Docs/Support/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -manual.html -manual_toc.html diff --git a/Docs/Support/colspec-fix.pl b/Docs/Support/colspec-fix.pl deleted file mode 100755 index 6c64edd1441..00000000000 --- a/Docs/Support/colspec-fix.pl +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/perl -w - -# -# Script to rewrite colspecs from relative values to absolute values -# - -# arjen 2002-03-14 append "cm" specifier to colwidth field. - -use strict; - -my $table_width = 12.75; # Specify the max width of the table in cm -my $gutter_width = 0.55; # Specify the width of the gutters in cm - -my $str = join '', <>; # Push stdin (or file) - -$str =~ s{([\t ]*(\s*)+)} - {&rel2abs($1)}ges; - -print STDOUT $str; -exit; - -# -# Definitions for helper sub-routines -# - -sub msg { - print STDERR shift, "\n"; -} - -sub rel2abs { - my $str = shift; - my $colnum = 1; - - my @widths = (); - my $total = 0; - my $output = ''; - - my $gutters; - my $content_width; - my $total_width; - my @num_cache; - - $str =~ /^(\s+)/; - my $ws = $1; - - while ($str =~ m//g) { - $total += $1; - push @widths, $1; - } - - msg("!!! WARNING: Total Percent > 100%: $total%") if $total > 100; - - if (! $total) { - die 'Something bad has happened - the script believes that there are no columns'; - } - - $gutters = $#widths * $gutter_width; - $content_width = $table_width - $gutters; - # Don't forget that $#... is the last offset not the count - - foreach (@widths) { - my $temp = sprintf ("%0.2f", $_/100 * $content_width); - $total_width += $temp; - - if ($total_width > $content_width) { - $temp -= $total_width - $content_width; - msg("!!! WARNING: Column width reduced from " . - ($temp + ($total_width - $content_width)) . " to $temp !!!"); - $total_width -= $total_width - $content_width; - } - - $output .= $ws . '' . "\n"; - ++$colnum; - push @num_cache, $temp; - } - - return $output . "\n$ws"; -} diff --git a/Docs/Support/docbook-fixup.pl b/Docs/Support/docbook-fixup.pl deleted file mode 100755 index 48ab085ad3e..00000000000 --- a/Docs/Support/docbook-fixup.pl +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/perl -w - -# Fix the output of `makeinfo --docbook` version 4.0c -# Convert the broken docbook output to well-formed XML that conforms to the O'Reilly idiom -# See code for detailed comments -# Authors: Arjen Lentz and Zak Greant (original code by Jeremy Cole) - -use strict; - -my $data = ''; -my @apx = (); -my $apx = ''; -my @nodes = (); -my $nodes = ''; - -msg ("-- Post-processing `makeinfo --docbook` output --"); -msg ("** Written to work with makeinfo version 4.0c **\n"); - -msg ("Discarding DTD - not required by subsequent scripts"); -# <> is a magic filehandle - either reading lines from stdin or from file(s) specified on the command line -<>; - -msg ("Create an XML PI with ISO-8859-1 character encoding"); -$data = ""; - -msg ("Get the rest of the data"); -$data = $data . join "", <>; - -msg ("Add missing and opening tags"); -# Note the absence of the g (global) pattern modified. This situation can only happen once. -# ...as soon as we find the first instance, we can stop looking. -$data =~ s///; - - -# arjen 2002-05-01 -msg ("Processing docbook-prefix special strings"); -$data =~ s/FIXUPmdashFIXUP/\&mdash\;/g; - -$data =~ s/FIXUPdoubledashFIXUP/--/g; - -$data =~ s/FIXUPstrongFIXUP//g; -$data =~ s/FIXUPendstrongFIXUP/<\/emphasis>/g; - -$data =~ s/FIXUPemphFIXUP//g; -$data =~ s/FIXUPendemphFIXUP/<\/emphasis>/g; - -$data =~ s/FIXUPfileFIXUP//g; -$data =~ s/FIXUPendfileFIXUP/<\/filename>/g; - -$data =~ s/FIXUPsampFIXUP//g; -$data =~ s/FIXUPendsampFIXUP/<\/literal>/g; - - -msg ("Removing mailto: from email addresses..."); -$data =~ s/mailto://g; - -msg ("Removing INFORMALFIGURE..."); -$data =~ s{.+?} - {}gs; - -msg ("Convert ampersand to XML escape sequence..."); -$data =~ s/&(?!\w+;)/&/g; - -# arjen 2002-05-01 -msg ("Changing (TM) to XML escape sequence..."); -$data =~ s/MySQL \(TM\)/MySQL™/g; -$data =~ s{TM} - {™}g; - -# arjen 2002-05-01 -msg ("Changing ' -- ' to XML escape sequence..."); -$data =~ s/ -- /—/g; - -msg ("Changing @@ to @..."); -$data =~ s/@@/@/g; - -msg ("Rework references of the notation ''"); -# Need to talk to Arjen about what the bits are for -$data =~ s/<(\d)>/[$1]/g; - -msg ("Changing '_' to '-' in references..."); -$data =~ s{((?:id|linkend)=\".+?\")} - {&underscore2hyphen($1)}gex; - -msg ("Changing ULINK to SYSTEMITEM..."); -$data =~ s{\s*} - {$1}gs; - -msg ("Adding PARA inside ENTRY..."); -$data =~ s{(.*?)} - {$1}gs; - -msg ("Fixing spacing problem with titles..."); -$data =~ s{()(\w{2,})} - {$1 $2}gs; - -msg ("Adding closing / to XREF and COLSPEC tags..."); -$data =~ s{<(xref|colspec) (.+?)>} - {<$1 $2 />}gs; - -# arjen 2002-04-26 -msg ("Removing separate target titles from LINKs and make them XREFs..."); -$data =~ s{.+?} - {}gs; - -# Probably need to strip these -msg ('Adding "See " to XREFs that used to be @xref...'); -$data =~ s{([.'!)])\s*(\s*.+?)} - {$1

$2\n$1\n$1}gs; - -msg ("Removing EMPHASIS inside THEAD..."); -$data =~ s{(.+?)} - {"".&strip_tag($1, 'emphasis').""}gsex; - -msg ("Removing empty PARA..."); -$data =~ s{\s*} - {}gs; - -msg ("Removing lf before /PARA in ENTRY..."); -$data =~ s{\n()} - {$1}gs; - -msg ("Removing whitespace before /PARA if not on separate line..."); -$data =~ s{(\S+)[\t ]+} - {$1}g; - -msg ("Removing PARA around INDEXTERM if no text in PARA..."); -$data =~ s{((?:(?:<(primary|secondary)>[^>]+)+?)+?)\s*} - {$1}gs; - -@apx = ("Users", "MySQL Testimonials", "News", "GPL-license", "LGPL-license"); - -foreach $apx (@apx) { - msg ("Removing appendix $apx..."); - $data =~ s{(.+?)} - {}gs; - - # Skip to next appendix regex if the regex did not match anything - next unless (defined $&); - - msg ("...Building list of removed nodes..."); - - # Split the last bracketed regex match into an array - # Extract the node names from the tags and push them into an array - foreach (split "\n", $&) { - push @nodes, $1 if /<\w+ id=\"(.+?)\">/ - } -} - -# 2002-02-22 arjen@mysql.com (added fix " /" to end of regex, to make it match) -msg ("Fixing references to removed nodes..."); -# Merge the list of node names into a set of regex alternations -$nodes = join "|", @nodes; - -# Find all references to removed nodes and convert them to absolute URLs -$data =~ s{<\w+ linkend="($nodes)" />} - {&xref2link($1)}ges; - -print STDOUT $data; -exit; - -# -# Definitions for helper sub-routines -# - -sub msg { - print STDERR "docbook-fixup:", shift, "\n"; -} - -sub strip_tag($$) { - (my $str, my $tag) = @_; - $str =~ s{<$tag>(.+?)}{$1}gs; - return $str; -} - -sub underscore2hyphen($) { - my $str = shift; - $str =~ tr/_/-/; - return $str; -} - -sub xref2link { - my $ref = shift; - $ref =~ tr/ /_/; - $ref =~ s{^((.)(.).+)$}{$2/$3/$1.html}; - return "http://www.mysql.com/doc/" . $ref; -} - -# We might need to encode the high-bit characters to ensure proper representation -# msg ("Converting high-bit characters to entities"); -# $data =~ s/([\200-\400])/&get_entity($1)>/gs; -# There is no get_entity function yet - no point writing it til we need it :) diff --git a/Docs/Support/docbook-prefix.pl b/Docs/Support/docbook-prefix.pl deleted file mode 100755 index e76d84dbfe0..00000000000 --- a/Docs/Support/docbook-prefix.pl +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/perl -w - -# Preprocess the input of `makeinfo --docbook` version 4.0c -# Authors: Arjen Lentz and Zak Greant (started by arjen 2002-05-01) - -use strict; - -my $data = ''; - -msg ("-- Pre-processing `makeinfo --docbook` input --"); -msg ("** Written to work with makeinfo version 4.0c **\n"); - -# <> is a magic filehandle - either reading lines from stdin or from file(s) specified on the command line -msg ("Get the data"); -$data = join "", <>; - -msg ("Replacing '\@-' with FIXUPmdashFIXUP"); -$data =~ s/\@-/FIXUPmdashFIXUP/g; - -msg ("Replacing '--' with FIXUPdoubledashFIXUP"); -$data =~ s/--/FIXUPdoubledashFIXUP/g; - -msg ("Turning \@strong{} into LITERAL blocks"); -$data =~ s/\@strong\{(.*?)\}/FIXUPstrongFIXUP$1FIXUPendstrongFIXUP/gs; - -msg ("Turning \@emph{} into LITERAL blocks"); -$data =~ s/\@emph\{(.*?)\}/FIXUPemphFIXUP$1FIXUPendemphFIXUP/gs; - -msg ("Turning \@file{} into LITERAL blocks"); -$data =~ s/\@file\{(.*?)\}/FIXUPfileFIXUP$1FIXUPendfileFIXUP/gs; - -msg ("Turning \@samp{} into LITERAL blocks"); -$data =~ s/\@samp\{\@\{\}/FIXUPsampFIXUP\@\{FIXUPendsampFIXUP/g; -$data =~ s/\@samp\{\@\}\}/FIXUPsampFIXUP\@\}FIXUPendsampFIXUP/g; -$data =~ s/\@samp\{\@\{n\@\}\}/FIXUPsampFIXUP\@\{n\@\}FIXUPendsampFIXUP/g; -$data =~ s/\@samp\{(.*?)\}/FIXUPsampFIXUP$1FIXUPendsampFIXUP/gs; - - -msg ("Write the data"); -print STDOUT $data; -exit; - -# -# Definitions for helper sub-routines -# - -sub msg { - print STDERR "docbook-prefix: ", shift, "\n"; -} - diff --git a/Docs/Support/docbook-split b/Docs/Support/docbook-split deleted file mode 100755 index eafb437efe4..00000000000 --- a/Docs/Support/docbook-split +++ /dev/null @@ -1,70 +0,0 @@ -#! /usr/bin/perl -w -# O'Reilly's Perl script to chop mysql.xml into separate ch/apps/index files. -# The indexes are actually not used, they're created straight from the xrefs. -# Breaks the MySQL reference manual into chapters, appendices, and indexes. - -use strict; - -my $app_letter = "a"; # Start appendix letters at "a" -my $chap_num = 1; # Start chapter numbers at one (there is no preface) -my $directory = "mysql_refman_" . time; -my $ext = ".xml"; -my $line = ""; -my $output_name = ""; -my $start_text = ""; - -mkdir $directory unless -d $directory; - -while (defined $line) { - if ($line =~ /(.*)/i ) { - $start_text = $1 . $2 . $3; - $output_name = lc($2) . $ext; - &process_file("index"); - } - else { - # Skip junk in between chapters, appendices and indexes. - $line = <>; - } -} - -sub process_file { - my $marker = shift; - my $path = "$directory/$output_name"; - - open (OUTPUT_FILE, ">$path") or die "Cannot open $path"; - - print STDERR "Creating $path\n"; - - # Print out XML PI - print OUTPUT_FILE "\n"; - - # Print whatever happened to appear at the end of the previous chapter. - print OUTPUT_FILE "$start_text\n" if $start_text; - - while (defined $line) { - $line = <>; - - # Note: Anything after the terminating marker is lost, just like - # lines in between chapters. - if ($line =~ /(.*<\/\s*$marker\s*>)/i ) { - print OUTPUT_FILE "$1\n" if $1; - close OUTPUT_FILE; - return; - } - print OUTPUT_FILE $line; - } -} - -exit 0; diff --git a/Docs/Support/make-docbook b/Docs/Support/make-docbook deleted file mode 100755 index 93dbc56c0f8..00000000000 --- a/Docs/Support/make-docbook +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# 2002-01-30 arjen@mysql.com -# Use this to create mysql.xml (the DocBook XML format output of manual.texi) -# Requires makeinfo 4.0c - -#create include.texi with version/port # - echo "@c This file is autogenerated by the Makefile" > include.texi - echo -n "@set mysql_version " >> include.texi -# grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \ -# sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi -# 2002-04-26 arjen - the below just picks #.# instead of #.#.#-alpha -# (code by mwagner - tnx) - grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \ - perl -p -e 's/AM_INIT_AUTOMAKE\(mysql,\s(\d+\.\d+)\..+/$1/' >> include.texi - echo -n "@set default_port " >> include.texi - grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \ - sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi - -# produce DocBook XML - Support/docbook-prefix.pl < manual.texi |\ - makeinfo --force --no-ifinfo --docbook -o - |\ - Support/docbook-fixup.pl > mysql.xml - - # See if the XML output is well-formed - xmlwf mysql.xml - - # If all is well, keep processing - cat mysql.xml | Support/colspec-fix.pl | Support/docbook-split; - diff --git a/Docs/Support/make-makefile b/Docs/Support/make-makefile deleted file mode 100755 index 79cf06091fe..00000000000 --- a/Docs/Support/make-makefile +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# Use this when you have deleted Makefile and do not want to do a full -# build to get it back - -cd .. -automake --gnu Docs/Makefile -CONFIG_FILES=Docs/Makefile CONFIG_HEADERS= sh ./config.status diff --git a/Docs/Support/test-make-manual b/Docs/Support/test-make-manual deleted file mode 100755 index bd4ed4b04e3..00000000000 --- a/Docs/Support/test-make-manual +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh - -needed_flags=0 -needed_texi2html=0 -needed_texinfo_tex=0 -needed_include_texi=0 - -if [ -z $BROWSER ]; then - BROWSER=netscape - echo "BROWSER not set, using $BROWSER" -fi - -die () -{ - echo - echo $1 - cleanup - exit 1 -} - -cleanup () -{ - echo "Cleaning up..." - if [ $needed_flags ]; then - bk clean Flags - fi - - if [ $needed_texi2html ]; then - bk clean Support/texi2html - fi - - if [ $needed_texinfo_tex ]; then - bk clean Support/texinfo.tex - fi - - if [ $needed_include_texi ]; then - rm -f include.texi - fi - - for file in \ - manual.aux manual.cp manual.cps manual.dvi \ - manual.fn manual.fns manual.ky manual.html \ - manual.pg manual.toc manual.tp manual.vr \ - mysql.info manual_toc.html ; - do - rm -f $file - done - -} - - -if [ -e Flags/usa.txt ]; then - echo "Good, Flags are there." -else - echo -n "Checking out Flags..." - bk edit Flags >/dev/null 2>&1 - echo " Done." - needed_flags=1 -fi - -if [ -e Support/texi2html ]; then - echo "Good, texi2html is there." -else - echo -n "Checking out texi2html..." - bk edit Support/texi2html >/dev/null 2>&1 - echo " Done." - needed_texi2html=1 -fi - -if [ -e Support/texinfo.tex ]; then - echo "Good, texinfo.tex is there." -else - echo -n "Checking out texinfo.tex..." - bk edit Support/texinfo.tex >/dev/null 2>&1 - echo " Done." - needed_texinfo_tex=1 -fi - -if [ -e include.texi ]; then - echo "Good, include.texi is there." -else - echo -n "Creating include.texi..." - bk edit ../configure.in >/dev/null 2>&1 - echo "@c This file was generated by test-make-manual" > include.texi - echo -n "@set mysql_version " >> include.texi - grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \ - sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi - echo -n "@set default_port " >> include.texi - grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \ - sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi - echo " Done." - needed_include_texi=1 -fi - -echo -n "Running makeinfo..." -makeinfo --no-split -I . manual.texi - -if [ $? != 0 ]; then - die "Manual has errors - fix before you commit" -else - echo " Looks good." -fi - - -echo -n "Running texi2html..." -/usr/bin/perl ./Support/texi2html -iso -number manual.texi - -if [ $? != 0 ]; then - die "Manual has errors - fix before you commit" -else - echo " Looks good." -fi - - -echo -n "Running texi2dvi..." -texi2dvi --batch manual.texi > texi2dvi.out - -if [ $? != 0 ]; then - die "Manual has errors - fix before you commit (saved in texi2dvi.out)" -else - rm texi2dvi.out - echo " Looks good." -fi - -echo -echo -echo "Please examine your modifications in \`manual.html'." -echo -echo "If you would like to use a different browser, set the 'BROWSER' environment" -echo "variable." -echo - -$BROWSER file:`pwd`/manual_toc.html - -echo "-- Press Enter to Continue --" -read junk -cleanup diff --git a/Docs/Support/test-make-manual-de b/Docs/Support/test-make-manual-de deleted file mode 100755 index a5c03001bda..00000000000 --- a/Docs/Support/test-make-manual-de +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh - -needed_flags=0 -needed_texi2html=0 -needed_texinfo_tex=0 -needed_include_texi=0 - -if [ -z $BROWSER ]; then - BROWSER=netscape - echo "BROWSER not set, using $BROWSER" -fi - -die () -{ - echo - echo $1 - cleanup - exit 1 -} - -cleanup () -{ - echo "Cleaning up..." - if [ $needed_flags ]; then - bk clean Flags - fi - - if [ $needed_texi2html ]; then - bk clean Support/texi2html - fi - - if [ $needed_texinfo_tex ]; then - bk clean Support/texinfo.tex - fi - - if [ $needed_include_texi ]; then - rm -f include.texi - fi - - for file in \ - manual.de.aux manual.de.cp manual.de.cps manual.de.dvi \ - manual.de.fn manual.de.fns manual.de.ky manual.de.html \ - manual.de.pg manual.de.toc manual.de.tp manual.de.vr \ - mysql.de.info manual.de_toc.html ; - do - rm -f $file - done - -} - - -if [ -e Flags/usa.txt ]; then - echo "Good, Flags are there." -else - echo -n "Checking out Flags..." - bk edit Flags >/dev/null 2>&1 - echo " Done." - needed_flags=1 -fi - -if [ -e Support/texi2html ]; then - echo "Good, texi2html is there." -else - echo -n "Checking out texi2html..." - bk edit Support/texi2html >/dev/null 2>&1 - echo " Done." - needed_texi2html=1 -fi - -if [ -e Support/texinfo.tex ]; then - echo "Good, texinfo.tex is there." -else - echo -n "Checking out texinfo.tex..." - bk edit Support/texinfo.tex >/dev/null 2>&1 - echo " Done." - needed_texinfo_tex=1 -fi - -if [ -e include.texi ]; then - echo "Good, include.texi is there." -else - echo -n "Creating include.texi..." - bk edit ../configure.in >/dev/null 2>&1 - echo "@c This file was generated by test-make-manual" > include.texi - echo -n "@set mysql_version " >> include.texi - grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \ - sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi - echo -n "@set default_port " >> include.texi - grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \ - sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi - echo " Done." - needed_include_texi=1 -fi - -echo -n "Running makeinfo..." -makeinfo --no-split -I . manual.de.texi - -if [ $? != 0 ]; then - die "Manual has errors - fix before you commit" -else - echo " Looks good." -fi - - -echo -n "Running texi2html..." -/usr/bin/perl ./Support/texi2html -iso -number manual.de.texi - -if [ $? != 0 ]; then - die "Manual has errors - fix before you commit" -else - echo " Looks good." -fi - - -echo -n "Running texi2dvi..." -texi2dvi --batch manual.de.texi > texi2dvi.out - -if [ $? != 0 ]; then - die "Manual has errors - fix before you commit (saved in texi2dvi.out)" -else - rm texi2dvi.out - echo " Looks good." -fi - -echo -echo -echo "Please examine your modifications in \`manual.de.html'." -echo -echo "If you would like to use a different browser, set the 'BROWSER' environment" -echo "variable." -echo - -$BROWSER file:`pwd`/manual.de_toc.html - -echo "-- Press Enter to Continue --" -read junk -cleanup diff --git a/Docs/Support/trivial-makeinfo-4.0c.patch b/Docs/Support/trivial-makeinfo-4.0c.patch deleted file mode 100644 index b2446c0e8bb..00000000000 --- a/Docs/Support/trivial-makeinfo-4.0c.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- alt-multi.c Sun Apr 14 10:03:19 2002 -+++ multi.c Tue May 22 20:52:33 2001 -@@ -287,7 +287,7 @@ - && *params != '\n' && *params != '@') - params++; - setup_output_environment (i, -- (int) ((columnfrac * 100.00) + 0.49)); -+ (int) (columnfrac * (fill_column - current_indent) + .5)); - } - } - diff --git a/Docs/Support/xwf b/Docs/Support/xwf deleted file mode 100755 index 38f89774fe8..00000000000 --- a/Docs/Support/xwf +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl -w -# -# Parse document and report first syntax (well-formedness) error found. -# - -use strict; -use XML::Parser; -use Getopt::Std; - -my %opts; -getopts('e', \%opts); -my $ENTREFS = exists( $opts{'e'} ); # flag: check ent refs - -my $parser = XML::Parser->new( - ErrorContext => 2, # output error context - ); - -# get input from files -if( @ARGV ) { - foreach( @ARGV ) { - my $file = $_; - unless( -r $file ) { - print STDERR "ERROR: Can't open '$file'.\n"; - return; - } - my $input = ''; - open( F, $file ); - while( ) { $input .= $_; } - close F; - - # parse and report errors - if( &parse_string( $input )) { - print STDERR "ERROR in $file:\n$@\n"; - } else { - print STDERR "'$file' is well-formed.\n"; - } - } - print "All files checked.\n"; - -# get input from STDIN -} else { - my $input = ""; - while( ) { $input .= $_; } - if( &parse_string( $input )) { - print STDERR "ERROR in stream:\n$@\n"; - } else { - print STDERR "No syntax errors found in XML stream.\n"; - } -} - - -# parse the string and return error message -# -# NOTE: By default, entity refs are not expanded. XML::Parser can be -# told not to expand entity refs, but will still try to find -# replacement text just in case, which we don't want. Therefore, we -# need to do a stupid regexp replacement, removing entities from input. -# -sub parse_string { - my $string = shift; - unless( $ENTREFS ) { - $string =~ s/\&[^\s;]+;//g; # remove entity references - } - eval { $parser->parse( $string ); }; - $@ =~ s/at \/.*?$//s; # remove module line number - return $@; -} diff --git a/Docs/Tutorial-MySQL-final.txt b/Docs/Tutorial-MySQL-final.txt deleted file mode 100644 index bd52554a611..00000000000 --- a/Docs/Tutorial-MySQL-final.txt +++ /dev/null @@ -1,1643 +0,0 @@ -8 Tutorial MySQL -======================= - -Este capítulo ofrece un tutorial de introducción a MySQL, mostrando cómo usar el programa cliente -mysql para crear y usar una simple base de datos. mysql (al que algunas veces nos referimos como -"monitor terminal" o simplemente "monitor") es un programa interactivo que te permite conectarte a -un servidor MySQL, ejecutar consultas y observar los resultados. mysql puede ser usado también en -modo batch: escribes tus consultas en un fichero de texto, para después pedirle a mysql que -ejecute el contenido del fichero. Se cubren aquí esas dos formas de usar de usar mysql. - -Para ver una lista de opciones proporcionadas por mysql, lánzalo con las opción --help : - - shell> mysql --help - -Este capítulo asume que mysql está instalado en tu máquina, y que hay disponible un servidor al que -te puedes conectar. Si esto no es así, contacta con tu administrador MySQL. (Si el administrador -eres tú, necesitarás consultar otra sección de este manual). - -El capítulo describe el proceso completo de configurar y usar una base de datos. Si estás interesado -sólo en acceder una base de datos ya existente, querrás saltar las secciones que describen cómo -crear la base de datos y las tablas que la contienen. - -Dado que este capítulo es un tutorial básico, se dejarán en el tintero muchos -detalles. Consulta las secciones relevantes del manual para más información sobre los temas -aquí cubiertos. - - -8.1 Conectando y desconectando del servidor -============================================= - - -Para conectarse al servidor, generalmente necesitarás facilitar un nombre de usuario MySQL cuando -lances el cliente mysql y, lo más probable, también un password. Si el servidor se está ejecutando -en una máquina distinta a la que estás conectado, necesitarás especificar también un nombre de -host. Contacta con tu administrador para averiguar qué parámetros de conexión necesitas usar para -conectar (es decir, qué host, nombre de usuario y password usar). Una vez que conozcas los -parámetros adecuados, deberás ser capaz de conectar de la siguiente forma: - -shell> mysql -h host -u user -p -Enter password: ******* -Welcome to the MySQL monitor. Commands end with ; or \g. -Your MySQL connection id is 459 to server version: 3.22.20a-log - -Type 'help' for help. - -mysql> - -El prompt te indica que mysql ya está listo para la introducción de comandos. - -Algunas instalaciones MySQL permiten a los usuarios conectarse como usuarios "anonymous" (sin -nombre) al servidor ejecutándose en el host local. Si este es el caso en tu máquina, deberías ser -capaz de conectar a ese servidor invocando mysql sin ninguna opción: - -shell> mysql - -Una vez que hayas conectado con éxito, puedes desconectarte en cualquier momento tecleando QUIT en -el prompt mysql> : - -mysql> QUIT -Bye - -También puedes desconectar tecleando control-D. - -La mayor parte de los ejemplos en las siguientes secciones asumen que estás conectado al -servidor. Lo indicarán por el prompt mysql> - - -8.2 Haciendo consultas -======================== - -Asegúrate de que estás conectado al servidor, como se ha discutido en secciones anteriores. El -hacerlo no implica que tengas seleccionada ninguna base de datos con la que trabajar, pero está -bien. En este punto, es más importante averiguar un poco sobre cómo lanzar consultas que lanzarse -directamente a la creación de tablas, cargar datos en ellas y recuperar los datos de las -mismas. Esta sección describe los principios básicos de la entrada de comandos, usando varias -consultas que puedes probar para familiarizarte con la forma de trabajo de mysql. - -Aquí presentamos un comando simple que pide al servidor que nos diga su número de versión y fecha -actual. Tecléalo como se muestra a continuación siguiendo el prompt mysql> y pulsa la tecla RETURN: - - -mysql> SELECT VERSION(), CURRENT_DATE; -+-----------+--------------+ -| version() | CURRENT_DATE | -+-----------+--------------+ -| 3.22.23b | 2000-01-05 | -+-----------+--------------+ -1 row in set (0.06 sec) - -mysql> - -Esta consulta ilustra muchas cosas sobre mysql: - -* Un comando consiste normalmente de una sentencia SQL seguida por un punto y coma. (Existen algunas - excepciones donde no es necesario el punto y coma. QUIT, mencionado más adelante, es una de - ellas. Conoceremos otras más adelante.) - -* Cuando lanzas un comando, mysql lo envía al servidor para su ejecución y muestra los resultados, - después imprime otro mysql> para indicar que está listo para otro comando. - -* mysql muestra la salida de una consulta como una tabla (filas y columnas). La primera fila - contiene etiquetas para las columnas. Las siguientes filas son el resultado de la - consulta. Normalmente, las etiquetas de las columnas son los nombres de las columnas que has - obtenido de la base de datos. Si pides el valor de una expresión en vez de una columna de una - tabla (como en el ejemplo anterior), mysql etiqueta la columna usando la propia expresión. - -* mysql muestra el número de filas que se han dado como resultado, y cuánto tiempo llevó la - ejecución de la consulta, lo que te da una idea aproximada del rendimiento del servidor. Estos - valores son imprecisos porque representan tiempo real (no tiempo de CPU o máquina), y porque están - afectados por factores como la carga del servidor y la latencia de la red. (Por cuestiones de - brevedad, la línea "rows in set" no se mostrará en los ejemplos posteriores de este capítulo.) - -Las palabras clave pueden ser tecleadas en cualquier combinación mayúscula/minúscula. Las siguientes -consultas son equivalentes: - -mysql> SELECT VERSION(), CURRENT_DATE; -mysql> select version(), current_date; -mysql> SeLeCt vErSiOn(), current_DATE; - -He aquí otra consulta. Demuestra que puedes usar mysql como una calculadora sencilla: - -mysql> SELECT SIN(PI()/4), (4+1)*5; -+-------------+---------+ -| SIN(PI()/4) | (4+1)*5 | -+-------------+---------+ -| 0.707107 | 25 | -+-------------+---------+ - -Los comandos vistos hasta aquí han sido relativamente cortos, sentencias de una sola línea. También puedes -insertar múltiples sentencias en una sola línea. Simplemente, termina cada una con un punto y coma: - -mysql> SELECT VERSION(); SELECT NOW(); - -+-----------+ -| version() | -+-----------+ -| 3.22.23b | -+-----------+ - -+---------------------+ -| NOW() | -+---------------------+ -| 2000-01-05 17:33:16 | -+---------------------+ - -Un comando no necesita ser dado todo en una sóla línea, así pues, los comandos largos que requieran -varias lineas no son un problema. mysql determina cuando termina tu sentencia buscando el punto y -coma final, no buscando el final de la línea de entrada. (En otras palabras, mysql acepta entrada de -libre formato: recoleta las líneas de entrada pero no las ejecutahasta que vea el punto y coma.) - -Aquí tenemos un simple ejemplo de múltiples líneas: - -mysql> SELECT - -> USER() - -> , - -> CURRENT_DATE; -+----------------+--------------+ -| USER() | CURRENT_DATE | -+----------------+--------------+ -| root@localhost | 2000-01-05 | -+----------------+--------------+ - -En este ejemplo, observa como cambia el prompt de mysql> a -> una vez que has insertado la primera -línea de una consulta multi-línea. Esta es la forma en que mysql indica que no ha encontrado una -sentencia completa y que está esperando por el resto. El prompt es tu amigo, dado que ofrece una -retroalimentación (feedback) significativa. Si usas ese feedback, siempre sabrás a qué está -esperando mysql. - -Si decides que no quieres ejecutar un comando que está en proceso de introducción, puedes cancelarlo -tecleando \c : - -mysql> SELECT - -> USER - -> \c -mysql> - -Observa aquí también el prompt. Ha vuelto a mysql> tras haber tecleado \c, ofreciendo un feedback -que indica que mysql está listo para un nuevo comando. - -La siguiente tabla muestra cada uno de los prompts que puedes ver y resume qué es lo que significan -y el estado en el que se encontrará mysql: - -Prompt Significado -mysql> Listo para un nuevo comando - -> Esperando una nueva línea de una consulta multi-línea - '> Esperando la siguiente línea, se ha insertado una línea que comienza con (') - "> Esperando la siguiente línea, se ha insertado una línea que comienza con (") - -Las sentencias multi-línea ocurren comúnmente "por accidente" cuando intentas lanzar un comando en -una única línea, pero olvidas el punto y coma del final. En este caso, mysql espera más entrada: - -mysql> SELECT USER() - -> - -Si esto es lo que te ocurre (crees que has introducido una sentencia pero la única respuesta es un -prompt como ->), lo más probable es que mysql esté esperando por el punto y coma. Si no observas qué -es lo que te dice el prompt, podrías quedarte esperando un buen rato antes de enterarte de qué es lo -que sucede. Introduce un punto y coma para completar la sentencia, y mysql la ejecutará: - -mysql> SELECT USER() - -> ; -+----------------+ -| USER() | -+----------------+ -| root@localhost | -+----------------+ - -Los prompts '> y "> ocurren durante la recogida de strings. En MySQL, puedes escribir strings -encerrados por comillas simples (') o dobles (") (por ejemplo, 'hola' o "adios"), y mysql te permite -introducir también strings que se cortan en múltiples líneas. Cuando veas un prompt como '> ó ">, -significa que has introducido una línea que contenía un string que comenzaba por (') o ("), pero que -no has introducido aún la comilla (simple o doble) de cierre. Esto está bien si realmente estabas -introduciendo un string multi-línea, pero no es lo más normal. Lo que sí es más normal, es que los -prompts '> ó "> indiquen que te has olvidado del caracter de cierre " ó '. Por ejemplo: - -mysql> SELECT * FROM mi_tabla WHERE nombre ="García AND edad < 30; - "> - -Si tecleas esta sentencia SELECT, después pulsas ENTER y esperas por el resultado, no sucederá -nada. En lugar de preocuparte, "¿por qué tarda tanto esta consulta?", observa la pista que te ofrece -el prompt "> . Esto te indica que mysql espera ver el resto de un string que aún no ha -terminado. (¿Ves el error en la sentencia? La cadena "García ha perdido las comillas de cierre.) - -Llegados a este punto, ¿qué puedes hacer?. Lo más fácil es cancelar el comando. Sin embargo, no -puedes teclear simplemente \c en este ejemplo, dado que mysql ¡lo interpretará como parte del string -que está leyendo! En vez de eso, introduce las comillas de cierre (para que mysql sepa que ya has -terminado de introducir el string), y después teclea \c : - -mysql> SELECT * FROM mi_tabla WHERE nombre ="García AND edad < 30; - "> "\c -mysql> - -El prompt vuelve a cambiar a mysql>, indicando que mysql está listo para un nuevo comando. - -Es importante saber qué significan los prompts '> y ">, dado que si introduces por error un string -sin cerrar, cualquier otra línea que introduzcas serán ignoradas por mysql - ¡incluyendo una línea -que contenga QUIT! Esto puede ser bastante confuso, especialmente si no sabes que debes introducir -la comilla de cierre antes de poder cancelar el comando actual. - -8.3 Creando y usando una base de datos -========================================== - -Ahora que sabes como introducir comandos, es hora de acceder a la base de datos. - -Supon que tienes varias mascotas en tu casa (tu pequeño "zoo") y que te gustaría llevar un control -de varios tipos de información sobre estos animales. Puedes hacerlo creando tablas que guarden tus -datos y cargandolas con la información deseada. Después puedes responder a diferentes series de -preguntas sobre tus animales extrayendo los datos de las tablas. Esta sección explica cómo hacer -todo esto: - -* Cómo crear una base de datos -* Cómo crear una tabla -* Cómo cargar los datos en la tabla -* Cómo extraer información de la tabla de varias maneras -* Cómo usar múltiples tablas - -La base de datos del zoo será simple (deliberadamente), pero no es difícil pensar en situaciones del -mundo real en las que se pudiera utilizar una base de datos similar. Por ejemplo, se podría usar una base -de datos como ésta en una granja para llevar un control del ganado, o por un veterinario para -controlar el historial de sus pacientes. - -Usa la sentencia SHOW para averiguar qué bases de datos existen actualmente en el servidor: - -mysql> SHOW DATABASES; -+----------+ -| Database | -+----------+ -| mysql | -| test | -+----------+ - -Probablemente, la lista de las bases de datos será diferente en tu máquina, pero las bases de datos -mysql y test es probable que se encuentren en esa lista. Se requiere la base de datos mysql pues -describe los privilegios de acceso de los usuarios. La base de datos test se ofrece como campo de -pruebas para que los usuarios prueben ahí sus teorías. - -Si la base de datos test existe, intenta acceder a ella: - -mysql> USE test -Database changed - -Observa que USE, como QUIT, no requiere un punto y coma. (Puedes terminar este tipo de sentencias -con un punto y coma si quieres, pero no es necesario.) La sentencia USE es especial en otro sentido, -también: debe ser tecleada en una sola línea. - -Puedes usar la base de datos test (si tienes acceso a ella) para los ejemplos que siguen, pero -cualquier cosa que crees en dicha base de datos puede ser eliminada por cualquiera que tenga acceso -a ella. Por esta razón, deberías pedir a tu administrador MySQL permisos para usar una base de datos -propia. Suponte que le quieres llamar zoo. El administrador necesitará ejecutar entonces la -siguiente orden: - -mysql> GRANT ALL ON zoo.* TO tu_nombre; - -donde tu_nombre es el nombre de usuario MySQL que tengas asignado. - -ejemplo: - -mysql> GRANT ALL ON zoo.* TO chessy@localhost; -Query OK, 0 rows affected (0.08 sec) - - -8.3.1 Creando y seleccionando una base de datos -================================================== - -Si el administrador creó la base de datos para tí cuando te configuró los permisos, puedes comenzar -a usarla. En otro caso, deberás crearla tú mismo: - -[chessy@bishito chessy]$ mysql -u chessy -Welcome to the MySQL monitor. Commands end with ; or \g. -Your MySQL connection id is 6 to server version: 3.22.23b - -Type 'help' for help. - -mysql> CREATE DATABASE zoo; -Query OK, 1 row affected (0.02 sec) - - -Bajo Unix, los nombres de bases de datos son sensibles a las mayúsculas/minúsculas (a diferencia de -los comandos SQL), así que deberás referirte siempre a tu base de datos con el nombre zoo, no como -Zoo, ZOO o cualquier otra variante. Es es así también para las tablas. (Bajo Windows, esta -restricción desaparece, aunque deberías referirte a las bases de datos y a las tablas usando la -misma sintaxis en tus consultas.) - -Crear una base de datos no la selecciona para su uso, debes hacerlo explícitamente. Para hacer que -la base de datos zoo sea tu base de datos de trabajo, usa el comando: - -mysql> USE zoo; -Database changed - -Tu base de datos sólo necesita ser creada una vez, pero debes seleccionarla para usarla cada vez que -comiences una sesión mysql. Puedes hacerlo lanzando un comando USE como se ha visto en el -ejemplo. Alternativamente, puedes seleccionar la base de datos desde la línea de comandos cuando -lanzas mysql. Simplemente especifica su nombre tras los parámetros de conexión que hayas -escrito. Por ejemplo: - -shell> mysql -h host -u user -p zoo -Enter password: ******** - -Observa que en la línea de comandos del ejemplo, zoo no es tu password. Si quieres introducir tu -password como parámetro en la línea de comandos tras la opción -p, debes hacerlo sin teclear un -espacio en blanco intermedio (es decir, como -pmi_password, no como -p mi_password). Sin embargo, no -es recomendable poner tu password en la línea de comandos, pues hacerlo lo expone a posibles -miradas de otros usuarios conectados a tu máquina. - -8.3.2 Creando una tabla -============================ - -Crear una tabla es la parte fácil, pero hasta este momento está vacía, como te dice la orden SHOW -TABLES: - -mysql> SHOW TABLES; -Empty set (0.00 sec) - -La parte más dura consiste en decidir cual va a ser la estructura de tu base de datos: qué tablas -necesitarás, y qué columnas tendrá cada una de ellas. - -Querrás seguramente una tabla que contenga un registro por cada una de tus mascotas. Esta tabla -puede llamarse mascotas, y debería contener, como mínimo, el nombre de cada animal. Dado que el -nombre por sí solo no es muy interesante, la tabla debería contener otra información. Por ejemplo, -si más de una persona de tu familia tiene mascotas, probablemente quieras listar el propietario de -cada animal. También querrás guardar información descriptiva básica como puede ser la especie y el -sexo de cada mascota. - -¿Qué pasa con la edad? Podría ser de interés, pero no es una buena cosa a guardar en una base de -datos. La edad cambia a medida que pasa el tiempo, lo que significa que tendrás que actualizar tus -registros a menudo. En vez de eso, es mejor almacenar un valor fijo como la edad de -nacimiento. Después, cada vez que necesites saber la edad, puedes calcularla como la diferencia -entre la fecha actual y la fecha de nacimiento. MySQL ofrece funciones para realizar cálculos -aritméticos entre fechas, por lo que esto no es difícil. Almacenar la fecha de nacimiento en lugar -de la edad tiene también otras ventajas: - -* Puedes usar la base de datos para generar recordatorios de cumpleaños de mascotas. (Si crees que - este tipo de consulta es algo tonta, observa que es la misma pregunta que necesitarás hacer en el - contexto de una base de datos de un negocio para identificar clientes a los que pronto necesitarás - mandar un saludo por su cumpleaños, para ese toque personal asistido por ordenador :-) - -* Puedes calcular la edad en relación a fechas distintas a la fecha actual. Por ejemplo, si - almacenas la fecha de muerte en la base de datos, puedes calcular fácilmente lo vieja que era una - mascota cuando murió. - -Seguramente puedas pensar en otros tipos de información que sería útil en la tabla mascota, pero los -identificados hasta ahora son suficientes por el momento: nombre, propietarios, especie, sexo, fecha -de nacimiento y muerte. - -Usa una sentencia CREATE TABLE para especificar la estructura de tu tabla: - -mysql> CREATE TABLE mascota (nombre VARCHAR(20), propietario VARCHAR(20), - -> especie VARCHAR(20), sexo CHAR(1), nacimiento DATE, muerte DATE); - -VARCHAR es una buena elección para las columnas nombre, propietario y especie dado que los valores -de estas columnas variarán su longitud. Las longitudes de estas columnas no necesitan ser iguales, y -no necesitan ser 20. Puedes elegir cualquier longitud entre 1 y 255, cualquiera que te parezca -razonable. (Si realizar una elección pobre y resulta que más adelante necesitas un campo mayor, -MySQL ofrece una sentencia ALTER TABLE.) - -El sexo del animal puede ser representado en una variedad de formas, por ejemplo, "m" y "f", o -quizás "masculino" y "femenino". Es más simple usar un único caracter, "m" ó "f". - -El uso del tipo de datos DATE para las columnas de nacimiento y muerte es una opción bastante -obvia. - -Ahora que ya has creado una tabla, SHOW TABLES debería producir alguna salida: - -mysql> SHOW TABLES; -+---------------+ -| Tables in zoo | -+---------------+ -| mascota | -+---------------+ - -Para verificar que tu tabla fue creada de la forma que esperabas, usa una sentencia DESCRIBE: - -mysql> DESCRIBE mascota; -+-------------+-------------+------+-----+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------------+-------------+------+-----+---------+-------+ -| nombre | varchar(20) | YES | | NULL | | -| propietario | varchar(20) | YES | | NULL | | -| especie | varchar(20) | YES | | NULL | | -| sexo | char(1) | YES | | NULL | | -| nacimiento | date | YES | | NULL | | -| muerte | date | YES | | NULL | | -+-------------+-------------+------+-----+---------+-------+ - -Puedes usar DESCRIBE en cualquier momento, por ejemplo, si olvidas los nombres de las columnas de tu -tabla o a qué tipo de datos pertenecen. - -8.3.3 Cargando datos en una tabla -===================================== - -Una vez creada tu tabla, necesitas poblarla. Las sentencias LOAD DATA e INSERT son útiles para esto. - -Suponte que tus registros de mascotas pueden ser descritos como se muestra más abajo. (Observa que -MySQL espera que las fechas se introduzcan en formato AAAA-MM-DD; esto podría ser diferente a lo que -estás acostumbrado.) - -nombre propietario especie sexo nacimiento muerte -Fluffy Harold gato f 1993-02-04 -Claws Gwen gato m 1994-03-17 -Buffy Harold perro f 1989-05-13 -Fang Benny perro m 1990-08-27 -Bowser Diane perro m 1998-08-31 1995-07-29 -Chirpy Gwen pájaro f 1998-09-11 -Whistler Gwen pájaro 1997-12-09 -Slim Benny serpiente m 1996-04-29 - -Dado que estás comenzando con una tabla vacía, una forma sencilla de poblarla consiste en crear un -fichero de texto conteniendo una fila para cada uno de tus animales, y después cargar el contenido del -fichero en la tabla con una sola sentencia. - -Puedes crear un fichero de texto "mascota.txt" conteniendo un registro por línea, con valores separados -por tabuladores, y dados en el orden en el que las columnas fueron listadas en la sentencia CREATE -TABLE. Para valores perdidos (como sexos desconocidos, o fechas de muerte de animales que aún están -vivos), puedes usar valores NULL. Para representar estos en tu fichero de texto, use \N. Por -ejemplo, el registro para Whistler el pájaro sería algo como esto (donde el espacio en blanco entre -valores es un simple caracter de tabulación): - -Whistler Gwen pájaro \N 1997-12-09 \N - -Para cargar el fichero de texto "mascota.txt" en la tabla mascota, usa este comando: - -mysql> LOAD DATA LOCAL INFILE "mascota.txt" INTO TABLE mascota; - -Puedes especificar el valor de separación de columna y el marcador de final de línea explícitamente -en la sentencia LOAD DATA si lo deseas, pero por defecto equivalen a TAB y LF (intro). Estos valores -por defecto son suficientes para que la sentencia que lee el fichero "mascota.txt" funcione -correctamente. - -Cuando quieras añadir nuevos registros uno a uno, la sentencia INSERT es muy útil. En su forma más -simple, ofreces valores para cada columna, en el orden en el que las columnas fueron listadas en la -sentencia CREATE TABLE. Supón que Diane consige un nuevo hamster llamado Puffball. Podrías añadir un -nuevo registro usando una sentencia INSERT como esta: - -mysql> INSERT INTO mascota - -> VALUES ('Puffball','Diane','hamster','f','1999-03-30',NULL); - -Observa que los valores string y fecha se espefican encerrados entre comillas. Observa también que, -con INSERT, puedes insertar NULL directamente para representar un valor perdido. No usamos \N como -hacíamos con LOAD DATA. - -De este ejemplo, deberías ser capaz de ver que hubiera dido mucho más costoso teclear todos los -datos necesarios en la tabla mascota con sentencias INSERT que hacerlo como lo hemos hecho con una -única sentencia LOAD DATA. - - -8.3.4 Extrayendo información de una tabla -=============================================== - - -La sentencia SELECT se usa para recabar información de una tabla. La forma -general de la sentencia es: - -SELECT qué_seleccionar -FROM de_qué_tabla -WHERE condiciones_a_satisfacer - -qué_seleccionar indica qué es lo que quieres seleccionar. Puede ser una lista de -columnas, o * para indicar "todas las columnas". de_qué_tabla indica la tabla de -la que quieres extraer datos. La claúsula WHERE es opcional. Si está presente, -condiciones_a_satisfacer especifica las codiciones que las filas deben cumplir -para estar presentes en el resultado de la selección. - -8.3.4.1 Seleccionando todos los datos -======================================= - -La forma más simplede SELECT recoge toda la información de una tabla: - -mysql> SELECT * FROM mascota; -+----------+-------------+-----------+------+------------+------------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+----------+-------------+-----------+------+------------+------------+ -| Bluffy | Harold | gato | f | 1993-02-04 | NULL | -| Claws | Gwen | gato | m | 1994-03-17 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -| Fang | Benny | perro | m | 1990-08-27 | NULL | -| Bowser | Diane | perro | m | 1998-08-31 | 1995-07-29 | -| Chirpy | Gwen | pájaro | f | 1998-09-11 | NULL | -| Whistler | Gwen | pájaro | NULL | 1997-12-09 | NULL | -| Slim | Benny | serpiente | m | 1996-04-29 | NULL | -| Puffball | Diane | hamster | f | 1999-03-30 | NULL | -+----------+-------------+-----------+------+------------+------------+ - -Esta forma de SELECT es útil si quieres revisar tu tabla al completo, por -ejemplo, tras haberla cargado con tu conjunto inicial de datos. Como suele -suceder, la salida ya muestra un error en tu fichero de datos: Bowser ¡parece -haber nacido tras su muerte! Consultando tus papeles originales sobre el -pedigree del perro, descubres que la fecha correcta de nacimiento es 1989, no -1998. - -Existen al menos un par de maneras de arreglar esto: - -* Edita el fichero "mascota.txt" para corregir el error, después vacía la tabla - y vuelve a cargarla usando DELETE y LOAD DATA: - -mysql> DELETE from mascota; -mysql> LOAD DATA LOCAL INFILE "mascota.txt" INTO TABLE mascota; - -Sin embargo, si haces esto, debes re-escribir el registro para Puffball. - -* Arreglar sólo el registro erróneo con la sentencia UPDATE: - -mysql> UPDATE mascota SET nacimiento="1989-08-31" WHERE nombre="Bowser"; - -Como se muestra más arriba, es fácil recuperar el cuerpo de una data. Pero -típicamente no querrás hacer eso, en particular cuando la tabla sea muy -larga. Generalmente, estarás más interesado en responder a una pregunta en -particular, en cuyo caso deberás especificar algunas restricciones en la -información que deseas. Veamos algunas consultas de selección en términos de -preguntas sobre tus mascotas que se deben responder. - -8.3.4.2 Seleccionando filas en particular -============================================= - -Puedes seleccionar sólo filas en particular de tu tabla. Por ejemplo, si quieres -verificar el cambio que has realizado a la fecha de nacimiento de Bowser, -selecciona el registro de Bowser de la siguiente forma: - -mysql> SELECT * FROM mascota WHERE nombre="Bowser"; -+--------+-------------+---------+------+------------+------------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+------------+ -| Bowser | Diane | perro | m | 1989-08-31 | 1995-07-29 | -+--------+-------------+---------+------+------------+------------+ - -La salida confirma que el año está correctamente registrado como 1989, no 1998. - -Las comparaciones de cadenas de texto son normalmente insensibles a las -mayúsculas/minúsculas, por lo que puedes especificar el nombre como "bowser", -"BOWSER", etc. El resultado de la consulta será el mismo. - -Puedes especificar condiciones en cualquier columna, no sólo el nombre. Por -ejemplo, si quisieras saber qué animales nacieron a partir de 1998, examina la -columna nacimiento: - -mysql> SELECT * FROM mascota WHERE nacimiento >= "1998-1-1"; -+----------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+----------+-------------+---------+------+------------+--------+ -| Chirpy | Gwen | pájaro | f | 1998-09-11 | NULL | -| Puffball | Diane | hamster | f | 1999-03-30 | NULL | -+----------+-------------+---------+------+------------+--------+ - -Puedes combinar condiciones, por ejemplo, para localizar los perros hembra: - -mysql> SELECT * FROM mascota WHERE especie="perro" AND sexo="f"; -+--------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+--------+ -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -+--------+-------------+---------+------+------------+--------+ - -La consulta anterior usa el operador lógico AND. Existe también un operador OR: - -mysql> SELECT * FROM mascota WHERE especie="serpiente" OR especie="pájaro"; -+----------+-------------+-----------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+----------+-------------+-----------+------+------------+--------+ -| Chirpy | Gwen | pájaro | f | 1998-09-11 | NULL | -| Whistler | Gwen | pájaro | NULL | 1997-12-09 | NULL | -| Slim | Benny | serpiente | m | 1996-04-29 | NULL | -+----------+-------------+-----------+------+------------+--------+ - -AND y OR pueden entremezclarse. Si lo haces, es una buena idea el utilizar -paréntesis para indicar cómo deberían agruparse las condiciones: - -mysql> SELECT * FROM mascota WHERE (especie="gato" AND sexo="m") - -> OR (especie="perro" AND sexo="f"); -+--------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+--------+ -| Claws | Gwen | gato | m | 1994-03-17 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -+--------+-------------+---------+------+------------+--------+ - -8.3.4.3 Seleccionando columnas en particular -=================================================== - -Si no quieres ver filas completas de tu tabla, simplemente nombra las columnas -en las cuales estás interesado, separadas por comas. Por ejemplo, si quieres -saber cuándo nacieron tus animales, selecciona las columnas nombre y nacimiento: - -mysql> SELECT nombre, nacimiento FROM mascota; -+----------+------------+ -| nombre | nacimiento | -+----------+------------+ -| Bluffy | 1993-02-04 | -| Claws | 1994-03-17 | -| Buffy | 1989-05-13 | -| Fang | 1990-08-27 | -| Bowser | 1989-08-31 | -| Chirpy | 1998-09-11 | -| Whistler | 1997-12-09 | -| Slim | 1996-04-29 | -| Puffball | 1999-03-30 | -+----------+------------+ - -Para averiguar quién posee mascotas, usa esta consulta: - -mysql> SELECT propietario FROM mascota; -+-------------+ -| propietario | -+-------------+ -| Harold | -| Gwen | -| Harold | -| Benny | -| Diane | -| Gwen | -| Gwen | -| Benny | -| Diane | -+-------------+ - -Sin embargo, observa que la consulta simplemente obtiene el campo propietario de -cada registro, y algunos de ellos aparecen más de una vez. Para minimizar la -salida, obtén cada registro de salida único una sola vez añadiendo la palabra -reservada DISTINCT: - -mysql> SELECT DISTINCT propietario FROM mascota; -+-------------+ -| propietario | -+-------------+ -| Benny | -| Diane | -| Gwen | -| Harold | -+-------------+ - -Puedes usar una claúsula WHERE para combinar la selección de filas con la -selección de columnas. Por ejemplo, para conseguir sólo las fechas de nacimiento -de perros y gatos, usa esta consulta: - -mysql> SELECT nombre, especie, nacimiento FROM mascota - -> WHERE especie = "perro" OR especie = "gato"; -+--------+---------+------------+ -| nombre | especie | nacimiento | -+--------+---------+------------+ -| Bluffy | gato | 1993-02-04 | -| Claws | gato | 1994-03-17 | -| Buffy | perro | 1989-05-13 | -| Fang | perro | 1990-08-27 | -| Bowser | perro | 1989-08-31 | -+--------+---------+------------+ - -8.3.4.4 Ordenando filas -=========================== - -Tal vez hayas observado que en los ejemplos anteriores las filas del resultado -se muestran sin ningún tipo de orden en particular. Sin embargo, a menudo es más -fácil de examinar la salida de una consulta cuando las filas están ordenadas de -alguna manera en particular. Para ordenar un resultado, usa la claúsula ORDER -BY. - -Aquí mostramos las fechas de nacimiento de los animales, ordenadas por fecha: - -mysql> SELECT nombre, nacimiento FROM mascota ORDER BY nacimiento; -+----------+------------+ -| nombre | nacimiento | -+----------+------------+ -| Buffy | 1989-05-13 | -| Bowser | 1989-08-31 | -| Fang | 1990-08-27 | -| Bluffy | 1993-02-04 | -| Claws | 1994-03-17 | -| Slim | 1996-04-29 | -| Whistler | 1997-12-09 | -| Chirpy | 1998-09-11 | -| Puffball | 1999-03-30 | -+----------+------------+ - -Para ordenar de forma inversa, añade la palabra reservada DESC (descendente) al -nombre de la columna por la que estás ordenando: - -mysql> SELECT nombre, nacimiento FROM mascota ORDER BY nacimiento DESC; -+----------+------------+ -| nombre | nacimiento | -+----------+------------+ -| Puffball | 1999-03-30 | -| Chirpy | 1998-09-11 | -| Whistler | 1997-12-09 | -| Slim | 1996-04-29 | -| Claws | 1994-03-17 | -| Bluffy | 1993-02-04 | -| Fang | 1990-08-27 | -| Bowser | 1989-08-31 | -| Buffy | 1989-05-13 | -+----------+------------+ - -Puedes ordenar por múltiples columnas. Por ejemplo, para ordenar por tipo de -animal, después por fecha de nacimiento dentro del mismo tipo de animal estando -los animales más jóvenes primero, usa la siguiente consulta: - -mysql> SELECT nombre, especie, nacimiento FROM mascota ORDER BY especie, nacimiento DESC; -+----------+-----------+------------+ -| nombre | especie | nacimiento | -+----------+-----------+------------+ -| Claws | gato | 1994-03-17 | -| Bluffy | gato | 1993-02-04 | -| Puffball | hamster | 1999-03-30 | -| Chirpy | pájaro | 1998-09-11 | -| Whistler | pájaro | 1997-12-09 | -| Fang | perro | 1990-08-27 | -| Bowser | perro | 1989-08-31 | -| Buffy | perro | 1989-05-13 | -| Slim | serpiente | 1996-04-29 | -+----------+-----------+------------+ - -Observa que la palabra reservada DESC se aplica sólo al nombre de columna que -preceda a la palabra reservada (nacimiento); los valores especie siguen siendo -ordenados en forma ascendente. - -8.3.4.5 Cálculos de fecha -============================ - -MySQL ofrece muchas funciones que puedes usar para realizar cálculos con fechas, -por ejemplo, para calcular edades o extraer partes de fechas. - -Para determinar cuantos años tiene cada una de tus mascotas, puedes calcular la -edad como la diferencia entre la fecha de nacimiento y la fecha actual. Puedes -hacerlo convirtiendo las dos fechas a dias, coge la diferencia, y divídela por -365 (el número de dias en un año): - -mysql> select nombre, (TO_DAYS(NOW())-TO_DAYS(nacimiento))/365 FROM mascota; -+----------+------------------------------------------+ -| nombre | (TO_DAYS(NOW())-TO_DAYS(nacimiento))/365 | -+----------+------------------------------------------+ -| Bluffy | 6.94 | -| Claws | 5.83 | -| Buffy | 10.68 | -| Fang | 9.39 | -| Bowser | 10.38 | -| Chirpy | 1.34 | -| Whistler | 2.10 | -| Slim | 3.71 | -| Puffball | 0.79 | -+----------+------------------------------------------+ - -Aunque la consulta funcione, existen algunos puntos que podrían ser -mejorados. Primero, el resultado podría ser revisado más fácilmente si las filas -se presentaran ordenadas de alguna manera. Segundo, la cabecera de la columna -edad no es muy significativa. - -El primer problema puede ser solucionado añadiendo una cláusula ORDER BY nombre -para ordenar la salida por nombre. Para arreglar el tema del encabezamiento de -columna, puedes darle un nombre a dicha columna de tal forma que aparezca una -etiqueta diferente en la salida (esto es lo que se llama un alias de columna): - -mysql> select nombre, (TO_DAYS(NOW())-TO_DAYS(nacimiento))/365 AS edad - -> FROM mascota ORDER BY nombre; -+----------+-------+ -| nombre | edad | -+----------+-------+ -| Bluffy | 6.94 | -| Bowser | 10.38 | -| Buffy | 10.68 | -| Chirpy | 1.34 | -| Claws | 5.83 | -| Fang | 9.39 | -| Puffball | 0.79 | -| Slim | 3.71 | -| Whistler | 2.10 | -+----------+-------+ - -Para ordenar la salida por edad en lugar de por nombre, puedes hacerlo usando -símplemente una cláusula ORDER BY diferente: - -mysql> select nombre, (TO_DAYS(NOW())-TO_DAYS(nacimiento))/365 AS edad - -> FROM mascota ORDER BY edad; -+----------+-------+ -| nombre | edad | -+----------+-------+ -| Puffball | 0.79 | -| Chirpy | 1.34 | -| Whistler | 2.10 | -| Slim | 3.71 | -| Claws | 5.83 | -| Bluffy | 6.94 | -| Fang | 9.39 | -| Bowser | 10.38 | -| Buffy | 10.68 | -+----------+-------+ - -Puede usarse una consulta similar para determinar la edad de la muerte para los -animales que hayan muerto. Puedes determinar qué animales son estos comprobando -si el valor muerte es NULL o no. Después, para aquellos que no tengan un valor -NULL, calcular la diferencia entre los valores muerte y nacimiento: - -mysql> select nombre, nacimiento, muerte, - -> (TO_DAYS(NOW())-TO_DAYS(nacimiento))/365 AS edad - -> FROM mascota WHERE muerte IS NOT NULL ORDER BY edad; -+--------+------------+------------+-------+ -| nombre | nacimiento | muerte | edad | -+--------+------------+------------+-------+ -| Bowser | 1989-08-31 | 1995-07-29 | 10.38 | -+--------+------------+------------+-------+ - -La consulta usa muerte IS NOT NULL en lugar de muerte != NULL dado que NULL es -un valor especial. Esto se explica más adelante. [Puedes consultar la sección -[Working with NULL] del manual de MySQL. - -¿Qué harías si quisieras saber qué animales cumplen años el mes que viene? Para -este tipo de cálculos, año y día son irrelevantes, simplemente querrás extraer -la parte mes de la columna nacimiento. MySQL ofrece muchas funciones de -extracción de parte-de-fecha, como YEAR(),MONTH() y DAY(). La función apropiada -para nuestro problema es MONTH(). Para ver cómo funciona, ejecuta una consulta -rápida que muestre el valor de la fecha de nacimiento y el mes de nacimiento -(MONTH(nacimiento)): - -mysql> SELECT nombre, nacimiento, MONTH(nacimiento) FROM mascota; -+----------+------------+-------------------+ -| nombre | nacimiento | MONTH(nacimiento) | -+----------+------------+-------------------+ -| Bluffy | 1993-02-04 | 2 | -| Claws | 1994-03-17 | 3 | -| Buffy | 1989-05-13 | 5 | -| Fang | 1990-08-27 | 8 | -| Bowser | 1989-08-31 | 8 | -| Chirpy | 1998-09-11 | 9 | -| Whistler | 1997-12-09 | 12 | -| Slim | 1996-04-29 | 4 | -| Puffball | 1999-03-30 | 3 | -+----------+------------+-------------------+ - -Buscar animales que hayan nacido en el mes próximo es también sencillo de -realizar. Suponte que Abril es el mes actual. Entonces el valor del mes es 4 y -lo que buscas son animales nacidos en Mayo (mes 5): - -mysql> SELECT nombre, nacimiento FROM mascota WHERE MONTH(nacimiento) = 5; -+--------+------------+ -| nombre | nacimiento | -+--------+------------+ -| Buffy | 1989-05-13 | -+--------+------------+ - -Existe una pequeña complicación si el mes actual es Diciembre, por supuesto. No -puedes añadir simplemente uno al número de mes (12) y buscar animales nacidos en -el mes 13, dado que no existe tal mes. En lugar de eso, debes buscar animales -nacidos en Enero (mes 1). - -Puedes escribir la consulta de tal forma que funcione independientemente del mes -en el que estemos. De esa forma no tendrás que usar un número de mes en -particular en la consulta. DATE_ADD() te permite añadir un intervalo de tiempo a -una fecha dada. Si añades un mes al valor de NOW(), y después extraes la parte -del mes con MONTH(), el resultado produce el mes del cumpleaños que buscamos: - - -mysql> select NOW(); -+---------------------+ -| NOW() | -+---------------------+ -| 2000-01-13 18:13:09 | -+---------------------+ - -mysql> SELECT nombre, nacimiento FROM mascota - -> WHERE MONTH(nacimiento) = MONTH(DATE_ADD(NOW(),INTERVAL 1 MONTH)); -+--------+------------+ -| nombre | nacimiento | -+--------+------------+ -| Bluffy | 1993-02-04 | -+--------+------------+ - -Una manera difente de conseguir los mismos resultados es añadir 1 al mes actual -para conseguir el mes siguiente (tras usar la función módulo (MOD) para -convertir el valor de mes actual en 0 si estamos en Diciembre (mes 12)): - -mysql> SELECT nombre, nacimiento FROM mascota - -> WHERE MONTH(nacimiento) = MOD(MONTH(NOW()),12) +1; -+--------+------------+ -| nombre | nacimiento | -+--------+------------+ -| Bluffy | 1993-02-04 | -+--------+------------+ - - -8.3.4.6 Trabajando con valores NULL -======================================= - -Los valores NULL pueden ser sorprenderte hasta que te acostumbras a -usarlos. Conceptualmente, NULL significa "valor perdido" o "valor desconocido" y -se trata de forma diferente que otros valores. Para realizar comparaciones -respecto a NULL, no puedes utilizar los operadores de comparación aritméticos -como =, < o != . Puedes realizar una demostración de esto, prueba la siguiente consulta: - -mysql> SELECT 1 = NULL, 1 != NULL, 1 < NULL, 1 > NULL; -+----------+-----------+----------+----------+ -| 1 = NULL | 1 != NULL | 1 < NULL | 1 > NULL | -+----------+-----------+----------+----------+ -| NULL | NULL | NULL | NULL | -+----------+-----------+----------+----------+ - -Ciertamente, de estas comparaciones no se pueden extraer resultados -significativos. Para conseguirlo, usa los operadores IS NULL y IS NOT NULL: - -mysql> SELECT 1 IS NULL, 1 IS NOT NULL; -+-----------+---------------+ -| 1 IS NULL | 1 IS NOT NULL | -+-----------+---------------+ -| 0 | 1 | -+-----------+---------------+ - -En MySQL, 0 significa falso y 1 significa VERDADERO. - -Este tratamiento especial de NULL fue la causa de que en la sección anterior -fuera necesario determinar qué animales ya no vivían usando "muerte IS NOT NULL" -en lugar de "muerte != NULL". - -8.3.4.7 Asociación/Coincidencia de patrones (PATTERN MATCHING) -================================================================ - -MySQL ofrece las características de asociación de patrones estándar así como -una forma de coincidencia de patrones basadas en expresiones regulares -extendidas similares a las usadas por utilidades UNIX como vi, grep y sed. - -La asociación de patrones SQL te permite usar '_' para asociar cualquier -caracter simple, y '%' para asociar un número arbitrario de caracteres -(incluyendo cero caracteres). Los patrones SQL no toman en cuenta las -diferencias entre mayúsculas y minúsculas. Se muestran debajo algunos -ejemplos. Observa que no se utiliza = o != en el trabajo con patrones SQL; -utiliza en su lugar los operadores de comparación LIKE o NOT LIKE. - -Para buscar nombres que comienzan por "b": - -mysql> SELECT * FROM mascota WHERE nombre LIKE "b%"; -+--------+-------------+---------+------+------------+------------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+------------+ -| Bluffy | Harold | gato | f | 1993-02-04 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -| Bowser | Diane | perro | m | 1989-08-31 | 1995-07-29 | -+--------+-------------+---------+------+------------+------------+ - -Para buscar nombres que terminen por "fy": - -mysql> SELECT * FROM mascota WHERE nombre LIKE "%fy"; -+--------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+--------+ -| Bluffy | Harold | gato | f | 1993-02-04 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -+--------+-------------+---------+------+------------+--------+ - -Para buscar nombres que contengan una "w": - -mysql> SELECT * FROM mascota WHERE nombre LIKE "%w%"; -+----------+-------------+---------+------+------------+------------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+----------+-------------+---------+------+------------+------------+ -| Claws | Gwen | gato | m | 1994-03-17 | NULL | -| Bowser | Diane | perro | m | 1989-08-31 | 1995-07-29 | -| Whistler | Gwen | pájaro | NULL | 1997-12-09 | NULL | -+----------+-------------+---------+------+------------+------------+ - -Para buscar nombres de longitud cinco caracteres, usa el patrón "_" : - -mysql> SELECT * FROM mascota WHERE nombre LIKE "_____"; -+--------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+--------+ -| Claws | Gwen | gato | m | 1994-03-17 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -+--------+-------------+---------+------+------------+--------+ - -El otro tipo de asociación de patrones ofrecido por MySQL utiliza expresiones -regulares extendidas. Cuando se realiza una comprobación buscando una coincidencia -para este tipo de patrón, se deben usar los operadores REGEXP y NOT REGEXP (o -RLIKE y NOT RLIKE, dado que son sinónimos). - -Algunas características de las expresiones regulares extendidas son: - -* `.' se asocia con cualquier caracter (pero sólo uno) - -* Una clase de caracteres `[...]' se asocia con culquier caracter contenido - dentro de los corchetes. Por ejemplo, `[abc]' se asocia con 'a', 'b' ó - -* 'c'. Para nombrar un rango de caracteres, usa un guión. `[a-z]' se asocia con -cualquier letra en minúscula, donde '[0-9]' se asocia con cualquier dígito. - -* '*' se asocia con 0 o más instancias de lo que preceda al asterisco. Por - ejemplo,'a*' coincide con cualquier número de a's,'[0-9]*' se asocia con - cualquier número de dígitos, y '.*' se asocia con cualquier cosa. - -* Las expresiones regulares son sensibles a las mayúsculas/minúsculas, pero - puedes utilizar una clase caracter para asociar ambos casos si los deseas. Por - ejemplo, '[aA]' coincide tanto con la letra a minúscula como con la letra A - mayúscula y '[a-zA-Z]' coincide con cualquier letra en cualquier modo - mayúscula/minúscula. - -* El patrón se asocia si ocurre en cualquier lugar dentro del valor a ser - probado (los patrones SQL coinciden sólo si se asocian con el valor - completo). - -* Para anclar un patrón de manera que se busque la coincidencia bien al comienzo - o bien al final del valor a ser comprobado, usa '^' al comienzo del patrón o - '$' al final del patrón, respectivamente. - -Para demostrar cómo funcionan las expresiones regulares, las consultas LIKE -mostradas antes son reescritas debajo para usar REGEXP: - -Para buscar nombres que comiencen por "b", usa '^' para buscar la coincidencia -al comienzo del nombre y '[bB]' para buscar la asociación tanto con la b -minúscula como con la b mayúscula: - -mysql> SELECT * FROM mascota WHERE nombre REGEXP "^[bB]"; -+--------+-------------+---------+------+------------+------------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+------------+ -| Bluffy | Harold | gato | f | 1993-02-04 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -| Bowser | Diane | perro | m | 1989-08-31 | 1995-07-29 | -+--------+-------------+---------+------+------------+------------+ - -Para buscar nombres que terminen por "fy", usa "$" para buscar la coincidencia -al final del nombre: - -mysql> SELECT * FROM mascota WHERE nombre REGEXP "fy$"; -+--------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+--------+ -| Bluffy | Harold | gato | f | 1993-02-04 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -+--------+-------------+---------+------+------------+--------+ - -Para buscar nombres que contengan una "w", utiliza "[wW]" para buscar la -asociación tanto en mayúsculas como minúsculas: - - mysql> SELECT * FROM mascota WHERE nombre REGEXP "[wW]"; -+----------+-------------+---------+------+------------+------------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+----------+-------------+---------+------+------------+------------+ -| Claws | Gwen | gato | m | 1994-03-17 | NULL | -| Bowser | Diane | perro | m | 1989-08-31 | 1995-07-29 | -| Whistler | Gwen | pájaro | NULL | 1997-12-09 | NULL | -+----------+-------------+---------+------+------------+------------+ - -Dado que un patrón de una expresión regular se asocia si ocurre en cualquier -lugar del valor, no es necesario poner un caracter comodín en ningún lado del -patrón para conseguir que se asocie con el valor completo como harías si usaras -un patrón SQL. - -Para buscar nombres conteniendo exactamente cinco caracteres, usa "^" y "$" para -asociar el comienzo y el final de un nombre, y cinco instancias de "." entre -ellos: - -mysql> SELECT * FROM mascota WHERE nombre REGEXP "^.....$"; -+--------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+--------+ -| Claws | Gwen | gato | m | 1994-03-17 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -+--------+-------------+---------+------+------------+--------+ - -También podrías haber escrito la consulta anterior usando el operador '{n}' -"repetir n veces": - -mysql> SELECT * FROM mascota WHERE nombre REGEXP "^.{5}$"; -+--------+-------------+---------+------+------------+--------+ -| nombre | propietario | especie | sexo | nacimiento | muerte | -+--------+-------------+---------+------+------------+--------+ -| Claws | Gwen | gato | m | 1994-03-17 | NULL | -| Buffy | Harold | perro | f | 1989-05-13 | NULL | -+--------+-------------+---------+------+------------+--------+ - - -8.3.4.8 Contando filas -======================= - -Las bases de datos son usadas a menudo para responder a la pregunta, "¿cuantas -veces aparece un determinado tipo de datos en una tabla?". Por ejemplo, podrías -querer saber cuántas mascotas tienes, o cuántas mascotas tiene cada propietario, -o podrías querer realizar varios tipos de censos respecto a tus animales. - -Contar el número total de animales que tienes es lo mismo que preguntar -"¿cuántas filas hay en la tabla mascota?", dado que hay sólo una fila por -mascota. La función COUNT() cuenta el número de resultados no-NULL , así pues, -la consulta a realizar para contar el número de animales tiene la siguiente forma: - -mysql> SELECT COUNT(*) FROM mascota; -+----------+ -| COUNT(*) | -+----------+ -| 9 | -+----------+ - -Antes, conseguiste los nombres de las personas que poseen una mascota. Puedes -usar COUNT() para averiguar cuántas mascotas tiene cada propietario: - -mysql> SELECT propietario, COUNT(*) FROM mascota GROUP BY propietario; -+-------------+----------+ -| propietario | COUNT(*) | -+-------------+----------+ -| Benny | 2 | -| Diane | 2 | -| Gwen | 3 | -| Harold | 2 | -+-------------+----------+ - -Observa el uso de GROUP BY para agrupar todos los registros de cada -propietario. Si no lo hubiéramos puesto, todo lo que conseguirias sería un -mensaje de error: - -mysql> SELECT propietario, COUNT(propietario) FROM mascota; -ERROR 1140: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP -columns is illegal if there is no GROUP BY clause - -COUNT() y GROUP BY son útiles para la caracterización de tus datos de varias -formas. Los siguientes ejemplos muestran difentes maneras para realizar -operaciones de censo animal. - -Número de animales por especies: - -mysql> SELECT especie, COUNT(*) FROM mascota GROUP BY especie; -+-----------+----------+ -| especie | COUNT(*) | -+-----------+----------+ -| gato | 2 | -| hamster | 1 | -| pájaro | 2 | -| perro | 3 | -| serpiente | 1 | -+-----------+----------+ - -Número de animales por sexo: - -mysql> SELECT sexo , COUNT(*) FROM mascota GROUP BY sexo; -+------+----------+ -| sexo | COUNT(*) | -+------+----------+ -| NULL | 1 | -| f | 4 | -| m | 4 | -+------+----------+ - -(En este resultado, NULL indica "sexo desconocido") - -El número de animales por combinación de especies y sexo: - -mysql> SELECT especie , sexo, COUNT(*) FROM mascota GROUP BY especie, sexo; -+-----------+------+----------+ -| especie | sexo | COUNT(*) | -+-----------+------+----------+ -| gato | f | 1 | -| gato | m | 1 | -| hamster | f | 1 | -| pájaro | NULL | 1 | -| pájaro | f | 1 | -| perro | f | 1 | -| perro | m | 2 | -| serpiente | m | 1 | -+-----------+------+----------+ - -No necesitas recuperar una tabla completa cuando uses COUNT(). Por ejemplo, la -consulta anterior, cuando se realiza sólo sobre perros y gatos, se escribe así: - -mysql> SELECT especie , sexo, COUNT(*) FROM mascota - -> WHERE especie = "perro" OR especie = "gato" - -> GROUP BY especie, sexo; -+---------+------+----------+ -| especie | sexo | COUNT(*) | -+---------+------+----------+ -| gato | f | 1 | -| gato | m | 1 | -| perro | f | 1 | -| perro | m | 2 | -+---------+------+----------+ - -O, si quieres conocer el número de animales por sexo sólo para animales de sexo -conocido: - -mysql> SELECT especie , sexo, COUNT(*) FROM mascota - -> WHERE sexo IS NOT NULL - -> GROUP BY especie, sexo; -+-----------+------+----------+ -| especie | sexo | COUNT(*) | -+-----------+------+----------+ -| gato | f | 1 | -| gato | m | 1 | -| hamster | f | 1 | -| pájaro | f | 1 | -| perro | f | 1 | -| perro | m | 2 | -| serpiente | m | 1 | -+-----------+------+----------+ - - -8.3.5 Usando más de una tabla -=============================== - -La tabla mascota guarda datos sobre las mascotas que posees. Si quieres guardar -otra información sobre ellos, como eventos en sus vidas, visitas al veterinario -o cuándo han tenido hermanos, necesitas otra tabla. ¿Cómo debería ser esta otra -tabla? - -* Deberá contener el nombre de la mascota de tal forma que pudieras saber a qué - animal corresponde cada evento almacenado en la misma. - -* Necesitará una fecha para conocer cuándo ocurrió el evento. - -* Necesitará un campo para describir el evento - -* Si quieres ser capaz de categorizar los eventos, sería útil tener un campo de - tipo evento. - -Dadas estas consideraciones, la sentencia CREATE TABLE para la tabla "evento" se -parecería a esto: - -mysql> CREATE TABLE evento (nombre VARCHAR(20), fecha DATE, - -> tipo VARCHAR(15), anotación VARCHAR(255)); - -Como ocurría con la tabla mascota, es más fácil cargar los registros iniciales -creando un fichero de texto delimitado por tabuladores conteniendo la -información: - -Fluffy 1995-05-15 parto 4 cachorros, 3 hembras, 1 macho -Buffy 1993-06-23 parto 5 cachorros, 2 hembras, 3 machos -Buffy 1994-06-19 parto 3 cachorros, 3 hembras -Chirpy 1999-03-21 veterinario necesitó enderezamiento de pico -Slim 1997-08-03 veterinario costilla rota -Bowser 1991-10-12 perrera -Fang 1991-10-12 perrera -Fang 1998-08-28 cumpleaños Se le regala un nuevo juguete de goma -Claws 1998-03-17 cumpleaños Se le regala un nuevo collar de pulgas -Whistler 1998-12-09 cumpleaños Primer cumpleaños - - -Carga los registros así: - -mysql> LOAD DATA LOCAL INFILE "evento.txt" INTO TABLE evento; - -Basándote en lo que has aprendido de las consultas que has ejecutado em la tabla -mascota, deberías ser capaz de realizar recuperaciones de datos en los registros -de la tabla "evento"; los principios son los mismos. ¿Pero qué hacer cuando la -tabla evento no sea suficiente por sí sola de responder a cuestiones que -podrías llegar a realizar? - -Supón que quisieras averiguar las edades de cada mascota al tener cachorros. La -tabla evento indica cuándo ha ocurrido esto, pero para calcular la edad de la -madre, necesitas su fecha de nacimiento. Dado que eso está almacenado en la -tabla mascota, necesitas ambas tablas para la consulta: - -mysql> SELECT mascota.nombre , (TO_DAYS(fecha) - TO_DAYS(nacimiento))/365 AS edad, anotación - -> FROM mascota, evento - -> WHERE mascota.nombre = evento.nombre AND tipo = "parto"; -+--------+------+----------------------------------+ -| nombre | edad | anotación | -+--------+------+----------------------------------+ -| Fluffy | 2.27 | 4 cachorros, 3 hembras, 1 macho | -| Buffy | 4.12 | 5 cachorros, 2 hembras, 3 machos | -| Buffy | 5.10 | 3 cachorros, 3 hembras | -+--------+------+----------------------------------+ - -Existen varios puntos que anotar sobre esta consulta: - -* La cláusula FROM lista dos tablas dado que la consulta necesita extraer - información de las dos. - -* Cuando se combina la información de múltiples tablas, necesitas especificar - cómo pueden ser asociados los registros de una tabla con los registros de la - otra. Esto es fácil dado que ambas tienen una columna nombre (N.T.: nombre es - una clave extranjera). La consulta usa la cláusula WHERE para combinar los - registros de las dos tablas basándose en los valores de nombre. - -* Dado que la columna nombre aparece en ambas tablas, debes ser específico sobre - a qué tabla te refieres cuando estés hablando de esa columna. Esto se realiza - poniendo el nombre de la tabla como prefijo de la columna. - -No necesitas tener dos tablas diferentes para realizar un join. En algunas -ocasiones es útil realizar un join de una tabla consigo misma, si quieres comparar -registros de una tabla con otros registros en la misma tabla. Por ejemplo, para buscar -parejas de sexos entre tus mascotas, puedes enlazar la tabla mascota consigo -mismo para emaparejar machos y hembras de las mismas especies: - -mysql> SELECT p1.nombre, p1.sexo, p2.nombre, p2.sexo, p1.especie - -> FROM mascota AS p1, mascota AS p2 - -> WHERE p1.especie = p2.especie AND p1.sexo = "f" AND p2.sexo = "m"; -+--------+------+--------+------+---------+ -| nombre | sexo | nombre | sexo | especie | -+--------+------+--------+------+---------+ -| Fluffy | f | Claws | m | gato | -| Buffy | f | Fang | m | perro | -| Buffy | f | Bowser | m | perro | -+--------+------+--------+------+---------+ - - -En esta consulta, especificamos un par de alias para el nombre de las tablas -y ser capaces así de referirnos a las columnas y saber en todo momento a qué -instancia de qué tabla se asocia cada referencia de columna. - -8.4 Obtener información sobre bases de datos y tablas -================================================================ - -¿Qué ocurre si olvidas el nombre de una base de datos o de una tabla, o cuál es -la estructura de una tabla dada (ejm. : ¿cómo se llaman sus columnas?) MySQL -soluciona este problema a través de numerosas sentencias que ofrecen información -sobre las bases de datos y las tablas que soporta. - -Ya hemos visto SHOW DATABASES, que lista las bases de datos gestionadas por el -servidor. Para averiguar qué base de datos está actualmente seleccionada, usa la -función DATABASE(): - -mysql> SELECT DATABASE(); -+------------+ -| DATABASE() | -+------------+ -| zoo | -+------------+ - -Si aún no has seleccionado ninguna base de datos, el resultado estará en blanco. - -Para averiguar qué tablas contiene la base de datos actual (por ejemplo, cuando -no estás seguro sobre el nombre de una tabla), usa este comando: - -mysql> SHOW TABLES; -+---------------+ -| Tables in zoo | -+---------------+ -| evento | -| mascota | -+---------------+ - -Si quieres averiguar la estructura de una tabla, el comando DESCRIBE te será -útil; muestra información sobre cada columna de una tabla: - -mysql> DESCRIBE mascota; -+-------------+-------------+------+-----+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------------+-------------+------+-----+---------+-------+ -| nombre | varchar(20) | YES | | NULL | | -| propietario | varchar(20) | YES | | NULL | | -| especie | varchar(20) | YES | | NULL | | -| sexo | char(1) | YES | | NULL | | -| nacimiento | date | YES | | NULL | | -| muerte | date | YES | | NULL | | -+-------------+-------------+------+-----+---------+-------+ - -Field indica el nombre de la columna, Type es el tipo de datos para la columna, -Null indica si la columna puede contener o no valores NULL, Key indica si la -columna está indexada o no, y Default especifica el valor por defecto para la -columna. - -Si tienes índices en una tabla, SHOW INDEX FROM nombre_tabla te mostrará -información sobre ellos. - -8.5 Usando mysql en modo batch -================================= - -En las secciones previas, hemos usado mysql interactivamente para introducir -consultas y observar los resultados. También puedes ejecutar mysql en modo -batch. Para realizarlo, escribe los comandos que quieras ejecutar en un fichero, -después pídele a mysql que lea su entrada desde el fichero: - -shell> mysql < fichero-batch - -(N.T.: en ocasiones se traduce como fichero por lotes) - -Si necesitas especificar parámetros de conexión en la línea de comandos, el -comando podría parecerse a esto: - -shell> mysql -h host -u user -p < fichero-batch -Enter password: ******** - -Cuando usas MySQL de esta manera, estás creando un fichero script (de guión), y -después ejecutando el script. - -¿Por qué usar un script? He aquí algunas razones: - -* Si ejecutas una consulta repetidamente (digamos, cada día o cada semana), el - construir un script con esta consulta te permite evitar volver a teclearla - cada vez que la ejecutes. - -* Puedes generar nuevas consultas a partir de consultas ya existentes similares - simplemente copiando y editando los ficheros script. - -* El modo batch puede ser también muy útil cuando estés desarrollando una - consulta, particularmente para comandos multi-línea o múltiples secuencias de - comandos de múltiples sentencias. Si cometes un error, no necesitas reescribir - todo. Símplemente edita el script para corregir el error, y después pídele a - mysql que lo vuelva a ejecutar. - -* Si tienes una consulta que produce resultados muy largos, puedes usar un - paginador para filtrar esta salida en lugar de ver cómo se desplaza fuera del - alcance de tu pantalla: - - -shell> mysql < fichero_batch | more - -* Puedes redirigir la salida a un fichero para un procesamiento posterior: - -shell> mysql < fichero_batch > mysql.out - -* Puedes distribuir tu script a otras personas para que puedan ejecutar también - tus comandos. - -* Algunas situaciones no permiten un uso interactivo, por ejemplo, cuando - ejecutas una consulta como una tarea de cron. (N.T.: cron es un comando UNIX - que sirve para planificar y ejecutar comandos UNIX en el tiempo). En este - caso, debes usar el procesamiento por lotes. - -El formato de salida por defecto es diferente (más conciso) cuando ejecutas -mysql en modo batch que cuando lo usas de manera interactiva. Por ejemplo, la -salida de SELECT DISTINCT especie FROM mascota es la siguiente cuando se -ejecuta de manera interactiva: - -mysql> SELECT DISTINCT especie FROM mascota; -+-----------+ -| especie | -+-----------+ -| gato | -| hamster | -| pájaro | -| perro | -| serpiente | -+-----------+ - -Y la siguiente si se ejecuta en modo batch: - -especie -gato -hamster -pájaro -perro -serpiente - -Si quieres obtener el formato de salida del modo interactivo también en modo -batch, usa mysql -t. Para redirigir a salida estándar los comandos que se están -ejecutando, usa mysql -vvv. - - - -8.6 Consultas del proyecto gemelos - -En Analytikerna y Lentus, hemos estado realizando el trabajo de campo y sistemas para -un gran proyecto de investigación. Este proyecto es una colaboración entre el Instituto de -Medicina Medioambiental en el Karolinska Institutet Stockholm y la Sección en Investigación -Clínica en Envejecimiento y Psicología en la Universidad del Sur de California. - -El proyecto consistió en una parte de selección donde todos los gemelos en Suecia mayores de -65 años eran entrevistados por teléfono. Los gemelos que reunían ciertos criterios pasaban a la -siguiente fase. En esta fase posterior, los gemelos que querían participar eran visitados por -un equipo doctor/enfermera. Algunos de los exámenes incluían exámenes físicos y neuropsicológicos, -pruebas de laboratorio, neuroimágenes, valoración del estado psicológico, y recopilación de la -historia familiar. Además, se recogieron datos sobre los factores de riesgo médicos y -medioambientales. - -Puede encontrarse más información sobre los estudios de gemelos en : - - http://www.imm.ki.se/TWIN/TWINUKW.HTM - -La última parte del proyecto se administra con un interfaz web escrito usando Perl y MySQL. -Cada noche, todos los datos de las entrevistas son movidos a una base de datos MySQL. - -8.6.1 Buscar todos los gemelos no-distribuidos - -La siguiente consulta se usa para determinar quién pasa a la segunda parte del proyecto: - - select - concat(p1.id, p1.tvab) + 0 as tvid, - concat(p1.christian_name, " ", p1.surname) as Name, - p1.postal_code as Code, - p1.city as City, - pg.abrev as Area, - if(td.participation = "Aborted", "A", " ") as A, - p1.dead as dead1, - l.event as event1, - td.suspect as tsuspect1, - id.suspect as isuspect1, - td.severe as tsevere1, - id.severe as isevere1, - p2.dead as dead2, - l2.event as event2, - h2.nurse as nurse2, - h2.doctor as doctor2, - td2.suspect as tsuspect2, - id2.suspect as isuspect2, - td2.severe as tsevere2, - id2.severe as isevere2, - l.finish_date - from - twin_project as tp - /* For Twin 1 */ - left join twin_data as td on tp.id = td.id and tp.tvab = td.tvab - left join informant_data as id on tp.id = id.id and tp.tvab = id.tvab - left join harmony as h on tp.id = h.id and tp.tvab = h.tvab - left join lentus as l on tp.id = l.id and tp.tvab = l.tvab - /* For Twin 2 */ - left join twin_data as td2 on p2.id = td2.id and p2.tvab = td2.tvab left join informant_data as id2 on p2.id = id2.id and p2.tvab = id2.tvab - left join harmony as h2 on p2.id = h2.id and p2.tvab = h2.tvab - left join lentus as l2 on p2.id = l2.id and p2.tvab = l2.tvab, - person_data as p1, - person_data as p2, - postal_groups as pg - where - /* p1 gets main twin and p2 gets his/her twin. */ - /* ptvab is a field inverted from tvab */ - p1.id = tp.id and p1.tvab = tp.tvab and - p2.id = p1.id and p2.ptvab = p1.tvab and - /* Just the sceening survey */ - tp.survey_no = 5 and - /* Skip if partner died before 65 but allow emigration (dead=9) */ - (p2.dead = 0 or p2.dead = 9 or - (p2.dead = 1 and - (p2.death_date = 0 or - (((to_days(p2.death_date) - to_days(p2.birthday)) / 365) - >= 65)))) - and - ( - /* Twin is suspect */ - (td.future_contact = 'Yes' and td.suspect = 2) or - /* Twin is suspect - Informant is Blessed */ - (td.future_contact = 'Yes' and td.suspect = 1 and id.suspect = 1) o - /* No twin - Informant is Blessed */ - (ISNULL(td.suspect) and id.suspect = 1 and id.future_contact = 'Yes') or - /* Twin broken off - Informant is Blessed */ - (td.participation = 'Aborted' - and id.suspect = 1 and id.future_contact = 'Yes') or - /* Twin broken off - No inform - Have partner */ - (td.participation = 'Aborted' and ISNULL(id.suspect) and p2.dead = 0)) - and - l.event = 'Finished' - /* Get at area code */ - and substring(p1.postal_code, 1, 2) = pg.code - /* Not already distributed */ - and (h.nurse is NULL or h.nurse=00 or h.doctor=00) - /* Has not refused or been aborted */ - and not (h.status = 'Refused' or h.status = 'Aborted' - or h.status = 'Died' or h.status = 'Other') - order by - tvid; - -Algunas explicaciones: - -`concat(p1.id, p1.tvab) + 0 as tvid' - Queremos ordenar por la concatenación de `id' y `tvab' en orden numérico. - Añadiendo `0' al resultado provocamos que *MySQL* trate el resultado como - un número. - -column `id' - Esto identifica un par de gemelos. Es una clave en todas las tablas. - -column `tvab' - Esto identifica un gemelo de una pareja. Tiene un valor de `1' ó `2' - -column `ptvab' - Esto es la inversa de `tvab'. Cuando `tvab' es `1' esto es `2', y - vice versa. Esto existe para ahorrarnos teclear y para hacer más fácil - la optimización de la consulta a MySQL. - - -Esta consulta demuestra, entre otras cosas, cómo realizar búsquedas en una tabla -enlazada con la misma tabla a través de un join (p1 y p2). En el ejemplo, ésto -se usa para comprobar cuándo un gemelo de una pareja murió antes de cumplir 65. -En caso afirmativo, la fila no es devuelta. - -Todo lo anterior existe en todas las tablas con información relacionada con los gemelos. -Tenemos una clave tanto en id, tvab (todas las tablas) como en id,ptvab (person_data) para -construir consultas más rápidas. - -En nuestra máquina de producción (una UltraSPARC 200MHz), esta consulta devuelve alrededor -de 150-200 filas y tarda menos de un segundo. - -El número actual de registros en las tablas usadas arriba: - -Tabla Filas - -person_data 71074 -lentus 5291 -twin_project 5286 -twin_data 2012 -informant_data 663 -harmony 381 -postal_groups 100 - - - - -8.6.2 Mostrar una tabla con el estado de la pareja de gemelos. - -Cada entrevista finaliza con un código de estado llamado event. La consulta mostrada -debajo se usa para imprimir una tabla sobre todas las parejas de gemelos combinadas por evento. -Esto indica en cuántas parejas ambos gemelos han finalizado, en cuántas parejas -ha finalizado un gemelo y el otro se rechazó, etc. - - select - t1.event, - t2.event, - count(*) - from - lentus as t1, - lentus as t2, - twin_project as tp - where - /* We are looking at one pair at a time */ - t1.id = tp.id - and t1.tvab=tp.tvab - and t1.id = t2.id - /* Just the sceening survey */ - and tp.survey_no = 5 - /* This makes each pair only appear once */ - and t1.tvab='1' and t2.tvab='2' - group by - t1.event, t2.event; - - - diff --git a/Docs/bk.txt b/Docs/bk.txt deleted file mode 100644 index b9274901653..00000000000 --- a/Docs/bk.txt +++ /dev/null @@ -1,65 +0,0 @@ -Mail by sasha, should be rewritten as a HOWTO sometimes -vva added point C) for Windows-project ------------ - -I have set up a repository with BitKeeper on work. There are still some things -about it that I would like to learn, but I have gotten far enough with it to -replace CVS functionality were are currently using, so let's just go ahead and -get started on it. Please follow the instructions below (make sure to save the -message for future reference): - -a) http://www.bitmover.com/download - user: beta - password: get bitkeeper - - get the version appropriate for your platform - download it to a temp -directory, chmod +x and then run it. You will have to tell it which directory -to install, for consistency, let's use /usr/local/bin - -b) we will take advantage of bk capablity of working with master/slave -repositories. The master will be on work.mysql.com, the slaves will be our -individual machines. The master repository has already been set up on work, so -you will need just to set up a slave repository on your machine: - - mkdir bk - cd bk - bk clone yourusername@work:/home/bk/mysql mysql - cd mysql - bk -r edit - -Now you have the entire source tree in the current directory. Let's compile it: - - BUILD/compile-pentium-debug - -C) Windows project. - - Compile Linux-project (see points above) - - run VC++Files/prepare - - make repository accessible for Windows (using samba) - - open VC++Files/mysql.dsw in Microsoft Visual Stidio (5.0 or above) - -After you edit a file, you need to check it in using bk citool or bk ci -filename. Note that ci is different than commit - you ci a file, but you commit -a change set. This is a very nice concept - instead of thinking of each -individual file as CVS does, bk groups the changes you are making and allows you -to document what you actually did between the commits as a whole, rather than -just commenting on every file. When you commit, bk will ask you to comment on -the change set. - -Commit is done just to your local repository. To make your changes global, you -will need to run bk push. Be careful with that - it is a good idea to run bk -push -l -n first too see what you are just about to push to the master -repository. - -When somebody does a push, you will be getting a email ( I will set this up to -day). You will then need to execute bk pull to update your sources. If there are -any conflicts, bk will force you to resolve them by asking you questions on what -to do with each conflict. - -To learn more about bk, use bk helptool - I will be doing this a lot in the next -couple of days :-) If you find bugs or have questions/feature -suggestions/comments for developers, feel free to e-mail dev@bitmover.com . -Their developers, and especially the president of the company Larry McVoy really -like MySQL and are very anxious to help us. Make sure it is obvious that you -work for MySQL, of course. And, of course, do not bug them with little things -that you can figure out on your own or with my help - they were nice to offer us -support, but we should not abuse it. \ No newline at end of file diff --git a/Docs/linuxthreads.txt b/Docs/linuxthreads.txt index 30270125c0d..552415fe794 100644 --- a/Docs/linuxthreads.txt +++ b/Docs/linuxthreads.txt @@ -1,3 +1,5 @@ +[Note this information is obsolete] + Notes on compiling glibc for the standard MySQL binary: - make sure you have gcc 2.95 and gmake 3.79 or newer diff --git a/Docs/my_sys.txt b/Docs/my_sys.txt deleted file mode 100644 index 85ffc13ecb4..00000000000 --- a/Docs/my_sys.txt +++ /dev/null @@ -1,140 +0,0 @@ -Functions i mysys: (For flags se my_sys.h) - - int my_copy _A((const char *from,const char *to,myf MyFlags)); - - Copy file - - int my_delete _A((const char *name,myf MyFlags)); - - Delete file - - int my_getwd _A((string buf,uint size,myf MyFlags)); - int my_setwd _A((const char *dir,myf MyFlags)); - - Get and set working directory - - string my_tempnam _A((const char *pfx,myf MyFlags)); - - Make a uniq temp file name by using dir and adding something after - pfx to make name uniq. Name is made by adding a uniq 6 length-string - and TMP_EXT after pfx. - Returns pointer to malloced area for filename. Should be freed by - free(). - - File my_open _A((const char *FileName,int Flags,myf MyFlags)); - File my_create _A((const char *FileName,int CreateFlags, - int AccsesFlags, myf MyFlags)); - int my_close _A((File Filedes,myf MyFlags)); - uint my_read _A((File Filedes,byte *Buffer,uint Count,myf MyFlags)); - uint my_write _A((File Filedes,const byte *Buffer,uint Count, - myf MyFlags)); - ulong my_seek _A((File fd,ulong pos,int whence,myf MyFlags)); - ulong my_tell _A((File fd,myf MyFlags)); - - Use instead of open,open-with-create-flag, close read and write - to get automatic error-messages (flag: MYF_WME) and only have - to test for != 0 if error (flag: MY_NABP). - - int my_rename _A((const char *from,const char *to,myf MyFlags)); - - Rename file - - FILE *my_fopen _A((const char *FileName,int Flags,myf MyFlags)); - FILE *my_fdopen _A((File Filedes,int Flags,myf MyFlags)); - int my_fclose _A((FILE *fd,myf MyFlags)); - uint my_fread _A((FILE *stream,byte *Buffer,uint Count,myf MyFlags)); - uint my_fwrite _A((FILE *stream,const byte *Buffer,uint Count, - myf MyFlags)); - ulong my_fseek _A((FILE *stream,ulong pos,int whence,myf MyFlags)); - ulong my_ftell _A((FILE *stream,myf MyFlags)); - - Same read-interface for streams as for files - - gptr _mymalloc _A((uint uSize,const char *sFile, - uint uLine, myf MyFlag)); - gptr _myrealloc _A((string pPtr,uint uSize,const char *sFile, - uint uLine, myf MyFlag)); - void _myfree _A((gptr pPtr,const char *sFile,uint uLine)); - int _sanity _A((const char *sFile,unsigned int uLine)); - gptr _myget_copy_of_memory _A((const byte *from,uint length, - const char *sFile, uint uLine, - myf MyFlag)); - - malloc(size,myflag) is mapped to this functions if not compiled - with -DSAFEMALLOC - - void TERMINATE _A((void)); - - Writes malloc-info on stdout if compiled with -DSAFEMALLOC. - - int my_chsize _A((File fd,ulong newlength,myf MyFlags)); - - Change size of file - - void my_error _D((int nr,myf MyFlags, ...)); - - Writes message using error number (se mysys/errors.h) on - stdout or curses if MYSYS_PROGRAM_USES_CURSES() is called. - - void my_message _A((const char *str,myf MyFlags)); - - Writes message-string on - stdout or curses if MYSYS_PROGRAM_USES_CURSES() is called. - - void my_init _A((void )); - - Start each program (in main) with this. - void my_end _A((int infoflag)); - - Gives info about program. - - If infoflag & MY_CHECK_ERROR prints if some files are left open - - If infoflag & MY_GIVE_INFO prints timing info and malloc info - about prog. - - int my_redel _A((const char *from, const char *to, int MyFlags)); - - Delete from before rename of to to from. Copyes state from old - file to new file. If MY_COPY_TIME is set sets old time. - - int my_copystat _A((const char *from, const char *to, int MyFlags)); - - Copye state from old file to new file. - If MY_COPY_TIME is set sets copy also time. - - string my_filename _A((File fd)); - - Give filename of open file. - - int dirname _A((string to,const char *name)); - - Copy name of directory from filename. - - int test_if_hard_path _A((const char *dir_name)); - - Test if dirname is a hard path (Starts from root) - - void convert_dirname _A((string name)); - - Convert dirname acording to system. - - In MSDOS changes all caracters to capitals and changes '/' to - '\' - string fn_ext _A((const char *name)); - - Returns pointer to extension in filename - string fn_format _A((string to,const char *name,const char *dsk, - const char *form,int flag)); - format a filename with replace of library and extension and - converts between different systems. - params to and name may be identicall - function dosn't change name if name != to - Flag may be: 1 force replace filnames library with 'dsk' - 2 force replace extension with 'form' */ - 4 force Unpack filename (replace ~ with home) - 8 Pack filename as short as possibly for output to - user. - All open requests should allways use at least: - "open(fn_format(temp_buffe,name,"","",4),...)" to unpack home and - convert filename to system-form. - - string fn_same _A((string toname,const char *name,int flag)); - - Copys directory and extension from name to toname if neaded. - copy can be forced by same flags that in fn_format. - - int wild_compare _A((const char *str,const char *wildstr)); - - Compare if str matches wildstr. Wildstr can contain "*" and "?" - as match-characters. - Returns 0 if match. - - void get_date _A((string to,int timeflag)); - - Get current date in a form ready for printing. - - void soundex _A((string out_pntr, string in_pntr)) - - Makes in_pntr to a 5 chars long string. All words that sounds - alike have the same string. - - int init_key_cache _A((ulong use_mem,ulong leave_this_much_mem)); - - Use cacheing of keys in MISAM, PISAM, and ISAM. - KEY_CACHE_SIZE is a good size. - - Remember to lock databases for optimal cacheing - - void end_key_cache _A((void)); - - End key-cacheing. diff --git a/Docs/net_doc.txt b/Docs/net_doc.txt deleted file mode 100644 index 8a25ef41d06..00000000000 --- a/Docs/net_doc.txt +++ /dev/null @@ -1,945 +0,0 @@ - MySQL Client - Server Protocol Ducumentation - - - -Introduction ------------- - - -This paper has an objective of a through description of the -client - server protocol which is embodied in MySQL. Particularly, -this paper aims to document and describe: - -- manner in which MySQL server detects client connection requests and - creates connection -- manner in which MySQL client C API call connects to server - the - entire protocol of sending / receiving data by MySQL server and C API - code -- manner in which queries are sent by client C API calls to server -- manner in which query results are sent by server -- manner in which query results are resolved by server -- sending and receiving of error messages - - -This paper does not have the goal or describing nor documenting other -related MySQL issues, like usage of thread libraries, MySQL standard -library set, MySQL strings library and other MySQL specific libraries, -type definitions and utilities. - -Issues that are covered by this paper are contained in the following -source code files: - -- client/net.c and sql/net_serv.c, the two being identical -- client/libmysql.c (not entire file is covered) -- include/mysql_com.h -- include/mysql.h -- sql/mysqld.cc (not entire file is covered) -- sql/net_pkg.cc -- sql/sql_base.cc (not entire file is covered) -- sql/sql_select.cc (not entire file is covered) -- sql/sql_parse.cc (not entire file is covered) - -Beside this introduction this paper presents basic definitions, -constants, structures and global variables, all related functions in -server and in C API. Textual description of the entire protocol -functioning is described in the last chapter of this paper. - - -Constants, structures and global variables ------------------------------------------- - -This chapter will describe all constants, structures and -global variables relevant to client - server protocol. - -Constants - -They are important as they contain default values, the ones -that are valied if options are not set in any other way. Beside that -MySQL source code does not contain a single non-defined constant in -it's code. This description of constants does not include -configuration and conditional compilation #defines. - -NAME_LEN - field and table name length, current value 64 -HOSTNAME_LENGTH - length of the host name, current value 64 -USERNAME_LENGTH - user name length, current vluae 16 -MYSQL_PORT - default TCP/IP port number, current value 3306 -MYSQL_UNIX_ADDR - full path of the default Unix socket file, current value - "/tmp/mysql.sock" -MYSQL_NAMEDPIPE - full path of the default NT pipe file, current value - "MySQL" -MYSQL_SERVICENAME - name of the MySQL Service on NT, current value "MySql" -NET_HEADER_SIZE - size of the network header, when no - compression is used, current value 4 -COMP_HEADER_SIZE - additional size of network header when - compression is used, current value 3 - -What follows are set of constants, defined in source only, which -define capabilities of the client built with that version of C -API. Simply, when some new feature is added in client, that client -feature is defined, so that server can detect what capabilities a -client program has. - -CLIENT_LONG_PASSWORD - client supports new more secure passwords -CLIENT_LONG_FLAG - client uses longer flags -CLIENT_CONNECT_WITH_DB - client can specify db on connect -CLIENT_COMPRESS - client can use compression protocol -CLIENT_ODBC - ODBC client -CLIENT_LOCAL_FILES - client can use LOAD DATA INFILE LOCAL -CLIENT_IGNORE_SPACE - client can Ignore spaces before '(' -CLIENT_CHANGE_USER - client supports the mysql_change_user() - -What follows are other constants, pertaining to timeouts and sizes - -MYSQL_ERRMSG_SIZE - maximum size of error message string, current value 200 -NET_READ_TIMEOUT - read timeout, current value 30 sec. -NET_WRITE_TIMEOUT - write timeout, current value 60 sec. -NET_WAIT_TIMEOUT - wait for new query timeout, current value 8*60*60 - sec. i.e. 8 hours -packet_error - value returned in case of socket errors, current - value -1 -TES_BLOCKING - used in debug mode for setting up blocking testing -RETRY COUNT - number of times network read and write will be - retried, current value 1 - -There are also error messages for last_errno, which depict system -errors, and are used on the server only. - -ER_NET_PACKAGE_TOO_LARGE - packet is larger then max_allowed_packet -ER_OUT_OF_RESOURCES - practically no more memory -ER_NET_ERROR_ON_WRITE - error in writing to NT Named Pipe -ER_NET_WRITE_INTERRUPTED - some signal or interrupt happened - during write -ER_NET_READ_ERROR_FROM_PIPE - error in reading from NT Named Pipe -ER_NET_FCNTL_ERROR - error in trying to set fcntl on socket - descriptor -ER_NET_PACKETS_OUT_OF_ORDER - packet numbers on client and - server side differ -ER_NET_UNCOMPRESS_ERROR - error in uncompress of compressed packet - - - Structs and eunms - - -struct NET - -this is MySQL's network handle structure, used in all client / server -read/write functions. On the server it is initialized and preserved in -each thread. On the client, it is a part of MYSQL struct, which is -MySQL handle used in all C API functions. This structure uniquely -identifies a connection, either on the server or client side. -This structure consists of the following -fields: - - Vio* vio; - explained above - HANDLE hPipe - Handle for NT Named Pipe file - my_socket fd - file descriptor used for both tcp socket and Unix socket file - int fcntl - contains info on fcntl options used on fd. Mostly - used for saving info if blocking is used or not - unsigned char *buff - network buffer used for storing data for - reading from / writing to socket - unsigned char,*buff_end - points to the end of buff - unsigned char *write_pos - present writing position in buff - unsigned char *read_pos - present reading postiion in - buff. This pointer is used for - reading data after calling - my_net_read function and function - that are just it's wrappers - char last_error[MYSQL_ERRMSG_SIZE] - holds last error message - unsigned int last_errno - holds last error code of the network - protocol. It's ossible values are - listed in above constants. It is - used only on the server side - unsigned int max_packet - holds current value of buff size - unsigned int timeout - stores read timeout value for that connection - unsigned int pkt_nr - stores a value of the current packet - number in a batch of packets. Used - primarily for detection of protocol - errors resulting in a mismatch - my_bool error - holds either 1 or 0 depending on the error condition - my_bool return_errno - if it's value != 0 then there is an - error in protocol mismatch between - client and server - my_bool compress - if true compression is used in the protocol - unsigned long remain_in_buf - used only in reading compressed - packets. Explained in my_net_read - unsigned long length - used only for storing a length of the - read packet. Explained in my_net_read - unsigned long buf_length - used only in reading compressed - packets. Explained in my_net_read - unsigned long where_b - used only in reading compressed - packets. Explained in my_net_read - short int more - used for reporting in mysql_list_processes - char save_char - used in reading compressed packets for saving - chars in order to make zero-delimited - strings. Explained in my_net_read - -Few typedefs will be defined for easier understanding of the text that -follows. - - typedef char **MYSQL_ROW - data containing one row of values - typedef unsigned int MYSQL_FIELD_OFFSET - offset in bytes of - the current field - typedef MYSQL_ROWS *MYSQL_ROW_OFFSET - offset in bytes of - the current row - - - struct MYSQL_FIELD - contains all info on the attributes of a -specific column in a result set, plus info on lengths of the column in -a result set. This struct is tagged as st_mysql_field. This structure -consists of the following fields: - - char *name - name of column - char *table - table of column if column was a field and not - expression or constant - char *def - default value (set by mysql_list_fields) - enum enum_field_types type - see above - unsigned int length - width of column in a current row - unsigned int max_length - maximum width of that column in - entire result set - unsigned int flags - corresponding to Extra in DESCRIBE - unsigned int decimals - number of decimals in field - - - struct MYSQL_ROWS - a node for each row in the single linked -list forming entire result set. This struct is tagged as -st_mysql_rows, and has two fields: - - struct st_mysql_rows *next - pointer to a next one - MYSQL_ROW data - see above - - - struct MYSQL_DATA - contains all rows from result set. It is -tagged as st_mysql_data and has following fields: - - my_ulonglong rows - how many rows - unsigned int fields - how many columns - MYSQL_ROWS *data - see above. This is a first node of the - linked list - MEM_ROOT alloc - MEM_ROOT is MySQL memory allocation - structure, and this field is used to store - all fields and rows. - - - struct st_mysql_options - holds various client options, and -contains following fields: - - unsigned int connect_timeout - time in sec. for cennection - unsigned int client_flag - used to cold client capabilities - my_bool compress - boolean for compression - my_bool named_pipe - is Named Pipe used on NT - unsigned int port - what TCP port is used - char *host - host to connect to - char *init_command - command to be executed upon connection - char *user - account name on MySQL server - char *password - password for the above - char *unix_socket - full path for Unix socket file - char *db - default database - char *my_cnf_file - optional configuration file - char *my_cnf_group - optional header for options - - - struct MYSQL - MySQL client's handle. Required for any -operation issed from client to server. Tagged as st_mysql and having -following fields: - - NET net - see above - char *host - host on which MySQL server is running - char *user - MySQL user name - char *passwd - password for above - char *unix_socket- full path of Unix socket file - char *server_version - version of the server - char *host_info - contains info on how has connection been - established, TCP port, socket or Named Pipe - char *info - used to store information on the query results, - like number of rows affected etc. - char *db - current database - unsigned int port -= TCP port in use - unsigned int client_flag - client capabilities - unsigned int server_capabilities - server capabilities - unsigned int protocol_version - version of the protocl - unsigned int field_count - used for storing number of fields - immidiately upon execution of a - query, but before fetching rows - unsigned long thread_id - server thread to which this connection is attached - my_ulonglong affected_rows - used for storing number of rows - immidiately upon execution of a - query, but before fetching rows - my_ulonglong insert_id - fetching LAST_INSERT_ID() through - client C API - my_ulonglong extra_info - used by mysqlshow - unsigned long packet_length - saving size of the first packet - upon execution of a query - enum mysql_status status - see above - MYSQL_FIELD *fields - see above - MEM_ROOT field_alloc - memory used for storing previous field - (fields) - my_bool free_me - boolean that flags if MYSQL was allocated in - mysql_init - my_bool reconnect - used to automatically reconnect - struct st_mysql_options options - see above - char scramble_buff[9] - key for scrambling password before - sending it to server - - - struct MYSQL_RES - tagged as st_mysql_res and used to store -entire result set from a single query. Contains following fields: - - my_ulonglong row_count - number of rows - unsigned int field_count - number of columns - unsigned int current_field - cursor for fetching fields - MYSQL_FIELD *fields - see above - MYSQL_DATA *data - see above, and used in buffered reads, - i.e. mysql_store_result only - MYSQL_ROWS *data_cursor - pointing to the field of above "data" - MEM_ROOT field_alloc - memory allocation for above "fields" - MYSQL_ROW row - used for storing row by row in unbuffered - reads, i.e. in mysql_use_result - MYSQL_ROW current_row - cursor to the current row for buffered - reads - unsigned long *lengths - column lengths of current row - MYSQL *handle - see above, used in unbuffered reads, i.e. in - mysql_use_resultq - my_bool eof - used my mysql_fetch_row as a marker for end of data - - - - - Global variables - - - unsigned long max_allowed_packet - maximum allowable value of - network buffer. Default - value - 1 Mb - - unsigned long net_buffer_length - default, starting value of - network buffer - 8 Kb - - unsigned long bytes_sent - total number of bytes written since - startup of the server - - unsigned long bytes_received - total number of bytes read - since startup of the server - - - Synopsis of the basic client - server protocol - ---------------------------------------------- - - Purpose of this chapter is to provide a complete picture of -the basic client - server protocol implemented in MySQL. It was felt -it is necessary after writting descriptions for all of the functions -involved in basic protocol. There are at present 11 functions -involved, with several structures, many constants etc, which are all -described in detail. But as a forest could not be seen from the trees, -so a concept of the protocol could not be deciphered easily from a -thourough documentation on minutae. - - Althouch concept of the protocol was not changed with the -introduction of vio system, embodied in violate.cc source file and VIO -system, the introduction of these has changed a code substantially. Before -VIO was introduced, functions for reading from / writing to network -connection had to deal with various network standards. So, these functions -depended on whether TCP port or Unix socket file or NT Named Pipe file is -used. This is all changed now and single vio_ functions are called, while -all this diversity is covered by vio_ functions. - - In MySQL a specific buffered network input / output transport -model has been implemented. Although each operating system mah have -it's own buffering for network connections, MySQL has added it's own -buffering model. This same for each of the three transport protocol -types that are used in MySQL client - server communications, which are -tcp sockets (on all systems), Unix socket files on Unix and Unix-like -operating systems and Named Pipe files on NT. Alghouth tcp sockets -are omnipresent, the later two types have been added for local -connections. Those two connection types can be used in local modes -only, i.e. when both client and server reside on the same host, and -are introduced because they enable better speeds for local -connections. This is especially usefull for WWW type of -applications. Startup options of MySQl server allow that either tcp -sockets or local connection (OS dependent) can be disallowed. - - In order to be able to implement buffered input / output MySQL -allocates a buffer. A starting size of this buffer is determined by a -value of the global variable net_buffer_length, which can be changed -at MySQL server startup. This is, as explained only a startup length -of MySQL network buffer. As a signle item that has to be read / -written can be larger then that value, MySQL will increase buffer size -as long as that size reaches value of global variable -max_aallowed_packet, which is also settable at server startup. Maximum -value of this variable is limited by the way MySQL stores / reads -sizes of packets to be sent / read, which means by the way MySQL -formats packages. - - Basically each packet consists of two parts, a header and -data. In the case when compression is not used, header consists of 4 -bytes of which 3 contain a length of the packet to be sent and one -holds a packet number. When compression is used there are -onother 3 bytes which store a size of uncompressed data. Because of -the way MySQL packs length into 3 bytes, plus due to the usage of some -special values in the most significant byte, maximum size of -max_allowed_packet is limited to 24 Mb at present. So, if compression -is not used, at first 4 bytes are written to the buffer and then data -itself. As MySQL buffers I/O logical packets are packet together until -packets fill up entire size of the buffer. That size no less then -net_buffer_size, but no greater then max_allowed_packet. So, actuall -writting to the network is done when this buffer is filled up. As -frequently sequence of buffers make a logicall unit, like a result -set, then at the end of sending data, even if buffer is not full, data -is written, i.e. flushed to the connection with a call of the -net_flush function. In order to maintain that no single packet can be -larger then this value, checks are made throughout a code, so that not -signle field or command could exceed that value. - - In order to maintain coherency in consicutive packets, each -packet is numbered and their number stored as a part of a header, as -explained above. Packets start with 0, so whenever a logical packet is -written, that number is incremented. On the other side when packets -are read, value that is fetched is compared with a value stored and if -there is no mismatch that value is incremented too. Packet number is -reset on the client side when unwanted connections are removed from -the connection and on the server side when a new command hsa been -started. - - - So, before writting, a buffer contains a sequence of logical -packets, consisting of header plus data consequtively. In the case -that compression is used, packet numbers are not stored in each header -of the logical packets, but a whole buffer, or a part of it if -flushing is done, containing one or more logical packets are -compressed. In that case a new larger header, is formed, and all -logical packets contained in the buffer are compressed together. This -way only one packet is formed which makes several logical packets, -which improves both speed and compression ratio. On the other side, -when this large compressed packet is read, it is furst uncompressed, -and then logical packets are sent, one by one, to the calling -functions. - - - All this functionality is described in detail in the following -chapter. It does not contain functions that form logical packets, or -that read and write to connections but also functions that are used -for initialisation, clearing of connections. There are functions at -higher level dealing with sending fields, rows, establishing -connections, sending commands, but those are not explained in the -following chapter. - - - Functions utilized in client - server protocol - ---------------------------------------------- - - First of all, functions are described that are involved in -praparing/ reading / writing data over TCP port , socket or named pipe -file, and functions directly related to those. All of these functions -are used both in server and client. Server and client specific code -segments will be documented in each function description. Each MySQl -function checks for errors in memory allocation / freeing, as well as -in every OS call, like the one dealing with files and sockets, and for -errors in indeginous MySQL function calls. This is expected, but has -to be said, as not to repeat it in every function description. - - Older versions of MySQL have utilized the following macros for -reading from / writing to socket. - - raw_net_read - calls OS function recv function that reads N - bytes from a socket into a buffer. Number of - bytes read is returned. - - raw_net_write - calls OS funciton send to write N bytes from - a buffer to socket. Number of bytes written - is returned. - - These macros are replaced with VIO (Virtual I/O) functions. - - - Function name: my_net_init - - Parameters: struct NET *, enum_net_type, struct Vio - - Return value : 1 for error, 0 for success - - Function purpose: To initialize properly all NET fields, - allocate memory and set socket options - - Function description - - First of all, buff field of NET struct is allocated to the -size of net_buffer_lenght, and on failure function exits with 0. All -fields in NET are set to their default or starting values. As -net_buffer_length and max_allowed_packet are configurable, -max_allowed_packet is set equal to net_buffer_length it the later one -is greater. max_packet if set for that NET to net_buffer_lenght, and -buff_end points to buff end. vio feild is set to the second parameter. -If it is a real connection, which is a case when second parameter is -not null, then fd field is set by calling vio_fd function.read_pos and -write_pos to buff, while remaining integers are set to 0. If function -is run on the MySQL server on Unix and server is started in a test -mode that would require testing of blocking, then vio_blocking -function is called. Last, fast throughput mode is set by a call to -vio_fastsend function. - - - - Function name: net_end - - Parameters: struct NET * - - Return value : void - - Function purpose: To release memory alloceted to buff - - - - Function name: net_realloc (private, static function) - - Parameters: struct NET, unlong (unsigned long) - - Return value : 1 for error, 0 for success - - Function purpose: To change memory allocated to buff - - Function description - - New length of buff field of NET struct is passed as second -parameter. It is first checked versus max_allowd_packet and if greater -error is returned. New length is aligned to 4096 boundary. Then , buff -is reallocated, buff_end, max_packet and write_pas reset to the same -values as in my_net_init. - - - - Function name: net_clear (used on client side only) - - Parameters: struct NET * - - Return value : void - - Function purpose: To read unread packets - - Function description - - This function is used on client side only, and is executed -only if a program is not started in test mode. This function reads -unread packets without processing them. First, non-blocking mode is -set on systems that have not non-blocking mode defined. This is -performed by checking a mode with vio_is_blocking function. and -setting non-blocking mode by vio_blocking function. If this operation -was successfull, then packets are read by vio_read function, to which -vio field of NET is passed together with buff and max_packet field -values. field of the same struct at a length of max_packet. If -blocking was active before reading is performed, blocking is set with -vio_blocking function. AFter reading has been performed, pkt_nr is -reset to 0 and write_pos reset to buff. In order to clarify some -matters non-blocking mode enables executing program to dissociate from -a connection, so that error in connection would not hang entire -program or it's thread. - - Function name: net_flush - - Parameters: struct NET * - - Return value : 1 for error, 0 for success - - Function purpose: To write remaining bytes in buff to socket - - Function description - - net_real_write (described below) is performed is write_pos -differs from buff, both being fields of the only parameter. write_pos -is reset to buff. This function has to be used, as MySQL uses buffered -writes, as it will be more explained in a function net_write_buff. - - - Function name: my_net_write - - Parameters: struct NET *, const char *, ulong - - Return value : 1 for error, 0 for success - - Function purpose: Write a logical packet in a first parameter - of second parameter length - - Function description - - The purpose of this function is to prepare a logical packet -such that entire content of data, pointed to by second parametar and -in length of third parameter is sent to the other side. In case of -server, it is used for sending result sets, and in case of client it -is used for sending local data. This function foremost prepares a -header for the packet. Normal, header consists of 4 bytes, of which -first 3 bytes contain a length of the packet, thereby limiting a -maximum allowable length of a packet to 16 Mb, while a fourth byte -contains a packet number, which is used when one large packet has to -be divided into sequence of packets. This way each sub-packet gets -it's number which should be matched on the other side. When -compression is used another three bytes are added to packet header, -thus packet header is in that case increased to 7 bytes. Additional -three bytes are used to save a length of compressed data. As in -connection that uses compression option, code packs packets together,, -a header prepared by this function is later not used in writting to / -reading from network, but only to distinguish logical packets within a -buffered read operation. - - - This function, first stores a value for third parameter into a -first 3 bytes of local char variable of NET_HEADER_SIZE size by usage -of function int3store. Then, at this point, if compression is not -used, pkt_nr is increased, and it's value stored in the last byte of -the said local char[] variable. If compression is used 0 is stored in -both values. Then those four bytes are sent to other side by the usage -of the function net_write_buff(to be explained later on), and -successfull, entire packet in second parameter of the length described -in third parameter is sent by the usage of the same function. - - - Function name: net_write_command - - Parameters: struct NET *, char, const char *, ulong - - Return value : 1 for error, 0 for success - - Function purpose: Send a command with a packet as in previous - function - - Function description - - This function is very similar to the previous one. The only -difference is that first packet is enlarged by one byte, so that a -command precedes a packet to be sent. This is implemented by -increasing fist packet by one byte, which contains a command code. As -command codes do not use a range of values that are used by chararcter -sets, so when the other side receives a packet, first byte after -header contains a command code. This function is used by client for -sending all commands and queries, and by server in connection process -and for sending errors. - - - Function name: net_write_buff (private, static function) - - Parameters: struct NET *, const char *, uint - - Return value : 1 for error, 0 for success - - Function purpose: To write a packet of vany size by cutting it - and using next function for writing it - - Function description - - This function was created after compression feature has been -added to MySQL. This function supposes that packets have already been -properly formatted, regarding packet header etc. Principal reason for -this function existst because a packet that is sent by client or -server does not have to be less then max_packet. So this function -first calculeates how much data has been left in a buff, by getting a -difference between buff_end and write_pos and storing it to local -variable left_length. Then a loop is run as long as a length to be -sent is greater then length of left bytes (left_length). In a loop -data from second parameter is copied to buff at write_pos, as much as -it can be, i.e. by left_length. Then net_real_write function is called -(see below) with NET, buff, and max_packet parameters. This function -is the lowest level fucntion that writes data over established -connection. In a loop, write_pos is reset to buff, a pointer to data -(second parameter) is moved by teh amount of data sent (left_length), -length of data to be sent (third parameter) is decreased by the amount -sent (left_length) and left_length is reset to max_packet value, which -ends a loop. This logic was necessary, as there could have been some -data yet unsent (write_pos != buf), while data to be sent could be as -large as necessary, thus requiring many loops. At the end of function, -remaining data in second parameter are copied to buff at write_pos, by -the remaining length of data to be sent (third parameter). So, in the -next call of this function remaining data will be sent, as buff is -used in a call to net_real_write. It is very important to note that if -a packet to be sent is less then a number of bytes that are still -available in buff, then there will be no writing over network, but -only logical packets will be added one after another. This will -accelerate network traffic, plus if a compression is used, the -expected compression rate would be higher. That is why server or -client functions that sends data uses at the end of data net_flush -function described above. - - - Function name: net_real_write - - Parameters: struct NET *, const char *, ulong - - Return value : 1 for error, 0 for success - - Function purpose: To write data to a socket or pipe, with - compression if used - - Function description - - First, more field is set to 2, to enable reporting in -mysql_list_processes. Then if compression is enabled on that -connection, a new local buffer (variable b) is initialized to the -length of total header (normal header + compression header) and if no -memory is available error is returned. This buffer (b) is used for -holding a fineal, compressed packet to be written ove -connection. Furthermore in compressiion initialization, Second -parameter at length of third parameter is copied to the local buffer -b, and MySQL's wrapped zlib's compression function is run at total -header offset of the local buffer. Please, do note that this function -does not test effectiveness of compression. If compression is turned -on in some connection, it is used all of the time. Also, it is very -important to be cognizant of the fact that this algorithm makes -possible that a single compressed packet contains several logical -packets. In this way compression rate is increased and network -throughput is increased as well. However, this algorithm has -consequences on the other sided, that reads compressed packet, which -is covered in my_net_read function. After compression is done, a full -compression header is properly formed with a packet number, -compressed and uncompressed lengths. At the end of compression code, -third parameter is increased by total header length, as the original -header is not used (see above), and second parameter, pointer to data, -is set to point to local buffer b, in order that a further flow of -function is independent of compression. . If a function is executed -on server side, a thread alarm initialized and if non-blocking is -active set at NET_WRITE_TIMEOUT. Two local (char *) pointers are -initialized, pos at beginning of second parameter, and end at end of -data. Then a loop is run as long as all data is written, which means -as long as pos != end. First vio_write function is called, with -parameters of vio field, pos and size of data (end - pos). Number of -bytes written over connection is saved in local variable (length). If -error is returned local bool variable (interrupted) is set according -to the return value of the vio_should_retry called with vio field as -parameter. This bool variable indicates whether writing was -interrupted in some way or not. Firther, error from vio_write is -differently treated on Unix versus other OS's (Win32 or OS/2). On Unix -an alarm is set if one is not in use, no bytes have been written and -there has been no interruption. Also, in that case, if connection is -not in blocking mode, a sub - loop is run as long as blocking is not -set with vio_blocking function. Withing a loop another run of above -vio_write is run based on return value of vio_is_retry function, --provided number of repeated writes is less then RETRY_COUNT. If that -is not a case, error field of struct NET. is set to 1 and function -exits. At the exit of sub-llop number of reruns already executed is -reset to zero and another run of above vio_write function is -attempted. If a function is run on Win32 and OS/2, and in the case -that function flow was not interrupted and thread alarm is not in use, -again a main loop is continued until pos != end. In the case that this -function is executed on thread safe client program, a communication -flow is tested on EINTR, caused by context switching, by use of -vio_errno function, in which case a loop is continued. At the end of -processing of the error from vio_write, error field of struct NET is -set, and if on server last_errno field is set to -ER_NET_WRITE_INTERRUPTED in the case thatb local bool variable -(interrupted) is true or to ER_NET_ERROR_ON_WRITE. Before the end of -loop, in order to make possible evaluation of the loop condition, pos -is increased by a value writen in last iteration (length). Also global -variable bytes_sent is increased by the same value, for status -purposes. At the end of the functions more fields is reset, in case -of compression, combression buffer (b) memory is released and if -thread is still in use, it is ended and blocking state is reset to -it's original state, and function returns error is all bytes are not -written. - - - - Function name: my_real_read (private, static function) - - Parameters: struct NET *, ulong * - - Return value : length of bytes read - - Function purpose: low level network connection read function - - Function description - - This function has made as a separate one when compression was -introduced in MySQL client - server protocol . It contains basic, low -level network reading functionality, while all dealings with -compressed packets are handled in next function. Compression in this -function is only handled in as much to unfold a length of uncompressed -data. First blocking state of connection is saved in local bool -variable net_blocking, and field more is set 1 for deteiled reporting -in mysqld_list_processes. A new thread alarm is initialized, in order -to enable read timout handling, and if on server and a connection can -block a program, the alarm is set at a value of timeout field. Local -pointer is set to the position of the next logical packet, with it's -header skipped, which is at field where_b offset from buff. Next, a -two time run code is entered. A loop is run exactly two times becase -first time number of bytes to be fetched (remain) are set to the -header size, which is different when compression is used or not used -on the connection. After first fetch has been done, number of packets -that will be received in second iteration is well known, as fetched -header contains a size of packet, packet number ,and in a case of -compression a size of uncompressed packet. Then as long, as there are -bytes to read a loop is entered with ffirst reading data from network -connection with vio_read function, called with parameters of field -vio, current position and remaining number of bytes, which value is -hold by local variable (remain) initialized at a value of header size, -which differs if compression is used. Number of bytes read are -returned in local length variable. If error is returned local bool -variable (interrupted) is set according to the return value of the -vio_should_retry called with vio field as parameter. This bool -variable indicates whether reading was interrupted in some way or not. -Firther, error from vio_read is differently treated on Unix versus -other OS's (Win32 or OS/2). On Unix an alarm is set if one is not in -use, no bytes have been read and there has been no interruption. Also, -in that case, if connection is not in blocking mode, a sub - loop is -run as long as blocking is not set with vio_blocking function. Withing -a loop another run of above vio_read is run based on return value of -vio_is_retry function, -provided number of repeated writes is less -then RETRY_COUNT. If that is not a case, error field of struct NET. is -set to 1 and function exits. At the exit of sub-llop number of reruns -already executed is reset to zero and another run of above vio_read -function is attempted. If a function is run on Win32 and OS/2, and in -the case that function flow was not interrupted and thread alarm is -not in use, again a main loop is continued as long as there are bytes -remaining. In the case that this function is executed on thread safe -client program, then if a another run should be made, which is decided -by the output of vio_should_retry function, in which case a loop is -continued. At the end of processing of the error from vio_read, error -field of struct NET is set, and if on server last_errno field is set -to ER_NET_READ_INTERRUPTED in the case thatb local bool variable -(interrupted) is true or to ER_NET_ERROR_ON_READ. In case of such an -error this function exits and returns error. In a case when there is -no error, number of remaining bytes (remain) is decreased by a number -of bytes read, which should be zero, but in case it is not the entire -code is still in while (remain > 0) loop, which will be exited -immediately if it is. This has been done to accomodate errors in the -traffic level and for the very slow connections. Current position in -field buff is also moved by the amount of bytes read by vio_read -funciton, and global variable bytes_received is increased by the same -value in a thread safe manner. When a loop that is run until necessary -bytes are read (remain) is finished, then if external loop is in it's -first run, of the two, packet sequencing is tested on consistency by -comparing a number contained at 4th byte in header with pkt_nre -field. Header location is found at where_b offset to field_b. Usage of -where_b is obligatory due to the possible compression usage. If there -is no compression on a connection, then where_b is always 0. If there -is a discrepancy, then first byte of the header is checked whether it -is equal to 255, because when error is sent by a server, or by a -client if it is sending data (like in LOAD DATA INFILE LOCAL...), then -first byte in header is set to 255. If it is not 255, then an error on -packets being out of order is printed. In any case, on server, -last_errno field is set to ER_NET_PACKETS_OUT_OF_ORDER and a function -returns with the error, i.e. value returned is packet_error. If a -check on serial number of packet is successful, pkt_nr field is -incremented in order to enable checking packet order with next packet -and if compression is used, uncompressed length is extracted from a -proper position in header and returned in the second parameter of this -function. Length of the packet is saved, for the purpose of a proper -return value from this function. Still in the first iteration of the -main loop, a check must be made if field buff could accomodate entire -package that comes, in it's compressed or uncompressed form. This is -done in such a way, because zlib's compress and uncompress functions -use a same memory area for compression / uncompression. Necessary -field buff length is equal to current offset where data are (where_b -which is zero for non-compression), plus the larger value of -compressed or uncompressed package to be read in a second run. If this -value is larger then a current length of field buff, which is read -from field max_packet, then feild buff has to be reallocated. IF -reallocation with net_realloc function fails, function is returned -with error. Before a second loop is started, length to be read is set -to the length of expected data and current position (pos) is set at -where_b offset from field buff. At the end of function, if alarm is -set, which is a case if it is run on server or on a client if a -function is interrupted and another run of vio_read is attempted, -alarm is ended and blocking state is resotred from the saved local bool -variable net_blocking. Function returns number of bytes read or the -error (packet_error). - - - - - Function name: my_net_read - - Parameters: struct NET * - - Return value : length of bytes read - - Function purpose: Highest level general purpose reading function - - Function description - - First, if compression is not used, my_real_read is called, -with struct NET * a first parameter, and pointer to local ulong -complen as a second parameter, but it's value is not used here. -Number of bytes read is returned in local ulong variable len. read_pos -field is set to an offset of value of where_b field from field -buff. where_b field actually denotes where in field buff is a current -packet. If returned number of bytes read (local variable len) does not -signal that an error in packet trnasmission occured, i.e. it is not -set to packet_error, then a string contained in read_pos is zero -terminated. Simply, the end of a string starting at read_pos, and -ending at read_pos + len, is set to zero. This is done in that way, -because mysql_use_result expects a zero terminated string, and -function returns with a value local variable len. This ends this -function in the case that compression is not used and a remaining code -is executed only if compression is enabled on the connection. In -order to explain how is compressed packet logically cut into -meningfull packets, a full meaning of several NET feilds should be -explained. First of all, fields in NET are used and not local -variables, as all values should be saved between consecutive calls of -this function. Simply, this function is called in order to return -logical packets, but this function does not need to call my_real_read -function everytime, because when a large packet is uncompressed, it -may, but not necessarily so, contain several logical -packets. Therefore, in oreder to preserve data on logical packets -local variables are not used. Instead fields in NET struct are -used. Field remain_in_buf denotes how many bytes of entire -uncompressed packets is still contained withing buff. field buf_length -saves a value of the length of entire uncompressed packet. field -save_char is used to save a character at a position where a packet -ends, which character has to be replaced with a zero, '\0', in order -to make a logical packet zero delimited, for mysql_use_result. Field -length stores a value of the length of compressed packet. Field -read_pos as usual, points to the current reading position. This char * -pointer is used by all fucntion calling this function in order to -fetch their data. Field buff is not used for that purpose, but -read_pos is used instead. This change was introduced with compression, -when algorihtm accomodated grouping of several packets together. Now, -that meanings of all relevant NET fields is complained, we can proceed -with a flow of this functinn in case when compression is -active. First, if there are remaining portions of compressed packet in -a field buff, saved character value is set at a position where zero -char '\0' was inserted to enable a string do be zero delimited for -mysql_use_result. Then a loop is started. In the first part of the -loop, if there are remaining bytes, local uchar *pos variable is set -at a current position in field buff where a new packet starts. This -position is an (buf_length - remain_in_buf) offset in field buff. As -it is possible that next logical packet is not read to the full length -in the remaining of the field buf, several things had to be -inspected. It should be noted that data that is read from -net_rweal_read contains only logical packets containing 4 byte headers -only, being 4 byte headers prepared by my_net_write or -net_write_command. But, when written, logical packet could be so -divided that only a part of header is read in. Therefore after pointer -to the start of the next packet has been saved, a check is made -whether number of remaining bytes in buffer is less then 4, being 3 -bytes for length and one byte for packet number. If it is greater, -then a length of the logical packet is extracted and saved a length -field. Then a check is made whether entire packet is contained withing -a buf, i.e. a check is made that a logical packet is fully contained -in a buffer. In that case, number of bytes remaining in buffer is -decreased by a full length of logical packet ( 4 + length field), -read_pos is moved forward by 4 bytes to skip header and be set at a -beginning of data in logical packet, length field is saved for a value -to be returned in function and a loop is exited. In a case that -entire logical packet is not contained within a buffer, then if length -of the entire buffer differs from remaining length of logical packet, -it (logical packet) is moved to the beginning of the field buff. If -length of the entire buffer equals the remaining length of logical -packet, where_b and buf_length fields are set to 0. This is done so -that in both cases buffer is ready to accept next part of packet. In -order to get a next part of a packet, still within a loop, -my_real_read function is called and length of compressed packet is -returned to a local len variable, and length of compressed data is -returned in complen variable. In a case of non-compression value of -complen is zero. If packet_error is from my_real_read function, this -function returns also with packet_error. If it is not a packet_error -my_uncompress function is called to uncompress data. It is called with -offset of where_b data from field buff, as it is a postion where -compressed packet starts, and with len and complen values, being -lengths of compressed and uncompressed data. If there is no -compression, 0 is returned for uncompressed size from my_real_read -function, and my_uncompress wrapper function is made to skip zlib -uncompress in that case. If error is returned fom my_uncompress, -error field is set to 1, if on server last_errno is set to -ER_NET_UNCOMPRESS_ERROR and loop is exited and function returns with -packet_error. If not, buf_length and reamin_in_buf fields are set to -the uncompressed size of buffer and a loop is continued. When a loop -is exited save_char field is used to save a char at end of a logical -packet, which is an offset of field len from position in field buff -pointed by field read_os, in order that zero char is set at the same -position, for mysql_use_result. Function returns a length of the -logical packet without it's header. From 4b4700f32f88f58c9b7f3d30ef600b292c87693b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 19:43:15 +0100 Subject: [PATCH 305/789] .del-fill_func_tables.sh: Delete: scripts/fill_func_tables.sh .del-fill_help_tables.sh: Delete: scripts/fill_help_tables.sh .del-internals.texi: Delete: Docs/internals.texi BitKeeper/deleted/.del-internals.texi: Delete: Docs/internals.texi BitKeeper/deleted/.del-fill_func_tables.sh: Delete: scripts/fill_func_tables.sh BitKeeper/deleted/.del-fill_help_tables.sh: Delete: scripts/fill_help_tables.sh --- Docs/internals.texi | 101 ------ scripts/fill_func_tables.sh | 239 -------------- scripts/fill_help_tables.sh | 603 ------------------------------------ 3 files changed, 943 deletions(-) delete mode 100644 Docs/internals.texi delete mode 100644 scripts/fill_func_tables.sh delete mode 100644 scripts/fill_help_tables.sh diff --git a/Docs/internals.texi b/Docs/internals.texi deleted file mode 100644 index e1462531270..00000000000 --- a/Docs/internals.texi +++ /dev/null @@ -1,101 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c -@c ********************************************************* -@c -@c This is a dummy placeholder file for internals.texi in the -@c MySQL source trees. -@c -@c Note, that the internals documentation has been moved into a separate -@c BitKeeper source tree named "mysqldoc" - do not attempt to edit this -@c file! All changes to internals.texi should be done in the mysqldoc tree. -@c -@c See http://www.mysql.com/doc/en/Installing_source_tree.html -@c for information about how to work with BitKeeper source trees. -@c -@c This dummy file is being replaced with the actual file from the -@c mysqldoc tree when building the official source distribution. -@c -@c Please e-mail docs@mysql.com for more information or if -@c you are interested in doing a translation. -@c -@c ********************************************************* -@c -@c %**start of header - -@setfilename internals.info - -@c We want the types in the same index -@syncodeindex tp fn - -@ifclear tex-debug -@c This removes the black squares in the right margin -@finalout -@end ifclear - -@c Set background for HTML -@set _body_tags BGCOLOR=silver TEXT=#000000 LINK=#101090 VLINK=#7030B0 -@c Set some style elements for the manual in HTML form. 'suggested' -@c natural language colors: aqua, black, blue, fuchsia, gray, green, -@c lime, maroon, navy, olive, purple, red, silver, teal, white, and -@c yellow. From Steeve Buehler -@set _extra_head - -@settitle Dummy MySQL internals documentation for version @value{mysql_version}. - -@c We want single-sided heading format, with chapters on new pages. To -@c get double-sided format change 'on' below to 'odd' -@setchapternewpage on - -@paragraphindent 0 - -@c %**end of header - -@ifinfo -@format -START-INFO-DIR-ENTRY -* mysql: (mysql). MySQL documentation. -END-INFO-DIR-ENTRY -@end format -@end ifinfo - -@titlepage -@sp 10 -@center @titlefont{Empty placeholder for the MySQL Internals Documentation} -@sp 10 -@center Copyright @copyright{} 1995-2003 MySQL AB -@c blank page after title page makes page 1 be a page front. -@c also makes the back of the title page blank. -@page -@end titlepage - -@c This should be added. The HTML conversion also needs a MySQL version -@c number somewhere. - -@iftex -@c change this to double if you want formatting for double-sided -@c printing -@headings single - -@oddheading @thischapter @| @| @thispage -@evenheading @thispage @| @| MySQL Internal Reference for Version @value{mysql_version} - -@end iftex - -@node Top, (dir), (dir), (dir) - -@ifinfo -This is an empty placeholder file for the MySQL internals documentation. - -The real version of this file is now maintained in a separate BitKeeper -source tree! Please see -@url{http://www.mysql.com/doc/en/Installing_source_tree.html} for more info -on how to work with BitKeeper. - -Please do not attempt to edit this file directly - use the one in the -@code{mysqldoc} BK tree instead. - -This file will be replaced with the current @code{internals.texi} when -building the official source distribution. -@end ifinfo - -@bye diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh deleted file mode 100644 index b7bd3736392..00000000000 --- a/scripts/fill_func_tables.sh +++ /dev/null @@ -1,239 +0,0 @@ -#!@PERL@ -# -# Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. -# -# fill_func_tables - parse ../Docs/manual.texi -# -# Original version by Victor Vagin -# - -my $cat_name= ""; -my $func_name= ""; -my $text= ""; -my $example= ""; - -local $mode= ""; - -sub prepare_name -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - - $a =~ s/\@table \@code/ /g; - - $a =~ s/\(\)//g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; - $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - - return $a; -} - -sub prepare_text -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@itemx/ /g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - $a =~ s/\@table \@code/ /g; - - return $a; -} - -sub prepare_example -{ - my ($a)= @_; - - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - return $a; -} - -sub flush_all -{ - my ($mode) = @_; - - if ($mode eq ""){return;} - - $func_name= prepare_name($func_name); - $text= prepare_text($text); - $example= prepare_example($example); - - if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT INTO function (name,description,example) VALUES ("; - print "'$func_name',"; - print "'$text',"; - print "'$example'"; - print ");\n"; - print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; - } - - $func_name= ""; - $text= ""; - $example= ""; - $mode= ""; -} - -sub new_category -{ - my ($category)= @_; - - $category= prepare_text($category); - - print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; - print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; -} - -print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; -print "CREATE DATABASE mysql_help;\n"; - -print "USE mysql_help;\n"; - -print "DROP TABLE IF EXISTS function;\n"; -print "CREATE TABLE function ("; -print " func_id int unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " description text not null,"; -print " example text not null,"; -print " min_args tinyint not null,"; -print " max_args tinyint,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (func_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category_name;\n"; -print "CREATE TABLE function_category_name ("; -print " cat_id smallint unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (cat_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category;\n"; -print "CREATE TABLE function_category ("; -print " cat_id smallint unsigned not null references function_category_name,"; -print " func_id int unsigned not null references function,"; -print " primary key (cat_id, func_id)"; -print ") type=myisam;\n\n"; - -print "DELETE FROM function_category_name;\n"; -print "DELETE FROM function_category;\n"; -print "DELETE FROM function;\n"; -print "SELECT \@cur_category:=null;\n\n"; - -my $in_section_6_3= 0; - -for(<>) -{ - if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && - !$in_section_6_3){ - $in_section_6_3= 1; - next; - } - - if ($_=~/\@section/ && $in_section_6_3){ - $in_section_6_3= 0; - next; - } - - if (!$in_section_6_3) { next; } - - my $c_name= ""; - - ($c_name)=m|\@c for_mysql_help,(.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsubsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($f_name)=m|\@findex (.+?)$|; - if (!($f_name eq "")){ - flush_all($mode); - ($func_name)= ($f_name); - $mode= "text"; - next; - } - - if ($_=~/\@example/ && ($mode eq "text")){ - $mode= "example"; - next; - } - - if ($_=~/\@end example/ && ($mode eq "example")){ - flush_all($mode); - next; - } - - if ($mode eq "text") { $text .= $_; } - if ($mode eq "example") { $example .= $_; } -} - - -print "DELETE function_category_name "; -print "FROM function_category_name "; -print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; -print "WHERE function_category.cat_id is null;" - diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh deleted file mode 100644 index fc0c684c2dc..00000000000 --- a/scripts/fill_help_tables.sh +++ /dev/null @@ -1,603 +0,0 @@ -#!@PERL@ -# -# Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. -# -# This script generates the SQL statements required by mysql_install_db to -# fill up the tables for the server-side online function help, which can be -# invoked with "help " from the MySQL client. -# -# Usage: -# fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql -# -# --help display this helpscreen and exit -# --verbose print information about help completeness to STDERR -# --lexems=path path to file with lexems. it is used with verbose option. -# default value is ../sql/lex.h -# Examples: -# ./fill_help_tables --help -# ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql -# ./fill_help_tables < manual.texi > fill_help_tables.sql -# -# Please note, that you first need to update Docs/manual.texi with the -# manual file from the separate "mysqldoc" BitKeeper-Tree! The manual.texi -# included in the source tree is just an empty stub file - the full manual -# is now maintained in a separate tree. -# -# extra tags in manual.texi: -# -# @c help_category [@] -# -# @c description_for_help_topic -# .... -# @c end_description_for_help_topic -# -# @c example_for_help_topic -# @example -# .... -# @end example -# -# -# Original version by Victor Vagin -# - -use strict; -use Getopt::Long; - -my $insert_portion_size= 15; -my $error_prefix= "---- help parsing errors :"; - -my $path_to_lex_file= "../sql/lex.h"; -my $verbose_option= 0; -my $help_option= 0; - -my $cur_line= 0; -my $count_errors= 0; - -GetOptions( - "help",\$help_option, - "verbose",\$verbose_option, - "lexems=s",\$path_to_lex_file -); - -if ($help_option ne 0) -{ - print <<_HELP; - -This script generates the SQL statements required by mysql_install_db to -fill up the tables for the server-side online function help, which can be -invoked with "help " from the MySQL client. - -Usage: - fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql - - --help display this helpscreen and exit - --verbose print information about help completeness to STDERR - --lexems=path path to file with lexems. it is used with verbose option. - default value is ../sql/lex.h - -Examples: - ./fill_help_tables --help - ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql - ./fill_help_tables < manual.texi > fill_help_tables.sql - -_HELP - exit; -} - -my $current_category= ""; -my $current_parent_category= ""; -my $next_example_for_topic= ""; - -my %topics; -my %categories; -my %keywords; - -$categories{Contents}->{__parent_category__}= ""; - -sub print_error -{ - my ($text)= @_; - if ($count_errors==0) - { - print STDERR "$error_prefix\n"; - } - print STDERR "line $cur_line : $text"; - $count_errors++; -} - -sub add_topic_to_category -{ - my ($topic_name)= @_; - - $categories{$current_category}->{$topic_name}= $topics{$topic_name}; - my $category= $categories{$current_category}; - $category->{__name__}= $current_category; - - if (exists($category->{__parent_category__})) - { - my $old_parent= $category->{__parent_category__}; - if ($old_parent ne $current_parent_category) - { - print_error "wrong parent for $current_category\n"; - } - } - - if ($current_parent_category ne "") - { - $category->{__parent_category__}= $current_parent_category; - } - - if (exists($topics{$topic_name}->{category})) - { - my $old_category= $topics{$topic_name}->{category}; - if ($old_category ne $category) - { - print_error "wrong category for $topic_name (first one's \"$old_category->{__name__}\" second one's \"$current_category\")\n"; - } - } - - $topics{$topic_name}->{category}= $category; -} - -sub add_example -{ - my ($topic_name,$example)= @_; - - $topic_name=~ tr/a-z/A-Z/; - - if (exists($topics{$topic_name}->{example})) - { - print_error "double example for $topic_name\n"; - } - - $topics{$topic_name}->{example}= $example; - add_topic_to_category($topic_name); -} - -sub add_description -{ - my ($topic_name,$description)= @_; - - $topic_name=~ tr/a-z/A-Z/; - - if (exists($topics{$topic_name}->{description})) - { - print_error "double description for $topic_name\n"; - } - $topics{$topic_name}->{description}= $description; - add_topic_to_category($topic_name); -} - -sub add_keyword -{ - my ($topic_name,$keyword)= @_; - - $topic_name=~ tr/a-z/A-Z/; - $keyword=~ tr/a-z/A-Z/; - - push(@{$topics{$topic_name}->{keywords}},$keyword); - if (exists($keywords{$keyword}->{$topic_name})) - { - print_error "double keyword $keyword for $topic_name\n"; - } - $keywords{$keyword}->{$topic_name}= $topics{$topic_name}; -} - -sub prepare_name -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@item/ /g; - $a =~ s/\@minus\{\}/-/g; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@command\{((.|\n)+?)\}/$1/go; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/'$1'/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - - $a =~ s/\@table \@code/ /g; - $a =~ s/\(\)//g; - $a =~ s/\"/\\\"/g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs; - $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - - $a =~ s/((\s)+)$//g; - - return $a; -} - -sub prepare_description -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet\n)//g; - $a =~ s/(\@c help_keyword (.*?)\n)//g; - $a =~ s/(\@end itemize\n)//g; - $a =~ s/(\@end example\n)//g; - $a =~ s/(\@example\n)//g; - $a =~ s/(\@{)/{/g; - $a =~ s/(\@})/}/g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)//g; - $a =~ s/(\@findex(.*?)\n)//g; - $a =~ s/(\@table(.*?)\n)//g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@itemx/ /g; - $a =~ s/(\@item\n(\s*?))(\S)/ --- $3/g; - $a =~ s/(\@item)/ /g; - $a =~ s/(\@tindex\s(.*?)\n)//g; - $a =~ s/(\@c\s(.*?)\n)//g; - $a =~ s/\@minus\{\}/-/g; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@command\{((.|\n)+?)\}/$1/go; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/'$1'/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\@w\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{((.|\n)+?)\}/\n!!!!\n$1\n!!!!\n/go; - $a =~ s/\@file\{((.|\n)+?)\}/\*$1/go; - $a =~ s/\\/\\\\/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n/\\n/g; - $a =~ s/\"/\\\"/g; - - $a =~ s/\@table \@code/ /g; - - return $a; -} - -sub prepare_example -{ - my ($a)= @_; - - $a =~ s/(^\@c for_help_topic(.*?)\n)//g; - - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\\/\\\\/g; - $a =~ s/(\@{)/{/g; - $a =~ s/(\@})/}/g; - $a =~ s/(\@\@)/\@/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - $a =~ s/\"/\\\"/g; - - return $a; -} - -sub parse_example -{ - return if (!($_=~/\@example/)); - return if ($next_example_for_topic eq ""); - - my $topic_name= $next_example_for_topic; - $next_example_for_topic= ""; - my $text= ""; - - while (<>) - { - $cur_line++; - last if ($_=~/\@end example/); - $text .= $_; - } - - $text= prepare_example($text); - $topic_name= prepare_name($topic_name); - add_example($topic_name,$text) if ($topic_name ne ""); -} - -sub parse_example_for_topic -{ - my ($for_topic)= m|\@c example_for_help_topic (.+?)$|; - return if ($for_topic eq ""); - - $next_example_for_topic= $for_topic; -} - -sub parse_description -{ - my ($topic_description)= m|\@c description_for_help_topic (.+?)$|; - return if ($topic_description eq ""); - - my ($topic_name,$topic_keywords)= split(/ /,$topic_description); - - if ($topic_name eq "" || $topic_keywords eq "") - { - $topic_name= $topic_description; - } - else - { - my $keyword; - foreach $keyword (split(/ /,$topic_keywords)) - { - add_keyword($topic_name,$keyword) if ($keyword ne ""); - } - } - - my $text= ""; - - while (<>) - { - $cur_line++; - last if ($_=~/\@c end_description_for_help_topic/); - $text .= $_; - } - - $text= prepare_description($text); - $topic_name= prepare_name($topic_name); - add_description($topic_name,$text); -} - -sub parse_category -{ - my ($c_name,$pc_name)= m|\@c help_category (.+?)\@(.+?)$|; - - if ($pc_name ne "") - { - $current_category= prepare_name($c_name); - $current_parent_category= prepare_name($pc_name); - } - else - { - my ($c_name)=m|\@c help_category (.+?)$|; - return if ($c_name eq ""); - - $current_category= prepare_name($c_name); - $current_parent_category= "Contents" - } -} - -# parse manual: - -while (<>) -{ - parse_example_for_topic (); - parse_example (); - parse_description (); - parse_category (); - $cur_line++; -} - -# test results of parsing: - -sub print_bad_names -{ - my($names,$prompt)= @_; - if (scalar(@{$names})) - { - print STDERR "\n-------------- $prompt : \n\n"; - my $name; - foreach $name (@{$names}) - { - print STDERR "$name\n"; - } - print STDERR "\n"; - } -} - -sub print_verbose_errors -{ - my($name_of_log_file)= @_; - - my @without_help; - my @description_with_at; - my @example_with_at; - my @without_description; - my @without_example; - - print STDERR "\n-------------- parameters of help completeness : \n\n"; - - my $count_lex= 0; - if (!open (TLEX,"<$path_to_lex_file")) - { - print STDERR "Error opening lex file \"$path_to_lex_file\" $!\n"; - } - else - { - for () - { - my ($a,$lex,$b)=m|(.+?)\"(.+?)\"(.+?)$|; - next if ($lex eq ""); - $count_lex++; - next if (exists($topics{$lex}) || exists($keywords{$lex})); - push(@without_help,$lex); - } - close(TLEX); - print STDERR "number of lexems in \"$path_to_lex_file\" - $count_lex\n"; - } - - my $name; - my @topic_names= keys(%topics); - foreach $name (@topic_names) - { - my $topic= $topics{$name}; - push(@description_with_at,$name) if ($topic->{description}=~/\@/); - push(@example_with_at,$name) if ($topic->{example}=~/\@/); - push(@without_description,$name) if (!exists($topic->{description})); - push(@without_example,$name) if (!exists($topic->{example})); - } - - my $count_categories= scalar(keys(%categories)); - print STDERR "number of help categories - ",$count_categories,"\n"; - my $count_topics= scalar(@topic_names); - print STDERR "number of help topics - ",$count_topics,"\n"; - my $count_keywords= scalar(keys(%keywords)); - print STDERR "number of help keywords - ",$count_keywords,"\n"; - - my $count_without_help= scalar(@without_help); - my $percent_without_help= $count_lex ? - int (($count_without_help/$count_lex)*100) : - "100"; - print_bad_names(\@without_help,"lexems without help (". - $count_without_help." ~ ". - $percent_without_help."%)"); - print_bad_names(\@description_with_at, - " topics below have symbol \'@\' in their descriptions.\n". - "it's probably the litter from 'texi' tags (script needs fixing)"); - print_bad_names(\@example_with_at, - " topics below have symbol \'@\' in their examples.\n". - "it's probably the litter from 'texi' tags (script needs fixing)"); - print_bad_names(\@without_description,"topics without description"); - - my $count_without_example= scalar(@without_example); - my $percent_without_example= $count_topics ? - int (($count_without_example/$count_topics)*100) : - "100"; - print_bad_names(\@without_example,"topics without example (". - $count_without_example." ~ ". - $percent_without_example."%)"); -} - -print_verbose_errors if ($verbose_option ne 0); - -# output result - -sub print_insert_header -{ - my($count,$header)= @_; - - if ($count % $insert_portion_size ne 0) { - print ","; - } else { - print ";\n" if ($count ne 0); - print "$header"; - } -} - -print <{__id__}= $count; - $count++; - } - - my $header= "insert into help_category ". - "(help_category_id,name,parent_category_id) values "; - $count= 0; - foreach $cat_name (@category_names) - { - print_insert_header($count,$header); - my $parent_cat_name= $categories{$cat_name}->{__parent_category__}; - my $parent_cat_id= $parent_cat_name eq "" - ? "-1" : $categories{$parent_cat_name}->{__id__}; - print "($count,\"$cat_name\",$parent_cat_id)"; - $count++; - } - printf ";\n\n"; -} - -my @topic_names= keys(%topics); -if (scalar(@topic_names)) -{ - my $header= "insert into help_topic ". - "(help_topic_id,help_category_id,name,description,example) values "; - my $topic_name; - my $count= 0; - foreach $topic_name (@topic_names) - { - print_insert_header($count,$header); - my $topic= $topics{$topic_name}; - print "($count,"; - print "$topic->{category}->{__id__},"; - print "\"$topic_name\","; - print "\"$topic->{description}\","; - print "\"$topic->{example}\")"; - $topics{$topic_name}->{__id__}= $count; - $count++; - } - printf ";\n\n"; -} - -my @keywords_names= keys(%keywords); -if (scalar(@keywords_names)) -{ - my $header= "insert into help_keyword (help_keyword_id,name) values "; - my $keyword_name; - my $count= 0; - foreach $keyword_name (@keywords_names) - { - print_insert_header($count,$header); - print "($count,\"$keyword_name\")"; - $count++; - } - printf ";\n\n"; - - $header= "insert into help_relation ". - "(help_topic_id,help_keyword_id) values "; - $count= 0; - my $count_keyword= 0; - foreach $keyword_name (@keywords_names) - { - my $topic_name; - foreach $topic_name (keys(%{$keywords{$keyword_name}})) - { - print_insert_header($count,$header); - print "($topics{$topic_name}->{__id__},$count_keyword)"; - $count++; - } - $count_keyword++; - } - printf ";\n\n"; -} - -if ($count_errors) -{ - print STDERR "$count_errors errors !!!\n"; - exit 1; -} From e2e06e3abe52aa1ec7432522d82ec1d0b2b1959e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 20:55:59 +0200 Subject: [PATCH 306/789] Bug#27171 mysqlbinlog produces different output depends from option -R Server starts any binlog dump from Format_description_log_event, this shifted all offset calculations in mysqlbinlog and made it to stop the dump earlier than --stop-position. Now mysqlbinlog takes Format_description_log_event into account mysql-test/r/mysqlbinlog2.result: Bug#27171 mysqlbinlog produces different output depends from option -R mysql-test/t/mysqlbinlog2.test: Bug#27171 mysqlbinlog produces different output depends from option -R --- client/mysqlbinlog.cc | 15 +++++++++---- mysql-test/r/mysqlbinlog2.result | 36 ++++++++++++++++++++++++++++++++ mysql-test/t/mysqlbinlog2.test | 8 +++++++ 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 7489cdb334c..d8ea3d5f255 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1040,7 +1040,7 @@ static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, uint logname_len; NET* net; int error= 0; - my_off_t old_off= start_position_mot; + my_off_t old_off= min(start_position_mot, BIN_LOG_HEADER_SIZE); char fname[FN_REFLEN+1]; DBUG_ENTER("dump_remote_log_entries"); @@ -1192,10 +1192,17 @@ could be out of memory"); } } /* - Let's adjust offset for remote log as for local log to produce - similar text. + Let's adjust offset for remote log as for local log to produce + similar text and to have --stop-position to work identically. + + Exception - the server sends Format_description_log_event + in the beginning of the dump, and only after it the event from + start_position. Let the old_off reflect it. */ - old_off+= len-1; + if (old_off < start_position_mot) + old_off= start_position_mot; + else + old_off+= len-1; } err: diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index 51ca19654c7..03b0e16d32a 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -122,6 +122,24 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +--- start and stop positions --- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +SET INSERT_ID=4/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609946/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; + --- start-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; @@ -481,6 +499,24 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +--- start and stop positions --- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +SET INSERT_ID=4/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609946/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +insert into t1 values(null, "d")/*!*/; +SET INSERT_ID=5/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; + --- start-datetime -- /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 6afae538f04..14b213cd9cc 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -55,6 +55,10 @@ select "--- stop-position --" as ""; --enable_query_log --exec $MYSQL_BINLOG --short-form --stop-position=600 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log +select "--- start and stop positions ---" as ""; +--enable_query_log +--exec $MYSQL_BINLOG --short-form --start-position=600 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001 +--disable_query_log select "--- start-datetime --" as ""; --enable_query_log --exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 @@ -111,6 +115,10 @@ select "--- stop-position --" as ""; --enable_query_log --exec $MYSQL_BINLOG --short-form --stop-position=600 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log +select "--- start and stop positions ---" as ""; +--enable_query_log +--exec $MYSQL_BINLOG --short-form --start-position=600 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--disable_query_log select "--- start-datetime --" as ""; --enable_query_log --exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 From 9b774e8f8d472a5cf20c42643b342378511ed4b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 22:05:19 +0300 Subject: [PATCH 307/789] Bug#26813: The SUPER privilege is wrongly required to alter a view created by another user. When the DEFINER clause isn't specified in the ALTER statement then it's loaded from the view definition. If the definer differs from the current user then the error is thrown because only a super-user can set other users as a definers. Now if the DEFINER clause is omitted in the ALTER VIEW statement then the definer from the original view is used without check. mysql-test/t/view_grant.test: Added a test case for the bug#27006: The SUPER privilege is wrongly required to alter a view created by another user. mysql-test/r/view_grant.result: Added a test case for the bug#27006: The SUPER privilege is wrongly required to alter a view created by another user. sql/sql_view.cc: Bug#26813: The SUPER privilege is wrongly required to alter a view created by another user. Now if the DEFINER clause is omitted in the ALTER VIEW statement then the definer from the original view is used without check. --- mysql-test/r/view_grant.result | 21 +++++++++++++++++++++ mysql-test/t/view_grant.test | 31 +++++++++++++++++++++++++++++++ sql/sql_view.cc | 14 ++++++++------ 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 45cf5076fe1..6fec52896c9 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -773,4 +773,25 @@ DROP DATABASE mysqltest_db1; DROP DATABASE mysqltest_db2; DROP USER mysqltest_u1@localhost; DROP USER mysqltest_u2@localhost; +CREATE DATABASE db26813; +USE db26813; +CREATE TABLE t1(f1 INT, f2 INT); +CREATE VIEW v1 AS SELECT f1 FROM t1; +CREATE VIEW v2 AS SELECT f1 FROM t1; +CREATE VIEW v3 AS SELECT f1 FROM t1; +CREATE USER u26813@localhost; +GRANT DROP ON db26813.v1 TO u26813@localhost; +GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost; +GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost; +GRANT SELECT ON db26813.t1 TO u26813@localhost; +ALTER VIEW v1 AS SELECT f2 FROM t1; +ERROR 42000: CREATE VIEW command denied to user 'u26813'@'localhost' for table 'v1' +ALTER VIEW v2 AS SELECT f2 FROM t1; +ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table 'v2' +ALTER VIEW v3 AS SELECT f2 FROM t1; +SHOW CREATE VIEW v3; +View Create View +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f2` AS `f2` from `t1` +DROP USER u26813@localhost; +DROP DATABASE db26813; End of 5.0 tests. diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test index 0785b74dd47..b45afe4f312 100644 --- a/mysql-test/t/view_grant.test +++ b/mysql-test/t/view_grant.test @@ -1034,5 +1034,36 @@ DROP DATABASE mysqltest_db2; DROP USER mysqltest_u1@localhost; DROP USER mysqltest_u2@localhost; +# +# Bug#26813: The SUPER privilege is wrongly required to alter a view created +# by another user. +# +connection root; +CREATE DATABASE db26813; +USE db26813; +CREATE TABLE t1(f1 INT, f2 INT); +CREATE VIEW v1 AS SELECT f1 FROM t1; +CREATE VIEW v2 AS SELECT f1 FROM t1; +CREATE VIEW v3 AS SELECT f1 FROM t1; +CREATE USER u26813@localhost; +GRANT DROP ON db26813.v1 TO u26813@localhost; +GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost; +GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost; +GRANT SELECT ON db26813.t1 TO u26813@localhost; + +connect (u1,localhost,u26813,,db26813); +connection u1; +--error 1142 +ALTER VIEW v1 AS SELECT f2 FROM t1; +--error 1142 +ALTER VIEW v2 AS SELECT f2 FROM t1; +ALTER VIEW v3 AS SELECT f2 FROM t1; + +connection root; +SHOW CREATE VIEW v3; + +DROP USER u26813@localhost; +DROP DATABASE db26813; +disconnect u1; --echo End of 5.0 tests. diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 7143df8474a..714534707d1 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -224,6 +224,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, { LEX *lex= thd->lex; bool link_to_local; + bool definer_check_is_needed= mode != VIEW_ALTER || lex->definer; /* first table in list is target VIEW name => cut off it */ TABLE_LIST *view= lex->unlink_first_table(&link_to_local); TABLE_LIST *tables= lex->query_tables; @@ -256,8 +257,9 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, /* DEFINER-clause is missing; we have to create default definer in persistent arena to be PS/SP friendly. + If this is an ALTER VIEW then the current user should be set as + the definer. */ - Query_arena original_arena; Query_arena *ps_arena = thd->activate_stmt_arena_if_needed(&original_arena); @@ -277,11 +279,11 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, - same as current user - current user has SUPER_ACL */ - if (strcmp(lex->definer->user.str, - thd->security_ctx->priv_user) != 0 || - my_strcasecmp(system_charset_info, - lex->definer->host.str, - thd->security_ctx->priv_host) != 0) + if (definer_check_is_needed && + (strcmp(lex->definer->user.str, thd->security_ctx->priv_user) != 0 || + my_strcasecmp(system_charset_info, + lex->definer->host.str, + thd->security_ctx->priv_host) != 0)) { if (!(thd->security_ctx->master_access & SUPER_ACL)) { From 842eaa44e54acd164901c06c0f12f0452d9c4f66 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 23:13:40 +0300 Subject: [PATCH 308/789] sql_view.cc: Post-fix for bug#26813. sql/sql_view.cc: Post-fix for bug#26813. --- sql/sql_view.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 714534707d1..83beec3d1be 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -224,7 +224,9 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, { LEX *lex= thd->lex; bool link_to_local; +#ifndef NO_EMBEDDED_ACCESS_CHECKS bool definer_check_is_needed= mode != VIEW_ALTER || lex->definer; +#endif /* first table in list is target VIEW name => cut off it */ TABLE_LIST *view= lex->unlink_first_table(&link_to_local); TABLE_LIST *tables= lex->query_tables; From eebba6a2c4ce2776fa471b58d175bedb60cf096b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 21:28:28 +0100 Subject: [PATCH 309/789] After merge fix --- storage/myisam/ha_myisam.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 6f4d12ec5f7..505febf8828 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -697,9 +697,11 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) (struct st_mysql_ftparser *)parser->plugin->info; table->key_info[i].block_size= file->s->keyinfo[i].block_length; } - return (0); -err: + my_errno= 0; + goto end; + err: this->close(); + end: /* Both recinfo and keydef are allocated by my_multi_malloc(), thus only recinfo must be freed. From 805c2d52cd4a6cca64605ead2ddc0e43a65b819c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 14:40:52 -0600 Subject: [PATCH 310/789] NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Fixes: - Bug #21409: Incorrect result returned when in READ-COMMITTED with query_cache ON At low transaction isolation levels we let each consistent read set its own snapshot. - Bug #23666: strange Innodb_row_lock_time_% values in show status; also millisecs wrong On Windows ut_usectime returns secs and usecs relative to the UNIX epoch (which is Jan, 1 1970). - Bug #25494: LATEST DEADLOCK INFORMATION is not always cleared lock_deadlock_recursive(): When the search depth or length is exceeded, rewind lock_latest_err_file and display the two transactions at the point of aborting the search. - Bug #25927: Foreign key with ON DELETE SET NULL on NOT NULL can crash server Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns for which there is a foreign key constraint ON ... SET NULL. - Bug #26835: Repeatable corruption of utf8-enabled tables inside InnoDB The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. innobase/dict/dict0dict.c: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1317: branches/5.0: Port r1316 from trunk: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns for which there is a foreign key constraint ON ... SET NULL. (Bug #25927) dict_foreign_find_index(): Add paramettter check_null. dict_foreign_add_to_cache(): Do not allow ON DELETE SET NULL or ON UPDATE SET NULL if any of the referencing columns are declared NOT NULL. innobase/include/rem0rec.ic: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1339: branches/5.0: Merge r1338 from trunk: rec_offs_nth_size(): Treat n==0 as a special case. (Bug #26835) innobase/include/sync0sync.ic: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1293: branches/5.0: Fixed inline asm code, it didn't work with GCC > ver 3.x. innobase/lock/lock0lock.c: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1331: branches/5.0: Merge r1330 from trunk: lock_deadlock_recursive(): When the search depth or length is exceeded, rewind lock_latest_err_file and display the two transactions at the point of aborting the search. (Bug #25494) Revision r1333: branches/5.0: Merge r1332 from trunk: lock_deadlock_recursive(): When aborting the search, display a note regardless of start->undo_no. Otherwise, aborted searches may show up as genuine deadlocks. This mistake was made in r1330. innobase/srv/srv0srv.c: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1261: branches/5.0: Fix for Bug# 23666. On Windows ut_usectime returns secs and usecs relative to the UNIX epoch (which is Jan, 1 1970). innobase/ut/ut0ut.c: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1261: branches/5.0: Fix for Bug# 23666. On Windows ut_usectime returns secs and usecs relative to the UNIX epoch (which is Jan, 1 1970). mysql-test/r/innodb.result: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1319: branches/5.0: Port r1318 from trunk: Add a test case for r1316 (Bug #25927). Revision r1328: branches/5.0: mysql-test: Merge changes from MySQL AB. Revision r1341: branches/5.0: Merge r1340 from trunk: innodb.test, innodb.result: Add test case for Bug #26835. The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. Revision r1284: Merge changes from MySQL AB: ChangeSet 2007/01/24 14:49:36+04:00 holyfoot@mysql.com bug #22682 Test fails --without-geometry geometry dependent parts moved to proper .test files mysql-test/r/innodb.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -2 result fixed mysql-test/r/innodb_gis.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +2 -0 result fixed mysql-test/t/innodb.test 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -6 HAVE_GEOMETRY dependent part moved to innodb_gis.test mysql-test/t/innodb_gis.test 2007/01/24 14:49:35+04:00 holyfoot@mysql.com +6 -0 HAVE_GEOMETRY dependent part moved here from innodb.test Revision r1186: dict_load_foreign(): Use a local variable instead of the 10-bit field foreign->n_fields in order to preserve ON UPDATE CASCADE and ON DELETE CASCADE flags. For some reason, gcc does not warn about shifting a 10-bit field to right by 24 bits. (Bug #24741) This bug was introduced while reducing the memory footprint of the InnoDB data dictionary (Bug #20877). innodb.test, innodb.result: Add a test case. Revision r1318: Add a test case for r1316 (Bug #25927). Revision r1340: innodb.test, innodb.result: Add test case for Bug #26835. The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. mysql-test/t/innodb.test: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1279: branches/5.0: Merge changes from MySQL AB: ChangeSet 2006/11/20 22:42:06+02:00 monty@mysql.com Remove compiler warnings (Mostly in DBUG_PRINT() and unused arguments) Fixed bug in query cache when used with traceing (--with-debug) Fixed memory leak in mysqldump Removed warnings from mysqltest scripts (replaced -- with #) mysql-test/t/innodb.test 2006/11/20 22:41:41+02:00 monty@mysql.com +1 -1 Remove mysqltest warnings sql/ha_innodb.cc 2006/11/20 22:41:51+02:00 monty@mysql.com +2 -2 Fixed compiler warning Revision r1319: branches/5.0: Port r1318 from trunk: Add a test case for r1316 (Bug #25927). Revision r1328: branches/5.0: mysql-test: Merge changes from MySQL AB. Revision r1341: branches/5.0: Merge r1340 from trunk: innodb.test, innodb.result: Add test case for Bug #26835. The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. Revision r1284: Merge changes from MySQL AB: ChangeSet 2007/01/24 14:49:36+04:00 holyfoot@mysql.com bug #22682 Test fails --without-geometry geometry dependent parts moved to proper .test files mysql-test/r/innodb.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -2 result fixed mysql-test/r/innodb_gis.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +2 -0 result fixed mysql-test/t/innodb.test 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -6 HAVE_GEOMETRY dependent part moved to innodb_gis.test mysql-test/t/innodb_gis.test 2007/01/24 14:49:35+04:00 holyfoot@mysql.com +6 -0 HAVE_GEOMETRY dependent part moved here from innodb.test Revision r1283: Merge changes from MySQL AB: ChangeSet 2007/01/22 18:42:52+02:00 monty@mysql.com Give warnings for unused objects Changed error message to be compatible with old error file Added new error message for new DUP_ENTRY syntax mysql-test/t/innodb.test 2007/01/22 18:42:49+02:00 monty@mysql.com +14 -14 Changed to use new error message Revision r1186: dict_load_foreign(): Use a local variable instead of the 10-bit field foreign->n_fields in order to preserve ON UPDATE CASCADE and ON DELETE CASCADE flags. For some reason, gcc does not warn about shifting a 10-bit field to right by 24 bits. (Bug #24741) This bug was introduced while reducing the memory footprint of the InnoDB data dictionary (Bug #20877). innodb.test, innodb.result: Add a test case. Revision r1318: Add a test case for r1316 (Bug #25927). Revision r1329: Merge changes from MySQL AB to mysql-test directives. The results are not affected. Revision r1340: innodb.test, innodb.result: Add test case for Bug #26835. The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. sql/ha_innodb.cc: NULL MERGE this to 5.1 Apply the following InnoDB snapshots: innodb-5.0-ss1319 innodb-5.0-ss1331 innodb-5.0-ss1333 innodb-5.0-ss1341 Revision r1279: branches/5.0: Merge changes from MySQL AB: ChangeSet 2006/11/20 22:42:06+02:00 monty@mysql.com Remove compiler warnings (Mostly in DBUG_PRINT() and unused arguments) Fixed bug in query cache when used with traceing (--with-debug) Fixed memory leak in mysqldump Removed warnings from mysqltest scripts (replaced -- with #) mysql-test/t/innodb.test 2006/11/20 22:41:41+02:00 monty@mysql.com +1 -1 Remove mysqltest warnings sql/ha_innodb.cc 2006/11/20 22:41:51+02:00 monty@mysql.com +2 -2 Fixed compiler warning Revision r1280: branches/5.0: Merge a change from MySQL AB: ChangeSet 2006/11/30 18:25:05+02:00 monty@mysql.com Fixed portability issue in my_thr_init.c (was added in my last push) Fixed compiler warnings (detected by VC++): - Removed not used variables - Added casts - Fixed wrong assignments to bool - Fixed wrong calls with bool arguments - Added missing argument to store(longlong), which caused wrong store method to be called. sql/ha_innodb.cc 2006/11/30 18:24:53+02:00 monty@mysql.com +0 -1 Removed not used variable Revision r1260: branches/5.0: Fix for Bug# 21409. At low transaction isolation levels we let each consistent read set its own snapshot. Revision r1326: branches/5.0: Merge code from MySQL AB: ChangeSet@1.2417.3.1 2007-02-22 16:59:57+02:00 monty@mysql.fi Fixed compiler warnings (for linux and win32 and win64) --- innobase/dict/dict0dict.c | 36 +++++++++++++++------ innobase/include/rem0rec.ic | 3 ++ innobase/include/sync0sync.ic | 37 ++++++++-------------- innobase/lock/lock0lock.c | 30 ++++++++++++------ innobase/srv/srv0srv.c | 6 ++-- innobase/ut/ut0ut.c | 59 ++++++++++++++++++++++++++++++----- mysql-test/r/innodb.result | 18 +++++++++++ mysql-test/t/innodb.test | 28 +++++++++++++++++ sql/ha_innodb.cc | 9 ++++++ 9 files changed, 172 insertions(+), 54 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index df48a8a4b5a..33aebb25071 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2139,9 +2139,12 @@ dict_foreign_find_index( ulint n_cols, /* in: number of columns */ dict_index_t* types_idx, /* in: NULL or an index to whose types the column types must match */ - ibool check_charsets) /* in: whether to check charsets. + ibool check_charsets, /* in: whether to check charsets. only has an effect if types_idx != NULL. */ + ulint check_null) + /* in: nonzero if none of the columns must + be declared NOT NULL */ { #ifndef UNIV_HOTBACKUP dict_index_t* index; @@ -2154,10 +2157,11 @@ dict_foreign_find_index( if (dict_index_get_n_fields(index) >= n_cols) { for (i = 0; i < n_cols; i++) { - col_name = dict_index_get_nth_field(index, i) - ->col->name; - if (dict_index_get_nth_field(index, i) - ->prefix_len != 0) { + dict_field_t* field + = dict_index_get_nth_field(index, i); + + col_name = field->col->name; + if (field->prefix_len != 0) { /* We do not accept column prefix indexes here */ @@ -2169,6 +2173,13 @@ dict_foreign_find_index( break; } + if (check_null + && (field->col->type.prtype + & DATA_NOT_NULL)) { + + return(NULL); + } + if (types_idx && !cmp_types_are_equal( dict_index_get_nth_type(index, i), dict_index_get_nth_type(types_idx, i), @@ -2290,7 +2301,7 @@ dict_foreign_add_to_cache( index = dict_foreign_find_index(ref_table, (const char**) for_in_cache->referenced_col_names, for_in_cache->n_fields, - for_in_cache->foreign_index, check_charsets); + for_in_cache->foreign_index, check_charsets, FALSE); if (index == NULL) { dict_foreign_error_report(ef, for_in_cache, @@ -2317,13 +2328,17 @@ dict_foreign_add_to_cache( index = dict_foreign_find_index(for_table, (const char**) for_in_cache->foreign_col_names, for_in_cache->n_fields, - for_in_cache->referenced_index, check_charsets); + for_in_cache->referenced_index, check_charsets, + for_in_cache->type + & (DICT_FOREIGN_ON_DELETE_SET_NULL + | DICT_FOREIGN_ON_UPDATE_SET_NULL)); if (index == NULL) { dict_foreign_error_report(ef, for_in_cache, "there is no index in the table which would contain\n" "the columns as the first columns, or the data types in the\n" -"table do not match to the ones in the referenced table."); +"table do not match to the ones in the referenced table\n" +"or one of the ON ... SET NULL columns is declared NOT NULL."); if (for_in_cache == foreign) { if (added_to_referenced_list) { @@ -3125,7 +3140,8 @@ col_loop1: /* Try to find an index which contains the columns as the first fields and in the right order */ - index = dict_foreign_find_index(table, column_names, i, NULL, TRUE); + index = dict_foreign_find_index(table, column_names, i, + NULL, TRUE, FALSE); if (!index) { mutex_enter(&dict_foreign_err_mutex); @@ -3390,7 +3406,7 @@ try_find_index: if (referenced_table) { index = dict_foreign_find_index(referenced_table, - column_names, i, foreign->foreign_index, TRUE); + column_names, i, foreign->foreign_index, TRUE, FALSE); if (!index) { dict_foreign_free(foreign); mutex_enter(&dict_foreign_err_mutex); diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic index 9c24f385f4f..1abbb503bab 100644 --- a/innobase/include/rem0rec.ic +++ b/innobase/include/rem0rec.ic @@ -982,6 +982,9 @@ rec_offs_nth_size( { ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(n < rec_offs_n_fields(offsets)); + if (!n) { + return(rec_offs_base(offsets)[1 + n] & REC_OFFS_MASK); + } return((rec_offs_base(offsets)[1 + n] - rec_offs_base(offsets)[n]) & REC_OFFS_MASK); } diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic index a32a82d6e8b..e5c6f56d8ba 100644 --- a/innobase/include/sync0sync.ic +++ b/innobase/include/sync0sync.ic @@ -6,6 +6,16 @@ Mutex, the basic synchronization primitive Created 9/5/1995 Heikki Tuuri *******************************************************/ +#if defined(not_defined) && defined(__GNUC__) && defined(UNIV_INTEL_X86) +/* %z0: Use the size of operand %0 which in our case is *m to determine +instruction size, it should end up as xchgl. "1" in the input constraint, +says that "in" has to go in the same place as "out".*/ +#define TAS(m, in, out) \ + asm volatile ("xchg%z0 %2, %0" \ + : "=g" (*(m)), "=r" (out) \ + : "1" (in)) /* Note: "1" here refers to "=r" (out) */ +#endif + /********************************************************************** Sets the waiters field in a mutex. */ @@ -85,20 +95,10 @@ mutex_test_and_set( return(res); #elif defined(not_defined) && defined(__GNUC__) && defined(UNIV_INTEL_X86) - ulint* lw; ulint res; - lw = &(mutex->lock_word); + TAS(&mutex->lock_word, 1, res); - /* In assembly we use the so-called AT & T syntax where - the order of operands is inverted compared to the ordinary Intel - syntax. The 'l' after the mnemonics denotes a 32-bit operation. - The line after the code tells which values come out of the asm - code, and the second line tells the input to the asm code. */ - - asm volatile("movl $1, %%eax; xchgl (%%ecx), %%eax" : - "=eax" (res), "=m" (*lw) : - "ecx" (lw)); return(res); #else ibool ret; @@ -137,20 +137,9 @@ mutex_reset_lock_word( __asm MOV ECX, lw __asm XCHG EDX, DWORD PTR [ECX] #elif defined(not_defined) && defined(__GNUC__) && defined(UNIV_INTEL_X86) - ulint* lw; + ulint res; - lw = &(mutex->lock_word); - - /* In assembly we use the so-called AT & T syntax where - the order of operands is inverted compared to the ordinary Intel - syntax. The 'l' after the mnemonics denotes a 32-bit operation. */ - - asm volatile("movl $0, %%eax; xchgl (%%ecx), %%eax" : - "=m" (*lw) : - "ecx" (lw) : - "eax"); /* gcc does not seem to understand - that our asm code resets eax: tell it - explicitly that after the third ':' */ + TAS(&mutex->lock_word, 0, res); #else mutex->lock_word = 0; diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 06475c8ef7e..77dfca5fdf4 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -3259,12 +3259,6 @@ lock_deadlock_recursive( *cost = *cost + 1; - if ((depth > LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK) - || (*cost > LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK)) { - - return(LOCK_VICTIM_IS_START); - } - lock = wait_lock; if (lock_get_type(wait_lock) == LOCK_REC) { @@ -3296,11 +3290,18 @@ lock_deadlock_recursive( if (lock_has_to_wait(wait_lock, lock)) { + ibool too_far + = depth > LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK + || *cost > LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK; + lock_trx = lock->trx; - if (lock_trx == start) { + if (lock_trx == start || too_far) { + /* We came back to the recursion starting - point: a deadlock detected */ + point: a deadlock detected; or we have + searched the waits-for graph too long */ + FILE* ef = lock_latest_err_file; rewind(ef); @@ -3342,9 +3343,20 @@ lock_deadlock_recursive( } #ifdef UNIV_DEBUG if (lock_print_waits) { - fputs("Deadlock detected\n", stderr); + fputs("Deadlock detected" + " or too long search\n", + stderr); } #endif /* UNIV_DEBUG */ + if (too_far) { + + fputs("TOO DEEP OR LONG SEARCH" + " IN THE LOCK TABLE" + " WAITS-FOR GRAPH\n", ef); + + return(LOCK_VICTIM_IS_START); + } + if (ut_dulint_cmp(wait_lock->trx->undo_no, start->undo_no) >= 0) { /* Our recursion starting point diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index fe9e08d65be..96c0f05111b 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1822,14 +1822,14 @@ srv_export_innodb_status(void) export_vars.innodb_pages_written= buf_pool->n_pages_written; export_vars.innodb_row_lock_waits= srv_n_lock_wait_count; export_vars.innodb_row_lock_current_waits= srv_n_lock_wait_current_count; - export_vars.innodb_row_lock_time= srv_n_lock_wait_time / 10000; + export_vars.innodb_row_lock_time= srv_n_lock_wait_time / 1000; if (srv_n_lock_wait_count > 0) { export_vars.innodb_row_lock_time_avg = (ulint) - (srv_n_lock_wait_time / 10000 / srv_n_lock_wait_count); + (srv_n_lock_wait_time / 1000 / srv_n_lock_wait_count); } else { export_vars.innodb_row_lock_time_avg = 0; } - export_vars.innodb_row_lock_time_max= srv_n_lock_max_wait_time / 10000; + export_vars.innodb_row_lock_time_max= srv_n_lock_max_wait_time / 1000; export_vars.innodb_rows_read= srv_n_rows_read; export_vars.innodb_rows_inserted= srv_n_rows_inserted; export_vars.innodb_rows_updated= srv_n_rows_updated; diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index 1be5939303a..feb03269d91 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -20,6 +20,55 @@ Created 5/11/1994 Heikki Tuuri ibool ut_always_false = FALSE; +#ifdef __WIN__ +/********************************************************************* +NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix +epoch starts from 1970/1/1. For selection of constant see: +http://support.microsoft.com/kb/167296/ */ +#define WIN_TO_UNIX_DELTA_USEC ((ib_longlong) 11644473600000000ULL) + + +/********************************************************************* +This is the Windows version of gettimeofday(2).*/ +static +int +ut_gettimeofday( +/*============*/ + /* out: 0 if all OK else -1 */ + struct timeval* tv, /* out: Values are relative to Unix epoch */ + void* tz) /* in: not used */ +{ + FILETIME ft; + ib_longlong tm; + + if (!tv) { + errno = EINVAL; + return(-1); + } + + GetSystemTimeAsFileTime(&ft); + + tm = (ib_longlong) ft.dwHighDateTime << 32; + tm |= ft.dwLowDateTime; + + ut_a(tm >= 0); /* If tm wraps over to negative, the quotient / 10 + does not work */ + + tm /= 10; /* Convert from 100 nsec periods to usec */ + + /* If we don't convert to the Unix epoch the value for + struct timeval::tv_sec will overflow.*/ + tm -= WIN_TO_UNIX_DELTA_USEC; + + tv->tv_sec = (long) (tm / 1000000L); + tv->tv_usec = (long) (tm % 1000000L); + + return(0); +} +#else +#define ut_gettimeofday gettimeofday +#endif + /********************************************************************* Get the quote character to be used in SQL identifiers. This definition must match the one in sql/ha_innodb.cc! */ @@ -82,17 +131,11 @@ ut_usectime( ulint* sec, /* out: seconds since the Epoch */ ulint* ms) /* out: microseconds since the Epoch+*sec */ { -#ifdef __WIN__ - SYSTEMTIME st; - GetLocalTime(&st); - *sec = (ulint) st.wSecond; - *ms = (ulint) st.wMilliseconds; -#else struct timeval tv; - gettimeofday(&tv,NULL); + + ut_gettimeofday(&tv, NULL); *sec = (ulint) tv.tv_sec; *ms = (ulint) tv.tv_usec; -#endif } /************************************************************** diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 99f0d4100ee..0638152ba42 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2968,3 +2968,21 @@ a drop table t2, t1; create table t1 (g geometry not null, spatial gk(g)) engine=innodb; ERROR HY000: The used table type doesn't support SPATIAL indexes +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +ALTER TABLE t2 MODIFY a INT NOT NULL; +ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150) +DELETE FROM t1; +DROP TABLE t2,t1; +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +a +DDD +DROP TABLE t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index aa25677bd99..e762d740d66 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1976,6 +1976,34 @@ drop table t2, t1; --error ER_TABLE_CANT_HANDLE_SPKEYS create table t1 (g geometry not null, spatial gk(g)) engine=innodb; +# +# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns +# for which there is a foreign key constraint ON ... SET NULL. +# + +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +--replace_regex /'\.\/test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ +--error 1025 +ALTER TABLE t2 MODIFY a INT NOT NULL; +DELETE FROM t1; +DROP TABLE t2,t1; + +# +# Bug #26835: table corruption after delete+insert +# + +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +DROP TABLE t1; + ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index cbefa9d3949..217f59d4b7e 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -6066,6 +6066,15 @@ ha_innobase::external_lock( trx->isolation_level = innobase_map_isolation_level( (enum_tx_isolation) thd->variables.tx_isolation); + + if (trx->isolation_level <= TRX_ISO_READ_COMMITTED + && trx->global_read_view) { + + /* At low transaction isolation levels we let + each consistent read set its own snapshot */ + + read_view_close_for_mysql(trx); + } } if (trx->isolation_level == TRX_ISO_SERIALIZABLE From 3aa9cea32f33709c547fccf05e437ed09cff739c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 01:04:31 +0400 Subject: [PATCH 311/789] merging --- mysql-test/r/create.result | 30 +++++++++++++++--------------- mysql-test/r/type_float.result | 10 +++++----- mysql-test/r/union.result | 4 ++-- mysql-test/r/view.result | 2 -- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 77eb2bb025f..53892b219eb 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -455,21 +455,21 @@ create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnul show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `ifnull(a,a)` tinyint(4) default NULL, - `ifnull(b,b)` smallint(6) default NULL, - `ifnull(c,c)` mediumint(8) default NULL, - `ifnull(d,d)` int(11) default NULL, - `ifnull(e,e)` bigint(20) default NULL, - `ifnull(f,f)` float(3,2) default NULL, - `ifnull(g,g)` double(4,3) default NULL, - `ifnull(h,h)` decimal(5,4) default NULL, - `ifnull(i,i)` year(4) default NULL, - `ifnull(j,j)` date default NULL, - `ifnull(k,k)` timestamp NOT NULL default '0000-00-00 00:00:00', - `ifnull(l,l)` datetime default NULL, - `ifnull(m,m)` varchar(1) default NULL, - `ifnull(n,n)` varchar(3) default NULL, - `ifnull(o,o)` varchar(10) default NULL + `ifnull(a,a)` tinyint(4) DEFAULT NULL, + `ifnull(b,b)` smallint(6) DEFAULT NULL, + `ifnull(c,c)` mediumint(8) DEFAULT NULL, + `ifnull(d,d)` int(11) DEFAULT NULL, + `ifnull(e,e)` bigint(20) DEFAULT NULL, + `ifnull(f,f)` float(3,2) DEFAULT NULL, + `ifnull(g,g)` double(4,3) DEFAULT NULL, + `ifnull(h,h)` decimal(5,4) DEFAULT NULL, + `ifnull(i,i)` year(4) DEFAULT NULL, + `ifnull(j,j)` date DEFAULT NULL, + `ifnull(k,k)` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `ifnull(l,l)` datetime DEFAULT NULL, + `ifnull(m,m)` varchar(1) DEFAULT NULL, + `ifnull(n,n)` varchar(3) DEFAULT NULL, + `ifnull(o,o)` varchar(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14'); diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index de782f9a5e4..ac1270d33a0 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -91,10 +91,10 @@ col1 col2 col3 col4 show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `col1` double default NULL, - `col2` double(22,5) default NULL, - `col3` double default NULL, - `col4` double default NULL + `col1` double DEFAULT NULL, + `col2` double(22,5) DEFAULT NULL, + `col3` double DEFAULT NULL, + `col4` double DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create table t1 (a float); @@ -237,7 +237,7 @@ d show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `d` double default NULL + `d` double DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; create table t1 select 105213674794682365.00 + 0.0 x; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 2c8fa5cb896..275f3357c65 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -554,7 +554,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varbinary(2) NOT NULL default '' + `a` varbinary(2) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; @@ -655,7 +655,7 @@ f show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f` varbinary(12) default NULL + `f` varbinary(12) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT y from t2 UNION select da from t2; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 46b09b55565..9d20a8a16c7 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3338,8 +3338,6 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VI Warnings: Note 1449 There is no 'no_such'@'user_1' registered ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; -Warnings: -Note 1449 There is no 'no_such'@'user_1' registered SHOW CREATE VIEW v1; View Create View v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` From b4efce0cde862ba93e9e7464734e79c2da6dc701 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 01:46:02 +0400 Subject: [PATCH 312/789] merging --- mysql-test/t/gis.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 7ae6e3adda7..9cf42070f2f 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -1,5 +1,6 @@ -- source include/have_geometry.inc + # # Spatial objects # From 1f8bdbe4eb61b15996b5a9a25c75a905487c083f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 14:48:03 -0700 Subject: [PATCH 313/789] Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Ensured correct setting of the depended_from field in references generated for set functions aggregated in outer selects. A wrong value of this field resulted in wrong maps returned by used_tables() for these references. Made sure that a temporary table field is added for any set function aggregated in outer context when creation of a temporary table is needed to execute the inner subquery. mysql-test/r/subselect.result: Added a test case for bug #27229. mysql-test/t/subselect.test: Added a test case for bug #27229. sql/item.cc: Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Ensured correct setting of the depended_from field in references generated for set functions aggregated in outer selects. sql/item_sum.cc: Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Added the field aggr_sel to the objects of the class Item_sum. In any Item_sum object created for a set function this field has to contain a pointer to the select where the set function is aggregated. sql/item_sum.h: Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Added the field aggr_sel to the objects of the class Item_sum. In any Item_sum object created for a set function this field has to contain a pointer to the select where the set function is aggregated. Added a method that says whether a set function is aggregated in outer context and, if so, returns the aggregating select. Removed the field nest_level_tables_count introduced by the patch for bug 24484 as aggr_sel->join->tables contains the sane number. sql/sql_base.cc: Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Added the field aggr_sel to the objects of the class Item_sum. Removed changes introduced by the patch for bug 24484 as the field leaf_count of the THD class is not used anymore. sql/sql_class.h: Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Added the field aggr_sel to the objects of the class Item_sum. Removed changes introduce by the patch for bug 24484 as the field leaf_count of the THD class is not used anymore. sql/sql_insert.cc: Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. Added the field aggr_sel to the objects of the class Item_sum. Removed changes introduce by the patch for bug 24484 as the field leaf_count of the THD class is not used anymore. sql/sql_select.cc: Fixed bug #27229: crash when a set function aggregated in outer context was used as an argument of GROUP_CONCAT. When creating a temporary table a field is added in it for any set function aggregated in outer context. --- mysql-test/r/subselect.result | 19 +++++++++++++++++++ mysql-test/t/subselect.test | 19 +++++++++++++++++++ sql/item.cc | 9 ++++++--- sql/item_sum.cc | 33 ++++++++++++++++++--------------- sql/item_sum.h | 4 +++- sql/sql_base.cc | 2 -- sql/sql_class.h | 3 --- sql/sql_insert.cc | 6 ++---- sql/sql_select.cc | 11 +++++++++-- 9 files changed, 76 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 72bde001e87..81f087fe8fa 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3905,3 +3905,22 @@ COUNT(*) a 2 2 3 3 DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); +SELECT COUNT(*) c, a, +(SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) +FROM t1 GROUP BY a; +c a (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) +2 2 2 +3 3 3 +1 4 1,1 +SELECT COUNT(*) c, a, +(SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a) +FROM t1 GROUP BY a; +c a (SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a) +2 2 3 +3 3 4 +1 4 2,2 +DROP table t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index a238c8f070b..efd54ca95d1 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2763,3 +2763,22 @@ SELECT COUNT(*), a HAVING (SELECT MIN(m) FROM t2 WHERE m = count(*)) > 1; DROP TABLE t1,t2; + +# +# Bug #27229: GROUP_CONCAT in subselect with COUNT() as an argument +# + +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); + +SELECT COUNT(*) c, a, + (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) + FROM t1 GROUP BY a; + +SELECT COUNT(*) c, a, + (SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a) + FROM t1 GROUP BY a; + +DROP table t1,t2; diff --git a/sql/item.cc b/sql/item.cc index 11a5039ca19..255a756b6d1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1261,15 +1261,18 @@ void Item::split_sum_func2(THD *thd, Item **ref_pointer_array, Exception is Item_direct_view_ref which we need to convert to Item_ref to allow fields from view being stored in tmp table. */ + Item_aggregate_ref *item_ref; uint el= fields.elements; - Item *new_item, *real_itm= real_item(); + Item *real_itm= real_item(); ref_pointer_array[el]= real_itm; - if (!(new_item= new Item_aggregate_ref(&thd->lex->current_select->context, + if (!(item_ref= new Item_aggregate_ref(&thd->lex->current_select->context, ref_pointer_array + el, 0, name))) return; // fatal_error is set + if (type() == SUM_FUNC_ITEM) + item_ref->depended_from= ((Item_sum *) this)->depended_from(); fields.push_front(real_itm); - thd->change_item_tree(ref, new_item); + thd->change_item_tree(ref, item_ref); } } diff --git a/sql/item_sum.cc b/sql/item_sum.cc index fcebc89c6e9..03a1c32456a 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -61,9 +61,9 @@ bool Item_sum::init_sum_func_check(THD *thd) /* Save a pointer to object to be used in items for nested set functions */ thd->lex->in_sum_func= this; nest_level= thd->lex->current_select->nest_level; - nest_level_tables_count= thd->lex->current_select->join->tables; ref_by= 0; aggr_level= -1; + aggr_sel= NULL; max_arg_level= -1; max_sum_func_level= -1; return FALSE; @@ -151,7 +151,10 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) invalid= aggr_level < 0 && !(allow_sum_func & (1 << nest_level)); } if (!invalid && aggr_level < 0) + { aggr_level= nest_level; + aggr_sel= thd->lex->current_select; + } /* By this moment we either found a subquery where the set function is to be aggregated and assigned a value that is >= 0 to aggr_level, @@ -212,7 +215,6 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) bool Item_sum::register_sum_func(THD *thd, Item **ref) { SELECT_LEX *sl; - SELECT_LEX *aggr_sl= NULL; nesting_map allow_sum_func= thd->lex->allow_sum_func; for (sl= thd->lex->current_select->master_unit()->outer_select() ; sl && sl->nest_level > max_arg_level; @@ -222,7 +224,7 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) { /* Found the most nested subquery where the function can be aggregated */ aggr_level= sl->nest_level; - aggr_sl= sl; + aggr_sel= sl; } } if (sl && (allow_sum_func & (1 << sl->nest_level))) @@ -233,21 +235,22 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) The set function will be aggregated in this subquery. */ aggr_level= sl->nest_level; - aggr_sl= sl; + aggr_sel= sl; + } if (aggr_level >= 0) { ref_by= ref; - /* Add the object to the list of registered objects assigned to aggr_sl */ - if (!aggr_sl->inner_sum_func_list) + /* Add the object to the list of registered objects assigned to aggr_sel */ + if (!aggr_sel->inner_sum_func_list) next= this; else { - next= aggr_sl->inner_sum_func_list->next; - aggr_sl->inner_sum_func_list->next= this; + next= aggr_sel->inner_sum_func_list->next; + aggr_sel->inner_sum_func_list->next= this; } - aggr_sl->inner_sum_func_list= this; - aggr_sl->with_sum_func= 1; + aggr_sel->inner_sum_func_list= this; + aggr_sel->with_sum_func= 1; /* Mark Item_subselect(s) as containing aggregate function all the way up @@ -265,11 +268,11 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) has aggregate functions directly referenced (i.e. not through a sub-select). */ for (sl= thd->lex->current_select; - sl && sl != aggr_sl && sl->master_unit()->item; + sl && sl != aggr_sel && sl->master_unit()->item; sl= sl->master_unit()->outer_select() ) sl->master_unit()->item->with_sum_func= 1; } - thd->lex->current_select->mark_as_dependent(aggr_sl); + thd->lex->current_select->mark_as_dependent(aggr_sel); return FALSE; } @@ -299,10 +302,10 @@ Item_sum::Item_sum(List &list) :arg_count(list.elements), Item_sum::Item_sum(THD *thd, Item_sum *item): Item_result_field(thd, item), arg_count(item->arg_count), + aggr_sel(item->aggr_sel), nest_level(item->nest_level), aggr_level(item->aggr_level), quick_group(item->quick_group), used_tables_cache(item->used_tables_cache), - forced_const(item->forced_const), - nest_level_tables_count(item->nest_level_tables_count) + forced_const(item->forced_const) { if (arg_count <= 2) args=tmp_args; @@ -447,7 +450,7 @@ void Item_sum::update_used_tables () /* the aggregate function is aggregated into its local context */ if (aggr_level == nest_level) - used_tables_cache |= (1 << nest_level_tables_count) - 1; + used_tables_cache |= (1 << aggr_sel->join->tables) - 1; } } diff --git a/sql/item_sum.h b/sql/item_sum.h index 9ddda94a8ee..66c73e1d416 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -233,6 +233,7 @@ public: Item_sum *next; /* next in the circular chain of registered objects */ uint arg_count; Item_sum *in_sum_func; /* embedding set function if any */ + st_select_lex * aggr_sel; /* select where the function is aggregated */ int8 nest_level; /* number of the nesting level of the set function */ int8 aggr_level; /* nesting level of the aggregating subquery */ int8 max_arg_level; /* max level of unbound column references */ @@ -242,7 +243,6 @@ public: protected: table_map used_tables_cache; bool forced_const; - byte nest_level_tables_count; public: @@ -365,6 +365,8 @@ public: bool init_sum_func_check(THD *thd); bool check_sum_func(THD *thd, Item **ref); bool register_sum_func(THD *thd, Item **ref); + st_select_lex *depended_from() + { return (nest_level == aggr_level ? 0 : aggr_sel); } }; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 13279abb1c8..77bb1d9642b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4864,7 +4864,6 @@ bool setup_tables_and_check_access(THD *thd, TABLE_LIST *leaves_tmp = NULL; bool first_table= true; - thd->leaf_count= 0; if (setup_tables (thd, context, from_clause, tables, conds, &leaves_tmp, select_insert)) return TRUE; @@ -4882,7 +4881,6 @@ bool setup_tables_and_check_access(THD *thd, return TRUE; } first_table= false; - thd->leaf_count++; } return FALSE; } diff --git a/sql/sql_class.h b/sql/sql_class.h index 048da718dfd..99803802001 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1492,9 +1492,6 @@ public: query_id_t first_query_id; } binlog_evt_union; - /* pass up the count of "leaf" tables in a JOIN out of setup_tables() */ - byte leaf_count; - THD(); ~THD(); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 3c8f9fd5fc2..d9d32d14321 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2349,14 +2349,12 @@ bool mysql_insert_select_prepare(THD *thd) DBUG_ASSERT(select_lex->leaf_tables != 0); lex->leaf_tables_insert= select_lex->leaf_tables; /* skip all leaf tables belonged to view where we are insert */ - for (first_select_leaf_table= select_lex->leaf_tables->next_leaf, - thd->leaf_count --; + for (first_select_leaf_table= select_lex->leaf_tables->next_leaf; first_select_leaf_table && first_select_leaf_table->belong_to_view && first_select_leaf_table->belong_to_view == lex->leaf_tables_insert->belong_to_view; - first_select_leaf_table= first_select_leaf_table->next_leaf, - thd->leaf_count --) + first_select_leaf_table= first_select_leaf_table->next_leaf) {} select_lex->leaf_tables= first_select_leaf_table; DBUG_RETURN(FALSE); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f46a212e7fb..c96ae153cf2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -412,7 +412,12 @@ JOIN::prepare(Item ***rref_pointer_array, &select_lex->leaf_tables, FALSE, SELECT_ACL, SELECT_ACL)) DBUG_RETURN(-1); - tables= thd->leaf_count; + + TABLE_LIST *table_ptr; + for (table_ptr= select_lex->leaf_tables; + table_ptr; + table_ptr= table_ptr->next_leaf) + tables++; if (setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) || select_lex->setup_ref_array(thd, og_num) || @@ -9186,7 +9191,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, Item::Type type=item->type(); if (not_all_columns) { - if (item->with_sum_func && type != Item::SUM_FUNC_ITEM) + if (item->with_sum_func && type != Item::SUM_FUNC_ITEM && + (type == Item::SUBSELECT_ITEM || + (item->used_tables() & ~PSEUDO_TABLE_BITS))) { /* Mark that the we have ignored an item that refers to a summary From 76de7d788cf82f5901ea722f4031177907156f59 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 15:59:35 -0600 Subject: [PATCH 314/789] Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Fixes: - Bug #21409: Incorrect result returned when in READ-COMMITTED with query_cache ON At low transaction isolation levels we let each consistent read set its own snapshot. - Bug #23666: strange Innodb_row_lock_time_% values in show status; also millisecs wrong On Windows ut_usectime returns secs and usecs relative to the UNIX epoch (which is Jan, 1 1970). - Bug #25494: LATEST DEADLOCK INFORMATION is not always cleared lock_deadlock_recursive(): When the search depth or length is exceeded, rewind lock_latest_err_file and display the two transactions at the point of aborting the search. - Bug #25927: Foreign key with ON DELETE SET NULL on NOT NULL can crash server Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns for which there is a foreign key constraint ON ... SET NULL. - Bug #26835: Repeatable corruption of utf8-enabled tables inside InnoDB The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. mysql-test/r/innodb.result: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1284: Merge changes from MySQL AB: ChangeSet 2007/01/24 14:49:36+04:00 holyfoot@mysql.com bug 22682 Test fails --without-geometry geometry dependent parts moved to proper .test files mysql-test/r/innodb.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -2 result fixed mysql-test/r/innodb_gis.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +2 -0 result fixed mysql-test/t/innodb.test 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -6 HAVE_GEOMETRY dependent part moved to innodb_gis.test mysql-test/t/innodb_gis.test 2007/01/24 14:49:35+04:00 holyfoot@mysql.com +6 -0 HAVE_GEOMETRY dependent part moved here from innodb.test Revision r1186: dict_load_foreign(): Use a local variable instead of the 10-bit field foreign->n_fields in order to preserve ON UPDATE CASCADE and ON DELETE CASCADE flags. For some reason, gcc does not warn about shifting a 10-bit field to right by 24 bits. (Bug 24741) This bug was introduced while reducing the memory footprint of the InnoDB data dictionary (Bug 20877). innodb.test, innodb.result: Add a test case. Revision r1318: Add a test case for r1316 (Bug #25927). Revision r1340: innodb.test, innodb.result: Add test case for Bug #26835. The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. mysql-test/t/innodb.test: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1284: Merge changes from MySQL AB: ChangeSet 2007/01/24 14:49:36+04:00 holyfoot@mysql.com bug 22682 Test fails --without-geometry geometry dependent parts moved to proper .test files mysql-test/r/innodb.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -2 result fixed mysql-test/r/innodb_gis.result 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +2 -0 result fixed mysql-test/t/innodb.test 2007/01/24 14:49:34+04:00 holyfoot@mysql.com +0 -6 HAVE_GEOMETRY dependent part moved to innodb_gis.test mysql-test/t/innodb_gis.test 2007/01/24 14:49:35+04:00 holyfoot@mysql.com +6 -0 HAVE_GEOMETRY dependent part moved here from innodb.test Revision r1283: Merge changes from MySQL AB: ChangeSet 2007/01/22 18:42:52+02:00 monty@mysql.com Give warnings for unused objects Changed error message to be compatible with old error file Added new error message for new DUP_ENTRY syntax mysql-test/t/innodb.test 2007/01/22 18:42:49+02:00 monty@mysql.com +14 -14 Changed to use new error message Revision r1186: dict_load_foreign(): Use a local variable instead of the 10-bit field foreign->n_fields in order to preserve ON UPDATE CASCADE and ON DELETE CASCADE flags. For some reason, gcc does not warn about shifting a 10-bit field to right by 24 bits. (Bug 24741) This bug was introduced while reducing the memory footprint of the InnoDB data dictionary (Bug 20877). innodb.test, innodb.result: Add a test case. Revision r1318: Add a test case for r1316 (Bug #25927). Revision r1329: Merge changes from MySQL AB to mysql-test directives. The results are not affected. Revision r1340: innodb.test, innodb.result: Add test case for Bug #26835. The bug could be reproduced as follows: Define a table so that the first column of the clustered index is a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes of differing length are considered equivalent. Insert and delete a record. Before the delete-marked record is purged, insert another record whose first column is of different length but equivalent to the first record. Under certain conditions, the insertion can be incorrectly performed as update-in-place. Likewise, an operation that could be done as update-in-place can unnecessarily be performed as delete and insert, but that would not cause corruption but merely degraded performance. storage/innobase/buf/buf0buf.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/buf/buf0flu.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/buf/buf0lru.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/dict/dict0boot.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/dict/dict0crea.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1324: Merge changes from MySQL AB: ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0 Fixed compiler warnings ... Fixed compiler warnings detected on windows64 storage/innobase/dict/dict0dict.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1316: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns for which there is a foreign key constraint ON ... SET NULL. (Bug #25927) dict_foreign_find_index(): Add paramettter check_null. dict_foreign_add_to_cache(): Do not allow ON DELETE SET NULL or ON UPDATE SET NULL if any of the referencing columns are declared NOT NULL. Revision r1324: Merge changes from MySQL AB: ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0 Fixed compiler warnings ... Fixed compiler warnings detected on windows64 storage/innobase/dict/dict0load.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1186: dict_load_foreign(): Use a local variable instead of the 10-bit field foreign->n_fields in order to preserve ON UPDATE CASCADE and ON DELETE CASCADE flags. For some reason, gcc does not warn about shifting a 10-bit field to right by 24 bits. (Bug 24741) This bug was introduced while reducing the memory footprint of the InnoDB data dictionary (Bug 20877). innodb.test, innodb.result: Add a test case. Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1324: Merge changes from MySQL AB: ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0 Fixed compiler warnings ... Fixed compiler warnings detected on windows64 storage/innobase/fil/fil0fil.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/fsp/fsp0fsp.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/ha/ha0ha.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/handler/ha_innodb.cc: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1204: Change this in ha_innobase: void* innobase_prebuilt; to this: row_prebuilt_t* prebuilt; by introducing the typedef in ha_innodb.h, and remove all the now needless local variables and casts in ha_innodb.cc. Revision r1298: ha_innodb.cc: Remove all references to thd->ha_data[hton->slot]. thd_to_trx(thd, hton): Accessor for getting the InnoDB trx object of a MySQL thread object and an InnoDB handlerton. Revision r1292: Remove the declarations of some global functions in ha_innodb.h and declare them static in ha_innodb.cc. These functions are invoked via function pointers in handlerton. Revision r1300: ha_innodb.cc: Replace thd->tablespace_op with thd_tablespace_op(thd). Plugins must treat class THD as an opaque type. Revision r1198: Merge a change from MySQL AB: ChangeSet@1.2372, 2006-12-31 02:29:11+01:00, kent@mysql.com +79 -0 Many files: Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header Adjusted year(s) in copyright header Added GPL copyright text Revision r1271: Merge changes from MySQL AB: Rename some FIELD_TYPE_ constants to MYSQL_TYPE_. Change the scope of a type cast of two dividends. Revision r1299: ha_innodb.cc: Replace thd->in_lock_tables with thd_in_lock_tables(thd). Plugins must treat class THD as an opaque type. Revision r1201: Apply patch from MySQL: ChangeSet@1.2353, 2006-12-19 16:57:51-07:00, tsmith@siva.hindu.god +13 -0 Added innodb_rollback_on_timeout option to restore the 4.1 InnoDB timeout behavior (Bug 24200) Revision r1322: ha_innodb.cc: Remove the unused innobase_repl_ variables. Revision r1324: Merge changes from MySQL AB: ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0 Fixed compiler warnings ... Fixed compiler warnings detected on windows64 Revision r1334: Fix for Bug# 21409. At low transaction isolation levels we let each consistent read set its own snapshot storage/innobase/handler/ha_innodb.h: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1204: Change this in ha_innobase: void* innobase_prebuilt; to this: row_prebuilt_t* prebuilt; by introducing the typedef in ha_innodb.h, and remove all the now needless local variables and casts in ha_innodb.cc. Revision r1292: Remove the declarations of some global functions in ha_innodb.h and declare them static in ha_innodb.cc. These functions are invoked via function pointers in handlerton. Revision r1198: Merge a change from MySQL AB: ChangeSet@1.2372, 2006-12-31 02:29:11+01:00, kent@mysql.com +79 -0 Many files: Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header Adjusted year(s) in copyright header Added GPL copyright text Revision r1201: Apply patch from MySQL: ChangeSet@1.2353, 2006-12-19 16:57:51-07:00, tsmith@siva.hindu.god +13 -0 Added innodb_rollback_on_timeout option to restore the 4.1 InnoDB timeout behavior (Bug 24200) storage/innobase/ibuf/ibuf0ibuf.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/buf0buf.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/buf0flu.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/dict0dict.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/ha0ha.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/lock0lock.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/log0log.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/mem0mem.h: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1241: Remove the unused function mem_strdupq(). storage/innobase/include/mem0mem.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1241: Remove the unused function mem_strdupq(). storage/innobase/include/rem0rec.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1338: rec_offs_nth_size(): Treat n==0 as a special case. (Bug #26835) storage/innobase/include/sync0rw.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/sync0sync.h: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1247: Rename mutex_enter_nowait to mutex_enter_nowait_func and add macro mutex_enter_nowait that supplies the default __FILE__ and __LINE__ arguments. Adjust callers. storage/innobase/include/sync0sync.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1294: Fixed inline asm code, it didn't work with GCC > ver 3.x. Revision r1244: Add ut_ad() debug assertions. UT_LIST_ADD_FIRST(), UT_LIST_ADD_LAST(), UT_LIST_INSERT_AFTER(): Assert against some trivial cases of cyclic lists. mutex_enter_func(): Assert that the current thread is not holding the mutex. Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/trx0sys.ic: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/include/univ.i: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1285: Merge a change from MySQL AB: ChangeSet 2006/10/26 15:41:47-04:00 iggy@amd64. Post Merge Cleanup storage/innobase/include/univ.i 2006/10/26 15:38:50-04:00 iggy@amd64. +9 -0 Post Merge Cleanup storage/innobase/include/ut0lst.h: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1244: Add ut_ad() debug assertions. UT_LIST_ADD_FIRST(), UT_LIST_ADD_LAST(), UT_LIST_INSERT_AFTER(): Assert against some trivial cases of cyclic lists. mutex_enter_func(): Assert that the current thread is not holding the mutex. storage/innobase/lock/lock0lock.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1330: lock_deadlock_recursive(): When the search depth or length is exceeded, rewind lock_latest_err_file and display the two transactions at the point of aborting the search. (Bug #25494) Revision r1332: lock_deadlock_recursive(): When aborting the search, display a note regardless of start->undo_no. Otherwise, aborted searches may show up as genuine deadlocks. This mistake was made in r1330. storage/innobase/log/log0log.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1247: Rename mutex_enter_nowait to mutex_enter_nowait_func and add macro mutex_enter_nowait that supplies the default __FILE__ and __LINE__ arguments. Adjust callers. storage/innobase/log/log0recv.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/mem/mem0pool.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/pars/pars0pars.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/que/que0que.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/read/read0read.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/row/row0mysql.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1201: Apply patch from MySQL: ChangeSet@1.2353, 2006-12-19 16:57:51-07:00, tsmith@siva.hindu.god +13 -0 Added innodb_rollback_on_timeout option to restore the 4.1 InnoDB timeout behavior (Bug 24200) Revision r1324: Merge changes from MySQL AB: ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0 Fixed compiler warnings ... Fixed compiler warnings detected on windows64 storage/innobase/row/row0vers.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/srv/srv0que.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/srv/srv0srv.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1262: Fix for Bug# 23666. On Windows ut_usectime returns secs and usecs relative to the UNIX epoch (which is Jan, 1 1970). Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/sync/sync0rw.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1247: Rename mutex_enter_nowait to mutex_enter_nowait_func and add macro mutex_enter_nowait that supplies the default __FILE__ and __LINE__ arguments. Adjust callers. Revision r1324: Merge changes from MySQL AB: ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0 Fixed compiler warnings ... Fixed compiler warnings detected on windows64 storage/innobase/sync/sync0sync.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1247: Rename mutex_enter_nowait to mutex_enter_nowait_func and add macro mutex_enter_nowait that supplies the default __FILE__ and __LINE__ arguments. Adjust callers. storage/innobase/thr/thr0loc.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/trx/trx0purge.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/trx/trx0roll.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/trx/trx0rseg.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/trx/trx0sys.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/trx/trx0trx.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. Revision r1324: Merge changes from MySQL AB: ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0 Fixed compiler warnings ... Fixed compiler warnings detected on windows64 storage/innobase/trx/trx0undo.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/usr/usr0sess.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1242: Merge r1239 from branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. storage/innobase/ut/ut0ut.c: Apply the following InnoDB snapshots: innodb-5.1-ss1318 innodb-5.1-ss1330 innodb-5.1-ss1332 innodb-5.1-ss1340 Revision r1262: Fix for Bug# 23666. On Windows ut_usectime returns secs and usecs relative to the UNIX epoch (which is Jan, 1 1970). --- mysql-test/r/innodb.result | 18 ++ mysql-test/t/innodb.test | 28 ++ storage/innobase/buf/buf0buf.c | 7 +- storage/innobase/buf/buf0flu.c | 9 - storage/innobase/buf/buf0lru.c | 17 +- storage/innobase/dict/dict0boot.c | 2 - storage/innobase/dict/dict0crea.c | 20 -- storage/innobase/dict/dict0dict.c | 69 ++--- storage/innobase/dict/dict0load.c | 22 -- storage/innobase/fil/fil0fil.c | 17 +- storage/innobase/fsp/fsp0fsp.c | 21 +- storage/innobase/ha/ha0ha.c | 11 +- storage/innobase/handler/ha_innodb.cc | 429 ++++++++++++++------------ storage/innobase/handler/ha_innodb.h | 101 +----- storage/innobase/ibuf/ibuf0ibuf.c | 15 +- storage/innobase/include/buf0buf.ic | 11 +- storage/innobase/include/buf0flu.ic | 2 +- storage/innobase/include/dict0dict.ic | 6 - storage/innobase/include/ha0ha.ic | 8 - storage/innobase/include/lock0lock.ic | 2 - storage/innobase/include/log0log.ic | 4 - storage/innobase/include/mem0mem.h | 11 - storage/innobase/include/mem0mem.ic | 35 --- storage/innobase/include/rem0rec.ic | 3 + storage/innobase/include/sync0rw.ic | 3 +- storage/innobase/include/sync0sync.h | 43 +-- storage/innobase/include/sync0sync.ic | 51 ++- storage/innobase/include/trx0sys.ic | 20 -- storage/innobase/include/univ.i | 12 +- storage/innobase/include/ut0lst.h | 3 + storage/innobase/lock/lock0lock.c | 121 ++------ storage/innobase/log/log0log.c | 56 +--- storage/innobase/log/log0recv.c | 11 +- storage/innobase/mem/mem0pool.c | 2 - storage/innobase/pars/pars0pars.c | 3 +- storage/innobase/que/que0que.c | 15 - storage/innobase/read/read0read.c | 10 +- storage/innobase/row/row0mysql.c | 12 +- storage/innobase/row/row0vers.c | 2 +- storage/innobase/srv/srv0que.c | 3 - storage/innobase/srv/srv0srv.c | 16 +- storage/innobase/sync/sync0rw.c | 9 +- storage/innobase/sync/sync0sync.c | 56 ++-- storage/innobase/thr/thr0loc.c | 2 - storage/innobase/trx/trx0purge.c | 19 +- storage/innobase/trx/trx0roll.c | 14 - storage/innobase/trx/trx0rseg.c | 4 - storage/innobase/trx/trx0sys.c | 6 - storage/innobase/trx/trx0trx.c | 38 --- storage/innobase/trx/trx0undo.c | 34 +- storage/innobase/usr/usr0sess.c | 8 +- storage/innobase/ut/ut0ut.c | 59 +++- 52 files changed, 518 insertions(+), 982 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index f2d504f555f..4d104c64fa9 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -3159,3 +3159,21 @@ t2 CREATE TABLE `t2` ( CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t2, t1; +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +ALTER TABLE t2 MODIFY a INT NOT NULL; +ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150) +DELETE FROM t1; +DROP TABLE t2,t1; +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +a +DDD +DROP TABLE t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 0937b4fd30d..c4b8491b39d 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -2293,6 +2293,34 @@ DELETE CASCADE ON UPDATE CASCADE; SHOW CREATE TABLE t2; DROP TABLE t2, t1; +# +# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns +# for which there is a foreign key constraint ON ... SET NULL. +# + +CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB; +CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; +--replace_regex /'\.\/test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ +--error 1025 +ALTER TABLE t2 MODIFY a INT NOT NULL; +DELETE FROM t1; +DROP TABLE t2,t1; + +# +# Bug #26835: table corruption after delete+insert +# + +CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY) +ENGINE=InnoDB; +INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4); +DELETE FROM t1; +INSERT INTO t1 VALUES ('DDD'); +SELECT * FROM t1; +DROP TABLE t1; + ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index ad775fbd6d5..c847b8db9e2 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -802,9 +802,7 @@ buf_awe_map_page_to_frame( { buf_block_t* bck; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(block); if (block->frame) { @@ -900,9 +898,7 @@ buf_block_make_young( /*=================*/ buf_block_t* block) /* in: block to make younger */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* Note that we read freed_page_clock's without holding any mutex: this is allowed since the result is used only in heuristics */ @@ -1635,10 +1631,9 @@ buf_page_init( in units of a page */ buf_block_t* block) /* in: block to init */ { -#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(mutex_own(&(block->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(block->state != BUF_BLOCK_FILE_PAGE); /* Set the state of the block */ diff --git a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c index 650c9d5d707..423c08c0569 100644 --- a/storage/innobase/buf/buf0flu.c +++ b/storage/innobase/buf/buf0flu.c @@ -48,10 +48,7 @@ buf_flush_insert_into_flush_list( /*=============================*/ buf_block_t* block) /* in: block which is modified */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ - ut_a(block->state == BUF_BLOCK_FILE_PAGE); ut_ad((UT_LIST_GET_FIRST(buf_pool->flush_list) == NULL) @@ -77,9 +74,7 @@ buf_flush_insert_sorted_into_flush_list( buf_block_t* prev_b; buf_block_t* b; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ prev_b = NULL; b = UT_LIST_GET_FIRST(buf_pool->flush_list); @@ -111,10 +106,8 @@ buf_flush_ready_for_replace( buf_block_t* block) /* in: buffer control block, must be in state BUF_BLOCK_FILE_PAGE and in the LRU list */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(mutex_own(&block->mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (block->state != BUF_BLOCK_FILE_PAGE) { ut_print_timestamp(stderr); fprintf(stderr, @@ -147,10 +140,8 @@ buf_flush_ready_for_flush( BUF_BLOCK_FILE_PAGE */ ulint flush_type)/* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(mutex_own(&(block->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(block->state == BUF_BLOCK_FILE_PAGE); if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0) diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c index 377552ece6c..1e27144bdbf 100644 --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c @@ -549,9 +549,7 @@ buf_LRU_old_adjust_len(void) ulint new_len; ut_a(buf_pool->LRU_old); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(3 * (BUF_LRU_OLD_MIN_LEN / 8) > BUF_LRU_OLD_TOLERANCE + 5); for (;;) { @@ -593,6 +591,7 @@ buf_LRU_old_init(void) { buf_block_t* block; + ut_ad(mutex_own(&(buf_pool->mutex))); ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == BUF_LRU_OLD_MIN_LEN); /* We first initialize all blocks in the LRU list as old and then use @@ -624,9 +623,7 @@ buf_LRU_remove_block( { ut_ad(buf_pool); ut_ad(block); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(block->state == BUF_BLOCK_FILE_PAGE); ut_a(block->in_LRU_list); @@ -690,9 +687,7 @@ buf_LRU_add_block_to_end_low( ut_ad(buf_pool); ut_ad(block); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(block->state == BUF_BLOCK_FILE_PAGE); @@ -755,9 +750,7 @@ buf_LRU_add_block_low( ut_ad(buf_pool); ut_ad(block); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(block->state == BUF_BLOCK_FILE_PAGE); ut_a(!block->in_LRU_list); @@ -858,10 +851,9 @@ buf_LRU_block_free_non_file_page( /*=============================*/ buf_block_t* block) /* in: block, must not contain a file page */ { -#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(mutex_own(&block->mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(block); ut_a((block->state == BUF_BLOCK_MEMORY) @@ -898,10 +890,8 @@ buf_LRU_block_remove_hashed_page( be in a state where it can be freed; there may or may not be a hash index to the page */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(mutex_own(&block->mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(block); ut_a(block->state == BUF_BLOCK_FILE_PAGE); @@ -961,10 +951,9 @@ buf_LRU_block_free_hashed_page( buf_block_t* block) /* in: block, must contain a file page and be in a state where it can be freed */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(mutex_own(&block->mutex)); -#endif /* UNIV_SYNC_DEBUG */ + ut_a(block->state == BUF_BLOCK_REMOVE_HASH); block->state = BUF_BLOCK_MEMORY; diff --git a/storage/innobase/dict/dict0boot.c b/storage/innobase/dict/dict0boot.c index 08515d8fb13..f8849008854 100644 --- a/storage/innobase/dict/dict0boot.c +++ b/storage/innobase/dict/dict0boot.c @@ -86,9 +86,7 @@ dict_hdr_flush_row_id(void) dulint id; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ id = dict_sys->row_id; diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c index 76474c72c43..e060d45768e 100644 --- a/storage/innobase/dict/dict0crea.c +++ b/storage/innobase/dict/dict0crea.c @@ -212,9 +212,7 @@ dict_build_table_def_step( ulint i; ulint row_len; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ table = node->table; @@ -312,9 +310,7 @@ dict_create_sys_indexes_tuple( dfield_t* dfield; byte* ptr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(index && heap); sys_indexes = dict_sys->sys_indexes; @@ -512,9 +508,7 @@ dict_build_index_def_step( dtuple_t* row; trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx = thr_get_trx(thr); @@ -585,9 +579,7 @@ dict_create_index_tree_step( btr_pcur_t pcur; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ index = node->index; table = node->table; @@ -642,10 +634,7 @@ dict_drop_index_tree( byte* ptr; ulint len; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ - ut_a(!dict_table_is_comp(dict_sys->sys_indexes)); ptr = rec_get_nth_field_old(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, &len); @@ -718,10 +707,7 @@ dict_truncate_index_tree( ulint comp; dict_index_t* index; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ - ut_a(!dict_table_is_comp(dict_sys->sys_indexes)); rec = btr_pcur_get_rec(pcur); ptr = rec_get_nth_field_old(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, &len); @@ -907,9 +893,7 @@ dict_create_table_step( trx_t* trx; ut_ad(thr); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx = thr_get_trx(thr); @@ -1016,9 +1000,7 @@ dict_create_index_step( trx_t* trx; ut_ad(thr); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx = thr_get_trx(thr); @@ -1440,9 +1422,7 @@ dict_create_add_foreigns_to_dictionary( ulint number = start_id + 1; ulint error; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (NULL == dict_table_get_low("SYS_FOREIGN")) { fprintf(stderr, diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 6ae02c0b81a..e07d84a1ee0 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -689,9 +689,7 @@ dict_table_get_on_id( if we are doing a rollback to handle an error in TABLE CREATE, for example, we already have the mutex! */ -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ return(dict_table_get_on_id_low(table_id)); } @@ -854,9 +852,7 @@ dict_table_add_to_cache( ulint row_len; ut_ad(table); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->cached == FALSE); @@ -1003,9 +999,7 @@ dict_table_rename_in_cache( ibool success; ut_ad(table); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ old_size = mem_heap_get_size(table->heap); @@ -1209,9 +1203,7 @@ dict_table_change_id_in_cache( dulint new_id) /* in: new id to set */ { ut_ad(table); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* Remove the table from the hash table of id's */ @@ -1238,9 +1230,7 @@ dict_table_remove_from_cache( ulint size; ut_ad(table); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); #if 0 @@ -1354,9 +1344,7 @@ dict_index_add_to_cache( ulint i; ut_ad(index); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(index->n_def == index->n_fields); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); @@ -1452,9 +1440,7 @@ dict_index_remove_from_cache( ut_ad(table && index); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ rw_lock_free(&index->lock); @@ -1484,9 +1470,7 @@ dict_index_find_cols( ut_ad(table && index); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ for (i = 0; i < index->n_fields; i++) { ulint j; @@ -1648,9 +1632,7 @@ dict_index_build_internal_clust( ut_ad(table && index); ut_ad(index->type & DICT_CLUSTERED); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* Create a new index object with certainly enough fields */ @@ -1803,9 +1785,7 @@ dict_index_build_internal_non_clust( ut_ad(table && index); ut_ad(0 == (index->type & DICT_CLUSTERED)); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); /* The clustered index should be the first in the list of indexes */ @@ -1918,9 +1898,7 @@ dict_foreign_remove_from_cache( /*===========================*/ dict_foreign_t* foreign) /* in, own: foreign constraint */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(foreign); if (foreign->referenced_table) { @@ -1951,9 +1929,7 @@ dict_foreign_find( { dict_foreign_t* foreign; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ foreign = UT_LIST_GET_FIRST(table->foreign_list); @@ -1994,9 +1970,12 @@ dict_foreign_find_index( ulint n_cols, /* in: number of columns */ dict_index_t* types_idx, /* in: NULL or an index to whose types the column types must match */ - ibool check_charsets) + ibool check_charsets, /* in: whether to check charsets. only has an effect if types_idx != NULL */ + ulint check_null) + /* in: nonzero if none of the columns must + be declared NOT NULL */ { dict_index_t* index; dict_field_t* field; @@ -2026,6 +2005,12 @@ dict_foreign_find_index( break; } + if (check_null + && (field->col->prtype & DATA_NOT_NULL)) { + + return(NULL); + } + if (types_idx && !cmp_cols_are_equal( dict_index_get_nth_col(index, i), dict_index_get_nth_col(types_idx, @@ -2113,9 +2098,7 @@ dict_foreign_add_to_cache( ibool added_to_referenced_list= FALSE; FILE* ef = dict_foreign_err_file; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ for_table = dict_table_check_if_in_cache_low( foreign->foreign_table_name); @@ -2144,7 +2127,7 @@ dict_foreign_add_to_cache( ref_table, (const char**) for_in_cache->referenced_col_names, for_in_cache->n_fields, for_in_cache->foreign_index, - check_charsets); + check_charsets, FALSE); if (index == NULL) { dict_foreign_error_report( @@ -2176,7 +2159,10 @@ dict_foreign_add_to_cache( for_table, (const char**) for_in_cache->foreign_col_names, for_in_cache->n_fields, - for_in_cache->referenced_index, check_charsets); + for_in_cache->referenced_index, check_charsets, + for_in_cache->type + & (DICT_FOREIGN_ON_DELETE_SET_NULL + | DICT_FOREIGN_ON_UPDATE_SET_NULL)); if (index == NULL) { dict_foreign_error_report( @@ -2186,7 +2172,9 @@ dict_foreign_add_to_cache( "the columns as the first columns," " or the data types in the\n" "table do not match" - " the ones in the referenced table."); + " the ones in the referenced table\n" + "or one of the ON ... SET NULL columns" + " is declared NOT NULL."); if (for_in_cache == foreign) { if (added_to_referenced_list) { @@ -2794,9 +2782,7 @@ dict_create_foreign_constraints_low( const char* column_names[500]; const char* referenced_table_name; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ table = dict_table_get_low(name); @@ -2994,7 +2980,8 @@ col_loop1: /* Try to find an index which contains the columns as the first fields and in the right order */ - index = dict_foreign_find_index(table, column_names, i, NULL, TRUE); + index = dict_foreign_find_index(table, column_names, i, + NULL, TRUE, FALSE); if (!index) { mutex_enter(&dict_foreign_err_mutex); @@ -3265,7 +3252,8 @@ try_find_index: if (referenced_table) { index = dict_foreign_find_index(referenced_table, column_names, i, - foreign->foreign_index, TRUE); + foreign->foreign_index, + TRUE, FALSE); if (!index) { dict_foreign_free(foreign); mutex_enter(&dict_foreign_err_mutex); @@ -3425,9 +3413,7 @@ dict_foreign_parse_drop_constraints( str = dict_strip_comments(*(trx->mysql_query_str)); ptr = str; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ loop: ptr = dict_scan_to(ptr, "DROP"); @@ -3864,9 +3850,7 @@ dict_foreign_print_low( { ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ fprintf(stderr, " FOREIGN KEY CONSTRAINT %s: %s (", foreign->id, foreign->foreign_table_name); @@ -3931,9 +3915,7 @@ dict_table_print_low( dict_foreign_t* foreign; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ dict_update_statistics_low(table, TRUE); @@ -3989,9 +3971,7 @@ dict_col_print_low( { dtype_t type; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ dict_col_copy_type(col, &type); fprintf(stderr, "%s: ", dict_table_get_col_name(table, @@ -4011,9 +3991,7 @@ dict_index_print_low( ib_longlong n_vals; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (index->n_user_defined_cols > 0) { n_vals = index->stat_n_diff_key_vals[ @@ -4061,9 +4039,8 @@ dict_field_print_low( /*=================*/ dict_field_t* field) /* in: field */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ + fprintf(stderr, " %s", field->name); if (field->prefix_len != 0) { diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index e23795f9898..ba2e25cf031 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -67,9 +67,7 @@ dict_get_first_table_name_in_db( ulint len; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ heap = mem_heap_create(1000); @@ -353,9 +351,7 @@ dict_load_columns( ulint i; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ mtr_start(&mtr); @@ -478,11 +474,7 @@ dict_load_fields( ulint i; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ - - UT_NOT_USED(table); mtr_start(&mtr); @@ -586,9 +578,7 @@ dict_load_indexes( dulint id; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if ((ut_dulint_get_high(table->id) == 0) && (ut_dulint_get_low(table->id) < DICT_HDR_FIRST_ID)) { @@ -754,9 +744,7 @@ dict_load_table( ulint err; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ heap = mem_heap_create(1000); @@ -920,9 +908,7 @@ dict_load_table_on_id( dict_table_t* table; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* NOTE that the operation of this function is protected by the dictionary mutex, and therefore no deadlocks can occur @@ -1003,9 +989,7 @@ dict_load_sys_table( { mem_heap_t* heap; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ heap = mem_heap_create(1000); @@ -1035,9 +1019,7 @@ dict_load_foreign_cols( ulint i; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ foreign->foreign_col_names = mem_heap_alloc( foreign->heap, foreign->n_fields * sizeof(void*)); @@ -1113,9 +1095,7 @@ dict_load_foreign( ulint n_fields_and_type; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ heap2 = mem_heap_create(1000); @@ -1243,9 +1223,7 @@ dict_load_foreigns( ulint err; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ sys_foreign = dict_table_get_low("SYS_FOREIGN"); diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index 883fbd09ee4..c63d67cae60 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -409,9 +409,7 @@ fil_space_is_flushed( { fil_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(fil_system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ node = UT_LIST_GET_FIRST(space->chain); @@ -514,9 +512,7 @@ fil_node_open_file( ulint space_id; #endif /* !UNIV_HOTBACKUP */ -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(node->n_pending == 0); ut_a(node->open == FALSE); @@ -660,9 +656,7 @@ fil_node_close_file( ibool ret; ut_ad(node && system); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(node->open); ut_a(node->n_pending == 0); ut_a(node->n_pending_flushes == 0); @@ -705,9 +699,8 @@ fil_try_to_close_file_in_LRU( fil_system_t* system = fil_system; fil_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ + node = UT_LIST_GET_LAST(system->LRU); if (print_info) { @@ -765,9 +758,7 @@ fil_mutex_enter_and_prepare_for_io( ulint count = 0; ulint count2 = 0; -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&(system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ retry: mutex_enter(&(system->mutex)); @@ -881,9 +872,7 @@ fil_node_free( fil_space_t* space) /* in: space where the file node is chained */ { ut_ad(node && system && space); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(node->magic_n == FIL_NODE_MAGIC_N); ut_a(node->n_pending == 0); @@ -3870,9 +3859,7 @@ fil_node_prepare_for_io( fil_space_t* space) /* in: space */ { ut_ad(node && system && space); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (system->n_open > system->max_n_open + 5) { ut_print_timestamp(stderr); @@ -3917,9 +3904,7 @@ fil_node_complete_io( { ut_ad(node); ut_ad(system); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(node->n_pending > 0); diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c index 00c5e582b3e..b5662fd24a4 100644 --- a/storage/innobase/fsp/fsp0fsp.c +++ b/storage/innobase/fsp/fsp0fsp.c @@ -2045,11 +2045,9 @@ fseg_create_general( mtr); } -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex) || mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); -#endif /* UNIV_SYNC_DEBUG */ latch = fil_space_get_latch(space); mtr_x_lock(latch, mtr); @@ -2205,11 +2203,10 @@ fseg_n_reserved_pages( space = buf_frame_get_space_id(header); -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex) || mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); -#endif /* UNIV_SYNC_DEBUG */ + mtr_x_lock(fil_space_get_latch(space), mtr); inode = fseg_inode_get(header, mtr); @@ -2601,11 +2598,9 @@ fseg_alloc_free_page_general( space = buf_frame_get_space_id(seg_header); -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex) || mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); -#endif /* UNIV_SYNC_DEBUG */ latch = fil_space_get_latch(space); mtr_x_lock(latch, mtr); @@ -2751,11 +2746,9 @@ fsp_reserve_free_extents( ulint n_pages_added; ut_ad(mtr); -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex) || mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); -#endif /* UNIV_SYNC_DEBUG */ *n_reserved = n_ext; latch = fil_space_get_latch(space); @@ -2853,9 +2846,8 @@ fsp_get_available_space_in_free_extents( rw_lock_t* latch; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + mtr_start(&mtr); latch = fil_space_get_latch(space); @@ -3113,11 +3105,10 @@ fseg_free_page( { fseg_inode_t* seg_inode; -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex) || mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); -#endif /* UNIV_SYNC_DEBUG */ + mtr_x_lock(fil_space_get_latch(space), mtr); seg_inode = fseg_inode_get(seg_header, mtr); @@ -3222,11 +3213,10 @@ fseg_free_step( space = buf_frame_get_space_id(header); -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex) || mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); -#endif /* UNIV_SYNC_DEBUG */ + mtr_x_lock(fil_space_get_latch(space), mtr); descr = xdes_get_descriptor(space, buf_frame_get_page_no(header), mtr); @@ -3297,11 +3287,10 @@ fseg_free_step_not_header( space = buf_frame_get_space_id(header); -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex) || mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); -#endif /* UNIV_SYNC_DEBUG */ + mtr_x_lock(fil_space_get_latch(space), mtr); inode = fseg_inode_get(header, mtr); diff --git a/storage/innobase/ha/ha0ha.c b/storage/innobase/ha/ha0ha.c index 07dfb66afa8..7f241140050 100644 --- a/storage/innobase/ha/ha0ha.c +++ b/storage/innobase/ha/ha0ha.c @@ -96,9 +96,8 @@ ha_insert_for_fold( ulint hash; ut_ad(table && data); -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ + hash = hash_calc_hash(fold, table); cell = hash_get_nth_cell(table, hash); @@ -194,9 +193,8 @@ ha_delete( { ha_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ + node = ha_search_with_data(table, fold, data); ut_a(node); @@ -218,9 +216,7 @@ ha_search_and_update_if_found( { ha_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ node = ha_search_with_data(table, fold, data); @@ -248,9 +244,8 @@ ha_remove_all_nodes_to_page( { ha_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ + node = ha_chain_get_first(table, fold); while (node) { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index e9309f4f8b8..2d8f3eb0ef9 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -56,53 +56,6 @@ bool innodb_inited= 0; */ static handlerton *legacy_innodb_hton; -/*-----------------------------------------------------------------*/ -/* These variables are used to implement (semi-)synchronous MySQL binlog -replication for InnoDB tables. */ - -pthread_cond_t innobase_repl_cond; /* Posix cond variable; - this variable is signaled - when enough binlog has been - sent to slave, so that a - waiting trx can return the - 'ok' message to the client - for a commit */ -pthread_mutex_t innobase_repl_cond_mutex; /* Posix cond variable mutex - that also protects the next - innobase_repl_... variables */ -uint innobase_repl_state; /* 1 if synchronous replication - is switched on and is working - ok; else 0 */ -uint innobase_repl_file_name_inited = 0; /* This is set to 1 when - innobase_repl_file_name - contains meaningful data */ -char* innobase_repl_file_name; /* The binlog name up to which - we have sent some binlog to - the slave */ -my_off_t innobase_repl_pos; /* The position in that file - up to which we have sent the - binlog to the slave */ -uint innobase_repl_n_wait_threads = 0; /* This tells how many - transactions currently are - waiting for the binlog to be - sent to the client */ -uint innobase_repl_wait_file_name_inited = 0; /* This is set to 1 - when we know the 'smallest' - wait position */ -char* innobase_repl_wait_file_name; /* NULL, or the 'smallest' - innobase_repl_file_name that - a transaction is waiting for */ -my_off_t innobase_repl_wait_pos; /* The smallest position in - that file that a trx is - waiting for: the trx can - proceed and send an 'ok' to - the client when MySQL has sent - the binlog up to this position - to the slave */ -/*-----------------------------------------------------------------*/ - - - /* Store MySQL definition of 'byte': in Linux it is char while InnoDB uses unsigned char; the header univ.i which we include next defines 'byte' as a macro which expands to 'unsigned char' */ @@ -222,6 +175,139 @@ static handler *innobase_create_handler(handlerton *hton, return new (mem_root) ha_innobase(hton, table); } +/*********************************************************************** +This function is used to prepare X/Open XA distributed transaction */ +static +int +innobase_xa_prepare( +/*================*/ + /* out: 0 or error number */ + handlerton* hton, + THD* thd, /* in: handle to the MySQL thread of the user + whose XA transaction should be prepared */ + bool all); /* in: TRUE - commit transaction + FALSE - the current SQL statement ended */ +/*********************************************************************** +This function is used to recover X/Open XA distributed transactions */ +static +int +innobase_xa_recover( +/*================*/ + /* out: number of prepared transactions + stored in xid_list */ + handlerton* hton, + XID* xid_list, /* in/out: prepared transactions */ + uint len); /* in: number of slots in xid_list */ +/*********************************************************************** +This function is used to commit one X/Open XA distributed transaction +which is in the prepared state */ +static +int +innobase_commit_by_xid( +/*===================*/ + /* out: 0 or error number */ + handlerton* hton, + XID* xid); /* in: X/Open XA transaction identification */ +/*********************************************************************** +This function is used to rollback one X/Open XA distributed transaction +which is in the prepared state */ +static +int +innobase_rollback_by_xid( +/*=====================*/ + /* out: 0 or error number */ + handlerton* hton, + XID *xid); /* in: X/Open XA transaction identification */ +/*********************************************************************** +Create a consistent view for a cursor based on current transaction +which is created if the corresponding MySQL thread still lacks one. +This consistent view is then used inside of MySQL when accessing records +using a cursor. */ +static +void* +innobase_create_cursor_view( +/*========================*/ + /* out: pointer to cursor view or NULL */ + handlerton* hton, /* in: innobase hton */ + THD* thd); /* in: user thread handle */ +/*********************************************************************** +Set the given consistent cursor view to a transaction which is created +if the corresponding MySQL thread still lacks one. If the given +consistent cursor view is NULL global read view of a transaction is +restored to a transaction read view. */ +static +void +innobase_set_cursor_view( +/*=====================*/ + handlerton* hton, + THD* thd, /* in: user thread handle */ + void* curview);/* in: Consistent cursor view to be set */ +/*********************************************************************** +Close the given consistent cursor view of a transaction and restore +global read view to a transaction read view. Transaction is created if the +corresponding MySQL thread still lacks one. */ +static +void +innobase_close_cursor_view( +/*=======================*/ + handlerton* hton, + THD* thd, /* in: user thread handle */ + void* curview);/* in: Consistent read view to be closed */ +/********************************************************************* +Removes all tables in the named database inside InnoDB. */ +static +void +innobase_drop_database( +/*===================*/ + /* out: error number */ + handlerton* hton, /* in: handlerton of Innodb */ + char* path); /* in: database path; inside InnoDB the name + of the last directory in the path is used as + the database name: for example, in 'mysql/data/test' + the database name is 'test' */ +/*********************************************************************** +Closes an InnoDB database. */ +static +int +innobase_end(handlerton *hton, ha_panic_function type); + +/********************************************************************* +Creates an InnoDB transaction struct for the thd if it does not yet have one. +Starts a new InnoDB transaction if a transaction is not yet started. And +assigns a new snapshot for a consistent read if the transaction does not yet +have one. */ +static +int +innobase_start_trx_and_assign_read_view( +/*====================================*/ + /* out: 0 */ + handlerton* hton, /* in: Innodb handlerton */ + THD* thd); /* in: MySQL thread handle of the user for whom + the transaction should be committed */ +/******************************************************************** +Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes +the logs, and the name of this function should be innobase_checkpoint. */ +static +bool +innobase_flush_logs( +/*================*/ + /* out: TRUE if error */ + handlerton* hton); /* in: InnoDB handlerton */ + +/**************************************************************************** +Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB +Monitor to the client. */ +static +bool +innodb_show_status( +/*===============*/ + handlerton* hton, /* in: the innodb handlerton */ + THD* thd, /* in: the MySQL query thread of the caller */ + stat_print_fn *stat_print); +static +bool innobase_show_status(handlerton *hton, THD* thd, + stat_print_fn* stat_print, + enum ha_stat_type stat_type); /********************************************************************* Commits a transaction in an InnoDB database. */ @@ -379,11 +465,24 @@ innobase_release_stat_resources( } } +/************************************************************************ +Obtain the InnoDB transaction of a MySQL thread. */ +inline +trx_t*& +thd_to_trx( +/*=======*/ + /* out: reference to transaction pointer */ + THD* thd, /* in: MySQL thread */ + handlerton* hton) /* in: InnoDB handlerton */ +{ + return(*(trx_t**) thd_ha_data(thd, hton)); +} + /************************************************************************ Call this function when mysqld passes control to the client. That is to avoid deadlocks on the adaptive hash S-latch possibly held by thd. For more documentation, see handler.cc. */ - +static int innobase_release_temporary_latches( /*===============================*/ @@ -397,7 +496,7 @@ innobase_release_temporary_latches( return 0; } - trx = (trx_t*) thd->ha_data[hton->slot]; + trx = thd_to_trx(thd, hton); if (trx) { innobase_release_stat_resources(trx); @@ -857,12 +956,10 @@ check_trx_exists( handlerton* hton, /* in: handlerton for innodb */ THD* thd) /* in: user thread handle */ { - trx_t* trx; + trx_t*& trx = thd_to_trx(thd, hton); ut_ad(thd == current_thd); - trx = (trx_t*) thd->ha_data[hton->slot]; - if (trx == NULL) { DBUG_ASSERT(thd != NULL); trx = trx_allocate_for_mysql(); @@ -874,8 +971,6 @@ check_trx_exists( /* Update the info whether we should skip XA steps that eat CPU time */ trx->support_xa = (ibool)(thd->variables.innodb_support_xa); - - thd->ha_data[hton->slot] = trx; } else { if (trx->magic_n != TRX_MAGIC_N) { mem_analyze_corruption(trx); @@ -928,7 +1023,6 @@ ha_innobase::update_thd( /* out: 0 or error code */ THD* thd) /* in: thd to use the handle */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; trx_t* trx; trx = check_trx_exists(ht, thd); @@ -1271,8 +1365,6 @@ void ha_innobase::init_table_handle_for_HANDLER(void) /*============================================*/ { - row_prebuilt_t* prebuilt; - /* If current thd does not yet have a trx struct, create one. If the current handle does not yet have a prebuilt struct, create one. Update the trx pointers in the prebuilt struct. Normally @@ -1283,8 +1375,6 @@ ha_innobase::init_table_handle_for_HANDLER(void) /* Initialize the prebuilt struct much like it would be inited in external_lock */ - prebuilt = (row_prebuilt_t*)innobase_prebuilt; - innobase_release_stat_resources(prebuilt->trx); /* If the transaction is not started yet, start it */ @@ -1331,7 +1421,7 @@ ha_innobase::init_table_handle_for_HANDLER(void) /************************************************************************* Opens an InnoDB database. */ - +static int innobase_init(void *p) /*===============*/ @@ -1620,7 +1710,7 @@ error: /*********************************************************************** Closes an InnoDB database. */ - +static int innobase_end(handlerton *hton, ha_panic_function type) /*==============*/ @@ -1658,7 +1748,7 @@ innobase_end(handlerton *hton, ha_panic_function type) /******************************************************************** Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes the logs, and the name of this function should be innobase_checkpoint. */ - +static bool innobase_flush_logs(handlerton *hton) /*=====================*/ @@ -1694,7 +1784,7 @@ Creates an InnoDB transaction struct for the thd if it does not yet have one. Starts a new InnoDB transaction if a transaction is not yet started. And assigns a new snapshot for a consistent read if the transaction does not yet have one. */ - +static int innobase_start_trx_and_assign_read_view( /*====================================*/ @@ -1908,7 +1998,7 @@ innobase_report_binlog_offset_and_commit( #if 0 /*********************************************************************** This function stores the binlog offset and flushes logs. */ - +static void innobase_store_binlog_offset_and_flush_log( /*=======================================*/ @@ -1951,7 +2041,7 @@ innobase_commit_complete( { trx_t* trx; - trx = (trx_t*) thd->ha_data[hton->slot]; + trx = thd_to_trx(thd, hton); if (trx && trx->active_trans) { @@ -2175,7 +2265,7 @@ innobase_close_connection( { trx_t* trx; - trx = (trx_t*)thd->ha_data[hton->slot]; + trx = thd_to_trx(thd, hton); ut_a(trx); @@ -2216,8 +2306,6 @@ ha_innobase::get_row_type() const /*=============================*/ /* out: ROW_TYPE_REDUNDANT or ROW_TYPE_COMPACT */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - if (prebuilt && prebuilt->table) { if (dict_table_is_comp_noninline(prebuilt->table)) { return(ROW_TYPE_COMPACT); @@ -2364,7 +2452,7 @@ ha_innobase::open( DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); } - if (ib_table->ibd_file_missing && !thd->tablespace_op) { + if (ib_table->ibd_file_missing && !thd_tablespace_op(thd)) { ut_print_timestamp(stderr); sql_print_error("MySQL is trying to open a table handle but " "the .ibd file for\ntable %s does not exist.\n" @@ -2382,10 +2470,9 @@ ha_innobase::open( DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); } - innobase_prebuilt = row_create_prebuilt(ib_table); + prebuilt = row_create_prebuilt(ib_table); - ((row_prebuilt_t*)innobase_prebuilt)->mysql_row_len = - table->s->reclength; + prebuilt->mysql_row_len = table->s->reclength; /* Looks like MySQL-3.23 sometimes has primary key number != 0 */ @@ -2404,8 +2491,8 @@ ha_innobase::open( "dictionary, but not in MySQL!", name); } - ((row_prebuilt_t*)innobase_prebuilt) - ->clust_index_was_generated = FALSE; + prebuilt->clust_index_was_generated = FALSE; + /* MySQL allocates the buffer for ref. key_info->key_length includes space for all key columns + one byte for each column that may be NULL. ref_length must be as exact as possible to @@ -2426,8 +2513,7 @@ ha_innobase::open( "of the table.", name); } - ((row_prebuilt_t*)innobase_prebuilt) - ->clust_index_was_generated = TRUE; + prebuilt->clust_index_was_generated = TRUE; ref_length = DATA_ROW_ID_LEN; @@ -2474,7 +2560,7 @@ ha_innobase::close(void) { DBUG_ENTER("ha_innobase::close"); - row_prebuilt_free((row_prebuilt_t*) innobase_prebuilt); + row_prebuilt_free(prebuilt); my_free((gptr) upd_buff, MYF(0)); free_share(share); @@ -3264,34 +3350,31 @@ ha_innobase::write_row( /* out: error code */ mysql_byte* record) /* in: a row in MySQL format */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; int error; longlong auto_inc; longlong dummy; ibool auto_inc_used= FALSE; + THD* thd = current_thd; + trx_t* trx = thd_to_trx(thd, ht); DBUG_ENTER("ha_innobase::write_row"); - if (prebuilt->trx != - (trx_t*) current_thd->ha_data[ht->slot]) { + if (prebuilt->trx != trx) { sql_print_error("The transaction object for the table handle is at " "%p, but for the current thread it is at %p", - prebuilt->trx, - (trx_t*) current_thd->ha_data[ht->slot]); + prebuilt->trx, trx); fputs("InnoDB: Dump of 200 bytes around prebuilt: ", stderr); ut_print_buf(stderr, ((const byte*)prebuilt) - 100, 200); fputs("\n" - "InnoDB: Dump of 200 bytes around transaction.all: ", + "InnoDB: Dump of 200 bytes around ha_data: ", stderr); - ut_print_buf(stderr, - ((byte*)(&(current_thd->ha_data[ht->slot]))) - 100, - 200); + ut_print_buf(stderr, ((const byte*) trx) - 100, 200); putc('\n', stderr); ut_error; } - statistic_increment(current_thd->status_var.ha_write_count, + statistic_increment(thd->status_var.ha_write_count, &LOCK_status); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) @@ -3655,14 +3738,13 @@ ha_innobase::update_row( const mysql_byte* old_row,/* in: old row in MySQL format */ mysql_byte* new_row)/* in: new row in MySQL format */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; upd_t* uvect; int error = 0; + trx_t* trx = thd_to_trx(current_thd, ht); DBUG_ENTER("ha_innobase::update_row"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == trx); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); @@ -3671,7 +3753,7 @@ ha_innobase::update_row( prebuilt->sql_stat_start = TRUE; last_query_id = user_thd->query_id; - innobase_release_stat_resources(prebuilt->trx); + innobase_release_stat_resources(trx); } if (prebuilt->upd_node) { @@ -3692,11 +3774,11 @@ ha_innobase::update_row( assert(prebuilt->template_type == ROW_MYSQL_WHOLE_ROW); - innodb_srv_conc_enter_innodb(prebuilt->trx); + innodb_srv_conc_enter_innodb(trx); error = row_update_for_mysql((byte*) old_row, prebuilt); - innodb_srv_conc_exit_innodb(prebuilt->trx); + innodb_srv_conc_exit_innodb(trx); error = convert_error_code_to_mysql(error, user_thd); @@ -3717,19 +3799,18 @@ ha_innobase::delete_row( /* out: error number or 0 */ const mysql_byte* record) /* in: a row in MySQL format */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; int error = 0; + trx_t* trx = thd_to_trx(current_thd, ht); DBUG_ENTER("ha_innobase::delete_row"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == trx); if (last_query_id != user_thd->query_id) { prebuilt->sql_stat_start = TRUE; last_query_id = user_thd->query_id; - innobase_release_stat_resources(prebuilt->trx); + innobase_release_stat_resources(trx); } if (!prebuilt->upd_node) { @@ -3740,11 +3821,11 @@ ha_innobase::delete_row( prebuilt->upd_node->is_delete = TRUE; - innodb_srv_conc_enter_innodb(prebuilt->trx); + innodb_srv_conc_enter_innodb(trx); error = row_update_for_mysql((byte*) record, prebuilt); - innodb_srv_conc_exit_innodb(prebuilt->trx); + innodb_srv_conc_exit_innodb(trx); error = convert_error_code_to_mysql(error, user_thd); @@ -3765,8 +3846,6 @@ void ha_innobase::unlock_row(void) /*=========================*/ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - DBUG_ENTER("ha_innobase::unlock_row"); if (UNIV_UNLIKELY(last_query_id != user_thd->query_id)) { @@ -3774,7 +3853,7 @@ ha_innobase::unlock_row(void) sql_print_error("last_query_id is %lu != user_thd_query_id is " "%lu", (ulong) last_query_id, (ulong) user_thd->query_id); - mem_analyze_corruption((byte *) prebuilt->trx); + mem_analyze_corruption(prebuilt->trx); ut_error; } @@ -3808,8 +3887,6 @@ bool ha_innobase::was_semi_consistent_read(void) /*=======================================*/ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - return(prebuilt->row_read_type == ROW_READ_DID_SEMI_CONSISTENT); } @@ -3818,10 +3895,7 @@ void ha_innobase::try_semi_consistent_read(bool yes) /*===========================================*/ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); /* Row read type is set to semi consistent read if this was requested by the MySQL and either innodb_locks_unsafe_for_binlog @@ -3978,7 +4052,6 @@ ha_innobase::index_read( uint key_len,/* in: key value length */ enum ha_rkey_function find_flag)/* in: search flags from my_base.h */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; ulint mode; dict_index_t* index; ulint match_mode = 0; @@ -3987,8 +4060,7 @@ ha_innobase::index_read( DBUG_ENTER("index_read"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); statistic_increment(current_thd->status_var.ha_read_key_count, &LOCK_status); @@ -4095,15 +4167,13 @@ ha_innobase::change_active_index( index, even if it was internally generated by InnoDB */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; KEY* key=0; - statistic_increment(current_thd->status_var.ha_read_key_count, - &LOCK_status); + THD* thd = current_thd; + statistic_increment(thd->status_var.ha_read_key_count, &LOCK_status); DBUG_ENTER("change_active_index"); - ut_ad(user_thd == current_thd); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_ad(user_thd == thd); + ut_a(prebuilt->trx == thd_to_trx(thd, ht)); active_index = keynr; @@ -4186,14 +4256,12 @@ ha_innobase::general_fetch( uint match_mode) /* in: 0, ROW_SEL_EXACT, or ROW_SEL_EXACT_PREFIX */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; ulint ret; int error = 0; DBUG_ENTER("general_fetch"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); innodb_srv_conc_enter_innodb(prebuilt->trx); @@ -4340,8 +4408,6 @@ ha_innobase::rnd_init( { int err; - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - /* Store the active index value so that we can restore the original value after a scan */ @@ -4419,7 +4485,6 @@ ha_innobase::rnd_pos( the length of data in pos has to be ref_length */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; int error; uint keynr = active_index; DBUG_ENTER("rnd_pos"); @@ -4428,8 +4493,7 @@ ha_innobase::rnd_pos( statistic_increment(current_thd->status_var.ha_read_rnd_count, &LOCK_status); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); if (prebuilt->clust_index_was_generated) { /* No primary key was defined for the table and we @@ -4475,11 +4539,9 @@ ha_innobase::position( /*==================*/ const mysql_byte* record) /* in: row in MySQL format */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; uint len; - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); if (prebuilt->clust_index_was_generated) { /* No primary key was defined for the table and we @@ -4970,16 +5032,15 @@ ha_innobase::discard_or_import_tablespace( /* out: 0 == success, -1 == error */ my_bool discard) /* in: TRUE if discard, else import */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; dict_table_t* dict_table; trx_t* trx; int err; DBUG_ENTER("ha_innobase::discard_or_import_tablespace"); - ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx); + ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); dict_table = prebuilt->table; trx = prebuilt->trx; @@ -5003,7 +5064,6 @@ ha_innobase::delete_all_rows(void) /*==============================*/ /* out: error number */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; int error; THD* thd = current_thd; @@ -5121,7 +5181,7 @@ ha_innobase::delete_table( /********************************************************************* Removes all tables in the named database inside InnoDB. */ - +static void innobase_drop_database( /*===================*/ @@ -5288,7 +5348,6 @@ ha_innobase::records_in_range( key_range *max_key) /* in: range end key val, may also be 0 */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; KEY* key; dict_index_t* index; mysql_byte* key_val_buff2 = (mysql_byte*) my_malloc( @@ -5307,8 +5366,7 @@ ha_innobase::records_in_range( DBUG_ENTER("records_in_range"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); prebuilt->trx->op_info = (char*)"estimating records in index range"; @@ -5382,7 +5440,6 @@ ha_innobase::estimate_rows_upper_bound(void) /*======================================*/ /* out: upper bound of rows */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; dict_index_t* index; ulonglong estimate; ulonglong local_data_file_length; @@ -5431,8 +5488,6 @@ ha_innobase::scan_time() /*====================*/ /* out: estimated time measured in disk seeks */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - /* Since MySQL seems to favor table scans too much over index searches, we pretend that a sequential read takes the same time as a random disk read, that is, we do not divide the following @@ -5488,7 +5543,6 @@ ha_innobase::info( /*==============*/ uint flag) /* in: what information MySQL requests */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; dict_table_t* ib_table; dict_index_t* index; ha_rows rec_per_key; @@ -5741,12 +5795,10 @@ ha_innobase::check( HA_CHECK_OPT* check_opt) /* in: check options, currently ignored */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; ulint ret; ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); if (prebuilt->mysql_template == NULL) { /* Build the template; we will use a dummy template @@ -5776,9 +5828,8 @@ ha_innobase::update_table_comment( info on foreign keys */ const char* comment)/* in: table comment defined by user */ { - uint length = (uint) strlen(comment); - char* str; - row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; + uint length = (uint) strlen(comment); + char* str; long flen; /* We do not know if MySQL can call this function before calling @@ -5851,7 +5902,6 @@ ha_innobase::get_foreign_key_create_info(void) can be inserted to the CREATE TABLE statement, MUST be freed with ::free_foreign_key_create_info */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; char* str = 0; long flen; @@ -5909,7 +5959,6 @@ ha_innobase::get_foreign_key_list(THD *thd, List *f_key_list) dict_foreign_t* foreign; DBUG_ENTER("get_foreign_key_list"); - row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; ut_a(prebuilt != NULL); update_thd(current_thd); prebuilt->trx->op_info = (char*)"getting list of foreign keys"; @@ -6042,13 +6091,11 @@ bool ha_innobase::can_switch_engines(void) /*=================================*/ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; bool can_switch; DBUG_ENTER("ha_innobase::can_switch_engines"); - ut_a(prebuilt->trx == - (trx_t*) current_thd->ha_data[ht->slot]); + ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); prebuilt->trx->op_info = "determining if there are foreign key constraints"; @@ -6074,8 +6121,6 @@ ha_innobase::referenced_by_foreign_key(void) /*========================================*/ /* out: > 0 if referenced by a FOREIGN KEY */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt; - if (dict_table_referenced_by_foreign_key(prebuilt->table)) { return(1); @@ -6108,8 +6153,6 @@ ha_innobase::extra( enum ha_extra_function operation) /* in: HA_EXTRA_FLUSH or some other flag */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - /* Warning: since it is not sure that MySQL calls external_lock before calling this function, the trx field in prebuilt can be obsolete! */ @@ -6142,7 +6185,6 @@ ha_innobase::extra( int ha_innobase::reset() { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; if (prebuilt->blob_heap) { row_mysql_prebuilt_free_blob_heap(prebuilt); } @@ -6161,7 +6203,7 @@ on that table. MySQL-5.0 also calls this before each statement in an execution of a stored procedure. To make the execution more deterministic for binlogging, MySQL-5.0 locks all tables involved in a stored procedure with full explicit table -locks (thd->in_lock_tables is true in ::store_lock()) before executing the +locks (thd_in_lock_tables(thd) holds in store_lock()) before executing the procedure. */ int @@ -6171,7 +6213,6 @@ ha_innobase::start_stmt( THD* thd, /* in: handle to the user thread */ thr_lock_type lock_type) { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; trx_t* trx; update_thd(thd); @@ -6270,7 +6311,6 @@ ha_innobase::external_lock( THD* thd, /* in: handle to the user thread */ int lock_type) /* in: lock type */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; trx_t* trx; DBUG_ENTER("ha_innobase::external_lock"); @@ -6336,16 +6376,16 @@ ha_innobase::external_lock( VERY easily deadlocks. We do not set InnoDB table locks if user has not explicitly - requested a table lock. Note that thd->in_lock_tables - can be TRUE on some cases e.g. at the start of a stored + requested a table lock. Note that thd_in_lock_tables(thd) + can hold in some cases, e.g., at the start of a stored procedure call (SQLCOM_CALL). */ if (prebuilt->select_lock_type != LOCK_NONE) { - if (thd->in_lock_tables && - thd->lex->sql_command == SQLCOM_LOCK_TABLES && - thd->variables.innodb_table_locks && - (thd->options & OPTION_NOT_AUTOCOMMIT)) { + if (thd->lex->sql_command == SQLCOM_LOCK_TABLES + && thd->variables.innodb_table_locks + && (thd->options & OPTION_NOT_AUTOCOMMIT) + && thd_in_lock_tables(thd)) { ulint error = row_lock_table_for_mysql( prebuilt, NULL, 0); @@ -6412,7 +6452,6 @@ ha_innobase::transactional_table_lock( THD* thd, /* in: handle to the user thread */ int lock_type) /* in: lock type */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; trx_t* trx; DBUG_ENTER("ha_innobase::transactional_table_lock"); @@ -6424,7 +6463,8 @@ ha_innobase::transactional_table_lock( update_thd(thd); - if (prebuilt->table->ibd_file_missing && !current_thd->tablespace_op) { + if (prebuilt->table->ibd_file_missing + && !thd_tablespace_op(current_thd)) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB error:\n" "MySQL is trying to use a table handle but the .ibd file for\n" @@ -6469,7 +6509,7 @@ ha_innobase::transactional_table_lock( trx->active_trans = 1; } - if (thd->in_lock_tables && thd->variables.innodb_table_locks) { + if (thd->variables.innodb_table_locks && thd_in_lock_tables(thd)) { ulint error = DB_SUCCESS; error = row_lock_table_for_mysql(prebuilt, NULL, 0); @@ -6509,7 +6549,7 @@ innodb_export_status() /**************************************************************************** Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB Monitor to the client. */ - +static bool innodb_show_status( /*===============*/ @@ -6699,6 +6739,7 @@ innodb_mutex_show_status( DBUG_RETURN(FALSE); } +static bool innobase_show_status(handlerton *hton, THD* thd, stat_print_fn* stat_print, enum ha_stat_type stat_type) @@ -6800,7 +6841,6 @@ ha_innobase::store_lock( 'lock'; this may also be TL_IGNORE */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; trx_t* trx; /* Note that trx in this function is NOT necessarily prebuilt->trx @@ -6821,16 +6861,28 @@ ha_innobase::store_lock( trx->isolation_level = innobase_map_isolation_level( (enum_tx_isolation) thd->variables.tx_isolation); + + if (trx->isolation_level <= TRX_ISO_READ_COMMITTED + && trx->global_read_view) { + + /* At low transaction isolation levels we let + each consistent read set its own snapshot */ + + read_view_close_for_mysql(trx); + } + } + const bool in_lock_tables = thd_in_lock_tables(thd); + if (thd->lex->sql_command == SQLCOM_DROP_TABLE) { /* MySQL calls this function in DROP TABLE though this table handle may belong to another thd that is running a query. Let us in that case skip any changes to the prebuilt struct. */ - } else if ((lock_type == TL_READ && thd->in_lock_tables) || - (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || + } else if ((lock_type == TL_READ && in_lock_tables) || + (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || lock_type == TL_READ_NO_INSERT || (thd->lex->sql_command != SQLCOM_SELECT @@ -6901,7 +6953,7 @@ ha_innobase::store_lock( /* Starting from 5.0.7, we weaken also the table locks set at the start of a MySQL stored procedure call, just like we weaken the locks set at the start of an SQL statement. - MySQL does set thd->in_lock_tables TRUE there, but in reality + MySQL does set in_lock_tables TRUE there, but in reality we do not need table locks to make the execution of a single transaction stored procedure call deterministic (if it does not use a consistent read). */ @@ -6929,14 +6981,14 @@ ha_innobase::store_lock( We especially allow multiple writers if MySQL is at the start of a stored procedure call (SQLCOM_CALL) or a - stored function call (MySQL does have thd->in_lock_tables + stored function call (MySQL does have in_lock_tables TRUE there). */ if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) - && !(thd->in_lock_tables + && !(in_lock_tables && thd->lex->sql_command == SQLCOM_LOCK_TABLES) - && !thd->tablespace_op + && !thd_tablespace_op(thd) && thd->lex->sql_command != SQLCOM_TRUNCATE && thd->lex->sql_command != SQLCOM_OPTIMIZE @@ -6963,7 +7015,7 @@ ha_innobase::store_lock( We especially allow concurrent inserts if MySQL is at the start of a stored procedure call (SQLCOM_CALL) - (MySQL does have thd->in_lock_tables TRUE there). */ + (MySQL does have in_lock_tables TRUE there). */ if (lock_type == TL_READ_NO_INSERT && thd->lex->sql_command != SQLCOM_LOCK_TABLES) { @@ -6992,7 +7044,6 @@ ha_innobase::innobase_read_and_init_auto_inc( timeout */ longlong* ret) /* out: auto-inc value */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; longlong auto_inc; ulint old_select_lock_type; ibool trx_was_not_started = FALSE; @@ -7172,8 +7223,7 @@ ha_innobase::reset_auto_increment(ulonglong value) { DBUG_ENTER("ha_innobase::reset_auto_increment"); - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; - int error; + int error; update_thd(current_thd); @@ -7217,7 +7267,6 @@ ha_innobase::cmp_ref( const mysql_byte* ref2) /* in: an (internal) primary key value in the MySQL key value format */ { - row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; enum_field_types mysql_type; Field* field; KEY_PART_INFO* key_part; @@ -7408,7 +7457,7 @@ innobase_query_is_update(void) /*********************************************************************** This function is used to prepare X/Open XA distributed transaction */ - +static int innobase_xa_prepare( /*================*/ @@ -7504,7 +7553,7 @@ innobase_xa_prepare( /*********************************************************************** This function is used to recover X/Open XA distributed transactions */ - +static int innobase_xa_recover( /*================*/ @@ -7525,7 +7574,7 @@ innobase_xa_recover( /*********************************************************************** This function is used to commit one X/Open XA distributed transaction which is in the prepared state */ - +static int innobase_commit_by_xid( /*===================*/ @@ -7549,7 +7598,7 @@ innobase_commit_by_xid( /*********************************************************************** This function is used to rollback one X/Open XA distributed transaction which is in the prepared state */ - +static int innobase_rollback_by_xid( /*=====================*/ @@ -7573,9 +7622,10 @@ Create a consistent view for a cursor based on current transaction which is created if the corresponding MySQL thread still lacks one. This consistent view is then used inside of MySQL when accessing records using a cursor. */ - +static void* innobase_create_cursor_view( +/*========================*/ /* out: pointer to cursor view or NULL */ handlerton *hton, /* in: innobase hton */ THD* thd) /* in: user thread handle */ @@ -7588,9 +7638,10 @@ innobase_create_cursor_view( Close the given consistent cursor view of a transaction and restore global read view to a transaction read view. Transaction is created if the corresponding MySQL thread still lacks one. */ - +static void innobase_close_cursor_view( +/*=======================*/ handlerton *hton, THD* thd, /* in: user thread handle */ void* curview)/* in: Consistent read view to be closed */ @@ -7604,7 +7655,7 @@ Set the given consistent cursor view to a transaction which is created if the corresponding MySQL thread still lacks one. If the given consistent cursor view is NULL global read view of a transaction is restored to a transaction read view. */ - +static void innobase_set_cursor_view( /*=====================*/ diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 339238a584e..eb977ed6bd5 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -33,6 +33,7 @@ typedef struct st_innobase_share { struct row_prebuilt_struct; +typedef struct row_prebuilt_struct row_prebuilt_t; my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name, uint full_name_len, @@ -41,9 +42,8 @@ my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name, /* The class defining a handle to an Innodb table */ class ha_innobase: public handler { - void* innobase_prebuilt;/* (row_prebuilt_t*) prebuilt - struct in InnoDB, used to save - CPU time with prebuilt data + row_prebuilt_t* prebuilt; /* prebuilt struct in InnoDB, used + to save CPU time with prebuilt data structures*/ THD* user_thd; /* the thread handle of the user currently using the handle; this is @@ -238,11 +238,6 @@ extern ulong srv_commit_concurrency; extern ulong srv_flush_log_at_trx_commit; } -int innobase_init(void); -int innobase_end(handlerton *hton, ha_panic_function type); -bool innobase_flush_logs(handlerton *hton); -uint innobase_get_free_space(void); - /* don't delete it - it may be re-enabled later as an optimization for the most common case InnoDB+binlog @@ -256,93 +251,3 @@ int innobase_report_binlog_offset_and_commit( int innobase_commit_complete(void* trx_handle); void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset); #endif - -void innobase_drop_database(handlerton *hton, char *path); -bool innobase_show_status(handlerton *hton, THD* thd, stat_print_fn*, enum ha_stat_type); - -int innobase_release_temporary_latches(handlerton *hton, THD *thd); - -void innobase_store_binlog_offset_and_flush_log(handlerton *hton, char *binlog_name,longlong offset); - -int innobase_start_trx_and_assign_read_view(handlerton *hton, THD* thd); - -/*********************************************************************** -This function is used to prepare X/Open XA distributed transaction */ - -int innobase_xa_prepare( -/*====================*/ - /* out: 0 or error number */ - handlerton *hton, /* in: innobase hton */ - THD* thd, /* in: handle to the MySQL thread of the user - whose XA transaction should be prepared */ - bool all); /* in: TRUE - commit transaction - FALSE - the current SQL statement ended */ - -/*********************************************************************** -This function is used to recover X/Open XA distributed transactions */ - -int innobase_xa_recover( -/*====================*/ - /* out: number of prepared transactions - stored in xid_list */ - handlerton *hton, /* in: innobase hton */ - XID* xid_list, /* in/out: prepared transactions */ - uint len); /* in: number of slots in xid_list */ - -/*********************************************************************** -This function is used to commit one X/Open XA distributed transaction -which is in the prepared state */ - -int innobase_commit_by_xid( -/*=======================*/ - /* out: 0 or error number */ - handlerton *hton, /* in: innobase hton */ - XID* xid); /* in : X/Open XA Transaction Identification */ - -/*********************************************************************** -This function is used to rollback one X/Open XA distributed transaction -which is in the prepared state */ - -int innobase_rollback_by_xid( - /* out: 0 or error number */ - handlerton *hton, /* in: innobase hton */ - XID *xid); /* in : X/Open XA Transaction Identification */ - - -/*********************************************************************** -Create a consistent view for a cursor based on current transaction -which is created if the corresponding MySQL thread still lacks one. -This consistent view is then used inside of MySQL when accessing records -using a cursor. */ - -void* -innobase_create_cursor_view( - /* out: Pointer to cursor view or NULL */ - handlerton *hton, /* in: innobase hton */ - THD* thd); /* in: user thread handle */ - -/*********************************************************************** -Close the given consistent cursor view of a transaction and restore -global read view to a transaction read view. Transaction is created if the -corresponding MySQL thread still lacks one. */ - -void -innobase_close_cursor_view( -/*=======================*/ - handlerton *hton, /* in: innobase hton */ - THD* thd, /* in: user thread handle */ - void* curview); /* in: Consistent read view to be closed */ - - -/*********************************************************************** -Set the given consistent cursor view to a transaction which is created -if the corresponding MySQL thread still lacks one. If the given -consistent cursor view is NULL global read view of a transaction is -restored to a transaction read view. */ - -void -innobase_set_cursor_view( -/*=====================*/ - handlerton *hton, /* in: innobase hton */ - THD* thd, /* in: user thread handle */ - void* curview); /* in: Consistent read view to be set */ diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 96ab928a436..1cbb6003cfc 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -417,9 +417,7 @@ ibuf_data_sizes_update( { ulint old_size; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&ibuf_mutex)); -#endif /* UNIV_SYNC_DEBUG */ old_size = data->size; @@ -1576,9 +1574,7 @@ ibuf_data_enough_free_for_insert( /* out: TRUE if enough free pages in list */ ibuf_data_t* data) /* in: ibuf data for the space */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&ibuf_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* We want a big margin of free pages, because a B-tree can sometimes grow in size also if records are deleted from it, as the node pointers @@ -1604,16 +1600,9 @@ ibuf_data_too_much_free( /* out: TRUE if enough free pages in list */ ibuf_data_t* data) /* in: ibuf data for the space */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&ibuf_mutex)); -#endif /* UNIV_SYNC_DEBUG */ - if (data->free_list_len >= 3 + data->size / 2 + 3 * data->height) { - - return(TRUE); - } - - return(FALSE); + return(data->free_list_len >= 3 + data->size / 2 + 3 * data->height); } /************************************************************************* @@ -3451,9 +3440,7 @@ ibuf_validate_low(void) ibuf_data_t* data; ulint sum_sizes; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&ibuf_mutex)); -#endif /* UNIV_SYNC_DEBUG */ sum_sizes = 0; diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index c448c28933a..031bf6c51b4 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -128,9 +128,7 @@ buf_pool_clock_tic(void) /*====================*/ /* out: new clock value */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ buf_pool->ulint_clock++; @@ -456,7 +454,7 @@ buf_frame_modify_clock_inc( #ifdef UNIV_SYNC_DEBUG ut_ad((mutex_own(&(buf_pool->mutex)) && (block->buf_fix_count == 0)) || rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE)); -#endif /*UNIV_SYNC_DEBUG */ +#endif /* UNIV_SYNC_DEBUG */ UT_DULINT_INC(block->modify_clock); @@ -513,14 +511,12 @@ buf_block_buf_fix_inc_debug( const char* file __attribute__ ((unused)), /* in: file name */ ulint line __attribute__ ((unused))) /* in: line */ { -#ifdef UNIV_SYNC_DEBUG ibool ret; ret = rw_lock_s_lock_func_nowait(&(block->debug_latch), file, line); ut_ad(ret == TRUE); ut_ad(mutex_own(&block->mutex)); -#endif block->buf_fix_count++; } #else /* UNIV_SYNC_DEBUG */ @@ -532,9 +528,8 @@ buf_block_buf_fix_inc( /*==================*/ buf_block_t* block) /* in: block to bufferfix */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&block->mutex)); -#endif + block->buf_fix_count++; } #endif /* UNIV_SYNC_DEBUG */ @@ -552,9 +547,7 @@ buf_page_hash_get( ulint fold; ut_ad(buf_pool); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(buf_pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* Look for the page in the hash table */ diff --git a/storage/innobase/include/buf0flu.ic b/storage/innobase/include/buf0flu.ic index b304673f8be..ae873c42088 100644 --- a/storage/innobase/include/buf0flu.ic +++ b/storage/innobase/include/buf0flu.ic @@ -42,8 +42,8 @@ buf_flush_note_modification( ut_ad(block->buf_fix_count > 0); #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX)); - ut_ad(mutex_own(&(buf_pool->mutex))); #endif /* UNIV_SYNC_DEBUG */ + ut_ad(mutex_own(&(buf_pool->mutex))); ut_ad(ut_dulint_cmp(mtr->start_lsn, ut_dulint_zero) != 0); ut_ad(mtr->modifications); diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index d59e99277da..4a9afd2f3f5 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -551,9 +551,7 @@ dict_table_check_if_in_cache_low( ulint table_fold; ut_ad(table_name); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* Look for the table name in the hash table */ table_fold = ut_fold_string(table_name); @@ -576,9 +574,7 @@ dict_table_get_low( dict_table_t* table; ut_ad(table_name); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ table = dict_table_check_if_in_cache_low(table_name); @@ -601,9 +597,7 @@ dict_table_get_on_id_low( dict_table_t* table; ulint fold; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* Look for the table name in the hash table */ fold = ut_fold_dulint(table_id); diff --git a/storage/innobase/include/ha0ha.ic b/storage/innobase/include/ha0ha.ic index 1584e1ff4bf..fb264377f28 100644 --- a/storage/innobase/include/ha0ha.ic +++ b/storage/innobase/include/ha0ha.ic @@ -81,9 +81,7 @@ ha_search( { ha_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ node = ha_chain_get_first(table, fold); @@ -113,9 +111,7 @@ ha_search_and_get_data( { ha_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ node = ha_chain_get_first(table, fold); @@ -145,9 +141,7 @@ ha_search_with_data( { ha_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ node = ha_chain_get_first(table, fold); @@ -177,9 +171,7 @@ ha_search_and_delete_if_found( { ha_node_t* node; -#ifdef UNIV_SYNC_DEBUG ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); -#endif /* UNIV_SYNC_DEBUG */ node = ha_search_with_data(table, fold, data); diff --git a/storage/innobase/include/lock0lock.ic b/storage/innobase/include/lock0lock.ic index feec460bec8..311623b190b 100644 --- a/storage/innobase/include/lock0lock.ic +++ b/storage/innobase/include/lock0lock.ic @@ -65,9 +65,7 @@ lock_clust_rec_some_has_impl( { dulint trx_id; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(index->type & DICT_CLUSTERED); ut_ad(page_rec_is_user_rec(rec)); diff --git a/storage/innobase/include/log0log.ic b/storage/innobase/include/log0log.ic index 06deff196bc..df0a8baf2d5 100644 --- a/storage/innobase/include/log0log.ic +++ b/storage/innobase/include/log0log.ic @@ -255,9 +255,7 @@ log_block_init( { ulint no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ no = log_block_convert_lsn_to_no(lsn); @@ -279,9 +277,7 @@ log_block_init_in_old_format( { ulint no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ no = log_block_convert_lsn_to_no(lsn); diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h index f68d45d83df..2d5fd1db6c3 100644 --- a/storage/innobase/include/mem0mem.h +++ b/storage/innobase/include/mem0mem.h @@ -279,17 +279,6 @@ mem_strdupl( const char* str, /* in: string to be copied */ ulint len); /* in: length of str, in bytes */ -/************************************************************************** -Makes a NUL-terminated quoted copy of a NUL-terminated string. */ -UNIV_INLINE -char* -mem_strdupq( -/*========*/ - /* out, own: a quoted copy of the string, - must be deallocated with mem_free */ - const char* str, /* in: string to be copied */ - char q); /* in: quote character */ - /************************************************************************** Duplicates a NUL-terminated string, allocated from a memory heap. */ diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic index 069f8de36cb..cb8fbe92cf0 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.ic @@ -589,41 +589,6 @@ mem_strdupl( return(memcpy(s, str, len)); } -/************************************************************************** -Makes a NUL-terminated quoted copy of a NUL-terminated string. */ -UNIV_INLINE -char* -mem_strdupq( -/*========*/ - /* out, own: a quoted copy of the string, - must be deallocated with mem_free */ - const char* str, /* in: string to be copied */ - char q) /* in: quote character */ -{ - char* dst; - char* d; - const char* s = str; - size_t len = strlen(str) + 3; - /* calculate the number of quote characters in the string */ - while((s = strchr(s, q)) != NULL) { - s++; - len++; - } - /* allocate the quoted string, and copy it */ - d = dst = mem_alloc(len); - *d++ = q; - s = str; - while(*s) { - if ((*d++ = *s++) == q) { - *d++ = q; - } - } - *d++ = q; - *d++ = '\0'; - ut_ad((ssize_t) len == d - dst); - return(dst); -} - /************************************************************************** Makes a NUL-terminated copy of a nonterminated string, allocated from a memory heap. */ diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index ace90247b80..90a35af74dc 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -995,6 +995,9 @@ rec_offs_nth_size( { ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(n < rec_offs_n_fields(offsets)); + if (!n) { + return(rec_offs_base(offsets)[1 + n] & REC_OFFS_MASK); + } return((rec_offs_base(offsets)[1 + n] - rec_offs_base(offsets)[n]) & REC_OFFS_MASK); } diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic index defe0692aa8..f8b5367739a 100644 --- a/storage/innobase/include/sync0rw.ic +++ b/storage/innobase/include/sync0rw.ic @@ -133,9 +133,8 @@ rw_lock_s_lock_low( const char* file_name, /* in: file name where lock requested */ ulint line) /* in: line where requested */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(rw_lock_get_mutex(lock))); -#endif /* UNIV_SYNC_DEBUG */ + /* Check if the writer field is free */ if (UNIV_LIKELY(lock->writer == RW_LOCK_NOT_LOCKED)) { diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index e7e135c0c7e..69c0cd9e39b 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -114,13 +114,20 @@ mutex_enter_func( mutex_t* mutex, /* in: pointer to mutex */ const char* file_name, /* in: file name where locked */ ulint line); /* in: line where locked */ +/****************************************************************** +NOTE! The following macro should be used in mutex locking, not the +corresponding function. */ + +#define mutex_enter_nowait(M) \ + mutex_enter_nowait_func((M), __FILE__, __LINE__) /************************************************************************ -Tries to lock the mutex for the current thread. If the lock is not acquired -immediately, returns with return value 1. */ +NOTE! Use the corresponding macro in the header file, not this function +directly. Tries to lock the mutex for the current thread. If the lock is not +acquired immediately, returns with return value 1. */ ulint -mutex_enter_nowait( -/*===============*/ +mutex_enter_nowait_func( +/*====================*/ /* out: 0 if succeed, 1 if not */ mutex_t* mutex, /* in: pointer to mutex */ const char* file_name, /* in: file name where mutex @@ -170,7 +177,16 @@ Checks that the mutex has been initialized. */ ibool mutex_validate( /*===========*/ - mutex_t* mutex); + const mutex_t* mutex); +/********************************************************************** +Checks that the current thread owns the mutex. Works only +in the debug version. */ + +ibool +mutex_own( +/*======*/ + /* out: TRUE if owns */ + const mutex_t* mutex); /* in: mutex */ #endif /* UNIV_DEBUG */ #ifdef UNIV_SYNC_DEBUG /********************************************************************** @@ -215,15 +231,6 @@ sync_thread_levels_empty_gen( also purge_is_running mutex is allowed */ /********************************************************************** -Checks that the current thread owns the mutex. Works only -in the debug version. */ - -ibool -mutex_own( -/*======*/ - /* out: TRUE if owns */ - mutex_t* mutex); /* in: mutex */ -/********************************************************************** Gets the debug information for a reserved mutex. */ void @@ -248,7 +255,7 @@ UNIV_INLINE ulint mutex_get_lock_word( /*================*/ - mutex_t* mutex); /* in: mutex */ + const mutex_t* mutex); /* in: mutex */ #ifdef UNIV_SYNC_DEBUG /********************************************************************** NOT to be used outside this module except in debugging! Gets the waiters @@ -258,7 +265,7 @@ ulint mutex_get_waiters( /*==============*/ /* out: value to set */ - mutex_t* mutex); /* in: mutex */ + const mutex_t* mutex); /* in: mutex */ #endif /* UNIV_SYNC_DEBUG */ /* @@ -479,13 +486,13 @@ struct mutex_struct { #ifdef UNIV_SYNC_DEBUG const char* file_name; /* File where the mutex was locked */ ulint line; /* Line where the mutex was locked */ - os_thread_id_t thread_id; /* Debug version: The thread id of the - thread which locked the mutex. */ ulint level; /* Level in the global latching order */ #endif /* UNIV_SYNC_DEBUG */ const char* cfile_name;/* File name where mutex created */ ulint cline; /* Line where created */ #ifdef UNIV_DEBUG + os_thread_id_t thread_id; /* The thread id of the thread + which locked the mutex. */ ulint magic_n; # define MUTEX_MAGIC_N (ulint)979585 #endif /* UNIV_DEBUG */ diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic index 4b48a1469ff..9bd5ac2a518 100644 --- a/storage/innobase/include/sync0sync.ic +++ b/storage/innobase/include/sync0sync.ic @@ -6,6 +6,16 @@ Mutex, the basic synchronization primitive Created 9/5/1995 Heikki Tuuri *******************************************************/ +#if defined(not_defined) && defined(__GNUC__) && defined(UNIV_INTEL_X86) +/* %z0: Use the size of operand %0 which in our case is *m to determine +instruction size, it should end up as xchgl. "1" in the input constraint, +says that "in" has to go in the same place as "out".*/ +#define TAS(m, in, out) \ + asm volatile ("xchg%z0 %2, %0" \ + : "=g" (*(m)), "=r" (out) \ + : "1" (in)) /* Note: "1" here refers to "=r" (out) */ +#endif + /********************************************************************** Sets the waiters field in a mutex. */ @@ -89,20 +99,10 @@ mutex_test_and_set( return(res); #elif defined(not_defined) && defined(__GNUC__) && defined(UNIV_INTEL_X86) - ulint* lw; ulint res; - lw = &(mutex->lock_word); + TAS(&mutex->lock_word, 1, res); - /* In assembly we use the so-called AT & T syntax where - the order of operands is inverted compared to the ordinary Intel - syntax. The 'l' after the mnemonics denotes a 32-bit operation. - The line after the code tells which values come out of the asm - code, and the second line tells the input to the asm code. */ - - asm volatile("movl $1, %%eax; xchgl (%%ecx), %%eax" : - "=eax" (res), "=m" (*lw) : - "ecx" (lw)); return(res); #else ibool ret; @@ -141,20 +141,9 @@ mutex_reset_lock_word( __asm MOV ECX, lw __asm XCHG EDX, DWORD PTR [ECX] #elif defined(not_defined) && defined(__GNUC__) && defined(UNIV_INTEL_X86) - ulint* lw; + ulint res; - lw = &(mutex->lock_word); - - /* In assembly we use the so-called AT & T syntax where - the order of operands is inverted compared to the ordinary Intel - syntax. The 'l' after the mnemonics denotes a 32-bit operation. */ - - asm volatile("movl $0, %%eax; xchgl (%%ecx), %%eax" : - "=m" (*lw) : - "ecx" (lw) : - "eax"); /* gcc does not seem to understand - that our asm code resets eax: tell it - explicitly that after the third ':' */ + TAS(&mutex->lock_word, 0, res); #else mutex->lock_word = 0; @@ -168,9 +157,9 @@ UNIV_INLINE ulint mutex_get_lock_word( /*================*/ - mutex_t* mutex) /* in: mutex */ + const mutex_t* mutex) /* in: mutex */ { - volatile ulint* ptr; /* declared volatile to ensure that + const volatile ulint* ptr; /* declared volatile to ensure that lock_word is loaded from memory */ ut_ad(mutex); @@ -186,9 +175,9 @@ ulint mutex_get_waiters( /*==============*/ /* out: value to set */ - mutex_t* mutex) /* in: mutex */ + const mutex_t* mutex) /* in: mutex */ { - volatile ulint* ptr; /* declared volatile to ensure that + const volatile ulint* ptr; /* declared volatile to ensure that the value is read from memory */ ut_ad(mutex); @@ -206,11 +195,11 @@ mutex_exit( /*=======*/ mutex_t* mutex) /* in: pointer to mutex */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(mutex)); - mutex->thread_id = ULINT_UNDEFINED; + ut_d(mutex->thread_id = ULINT_UNDEFINED); +#ifdef UNIV_SYNC_DEBUG sync_thread_reset_level(mutex); #endif mutex_reset_lock_word(mutex); @@ -250,6 +239,7 @@ mutex_enter_func( ulint line) /* in: line where locked */ { ut_ad(mutex_validate(mutex)); + ut_ad(!mutex_own(mutex)); /* Note that we do not peek at the value of lock_word before trying the atomic test_and_set; we could peek, and possibly save time. */ @@ -259,6 +249,7 @@ mutex_enter_func( #endif /* UNIV_DEBUG && !UNIV_HOTBACKUP */ if (!mutex_test_and_set(mutex)) { + ut_d(mutex->thread_id = os_thread_get_curr_id()); #ifdef UNIV_SYNC_DEBUG mutex_set_debug_info(mutex, file_name, line); #endif diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic index 9c950be09f0..86b71df08d6 100644 --- a/storage/innobase/include/trx0sys.ic +++ b/storage/innobase/include/trx0sys.ic @@ -62,9 +62,7 @@ trx_sys_get_nth_rseg( trx_sys_t* sys, /* in: trx system */ ulint n) /* in: index of slot */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(n < TRX_SYS_N_RSEGS); return(sys->rseg_array[n]); @@ -121,9 +119,7 @@ trx_sysf_rseg_get_space( ulint i, /* in: slot index == rseg id */ mtr_t* mtr) /* in: mtr */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(sys_header); ut_ad(i < TRX_SYS_N_RSEGS); @@ -146,9 +142,7 @@ trx_sysf_rseg_get_page_no( mtr_t* mtr) /* in: mtr */ { ut_ad(sys_header); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(i < TRX_SYS_N_RSEGS); return(mtr_read_ulint(sys_header + TRX_SYS_RSEGS @@ -168,9 +162,7 @@ trx_sysf_rseg_set_space( ulint space, /* in: space id */ mtr_t* mtr) /* in: mtr */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(sys_header); ut_ad(i < TRX_SYS_N_RSEGS); @@ -194,9 +186,7 @@ trx_sysf_rseg_set_page_no( slot is reset to unused */ mtr_t* mtr) /* in: mtr */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(sys_header); ut_ad(i < TRX_SYS_N_RSEGS); @@ -250,9 +240,7 @@ trx_get_on_id( { trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx = UT_LIST_GET_FIRST(trx_sys->trx_list); @@ -282,9 +270,7 @@ trx_list_get_min_trx_id(void) { trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx = UT_LIST_GET_LAST(trx_sys->trx_list); @@ -307,9 +293,7 @@ trx_is_active( { trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (ut_dulint_cmp(trx_id, trx_list_get_min_trx_id()) < 0) { @@ -346,9 +330,7 @@ trx_sys_get_new_trx_id(void) { dulint id; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* VERY important: after the database is started, max_trx_id value is divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if @@ -378,9 +360,7 @@ trx_sys_get_new_trx_no(void) /*========================*/ /* out: new, allocated trx number */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ return(trx_sys_get_new_trx_id()); } diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 7a5cb21f07a..957baa0391f 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -40,9 +40,9 @@ if we are compiling on Windows. */ # undef VERSION /* Include the header file generated by GNU autoconf */ -#ifndef __WIN__ -# include "config.h" -#endif +# ifndef __WIN__ +# include "config.h" +# endif # ifdef HAVE_SCHED_H # include @@ -51,9 +51,9 @@ if we are compiling on Windows. */ /* When compiling for Itanium IA64, undefine the flag below to prevent use of the 32-bit x86 assembler in mutex operations. */ -#if defined(__WIN__) && !defined(WIN64) && !defined(_WIN64) -#define UNIV_CAN_USE_X86_ASSEMBLER -#endif +# if defined(__WIN__) && !defined(WIN64) && !defined(_WIN64) +# define UNIV_CAN_USE_X86_ASSEMBLER +# endif /* We only try to do explicit inlining of functions with gcc and Microsoft Visual C++ */ diff --git a/storage/innobase/include/ut0lst.h b/storage/innobase/include/ut0lst.h index 9735bf315c6..ebe2803fe23 100644 --- a/storage/innobase/include/ut0lst.h +++ b/storage/innobase/include/ut0lst.h @@ -74,6 +74,7 @@ the pointer to the node to be added to the list. NAME is the list name. */ ((N)->NAME).next = (BASE).start;\ ((N)->NAME).prev = NULL;\ if ((BASE).start != NULL) {\ + ut_ad((BASE).start != (N));\ (((BASE).start)->NAME).prev = (N);\ }\ (BASE).start = (N);\ @@ -94,6 +95,7 @@ the pointer to the node to be added to the list. NAME is the list name. */ ((N)->NAME).prev = (BASE).end;\ ((N)->NAME).next = NULL;\ if ((BASE).end != NULL) {\ + ut_ad((BASE).end != (N));\ (((BASE).end)->NAME).next = (N);\ }\ (BASE).end = (N);\ @@ -111,6 +113,7 @@ name, NODE1 and NODE2 are pointers to nodes. */ {\ ut_ad(NODE1);\ ut_ad(NODE2);\ + ut_ad((NODE1) != (NODE2));\ ((BASE).count)++;\ ((NODE2)->NAME).prev = (NODE1);\ ((NODE2)->NAME).next = ((NODE1)->NAME).next;\ diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index 84b64b146dc..93a43d9a30f 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -1162,9 +1162,7 @@ lock_rec_get_next_on_page( ulint space; ulint page_no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(lock_get_type(lock) == LOCK_REC); space = lock->un_member.rec_lock.space; @@ -1201,9 +1199,7 @@ lock_rec_get_first_on_page_addr( { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = HASH_GET_FIRST(lock_sys->rec_hash, lock_rec_hash(space, page_no)); @@ -1261,9 +1257,7 @@ lock_rec_get_first_on_page( ulint space; ulint page_no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ hash = buf_frame_get_lock_hash_val(ptr); @@ -1295,9 +1289,7 @@ lock_rec_get_next( rec_t* rec, /* in: record on a page */ lock_t* lock) /* in: lock */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(lock_get_type(lock) == LOCK_REC); if (page_rec_is_comp(rec)) { @@ -1326,9 +1318,7 @@ lock_rec_get_first( { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = lock_rec_get_first_on_page(rec); if (UNIV_LIKELY_NULL(lock)) { @@ -1414,9 +1404,7 @@ lock_rec_get_prev( ulint page_no; lock_t* found_lock = NULL; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(lock_get_type(in_lock) == LOCK_REC); space = in_lock->un_member.rec_lock.space; @@ -1456,9 +1444,7 @@ lock_table_has( { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* Look for stronger locks the same trx already has on the table */ @@ -1502,9 +1488,7 @@ lock_rec_has_expl( { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad((precise_mode & LOCK_MODE_MASK) == LOCK_S || (precise_mode & LOCK_MODE_MASK) == LOCK_X); ut_ad(!(precise_mode & LOCK_INSERT_INTENTION)); @@ -1552,9 +1536,7 @@ lock_rec_other_has_expl_req( { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(mode == LOCK_X || mode == LOCK_S); ut_ad(gap == 0 || gap == LOCK_GAP); ut_ad(wait == 0 || wait == LOCK_WAIT); @@ -1594,9 +1576,8 @@ lock_rec_other_has_conflicting( trx_t* trx) /* in: our transaction */ { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = lock_rec_get_first(rec); @@ -1629,9 +1610,7 @@ lock_rec_find_similar_on_page( lock_t* lock; ulint heap_no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ heap_no = rec_get_heap_no(rec, page_rec_is_comp(rec)); lock = lock_rec_get_first_on_page(rec); @@ -1665,9 +1644,7 @@ lock_sec_rec_some_has_impl_off_kernel( { page_t* page; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(!(index->type & DICT_CLUSTERED)); ut_ad(page_rec_is_user_rec(rec)); ut_ad(rec_offs_validate(rec, index, offsets)); @@ -1760,9 +1737,7 @@ lock_rec_create( ulint n_bits; ulint n_bytes; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ page = buf_frame_align(rec); space = buf_frame_get_space_id(page); @@ -1842,9 +1817,7 @@ lock_rec_enqueue_waiting( lock_t* lock; trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* Test if there already is some other reason to suspend thread: we do not enqueue a lock request if the query thread should be @@ -1934,9 +1907,7 @@ lock_rec_add_to_queue( ulint heap_no; ibool somebody_waits = FALSE; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad((type_mode & (LOCK_WAIT | LOCK_GAP)) || ((type_mode & LOCK_MODE_MASK) != LOCK_S) || !lock_rec_other_has_expl_req(LOCK_X, 0, LOCK_WAIT, @@ -2017,9 +1988,7 @@ lock_rec_lock_fast( ulint heap_no; trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad((LOCK_MODE_MASK & mode) != LOCK_S || lock_table_has(thr_get_trx(thr), index->table, LOCK_IS)); ut_ad((LOCK_MODE_MASK & mode) != LOCK_X @@ -2102,9 +2071,7 @@ lock_rec_lock_slow( trx_t* trx; ulint err; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad((LOCK_MODE_MASK & mode) != LOCK_S || lock_table_has(thr_get_trx(thr), index->table, LOCK_IS)); ut_ad((LOCK_MODE_MASK & mode) != LOCK_X @@ -2176,9 +2143,7 @@ lock_rec_lock( { ulint err; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad((LOCK_MODE_MASK & mode) != LOCK_S || lock_table_has(thr_get_trx(thr), index->table, LOCK_IS)); ut_ad((LOCK_MODE_MASK & mode) != LOCK_X @@ -2216,9 +2181,7 @@ lock_rec_has_to_wait_in_queue( ulint page_no; ulint heap_no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(lock_get_wait(wait_lock)); ut_ad(lock_get_type(wait_lock) == LOCK_REC); @@ -2251,9 +2214,7 @@ lock_grant( /*=======*/ lock_t* lock) /* in: waiting lock request */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock_reset_lock_and_trx_wait(lock); @@ -2298,9 +2259,7 @@ lock_rec_cancel( /*============*/ lock_t* lock) /* in: waiting record lock request */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(lock_get_type(lock) == LOCK_REC); /* Reset the bit (there can be only one set bit) in the lock bitmap */ @@ -2333,9 +2292,7 @@ lock_rec_dequeue_from_page( lock_t* lock; trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(lock_get_type(in_lock) == LOCK_REC); trx = in_lock->trx; @@ -2378,9 +2335,7 @@ lock_rec_discard( ulint page_no; trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(lock_get_type(in_lock) == LOCK_REC); trx = in_lock->trx; @@ -2409,9 +2364,7 @@ lock_rec_free_all_from_discard_page( lock_t* lock; lock_t* next_lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ space = buf_frame_get_space_id(page); page_no = buf_frame_get_page_no(page); @@ -2444,9 +2397,7 @@ lock_rec_reset_and_release_wait( lock_t* lock; ulint heap_no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ heap_no = rec_get_heap_no(rec, page_rec_is_comp(rec)); @@ -2477,9 +2428,8 @@ lock_rec_inherit_to_gap( the locks on this record */ { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = lock_rec_get_first(rec); @@ -2518,9 +2468,8 @@ lock_rec_inherit_to_gap_if_gap_lock( the locks on this record */ { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = lock_rec_get_first(rec); @@ -2554,9 +2503,7 @@ lock_rec_move( ulint heap_no; ulint type_mode; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ heap_no = rec_get_heap_no(donator, comp); @@ -3228,9 +3175,7 @@ lock_deadlock_occurs( ulint cost = 0; ut_ad(trx && lock); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ retry: /* We check that adding this trx to the waits-for graph does not produce a cycle. First mark all active transactions @@ -3302,9 +3247,7 @@ lock_deadlock_recursive( ulint ret; ut_a(trx && start && wait_lock); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (trx->deadlock_mark == 1) { /* We have already exhaustively searched the subtree starting @@ -3315,12 +3258,6 @@ lock_deadlock_recursive( *cost = *cost + 1; - if ((depth > LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK) - || (*cost > LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK)) { - - return(LOCK_VICTIM_IS_START); - } - lock = wait_lock; if (lock_get_type(wait_lock) == LOCK_REC) { @@ -3353,11 +3290,18 @@ lock_deadlock_recursive( if (lock_has_to_wait(wait_lock, lock)) { + ibool too_far + = depth > LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK + || *cost > LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK; + lock_trx = lock->trx; - if (lock_trx == start) { + if (lock_trx == start || too_far) { + /* We came back to the recursion starting - point: a deadlock detected */ + point: a deadlock detected; or we have + searched the waits-for graph too long */ + FILE* ef = lock_latest_err_file; rewind(ef); @@ -3399,9 +3343,20 @@ lock_deadlock_recursive( } #ifdef UNIV_DEBUG if (lock_print_waits) { - fputs("Deadlock detected\n", stderr); + fputs("Deadlock detected" + " or too long search\n", + stderr); } #endif /* UNIV_DEBUG */ + if (too_far) { + + fputs("TOO DEEP OR LONG SEARCH" + " IN THE LOCK TABLE" + " WAITS-FOR GRAPH\n", ef); + + return(LOCK_VICTIM_IS_START); + } + if (ut_dulint_cmp(wait_lock->trx->undo_no, start->undo_no) >= 0) { /* Our recursion starting point @@ -3472,9 +3427,7 @@ lock_table_create( lock_t* lock; ut_ad(table && trx); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (type_mode == LOCK_AUTO_INC) { /* Only one trx can have the lock on the table @@ -3519,9 +3472,7 @@ lock_table_remove_low( dict_table_t* table; trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ table = lock->un_member.tab_lock.table; trx = lock->trx; @@ -3555,9 +3506,7 @@ lock_table_enqueue_waiting( lock_t* lock; trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* Test if there already is some other reason to suspend thread: we do not enqueue a lock request if the query thread should be @@ -3630,9 +3579,7 @@ lock_table_other_has_incompatible( { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = UT_LIST_GET_LAST(table->locks); @@ -3786,9 +3733,7 @@ lock_table_dequeue( { lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_a(lock_get_type(in_lock) == LOCK_TABLE); lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, in_lock); @@ -3930,9 +3875,7 @@ lock_release_off_kernel( ulint count; lock_t* lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = UT_LIST_GET_LAST(trx->trx_locks); @@ -3993,9 +3936,7 @@ lock_cancel_waiting_and_release( /*============================*/ lock_t* lock) /* in: waiting lock request */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (lock_get_type(lock) == LOCK_REC) { @@ -4028,9 +3969,7 @@ lock_reset_all_on_table_for_trx( lock_t* lock; lock_t* prev_lock; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ lock = UT_LIST_GET_LAST(trx->trx_locks); @@ -4091,9 +4030,7 @@ lock_table_print( FILE* file, /* in: file where to print */ lock_t* lock) /* in: table type lock */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_a(lock_get_type(lock) == LOCK_TABLE); fputs("TABLE LOCK table ", file); @@ -4143,9 +4080,7 @@ lock_rec_print( ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_a(lock_get_type(lock) == LOCK_REC); space = lock->un_member.rec_lock.space; @@ -4250,9 +4185,7 @@ lock_get_n_rec_locks(void) ulint n_locks = 0; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ for (i = 0; i < hash_get_n_cells(lock_sys->rec_hash); i++) { @@ -4492,9 +4425,7 @@ lock_table_queue_validate( lock_t* lock; ibool is_waiting; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ is_waiting = FALSE; @@ -4665,9 +4596,7 @@ lock_rec_validate_page( ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ mtr_start(&mtr); @@ -4943,9 +4872,7 @@ lock_rec_convert_impl_to_expl( { trx_t* impl_trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(page_rec_is_user_rec(rec)); ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(!page_rec_is_comp(rec) == !rec_offs_comp(offsets)); diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c index 5d8875f1bd0..e9dedf6aac4 100644 --- a/storage/innobase/log/log0log.c +++ b/storage/innobase/log/log0log.c @@ -165,9 +165,7 @@ log_buf_pool_get_oldest_modification(void) { dulint lsn; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ lsn = buf_pool_get_oldest_modification(); @@ -269,9 +267,7 @@ log_write_low( ulint data_len; byte* log_block; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log->mutex))); -#endif /* UNIV_SYNC_DEBUG */ part_loop: /* Calculate a part length */ @@ -340,9 +336,7 @@ log_close(void) log_t* log = log_sys; ulint checkpoint_age; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log->mutex))); -#endif /* UNIV_SYNC_DEBUG */ lsn = log->lsn; @@ -464,9 +458,7 @@ log_group_get_capacity( /* out: capacity in bytes */ log_group_t* group) /* in: log group */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ return((group->file_size - LOG_FILE_HDR_SIZE) * group->n_files); } @@ -482,9 +474,7 @@ log_group_calc_size_offset( ulint offset, /* in: real offset within the log group */ log_group_t* group) /* in: log group */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ return(offset - LOG_FILE_HDR_SIZE * (1 + offset / group->file_size)); } @@ -500,9 +490,7 @@ log_group_calc_real_offset( ulint offset, /* in: size offset within the log group */ log_group_t* group) /* in: log group */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ return(offset + LOG_FILE_HDR_SIZE * (1 + offset / (group->file_size - LOG_FILE_HDR_SIZE))); @@ -525,9 +513,7 @@ log_group_calc_lsn_offset( ib_longlong group_size; ib_longlong offset; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* If total log file size is > 2 GB we can easily get overflows with 32-bit integers. Use 64-bit integers instead. */ @@ -642,9 +628,7 @@ log_calc_max_ages(void) ulint archive_margin; ulint smallest_archive_margin; -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ mutex_enter(&(log_sys->mutex)); @@ -942,9 +926,7 @@ log_flush_do_unlocks( ulint code) /* in: any ORed combination of LOG_UNLOCK_FLUSH_LOCK and LOG_UNLOCK_NONE_FLUSHED_LOCK */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* NOTE that we must own the log mutex when doing the setting of the events: this is because transactions will wait for these events to @@ -976,9 +958,7 @@ log_group_check_flush_completion( /* out: LOG_UNLOCK_NONE_FLUSHED_LOCK or 0 */ log_group_t* group) /* in: log group */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (!log_sys->one_flushed && group->n_pending_writes == 0) { #ifdef UNIV_DEBUG @@ -1015,9 +995,7 @@ log_sys_check_flush_completion(void) ulint move_start; ulint move_end; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (log_sys->n_pending_writes == 0) { @@ -1129,10 +1107,8 @@ log_group_file_header_flush( { byte* buf; ulint dest_offset; -#ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ + ut_ad(mutex_own(&(log_sys->mutex))); ut_a(nth_file < group->n_files); buf = *(group->file_header_bufs + nth_file); @@ -1203,9 +1179,7 @@ log_group_write_buf( ulint next_offset; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(len % OS_FILE_LOG_BLOCK_SIZE == 0); ut_a(ut_dulint_get_low(start_lsn) % OS_FILE_LOG_BLOCK_SIZE == 0); @@ -1626,9 +1600,7 @@ void log_complete_checkpoint(void) /*=========================*/ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(log_sys->n_pending_checkpoint_writes == 0); log_sys->next_checkpoint_no @@ -1715,9 +1687,7 @@ log_group_checkpoint( byte* buf; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ #if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE # error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE" #endif @@ -1882,9 +1852,7 @@ log_group_read_checkpoint_info( log_group_t* group, /* in: log group */ ulint field) /* in: LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2 */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ log_sys->n_log_ios++; @@ -1902,9 +1870,7 @@ log_groups_write_checkpoint_info(void) { log_group_t* group; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ group = UT_LIST_GET_FIRST(log_sys->log_groups); @@ -2162,9 +2128,7 @@ log_group_read_log_seg( ulint source_offset; ibool sync; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ sync = FALSE; @@ -2237,9 +2201,7 @@ log_group_archive_file_header_write( byte* buf; ulint dest_offset; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(nth_file < group->n_files); @@ -2276,9 +2238,7 @@ log_group_archive_completed_header_write( byte* buf; ulint dest_offset; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_a(nth_file < group->n_files); buf = *(group->archive_file_header_bufs + nth_file); @@ -2317,9 +2277,7 @@ log_group_archive( ulint n_files; ulint open_mode; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ start_lsn = log_sys->archived_lsn; @@ -2452,9 +2410,7 @@ log_archive_groups(void) { log_group_t* group; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ group = UT_LIST_GET_FIRST(log_sys->log_groups); @@ -2477,9 +2433,7 @@ log_archive_write_complete_groups(void) dulint end_lsn; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ group = UT_LIST_GET_FIRST(log_sys->log_groups); @@ -2546,9 +2500,7 @@ void log_archive_check_completion_low(void) /*==================================*/ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (log_sys->n_pending_archive_ios == 0 && log_sys->archiving_phase == LOG_ARCHIVE_READ) { @@ -2784,9 +2736,7 @@ log_archive_close_groups( log_group_t* group; ulint trunc_len; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (log_sys->archiving_state == LOG_ARCH_OFF) { @@ -3278,9 +3228,7 @@ log_check_log_recs( byte* buf1; byte* scan_buf; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (len == 0) { @@ -3322,7 +3270,7 @@ log_peek_lsn( log system mutex */ dulint* lsn) /* out: if returns TRUE, current lsn is here */ { - if (0 == mutex_enter_nowait(&(log_sys->mutex), __FILE__, __LINE__)) { + if (0 == mutex_enter_nowait(&(log_sys->mutex))) { *lsn = log_sys->lsn; mutex_exit(&(log_sys->mutex)); diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c index 41e2b921664..ab5f42e3a13 100644 --- a/storage/innobase/log/log0recv.c +++ b/storage/innobase/log/log0recv.c @@ -171,9 +171,8 @@ void recv_sys_empty_hash(void) /*=====================*/ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(recv_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ + if (recv_sys->n_addrs != 0) { fprintf(stderr, "InnoDB: Error: %lu pages with log records" @@ -1396,9 +1395,8 @@ loop: goto loop; } -#ifdef UNIV_SYNC_DEBUG ut_ad(!allow_ibuf == mutex_own(&log_sys->mutex)); -#endif /* UNIV_SYNC_DEBUG */ + if (!allow_ibuf) { recv_no_ibuf_operations = TRUE; } @@ -1842,9 +1840,7 @@ recv_parse_log_recs( byte* body; ulint n_recs; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(!ut_dulint_is_zero(recv_sys->parse_start_lsn)); loop: ptr = recv_sys->buf + recv_sys->recovered_offset; @@ -2894,9 +2890,8 @@ recv_reset_logs( { log_group_t* group; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(log_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ + log_sys->lsn = ut_dulint_align_up(lsn, OS_FILE_LOG_BLOCK_SIZE); group = UT_LIST_GET_FIRST(log_sys->log_groups); diff --git a/storage/innobase/mem/mem0pool.c b/storage/innobase/mem/mem0pool.c index a7acd331e16..c010ae61160 100644 --- a/storage/innobase/mem/mem0pool.c +++ b/storage/innobase/mem/mem0pool.c @@ -257,9 +257,7 @@ mem_pool_fill_free_list( mem_area_t* area2; ibool ret; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(pool->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (i >= 63) { /* We come here when we have run out of space in the diff --git a/storage/innobase/pars/pars0pars.c b/storage/innobase/pars/pars0pars.c index 6861844870c..16530494a96 100644 --- a/storage/innobase/pars/pars0pars.c +++ b/storage/innobase/pars/pars0pars.c @@ -1859,10 +1859,9 @@ pars_sql( heap = mem_heap_create(256); -#ifdef UNIV_SYNC_DEBUG /* Currently, the parser is not reentrant: */ ut_ad(mutex_own(&(dict_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ + pars_sym_tab_global = sym_tab_create(heap); pars_sym_tab_global->string_len = strlen(str); diff --git a/storage/innobase/que/que0que.c b/storage/innobase/que/que0que.c index f5a63ae6ffa..bf83f28f04e 100644 --- a/storage/innobase/que/que0que.c +++ b/storage/innobase/que/que0que.c @@ -127,9 +127,7 @@ que_graph_publish( que_t* graph, /* in: graph */ sess_t* sess) /* in: session */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ UT_LIST_ADD_LAST(graphs, sess->graphs, graph); } @@ -238,9 +236,7 @@ que_thr_end_wait( { ibool was_active; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(thr); ut_ad((thr->state == QUE_THR_LOCK_WAIT) || (thr->state == QUE_THR_PROCEDURE_WAIT) @@ -280,9 +276,7 @@ que_thr_end_wait_no_next_thr( ut_a(thr->state == QUE_THR_LOCK_WAIT); /* In MySQL this is the only possible state here */ -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(thr); ut_ad((thr->state == QUE_THR_LOCK_WAIT) || (thr->state == QUE_THR_PROCEDURE_WAIT) @@ -419,9 +413,7 @@ que_fork_error_handle( { que_thr_t* thr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(trx->sess->state == SESS_ERROR); ut_ad(UT_LIST_GET_LEN(trx->reply_signals) == 0); ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0); @@ -698,9 +690,7 @@ que_graph_try_free( { sess_t* sess; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ sess = (graph->trx)->sess; @@ -931,9 +921,7 @@ que_thr_stop( que_t* graph; ibool ret = TRUE; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ graph = thr->graph; trx = graph->trx; @@ -1309,10 +1297,7 @@ que_run_threads_low( ut_ad(thr->state == QUE_THR_RUNNING); ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS); - -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* cumul_resource counts how much resources the OS thread (NOT the query thread) has spent in this function */ diff --git a/storage/innobase/read/read0read.c b/storage/innobase/read/read0read.c index 2375c35190a..10a6e07e96a 100644 --- a/storage/innobase/read/read0read.c +++ b/storage/innobase/read/read0read.c @@ -162,9 +162,8 @@ read_view_oldest_copy_or_open_new( ulint n; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + old_view = UT_LIST_GET_LAST(trx_sys->view_list); if (old_view == NULL) { @@ -245,9 +244,9 @@ read_view_open_now( read_view_t* view; trx_t* trx; ulint n; -#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + view = read_view_create_low(UT_LIST_GET_LEN(trx_sys->trx_list), heap); view->creator_trx_id = cr_trx_id; @@ -313,9 +312,8 @@ read_view_close( /*============*/ read_view_t* view) /* in: read view */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + UT_LIST_REMOVE(view_list, trx_sys->view_list, view); } diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 78851c7b4f9..7c9427db0d2 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -1748,8 +1748,8 @@ row_create_table_for_mysql( ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); - ut_ad(mutex_own(&(dict_sys->mutex))); #endif /* UNIV_SYNC_DEBUG */ + ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH); if (srv_created_new_raw) { @@ -1964,8 +1964,8 @@ row_create_index_for_mysql( #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); - ut_ad(mutex_own(&(dict_sys->mutex))); #endif /* UNIV_SYNC_DEBUG */ + ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); trx->op_info = "creating index"; @@ -2080,8 +2080,8 @@ row_table_add_foreign_constraints( { ulint err; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ ut_a(sql_string); @@ -2246,9 +2246,7 @@ row_get_background_drop_list_len_low(void) /*======================================*/ /* out: how many tables in list */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (!row_mysql_drop_list_inited) { @@ -2726,8 +2724,8 @@ row_truncate_table_for_mysql( row_mysql_lock_data_dictionary(trx); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ @@ -3001,8 +2999,8 @@ row_drop_table_for_mysql( locked_dictionary = TRUE; } -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(dict_sys->mutex))); +#ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); #endif /* UNIV_SYNC_DEBUG */ diff --git a/storage/innobase/row/row0vers.c b/storage/innobase/row/row0vers.c index c8b71965f75..03d9a2f1203 100644 --- a/storage/innobase/row/row0vers.c +++ b/storage/innobase/row/row0vers.c @@ -63,8 +63,8 @@ row_vers_impl_x_locked_off_kernel( mtr_t mtr; ulint comp; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); +#ifdef UNIV_SYNC_DEBUG ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED)); #endif /* UNIV_SYNC_DEBUG */ diff --git a/storage/innobase/srv/srv0que.c b/storage/innobase/srv/srv0que.c index 9c261cbb00e..e2b4e217980 100644 --- a/storage/innobase/srv/srv0que.c +++ b/storage/innobase/srv/srv0que.c @@ -82,10 +82,7 @@ srv_que_task_enqueue_low( que_thr_t* thr) /* in: query thread */ { ut_ad(thr); - -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr); diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 2a177ed26cd..72e8fe751d0 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -726,9 +726,7 @@ srv_suspend_thread(void) ulint slot_no; ulint type; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ slot_no = thr_local_get_slot_no(os_thread_get_curr_id()); @@ -780,9 +778,7 @@ srv_release_threads( ut_ad(type >= SRV_WORKER); ut_ad(type <= SRV_MASTER); ut_ad(n > 0); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ for (i = 0; i < OS_THREAD_MAX_N; i++) { @@ -1305,9 +1301,7 @@ srv_table_reserve_slot_for_mysql(void) srv_slot_t* slot; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ i = 0; slot = srv_mysql_table + i; @@ -1387,9 +1381,7 @@ srv_suspend_mysql_thread( ulint sec; ulint ms; -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ trx = thr_get_trx(thr); @@ -1535,9 +1527,7 @@ srv_release_mysql_thread_if_suspended( srv_slot_t* slot; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ for (i = 0; i < OS_THREAD_MAX_N; i++) { @@ -1830,15 +1820,15 @@ srv_export_innodb_status(void) export_vars.innodb_row_lock_waits = srv_n_lock_wait_count; export_vars.innodb_row_lock_current_waits = srv_n_lock_wait_current_count; - export_vars.innodb_row_lock_time = srv_n_lock_wait_time / 10000; + export_vars.innodb_row_lock_time = srv_n_lock_wait_time / 1000; if (srv_n_lock_wait_count > 0) { export_vars.innodb_row_lock_time_avg = (ulint) - (srv_n_lock_wait_time / 10000 / srv_n_lock_wait_count); + (srv_n_lock_wait_time / 1000 / srv_n_lock_wait_count); } else { export_vars.innodb_row_lock_time_avg = 0; } export_vars.innodb_row_lock_time_max - = srv_n_lock_max_wait_time / 10000; + = srv_n_lock_max_wait_time / 1000; export_vars.innodb_rows_read = srv_n_rows_read; export_vars.innodb_rows_inserted = srv_n_rows_inserted; export_vars.innodb_rows_updated = srv_n_rows_updated; diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index f06db577bad..34b45e2c1c3 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -339,9 +339,8 @@ rw_lock_x_lock_low( const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(rw_lock_get_mutex(lock))); -#endif /* UNIV_SYNC_DEBUG */ + if (rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED) { if (rw_lock_get_reader_count(lock) == 0) { @@ -564,8 +563,7 @@ rw_lock_debug_mutex_enter(void) /*==========================*/ { loop: - if (0 == mutex_enter_nowait(&rw_lock_debug_mutex, - __FILE__, __LINE__)) { + if (0 == mutex_enter_nowait(&rw_lock_debug_mutex)) { return; } @@ -573,8 +571,7 @@ loop: rw_lock_debug_waiters = TRUE; - if (0 == mutex_enter_nowait(&rw_lock_debug_mutex, - __FILE__, __LINE__)) { + if (0 == mutex_enter_nowait(&rw_lock_debug_mutex)) { return; } diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index c0198469491..672e1f93aad 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -311,12 +311,13 @@ mutex_free( } /************************************************************************ -Tries to lock the mutex for the current thread. If the lock is not acquired -immediately, returns with return value 1. */ +NOTE! Use the corresponding macro in the header file, not this function +directly. Tries to lock the mutex for the current thread. If the lock is not +acquired immediately, returns with return value 1. */ ulint -mutex_enter_nowait( -/*===============*/ +mutex_enter_nowait_func( +/*====================*/ /* out: 0 if succeed, 1 if not */ mutex_t* mutex, /* in: pointer to mutex */ const char* file_name __attribute__((unused)), @@ -329,6 +330,7 @@ mutex_enter_nowait( if (!mutex_test_and_set(mutex)) { + ut_d(mutex->thread_id = os_thread_get_curr_id()); #ifdef UNIV_SYNC_DEBUG mutex_set_debug_info(mutex, file_name, line); #endif @@ -346,13 +348,29 @@ Checks that the mutex has been initialized. */ ibool mutex_validate( /*===========*/ - mutex_t* mutex) + const mutex_t* mutex) { ut_a(mutex); ut_a(mutex->magic_n == MUTEX_MAGIC_N); return(TRUE); } + +/********************************************************************** +Checks that the current thread owns the mutex. Works only in the debug +version. */ + +ibool +mutex_own( +/*======*/ + /* out: TRUE if owns */ + const mutex_t* mutex) /* in: mutex */ +{ + ut_ad(mutex_validate(mutex)); + + return(mutex_get_lock_word(mutex) == 1 + && os_thread_eq(mutex->thread_id, os_thread_get_curr_id())); +} #endif /* UNIV_DEBUG */ /********************************************************************** @@ -451,6 +469,7 @@ spin_loop: if (mutex_test_and_set(mutex) == 0) { /* Succeeded! */ + ut_d(mutex->thread_id = os_thread_get_curr_id()); #ifdef UNIV_SYNC_DEBUG mutex_set_debug_info(mutex, file_name, line); #endif @@ -492,6 +511,7 @@ spin_loop: sync_array_free_cell_protected(sync_primary_wait_array, index); + ut_d(mutex->thread_id = os_thread_get_curr_id()); #ifdef UNIV_SYNC_DEBUG mutex_set_debug_info(mutex, file_name, line); #endif @@ -592,7 +612,6 @@ mutex_set_debug_info( mutex->file_name = file_name; mutex->line = line; - mutex->thread_id = os_thread_get_curr_id(); } /********************************************************************** @@ -614,31 +633,6 @@ mutex_get_debug_info( *thread_id = mutex->thread_id; } -/********************************************************************** -Checks that the current thread owns the mutex. Works only in the debug -version. */ - -ibool -mutex_own( -/*======*/ - /* out: TRUE if owns */ - mutex_t* mutex) /* in: mutex */ -{ - ut_ad(mutex_validate(mutex)); - - if (mutex_get_lock_word(mutex) != 1) { - - return(FALSE); - } - - if (!os_thread_eq(mutex->thread_id, os_thread_get_curr_id())) { - - return(FALSE); - } - - return(TRUE); -} - /********************************************************************** Prints debug info of currently reserved mutexes. */ static diff --git a/storage/innobase/thr/thr0loc.c b/storage/innobase/thr/thr0loc.c index f22e909f392..b803bd53101 100644 --- a/storage/innobase/thr/thr0loc.c +++ b/storage/innobase/thr/thr0loc.c @@ -64,9 +64,7 @@ thr_local_get( try_again: ut_ad(thr_local_hash); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&thr_local_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* Look for the local struct in the hash table */ diff --git a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c index 11e089ac90e..25519a09a1d 100644 --- a/storage/innobase/trx/trx0purge.c +++ b/storage/innobase/trx/trx0purge.c @@ -197,9 +197,7 @@ void trx_purge_sys_create(void) /*======================*/ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ purge_sys = mem_alloc(sizeof(trx_purge_t)); @@ -260,9 +258,8 @@ trx_purge_add_update_undo_to_history( ut_ad(undo); rseg = undo->rseg; -#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr); @@ -341,9 +338,7 @@ trx_purge_free_segment( /* fputs("Freeing an update undo log segment\n", stderr); */ -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(purge_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ loop: mtr_start(&mtr); mutex_enter(&(rseg->mutex)); @@ -445,9 +440,7 @@ trx_purge_truncate_rseg_history( ulint n_removed_logs = 0; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(purge_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ mtr_start(&mtr); mutex_enter(&(rseg->mutex)); @@ -537,9 +530,7 @@ trx_purge_truncate_history(void) dulint limit_trx_no; dulint limit_undo_no; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(purge_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx_purge_arr_get_biggest(purge_sys->arr, &limit_trx_no, &limit_undo_no); @@ -579,9 +570,7 @@ trx_purge_truncate_if_arr_empty(void) /*=================================*/ /* out: TRUE if array empty */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(purge_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (purge_sys->arr->n_used == 0) { @@ -610,9 +599,7 @@ trx_purge_rseg_get_next_history_log( ibool del_marks; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(purge_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ mutex_enter(&(rseg->mutex)); @@ -715,9 +702,7 @@ trx_purge_choose_next_log(void) ulint offset = 0; /* remove warning (??? bug ???) */ mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(purge_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(purge_sys->next_stored == FALSE); rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list); @@ -818,9 +803,7 @@ trx_purge_get_next_rec( ulint cmpl_info; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(purge_sys->mutex))); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(purge_sys->next_stored); space = purge_sys->rseg->space; diff --git a/storage/innobase/trx/trx0roll.c b/storage/innobase/trx/trx0roll.c index 201d1be3656..91dcf035f96 100644 --- a/storage/innobase/trx/trx0roll.c +++ b/storage/innobase/trx/trx0roll.c @@ -785,10 +785,8 @@ trx_roll_try_truncate( dulint limit; dulint biggest; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(trx->undo_mutex))); ut_ad(mutex_own(&((trx->rseg)->mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx->pages_undone = 0; @@ -831,9 +829,7 @@ trx_roll_pop_top_rec( trx_undo_rec_t* prev_rec; page_t* prev_rec_page; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(trx->undo_mutex))); -#endif /* UNIV_SYNC_DEBUG */ undo_page = trx_undo_page_get_s_latched(undo->space, undo->top_page_no, mtr); @@ -1060,9 +1056,7 @@ trx_rollback( que_thr_t* thr; /* que_thr_t* thr2; */ -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad((trx->undo_no_arr == NULL) || ((trx->undo_no_arr)->n_used == 0)); /* Initialize the rollback field in the transaction */ @@ -1131,9 +1125,7 @@ trx_roll_graph_build( que_thr_t* thr; /* que_thr_t* thr2; */ -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ heap = mem_heap_create(512); fork = que_fork_create(NULL, NULL, QUE_FORK_ROLLBACK, heap); @@ -1160,9 +1152,7 @@ trx_finish_error_processing( trx_sig_t* sig; trx_sig_t* next_sig; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ sig = UT_LIST_GET_FIRST(trx->signals); @@ -1195,9 +1185,7 @@ trx_finish_partial_rollback_off_kernel( { trx_sig_t* sig; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ sig = UT_LIST_GET_FIRST(trx->signals); @@ -1228,9 +1216,7 @@ trx_finish_rollback_off_kernel( trx_sig_t* sig; trx_sig_t* next_sig; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_a(trx->undo_no_arr == NULL || trx->undo_no_arr->n_used == 0); diff --git a/storage/innobase/trx/trx0rseg.c b/storage/innobase/trx/trx0rseg.c index 7a6989c7b4f..020f217c90b 100644 --- a/storage/innobase/trx/trx0rseg.c +++ b/storage/innobase/trx/trx0rseg.c @@ -60,9 +60,7 @@ trx_rseg_header_create( page_t* page; ut_ad(mtr); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(mtr_memo_contains(mtr, fil_space_get_latch(space), MTR_MEMO_X_LOCK)); sys_header = trx_sysf_get(mtr); @@ -138,9 +136,7 @@ trx_rseg_mem_create( ulint sum_of_undo_sizes; ulint len; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ rseg = mem_alloc(sizeof(trx_rseg_t)); diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c index b87f3d5e090..307a03bfbc3 100644 --- a/storage/innobase/trx/trx0sys.c +++ b/storage/innobase/trx/trx0sys.c @@ -547,9 +547,7 @@ trx_in_trx_list( { trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ trx = UT_LIST_GET_FIRST(trx_sys->trx_list); @@ -576,9 +574,7 @@ trx_sys_flush_max_trx_id(void) trx_sysf_t* sys_header; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ mtr_start(&mtr); @@ -799,9 +795,7 @@ trx_sysf_rseg_find_free( ulint page_no; ulint i; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); -#endif /* UNIV_SYNC_DEBUG */ sys_header = trx_sysf_get(mtr); diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index 6f59d2659ec..2f0c25c323a 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -101,9 +101,7 @@ trx_create( { trx_t* trx; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ trx = mem_alloc(sizeof(trx_t)); @@ -280,9 +278,7 @@ trx_free( /*=====*/ trx_t* trx) /* in, own: trx object */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (trx->declared_to_be_inside_innodb) { ut_print_timestamp(stderr); @@ -406,9 +402,7 @@ trx_list_insert_ordered( { trx_t* trx2; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ trx2 = UT_LIST_GET_FIRST(trx_sys->trx_list); @@ -633,9 +627,7 @@ trx_assign_rseg(void) { trx_rseg_t* rseg = trx_sys->latest_rseg; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ loop: /* Get next rseg in a round-robin fashion */ @@ -672,9 +664,7 @@ trx_start_low( { trx_rseg_t* rseg; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(trx->rseg == NULL); if (trx->type == TRX_PURGE) { @@ -749,9 +739,7 @@ trx_commit_off_kernel( ibool must_flush_log = FALSE; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ trx->must_flush_log_later = FALSE; @@ -851,9 +839,7 @@ trx_commit_off_kernel( ut_ad(trx->conc_state == TRX_ACTIVE || trx->conc_state == TRX_PREPARED); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /* The following assignment makes the transaction committed in memory and makes its changes to data visible to other transactions. @@ -1036,9 +1022,7 @@ trx_handle_commit_sig_off_kernel( trx_sig_t* sig; trx_sig_t* next_sig; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ trx->que_state = TRX_QUE_COMMITTING; @@ -1078,9 +1062,7 @@ trx_end_lock_wait( { que_thr_t* thr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT); thr = UT_LIST_GET_FIRST(trx->wait_thrs); @@ -1107,9 +1089,7 @@ trx_lock_wait_to_suspended( { que_thr_t* thr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT); thr = UT_LIST_GET_FIRST(trx->wait_thrs); @@ -1137,9 +1117,7 @@ trx_sig_reply_wait_to_suspended( trx_sig_t* sig; que_thr_t* thr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ sig = UT_LIST_GET_FIRST(trx->reply_signals); @@ -1172,9 +1150,7 @@ trx_sig_is_compatible( { trx_sig_t* sig; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (UT_LIST_GET_LEN(trx->signals) == 0) { @@ -1260,9 +1236,7 @@ trx_sig_send( trx_t* receiver_trx; ut_ad(trx); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (!trx_sig_is_compatible(trx, type, sender)) { /* The signal is not compatible with the other signals in @@ -1332,9 +1306,7 @@ trx_end_signal_handling( /*====================*/ trx_t* trx) /* in: trx */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(trx->handling_signals == TRUE); trx->handling_signals = FALSE; @@ -1368,9 +1340,7 @@ loop: we can process immediately */ ut_ad(trx); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (trx->handling_signals && (UT_LIST_GET_LEN(trx->signals) == 0)) { @@ -1471,9 +1441,7 @@ trx_sig_reply( trx_t* receiver_trx; ut_ad(sig); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ if (sig->receiver != NULL) { ut_ad((sig->receiver)->state == QUE_THR_SIG_REPLY_WAIT); @@ -1501,9 +1469,7 @@ trx_sig_remove( trx_sig_t* sig) /* in, own: signal */ { ut_ad(trx && sig); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(sig->receiver == NULL); @@ -1820,9 +1786,7 @@ trx_prepare_off_kernel( dulint lsn; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ rseg = trx->rseg; @@ -1868,9 +1832,7 @@ trx_prepare_off_kernel( mutex_enter(&kernel_mutex); } -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ /*--------------------------------------*/ trx->conc_state = TRX_PREPARED; diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c index fbcfab38f01..831e337f513 100644 --- a/storage/innobase/trx/trx0undo.c +++ b/storage/innobase/trx/trx0undo.c @@ -395,9 +395,7 @@ trx_undo_seg_create( ibool success; ut_ad(mtr && id && rseg_hdr); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ /* fputs(type == TRX_UNDO_INSERT ? "Creating insert undo log segment\n" @@ -836,11 +834,9 @@ trx_undo_add_page( ulint n_reserved; ibool success; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(trx->undo_mutex))); ut_ad(!mutex_own(&kernel_mutex)); ut_ad(mutex_own(&(trx->rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ rseg = trx->rseg; @@ -911,10 +907,8 @@ trx_undo_free_page( ulint hist_size; ut_a(hdr_page_no != page_no); -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ undo_page = trx_undo_page_get(space, page_no, mtr); @@ -961,9 +955,7 @@ trx_undo_free_page_in_rollback( ulint last_page_no; ut_ad(undo->hdr_page_no != page_no); -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(trx->undo_mutex))); -#endif /* UNIV_SYNC_DEBUG */ last_page_no = trx_undo_free_page(undo->rseg, FALSE, undo->space, undo->hdr_page_no, page_no, mtr); @@ -1016,10 +1008,8 @@ trx_undo_truncate_end( trx_rseg_t* rseg; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(trx->undo_mutex))); ut_ad(mutex_own(&(trx->rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ rseg = trx->rseg; @@ -1096,9 +1086,7 @@ trx_undo_truncate_start( ulint page_no; mtr_t mtr; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (0 == ut_dulint_cmp(limit, ut_dulint_zero)) { @@ -1164,9 +1152,9 @@ trx_undo_seg_free( while (!finished) { mtr_start(&mtr); -#ifdef UNIV_SYNC_DEBUG + ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + mutex_enter(&(rseg->mutex)); seg_header = trx_undo_page_get(undo->space, undo->hdr_page_no, @@ -1389,9 +1377,7 @@ trx_undo_mem_create( { trx_undo_t* undo; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (id >= TRX_RSEG_N_SLOTS) { fprintf(stderr, @@ -1437,11 +1423,9 @@ trx_undo_mem_init_for_reuse( XID* xid, /* in: X/Open XA transaction identification*/ ulint offset) /* in: undo log header byte offset on page */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&((undo->rseg)->mutex))); -#endif /* UNIV_SYNC_DEBUG */ - if (undo->id >= TRX_RSEG_N_SLOTS) { + if (UNIV_UNLIKELY(undo->id >= TRX_RSEG_N_SLOTS)) { fprintf(stderr, "InnoDB: Error: undo->id is %lu\n", (ulong) undo->id); @@ -1501,9 +1485,7 @@ trx_undo_create( trx_undo_t* undo; page_t* undo_page; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (rseg->curr_size == rseg->max_size) { @@ -1561,9 +1543,7 @@ trx_undo_reuse_cached( page_t* undo_page; ulint offset; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ if (type == TRX_UNDO_INSERT) { @@ -1671,15 +1651,12 @@ trx_undo_assign_undo( rseg = trx->rseg; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(trx->undo_mutex))); -#endif /* UNIV_SYNC_DEBUG */ mtr_start(&mtr); -#ifdef UNIV_SYNC_DEBUG ut_ad(!mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + mutex_enter(&(rseg->mutex)); undo = trx_undo_reuse_cached(trx, rseg, type, trx->id, &trx->xid, @@ -1836,9 +1813,8 @@ trx_undo_update_cleanup( undo = trx->update_undo; rseg = trx->rseg; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(rseg->mutex))); -#endif /* UNIV_SYNC_DEBUG */ + trx_purge_add_update_undo_to_history(trx, undo_page, mtr); UT_LIST_REMOVE(undo_list, rseg->update_undo_list, undo); diff --git a/storage/innobase/usr/usr0sess.c b/storage/innobase/usr/usr0sess.c index ca97ea23e95..3740c05eaab 100644 --- a/storage/innobase/usr/usr0sess.c +++ b/storage/innobase/usr/usr0sess.c @@ -32,9 +32,8 @@ sess_open(void) { sess_t* sess; -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + sess = mem_alloc(sizeof(sess_t)); sess->state = SESS_ACTIVE; @@ -54,9 +53,7 @@ sess_close( /*=======*/ sess_t* sess) /* in, own: session object */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ ut_ad(sess->trx == NULL); mem_free(sess); @@ -72,9 +69,8 @@ sess_try_close( /* out: TRUE if closed */ sess_t* sess) /* in, own: session object */ { -#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); -#endif /* UNIV_SYNC_DEBUG */ + if (UT_LIST_GET_LEN(sess->graphs) == 0) { sess_close(sess); diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c index d805cc3b4b2..bc6778f4c2f 100644 --- a/storage/innobase/ut/ut0ut.c +++ b/storage/innobase/ut/ut0ut.c @@ -20,6 +20,55 @@ Created 5/11/1994 Heikki Tuuri ibool ut_always_false = FALSE; +#ifdef __WIN__ +/********************************************************************* +NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix +epoch starts from 1970/1/1. For selection of constant see: +http://support.microsoft.com/kb/167296/ */ +#define WIN_TO_UNIX_DELTA_USEC ((ib_longlong) 11644473600000000ULL) + + +/********************************************************************* +This is the Windows version of gettimeofday(2).*/ +static +int +ut_gettimeofday( +/*============*/ + /* out: 0 if all OK else -1 */ + struct timeval* tv, /* out: Values are relative to Unix epoch */ + void* tz) /* in: not used */ +{ + FILETIME ft; + ib_longlong tm; + + if (!tv) { + errno = EINVAL; + return(-1); + } + + GetSystemTimeAsFileTime(&ft); + + tm = (ib_longlong) ft.dwHighDateTime << 32; + tm |= ft.dwLowDateTime; + + ut_a(tm >= 0); /* If tm wraps over to negative, the quotient / 10 + does not work */ + + tm /= 10; /* Convert from 100 nsec periods to usec */ + + /* If we don't convert to the Unix epoch the value for + struct timeval::tv_sec will overflow.*/ + tm -= WIN_TO_UNIX_DELTA_USEC; + + tv->tv_sec = (long) (tm / 1000000L); + tv->tv_usec = (long) (tm % 1000000L); + + return(0); +} +#else +#define ut_gettimeofday gettimeofday +#endif + #ifndef UNIV_HOTBACKUP /********************************************************************* Display an SQL identifier. @@ -85,17 +134,11 @@ ut_usectime( ulint* sec, /* out: seconds since the Epoch */ ulint* ms) /* out: microseconds since the Epoch+*sec */ { -#ifdef __WIN__ - SYSTEMTIME st; - GetLocalTime(&st); - *sec = (ulint) st.wSecond; - *ms = (ulint) st.wMilliseconds; -#else struct timeval tv; - gettimeofday(&tv,NULL); + + ut_gettimeofday(&tv, NULL); *sec = (ulint) tv.tv_sec; *ms = (ulint) tv.tv_usec; -#endif } /************************************************************** From 46914b213b433fa1fc5d9eba95ec93c54909ff71 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2007 20:36:58 -0400 Subject: [PATCH 315/789] additional changes to merge fix for bug 26346 --- client/mysqldump.c | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 6fcb143d2c9..4b358296759 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1486,10 +1486,7 @@ static uint dump_events_for_db(char *db) mysql_query(mysql, "LOCK TABLES mysql.event READ"); if (mysql_query_with_error_report(mysql, &event_list_res, "show events")) - { - safe_exit(EX_MYSQLERR); DBUG_RETURN(0); - } strcpy(delimiter, ";"); if (mysql_num_rows(event_list_res) > 0) @@ -2928,25 +2925,25 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables) mysql_real_escape_string(mysql, name_buff, db, strlen(db)); - init_dynamic_string(&where, " AND TABLESPACE_NAME IN (" + init_dynamic_string_checked(&where, " AND TABLESPACE_NAME IN (" "SELECT DISTINCT TABLESPACE_NAME FROM" " INFORMATION_SCHEMA.PARTITIONS" " WHERE" " TABLE_SCHEMA='", 256, 1024); - dynstr_append(&where, name_buff); - dynstr_append(&where, "' AND TABLE_NAME IN ("); + dynstr_append_checked(&where, name_buff); + dynstr_append_checked(&where, "' AND TABLE_NAME IN ("); for (i=0 ; i Date: Fri, 23 Mar 2007 15:25:58 +1100 Subject: [PATCH 316/789] WL#3704 mgmapi timeouts: fix compile warning storage/ndb/src/mgmapi/mgmapi.cpp: fix compile warning - signed and unsigned comparison --- storage/ndb/src/mgmapi/mgmapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index 35c591ddf3d..b1a555872eb 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -483,7 +483,7 @@ extern "C" int ndb_mgm_number_of_mgmd_in_connect_string(NdbMgmHandle handle) { int count=0; - int i; + Uint32 i; LocalConfig &cfg= handle->cfg; for (i = 0; i < cfg.ids.size(); i++) From 49383e87c6cc76a70523634ab0c4655ed7688107 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 10:16:30 +0400 Subject: [PATCH 317/789] fixes to make embedded-server test working mysql-test/r/view.result: result fixed mysql-test/r/view_grant.result: result fixed mysql-test/t/query_cache_sql_prepare.test: test fixed mysql-test/t/view.test: moved to view_grant mysql-test/t/view_grant.test: moved here from view.test --- mysql-test/r/view.result | 32 ---------------------- mysql-test/r/view_grant.result | 33 +++++++++++++++++++++++ mysql-test/t/query_cache_sql_prepare.test | 2 +- mysql-test/t/view.test | 25 ----------------- mysql-test/t/view_grant.test | 27 +++++++++++++++++++ 5 files changed, 61 insertions(+), 58 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 9d20a8a16c7..0fa7cda1187 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3321,36 +3321,4 @@ DROP TABLE `t-2`; DROP VIEW `v-2`; DROP DATABASE `d-1`; USE test; -DROP VIEW IF EXISTS v1; -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (i INT); -CREATE VIEW v1 AS SELECT * FROM t1; -ALTER VIEW v1 AS SELECT * FROM t1; -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` -ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1; -Warnings: -Note 1449 There is no 'no_such'@'user_1' registered -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` -Warnings: -Note 1449 There is no 'no_such'@'user_1' registered -ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` -Warnings: -Note 1449 There is no 'no_such'@'user_1' registered -ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; -Warnings: -Note 1449 There is no 'no_such'@'user_2' registered -SHOW CREATE VIEW v1; -View Create View -v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` -Warnings: -Note 1449 There is no 'no_such'@'user_2' registered -DROP VIEW v1; -DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index a8770bdac41..2a0bedc1443 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -797,3 +797,36 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI DROP USER u26813@localhost; DROP DATABASE db26813; End of 5.0 tests. +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT); +CREATE VIEW v1 AS SELECT * FROM t1; +ALTER VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1; +Warnings: +Note 1449 There is no 'no_such'@'user_1' registered +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +Warnings: +Note 1449 There is no 'no_such'@'user_1' registered +ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +Warnings: +Note 1449 There is no 'no_such'@'user_1' registered +ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; +Warnings: +Note 1449 There is no 'no_such'@'user_2' registered +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` +Warnings: +Note 1449 There is no 'no_such'@'user_2' registered +DROP VIEW v1; +DROP TABLE t1; +End of 5.1 tests. diff --git a/mysql-test/t/query_cache_sql_prepare.test b/mysql-test/t/query_cache_sql_prepare.test index 69b504e2fd1..98141153002 100644 --- a/mysql-test/t/query_cache_sql_prepare.test +++ b/mysql-test/t/query_cache_sql_prepare.test @@ -5,7 +5,7 @@ -- source include/have_query_cache.inc -connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (con1,localhost,root,,test,$MASTER_MYPORT,); connection default; set global query_cache_size=100000; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 026a08bf365..4961d95d0ac 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3216,29 +3216,4 @@ DROP VIEW `v-2`; DROP DATABASE `d-1`; USE test; - -# -# Test that ALTER VIEW accepts DEFINER and ALGORITHM, see bug#16425. -# ---disable_warnings -DROP VIEW IF EXISTS v1; -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1 (i INT); -CREATE VIEW v1 AS SELECT * FROM t1; - -ALTER VIEW v1 AS SELECT * FROM t1; -SHOW CREATE VIEW v1; -ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1; -SHOW CREATE VIEW v1; -ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; -SHOW CREATE VIEW v1; -ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; -SHOW CREATE VIEW v1; - -DROP VIEW v1; -DROP TABLE t1; - - --echo End of 5.1 tests. diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test index acdfec90601..64cafe89d10 100644 --- a/mysql-test/t/view_grant.test +++ b/mysql-test/t/view_grant.test @@ -1073,3 +1073,30 @@ DROP DATABASE db26813; disconnect u1; --echo End of 5.0 tests. + + +# +# Test that ALTER VIEW accepts DEFINER and ALGORITHM, see bug#16425. +# +connection default; +--disable_warnings +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (i INT); +CREATE VIEW v1 AS SELECT * FROM t1; + +ALTER VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +ALTER DEFINER=no_such@user_1 VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; +ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1; +SHOW CREATE VIEW v1; + +DROP VIEW v1; +DROP TABLE t1; + +--echo End of 5.1 tests. From 6f17f42c59e78e2bc618c7d00c661dea1d1c8a57 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 07:27:46 +0100 Subject: [PATCH 318/789] Raise version number after cloning 5.1.17-beta --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 99f05be35a5..4a70337b048 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.1.17-beta) +AM_INIT_AUTOMAKE(mysql, 5.1.18-beta) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From ab785bfe5b505a0a5c7e91edcb5f5fc2a2516b86 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 10:26:14 +0100 Subject: [PATCH 319/789] Bug#26782 - Patch: myisamchk -rq creates .MYI.MYI file on packed MyISAM tables After merge fix In conjunction with the newest 5.1 we always need to create a real path name to be able to detect already open tables. --- storage/myisam/mi_create.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 5ce07c5ac4e..71d377c8b6b 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -573,6 +573,10 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, pthread_mutex_lock(&THR_LOCK_myisam); + /* + NOTE: For test_if_reopen() we need a real path name. Hence we need + MY_RETURN_REAL_PATH for every fn_format(filename, ...). + */ if (ci->index_file_name) { char *iext= strrchr(ci->index_file_name, '.'); @@ -584,13 +588,14 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, if ((path= strrchr(ci->index_file_name, FN_LIBCHAR))) *path= '\0'; fn_format(filename, name, ci->index_file_name, MI_NAME_IEXT, - MY_REPLACE_DIR | MY_UNPACK_FILENAME | MY_APPEND_EXT); + MY_REPLACE_DIR | MY_UNPACK_FILENAME | + MY_RETURN_REAL_PATH | MY_APPEND_EXT); } else { fn_format(filename, ci->index_file_name, "", MI_NAME_IEXT, - MY_UNPACK_FILENAME | (have_iext ? MY_REPLACE_EXT : - MY_APPEND_EXT)); + MY_UNPACK_FILENAME | MY_RETURN_REAL_PATH | + (have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT)); } fn_format(linkname, name, "", MI_NAME_IEXT, MY_UNPACK_FILENAME|MY_APPEND_EXT); @@ -606,8 +611,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, char *iext= strrchr(name, '.'); int have_iext= iext && !strcmp(iext, MI_NAME_IEXT); fn_format(filename, name, "", MI_NAME_IEXT, - MY_UNPACK_FILENAME | - ((flags & HA_DONT_TOUCH_DATA) ? MY_RETURN_REAL_PATH : 0) | + MY_UNPACK_FILENAME | MY_RETURN_REAL_PATH | (have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT)); linkname_ptr=0; /* Replace the current file */ @@ -620,6 +624,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, A TRUNCATE command checks for the table in the cache only and could be fooled to believe, the table is not open. Pull the emergency brake in this situation. (Bug #8306) + + NOTE: The filename is compared against unique_file_name of every + open table. Hence we need a real path here. */ if (test_if_reopen(filename)) { From 2188de4fdd7f452e06114d12d5628d68f6d1eba5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 11:01:47 +0100 Subject: [PATCH 320/789] Bug#26233 very suspect code in mf_tempfile.c, in function create_temp_file() - Rework the windows implementation in 'create_temp_file' to be thread safe by using GetTempFileName instad of fiddling with "environ" mysys/mf_tempfile.c: - Update windows implementation of 'create_temp_file' to use GetTempFileName in favor of fiddeling with "environ" in an unsafe way - Remove the implementation that is supposed to be used if not windows, not mkstemp or tmpnam exists as it not longer compiles it can't be used anywhere. - Update function comment for 'create_temp_file' mysys/my_static.c: Remove unused variable mysys/my_static.h: Remove unused variable --- mysys/mf_tempfile.c | 145 +++++++++++++++++++------------------------- mysys/my_static.c | 5 -- mysys/my_static.h | 4 -- 3 files changed, 61 insertions(+), 93 deletions(-) diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c index 431674c5d61..c1108f85054 100644 --- a/mysys/mf_tempfile.c +++ b/mysys/mf_tempfile.c @@ -22,15 +22,36 @@ #include #endif -#ifdef HAVE_TEMPNAM -#if !defined(MSDOS) && !defined(OS2) && !defined(__NETWARE__) -extern char **environ; -#endif -#endif + /* - Create a temporary file in a given directory - This function should be used instead of my_tempnam() ! + @brief + Create a temporary file with unique name in a given directory + + @details + create_temp_file + to pointer to buffer where temporary filename will be stored + dir directory where to create the file + prefix prefix the filename with this + mode Flags to use for my_create/my_open + MyFlags Magic flags + + @return + File descriptor of opened file if success + -1 and sets errno if fails. + + @note + The behaviour of this function differs a lot between + implementation, it's main use is to generate a file with + a name that does not already exist. + + When passing O_TEMPORARY flag in "mode" the file should + be automatically deleted + + The implementation using mkstemp should be considered the + reference implementation when adding a new or modifying an + existing one + */ File create_temp_file(char *to, const char *dir, const char *prefix, @@ -38,41 +59,33 @@ File create_temp_file(char *to, const char *dir, const char *prefix, myf MyFlags __attribute__((unused))) { File file= -1; + DBUG_ENTER("create_temp_file"); -#if defined(_MSC_VER) + DBUG_PRINT("enter", ("dir: %s, prefix: %s", dir, prefix)); +#if defined (__WIN__) + + /* + Use GetTempFileName to generate a unique filename, create + the file and release it's handle + - uses up to the first three letters from prefix + */ + if (GetTempFileName(dir, prefix, 0, to) == 0) + DBUG_RETURN(-1); + + DBUG_PRINT("info", ("name: %s", to)); + + /* + Open the file without the "open only if file doesn't already exist" + since the file has already been created by GetTempFileName + */ + if ((file= my_open(to, (mode & ~O_EXCL), MyFlags)) < 0) { - char temp[FN_REFLEN],*end,*res,**old_env,*temp_env[1]; - old_env=environ; - if (dir) - { - end=strend(dir)-1; - if (!dir[0]) - { /* Change empty string to current dir */ - to[0]= FN_CURLIB; - to[1]= 0; - dir=to; - } - else if (*end == FN_DEVCHAR) - { /* Get current dir for drive */ - _fullpath(temp,dir,FN_REFLEN); - dir=to; - } - else if (*end == FN_LIBCHAR && dir < end && end[-1] != FN_DEVCHAR) - { - strmake(to,dir,(uint) (end-dir)); /* Copy and remove last '\' */ - dir=to; - } - environ=temp_env; /* Force use of dir (dir not checked) */ - temp_env[0]=0; - } - if ((res=tempnam((char*) dir,(char *) prefix))) - { - strmake(to,res,FN_REFLEN-1); - (*free)(res); - file=my_create(to,0, mode | O_EXCL | O_NOFOLLOW, MyFlags); - } - environ=old_env; + /* Open failed, remove the file created by GetTempFileName */ + int tmp= my_errno; + (void) my_delete(to, MYF(0)); + my_errno= tmp; } + #elif defined(_ZTC__) if (!dir) dir=getenv("TMPDIR"); @@ -101,6 +114,8 @@ File create_temp_file(char *to, const char *dir, const char *prefix, } strmov(convert_dirname(to,dir,NullS),prefix_buff); org_file=mkstemp(to); + if (mode & O_TEMPORARY) + (void) my_delete(to, MYF(MY_WME | ME_NOINPUT)); file=my_register_filename(org_file, to, FILE_BY_MKSTEMP, EE_CANTCREATEFILE, MyFlags); /* If we didn't manage to register the name, remove the temp file */ @@ -113,6 +128,10 @@ File create_temp_file(char *to, const char *dir, const char *prefix, } #elif defined(HAVE_TEMPNAM) { +#if !defined(__NETWARE__) + extern char **environ; +#endif + char *res,**old_env,*temp_env[1]; if (dir && !dir[0]) { /* Change empty string to current dir */ @@ -120,16 +139,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, to[1]= 0; dir=to; } -#ifdef OS2 - /* changing environ variable doesn't work with VACPP */ - char buffer[256], *end; - buffer[sizeof(buffer)-1]= 0; - end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS); - /* remove ending backslash */ - if (end[-1] == '\\') - end[-1]= 0; - putenv(buffer); -#elif !defined(__NETWARE__) +#if !defined(__NETWARE__) old_env= (char**) environ; if (dir) { /* Don't use TMPDIR if dir is given */ @@ -151,45 +161,12 @@ File create_temp_file(char *to, const char *dir, const char *prefix, { DBUG_PRINT("error",("Got error: %d from tempnam",errno)); } -#if !defined(OS2) && !defined(__NETWARE__) +#if !defined(__NETWARE__) environ=(const char**) old_env; #endif } #else - { - register long uniq; - register int length; - my_string pos,end_pos; - /* Make an unique number */ - pthread_mutex_lock(&THR_LOCK_open); - uniq= ((long) getpid() << 20) + (long) _my_tempnam_used++ ; - pthread_mutex_unlock(&THR_LOCK_open); - if (!dir && !(dir=getenv("TMPDIR"))) /* Use this if possibly */ - dir=P_tmpdir; /* Use system default */ - length=strlen(dir)+strlen(pfx)+1; - - DBUG_PRINT("test",("mallocing %d byte",length+8+sizeof(TMP_EXT)+1)); - if (length+8+sizeof(TMP_EXT)+1 > FN_REFLENGTH) - errno=my_errno= ENAMETOOLONG; - else - { - end_pos=strmov(to,dir); - if (end_pos != to && end_pos[-1] != FN_LIBCHAR) - *end_pos++=FN_LIBCHAR; - end_pos=strmov(end_pos,pfx); - - for (length=0 ; length < 8 && uniq ; length++) - { - *end_pos++= _dig_vec_upper[(int) (uniq & 31)]; - uniq >>= 5; - } - (void) strmov(end_pos,TMP_EXT); - file=my_create(to,0, - (int) (O_RDWR | O_BINARY | O_TRUNC | O_EXCL | O_NOFOLLOW | - O_TEMPORARY | O_SHORT_LIVED), - MYF(MY_WME)); - } - } +#error No implementation found for create_temp_file #endif if (file >= 0) thread_safe_increment(my_tmp_file_created,&THR_LOCK_open); diff --git a/mysys/my_static.c b/mysys/my_static.c index 694e5058bb0..77dbffb911e 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -67,11 +67,6 @@ uint my_once_extra=ONCE_ALLOC_INIT; /* Memory to alloc / block */ #ifdef HAVE_LARGE_PAGES my_bool my_use_large_pages= 0; uint my_large_page_size= 0; -#endif - - /* from my_tempnam */ -#if !defined(HAVE_TEMPNAM) || defined(HPUX11) -int _my_tempnam_used=0; #endif /* from safe_malloc */ diff --git a/mysys/my_static.h b/mysys/my_static.h index cbd293a0431..b438c936225 100644 --- a/mysys/my_static.h +++ b/mysys/my_static.h @@ -60,10 +60,6 @@ extern const char *soundex_map; extern USED_MEM* my_once_root_block; extern uint my_once_extra; -#if !defined(HAVE_TEMPNAM) || defined(HPUX11) -extern int _my_tempnam_used; -#endif - extern byte *sf_min_adress,*sf_max_adress; extern uint sf_malloc_count; extern struct st_irem *sf_malloc_root; From 1708aab339ad9e470e6c451d8aa7b50b0f0da707 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 11:18:59 +0100 Subject: [PATCH 321/789] Bug#27070 server logs are created unrequested and in wrong directory - Add output path for slow queries as well mysql-test/mysql-test-run.pl: Send queries to var/log/$type.log and slow queries to var/log/$type-slow.log --- mysql-test/mysql-test-run.pl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index fbe5a643fe7..69103334252 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1064,7 +1064,6 @@ sub command_line_setup () { idx => 0, path_myddir => "$opt_vardir/master-data", path_myerr => "$opt_vardir/log/master.err", - path_mylog => "$opt_vardir/log/master.log", path_pid => "$opt_vardir/run/master.pid", path_sock => "$sockdir/master.sock", port => $opt_master_myport, @@ -1080,7 +1079,6 @@ sub command_line_setup () { idx => 1, path_myddir => "$opt_vardir/master1-data", path_myerr => "$opt_vardir/log/master1.err", - path_mylog => "$opt_vardir/log/master1.log", path_pid => "$opt_vardir/run/master1.pid", path_sock => "$sockdir/master1.sock", port => $opt_master_myport + 1, @@ -1096,7 +1094,6 @@ sub command_line_setup () { idx => 0, path_myddir => "$opt_vardir/slave-data", path_myerr => "$opt_vardir/log/slave.err", - path_mylog => "$opt_vardir/log/slave.log", path_pid => "$opt_vardir/run/slave.pid", path_sock => "$sockdir/slave.sock", port => $opt_slave_myport, @@ -1113,7 +1110,6 @@ sub command_line_setup () { idx => 1, path_myddir => "$opt_vardir/slave1-data", path_myerr => "$opt_vardir/log/slave1.err", - path_mylog => "$opt_vardir/log/slave1.log", path_pid => "$opt_vardir/run/slave1.pid", path_sock => "$sockdir/slave1.sock", port => $opt_slave_myport + 1, @@ -1129,7 +1125,6 @@ sub command_line_setup () { idx => 2, path_myddir => "$opt_vardir/slave2-data", path_myerr => "$opt_vardir/log/slave2.err", - path_mylog => "$opt_vardir/log/slave2.log", path_pid => "$opt_vardir/run/slave2.pid", path_sock => "$sockdir/slave2.sock", port => $opt_slave_myport + 2, @@ -3683,8 +3678,10 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--log-output=table,file", $prefix); } - mtr_add_arg($args, "%s--log=%s", $prefix, $mysqld->{'path_mylog'}); - + my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx"; + mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path); + mtr_add_arg($args, + "%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path); # Check if "extra_opt" contains --skip-log-bin my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt); From 45f2f76457a39977cbe0026f3ae281aa726c6c67 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 11:52:25 +0100 Subject: [PATCH 322/789] Import yassl 1.6.0 extra/yassl/README: Import patch yassl.diff extra/yassl/include/buffer.hpp: Import patch yassl.diff extra/yassl/include/crypto_wrapper.hpp: Import patch yassl.diff extra/yassl/include/openssl/ssl.h: Import patch yassl.diff extra/yassl/include/socket_wrapper.hpp: Import patch yassl.diff extra/yassl/include/yassl_imp.hpp: Import patch yassl.diff extra/yassl/include/yassl_int.hpp: Import patch yassl.diff extra/yassl/src/crypto_wrapper.cpp: Import patch yassl.diff extra/yassl/src/ssl.cpp: Import patch yassl.diff extra/yassl/taocrypt/README: Import patch yassl.diff extra/yassl/taocrypt/benchmark/benchmark.cpp: Import patch yassl.diff extra/yassl/taocrypt/include/algebra.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/des.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/hash.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/hmac.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/misc.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/modarith.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/modes.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/rsa.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/sha.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/type_traits.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/types.hpp: Import patch yassl.diff extra/yassl/taocrypt/mySTL/list.hpp: Import patch yassl.diff extra/yassl/taocrypt/src/aes.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/algebra.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/asn.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/hash.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/integer.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/sha.cpp: Import patch yassl.diff extra/yassl/taocrypt/test/test.cpp: Import patch yassl.diff extra/yassl/testsuite/testsuite.cpp: Import patch yassl.diff --- extra/yassl/README | 8 + extra/yassl/include/buffer.hpp | 3 - extra/yassl/include/crypto_wrapper.hpp | 6 - extra/yassl/include/openssl/ssl.h | 10 +- extra/yassl/include/socket_wrapper.hpp | 6 +- extra/yassl/include/yassl_imp.hpp | 17 +- extra/yassl/include/yassl_int.hpp | 1 - extra/yassl/src/crypto_wrapper.cpp | 2 - extra/yassl/src/ssl.cpp | 4 +- extra/yassl/taocrypt/README | 13 +- extra/yassl/taocrypt/benchmark/benchmark.cpp | 32 +- extra/yassl/taocrypt/include/algebra.hpp | 3 - extra/yassl/taocrypt/include/des.hpp | 1 - extra/yassl/taocrypt/include/hash.hpp | 36 +- extra/yassl/taocrypt/include/hmac.hpp | 4 +- extra/yassl/taocrypt/include/misc.hpp | 19 + extra/yassl/taocrypt/include/modarith.hpp | 4 +- extra/yassl/taocrypt/include/modes.hpp | 4 +- extra/yassl/taocrypt/include/rsa.hpp | 34 +- extra/yassl/taocrypt/include/sha.hpp | 97 +++++ extra/yassl/taocrypt/include/type_traits.hpp | 6 +- extra/yassl/taocrypt/include/types.hpp | 3 + extra/yassl/taocrypt/mySTL/list.hpp | 16 +- extra/yassl/taocrypt/src/aes.cpp | 11 +- extra/yassl/taocrypt/src/algebra.cpp | 6 +- extra/yassl/taocrypt/src/asn.cpp | 8 +- extra/yassl/taocrypt/src/hash.cpp | 85 ++++ extra/yassl/taocrypt/src/integer.cpp | 2 +- extra/yassl/taocrypt/src/sha.cpp | 410 +++++++++++++++++++ extra/yassl/taocrypt/test/test.cpp | 258 +++++++++--- extra/yassl/testsuite/testsuite.cpp | 17 +- 31 files changed, 953 insertions(+), 173 deletions(-) diff --git a/extra/yassl/README b/extra/yassl/README index 32d97a1e873..6c4d101efc0 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -1,3 +1,11 @@ +*****************yaSSL Release notes, version 1.6.0 (2/22/07) + + This release of yaSSL contains bug fixes, portability enhancements, and + better X509 support. + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + *****************yaSSL Release notes, version 1.5.8 (1/10/07) This release of yaSSL contains bug fixes, portability enhancements, and diff --git a/extra/yassl/include/buffer.hpp b/extra/yassl/include/buffer.hpp index 3fe12f38f57..a51bca9a630 100644 --- a/extra/yassl/include/buffer.hpp +++ b/extra/yassl/include/buffer.hpp @@ -49,13 +49,11 @@ const uint AUTO = 0xFEEDBEEF; // Checking Policy should implement a check function that tests whether the // index is within the size limit of the array struct Check { - Check() {} void check(uint i, uint limit); }; struct NoCheck { - NoCheck() {} void check(uint, uint); }; @@ -193,7 +191,6 @@ inline void checked_delete(T* p) // sets pointer to zero so safe for std conatiners struct del_ptr_zero { - del_ptr_zero() {} template void operator()(T*& p) const { diff --git a/extra/yassl/include/crypto_wrapper.hpp b/extra/yassl/include/crypto_wrapper.hpp index 9e4eb582368..07b5925265a 100644 --- a/extra/yassl/include/crypto_wrapper.hpp +++ b/extra/yassl/include/crypto_wrapper.hpp @@ -42,7 +42,6 @@ namespace yaSSL { // Digest policy should implement a get_digest, update, and get sizes for pad // and digest struct Digest : public virtual_base { - Digest() {} virtual void get_digest(byte*) = 0; virtual void get_digest(byte*, const byte*, unsigned int) = 0; virtual void update(const byte*, unsigned int) = 0; @@ -54,7 +53,6 @@ struct Digest : public virtual_base { // For use with NULL Digests struct NO_MAC : public Digest { - NO_MAC() {} void get_digest(byte*); void get_digest(byte*, const byte*, unsigned int); void update(const byte*, unsigned int); @@ -179,7 +177,6 @@ private: // BulkCipher policy should implement encrypt, decrypt, get block size, // and set keys for encrypt and decrypt struct BulkCipher : public virtual_base { - BulkCipher() {} virtual void encrypt(byte*, const byte*, unsigned int) = 0; virtual void decrypt(byte*, const byte*, unsigned int) = 0; virtual void set_encryptKey(const byte*, const byte* = 0) = 0; @@ -193,7 +190,6 @@ struct BulkCipher : public virtual_base { // For use with NULL Ciphers struct NO_Cipher : public BulkCipher { - NO_Cipher() {} void encrypt(byte*, const byte*, unsigned int) {} void decrypt(byte*, const byte*, unsigned int) {} void set_encryptKey(const byte*, const byte*) {} @@ -315,14 +311,12 @@ struct Auth : public virtual_base { virtual bool verify(const byte*, unsigned int, const byte*, unsigned int) = 0; virtual uint get_signatureLength() const = 0; - Auth() {} virtual ~Auth() {} }; // For use with NULL Authentication schemes struct NO_Auth : public Auth { - NO_Auth() {} void sign(byte*, const byte*, unsigned int, const RandomPool&) {} bool verify(const byte*, unsigned int, const byte*, unsigned int) { return true; } diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index d0c49d6816c..29add5ca37d 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -33,7 +33,8 @@ #include "opensslv.h" /* for version number */ #include "rsa.h" -#define YASSL_VERSION "1.5.8" + +#define YASSL_VERSION "1.6.5" #if defined(__cplusplus) @@ -189,16 +190,11 @@ enum { /* ERR Constants */ EVP_R_BAD_DECRYPT = 2 }; -#ifdef WIN - typedef SOCKET socket_t; -#else - typedef int socket_t; -#endif SSL_CTX* SSL_CTX_new(SSL_METHOD*); SSL* SSL_new(SSL_CTX*); -int SSL_set_fd (SSL*, socket_t); +int SSL_set_fd (SSL*, int); int SSL_connect(SSL*); int SSL_write(SSL*, const void*, int); int SSL_read(SSL*, void*, int); diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp index de28778ead9..308704c2af0 100644 --- a/extra/yassl/include/socket_wrapper.hpp +++ b/extra/yassl/include/socket_wrapper.hpp @@ -38,14 +38,16 @@ #include #include #endif -#include "openssl/ssl.h" /* for socket_t */ namespace yaSSL { typedef unsigned int uint; -#ifndef _WIN32 +#ifdef _WIN32 + typedef SOCKET socket_t; +#else + typedef int socket_t; const socket_t INVALID_SOCKET = -1; const int SD_RECEIVE = 0; const int SD_SEND = 1; diff --git a/extra/yassl/include/yassl_imp.hpp b/extra/yassl/include/yassl_imp.hpp index a94b03bacbf..f6434443cb0 100644 --- a/extra/yassl/include/yassl_imp.hpp +++ b/extra/yassl/include/yassl_imp.hpp @@ -64,7 +64,6 @@ struct RecordLayerHeader { // base for all messages struct Message : public virtual_base { - Message() {} virtual input_buffer& set(input_buffer&) =0; virtual output_buffer& get(output_buffer&) const =0; @@ -178,7 +177,6 @@ private: class HandShakeBase : public virtual_base { int length_; public: - HandShakeBase() {} int get_length() const; void set_length(int); @@ -196,7 +194,6 @@ public: struct HelloRequest : public HandShakeBase { - HelloRequest() {} input_buffer& set(input_buffer& in); output_buffer& get(output_buffer& out) const; @@ -330,7 +327,6 @@ private: struct ServerKeyBase : public virtual_base { - ServerKeyBase() {} virtual ~ServerKeyBase() {} virtual void build(SSL&) {} virtual void read(SSL&, input_buffer&) {} @@ -341,21 +337,15 @@ struct ServerKeyBase : public virtual_base { // Server random number for FORTEZZA KEA struct Fortezza_Server : public ServerKeyBase { - Fortezza_Server() {} opaque r_s_[FORTEZZA_MAX]; }; struct SignatureBase : public virtual_base { - SignatureBase() {} virtual ~SignatureBase() {} }; -struct anonymous_sa : public SignatureBase -{ -public: - anonymous_sa() {} -}; +struct anonymous_sa : public SignatureBase {}; struct Hashes { @@ -365,13 +355,11 @@ struct Hashes { struct rsa_sa : public SignatureBase { - rsa_sa() {} Hashes hashes_; }; struct dsa_sa : public SignatureBase { - dsa_sa() {} uint8 sha_[SHA_LEN]; }; @@ -399,7 +387,6 @@ private: // Server's RSA exchange struct RSA_Server : public ServerKeyBase { - RSA_Server() {} ServerRSAParams params_; opaque* signature_; // signed rsa_sa hashes }; @@ -474,7 +461,6 @@ struct PreMasterSecret { struct ClientKeyBase : public virtual_base { - ClientKeyBase() {} virtual ~ClientKeyBase() {} virtual void build(SSL&) {} virtual void read(SSL&, input_buffer&) {} @@ -505,7 +491,6 @@ private: // Fortezza Key Parameters from page 29 // hard code lengths cause only used here struct FortezzaKeys : public ClientKeyBase { - FortezzaKeys() {} opaque y_c_ [128]; // client's Yc, public value opaque r_c_ [128]; // client's Rc opaque y_signature_ [40]; // DSS signed public key diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index d75d2200b3c..94cb85c3300 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -228,7 +228,6 @@ struct BIGNUM { TaoCrypt::Integer), we need to explicitly state the namespace here to let gcc 2.96 deduce the correct type. */ - BIGNUM() {} yaSSL::Integer int_; void assign(const byte* b, uint s) { int_.assign(b,s); } }; diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp index 0291faab301..28d7f1b5693 100644 --- a/extra/yassl/src/crypto_wrapper.cpp +++ b/extra/yassl/src/crypto_wrapper.cpp @@ -550,7 +550,6 @@ void RandomPool::Fill(opaque* dst, uint sz) const // Implementation of DSS Authentication struct DSS::DSSImpl { - DSSImpl() {} void SetPublic (const byte*, unsigned int); void SetPrivate(const byte*, unsigned int); TaoCrypt::DSA_PublicKey publicKey_; @@ -623,7 +622,6 @@ bool DSS::verify(const byte* sha_digest, unsigned int /* shaSz */, // Implementation of RSA key interface struct RSA::RSAImpl { - RSAImpl() {} void SetPublic (const byte*, unsigned int); void SetPrivate(const byte*, unsigned int); TaoCrypt::RSA_PublicKey publicKey_; diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 1f9d0dd4020..70198af79b4 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -229,7 +229,7 @@ void SSL_free(SSL* ssl) } -int SSL_set_fd(SSL* ssl, socket_t fd) +int SSL_set_fd(SSL* ssl, int fd) { ssl->useSocket().set_fd(fd); return SSL_SUCCESS; @@ -950,7 +950,7 @@ void ERR_print_errors_fp(FILE* /*fp*/) char* ERR_error_string(unsigned long errNumber, char* buffer) { - static char* msg = (char*) "Please supply a buffer for error string"; + static char* msg = "Please supply a buffer for error string"; if (buffer) { SetErrorString(YasslError(errNumber), buffer); diff --git a/extra/yassl/taocrypt/README b/extra/yassl/taocrypt/README index 34e1744492e..0a7ff301786 100644 --- a/extra/yassl/taocrypt/README +++ b/extra/yassl/taocrypt/README @@ -1,4 +1,15 @@ -TaoCrypt release 0.9.0 09/18/2006 +TaoCrypt release 0.9.2 02/5/2007 + + +This release includes bug fixes, portability enhancements, and some +optimiations. + +See 0.9.0 for build instructions. + + + + +******************TaoCrypt release 0.9.0 09/18/2006 This is the first release of TaoCrypt, it was previously only included with yaSSL. TaoCrypt is highly portable and fast, its features include: diff --git a/extra/yassl/taocrypt/benchmark/benchmark.cpp b/extra/yassl/taocrypt/benchmark/benchmark.cpp index dd9d1b1ff0d..bb725a90187 100644 --- a/extra/yassl/taocrypt/benchmark/benchmark.cpp +++ b/extra/yassl/taocrypt/benchmark/benchmark.cpp @@ -65,7 +65,7 @@ int main(int argc, char** argv) const int megs = 5; // how much to test -const byte global_key[] = +const byte key[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, @@ -81,19 +81,19 @@ const byte iv[] = }; -byte global_plain [1024*1024]; -byte global_cipher[1024*1024]; +byte plain [1024*1024]; +byte cipher[1024*1024]; void bench_des() { DES_EDE3_CBC_Encryption enc; - enc.SetKey(global_key, 16, iv); + enc.SetKey(key, 16, iv); double start = current_time(); for(int i = 0; i < megs; i++) - enc.Process(global_plain, global_cipher, sizeof(global_plain)); + enc.Process(plain, cipher, sizeof(plain)); double total = current_time() - start; @@ -107,12 +107,12 @@ void bench_des() void bench_aes(bool show) { AES_CBC_Encryption enc; - enc.SetKey(global_key, 16, iv); + enc.SetKey(key, 16, iv); double start = current_time(); for(int i = 0; i < megs; i++) - enc.Process(global_plain, global_cipher, sizeof(global_plain)); + enc.Process(plain, cipher, sizeof(plain)); double total = current_time() - start; @@ -127,12 +127,12 @@ void bench_aes(bool show) void bench_twofish() { Twofish_CBC_Encryption enc; - enc.SetKey(global_key, 16, iv); + enc.SetKey(key, 16, iv); double start = current_time(); for(int i = 0; i < megs; i++) - enc.Process(global_plain, global_cipher, sizeof(global_plain)); + enc.Process(plain, cipher, sizeof(plain)); double total = current_time() - start; @@ -147,12 +147,12 @@ void bench_twofish() void bench_blowfish() { Blowfish_CBC_Encryption enc; - enc.SetKey(global_key, 16, iv); + enc.SetKey(key, 16, iv); double start = current_time(); for(int i = 0; i < megs; i++) - enc.Process(global_plain, global_cipher, sizeof(global_plain)); + enc.Process(plain, cipher, sizeof(plain)); double total = current_time() - start; @@ -166,12 +166,12 @@ void bench_blowfish() void bench_arc4() { ARC4 enc; - enc.SetKey(global_key, 16); + enc.SetKey(key, 16); double start = current_time(); for(int i = 0; i < megs; i++) - enc.Process(global_cipher, global_plain, sizeof(global_plain)); + enc.Process(cipher, plain, sizeof(plain)); double total = current_time() - start; @@ -191,7 +191,7 @@ void bench_md5() for(int i = 0; i < megs; i++) - hash.Update(global_plain, sizeof(global_plain)); + hash.Update(plain, sizeof(plain)); hash.Final(digest); @@ -213,7 +213,7 @@ void bench_sha() for(int i = 0; i < megs; i++) - hash.Update(global_plain, sizeof(global_plain)); + hash.Update(plain, sizeof(plain)); hash.Final(digest); @@ -241,7 +241,7 @@ void bench_ripemd() for(int i = 0; i < megs; i++) - hash.Update(global_plain, sizeof(global_plain)); + hash.Update(plain, sizeof(plain)); hash.Final(digest); diff --git a/extra/yassl/taocrypt/include/algebra.hpp b/extra/yassl/taocrypt/include/algebra.hpp index 9a6b5344c0d..298ef115a4a 100644 --- a/extra/yassl/taocrypt/include/algebra.hpp +++ b/extra/yassl/taocrypt/include/algebra.hpp @@ -40,7 +40,6 @@ class TAOCRYPT_NO_VTABLE AbstractGroup : public virtual_base public: typedef Integer Element; - AbstractGroup() {} virtual ~AbstractGroup() {} virtual bool Equal(const Element &a, const Element &b) const =0; @@ -95,7 +94,6 @@ private: class MultiplicativeGroupT : public AbstractGroup { public: - MultiplicativeGroupT() {} const AbstractRing& GetRing() const {return *m_pRing;} @@ -147,7 +145,6 @@ class TAOCRYPT_NO_VTABLE AbstractEuclideanDomain : public AbstractRing { public: - AbstractEuclideanDomain() {} typedef Integer Element; virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a, diff --git a/extra/yassl/taocrypt/include/des.hpp b/extra/yassl/taocrypt/include/des.hpp index 9082f8ab57d..f99a289392f 100644 --- a/extra/yassl/taocrypt/include/des.hpp +++ b/extra/yassl/taocrypt/include/des.hpp @@ -41,7 +41,6 @@ enum { DES_BLOCK_SIZE = 8, DES_KEY_SIZE = 32 }; class BasicDES { public: - BasicDES() {} void SetKey(const byte*, word32, CipherDir dir); void RawProcessBlock(word32&, word32&) const; protected: diff --git a/extra/yassl/taocrypt/include/hash.hpp b/extra/yassl/taocrypt/include/hash.hpp index 71072bd3e74..fa5f6c04720 100644 --- a/extra/yassl/taocrypt/include/hash.hpp +++ b/extra/yassl/taocrypt/include/hash.hpp @@ -31,7 +31,6 @@ namespace TaoCrypt { // HASH class HASH : public virtual_base { public: - HASH() {} virtual ~HASH() {} virtual void Update(const byte*, word32) = 0; @@ -58,8 +57,7 @@ public: word32 GetBitCountLo() const { return loLen_ << 3; } word32 GetBitCountHi() const { return (loLen_ >> (8*sizeof(loLen_) - 3)) + (hiLen_ << 3); } - - enum { MaxDigestSz = 5, MaxBufferSz = 64 }; + enum { MaxDigestSz = 8, MaxBufferSz = 64 }; protected: typedef word32 HashLengthType; word32 buffLen_; // in bytes @@ -74,6 +72,38 @@ protected: }; +#ifdef WORD64_AVAILABLE + +// 64-bit HASH with Transform +class HASH64withTransform : public HASH { +public: + HASH64withTransform(word32 digSz, word32 buffSz); + virtual ~HASH64withTransform() {} + virtual ByteOrder getByteOrder() const = 0; + virtual word32 getPadSize() const = 0; + + virtual void Update(const byte*, word32); + virtual void Final(byte*); + + word32 GetBitCountLo() const { return loLen_ << 3; } + word32 GetBitCountHi() const { return (loLen_ >> (8*sizeof(loLen_) - 3)) + + (hiLen_ << 3); } + enum { MaxDigestSz = 8, MaxBufferSz = 128 }; +protected: + typedef word32 HashLengthType; + word32 buffLen_; // in bytes + HashLengthType loLen_; // length in bytes + HashLengthType hiLen_; // length in bytes + word64 digest_[MaxDigestSz]; + word64 buffer_[MaxBufferSz / sizeof(word64)]; + + virtual void Transform() = 0; + + void AddLength(word32); +}; + +#endif // WORD64_AVAILABLE + } // namespace diff --git a/extra/yassl/taocrypt/include/hmac.hpp b/extra/yassl/taocrypt/include/hmac.hpp index ccd54c05cb1..1d486514e06 100644 --- a/extra/yassl/taocrypt/include/hmac.hpp +++ b/extra/yassl/taocrypt/include/hmac.hpp @@ -109,11 +109,11 @@ void HMAC::KeyInnerHash() // Update template -void HMAC::Update(const byte* msg_arg, word32 length) +void HMAC::Update(const byte* msg, word32 length) { if (!innerHashKeyed_) KeyInnerHash(); - mac_.Update(msg_arg, length); + mac_.Update(msg, length); } diff --git a/extra/yassl/taocrypt/include/misc.hpp b/extra/yassl/taocrypt/include/misc.hpp index 224589e0640..96648a39aa1 100644 --- a/extra/yassl/taocrypt/include/misc.hpp +++ b/extra/yassl/taocrypt/include/misc.hpp @@ -464,6 +464,25 @@ inline word32 ByteReverse(word32 value) } +#ifdef WORD64_AVAILABLE + +inline word64 ByteReverse(word64 value) +{ +#ifdef TAOCRYPT_SLOW_WORD64 + return (word64(ByteReverse(word32(value))) << 32) | + ByteReverse(word32(value>>32)); +#else + value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | + ((value & W64LIT(0x00FF00FF00FF00FF)) << 8); + value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | + ((value & W64LIT(0x0000FFFF0000FFFF)) << 16); + return rotlFixed(value, 32U); +#endif +} + +#endif // WORD64_AVAILABLE + + template inline void ByteReverse(T* out, const T* in, word32 byteCount) { diff --git a/extra/yassl/taocrypt/include/modarith.hpp b/extra/yassl/taocrypt/include/modarith.hpp index f42a4397d48..501a8129b90 100644 --- a/extra/yassl/taocrypt/include/modarith.hpp +++ b/extra/yassl/taocrypt/include/modarith.hpp @@ -37,8 +37,8 @@ public: typedef int RandomizationParameter; typedef Integer Element; - ModularArithmetic(const Integer &modulus_arg = Integer::One()) - : modulus(modulus_arg), result((word)0, modulus_arg.reg_.size()) {} + ModularArithmetic(const Integer &modulus = Integer::One()) + : modulus(modulus), result((word)0, modulus.reg_.size()) {} ModularArithmetic(const ModularArithmetic &ma) : AbstractRing(), diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp index 36618a8f5ed..d1ebce7568b 100644 --- a/extra/yassl/taocrypt/include/modes.hpp +++ b/extra/yassl/taocrypt/include/modes.hpp @@ -42,8 +42,8 @@ public: { cipher_.Process(c, p, sz); } void SetKey(const byte* k, word32 sz) { cipher_.SetKey(k, sz, DIR); } - void SetKey(const byte* k, word32 sz, const byte* iv_arg) - { cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv_arg); } + void SetKey(const byte* k, word32 sz, const byte* iv) + { cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv); } private: T cipher_; diff --git a/extra/yassl/taocrypt/include/rsa.hpp b/extra/yassl/taocrypt/include/rsa.hpp index 454b0ef33a7..c895ab6fd34 100644 --- a/extra/yassl/taocrypt/include/rsa.hpp +++ b/extra/yassl/taocrypt/include/rsa.hpp @@ -131,7 +131,6 @@ private: // block type 2 padding class RSA_BlockType2 { public: - RSA_BlockType2() {} void Pad(const byte*, word32, byte*, word32, RandomNumberGenerator&) const; word32 UnPad(const byte*, word32, byte*) const; @@ -141,7 +140,6 @@ public: // block type 1 padding class RSA_BlockType1 { public: - RSA_BlockType1() {} void Pad(const byte*, word32, byte*, word32, RandomNumberGenerator&) const; word32 UnPad(const byte*, word32, byte*) const; @@ -176,27 +174,25 @@ public: // Public Encrypt template -void RSA_Encryptor::Encrypt(const byte* plain_arg, word32 sz, - byte* cipher_arg, - RandomNumberGenerator& rng_arg) +void RSA_Encryptor::Encrypt(const byte* plain, word32 sz, byte* cipher, + RandomNumberGenerator& rng) { PK_Lengths lengths(key_.GetModulus()); assert(sz <= lengths.FixedMaxPlaintextLength()); ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); - padding_.Pad(plain_arg, sz, paddedBlock.get_buffer(), - lengths.PaddedBlockBitLength(), rng_arg); + padding_.Pad(plain, sz, paddedBlock.get_buffer(), + lengths.PaddedBlockBitLength(), rng); key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())). - Encode(cipher_arg, lengths.FixedCiphertextLength()); + Encode(cipher, lengths.FixedCiphertextLength()); } // Private Decrypt template -word32 RSA_Decryptor::Decrypt(const byte* cipher_arg, word32 sz, - byte* plain_arg, - RandomNumberGenerator& rng_arg) +word32 RSA_Decryptor::Decrypt(const byte* cipher, word32 sz, byte* plain, + RandomNumberGenerator& rng) { PK_Lengths lengths(key_.GetModulus()); assert(sz == lengths.FixedCiphertextLength()); @@ -205,29 +201,29 @@ word32 RSA_Decryptor::Decrypt(const byte* cipher_arg, word32 sz, return 0; ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); - Integer x = key_.CalculateInverse(rng_arg, Integer(cipher_arg, + Integer x = key_.CalculateInverse(rng, Integer(cipher, lengths.FixedCiphertextLength()).Ref()); if (x.ByteCount() > paddedBlock.size()) x = Integer::Zero(); // don't return false, prevents timing attack x.Encode(paddedBlock.get_buffer(), paddedBlock.size()); return padding_.UnPad(paddedBlock.get_buffer(), - lengths.PaddedBlockBitLength(), plain_arg); + lengths.PaddedBlockBitLength(), plain); } // Private SSL type (block 1) Encrypt template void RSA_Decryptor::SSL_Sign(const byte* message, word32 sz, byte* sig, - RandomNumberGenerator& rng_arg) + RandomNumberGenerator& rng) { RSA_PublicKey inverse; inverse.Initialize(key_.GetModulus(), key_.GetPrivateExponent()); RSA_Encryptor enc(inverse); // SSL Type - enc.Encrypt(message, sz, sig, rng_arg); + enc.Encrypt(message, sz, sig, rng); } -word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain_arg); +word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain); // Public SSL type (block 1) Decrypt @@ -235,11 +231,11 @@ template bool RSA_Encryptor::SSL_Verify(const byte* message, word32 sz, const byte* sig) { - ByteBlock local_plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength()); - if (SSL_Decrypt(key_, sig, local_plain.get_buffer()) != sz) + ByteBlock plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength()); + if (SSL_Decrypt(key_, sig, plain.get_buffer()) != sz) return false; // not right justified or bad padding - if ( (memcmp(local_plain.get_buffer(), message, sz)) == 0) + if ( (memcmp(plain.get_buffer(), message, sz)) == 0) return true; return false; } diff --git a/extra/yassl/taocrypt/include/sha.hpp b/extra/yassl/taocrypt/include/sha.hpp index c501d3ad306..c0b4368121b 100644 --- a/extra/yassl/taocrypt/include/sha.hpp +++ b/extra/yassl/taocrypt/include/sha.hpp @@ -64,6 +64,103 @@ inline void swap(SHA& a, SHA& b) a.Swap(b); } +// SHA-256 digest +class SHA256 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 32, PAD_SIZE = 56, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA256() : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA256(const SHA256&); + SHA256& operator= (const SHA256&); + + void Swap(SHA256&); +private: + void Transform(); +}; + + +// SHA-224 digest +class SHA224 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 28, PAD_SIZE = 56, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA224() : HASHwithTransform(SHA256::DIGEST_SIZE /sizeof(word32),BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA224(const SHA224&); + SHA224& operator= (const SHA224&); + + void Swap(SHA224&); +private: + void Transform(); +}; + + +#ifdef WORD64_AVAILABLE + +// SHA-512 digest +class SHA512 : public HASH64withTransform { +public: + enum { BLOCK_SIZE = 128, DIGEST_SIZE = 64, PAD_SIZE = 112, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA512() : HASH64withTransform(DIGEST_SIZE / sizeof(word64), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA512(const SHA512&); + SHA512& operator= (const SHA512&); + + void Swap(SHA512&); +private: + void Transform(); +}; + + +// SHA-384 digest +class SHA384 : public HASH64withTransform { +public: + enum { BLOCK_SIZE = 128, DIGEST_SIZE = 48, PAD_SIZE = 112, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA384() : HASH64withTransform(SHA512::DIGEST_SIZE/ sizeof(word64), + BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA384(const SHA384&); + SHA384& operator= (const SHA384&); + + void Swap(SHA384&); +private: + void Transform(); +}; + +#endif // WORD64_AVAILABLE + + } // namespace diff --git a/extra/yassl/taocrypt/include/type_traits.hpp b/extra/yassl/taocrypt/include/type_traits.hpp index ce21a2eaa63..0dd5e4e5c50 100644 --- a/extra/yassl/taocrypt/include/type_traits.hpp +++ b/extra/yassl/taocrypt/include/type_traits.hpp @@ -62,11 +62,7 @@ MK_FUNDAMENTAL_TYPE(unsigned long) MK_FUNDAMENTAL_TYPE(float) MK_FUNDAMENTAL_TYPE( double) - -#ifdef LONG_DOUBLE_IS_DISTINCT_TYPE -// Don't define by default as this gives warnings on power mac - MK_FUNDAMENTAL_TYPE(long double) -#endif +MK_FUNDAMENTAL_TYPE(long double) #if defined(WORD64_AVAILABLE) && defined(WORD64_IS_DISTINCT_TYPE) MK_FUNDAMENTAL_TYPE(word64) diff --git a/extra/yassl/taocrypt/include/types.hpp b/extra/yassl/taocrypt/include/types.hpp index c817572d265..3efdcdfbccb 100644 --- a/extra/yassl/taocrypt/include/types.hpp +++ b/extra/yassl/taocrypt/include/types.hpp @@ -46,13 +46,16 @@ typedef unsigned int word32; #define WORD64_AVAILABLE #define WORD64_IS_DISTINCT_TYPE typedef unsigned __int64 word64; + #define W64LIT(x) x##ui64 #elif SIZEOF_LONG == 8 #define WORD64_AVAILABLE typedef unsigned long word64; + #define W64LIT(x) x##LL #elif SIZEOF_LONG_LONG == 8 #define WORD64_AVAILABLE #define WORD64_IS_DISTINCT_TYPE typedef unsigned long long word64; + #define W64LIT(x) x##LL #endif diff --git a/extra/yassl/taocrypt/mySTL/list.hpp b/extra/yassl/taocrypt/mySTL/list.hpp index 98a4589a354..6a081cba5ad 100644 --- a/extra/yassl/taocrypt/mySTL/list.hpp +++ b/extra/yassl/taocrypt/mySTL/list.hpp @@ -231,7 +231,7 @@ void list::push_front(T t) template void list::pop_front() { - node* local_front = head_; + node* front = head_; if (head_ == 0) return; @@ -241,8 +241,8 @@ void list::pop_front() head_ = head_->next_; head_->prev_ = 0; } - destroy(local_front); - FreeMemory(local_front); + destroy(front); + FreeMemory(front); --sz_; } @@ -303,13 +303,13 @@ T list::back() const template typename list::node* list::look_up(T t) { - node* local_list = head_; + node* list = head_; - if (local_list == 0) return 0; + if (list == 0) return 0; - for (; local_list; local_list = local_list->next_) - if (local_list->value_ == t) - return local_list; + for (; list; list = list->next_) + if (list->value_ == t) + return list; return 0; } diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp index 4f87bf3778a..b2b42d3dcf0 100644 --- a/extra/yassl/taocrypt/src/aes.cpp +++ b/extra/yassl/taocrypt/src/aes.cpp @@ -90,14 +90,13 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/) rounds_ = keylen/4 + 6; word32 temp, *rk = key_; + unsigned int i=0; GetUserKey(BigEndianOrder, rk, keylen/4, userKey, keylen); switch(keylen) { case 16: - { - unsigned int i=0; while (true) { temp = rk[3]; @@ -115,10 +114,8 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/) rk += 4; } break; - } + case 24: - { - unsigned int i=0; while (true) // for (;;) here triggers a bug in VC60 SP4 w/ Pro Pack { temp = rk[ 5]; @@ -139,10 +136,7 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/) } break; - } case 32: - { - unsigned int i=0; while (true) { temp = rk[ 7]; @@ -171,7 +165,6 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/) } break; } - } if (dir_ == DECRYPTION) { diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp index d797d0d4108..cb597c41552 100644 --- a/extra/yassl/taocrypt/src/algebra.cpp +++ b/extra/yassl/taocrypt/src/algebra.cpp @@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x, struct WindowSlider { - WindowSlider(const Integer &exp_arg, bool fastNegate_arg, + WindowSlider(const Integer &exp, bool fastNegate, unsigned int windowSizeIn=0) - : exp(exp_arg), windowModulus(Integer::One()), windowSize(windowSizeIn), - windowBegin(0), fastNegate(fastNegate_arg), firstTime(true), + : exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn), + windowBegin(0), fastNegate(fastNegate), firstTime(true), finished(false) { if (windowSize == 0) diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index 5bc865a4ba7..a06ab658c7b 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -737,17 +737,17 @@ void CertDecoder::GetName(NameType nt) email = true; source_.advance(oidSz + 1); - word32 length2 = GetLength(source_); + word32 length = GetLength(source_); if (email) { memcpy(&ptr[idx], "/emailAddress=", 14); idx += 14; - memcpy(&ptr[idx], source_.get_current(), length2); - idx += length2; + memcpy(&ptr[idx], source_.get_current(), length); + idx += length; } - source_.advance(length2); + source_.advance(length); } } ptr[idx++] = 0; diff --git a/extra/yassl/taocrypt/src/hash.cpp b/extra/yassl/taocrypt/src/hash.cpp index 66598177631..c51dc42a909 100644 --- a/extra/yassl/taocrypt/src/hash.cpp +++ b/extra/yassl/taocrypt/src/hash.cpp @@ -108,4 +108,89 @@ void HASHwithTransform::Final(byte* hash) Init(); // reset state } + +#ifdef WORD64_AVAILABLE + +HASH64withTransform::HASH64withTransform(word32 digSz, word32 buffSz) +{ + assert(digSz <= MaxDigestSz); + assert(buffSz <= MaxBufferSz); +} + + +void HASH64withTransform::AddLength(word32 len) +{ + HashLengthType tmp = loLen_; + if ( (loLen_ += len) < tmp) + hiLen_++; // carry low to high + hiLen_ += SafeRightShift<8*sizeof(HashLengthType)>(len); +} + + +// Update digest with data of size len, do in blocks +void HASH64withTransform::Update(const byte* data, word32 len) +{ + // do block size increments + word32 blockSz = getBlockSize(); + byte* local = reinterpret_cast(buffer_); + + while (len) { + word32 add = min(len, blockSz - buffLen_); + memcpy(&local[buffLen_], data, add); + + buffLen_ += add; + data += add; + len -= add; + + if (buffLen_ == blockSz) { + ByteReverseIf(buffer_, buffer_, blockSz, getByteOrder()); + Transform(); + AddLength(blockSz); + buffLen_ = 0; + } + } +} + + +// Final process, place digest in hash +void HASH64withTransform::Final(byte* hash) +{ + word32 blockSz = getBlockSize(); + word32 digestSz = getDigestSize(); + word32 padSz = getPadSize(); + ByteOrder order = getByteOrder(); + + AddLength(buffLen_); // before adding pads + HashLengthType preLoLen = GetBitCountLo(); + HashLengthType preHiLen = GetBitCountHi(); + byte* local = reinterpret_cast(buffer_); + + local[buffLen_++] = 0x80; // add 1 + + // pad with zeros + if (buffLen_ > padSz) { + memset(&local[buffLen_], 0, blockSz - buffLen_); + buffLen_ += blockSz - buffLen_; + + ByteReverseIf(buffer_, buffer_, blockSz, order); + Transform(); + buffLen_ = 0; + } + memset(&local[buffLen_], 0, padSz - buffLen_); + + ByteReverseIf(buffer_, buffer_, padSz, order); + + buffer_[blockSz / sizeof(word64) - 2] = order ? preHiLen : preLoLen; + buffer_[blockSz / sizeof(word64) - 1] = order ? preLoLen : preHiLen; + + Transform(); + ByteReverseIf(digest_, digest_, digestSz, order); + memcpy(hash, digest_, digestSz); + + Init(); // reset state +} + +#endif // WORD64_AVAILABLE + + } // namespace diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index 84255aa8544..419783403ea 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -3390,7 +3390,7 @@ void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a, CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount); SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount); if (n % WORD_BITS != 0) - r.reg_[wordCount-1] %= ((word) 1 << (n % WORD_BITS)); + r.reg_[wordCount-1] %= (1 << (n % WORD_BITS)); } else { diff --git a/extra/yassl/taocrypt/src/sha.cpp b/extra/yassl/taocrypt/src/sha.cpp index 9713940529a..ef165a342ad 100644 --- a/extra/yassl/taocrypt/src/sha.cpp +++ b/extra/yassl/taocrypt/src/sha.cpp @@ -69,6 +69,77 @@ void SHA::Init() hiLen_ = 0; } +void SHA256::Init() +{ + digest_[0] = 0x6A09E667L; + digest_[1] = 0xBB67AE85L; + digest_[2] = 0x3C6EF372L; + digest_[3] = 0xA54FF53AL; + digest_[4] = 0x510E527FL; + digest_[5] = 0x9B05688CL; + digest_[6] = 0x1F83D9ABL; + digest_[7] = 0x5BE0CD19L; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +void SHA224::Init() +{ + digest_[0] = 0xc1059ed8; + digest_[1] = 0x367cd507; + digest_[2] = 0x3070dd17; + digest_[3] = 0xf70e5939; + digest_[4] = 0xffc00b31; + digest_[5] = 0x68581511; + digest_[6] = 0x64f98fa7; + digest_[7] = 0xbefa4fa4; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +#ifdef WORD64_AVAILABLE + +void SHA512::Init() +{ + digest_[0] = W64LIT(0x6a09e667f3bcc908); + digest_[1] = W64LIT(0xbb67ae8584caa73b); + digest_[2] = W64LIT(0x3c6ef372fe94f82b); + digest_[3] = W64LIT(0xa54ff53a5f1d36f1); + digest_[4] = W64LIT(0x510e527fade682d1); + digest_[5] = W64LIT(0x9b05688c2b3e6c1f); + digest_[6] = W64LIT(0x1f83d9abfb41bd6b); + digest_[7] = W64LIT(0x5be0cd19137e2179); + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +void SHA384::Init() +{ + digest_[0] = W64LIT(0xcbbb9d5dc1059ed8); + digest_[1] = W64LIT(0x629a292a367cd507); + digest_[2] = W64LIT(0x9159015a3070dd17); + digest_[3] = W64LIT(0x152fecd8f70e5939); + digest_[4] = W64LIT(0x67332667ffc00b31); + digest_[5] = W64LIT(0x8eb44a8768581511); + digest_[6] = W64LIT(0xdb0c2e0d64f98fa7); + digest_[7] = W64LIT(0x47b5481dbefa4fa4); + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + +#endif // WORD64_AVAILABLE + SHA::SHA(const SHA& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) @@ -81,6 +152,59 @@ SHA::SHA(const SHA& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32), memcpy(buffer_, that.buffer_, BLOCK_SIZE); } + +SHA256::SHA256(const SHA256& that) : HASHwithTransform(DIGEST_SIZE / + sizeof(word32), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +SHA224::SHA224(const SHA224& that) : HASHwithTransform(SHA256::DIGEST_SIZE / + sizeof(word32), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +#ifdef WORD64_AVAILABLE + +SHA512::SHA512(const SHA512& that) : HASH64withTransform(DIGEST_SIZE / + sizeof(word64), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +SHA384::SHA384(const SHA384& that) : HASH64withTransform(SHA512::DIGEST_SIZE / + sizeof(word64), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + +#endif // WORD64_AVAILABLE + + SHA& SHA::operator= (const SHA& that) { SHA tmp(that); @@ -90,6 +214,46 @@ SHA& SHA::operator= (const SHA& that) } +SHA256& SHA256::operator= (const SHA256& that) +{ + SHA256 tmp(that); + Swap(tmp); + + return *this; +} + + +SHA224& SHA224::operator= (const SHA224& that) +{ + SHA224 tmp(that); + Swap(tmp); + + return *this; +} + + +#ifdef WORD64_AVAILABLE + +SHA512& SHA512::operator= (const SHA512& that) +{ + SHA512 tmp(that); + Swap(tmp); + + return *this; +} + + +SHA384& SHA384::operator= (const SHA384& that) +{ + SHA384 tmp(that); + Swap(tmp); + + return *this; +} + +#endif // WORD64_AVAILABLE + + void SHA::Swap(SHA& other) { STL::swap(loLen_, other.loLen_); @@ -101,6 +265,53 @@ void SHA::Swap(SHA& other) } +void SHA256::Swap(SHA256& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +void SHA224::Swap(SHA224& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +#ifdef WORD64_AVAILABLE + +void SHA512::Swap(SHA512& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +void SHA384::Swap(SHA384& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + +#endif // WORD64_AVIALABLE + #ifdef DO_SHA_ASM @@ -203,6 +414,205 @@ void SHA::Transform() } +#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15])) + +#define Ch(x,y,z) (z^(x&(y^z))) +#define Maj(x,y,z) ((x&y)|(z&(x|y))) + +#define a(i) T[(0-i)&7] +#define b(i) T[(1-i)&7] +#define c(i) T[(2-i)&7] +#define d(i) T[(3-i)&7] +#define e(i) T[(4-i)&7] +#define f(i) T[(5-i)&7] +#define g(i) T[(6-i)&7] +#define h(i) T[(7-i)&7] + +#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk0(i));\ + d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i)) + +// for SHA256 +#define S0(x) (rotrFixed(x,2)^rotrFixed(x,13)^rotrFixed(x,22)) +#define S1(x) (rotrFixed(x,6)^rotrFixed(x,11)^rotrFixed(x,25)) +#define s0(x) (rotrFixed(x,7)^rotrFixed(x,18)^(x>>3)) +#define s1(x) (rotrFixed(x,17)^rotrFixed(x,19)^(x>>10)) + + +static const word32 K256[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + + +static void Transform256(word32* digest_, word32* buffer_) +{ + const word32* K = K256; + + word32 W[16]; + word32 T[8]; + + // Copy digest to working vars + memcpy(T, digest_, sizeof(T)); + + // 64 operations, partially loop unrolled + for (unsigned int j = 0; j < 64; j += 16) { + R( 0); R( 1); R( 2); R( 3); + R( 4); R( 5); R( 6); R( 7); + R( 8); R( 9); R(10); R(11); + R(12); R(13); R(14); R(15); + } + + // Add the working vars back into digest + digest_[0] += a(0); + digest_[1] += b(0); + digest_[2] += c(0); + digest_[3] += d(0); + digest_[4] += e(0); + digest_[5] += f(0); + digest_[6] += g(0); + digest_[7] += h(0); + + // Wipe variables + memset(W, 0, sizeof(W)); + memset(T, 0, sizeof(T)); +} + + +// undef for 256 +#undef S0 +#undef S1 +#undef s0 +#undef s1 + + +void SHA256::Transform() +{ + Transform256(digest_, buffer_); +} + + +void SHA224::Transform() +{ + Transform256(digest_, buffer_); +} + + +#ifdef WORD64_AVAILABLE + +static const word64 K512[80] = { + W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd), + W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc), + W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019), + W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118), + W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe), + W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2), + W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1), + W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694), + W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3), + W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65), + W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483), + W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5), + W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210), + W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4), + W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725), + W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70), + W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926), + W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df), + W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8), + W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b), + W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001), + W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30), + W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910), + W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8), + W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53), + W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8), + W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb), + W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3), + W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60), + W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec), + W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9), + W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b), + W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207), + W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178), + W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6), + W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b), + W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493), + W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c), + W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a), + W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817) +}; + + +// for SHA512 +#define S0(x) (rotrFixed(x,28)^rotrFixed(x,34)^rotrFixed(x,39)) +#define S1(x) (rotrFixed(x,14)^rotrFixed(x,18)^rotrFixed(x,41)) +#define s0(x) (rotrFixed(x,1)^rotrFixed(x,8)^(x>>7)) +#define s1(x) (rotrFixed(x,19)^rotrFixed(x,61)^(x>>6)) + + +static void Transform512(word64* digest_, word64* buffer_) +{ + const word64* K = K512; + + word64 W[16]; + word64 T[8]; + + // Copy digest to working vars + memcpy(T, digest_, sizeof(T)); + + // 64 operations, partially loop unrolled + for (unsigned int j = 0; j < 80; j += 16) { + R( 0); R( 1); R( 2); R( 3); + R( 4); R( 5); R( 6); R( 7); + R( 8); R( 9); R(10); R(11); + R(12); R(13); R(14); R(15); + } + + // Add the working vars back into digest + + digest_[0] += a(0); + digest_[1] += b(0); + digest_[2] += c(0); + digest_[3] += d(0); + digest_[4] += e(0); + digest_[5] += f(0); + digest_[6] += g(0); + digest_[7] += h(0); + + // Wipe variables + memset(W, 0, sizeof(W)); + memset(T, 0, sizeof(T)); +} + + +void SHA512::Transform() +{ + Transform512(digest_, buffer_); +} + + +void SHA384::Transform() +{ + Transform512(digest_, buffer_); +} + +#endif // WORD64_AVIALABLE + + #ifdef DO_SHA_ASM // f1(x,y,z) (z^(x &(y^z))) diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp index c0d7aa50f18..9cf9c52b2c7 100644 --- a/extra/yassl/taocrypt/test/test.cpp +++ b/extra/yassl/taocrypt/test/test.cpp @@ -29,6 +29,12 @@ using TaoCrypt::byte; using TaoCrypt::word32; using TaoCrypt::SHA; +using TaoCrypt::SHA256; +using TaoCrypt::SHA224; +#ifdef WORD64_AVAILABLE + using TaoCrypt::SHA512; + using TaoCrypt::SHA384; +#endif using TaoCrypt::MD5; using TaoCrypt::MD2; using TaoCrypt::MD4; @@ -90,6 +96,12 @@ struct testVector { void file_test(int, char**); int sha_test(); +int sha256_test(); +#ifdef WORD64_AVAILABLE + int sha512_test(); + int sha384_test(); +#endif +int sha224_test(); int md5_test(); int md2_test(); int md4_test(); @@ -139,20 +151,20 @@ const byte msgTmp[] = { // "now is the time for all " w/o trailing 0 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; -byte* global_msg = 0; // for block cipher input -byte* global_plain = 0; // for cipher decrypt comparison -byte* global_cipher = 0; // block output +byte* msg = 0; // for block cipher input +byte* plain = 0; // for cipher decrypt comparison +byte* cipher = 0; // block output void taocrypt_test(void* args) { ((func_args*)args)->return_code = -1; // error state - global_msg = NEW_TC byte[24]; - global_plain = NEW_TC byte[24]; - global_cipher = NEW_TC byte[24]; + msg = NEW_TC byte[24]; + plain = NEW_TC byte[24]; + cipher = NEW_TC byte[24]; - memcpy(global_msg, msgTmp, 24); + memcpy(msg, msgTmp, 24); int ret = 0; if ( (ret = sha_test()) ) @@ -160,6 +172,30 @@ void taocrypt_test(void* args) else printf( "SHA test passed!\n"); + if ( (ret = sha256_test()) ) + err_sys("SHA-256 test failed!\n", ret); + else + printf( "SHA-256 test passed!\n"); + + if ( (ret = sha224_test()) ) + err_sys("SHA-224 test failed!\n", ret); + else + printf( "SHA-224 test passed!\n"); + +#ifdef WORD64_AVAILABLE + + if ( (ret = sha512_test()) ) + err_sys("SHA-512 test failed!\n", ret); + else + printf( "SHA-512 test passed!\n"); + + if ( (ret = sha384_test()) ) + err_sys("SHA-384 test failed!\n", ret); + else + printf( "SHA-384 test passed!\n"); + +#endif + if ( (ret = md5_test()) ) err_sys("MD5 test failed!\n", ret); else @@ -237,9 +273,9 @@ void taocrypt_test(void* args) printf( "PKCS12 test passed!\n"); */ - tcArrayDelete(global_cipher); - tcArrayDelete(global_plain); - tcArrayDelete(global_msg); + tcArrayDelete(cipher); + tcArrayDelete(plain); + tcArrayDelete(msg); ((func_args*)args)->return_code = ret; } @@ -328,6 +364,136 @@ int sha_test() } +int sha256_test() +{ + SHA256 sha; + byte hash[SHA256::DIGEST_SIZE]; + + testVector test_sha[] = + { + testVector("abc", + "\xBA\x78\x16\xBF\x8F\x01\xCF\xEA\x41\x41\x40\xDE\x5D\xAE\x22" + "\x23\xB0\x03\x61\xA3\x96\x17\x7A\x9C\xB4\x10\xFF\x61\xF2\x00" + "\x15\xAD"), + testVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "\x24\x8D\x6A\x61\xD2\x06\x38\xB8\xE5\xC0\x26\x93\x0C\x3E\x60" + "\x39\xA3\x3C\xE4\x59\x64\xFF\x21\x67\xF6\xEC\xED\xD4\x19\xDB" + "\x06\xC1") + }; + + int times( sizeof(test_sha) / sizeof(testVector) ); + for (int i = 0; i < times; ++i) { + sha.Update(test_sha[i].input_, test_sha[i].inLen_); + sha.Final(hash); + + if (memcmp(hash, test_sha[i].output_, SHA256::DIGEST_SIZE) != 0) + return -1 - i; + } + + return 0; +} + + +#ifdef WORD64_AVAILABLE + +int sha512_test() +{ + SHA512 sha; + byte hash[SHA512::DIGEST_SIZE]; + + testVector test_sha[] = + { + testVector("abc", + "\xdd\xaf\x35\xa1\x93\x61\x7a\xba\xcc\x41\x73\x49\xae\x20\x41" + "\x31\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2\x0a\x9e\xee\xe6\x4b\x55" + "\xd3\x9a\x21\x92\x99\x2a\x27\x4f\xc1\xa8\x36\xba\x3c\x23\xa3" + "\xfe\xeb\xbd\x45\x4d\x44\x23\x64\x3c\xe8\x0e\x2a\x9a\xc9\x4f" + "\xa5\x4c\xa4\x9f"), + testVector("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi" + "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", + "\x8e\x95\x9b\x75\xda\xe3\x13\xda\x8c\xf4\xf7\x28\x14\xfc\x14" + "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88" + "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4" + "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b" + "\x87\x4b\xe9\x09") + }; + + int times( sizeof(test_sha) / sizeof(testVector) ); + for (int i = 0; i < times; ++i) { + sha.Update(test_sha[i].input_, test_sha[i].inLen_); + sha.Final(hash); + + if (memcmp(hash, test_sha[i].output_, SHA512::DIGEST_SIZE) != 0) + return -1 - i; + } + + return 0; +} + + +int sha384_test() +{ + SHA384 sha; + byte hash[SHA384::DIGEST_SIZE]; + + testVector test_sha[] = + { + testVector("abc", + "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b\xb5\xa0\x3d\x69\x9a\xc6\x50" + "\x07\x27\x2c\x32\xab\x0e\xde\xd1\x63\x1a\x8b\x60\x5a\x43\xff" + "\x5b\xed\x80\x86\x07\x2b\xa1\xe7\xcc\x23\x58\xba\xec\xa1\x34" + "\xc8\x25\xa7"), + testVector("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi" + "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", + "\x09\x33\x0c\x33\xf7\x11\x47\xe8\x3d\x19\x2f\xc7\x82\xcd\x1b" + "\x47\x53\x11\x1b\x17\x3b\x3b\x05\xd2\x2f\xa0\x80\x86\xe3\xb0" + "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91" + "\x74\x60\x39") + }; + + int times( sizeof(test_sha) / sizeof(testVector) ); + for (int i = 0; i < times; ++i) { + sha.Update(test_sha[i].input_, test_sha[i].inLen_); + sha.Final(hash); + + if (memcmp(hash, test_sha[i].output_, SHA384::DIGEST_SIZE) != 0) + return -1 - i; + } + + return 0; +} + +#endif // WORD64_AVAILABLE + + +int sha224_test() +{ + SHA224 sha; + byte hash[SHA224::DIGEST_SIZE]; + + testVector test_sha[] = + { + testVector("abc", + "\x23\x09\x7d\x22\x34\x05\xd8\x22\x86\x42\xa4\x77\xbd\xa2\x55" + "\xb3\x2a\xad\xbc\xe4\xbd\xa0\xb3\xf7\xe3\x6c\x9d\xa7"), + testVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "\x75\x38\x8b\x16\x51\x27\x76\xcc\x5d\xba\x5d\xa1\xfd\x89\x01" + "\x50\xb0\xc6\x45\x5c\xb4\xf5\x8b\x19\x52\x52\x25\x25") + }; + + int times( sizeof(test_sha) / sizeof(testVector) ); + for (int i = 0; i < times; ++i) { + sha.Update(test_sha[i].input_, test_sha[i].inLen_); + sha.Final(hash); + + if (memcmp(hash, test_sha[i].output_, SHA224::DIGEST_SIZE) != 0) + return -1 - i; + } + + return 0; +} + + int md5_test() { MD5 md5; @@ -606,11 +772,11 @@ int des_test() const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; enc.SetKey(key, sizeof(key)); - enc.Process(global_cipher, global_msg, sz); + enc.Process(cipher, msg, sz); dec.SetKey(key, sizeof(key)); - dec.Process(global_plain, global_cipher, sz); + dec.Process(plain, cipher, sz); - if (memcmp(global_plain, global_msg, sz)) + if (memcmp(plain, msg, sz)) return -50; const byte verify1[] = @@ -620,7 +786,7 @@ int des_test() 0x89,0x3d,0x51,0xec,0x4b,0x56,0x3b,0x53 }; - if (memcmp(global_cipher, verify1, sz)) + if (memcmp(cipher, verify1, sz)) return -51; // CBC mode @@ -628,11 +794,11 @@ int des_test() DES_CBC_Decryption dec2; enc2.SetKey(key, sizeof(key), iv); - enc2.Process(global_cipher, global_msg, sz); + enc2.Process(cipher, msg, sz); dec2.SetKey(key, sizeof(key), iv); - dec2.Process(global_plain, global_cipher, sz); + dec2.Process(plain, cipher, sz); - if (memcmp(global_plain, global_msg, sz)) + if (memcmp(plain, msg, sz)) return -52; const byte verify2[] = @@ -642,7 +808,7 @@ int des_test() 0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b }; - if (memcmp(global_cipher, verify2, sz)) + if (memcmp(cipher, verify2, sz)) return -53; // EDE3 CBC mode @@ -664,11 +830,11 @@ int des_test() }; enc3.SetKey(key3, sizeof(key3), iv3); - enc3.Process(global_cipher, global_msg, sz); + enc3.Process(cipher, msg, sz); dec3.SetKey(key3, sizeof(key3), iv3); - dec3.Process(global_plain, global_cipher, sz); + dec3.Process(plain, cipher, sz); - if (memcmp(global_plain, global_msg, sz)) + if (memcmp(plain, msg, sz)) return -54; const byte verify3[] = @@ -678,7 +844,7 @@ int des_test() 0x18,0xbc,0xbb,0x6d,0xd2,0xb1,0x16,0xda }; - if (memcmp(global_cipher, verify3, sz)) + if (memcmp(cipher, verify3, sz)) return -55; return 0; @@ -697,10 +863,10 @@ int aes_test() enc.SetKey(key, bs, iv); dec.SetKey(key, bs, iv); - enc.Process(global_cipher, global_msg, bs); - dec.Process(global_plain, global_cipher, bs); + enc.Process(cipher, msg, bs); + dec.Process(plain, cipher, bs); - if (memcmp(global_plain, global_msg, bs)) + if (memcmp(plain, msg, bs)) return -60; const byte verify[] = @@ -709,7 +875,7 @@ int aes_test() 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb }; - if (memcmp(global_cipher, verify, bs)) + if (memcmp(cipher, verify, bs)) return -61; AES_ECB_Encryption enc2; @@ -718,10 +884,10 @@ int aes_test() enc2.SetKey(key, bs, iv); dec2.SetKey(key, bs, iv); - enc2.Process(global_cipher, global_msg, bs); - dec2.Process(global_plain, global_cipher, bs); + enc2.Process(cipher, msg, bs); + dec2.Process(plain, cipher, bs); - if (memcmp(global_plain, global_msg, bs)) + if (memcmp(plain, msg, bs)) return -62; const byte verify2[] = @@ -730,7 +896,7 @@ int aes_test() 0xc8,0x8c,0x33,0x3b,0xb5,0x8f,0x85,0xd1 }; - if (memcmp(global_cipher, verify2, bs)) + if (memcmp(cipher, verify2, bs)) return -63; return 0; @@ -749,10 +915,10 @@ int twofish_test() enc.SetKey(key, bs, iv); dec.SetKey(key, bs, iv); - enc.Process(global_cipher, global_msg, bs); - dec.Process(global_plain, global_cipher, bs); + enc.Process(cipher, msg, bs); + dec.Process(plain, cipher, bs); - if (memcmp(global_plain, global_msg, bs)) + if (memcmp(plain, msg, bs)) return -60; const byte verify[] = @@ -761,7 +927,7 @@ int twofish_test() 0x21,0x03,0x58,0x79,0x5F,0x02,0x27,0x2C }; - if (memcmp(global_cipher, verify, bs)) + if (memcmp(cipher, verify, bs)) return -61; Twofish_ECB_Encryption enc2; @@ -770,10 +936,10 @@ int twofish_test() enc2.SetKey(key, bs, iv); dec2.SetKey(key, bs, iv); - enc2.Process(global_cipher, global_msg, bs); - dec2.Process(global_plain, global_cipher, bs); + enc2.Process(cipher, msg, bs); + dec2.Process(plain, cipher, bs); - if (memcmp(global_plain, global_msg, bs)) + if (memcmp(plain, msg, bs)) return -62; const byte verify2[] = @@ -782,7 +948,7 @@ int twofish_test() 0xC4,0xCD,0x6B,0x91,0x14,0xC5,0x3A,0x09 }; - if (memcmp(global_cipher, verify2, bs)) + if (memcmp(cipher, verify2, bs)) return -63; return 0; @@ -801,10 +967,10 @@ int blowfish_test() enc.SetKey(key, 16, iv); dec.SetKey(key, 16, iv); - enc.Process(global_cipher, global_msg, bs * 2); - dec.Process(global_plain, global_cipher, bs * 2); + enc.Process(cipher, msg, bs * 2); + dec.Process(plain, cipher, bs * 2); - if (memcmp(global_plain, global_msg, bs)) + if (memcmp(plain, msg, bs)) return -60; const byte verify[] = @@ -813,7 +979,7 @@ int blowfish_test() 0xBC,0xD9,0x08,0xC4,0x94,0x6C,0x89,0xA3 }; - if (memcmp(global_cipher, verify, bs)) + if (memcmp(cipher, verify, bs)) return -61; Blowfish_ECB_Encryption enc2; @@ -822,10 +988,10 @@ int blowfish_test() enc2.SetKey(key, 16, iv); dec2.SetKey(key, 16, iv); - enc2.Process(global_cipher, global_msg, bs * 2); - dec2.Process(global_plain, global_cipher, bs * 2); + enc2.Process(cipher, msg, bs * 2); + dec2.Process(plain, cipher, bs * 2); - if (memcmp(global_plain, global_msg, bs)) + if (memcmp(plain, msg, bs)) return -62; const byte verify2[] = @@ -834,7 +1000,7 @@ int blowfish_test() 0x8F,0xCE,0x39,0x32,0xDE,0xD7,0xBC,0x5B }; - if (memcmp(global_cipher, verify2, bs)) + if (memcmp(cipher, verify2, bs)) return -63; return 0; diff --git a/extra/yassl/testsuite/testsuite.cpp b/extra/yassl/testsuite/testsuite.cpp index 06e75153341..1cf6a78ebe7 100644 --- a/extra/yassl/testsuite/testsuite.cpp +++ b/extra/yassl/testsuite/testsuite.cpp @@ -86,8 +86,8 @@ int main(int argc, char** argv) // input output compare byte input[TaoCrypt::MD5::DIGEST_SIZE]; byte output[TaoCrypt::MD5::DIGEST_SIZE]; - file_test((char*) "input", input); - file_test((char*) "output", output); + file_test("input", input); + file_test("output", output); assert(memcmp(input, output, sizeof(input)) == 0); printf("\nAll tests passed!\n"); @@ -141,17 +141,16 @@ int test_openSSL_des() /* test des encrypt/decrypt */ char data[] = "this is my data "; int dataSz = strlen(data); - DES_key_schedule local_key[3]; + DES_key_schedule key[3]; byte iv[8]; EVP_BytesToKey(EVP_des_ede3_cbc(), EVP_md5(), NULL, (byte*)data, dataSz, 1, - (byte*)local_key, iv); + (byte*)key, iv); byte cipher[16]; - DES_ede3_cbc_encrypt((byte*)data, cipher, dataSz, - &local_key[0], &local_key[1], - &local_key[2], &iv, true); + DES_ede3_cbc_encrypt((byte*)data, cipher, dataSz, &key[0], &key[1], + &key[2], &iv, true); byte plain[16]; - DES_ede3_cbc_encrypt(cipher, plain, 16, &local_key[0], &local_key[1], - &local_key[2], &iv, false); + DES_ede3_cbc_encrypt(cipher, plain, 16, &key[0], &key[1], &key[2], + &iv, false); return 0; } From bd49d8debfc1821cb9d158efb9cdfc55231e54ee Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 14:12:11 +0300 Subject: [PATCH 323/789] Fix for BUG#9504: Stored procedures: execute privilege doesn't make 'use database' okay. The problem was that we didn't check stored-routine privileges in check_grant_db(). The patch adds this check. mysql-test/r/grant.result: Update result file. mysql-test/r/sp-security.result: Update result fil. mysql-test/t/grant.test: Added test case for BUG#9504. mysql-test/t/sp-security.test: Update test. sql/sql_acl.cc: Check stored routines privileges. --- mysql-test/r/grant.result | 47 +++++++++++++++++++ mysql-test/r/sp-security.result | 35 ++++++++++---- mysql-test/t/grant.test | 83 +++++++++++++++++++++++++++++++++ mysql-test/t/sp-security.test | 77 ++++++++++++++++++------------ sql/sql_acl.cc | 31 +++++++++++- 5 files changed, 233 insertions(+), 40 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index d63e4181026..73d5bf94264 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -972,4 +972,51 @@ REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij123456789 ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) GRANT PROCESS ON * TO user@localhost; ERROR 3D000: No database selected +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +DROP DATABASE IF EXISTS mysqltest3; +DROP DATABASE IF EXISTS mysqltest4; +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; +CREATE DATABASE mysqltest3; +CREATE DATABASE mysqltest4; +CREATE PROCEDURE mysqltest1.p_def() SQL SECURITY DEFINER +SELECT 1; +CREATE PROCEDURE mysqltest2.p_inv() SQL SECURITY INVOKER +SELECT 1; +CREATE FUNCTION mysqltest3.f_def() RETURNS INT SQL SECURITY DEFINER +RETURN 1; +CREATE FUNCTION mysqltest4.f_inv() RETURNS INT SQL SECURITY INVOKER +RETURN 1; +GRANT EXECUTE ON PROCEDURE mysqltest1.p_def TO mysqltest_1@localhost; +GRANT EXECUTE ON PROCEDURE mysqltest2.p_inv TO mysqltest_1@localhost; +GRANT EXECUTE ON FUNCTION mysqltest3.f_def TO mysqltest_1@localhost; +GRANT EXECUTE ON FUNCTION mysqltest4.f_inv TO mysqltest_1@localhost; +GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost; + +---> connection: bug9504_con1 +use mysqltest1; +use mysqltest2; +use mysqltest3; +use mysqltest4; +use test; +CALL mysqltest1.p_def(); +1 +1 +CALL mysqltest2.p_inv(); +1 +1 +SELECT mysqltest3.f_def(); +mysqltest3.f_def() +1 +SELECT mysqltest4.f_inv(); +mysqltest4.f_inv() +1 + +---> connection: default +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; +DROP DATABASE mysqltest3; +DROP DATABASE mysqltest4; +DROP USER mysqltest_1@localhost; End of 5.0 tests diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 26b3f352a1f..8462bafe0e3 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -8,22 +8,29 @@ create procedure db1_secret.dummy() begin end; drop procedure db1_secret.dummy; use db1_secret; create table t1 ( u varchar(64), i int ); +insert into t1 values('test', 0); create procedure stamp(i int) insert into db1_secret.t1 values (user(), i); show procedure status like 'stamp'; Db Name Type Definer Modified Created Security_type Comment db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER -create function db() returns varchar(64) return database(); +create function db() returns varchar(64) +begin +declare v varchar(64); +select u into v from t1 limit 1; +return v; +end| show function status like 'db'; Db Name Type Definer Modified Created Security_type Comment db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER call stamp(1); select * from t1; u i +test 0 root@localhost 1 select db(); db() -db1_secret +test grant execute on procedure db1_secret.stamp to user1@'%'; grant execute on function db1_secret.db to user1@'%'; grant execute on procedure db1_secret.stamp to ''@'%'; @@ -31,25 +38,34 @@ grant execute on function db1_secret.db to ''@'%'; call db1_secret.stamp(2); select db1_secret.db(); db1_secret.db() -db1_secret +test select * from db1_secret.t1; ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1' create procedure db1_secret.dummy() begin end; ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret' drop procedure db1_secret.dummy; ERROR 42000: PROCEDURE db1_secret.dummy does not exist +drop procedure db1_secret.stamp; +ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.stamp' +drop function db1_secret.db; +ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.db' call db1_secret.stamp(3); select db1_secret.db(); db1_secret.db() -db1_secret +test select * from db1_secret.t1; ERROR 42000: SELECT command denied to user ''@'localhost' for table 't1' create procedure db1_secret.dummy() begin end; ERROR 42000: Access denied for user ''@'%' to database 'db1_secret' drop procedure db1_secret.dummy; ERROR 42000: PROCEDURE db1_secret.dummy does not exist +drop procedure db1_secret.stamp; +ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.stamp' +drop function db1_secret.db; +ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.db' select * from t1; u i +test 0 root@localhost 1 user1@localhost 2 anon@localhost 3 @@ -64,21 +80,22 @@ db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 IN call stamp(4); select * from t1; u i +test 0 root@localhost 1 user1@localhost 2 anon@localhost 3 root@localhost 4 select db(); db() -db1_secret +test call db1_secret.stamp(5); -ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret' +ERROR 42000: INSERT command denied to user 'user1'@'localhost' for table 't1' select db1_secret.db(); -ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret' +ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1' call db1_secret.stamp(6); -ERROR 42000: Access denied for user ''@'%' to database 'db1_secret' +ERROR 42000: INSERT command denied to user ''@'localhost' for table 't1' select db1_secret.db(); -ERROR 42000: Access denied for user ''@'%' to database 'db1_secret' +ERROR 42000: SELECT command denied to user ''@'localhost' for table 't1' drop database if exists db2; create database db2; use db2; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 82bf011d32f..92ed69d3f4b 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -875,4 +875,87 @@ GRANT PROCESS ON * TO user@localhost; disconnect con1; connection default; + +# +# BUG#9504: Stored procedures: execute privilege doesn't make 'use database' +# okay. +# + +# Prepare. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +DROP DATABASE IF EXISTS mysqltest3; +DROP DATABASE IF EXISTS mysqltest4; +--enable_warnings + +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; +CREATE DATABASE mysqltest3; +CREATE DATABASE mysqltest4; + +CREATE PROCEDURE mysqltest1.p_def() SQL SECURITY DEFINER + SELECT 1; + +CREATE PROCEDURE mysqltest2.p_inv() SQL SECURITY INVOKER + SELECT 1; + +CREATE FUNCTION mysqltest3.f_def() RETURNS INT SQL SECURITY DEFINER + RETURN 1; + +CREATE FUNCTION mysqltest4.f_inv() RETURNS INT SQL SECURITY INVOKER + RETURN 1; + +GRANT EXECUTE ON PROCEDURE mysqltest1.p_def TO mysqltest_1@localhost; +GRANT EXECUTE ON PROCEDURE mysqltest2.p_inv TO mysqltest_1@localhost; +GRANT EXECUTE ON FUNCTION mysqltest3.f_def TO mysqltest_1@localhost; +GRANT EXECUTE ON FUNCTION mysqltest4.f_inv TO mysqltest_1@localhost; + +GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost; + +# Test. + +--connect (bug9504_con1,localhost,mysqltest_1,,) +--echo +--echo ---> connection: bug9504_con1 + +# - Check that we can switch to the db; + +use mysqltest1; + +use mysqltest2; + +use mysqltest3; + +use mysqltest4; + +# - Check that we can call stored routines; + +use test; + +CALL mysqltest1.p_def(); + +CALL mysqltest2.p_inv(); + +SELECT mysqltest3.f_def(); + +SELECT mysqltest4.f_inv(); + +# Cleanup. + +--connection default +--echo +--echo ---> connection: default + +--disconnect bug9504_con1 + +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; +DROP DATABASE mysqltest3; +DROP DATABASE mysqltest4; + +DROP USER mysqltest_1@localhost; + + --echo End of 5.0 tests diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index a5d509f29b7..38c72fd4fa6 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -28,6 +28,7 @@ drop procedure db1_secret.dummy; use db1_secret; create table t1 ( u varchar(64), i int ); +insert into t1 values('test', 0); # A test procedure and function create procedure stamp(i int) @@ -35,7 +36,16 @@ create procedure stamp(i int) --replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' show procedure status like 'stamp'; -create function db() returns varchar(64) return database(); +delimiter |; +create function db() returns varchar(64) +begin + declare v varchar(64); + + select u into v from t1 limit 1; + + return v; +end| +delimiter ;| --replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' show function status like 'db'; @@ -63,14 +73,18 @@ call db1_secret.stamp(2); select db1_secret.db(); # ...but not this ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR select * from db1_secret.t1; # ...and not this ---error 1044 +--error ER_DBACCESS_DENIED_ERROR create procedure db1_secret.dummy() begin end; ---error 1305 +--error ER_SP_DOES_NOT_EXIST drop procedure db1_secret.dummy; +--error ER_PROCACCESS_DENIED_ERROR +drop procedure db1_secret.stamp; +--error ER_PROCACCESS_DENIED_ERROR +drop function db1_secret.db; # @@ -83,14 +97,18 @@ call db1_secret.stamp(3); select db1_secret.db(); # ...but not this ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR select * from db1_secret.t1; # ...and not this ---error 1044 +--error ER_DBACCESS_DENIED_ERROR create procedure db1_secret.dummy() begin end; ---error 1305 +--error ER_SP_DOES_NOT_EXIST drop procedure db1_secret.dummy; +--error ER_PROCACCESS_DENIED_ERROR +drop procedure db1_secret.stamp; +--error ER_PROCACCESS_DENIED_ERROR +drop function db1_secret.db; # @@ -121,9 +139,9 @@ select db(); connection con2user1; # This should not work ---error 1044 +--error ER_TABLEACCESS_DENIED_ERROR call db1_secret.stamp(5); ---error 1044 +--error ER_TABLEACCESS_DENIED_ERROR select db1_secret.db(); # @@ -132,9 +150,9 @@ select db1_secret.db(); connection con3anon; # This should not work ---error 1044 +--error ER_TABLEACCESS_DENIED_ERROR call db1_secret.stamp(6); ---error 1044 +--error ER_TABLEACCESS_DENIED_ERROR select db1_secret.db(); # @@ -165,7 +183,7 @@ use db2; create procedure p () insert into t2 values (1); # Check that this doesn't work. ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR call p(); connect (con4user2,localhost,user2,,); @@ -174,7 +192,7 @@ connection con4user2; use db2; # This should not work, since p is executed with definer's (user1's) rights. ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR call p(); select * from t2; @@ -207,9 +225,9 @@ alter procedure p modifies sql data; drop procedure p; # This should NOT work ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR alter procedure q modifies sql data; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR drop procedure q; connection con1root; @@ -260,30 +278,30 @@ connect (con4userc,localhost,userc,,); connection con2usera; call sptest.p1(1); ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR grant execute on procedure sptest.p1 to userb@localhost; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR drop procedure sptest.p1; connection con3userb; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR call sptest.p1(2); ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR grant execute on procedure sptest.p1 to userb@localhost; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR drop procedure sptest.p1; connection con4userc; call sptest.p1(3); grant execute on procedure sptest.p1 to userb@localhost; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR drop procedure sptest.p1; connection con3userb; call sptest.p1(4); ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR grant execute on procedure sptest.p1 to userb@localhost; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR drop procedure sptest.p1; connection con1root; @@ -332,7 +350,7 @@ delimiter ;// connect (user1,localhost,user1,,test); connection user1; use mysqltest; --- error 1370 +-- error ER_PROCACCESS_DENIED_ERROR select bug_9503(); connection root; @@ -401,13 +419,13 @@ grant usage on *.* to mysqltest_1@localhost; connect (n1,localhost,mysqltest_1,,information_schema,$MASTER_MYPORT,$MASTER_MYSOCK); connection n1; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR call mysqltest_1.p1(); disconnect n1; # Test also without a current database connect (n2,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK); connection n2; ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR call mysqltest_1.p1(); disconnect n2; @@ -433,9 +451,9 @@ end; create user user_bug12812@localhost IDENTIFIED BY 'ABC'| --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK connect (test_user_12812,localhost,user_bug12812,ABC,test)| ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR SELECT test.bug12812()| ---error 1370 +--error ER_PROCACCESS_DENIED_ERROR CREATE VIEW v1 AS SELECT test.bug12812()| # Cleanup connection default| @@ -489,7 +507,8 @@ drop database db_bug14834; # -# BUG#14533: 'desc tbl' in stored procedure causes error 1142 +# BUG#14533: 'desc tbl' in stored procedure causes error +# ER_TABLEACCESS_DENIED_ERROR # create database db_bug14533; use db_bug14533; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ee15f95f305..ebf9385d177 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3893,6 +3893,26 @@ err2: } +static bool check_grant_db_routine(THD *thd, const char *db, HASH *hash) +{ + Security_context *sctx= thd->security_ctx; + + for (uint idx= 0; idx < hash->records; ++idx) + { + GRANT_NAME *item= (GRANT_NAME*) hash_element(hash, idx); + + if (strcmp(item->user, sctx->priv_user) == 0 && + strcmp(item->db, db) == 0 && + compare_hostname(&item->host, sctx->host, sctx->ip)) + { + return FALSE; + } + } + + return TRUE; +} + + /* Check if a user has the right to access a database Access is accepted if he has a grant for any table/routine in the database @@ -3904,9 +3924,10 @@ bool check_grant_db(THD *thd,const char *db) Security_context *sctx= thd->security_ctx; char helping [NAME_LEN+USERNAME_LENGTH+2]; uint len; - bool error= 1; + bool error= TRUE; len= (uint) (strmov(strmov(helping, sctx->priv_user) + 1, db) - helping) + 1; + rw_rdlock(&LOCK_grant); for (uint idx=0 ; idx < column_priv_hash.records ; idx++) @@ -3917,11 +3938,17 @@ bool check_grant_db(THD *thd,const char *db) !memcmp(grant_table->hash_key,helping,len) && compare_hostname(&grant_table->host, sctx->host, sctx->ip)) { - error=0; // Found match + error= FALSE; /* Found match. */ break; } } + + if (error) + error= check_grant_db_routine(thd, db, &proc_priv_hash) && + check_grant_db_routine(thd, db, &func_priv_hash); + rw_unlock(&LOCK_grant); + return error; } From 81a701cb9c6128482a8e4d94eeb42f375fb83a2d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 12:35:30 +0100 Subject: [PATCH 324/789] Backport from 5.1, limit SHOW VARIABLES to "log_bin%" --- mysql-test/r/flush2.result | 16 ++-------------- mysql-test/t/flush2.test | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result index 7c94219fd71..13bcc371ef6 100644 --- a/mysql-test/r/flush2.result +++ b/mysql-test/r/flush2.result @@ -1,24 +1,12 @@ flush logs; set global expire_logs_days = 3; -show variables like 'log%'; +show variables like 'log_bin%'; Variable_name Value -log ON log_bin OFF log_bin_trust_function_creators ON -log_error -log_queries_not_using_indexes OFF -log_slave_updates OFF -log_slow_queries OFF -log_warnings 1 flush logs; -show variables like 'log%'; +show variables like 'log_bin%'; Variable_name Value -log ON log_bin OFF log_bin_trust_function_creators ON -log_error -log_queries_not_using_indexes OFF -log_slave_updates OFF -log_slow_queries OFF -log_warnings 1 set global expire_logs_days = 0; diff --git a/mysql-test/t/flush2.test b/mysql-test/t/flush2.test index fc9e88e3141..7582ab8426b 100644 --- a/mysql-test/t/flush2.test +++ b/mysql-test/t/flush2.test @@ -3,7 +3,7 @@ # flush logs; set global expire_logs_days = 3; -show variables like 'log%'; +show variables like 'log_bin%'; flush logs; -show variables like 'log%'; +show variables like 'log_bin%'; set global expire_logs_days = 0; From 6e1f446ae1f8484e069539c415818d9b9bd511e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 13:38:42 +0200 Subject: [PATCH 325/789] move thr_client_alarm initialization to mysqld.cc (in thr_alarm.cc it happened too late). mysys/thr_alarm.c: move thr_client_alarm initialization to mysqld.cc (here it happened too late) sql/mysqld.cc: move thr_client_alarm initialization to mysqld.cc (in thr_alarm.cc it happened too late). moved thr_kill_signal initialization to init_signals() --- mysys/thr_alarm.c | 4 ---- sql/mysqld.cc | 14 +++++++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 759544af17b..396623dea21 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -78,10 +78,6 @@ void init_thr_alarm(uint max_alarms) sigfillset(&full_signal_set); /* Neaded to block signals */ pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_alarm,NULL); - if (thd_lib_detected == THD_LIB_LT) - thr_client_alarm= SIGALRM; - else - thr_client_alarm= SIGUSR1; #ifndef USE_ALARM_THREAD if (thd_lib_detected != THD_LIB_LT) #endif diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a3263b50951..0e9131389c9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2046,6 +2046,17 @@ static void init_signals(void) struct sigaction sa; DBUG_ENTER("init_signals"); + if (thd_lib_detected == THD_LIB_LT) + { + thr_client_alarm= SIGALRM; + thr_kill_signal= SIGINT; + } + else + { + thr_client_alarm= SIGUSR1; + thr_kill_signal= SIGUSR2; + } + if (test_flags & TEST_SIGINT) { my_sigset(thr_kill_signal, end_thread_signal); @@ -3140,9 +3151,6 @@ int main(int argc, char **argv) MY_INIT(argv[0]); // init my_sys library & pthreads - /* Set signal used to kill MySQL */ - thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2; - #ifdef _CUSTOMSTARTUPCONFIG_ if (_cust_check_startup()) { From 5f62ccb46d764a68e56254bcff5c713d696d89c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 13:39:16 +0100 Subject: [PATCH 326/789] Bug #27070 server logs are created unrequested and in wrong directory mysql-test/t/log_state.test: Remove the "remove_file" for slow.log file, that file will now end up in var/log --- mysql-test/t/log_state.test | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test index e772089ce7a..16f466e9b54 100644 --- a/mysql-test/t/log_state.test +++ b/mysql-test/t/log_state.test @@ -136,4 +136,3 @@ disconnect con1; # Remove the log files that was created in the "default location" # i.e var/run --remove_file $MYSQLTEST_VARDIR/run/master.log ---remove_file $MYSQLTEST_VARDIR/run/master-slow.log From a80c9cced4c9f8201182aeae3f295dd90029a48e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 13:52:03 +0100 Subject: [PATCH 327/789] Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes ndb/include/kernel/signaldata/DictTabInfo.hpp: add single user mode field in table definition ndb/include/ndb_constants.h: new constants for single usermode option of tables ndb/include/ndbapi/NdbDictionary.hpp: add single user mode field in table definition ndb/src/common/debugger/signaldata/DictTabInfo.cpp: add single user mode field in table definition ndb/src/kernel/blocks/dbdict/Dbdict.cpp: add single user mode field in table definition send this infor to TC ndb/src/kernel/blocks/dbdict/Dbdict.hpp: add single user mode field in table definition ndb/src/kernel/blocks/dbtc/Dbtc.hpp: single user table mode on table object merge some flags from uint8 to bits get allow transaction to also check single user mode ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: single user table mode on table object merge some flags from uint8 to bits get allow transaction to also check single user mode ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: set single user mode flag on system tables to make them always updatable ndb/src/ndbapi/NdbDictionary.cpp: get/set functions for single user mode on tables ndb/src/ndbapi/NdbDictionaryImpl.cpp: get/set functions for single user mode on tables ndb/src/ndbapi/NdbDictionaryImpl.hpp: get/set functions for single user mode on tables ndb/test/src/NDBT_Table.cpp: print single user mode --- ndb/include/kernel/signaldata/DictTabInfo.hpp | 5 +- ndb/include/ndb_constants.h | 7 ++ ndb/include/ndbapi/NdbDictionary.hpp | 16 ++++ .../debugger/signaldata/DictTabInfo.cpp | 3 + ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 9 +- ndb/src/kernel/blocks/dbdict/Dbdict.hpp | 5 ++ ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 24 +++-- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 87 ++++++++++++------- ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 1 + ndb/src/ndbapi/NdbDictionary.cpp | 12 +++ ndb/src/ndbapi/NdbDictionaryImpl.cpp | 17 +++- ndb/src/ndbapi/NdbDictionaryImpl.hpp | 1 + ndb/test/src/NDBT_Table.cpp | 2 +- 13 files changed, 143 insertions(+), 46 deletions(-) diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 81bc95e5128..01231743a18 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -126,6 +126,8 @@ public: MinRowsLow = 143, MinRowsHigh = 144, + SingleUserMode = 152, + TableEnd = 999, AttributeName = 1000, // String, Mandatory @@ -273,7 +275,8 @@ public: Uint32 MaxRowsHigh; Uint32 MinRowsLow; Uint32 MinRowsHigh; - + Uint32 SingleUserMode; + void init(); }; diff --git a/ndb/include/ndb_constants.h b/ndb/include/ndb_constants.h index e4f46926498..e37392ca80e 100644 --- a/ndb/include/ndb_constants.h +++ b/ndb/include/ndb_constants.h @@ -68,4 +68,11 @@ #define NDB_TYPE_MAX 31 +/* + * Table single user mode + */ +#define NDB_SUM_LOCKED 0 +#define NDB_SUM_READONLY 1 +#define NDB_SUM_READ_WRITE 2 + #endif diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 3e87c30d7b2..34686dd4db1 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -497,6 +497,15 @@ public: */ class Table : public Object { public: + /* + * Single user mode specifies access rights to table during single user mode + */ + enum SingleUserMode { + SingleUserModeLocked = NDB_SUM_LOCKED, + SingleUserModeReadOnly = NDB_SUM_READONLY, + SingleUserModeReadWrite = NDB_SUM_READ_WRITE + }; + /** * @name General * @{ @@ -735,6 +744,13 @@ public: void setMinRows(Uint64 minRows); Uint64 getMinRows() const; + /** + * Set/Get SingleUserMode + */ + void setSingleUserMode(enum SingleUserMode); + enum SingleUserMode getSingleUserMode() const; + + /** @} *******************************************************************/ #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL diff --git a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp index 66c9c978762..5520d0f4d9f 100644 --- a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp +++ b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp @@ -51,6 +51,7 @@ DictTabInfo::TableMapping[] = { DTIMAP(Table, MaxRowsHigh, MaxRowsHigh), DTIMAP(Table, MinRowsLow, MinRowsLow), DTIMAP(Table, MinRowsHigh, MinRowsHigh), + DTIMAP(Table, SingleUserMode, SingleUserMode), DTIBREAK(AttributeName) }; @@ -131,6 +132,8 @@ DictTabInfo::Table::init(){ MaxRowsHigh = 0; MinRowsLow = 0; MinRowsHigh = 0; + + SingleUserMode = 0; } void diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 16964ec443f..190c2f9fb14 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -289,7 +289,7 @@ Dbdict::packTableIntoPagesImpl(SimpleProperties::Writer & w, w.add(DictTabInfo::MaxRowsHigh, tablePtr.p->maxRowsHigh); w.add(DictTabInfo::MinRowsLow, tablePtr.p->minRowsLow); w.add(DictTabInfo::MinRowsHigh, tablePtr.p->minRowsHigh); - + w.add(DictTabInfo::SingleUserMode, tablePtr.p->singleUserMode); if(!signal) { w.add(DictTabInfo::FragmentCount, tablePtr.p->fragmentCount); @@ -1500,6 +1500,7 @@ void Dbdict::initialiseTableRecord(TableRecordPtr tablePtr) tablePtr.p->maxRowsHigh = 0; tablePtr.p->minRowsLow = 0; tablePtr.p->minRowsHigh = 0; + tablePtr.p->singleUserMode = 0; tablePtr.p->storedTable = true; tablePtr.p->tableType = DictTabInfo::UserTable; tablePtr.p->primaryTableId = RNIL; @@ -4718,8 +4719,9 @@ Dbdict::execTAB_COMMITCONF(Signal* signal){ signal->theData[4] = (Uint32)tabPtr.p->tableType; signal->theData[5] = createTabPtr.p->key; signal->theData[6] = (Uint32)tabPtr.p->noOfPrimkey; - - sendSignal(DBTC_REF, GSN_TC_SCHVERREQ, signal, 7, JBB); + signal->theData[7] = (Uint32)tabPtr.p->singleUserMode; + + sendSignal(DBTC_REF, GSN_TC_SCHVERREQ, signal, 8, JBB); return; } @@ -5084,6 +5086,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, tablePtr.p->maxRowsHigh = tableDesc.MaxRowsHigh; tablePtr.p->minRowsLow = tableDesc.MinRowsLow; tablePtr.p->minRowsHigh = tableDesc.MinRowsHigh; + tablePtr.p->singleUserMode = tableDesc.SingleUserMode; Uint64 maxRows = (((Uint64)tablePtr.p->maxRowsHigh) << 32) + tablePtr.p->maxRowsLow; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 49b85affdcd..e1c5306b7a0 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -237,6 +237,11 @@ public: char frmData[MAX_FRM_DATA_SIZE]; Uint32 fragmentCount; + + /* + * Access rights to table during single user mode + */ + Uint8 singleUserMode; }; typedef Ptr TableRecordPtr; diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index 988aa091127..d0476895646 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -702,6 +702,7 @@ public: Uint8 tckeyrec; // Ändrad från R Uint8 tcindxrec; Uint8 apiFailState; // Ändrad från R + Uint8 singleUserMode; ReturnSignal returnsignal; Uint8 timeOutCounter; @@ -957,17 +958,28 @@ public: /********************************************************/ struct TableRecord { Uint32 currentSchemaVersion; - Uint8 enabled; - Uint8 dropping; + Uint16 m_flags; Uint8 tableType; - Uint8 storedTable; + Uint8 singleUserMode; + + enum { + TR_ENABLED = 1 << 0, + TR_DROPPING = 1 << 1, + TR_STORED_TABLE = 1 << 2 + }; + Uint8 get_enabled() const { return (m_flags & TR_ENABLED) != 0; } + Uint8 get_dropping() const { return (m_flags & TR_DROPPING) != 0; } + Uint8 get_storedTable() const { return (m_flags & TR_STORED_TABLE) != 0; } + void set_enabled(Uint8 f) { f ? m_flags |= (Uint16)TR_ENABLED : m_flags &= ~(Uint16)TR_ENABLED; } + void set_dropping(Uint8 f) { f ? m_flags |= (Uint16)TR_DROPPING : m_flags &= ~(Uint16)TR_DROPPING; } + void set_storedTable(Uint8 f) { f ? m_flags |= (Uint16)TR_STORED_TABLE : m_flags &= ~(Uint16)TR_STORED_TABLE; } Uint8 noOfKeyAttr; Uint8 hasCharAttr; Uint8 noOfDistrKeys; bool checkTable(Uint32 schemaVersion) const { - return enabled && !dropping && + return get_enabled() && !get_dropping() && (table_version_major(schemaVersion) == table_version_major(currentSchemaVersion)); } @@ -1835,10 +1847,10 @@ private: Uint32 transid2); void removeMarkerForFailedAPI(Signal* signal, Uint32 nodeId, Uint32 bucket); - bool getAllowStartTransaction(Uint32 nodeId) const { + bool getAllowStartTransaction(Uint32 nodeId, Uint32 table_single_user_mode) const { if (unlikely(getNodeState().getSingleUserMode())) { - if (getNodeState().getSingleUserApi() == nodeId) + if (getNodeState().getSingleUserApi() == nodeId || table_single_user_mode) return true; else return false; diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 82c8e4a9634..61f25141907 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -327,19 +327,21 @@ void Dbtc::execTC_SCHVERREQ(Signal* signal) tabptr.i = signal->theData[0]; ptrCheckGuard(tabptr, ctabrecFilesize, tableRecord); tabptr.p->currentSchemaVersion = signal->theData[1]; - tabptr.p->storedTable = (bool)signal->theData[2]; + tabptr.p->m_flags = 0; + tabptr.p->set_storedTable((bool)signal->theData[2]); BlockReference retRef = signal->theData[3]; tabptr.p->tableType = (Uint8)signal->theData[4]; BlockReference retPtr = signal->theData[5]; Uint32 noOfKeyAttr = signal->theData[6]; + tabptr.p->singleUserMode = (Uint8)signal->theData[7]; ndbrequire(noOfKeyAttr <= MAX_ATTRIBUTES_IN_INDEX); const KeyDescriptor* desc = g_key_descriptor_pool.getPtr(tabptr.i); ndbrequire(noOfKeyAttr == desc->noOfKeyAttr); - ndbrequire(tabptr.p->enabled == false); - tabptr.p->enabled = true; - tabptr.p->dropping = false; + ndbrequire(tabptr.p->get_enabled() == false); + tabptr.p->set_enabled(true); + tabptr.p->set_dropping(false); tabptr.p->noOfKeyAttr = desc->noOfKeyAttr; tabptr.p->hasCharAttr = desc->hasCharAttr; tabptr.p->noOfDistrKeys = desc->noOfDistrKeys; @@ -363,7 +365,7 @@ Dbtc::execPREP_DROP_TAB_REQ(Signal* signal) Uint32 senderRef = req->senderRef; Uint32 senderData = req->senderData; - if(!tabPtr.p->enabled){ + if(!tabPtr.p->get_enabled()){ jam(); PrepDropTabRef* ref = (PrepDropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -375,7 +377,7 @@ Dbtc::execPREP_DROP_TAB_REQ(Signal* signal) return; } - if(tabPtr.p->dropping){ + if(tabPtr.p->get_dropping()){ jam(); PrepDropTabRef* ref = (PrepDropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -387,7 +389,7 @@ Dbtc::execPREP_DROP_TAB_REQ(Signal* signal) return; } - tabPtr.p->dropping = true; + tabPtr.p->set_dropping(true); tabPtr.p->dropTable.senderRef = senderRef; tabPtr.p->dropTable.senderData = senderData; @@ -423,7 +425,7 @@ Dbtc::execWAIT_DROP_TAB_CONF(Signal* signal) tabPtr.i = conf->tableId; ptrCheckGuard(tabPtr, ctabrecFilesize, tableRecord); - ndbrequire(tabPtr.p->dropping == true); + ndbrequire(tabPtr.p->get_dropping() == true); Uint32 nodeId = refToNode(conf->senderRef); tabPtr.p->dropTable.waitDropTabCount.clearWaitingFor(nodeId); @@ -453,7 +455,7 @@ Dbtc::execWAIT_DROP_TAB_REF(Signal* signal) tabPtr.i = ref->tableId; ptrCheckGuard(tabPtr, ctabrecFilesize, tableRecord); - ndbrequire(tabPtr.p->dropping == true); + ndbrequire(tabPtr.p->get_dropping() == true); Uint32 nodeId = refToNode(ref->senderRef); tabPtr.p->dropTable.waitDropTabCount.clearWaitingFor(nodeId); @@ -490,7 +492,7 @@ Dbtc::checkWaitDropTabFailedLqh(Signal* signal, Uint32 nodeId, Uint32 tableId) for(Uint32 i = 0; ienabled && tabPtr.p->dropping){ + if(tabPtr.p->get_enabled() && tabPtr.p->get_dropping()){ if(tabPtr.p->dropTable.waitDropTabCount.isWaitingFor(nodeId)){ jam(); conf->senderRef = calcLqhBlockRef(nodeId); @@ -531,7 +533,7 @@ Dbtc::execDROP_TAB_REQ(Signal* signal) Uint32 senderData = req->senderData; DropTabReq::RequestType rt = (DropTabReq::RequestType)req->requestType; - if(!tabPtr.p->enabled && rt == DropTabReq::OnlineDropTab){ + if(!tabPtr.p->get_enabled() && rt == DropTabReq::OnlineDropTab){ jam(); DropTabRef* ref = (DropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -543,7 +545,7 @@ Dbtc::execDROP_TAB_REQ(Signal* signal) return; } - if(!tabPtr.p->dropping && rt == DropTabReq::OnlineDropTab){ + if(!tabPtr.p->get_dropping() && rt == DropTabReq::OnlineDropTab){ jam(); DropTabRef* ref = (DropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); @@ -555,8 +557,8 @@ Dbtc::execDROP_TAB_REQ(Signal* signal) return; } - tabPtr.p->enabled = false; - tabPtr.p->dropping = false; + tabPtr.p->set_enabled(false); + tabPtr.p->set_dropping(false); DropTabConf * conf = (DropTabConf*)signal->getDataPtrSend(); conf->tableId = tabPtr.i; @@ -1214,8 +1216,7 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) break; case NodeState::SL_STOPPING_1: case NodeState::SL_STOPPING_2: - if (getNodeState().getSingleUserMode() && - getNodeState().getSingleUserApi() == senderNodeId) + if (getNodeState().getSingleUserMode()) break; case NodeState::SL_STOPPING_3: case NodeState::SL_STOPPING_4: @@ -1225,9 +1226,6 @@ void Dbtc::execTCSEIZEREQ(Signal* signal) errCode = ZNODE_SHUTDOWN_IN_PROGRESS; break; case NodeState::SL_SINGLEUSER: - if (getNodeState().getSingleUserApi() == senderNodeId) - break; - errCode = ZCLUSTER_IN_SINGLEUSER_MODE; break; default: errCode = ZWRONG_STATE; @@ -2397,6 +2395,7 @@ void Dbtc::initApiConnectRec(Signal* signal, regApiPtr->buddyPtr = RNIL; regApiPtr->currSavePointId = 0; regApiPtr->m_transaction_nodes.clear(); + regApiPtr->singleUserMode = 0; // Trigger data releaseFiredTriggerData(®ApiPtr->theFiredTriggers), // Index data @@ -2550,9 +2549,12 @@ void Dbtc::execTCKEYREQ(Signal* signal) bool isIndexOpReturn = regApiPtr->indexOpReturn; regApiPtr->isIndexOp = false; // Reset marker regApiPtr->m_exec_flag |= TexecFlag; + TableRecordPtr localTabptr; + localTabptr.i = TtabIndex; + localTabptr.p = &tableRecord[TtabIndex]; switch (regApiPtr->apiConnectstate) { case CS_CONNECTED:{ - if (TstartFlag == 1 && getAllowStartTransaction(sendersNodeId) == true){ + if (TstartFlag == 1 && getAllowStartTransaction(sendersNodeId, localTabptr.p->singleUserMode) == true){ //--------------------------------------------------------------------- // Initialise API connect record if transaction is started. //--------------------------------------------------------------------- @@ -2560,7 +2562,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) initApiConnectRec(signal, regApiPtr); regApiPtr->m_exec_flag = TexecFlag; } else { - if(getAllowStartTransaction(sendersNodeId) == true){ + if(getAllowStartTransaction(sendersNodeId, localTabptr.p->singleUserMode) == true){ /*------------------------------------------------------------------ * WE EXPECTED A START TRANSACTION. SINCE NO OPERATIONS HAVE BEEN * RECEIVED WE INDICATE THIS BY SETTING FIRST_TC_CONNECT TO RNIL TO @@ -2587,6 +2589,13 @@ void Dbtc::execTCKEYREQ(Signal* signal) * the state will be CS_STARTED */ jam(); + if (unlikely(getNodeState().getSingleUserMode()) && + getNodeState().getSingleUserApi() != sendersNodeId && + !localTabptr.p->singleUserMode) + { + TCKEY_abort(signal, TexecFlag ? 60 : 57); + return; + } initApiConnectRec(signal, regApiPtr); regApiPtr->m_exec_flag = TexecFlag; } else { @@ -2607,6 +2616,10 @@ void Dbtc::execTCKEYREQ(Signal* signal) case CS_ABORTING: if (regApiPtr->abortState == AS_IDLE) { if (TstartFlag == 1) { + if(getAllowStartTransaction(sendersNodeId, localTabptr.p->singleUserMode) == false){ + TCKEY_abort(signal, TexecFlag ? 60 : 57); + return; + } //-------------------------------------------------------------------- // Previous transaction had been aborted and the abort was completed. // It is then OK to start a new transaction again. @@ -2670,9 +2683,6 @@ void Dbtc::execTCKEYREQ(Signal* signal) return; }//switch - TableRecordPtr localTabptr; - localTabptr.i = TtabIndex; - localTabptr.p = &tableRecord[TtabIndex]; if (localTabptr.p->checkTable(tcKeyReq->tableSchemaVersion)) { ; } else { @@ -2731,6 +2741,8 @@ void Dbtc::execTCKEYREQ(Signal* signal) regTcPtr->savePointId = regApiPtr->currSavePointId; regApiPtr->executingIndexOp = RNIL; + regApiPtr->singleUserMode |= 1 << localTabptr.p->singleUserMode; + if (TcKeyReq::getExecutingTrigger(Treqinfo)) { // Save the TcOperationPtr for fireing operation regTcPtr->triggeringOperation = TsenderData; @@ -2862,7 +2874,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) * THIS VARIABLE CONTROLS THE INTERVAL BETWEEN LCP'S AND * TEMP TABLES DON'T PARTICIPATE. * -------------------------------------------------------------------- */ - if (localTabptr.p->storedTable) { + if (localTabptr.p->get_storedTable()) { coperationsize = ((Toperationsize + TattrLen) + TkeyLength) + 17; } c_counters.cwriteCount = TwriteCount + 1; @@ -4721,6 +4733,7 @@ void Dbtc::copyApi(Signal* signal) regApiPtr->lqhkeyconfrec = Tlqhkeyconfrec; regApiPtr->commitAckMarker = TcommitAckMarker; regApiPtr->m_transaction_nodes = Tnodes; + regApiPtr->singleUserMode = 0; gcpPtr.i = TgcpPointer; ptrCheckGuard(gcpPtr, TgcpFilesize, localGcpRecord); @@ -4732,6 +4745,7 @@ void Dbtc::copyApi(Signal* signal) regTmpApiPtr->firstTcConnect = RNIL; regTmpApiPtr->lastTcConnect = RNIL; regTmpApiPtr->m_transaction_nodes.clear(); + regTmpApiPtr->singleUserMode = 0; releaseAllSeizedIndexOperations(regTmpApiPtr); }//Dbtc::copyApi() @@ -6237,8 +6251,9 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) { apiConnectptr.i = api_con_ptr; ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); - if (getNodeState().getSingleUserApi() == - refToNode(apiConnectptr.p->ndbapiBlockref)) + if ((getNodeState().getSingleUserApi() == + refToNode(apiConnectptr.p->ndbapiBlockref)) || + !(apiConnectptr.p->singleUserMode & (1 << NDB_SUM_LOCKED))) { // api allowed during single user, use original timeout time_out_value= @@ -8181,6 +8196,7 @@ void Dbtc::initApiConnectFail(Signal* signal) apiConnectptr.p->ndbapiConnect = 0; apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; setApiConTimer(apiConnectptr.i, 0, __LINE__); switch(ttransStatus){ case LqhTransConf::Committed: @@ -10076,6 +10092,7 @@ void Dbtc::initApiConnect(Signal* signal) apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; }//for apiConnectptr.i = tiacTmp - 1; ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); @@ -10104,6 +10121,7 @@ void Dbtc::initApiConnect(Signal* signal) apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; }//for apiConnectptr.i = (2 * tiacTmp) - 1; ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); @@ -10132,6 +10150,7 @@ void Dbtc::initApiConnect(Signal* signal) apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; }//for apiConnectptr.i = (3 * tiacTmp) - 1; ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); @@ -10316,10 +10335,11 @@ void Dbtc::initTable(Signal* signal) refresh_watch_dog(); ptrAss(tabptr, tableRecord); tabptr.p->currentSchemaVersion = 0; - tabptr.p->storedTable = true; + tabptr.p->m_flags = 0; + tabptr.p->set_storedTable(true); tabptr.p->tableType = 0; - tabptr.p->enabled = false; - tabptr.p->dropping = false; + tabptr.p->set_enabled(false); + tabptr.p->set_dropping(false); tabptr.p->noOfKeyAttr = 0; tabptr.p->hasCharAttr = 0; tabptr.p->noOfDistrKeys = 0; @@ -10452,6 +10472,7 @@ void Dbtc::releaseAbortResources(Signal* signal) apiConnectptr.p->firstTcConnect = RNIL; apiConnectptr.p->lastTcConnect = RNIL; apiConnectptr.p->m_transaction_nodes.clear(); + apiConnectptr.p->singleUserMode = 0; // MASV let state be CS_ABORTING until all // signals in the "air" have been received. Reset to CS_CONNECTED @@ -11130,7 +11151,7 @@ void Dbtc::execABORT_ALL_REQ(Signal* signal) const Uint32 senderData = req->senderData; const BlockReference senderRef = req->senderRef; - if(getAllowStartTransaction(refToNode(senderRef)) == true && !getNodeState().getSingleUserMode()){ + if(getAllowStartTransaction(refToNode(senderRef), 0) == true && !getNodeState().getSingleUserMode()){ jam(); ref->senderData = senderData; @@ -13366,9 +13387,9 @@ void Dbtc::deleteFromIndexTable(Signal* signal, Uint32 Dbtc::TableRecord::getErrorCode(Uint32 schemaVersion) const { - if(!enabled) + if(!get_enabled()) return ZNO_SUCH_TABLE; - if(dropping) + if(get_dropping()) return ZDROP_TABLE_IN_PROGRESS; if(table_version_major(schemaVersion) != table_version_major(currentSchemaVersion)) return ZWRONG_SCHEMA_VERSION_ERROR; diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 26e8f246293..e5fdc98edaa 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -1645,6 +1645,7 @@ void Ndbcntr::createSystableLab(Signal* signal, unsigned index) //w.add(DictTabInfo::NoOfVariable, (Uint32)0); //w.add(DictTabInfo::KeyLength, 1); w.add(DictTabInfo::TableTypeVal, (Uint32)table.tableType); + w.add(DictTabInfo::SingleUserMode, (Uint32)NDB_SUM_READ_WRITE); for (unsigned i = 0; i < table.columnCount; i++) { const SysColumn& column = table.columnList[i]; diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 747954f4532..0a52f62aa01 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -430,6 +430,18 @@ NdbDictionary::Table::getFrmLength() const { return m_impl.m_frm.length(); } +enum NdbDictionary::Table::SingleUserMode +NdbDictionary::Table::getSingleUserMode() const +{ + return (enum SingleUserMode)m_impl.m_single_user_mode; +} + +void +NdbDictionary::Table::setSingleUserMode(enum NdbDictionary::Table::SingleUserMode mode) +{ + m_impl.m_single_user_mode = (Uint8)mode; +} + void NdbDictionary::Table::setFrm(const void* data, Uint32 len){ m_impl.m_frm.assign(data, len); diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index c622332f11f..a3fd5c0ef7a 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -318,6 +318,7 @@ NdbTableImpl::init(){ m_replicaCount= 0; m_min_rows = 0; m_max_rows = 0; + m_single_user_mode = 0; } bool @@ -378,6 +379,14 @@ NdbTableImpl::equal(const NdbTableImpl& obj) const DBUG_RETURN(false); } + if(m_single_user_mode != obj.m_single_user_mode) + { + DBUG_PRINT("info",("m_single_user_mode %d != %d", + (int32)m_single_user_mode, + (int32)obj.m_single_user_mode)); + DBUG_RETURN(false); + } + DBUG_RETURN(true); } @@ -403,7 +412,8 @@ NdbTableImpl::assign(const NdbTableImpl& org) m_kvalue = org.m_kvalue; m_minLoadFactor = org.m_minLoadFactor; m_maxLoadFactor = org.m_maxLoadFactor; - + m_single_user_mode = org.m_single_user_mode; + if (m_index != 0) delete m_index; m_index = org.m_index; @@ -1191,6 +1201,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, impl->m_kvalue = tableDesc.TableKValue; impl->m_minLoadFactor = tableDesc.MinLoadFactor; impl->m_maxLoadFactor = tableDesc.MaxLoadFactor; + impl->m_single_user_mode = tableDesc.SingleUserMode; impl->m_indexType = (NdbDictionary::Index::Type) getApiConstant(tableDesc.TableType, @@ -1519,12 +1530,14 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, tmpTab.MaxRowsLow = (Uint32)(impl.m_max_rows & 0xFFFFFFFF); tmpTab.MinRowsHigh = (Uint32)(impl.m_min_rows >> 32); tmpTab.MinRowsLow = (Uint32)(impl.m_min_rows & 0xFFFFFFFF); - + Uint64 maxRows = (((Uint64)tmpTab.MaxRowsHigh) << 32) + tmpTab.MaxRowsLow; Uint64 minRows = (((Uint64)tmpTab.MinRowsHigh) << 32) + tmpTab.MinRowsLow; + tmpTab.SingleUserMode = impl.m_single_user_mode; + tmpTab.FragmentType = getKernelConstant(impl.m_fragmentType, fragmentTypeMapping, DictTabInfo::AllNodesSmallTable); diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index ed86f66ee11..6d58a703a3c 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -138,6 +138,7 @@ public: int m_maxLoadFactor; Uint16 m_keyLenInWords; Uint16 m_fragmentCount; + Uint8 m_single_user_mode; NdbDictionaryImpl * m_dictionary; NdbIndexImpl * m_index; diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp index 1d1896eee7f..8200747fc96 100644 --- a/ndb/test/src/NDBT_Table.cpp +++ b/ndb/test/src/NDBT_Table.cpp @@ -31,7 +31,7 @@ operator <<(class NdbOut& ndbout, const NDBT_Table & tab) ndbout << "Number of attributes: " << tab.getNoOfColumns() << endl; ndbout << "Number of primary keys: " << tab.getNoOfPrimaryKeys() << endl; ndbout << "Length of frm data: " << tab.getFrmLength() << endl; - + ndbout << "SingleUserMode: " << tab.getSingleUserMode() << endl; //<< ((tab.getTupleKey() == TupleId) ? " tupleid" : "") < Date: Fri, 23 Mar 2007 14:16:31 +0100 Subject: [PATCH 328/789] correction of merge --- storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 4e382750134..e6d914f9a20 100644 --- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -6140,7 +6140,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, tablePtr.p->minRowsHigh = c_tableDesc.MinRowsHigh; tablePtr.p->defaultNoPartFlag = c_tableDesc.DefaultNoPartFlag; tablePtr.p->linearHashFlag = c_tableDesc.LinearHashFlag; - tablePtr.p->singleUserMode = tableDesc.SingleUserMode; + tablePtr.p->singleUserMode = c_tableDesc.SingleUserMode; Uint64 maxRows = (((Uint64)tablePtr.p->maxRowsHigh) << 32) + tablePtr.p->maxRowsLow; From 4a76ac5fa6e844c78ec565c2e15ac88f0bb9a8a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 17:12:58 +0200 Subject: [PATCH 329/789] Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit was not restored at the end of SF() invocation, where SF() modified non-ta table. As the result of this artifact it was not possible to detect whether there were any side-effects when top-level query ends. If the top level query table was not modified and the bit is lost there would be no binlogging. Fixed with preserving the bit inside of thd->no_trans_update struct. The struct agregates two bool flags telling whether the current query and the current transaction modified any non-ta table. The flags stmt, all are dropped at the end of the query and the transaction. mysql-test/r/sp_trans.result: results will be changed once again after bug#23333 will be fixed. mysql-test/t/sp_trans.test: regression test added sql/ha_ndbcluster.cc: replacing thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit and bool thd->no_trans_update with thd->no_trans_update as struct sql/handler.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/log.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/set_var.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sp_head.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_class.h: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_delete.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_insert.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_load.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_parse.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_table.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_update.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. --- mysql-test/r/sp_trans.result | 32 ++++++++++++++++++++++++ mysql-test/t/sp_trans.test | 30 ++++++++++++++++++++++ sql/ha_ndbcluster.cc | 3 +-- sql/handler.cc | 2 +- sql/log.cc | 4 +-- sql/set_var.cc | 5 ++-- sql/sp_head.cc | 6 ++--- sql/sql_class.h | 8 ++++-- sql/sql_delete.cc | 4 +-- sql/sql_insert.cc | 18 +++++++------- sql/sql_load.cc | 16 ++++++------ sql/sql_parse.cc | 31 +++++++++++++---------- sql/sql_table.cc | 2 +- sql/sql_update.cc | 48 ++++++++++++++++++------------------ 14 files changed, 140 insertions(+), 69 deletions(-) diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 564e31c9e32..513bbc43ce3 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -530,3 +530,35 @@ count(*) drop table t3, t4| drop procedure bug14210| set @@session.max_heap_table_size=default| +drop function if exists bug23333| +drop table if exists t1,t2| +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| +CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| +reset master| +insert into t2 values (1,1)| +create function bug23333() +RETURNS int(11) +DETERMINISTIC +begin +insert into t1 values (null); +select count(*) from t1 into @a; +return @a; +end| +insert into t2 values (bug23333(),1)| +ERROR 23000: Duplicate entry '1' for key 1 +show binlog events /* must show the insert */| +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server ver: 5.0.40-debug-log, Binlog ver: 4 +master-bin.000001 98 Query 1 90 use `test`; insert into t2 values (1,1) +master-bin.000001 188 Xid 1 215 COMMIT /* xid=1165 */ +master-bin.000001 215 Query 1 446 use `test`; CREATE DEFINER=`root`@`localhost` function bug23333() +RETURNS int(11) +DETERMINISTIC +begin +insert into t1 values (null); +select count(*) from t1 into @a; +return @a; +end +select count(*),@a from t1 /* must be 1,1 */| +count(*) @a +1 1 diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 1ea32316f1e..579af44f28d 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -553,6 +553,36 @@ drop procedure bug14210| set @@session.max_heap_table_size=default| +# +# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog +# Bug #23333 stored function + non-transac table + transac table = +# breaks stmt-based binlog +# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() +# +--disable_warnings +drop function if exists bug23333| +drop table if exists t1,t2| +--enable_warnings + CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| + CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| + +reset master| +insert into t2 values (1,1)| + +create function bug23333() +RETURNS int(11) +DETERMINISTIC +begin + insert into t1 values (null); + select count(*) from t1 into @a; + return @a; +end| + +--error ER_DUP_ENTRY +insert into t2 values (bug23333(),1)| +show binlog events /* must show the insert */| +select count(*),@a from t1 /* must be 1,1 */| + # # BUG#NNNN: New bug synopsis # diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7a9c7d0d021..10567ca2d70 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3636,8 +3636,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) { m_transaction_on= FALSE; /* Would be simpler if has_transactions() didn't always say "yes" */ - thd->options|= OPTION_STATUS_NO_TRANS_UPDATE; - thd->no_trans_update= TRUE; + thd->no_trans_update= {TRUE, TRUE}; } else if (!thd->transaction.on) m_transaction_on= FALSE; diff --git a/sql/handler.cc b/sql/handler.cc index 5a27e470d70..076c6628fa0 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -830,7 +830,7 @@ int ha_rollback_trans(THD *thd, bool all) the error log; but we don't want users to wonder why they have this message in the error log, so we don't send it. */ - if (is_real_trans && (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && + if (is_real_trans && thd->no_trans_update.all && !thd->slave_thread) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARNING_NOT_COMPLETE_ROLLBACK, diff --git a/sql/log.cc b/sql/log.cc index 7d0bef5ca2c..a0068dce1c5 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -162,7 +162,7 @@ static int binlog_rollback(THD *thd, bool all) table. Such cases should be rare (updating a non-transactional table inside a transaction...) */ - if (unlikely(thd->options & OPTION_STATUS_NO_TRANS_UPDATE)) + if (unlikely(thd->no_trans_update.all)) { Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, FALSE); qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE) @@ -217,7 +217,7 @@ static int binlog_savepoint_rollback(THD *thd, void *sv) non-transactional table. Otherwise, truncate the binlog cache starting from the SAVEPOINT command. */ - if (unlikely(thd->options & OPTION_STATUS_NO_TRANS_UPDATE)) + if (unlikely(thd->no_trans_update.all)) { Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE, FALSE); DBUG_RETURN(mysql_bin_log.write(&qinfo)); diff --git a/sql/set_var.cc b/sql/set_var.cc index 46c2a775d8a..ca5b6471bec 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2873,14 +2873,15 @@ static bool set_option_autocommit(THD *thd, set_var *var) if ((org_options & OPTION_NOT_AUTOCOMMIT)) { /* We changed to auto_commit mode */ - thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); + thd->options&= ~(ulong) OPTION_BEGIN; + thd->no_trans_update.all= FALSE; thd->server_status|= SERVER_STATUS_AUTOCOMMIT; if (ha_commit(thd)) return 1; } else { - thd->options&= ~(ulong) (OPTION_STATUS_NO_TRANS_UPDATE); + thd->no_trans_update.all= FALSE; thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT; } } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 4cb56e003ee..50945f43c1a 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -337,13 +337,13 @@ sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr) enum_check_fields save_count_cuted_fields= thd->count_cuted_fields; bool save_abort_on_warning= thd->abort_on_warning; - bool save_no_trans_update= thd->no_trans_update; + bool save_no_trans_update_stmt= thd->no_trans_update.stmt; thd->count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL; thd->abort_on_warning= thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES); - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; /* Save the value in the field. Convert the value if needed. */ @@ -351,7 +351,7 @@ sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr) thd->count_cuted_fields= save_count_cuted_fields; thd->abort_on_warning= save_abort_on_warning; - thd->no_trans_update= save_no_trans_update; + thd->no_trans_update.stmt= save_no_trans_update_stmt; if (thd->net.report_error) { diff --git a/sql/sql_class.h b/sql/sql_class.h index 99803802001..12d7cb2368f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1440,7 +1440,11 @@ public: bool charset_is_system_charset, charset_is_collation_connection; bool charset_is_character_set_filesystem; bool enable_slow_log; /* enable slow log for current statement */ - bool no_trans_update, abort_on_warning; + struct { + bool all:1; + bool stmt:1; + } no_trans_update; + bool abort_on_warning; bool got_warning; /* Set on call to push_warning() */ bool no_warnings_for_error; /* no warnings on call to my_error() */ /* set during loop of derived table processing */ @@ -1664,7 +1668,7 @@ public: inline bool really_abort_on_warning() { return (abort_on_warning && - (!no_trans_update || + (!no_trans_update.stmt || (variables.sql_mode & MODE_STRICT_ALL_TABLES))); } void set_status_var_init(); diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index fe89f0f28f0..8cf07f328bf 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -311,7 +311,7 @@ cleanup: error=1; } if (!transactional_table) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } free_underlaid_joins(thd, select_lex); if (transactional_table) @@ -791,7 +791,7 @@ bool multi_delete::send_eof() local_error=1; // Log write failed: roll back the SQL statement } if (!transactional_tables) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } /* Commit or rollback the current SQL statement */ if (transactional_tables) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d9d32d14321..e586779a431 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -584,7 +584,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, if (lock_type != TL_WRITE_DELAYED && !thd->prelocked_mode) table->file->start_bulk_insert(values_list.elements); - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= (!ignore && (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))); @@ -731,7 +731,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, error=1; } if (!transactional_table) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } } if (transactional_table) @@ -1129,7 +1129,7 @@ static int last_uniq_key(TABLE *table,uint keynr) then both on update triggers will work instead. Similarly both on delete triggers will be invoked if we will delete conflicting records. - Sets thd->no_trans_update if table which is updated didn't have + Sets thd->no_trans_update.stmt to TRUE if table which is updated didn't have transactions. RETURN VALUE @@ -1295,7 +1295,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) goto err; info->deleted++; if (!table->file->has_transactions()) - thd->no_trans_update= 1; + thd->no_trans_update.stmt= TRUE; if (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_DELETE, TRG_ACTION_AFTER, TRUE)) @@ -1327,7 +1327,7 @@ ok_or_after_trg_err: if (key) my_safe_afree(key,table->s->max_unique_length,MAX_KEY_LENGTH); if (!table->file->has_transactions()) - thd->no_trans_update= 1; + thd->no_trans_update.stmt= TRUE; DBUG_RETURN(trg_error); err: @@ -2518,7 +2518,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); } - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= (!info.ignore && (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | @@ -2676,7 +2676,7 @@ void select_insert::send_error(uint errcode,const char *err) mysql_bin_log.write(&qinfo); } if (!table->s->tmp_table) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } if (info.copied || info.deleted || info.updated) { @@ -2705,7 +2705,7 @@ bool select_insert::send_eof() { query_cache_invalidate3(thd, table, 1); if (!(table->file->has_transactions() || table->s->tmp_table)) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } if (last_insert_id) @@ -2931,7 +2931,7 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) } if (!thd->prelocked_mode) table->file->start_bulk_insert((ha_rows) 0); - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= (!info.ignore && (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 3f67a0c3f5d..8848c2c5e5b 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -377,7 +377,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table->file->start_bulk_insert((ha_rows) 0); table->copy_blobs=1; - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= (!ignore && (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | @@ -467,7 +467,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, (ulong) (info.records - info.copied), (ulong) thd->cuted_fields); if (!transactional_table) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; #ifndef EMBEDDED_LIBRARY if (mysql_bin_log.is_open()) { @@ -531,7 +531,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, Item_field *sql_field; TABLE *table= table_list->table; ulonglong id; - bool no_trans_update; + bool no_trans_update_stmt; DBUG_ENTER("read_fixed_length"); id= 0; @@ -559,7 +559,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, #ifdef HAVE_purify read_info.row_end[0]=0; #endif - no_trans_update= !table->file->has_transactions(); + no_trans_update_stmt= !table->file->has_transactions(); restore_record(table, s->default_values); /* @@ -627,7 +627,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, if (write_record(thd, table, &info)) DBUG_RETURN(1); - thd->no_trans_update= no_trans_update; + thd->no_trans_update.stmt= no_trans_update_stmt; /* If auto_increment values are used, save the first one for @@ -670,12 +670,12 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, TABLE *table= table_list->table; uint enclosed_length; ulonglong id; - bool no_trans_update; + bool no_trans_update_stmt; DBUG_ENTER("read_sep_field"); enclosed_length=enclosed.length(); id= 0; - no_trans_update= !table->file->has_transactions(); + no_trans_update_stmt= !table->file->has_transactions(); for (;;it.rewind()) { @@ -817,7 +817,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, We don't need to reset auto-increment field since we are restoring its default value at the beginning of each loop iteration. */ - thd->no_trans_update= no_trans_update; + thd->no_trans_update.stmt= no_trans_update_stmt; if (read_info.next_line()) // Skip to next line break; if (read_info.line_cuted) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1b8bfd38fc4..52b17c23b92 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -147,7 +147,8 @@ static bool end_active_trans(THD *thd) thd->server_status&= ~SERVER_STATUS_IN_TRANS; if (ha_commit(thd)) error=1; - thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); + thd->options&= ~(ulong) OPTION_BEGIN; + thd->no_trans_update.all= FALSE; } DBUG_RETURN(error); } @@ -171,8 +172,8 @@ static bool begin_trans(THD *thd) else { LEX *lex= thd->lex; - thd->options= ((thd->options & (ulong) ~(OPTION_STATUS_NO_TRANS_UPDATE)) | - OPTION_BEGIN); + thd->no_trans_update.all= FALSE; + thd->options|= (ulong) OPTION_BEGIN; thd->server_status|= SERVER_STATUS_IN_TRANS; if (lex->start_transaction_opt & MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT) error= ha_start_consistent_snapshot(thd); @@ -1463,7 +1464,8 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion) */ thd->server_status&= ~SERVER_STATUS_IN_TRANS; res= ha_commit(thd); - thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); + thd->options&= ~(ulong) OPTION_BEGIN; + thd->no_trans_update.all= FALSE; break; case COMMIT_RELEASE: do_release= 1; /* fall through */ @@ -1480,7 +1482,8 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion) thd->server_status&= ~SERVER_STATUS_IN_TRANS; if (ha_rollback(thd)) res= -1; - thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); + thd->options&= ~(ulong) OPTION_BEGIN; + thd->no_trans_update.all= FALSE; if (!res && (completion == ROLLBACK_AND_CHAIN)) res= begin_trans(thd); break; @@ -2933,7 +2936,7 @@ mysql_execute_command(THD *thd) else { /* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */ - thd->options|= OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } DBUG_ASSERT(first_table == all_tables && first_table != 0); bool link_to_local; @@ -3707,10 +3710,10 @@ end_with_restore_list: we silently add IF EXISTS if TEMPORARY was used. */ if (thd->slave_thread) - lex->drop_if_exists= 1; + lex->drop_if_exists= 1; /* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */ - thd->options|= OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } /* DDL and binlog write order protected by LOCK_open */ res= mysql_rm_table(thd, first_table, lex->drop_if_exists, @@ -4296,7 +4299,7 @@ end_with_restore_list: res= TRUE; // cannot happen else { - if ((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && + if (thd->no_trans_update.all && !thd->slave_thread) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARNING_NOT_COMPLETE_ROLLBACK, @@ -4939,8 +4942,8 @@ create_sp_error: thd->transaction.xid_state.xa_state=XA_ACTIVE; thd->transaction.xid_state.xid.set(thd->lex->xid); xid_cache_insert(&thd->transaction.xid_state); - thd->options= ((thd->options & (ulong) ~(OPTION_STATUS_NO_TRANS_UPDATE)) | - OPTION_BEGIN); + thd->no_trans_update.all= FALSE; + thd->options|= (ulong) OPTION_BEGIN; thd->server_status|= SERVER_STATUS_IN_TRANS; send_ok(thd); break; @@ -5033,7 +5036,8 @@ create_sp_error: xa_state_names[thd->transaction.xid_state.xa_state]); break; } - thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); + thd->options&= ~(ulong) OPTION_BEGIN; + thd->no_trans_update.all= FALSE; thd->server_status&= ~SERVER_STATUS_IN_TRANS; xid_cache_delete(&thd->transaction.xid_state); thd->transaction.xid_state.xa_state=XA_NOTR; @@ -5063,7 +5067,8 @@ create_sp_error: my_error(ER_XAER_RMERR, MYF(0)); else send_ok(thd); - thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); + thd->options&= ~(ulong) OPTION_BEGIN; + thd->no_trans_update.all= FALSE; thd->server_status&= ~SERVER_STATUS_IN_TRANS; xid_cache_delete(&thd->transaction.xid_state); thd->transaction.xid_state.xa_state=XA_NOTR; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 14b9e0aa25d..98b12cc1de4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3968,7 +3968,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, alter_table_manage_keys(to, from->file->indexes_are_disabled(), keys_onoff); /* We can abort alter table for any table type */ - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= !ignore && test(thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 27d38114885..860d00b5bdd 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -429,7 +429,7 @@ int mysql_update(THD *thd, query_id=thd->query_id; transactional_table= table->file->has_transactions(); - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= test(!ignore && (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | @@ -452,7 +452,7 @@ int mysql_update(THD *thd, if (fill_record_n_invoke_before_triggers(thd, fields, values, 0, table->triggers, TRG_EVENT_UPDATE)) - break; /* purecov: inspected */ + break; /* purecov: inspected */ found++; @@ -470,12 +470,12 @@ int mysql_update(THD *thd, break; } } - if (!(error=table->file->update_row((byte*) table->record[1], - (byte*) table->record[0]))) - { - updated++; - thd->no_trans_update= !transactional_table; - + if (!(error=table->file->update_row((byte*) table->record[1], + (byte*) table->record[0]))) + { + updated++; + thd->no_trans_update.stmt= !transactional_table; + if (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, TRG_ACTION_AFTER, TRUE)) @@ -483,25 +483,25 @@ int mysql_update(THD *thd, error= 1; break; } - } - else if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) - { + } + else if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) + { /* If (ignore && error == HA_ERR_FOUND_DUPP_KEY) we don't have to do anything; otherwise... */ if (error != HA_ERR_FOUND_DUPP_KEY) thd->fatal_error(); /* Other handler errors are fatal */ - table->file->print_error(error,MYF(0)); - error= 1; - break; - } + table->file->print_error(error,MYF(0)); + error= 1; + break; + } } - + if (!--limit && using_limit) { - error= -1; // Simulate end of file - break; + error= -1; // Simulate end of file + break; } } else @@ -546,7 +546,7 @@ int mysql_update(THD *thd, error=1; // Rollback update } if (!transactional_table) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } free_underlaid_joins(thd, select_lex); if (transactional_table) @@ -910,7 +910,7 @@ bool mysql_multi_update(THD *thd, handle_duplicates, ignore))) DBUG_RETURN(TRUE); - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= test(thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)); @@ -1224,7 +1224,7 @@ multi_update::~multi_update() delete [] copy_field; thd->count_cuted_fields= CHECK_FIELD_IGNORE; // Restore this setting if (!trans_safe) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } @@ -1311,7 +1311,7 @@ bool multi_update::send_data(List ¬_used_values) else { if (!table->file->has_transactions()) - thd->no_trans_update= 1; + thd->no_trans_update.stmt= TRUE; if (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, TRG_ACTION_AFTER, TRUE)) @@ -1541,10 +1541,10 @@ bool multi_update::send_eof() Query_log_event qinfo(thd, thd->query, thd->query_length, transactional_tables, FALSE); if (mysql_bin_log.write(&qinfo) && trans_safe) - local_error= 1; // Rollback update + local_error= 1; // Rollback update } if (!transactional_tables) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } if (transactional_tables) From 57dc12563f099c7802ea8eaeb0c52ac4082de67a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 18:14:03 +0300 Subject: [PATCH 330/789] Trivial cleanups and whitespace change in Event Scheduler code. A larger patch is to come, this is to exclude rudimentary changes from it. sql/event_data_objects.cc: Whitespace change. sql/event_data_objects.h: Remove debug allocators - we have safemalloc. sql/event_db_repository.cc: Whitespace change. sql/event_db_repository.h: Whitespace change. sql/event_queue.cc: Remove an unused structure. Whitespace change. sql/event_queue.h: Whitespace. sql/event_scheduler.cc: Whitespace change. sql/event_scheduler.h: Add comments. Whitespace change. sql/events.cc: Whitespace change. sql/events.h: Trivial cleanups. --- sql/event_data_objects.cc | 23 +++++++++++------------ sql/event_data_objects.h | 20 +------------------- sql/event_db_repository.cc | 24 ++++++++++++------------ sql/event_db_repository.h | 4 ++-- sql/event_queue.cc | 24 +++++++----------------- sql/event_queue.h | 2 +- sql/event_scheduler.cc | 16 ++++++++-------- sql/event_scheduler.h | 12 +++++++++--- sql/events.cc | 21 ++++++++++----------- sql/events.h | 5 ++++- 10 files changed, 65 insertions(+), 86 deletions(-) diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 67ba371772a..5196cae22e3 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -81,7 +81,7 @@ Event_queue_element_for_exec::~Event_queue_element_for_exec() RETURN VALUE Address or NULL in case of error - + NOTE Created on THD's mem_root */ @@ -174,7 +174,7 @@ Event_parse_data::init_body(THD *thd) while (body_begin < body_end) { - if ((*body_end == '\0') || + if ((*body_end == '\0') || (my_isspace(thd->variables.character_set_client, *body_end))) { /* consume NULs and meaningless whitespace */ --body.length; @@ -186,7 +186,7 @@ Event_parse_data::init_body(THD *thd) consume closing comments This is arguably wrong, but it's the best we have until the parser is - changed to be smarter. FIXME PARSER + changed to be smarter. FIXME PARSER See also the sp_head code, where something like this is done also. @@ -296,7 +296,7 @@ Event_parse_data::init_execute_at(THD *thd) if (item_execute_at->fix_fields(thd, &item_execute_at)) goto wrong_value; - + /* no starts and/or ends in case of execute_at */ DBUG_PRINT("info", ("starts_null && ends_null should be 1 is %d", (starts_null && ends_null))); @@ -702,7 +702,7 @@ Event_basic::load_string_fields(Field **fields, ...) ret= TRUE; break; } - field_value->length= strlen(field_value->str); + field_value->length= strlen(field_value->str); field_name= (enum enum_events_table_field) va_arg(args, int); } @@ -778,7 +778,7 @@ Event_timed::Event_timed(): */ Event_timed::~Event_timed() -{ +{ } @@ -1382,7 +1382,6 @@ Event_queue_element::compute_next_execution_time() DBUG_PRINT("info", ("Dropped: %d", dropped)); status= Event_queue_element::DISABLED; status_changed= TRUE; - dropped= TRUE; goto ret; } @@ -1574,7 +1573,7 @@ Event_queue_element::mark_last_executed(THD *thd) last_executed= (my_time_t) thd->query_start(); last_executed_changed= TRUE; - + execution_count++; } @@ -1762,7 +1761,7 @@ Event_timed::get_create_event(THD *thd, String *buf) */ int -Event_job_data::get_fake_create_event(THD *thd, String *buf) +Event_job_data::get_fake_create_event(String *buf) { DBUG_ENTER("Event_job_data::get_create_event"); /* FIXME: "EVERY 3337 HOUR" is asking for trouble. */ @@ -1853,7 +1852,7 @@ done: RETURN VALUE 0 success EVEX_COMPILE_ERROR error during compilation - EVEX_MICROSECOND_UNSUP mysql.event was tampered + EVEX_MICROSECOND_UNSUP mysql.event was tampered */ int @@ -1878,7 +1877,7 @@ Event_job_data::compile(THD *thd, MEM_ROOT *mem_root) show_create.length(0); - switch (get_fake_create_event(thd, &show_create)) { + switch (get_fake_create_event(&show_create)) { case EVEX_MICROSECOND_UNSUP: DBUG_RETURN(EVEX_MICROSECOND_UNSUP); case 0: @@ -2043,7 +2042,7 @@ event_change_security_context(THD *thd, LEX_STRING user, LEX_STRING host, thd->security_ctx= &thd->main_security_ctx; #endif DBUG_RETURN(FALSE); -} +} /* diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index 8e013e40400..513f60df657 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -127,24 +127,6 @@ public: bool update_timing_fields(THD *thd); - - static void *operator new(size_t size) - { - void *p; - DBUG_ENTER("Event_queue_element::new(size)"); - p= my_malloc(size, MYF(0)); - DBUG_PRINT("info", ("alloc_ptr: 0x%lx", (long) p)); - DBUG_RETURN(p); - } - - static void operator delete(void *ptr, size_t size) - { - DBUG_ENTER("Event_queue_element::delete(ptr,size)"); - DBUG_PRINT("enter", ("free_ptr: 0x%lx", (long) ptr)); - TRASH(ptr, size); - my_free((gptr) ptr, MYF(0)); - DBUG_VOID_RETURN; - } }; @@ -206,7 +188,7 @@ public: compile(THD *thd, MEM_ROOT *mem_root); private: int - get_fake_create_event(THD *thd, String *buf); + get_fake_create_event(String *buf); Event_job_data(const Event_job_data &); /* Prevent use of these */ void operator=(Event_job_data &); diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 0c59d3e92f8..9e1ce1b4594 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -142,7 +142,7 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] = EVEX_GENERAL_ERROR Bad data EVEX_GET_FIELD_FAILED Field count does not match. table corrupted? - DESCRIPTION + DESCRIPTION Used both when an event is created and when it is altered. */ @@ -178,7 +178,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, /* Change the SQL_MODE only if body was present in an ALTER EVENT and of course always during CREATE EVENT. - */ + */ if (et->body.str) { fields[ET_FIELD_SQL_MODE]->store((longlong)thd->variables.sql_mode, TRUE); @@ -237,7 +237,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, fields[ET_FIELD_TRANSIENT_INTERVAL]->set_null(); fields[ET_FIELD_STARTS]->set_null(); fields[ET_FIELD_ENDS]->set_null(); - + TIME time; my_tz_UTC->gmt_sec_to_TIME(&time, et->execute_at); @@ -253,7 +253,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, this is an error if the action is create. something is borked */ } - + ((Field_timestamp *)fields[ET_FIELD_MODIFIED])->set_time(); if (et->comment.str) @@ -323,12 +323,12 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, ret= copy_event_to_schema_table(thd, schema_table, event_table); if (ret == 0) ret= event_table->file->index_next_same(event_table->record[0], - key_buf, key_len); + key_buf, key_len); } while (ret == 0); } DBUG_PRINT("info", ("Scan finished. ret=%d", ret)); } - event_table->file->ha_index_end(); + event_table->file->ha_index_end(); /* ret is guaranteed to be != 0 */ if (ret == HA_ERR_END_OF_FILE || ret == HA_ERR_KEY_NOT_FOUND) DBUG_RETURN(FALSE); @@ -489,7 +489,7 @@ Event_db_repository::open_event_table(THD *thd, enum thr_lock_type lock_type, check_parse_params() thd Thread context parse_data Event's data - + RETURN VALUE FALSE OK TRUE Error (reported) @@ -535,7 +535,7 @@ check_parse_params(THD *thd, Event_parse_data *parse_data) 0 OK EVEX_GENERAL_ERROR Failure - DESCRIPTION + DESCRIPTION Creates an event. Relies on mysql_event_fill_row which is shared with ::update_event. The name of the event is inside "et". */ @@ -630,7 +630,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, handle it here */ if ((ret= mysql_event_fill_row(thd, table, parse_data, FALSE))) - goto err; + goto err; /* Close active transaction only if We are going to modify disk */ if (end_active_trans(thd)) @@ -647,7 +647,7 @@ ok: (void) mysql_change_db(thd, old_db.str, 1); /* This statement may cause a spooky valgrind warning at startup - inside init_key_cache on my system (ahristov, 2006/08/10) + inside init_key_cache on my system (ahristov, 2006/08/10) */ close_thread_tables(thd); DBUG_RETURN(FALSE); @@ -914,14 +914,14 @@ Event_db_repository::drop_schema_events(THD *thd, LEX_STRING schema) */ void -Event_db_repository::drop_events_by_field(THD *thd, +Event_db_repository::drop_events_by_field(THD *thd, enum enum_events_table_field field, LEX_STRING field_value) { int ret= 0; TABLE *table= NULL; READ_RECORD read_record_info; - DBUG_ENTER("Event_db_repository::drop_events_by_field"); + DBUG_ENTER("Event_db_repository::drop_events_by_field"); DBUG_PRINT("enter", ("field=%d field_value=%s", field, field_value.str)); if (open_event_table(thd, TL_WRITE, &table)) diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h index 4991e2d0aa2..7d609dba860 100644 --- a/sql/event_db_repository.h +++ b/sql/event_db_repository.h @@ -62,7 +62,7 @@ public: update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname, LEX_STRING *new_name); - bool + bool drop_event(THD *thd, LEX_STRING db, LEX_STRING name, bool drop_if_exists); void @@ -98,5 +98,5 @@ private: Event_db_repository(const Event_db_repository &); void operator=(Event_db_repository &); }; - + #endif /* _EVENT_DB_REPOSITORY_H_ */ diff --git a/sql/event_queue.cc b/sql/event_queue.cc index ef9dddf9195..7832a0337e7 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -32,16 +32,6 @@ #define LOCK_QUEUE_DATA() lock_data(SCHED_FUNC, __LINE__) #define UNLOCK_QUEUE_DATA() unlock_data(SCHED_FUNC, __LINE__) -struct event_queue_param -{ - THD *thd; - Event_queue *queue; - pthread_mutex_t LOCK_loaded; - pthread_cond_t COND_loaded; - bool loading_finished; -}; - - /* Compares the execute_at members of two Event_queue_element instances. Used as callback for the prioritized queue when shifting @@ -62,7 +52,7 @@ struct event_queue_param execute_at.second_part is not considered during comparison */ -static int +static int event_queue_element_compare_q(void *vptr, byte* a, byte *b) { my_time_t lhs = ((Event_queue_element *)a)->execute_at; @@ -183,7 +173,7 @@ Event_queue::deinit_queue() } -/* +/** Adds an event to the queue. SYNOPSIS @@ -209,7 +199,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element) LOCK_QUEUE_DATA(); queue_insert_safe(&queue, (byte *) new_element); dbug_dump_queue(thd->query_start()); - pthread_cond_broadcast(&COND_queue_state); + pthread_cond_broadcast(&COND_queue_state); UNLOCK_QUEUE_DATA(); } DBUG_VOID_RETURN; @@ -256,7 +246,7 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name, { DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element)); queue_insert_safe(&queue, (byte *) new_element); - pthread_cond_broadcast(&COND_queue_state); + pthread_cond_broadcast(&COND_queue_state); } dbug_dump_queue(thd->query_start()); @@ -287,7 +277,7 @@ Event_queue::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name) find_n_remove_event(dbname, name); dbug_dump_queue(thd->query_start()); UNLOCK_QUEUE_DATA(); - + /* We don't signal here because the scheduler will catch the change next time it wakes up. @@ -309,7 +299,7 @@ Event_queue::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name) RETURN VALUE >=0 Number of dropped events - + NOTE Expected is the caller to acquire lock on LOCK_event_queue */ @@ -341,7 +331,7 @@ Event_queue::drop_matching_events(THD *thd, LEX_STRING pattern, i++; } /* - We don't call pthread_cond_broadcast(&COND_queue_state); + We don't call pthread_cond_broadcast(&COND_queue_state); If we remove the top event: 1. The queue is empty. The scheduler will wake up at some time and realize that the queue is empty. If create_event() comes inbetween diff --git a/sql/event_queue.h b/sql/event_queue.h index 338a6c8f903..95f52b7b588 100644 --- a/sql/event_queue.h +++ b/sql/event_queue.h @@ -34,7 +34,7 @@ public: bool init_queue(THD *thd); - + void deinit_queue(); diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 3c8ecf6ca3a..287bed27bd6 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -240,7 +240,7 @@ event_scheduler_thread(void *arg) /* - Function that executes an event in a child thread. Setups the + Function that executes an event in a child thread. Setups the environment for the event execution and cleans after that. SYNOPSIS @@ -254,7 +254,7 @@ event_scheduler_thread(void *arg) pthread_handler_t event_worker_thread(void *arg) { - THD *thd; + THD *thd; Event_queue_element_for_exec *event= (Event_queue_element_for_exec *)arg; thd= event->thd; @@ -267,7 +267,7 @@ event_worker_thread(void *arg) /* - Function that executes an event in a child thread. Setups the + Function that executes an event in a child thread. Setups the environment for the event execution and cleans after that. SYNOPSIS @@ -458,7 +458,7 @@ Event_scheduler::start() scheduler_thd= new_thd; DBUG_PRINT("info", ("Setting state go RUNNING")); state= RUNNING; - DBUG_PRINT("info", ("Forking new thread for scheduduler. THD: 0x%lx", (long) new_thd)); + DBUG_PRINT("info", ("Forking new thread for scheduler. THD: 0x%lx", (long) new_thd)); if (pthread_create(&th, &connection_attrib, event_scheduler_thread, (void*)scheduler_param_value)) { @@ -525,7 +525,7 @@ Event_scheduler::run(THD *thd) "event_name=0x%lx", (long) event_name)); if (event_name) { - if ((res= execute_top(thd, event_name))) + if ((res= execute_top(event_name))) break; } else @@ -559,7 +559,7 @@ Event_scheduler::run(THD *thd) */ bool -Event_scheduler::execute_top(THD *thd, Event_queue_element_for_exec *event_name) +Event_scheduler::execute_top(Event_queue_element_for_exec *event_name) { THD *new_thd; pthread_t th; @@ -631,7 +631,7 @@ Event_scheduler::is_running() } -/* +/** Stops the scheduler (again). Waits for acknowledgement from the scheduler that it has stopped - synchronous stopping. @@ -715,7 +715,7 @@ Event_scheduler::workers_count() { THD *tmp; uint count= 0; - + DBUG_ENTER("Event_scheduler::workers_count"); pthread_mutex_lock(&LOCK_thread_count); // For unlink from list I_List_iterator it(threads); diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h index 2ab21464057..74d53c4f63d 100644 --- a/sql/event_scheduler.h +++ b/sql/event_scheduler.h @@ -15,6 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + This file is internal to Events module. Please do not include it directly. + All public declarations of Events module are in events.h and + event_data_objects.h. +*/ + class Event_queue; class Event_job_data; @@ -31,7 +37,7 @@ void deinit_event_thread(THD *thd); -class Event_worker_thread +class Event_worker_thread { public: static void @@ -74,7 +80,7 @@ public: bool run(THD *thd); - void + void init_scheduler(Event_queue *queue); void @@ -99,7 +105,7 @@ private: /* helper functions */ bool - execute_top(THD *thd, Event_queue_element_for_exec *event_name); + execute_top(Event_queue_element_for_exec *event_name); /* helper functions for working with mutexes & conditionals */ void diff --git a/sql/events.cc b/sql/events.cc index 88014ee34af..02e5a292e16 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -49,7 +49,7 @@ counterpart. 1. CREATE EVENT the_name ON SCHEDULE EVERY 1 SECOND DISABLE DO SELECT 1; 2. DROP EVENT the_name - + In other words, the first one will create a row in mysql.event . In the second step because there will be a line, disk based drop will pass and the scheduler will remove the memory counterpart. The reason is that @@ -309,7 +309,7 @@ Events::Events() TRUE Error (Reported) NOTES - In case there is an event with the same name (db) and + In case there is an event with the same name (db) and IF NOT EXISTS is specified, an warning is put into the stack. */ @@ -346,7 +346,6 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) pthread_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); - } @@ -364,7 +363,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) TRUE Error NOTES - et contains data about dbname and event name. + et contains data about dbname and event name. new_name is the new name of the event, if not null this means that RENAME TO was specified in the query */ @@ -396,7 +395,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) new_element))) { DBUG_ASSERT(ret == OP_LOAD_ERROR); - delete new_element; + delete new_element; } else event_queue->update_event(thd, parse_data->dbname, parse_data->name, @@ -444,7 +443,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) } -/* +/** Drops all events from a schema SYNOPSIS @@ -457,8 +456,8 @@ void Events::drop_schema_events(THD *thd, char *db) { LEX_STRING const db_lex= { db, strlen(db) }; - - DBUG_ENTER("Events::drop_schema_events"); + + DBUG_ENTER("Events::drop_schema_events"); DBUG_PRINT("enter", ("dropping events from %s", db)); if (unlikely(check_system_tables_error)) { @@ -697,7 +696,7 @@ Events::deinit() } -/* +/** Inits Events mutexes SYNOPSIS @@ -755,7 +754,7 @@ Events::dump_internal_status() } -/* +/** Starts execution of events by the scheduler SYNOPSIS @@ -912,7 +911,7 @@ Events::check_system_tables(THD *thd) RETURN VALUE 0 OK - !0 Error (EVEX_OPEN_TABLE_FAILED, EVEX_MICROSECOND_UNSUP, + !0 Error (EVEX_OPEN_TABLE_FAILED, EVEX_MICROSECOND_UNSUP, EVEX_COMPILE_ERROR) - in all these cases mysql.event was tampered. diff --git a/sql/events.h b/sql/events.h index 35ee3c569d0..f97a0c5f57e 100644 --- a/sql/events.h +++ b/sql/events.h @@ -19,7 +19,6 @@ class sp_name; class Event_parse_data; class Event_db_repository; class Event_queue; -class Event_queue_element; class Event_scheduler; /* Return codes */ @@ -38,6 +37,10 @@ enum enum_events_error_code int sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs); +/** + @class Events -- a facade to the functionality of the Event Scheduler. + +*/ class Events { From 4e778fe994f691849112607d99913e22f21b8b4f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 18:19:53 +0300 Subject: [PATCH 331/789] Update an imperfect error message. sql/sql_servers.cc: It's not a fatal error if we can not open mysql.servers table (the start up process continues). --- sql/sql_servers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 7b3b71cdd9a..60ca08fb555 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -208,7 +208,7 @@ my_bool servers_reload(THD *thd) if (simple_open_n_lock_tables(thd, tables)) { - sql_print_error("Fatal error: Can't open and lock privilege tables: %s", + sql_print_error("Can't open and lock privilege tables: %s", thd->net.last_error); goto end; } From 37ef840f776153ca04d06ba8e1527001aebd07ba Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 16:41:17 +0100 Subject: [PATCH 332/789] Import patch from yaSSL after fixing warnings upstream extra/yassl/src/ssl.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/integer.cpp: Import patch yassl.diff extra/yassl/taocrypt/test/test.cpp: Import patch yassl.diff extra/yassl/testsuite/testsuite.cpp: Import patch yassl.diff --- extra/yassl/src/ssl.cpp | 2 +- extra/yassl/taocrypt/src/integer.cpp | 2 +- extra/yassl/taocrypt/test/test.cpp | 3 +-- extra/yassl/testsuite/testsuite.cpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 70198af79b4..5bbde13a652 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -950,7 +950,7 @@ void ERR_print_errors_fp(FILE* /*fp*/) char* ERR_error_string(unsigned long errNumber, char* buffer) { - static char* msg = "Please supply a buffer for error string"; + static char* msg = (char*)"Please supply a buffer for error string"; if (buffer) { SetErrorString(YasslError(errNumber), buffer); diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index 419783403ea..85733b88aa9 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -3390,7 +3390,7 @@ void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a, CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount); SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount); if (n % WORD_BITS != 0) - r.reg_[wordCount-1] %= (1 << (n % WORD_BITS)); + r.reg_[wordCount-1] %= (word(1) << (n % WORD_BITS)); } else { diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp index 9cf9c52b2c7..0af278404ab 100644 --- a/extra/yassl/taocrypt/test/test.cpp +++ b/extra/yassl/taocrypt/test/test.cpp @@ -94,7 +94,6 @@ struct testVector { output_((byte*)out), inLen_(strlen(in)), outLen_(strlen(out)) {} }; -void file_test(int, char**); int sha_test(); int sha256_test(); #ifdef WORD64_AVAILABLE @@ -300,7 +299,7 @@ void taocrypt_test(void* args) #endif // NO_MAIN_DRIVER -void file_test(char* file, byte* check) +void file_test(const char* file, byte* check) { FILE* f; int i(0); diff --git a/extra/yassl/testsuite/testsuite.cpp b/extra/yassl/testsuite/testsuite.cpp index 1cf6a78ebe7..3cd832ebb03 100644 --- a/extra/yassl/testsuite/testsuite.cpp +++ b/extra/yassl/testsuite/testsuite.cpp @@ -7,7 +7,7 @@ typedef unsigned char byte; void taocrypt_test(void*); -void file_test(char*, byte*); +void file_test(const char*, byte*); void client_test(void*); void echoclient_test(void*); From 140436564340841a8249cddfb8955004d90973c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 17:07:33 +0100 Subject: [PATCH 333/789] Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: abort on timeout if in single user mode --- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 61f25141907..b6496018b80 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -6246,6 +6246,7 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) Uint32 api_timer= getApiConTimer(api_con_ptr); jam(); if (api_timer != 0) { + Uint32 error= ZTIME_OUT_ERROR; time_out_value= time_out_param + (api_con_ptr & mask_value); if (unlikely(old_mask_value)) // abort during single user mode { @@ -6259,12 +6260,16 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) time_out_value= old_time_out_param + (api_con_ptr & old_mask_value); } + else + { + error= ZCLUSTER_IN_SINGLEUSER_MODE; + } } time_passed= tc_timer - api_timer; if (time_passed > time_out_value) { jam(); - timeOutFoundLab(signal, api_con_ptr, ZTIME_OUT_ERROR); + timeOutFoundLab(signal, api_con_ptr, error); api_con_ptr++; break; } @@ -6304,7 +6309,8 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr, Uint32 errCode) << " code: " << errCode); switch (apiConnectptr.p->apiConnectstate) { case CS_STARTED: - if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec){ + if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec && + errCode != ZCLUSTER_IN_SINGLEUSER_MODE){ jam(); /* We are waiting for application to continue the transaction. In this From 8503077e6d9350df98c07a45795551cf5e92a702 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 17:12:06 +0100 Subject: [PATCH 334/789] BUG#27254: Single User Mode.Mysql hangs if it tries delete a ndb table sql/ha_ndbcluster.cc: set single user mode on ndb schema table storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: dbug print --- sql/ha_ndbcluster.cc | 25 +++++++++++++------- storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index f0acab2b43d..24a9e30aa2e 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4742,6 +4742,7 @@ int ha_ndbcluster::create(const char *name, bool create_from_engine= (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE); bool is_truncate= (thd->lex->sql_command == SQLCOM_TRUNCATE); char tablespace[FN_LEN]; + NdbDictionary::Table::SingleUserMode single_user_mode= NdbDictionary::Table::SingleUserModeLocked; DBUG_ENTER("ha_ndbcluster::create"); DBUG_PRINT("enter", ("name: %s", name)); @@ -4793,19 +4794,23 @@ int ha_ndbcluster::create(const char *name, schema distribution table is setup ( unless it is a creation of the schema dist table itself ) */ - if (!ndb_schema_share && - !(strcmp(m_dbname, NDB_REP_DB) == 0 && - strcmp(m_tabname, NDB_SCHEMA_TABLE) == 0)) + if (!ndb_schema_share) { - DBUG_PRINT("info", ("Schema distribution table not setup")); - DBUG_RETURN(HA_ERR_NO_CONNECTION); + if (!(strcmp(m_dbname, NDB_REP_DB) == 0 && + strcmp(m_tabname, NDB_SCHEMA_TABLE) == 0)) + { + DBUG_PRINT("info", ("Schema distribution table not setup")); + DBUG_RETURN(HA_ERR_NO_CONNECTION); + } + single_user_mode = NdbDictionary::Table::SingleUserModeReadWrite; } #endif /* HAVE_NDB_BINLOG */ DBUG_PRINT("table", ("name: %s", m_tabname)); tab.setName(m_tabname); tab.setLogging(!(create_info->options & HA_LEX_CREATE_TMP_TABLE)); - + tab.setSingleUserMode(single_user_mode); + // Save frm data for this table if (readfrm(name, &data, &length)) DBUG_RETURN(1); @@ -5569,6 +5574,7 @@ retry_temporary_error1: { ndb_table_id= h->m_table->getObjectId(); ndb_table_version= h->m_table->getObjectVersion(); + DBUG_PRINT("info", ("success 1")); } else { @@ -5582,6 +5588,7 @@ retry_temporary_error1: break; } res= ndb_to_mysql_error(&dict->getNdbError()); + DBUG_PRINT("info", ("error(1) %u", res)); } h->release_metadata(thd, ndb); } @@ -5598,6 +5605,8 @@ retry_temporary_error1: { ndb_table_id= ndbtab_g.get_table()->getObjectId(); ndb_table_version= ndbtab_g.get_table()->getObjectVersion(); + DBUG_PRINT("info", ("success 2")); + break; } else { @@ -5617,8 +5626,8 @@ retry_temporary_error1: } } } - else - res= ndb_to_mysql_error(&dict->getNdbError()); + res= ndb_to_mysql_error(&dict->getNdbError()); + DBUG_PRINT("info", ("error(2) %u", res)); break; } } diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 3e187ef0599..2bd59c6e06f 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -51,7 +51,7 @@ #define ERR_RETURN(a,b) \ {\ - DBUG_PRINT("exit", ("error %d", (a).code));\ + DBUG_PRINT("exit", ("error %d return %d", (a).code, b));\ DBUG_RETURN(b);\ } From b2d3dddef527ba6b3b0d77d1cc04d53da54b15cb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 19:14:08 +0300 Subject: [PATCH 335/789] Change module prefix in error messages: SCHEDULER -> Event Scheduler, to not collide with the recently introduced thread scheduler module. mysql-test/r/events.result: Update test results with new error texts (SCHEDULER -> Event Scheduler, grammar). sql/event_data_objects.cc: SCHEDULER -> Event Scheduler. sql/event_queue.cc: SCHEDULER -> Event Scheduler. sql/event_scheduler.cc: SCHEDULER -> Event Scheduler. sql/events.cc: SCHEDULER -> Event Scheduler. sql/share/errmsg.txt: SCHEDULER -> Event Scheduler. Fix English grammar. --- mysql-test/r/events.result | 14 ++++++------- sql/event_data_objects.cc | 7 ++++--- sql/event_queue.cc | 7 ++++--- sql/event_scheduler.cc | 41 ++++++++++++++++++++++---------------- sql/events.cc | 25 ++++++++++++----------- sql/share/errmsg.txt | 6 +++--- 6 files changed, 55 insertions(+), 45 deletions(-) diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index cab5762012c..641de1571c3 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -229,10 +229,10 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED ALTER TABLE mysql.event ADD dummy INT FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. The table is probably corrupted ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. The table is probably corrupted ALTER TABLE mysql.event DROP dummy2; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status @@ -241,7 +241,7 @@ CREATE TABLE event_like LIKE mysql.event; INSERT INTO event_like SELECT * FROM mysql.event; ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details ALTER TABLE mysql.event MODIFY db char(20) character set utf8 collate utf8_bin default ''; SHOW CREATE TABLE mysql.event; Table Create Table @@ -266,7 +266,7 @@ event CREATE TABLE `event` ( PRIMARY KEY (`db`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin default ''; "This should work" SHOW EVENTS; @@ -274,13 +274,13 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default ''; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details ALTER TABLE mysql.event DROP comment, DROP starts; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. The table is probably corrupted DROP TABLE mysql.event; CREATE TABLE mysql.event like event_like; INSERT INTO mysql.event SELECT * FROM event_like; diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 5196cae22e3..c3ac488fb14 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1926,9 +1926,10 @@ Event_job_data::compile(THD *thd, MEM_ROOT *mem_root) thd->is_fatal_error)); lex.unit.cleanup(); - sql_print_error("SCHEDULER: Error during compilation of %s.%s or " - "thd->is_fatal_error: %d", - dbname.str, name.str, thd->is_fatal_error); + sql_print_error("Event Scheduler: " + "%serror during compilation of %s.%s", + thd->is_fatal_error ? "fatal " : "", + dbname.str, name.str); ret= EVEX_COMPILE_ERROR; goto done; diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 7832a0337e7..f110bfdd1bf 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -138,7 +138,7 @@ Event_queue::init_queue(THD *thd) 0 /*max_on_top*/, event_queue_element_compare_q, NULL, EVENT_QUEUE_EXTENT)) { - sql_print_error("SCHEDULER: Can't initialize the execution queue"); + sql_print_error("Event Scheduler: Can't initialize the execution queue"); goto err; } @@ -453,7 +453,8 @@ Event_queue::empty_queue() uint i; DBUG_ENTER("Event_queue::empty_queue"); DBUG_PRINT("enter", ("Purging the queue. %u element(s)", queue.elements)); - sql_print_information("SCHEDULER: Purging queue. %u events", queue.elements); + sql_print_information("Event Scheduler: Purging the queue. %u events", + queue.elements); /* empty the queue */ for (i= 0; i < queue.elements; ++i) { @@ -586,7 +587,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd, if (top->status == Event_queue_element::DISABLED) { DBUG_PRINT("info", ("removing from the queue")); - sql_print_information("SCHEDULER: Last execution of %s.%s. %s", + sql_print_information("Event Scheduler: Last execution of %s.%s. %s", top->dbname.str, top->name.str, top->dropped? "Dropping.":""); delete top; diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 287bed27bd6..d50ea932596 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -78,7 +78,7 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et) char prefix_buf[5 * STRING_BUFFER_USUAL_SIZE]; String prefix(prefix_buf, sizeof(prefix_buf), system_charset_info); prefix.length(0); - prefix.append("SCHEDULER: ["); + prefix.append("Event Scheduler: ["); append_identifier(thd, &prefix, et->definer.str, et->definer.length); prefix.append("][", 2); @@ -304,7 +304,8 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event) goto end; } - sql_print_information("SCHEDULER: [%s.%s of %s] executing in thread %lu. ", + sql_print_information("Event Scheduler: " + "[%s.%s of %s] executing in thread %lu. ", job_data->dbname.str, job_data->name.str, job_data->definer.str, thd->thread_id); @@ -314,23 +315,25 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event) print_warnings(thd, job_data); - sql_print_information("SCHEDULER: [%s.%s of %s] executed in thread %lu. " + sql_print_information("Event Scheduler: " + "[%s.%s of %s] executed in thread %lu. " "RetCode=%d", job_data->dbname.str, job_data->name.str, job_data->definer.str, thd->thread_id, ret); if (ret == EVEX_COMPILE_ERROR) - sql_print_information("SCHEDULER: COMPILE ERROR for event %s.%s of %s", + sql_print_information("Event Scheduler: " + "COMPILE ERROR for event %s.%s of %s", job_data->dbname.str, job_data->name.str, job_data->definer.str); else if (ret == EVEX_MICROSECOND_UNSUP) - sql_print_information("SCHEDULER: MICROSECOND is not supported"); + sql_print_information("Event Scheduler: MICROSECOND is not supported"); end: delete job_data; if (event->dropped) { - sql_print_information("SCHEDULER: Dropping %s.%s", event->dbname.str, - event->name.str); + sql_print_information("Event Scheduler: Dropping %s.%s", + event->dbname.str, event->name.str); /* Using db_repository can lead to a race condition because we access the table without holding LOCK_metadata. @@ -442,7 +445,7 @@ Event_scheduler::start() if (!(new_thd= new THD)) { - sql_print_error("SCHEDULER: Cannot init manager event thread"); + sql_print_error("Event Scheduler: Cannot initialize the scheduler thread"); ret= TRUE; goto end; } @@ -501,7 +504,7 @@ Event_scheduler::run(THD *thd) int res= FALSE; DBUG_ENTER("Event_scheduler::run"); - sql_print_information("SCHEDULER: Manager thread started with id %lu", + sql_print_information("Event Scheduler: scheduler thread started with id %lu", thd->thread_id); /* Recalculate the values in the queue because there could have been stops @@ -516,7 +519,8 @@ Event_scheduler::run(THD *thd) /* Gets a minimized version */ if (queue->get_top_for_execution_if_time(thd, &event_name)) { - sql_print_information("SCHEDULER: Serious error during getting next " + sql_print_information("Event Scheduler: " + "Serious error during getting next " "event to execute. Stopping"); break; } @@ -540,7 +544,7 @@ Event_scheduler::run(THD *thd) state= INITIALIZED; pthread_cond_signal(&COND_state); UNLOCK_DATA(); - sql_print_information("SCHEDULER: Stopped"); + sql_print_information("Event Scheduler: Stopped"); DBUG_RETURN(res); } @@ -657,8 +661,8 @@ Event_scheduler::stop() /* Guarantee we don't catch spurious signals */ do { - DBUG_PRINT("info", ("Waiting for COND_started_or_stopped from the manager " - "thread. Current value of state is %s . " + DBUG_PRINT("info", ("Waiting for COND_started_or_stopped from " + "the scheduler thread. Current value of state is %s . " "workers count=%d", scheduler_states_names[state].str, workers_count())); /* @@ -672,20 +676,23 @@ Event_scheduler::stop() */ state= STOPPING; - DBUG_PRINT("info", ("Manager thread has id %lu", scheduler_thd->thread_id)); + DBUG_PRINT("info", ("Scheduler thread has id %lu", + scheduler_thd->thread_id)); /* Lock from delete */ pthread_mutex_lock(&scheduler_thd->LOCK_delete); /* This will wake up the thread if it waits on Queue's conditional */ - sql_print_information("SCHEDULER: Killing manager thread %lu", + sql_print_information("Event Scheduler: Killing the scheduler thread, " + "thread id %lu", scheduler_thd->thread_id); scheduler_thd->awake(THD::KILL_CONNECTION); pthread_mutex_unlock(&scheduler_thd->LOCK_delete); /* thd could be 0x0, when shutting down */ - sql_print_information("SCHEDULER: Waiting the manager thread to reply"); + sql_print_information("Event Scheduler: " + "Waiting for the scheduler thread to reply"); COND_STATE_WAIT(thd, NULL, "Waiting scheduler to stop"); } while (state == STOPPING); - DBUG_PRINT("info", ("Manager thread has cleaned up. Set state to INIT")); + DBUG_PRINT("info", ("Scheduler thread has cleaned up. Set state to INIT")); /* The rationale behind setting it to NULL here but not destructing it beforehand is because the THD will be deinited in event_scheduler_thread(). diff --git a/sql/events.cc b/sql/events.cc index 02e5a292e16..fd8160e103c 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -641,7 +641,7 @@ Events::init() if (check_system_tables(thd)) { check_system_tables_error= TRUE; - sql_print_error("SCHEDULER: The system tables are damaged. " + sql_print_error("Event Scheduler: The system tables are damaged. " "The scheduler subsystem will be unusable during this run."); goto end; } @@ -649,7 +649,7 @@ Events::init() if (event_queue->init_queue(thd) || load_events_from_db(thd)) { - sql_print_error("SCHEDULER: Error while loading from disk."); + sql_print_error("Event Scheduler: Error while loading from disk."); goto end; } @@ -862,7 +862,7 @@ Events::check_system_tables(THD *thd) if ((ret= simple_open_n_lock_tables(thd, &tables))) { - sql_print_error("SCHEDULER: Cannot open mysql.db"); + sql_print_error("Event Scheduler: Cannot open mysql.db"); ret= TRUE; } ret= table_check_intact(tables.table, MYSQL_DB_FIELD_COUNT, @@ -877,7 +877,7 @@ Events::check_system_tables(THD *thd) if (simple_open_n_lock_tables(thd, &tables)) { - sql_print_error("SCHEDULER: Cannot open mysql.user"); + sql_print_error("Event Scheduler: Cannot open mysql.user"); ret= TRUE; } else @@ -933,7 +933,7 @@ Events::load_events_from_db(THD *thd) if ((ret= db_repository->open_event_table(thd, TL_READ, &table))) { - sql_print_error("SCHEDULER: Table mysql.event is damaged. Can not open"); + sql_print_error("Event Scheduler: Table mysql.event is damaged. Can not open"); DBUG_RETURN(EVEX_OPEN_TABLE_FAILED); } @@ -950,8 +950,9 @@ Events::load_events_from_db(THD *thd) if ((ret= et->load_from_row(thd, table))) { - sql_print_error("SCHEDULER: Error while loading from mysql.event. " - "Table probably corrupted"); + sql_print_error("Event Scheduler: " + "Error while reading from mysql.event. " + "The table is probably corrupted"); break; } if (et->status != Event_queue_element::ENABLED) @@ -964,7 +965,7 @@ Events::load_events_from_db(THD *thd) /* let's find when to be executed */ if (et->compute_next_execution_time()) { - sql_print_error("SCHEDULER: Error while computing execution time of %s.%s." + sql_print_error("Event Scheduler: Error while computing execution time of %s.%s." " Skipping", et->dbname.str, et->name.str); continue; } @@ -981,11 +982,11 @@ Events::load_events_from_db(THD *thd) */ switch (ret= temp_job_data.compile(thd, thd->mem_root)) { case EVEX_MICROSECOND_UNSUP: - sql_print_error("SCHEDULER: mysql.event is tampered. MICROSECOND is not " + sql_print_error("Event Scheduler: mysql.event is tampered. MICROSECOND is not " "supported but found in mysql.event"); break; case EVEX_COMPILE_ERROR: - sql_print_error("SCHEDULER: Error while compiling %s.%s. Aborting load", + sql_print_error("Event Scheduler: Error while compiling %s.%s. Aborting load", et->dbname.str, et->name.str); break; default: @@ -1017,8 +1018,8 @@ end: else { ret= 0; - sql_print_information("SCHEDULER: Loaded %d event%s", count, - (count == 1)?"":"s"); + sql_print_information("Event Scheduler: Loaded %d event%s", + count, (count == 1)?"":"s"); } close_thread_tables(thd); diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 8159f014e93..c0da7053ac2 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5881,10 +5881,10 @@ ER_EVENT_NEITHER_M_EXPR_NOR_M_AT eng "No datetime expression provided" ger "Kein DATETIME-Ausdruck angegeben" ER_COL_COUNT_DOESNT_MATCH_CORRUPTED - eng "Column count of mysql.%s is wrong. Expected %d, found %d. Table probably corrupted" + eng "Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted" ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d gefunden. Tabelle ist wahrscheinlich beschädigt" ER_CANNOT_LOAD_FROM_TABLE - eng "Cannot load from mysql.%s. Table probably corrupted. See error log." + eng "Cannot load from mysql.%s. The table is probably corrupted. Please see the error log for details" ger "Kann mysql.%s nicht einlesen. Tabelle ist wahrscheinlich beschädigt, siehe Fehlerlog" ER_EVENT_CANNOT_DELETE eng "Failed to delete the event from mysql.event" @@ -5982,7 +5982,7 @@ ER_EVENT_RECURSIVITY_FORBIDDEN eng "Recursivity of EVENT DDL statements is forbidden when body is present" ger "Rekursivität von EVENT-DDL-Anweisungen ist unzulässig wenn ein Hauptteil (Body) existiert" ER_EVENTS_DB_ERROR - eng "Cannot proceed because the tables used by events were found damaged at server start" + eng "Cannot proceed because system tables used by Event Scheduler were found damaged at server start" ger "Kann nicht weitermachen, weil die Tabellen, die von Events verwendet werden, beim Serverstart als beschädigt markiert wurden" ER_ONLY_INTEGERS_ALLOWED eng "Only integers allowed as number here" From 7dc5c00453e3ed894123c92c6264ff5abd99bdbf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 17:14:38 +0100 Subject: [PATCH 336/789] enabled and extended single user test --- mysql-test/r/ndb_single_user.result | 10 ++++++ mysql-test/t/disabled.def | 1 - mysql-test/t/ndb_single_user.test | 53 ++++++++++++++++++++--------- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result index debb74a6a41..907cb17fecf 100644 --- a/mysql-test/r/ndb_single_user.result +++ b/mysql-test/r/ndb_single_user.result @@ -43,4 +43,14 @@ update t1 set b=b+100; ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster update t1 set b=b+100 where a > 7; ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +BEGIN; +update t1 set b=b+100 where a=1; +BEGIN; +update t1 set b=b+100 where a=2; +update t1 set b=b+100 where a=3; +COMMIT; +update t1 set b=b+100 where a=4; +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +COMMIT; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster drop table t1; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 2116e9f51e0..df56165950f 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -12,4 +12,3 @@ ndb_load : Bug#17233 user_limits : Bug#23921 random failure of user_limits.test -ndb_single_user : Bug#27021 Error codes in mysqld in single user mode varies diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/t/ndb_single_user.test index c655124f79f..b191e573996 100644 --- a/mysql-test/t/ndb_single_user.test +++ b/mysql-test/t/ndb_single_user.test @@ -51,34 +51,55 @@ insert into t1 select * from t2; --connection server2 --error 1051 drop table t1; ---error 1146 -#--error 1296 +--error 1296 create index new_index on t1 (c); ---error 1146 -#--error 1296 +--error 1296 insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); ---error 1146 -#--error 1296 +--error 1296 select * from t1 where a = 1; ---error 1146 -#--error 1296 +--error 1296 select * from t1 where b = 4; ---error 1146 -#--error 1296 +--error 1296 update t1 set b=102 where a = 2; ---error 1146 -#--error 1296 +--error 1296 update t1 set b=103 where b = 3; ---error 1146 -#--error 1296 +--error 1296 update t1 set b=b+100; ---error 1146 -#--error 1296 +--error 1296 update t1 set b=b+100 where a > 7; --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT +# +# we should be able to run transaction while in single user mode +# +--connection server1 +BEGIN; +update t1 set b=b+100 where a=1; + +--connection server2 +BEGIN; +update t1 set b=b+100 where a=2; + +# enter single user mode +--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT + +--connection server1 +update t1 set b=b+100 where a=3; +COMMIT; + +# while on other mysqld it should be aborted +--connection server2 +--error 1296 +update t1 set b=b+100 where a=4; +--error 1296 +COMMIT; + +--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT + # cleanup --connection server1 drop table t1; From 0c65ef99e2981821827f19c6fa7a06f7dc2b1e5a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 17:22:52 +0100 Subject: [PATCH 337/789] result file updates, message format changes --- mysql-test/r/ndb_single_user.result | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result index 907cb17fecf..85ad30db8b0 100644 --- a/mysql-test/r/ndb_single_user.result +++ b/mysql-test/r/ndb_single_user.result @@ -1,7 +1,7 @@ use test; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; create table t1 (a int key, b int unique, c int) engine ndb; -ERROR HY000: Can't create table './test/t1.frm' (errno: 299) +ERROR HY000: Can't create table 'test.t1' (errno: 299) create table t1 (a int key, b int unique, c int) engine ndb; insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); create table t2 as select * from t1; @@ -28,21 +28,21 @@ insert into t1 select * from t2; drop table t1; ERROR 42S02: Unknown table 't1' create index new_index on t1 (c); -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0); -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER select * from t1 where a = 1; -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER select * from t1 where b = 4; -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER update t1 set b=102 where a = 2; -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER update t1 set b=103 where b = 3; -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER update t1 set b=b+100; -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER update t1 set b=b+100 where a > 7; -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER BEGIN; update t1 set b=b+100 where a=1; BEGIN; @@ -50,7 +50,7 @@ update t1 set b=b+100 where a=2; update t1 set b=b+100 where a=3; COMMIT; update t1 set b=b+100 where a=4; -ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster +ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from NDBCLUSTER COMMIT; -ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER drop table t1; From 9bfc06771dde728189d448b8799f936f77694c57 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 17:31:10 +0100 Subject: [PATCH 338/789] mysql-test/t/query_cache_sql_prepare.test : Prevent this test from running in "embedded". mysql-test/t/query_cache_sql_prepare.test: Prevent this test from running in "embedded", it needs two connections. --- mysql-test/t/query_cache_sql_prepare.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/query_cache_sql_prepare.test b/mysql-test/t/query_cache_sql_prepare.test index 69b504e2fd1..d9854273d02 100644 --- a/mysql-test/t/query_cache_sql_prepare.test +++ b/mysql-test/t/query_cache_sql_prepare.test @@ -4,6 +4,8 @@ # Query cache is abbreviated as "QC" -- source include/have_query_cache.inc +# embedded can't make more than one connection, which this test needs +-- source include/not_embedded.inc connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,); connection default; From 24ce495a518d6d2756e5b1c0cb50f9c7526d0191 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 19:00:34 +0100 Subject: [PATCH 339/789] Bug#26837 Return value ignored for packet->append() call within Log_event::read_log_event - Improve error handling for "out of memory" problems when master is sending logs to slave. If memory allocation fails the log should now report error "memory allocation failed reading log event" sql/log_event.cc: Return LOG_READ_MEM from "Log_event::read_log_event" if memory allocation fails. --- sql/log_event.cc | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index e272140c080..8bb63e72bde 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -669,19 +669,34 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, LOG_READ_TOO_LARGE); goto end; } - packet->append(buf, sizeof(buf)); + + /* Append the log event header to packet */ + if (packet->append(buf, sizeof(buf))) + { + /* Failed to allocate packet */ + result= LOG_READ_MEM; + goto end; + } data_len-= LOG_EVENT_MINIMAL_HEADER_LEN; if (data_len) { + /* Append rest of event, read directly from file into packet */ if (packet->append(file, data_len)) { /* - Here if we hit EOF it's really an error: as data_len is >=0 - there's supposed to be more bytes available. - EOF means we are reading the event partially, which should - never happen: either we read badly or the binlog is truncated. + Fatal error occured when appending rest of the event + to packet, possible failures: + 1. EOF occured when reading from file, it's really an error + as data_len is >=0 there's supposed to be more bytes available. + file->error will have been set to number of bytes left to read + 2. Read was interrupted, file->error would normally be set to -1 + 3. Failed to allocate memory for packet, my_errno + will be ENOMEM(file->error shuold be 0, but since the + memory allocation occurs before the call to read it might + be uninitialized) */ - result= file->error >= 0 ? LOG_READ_TRUNC: LOG_READ_IO; + result= (my_errno == ENOMEM ? LOG_READ_MEM : + (file->error >= 0 ? LOG_READ_TRUNC: LOG_READ_IO)); /* Implicit goto end; */ } } From b765a8af9bb0417a8bbb12cef44014de9badd938 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 19:24:03 +0100 Subject: [PATCH 340/789] Bug #26817: mysqldump fails to backup database containing view with invalid definer give some leeway on required permissions for SHOW FIELDS on views so an unknonwn DEFINER will no longer break mysqldump client/client_priv.h: Bug #26817: mysqldump fails to backup database containing view with invalid definer New option for mysqldump: redirect stderr to file ("2> for Windows") client/mysqldump.c: Bug #26817: mysqldump fails to backup database containing view with invalid definer New option for mysqldump: redirect stderr to file ("2> for Windows") mysql-test/r/information_schema_db.result: Bug #26817: mysqldump fails to backup database containing view with invalid definer New option for mysqldump: redirect stderr to file ("2> for Windows") mysql-test/t/information_schema_db.test: Bug #26817: mysqldump fails to backup database containing view with invalid definer New option for mysqldump: redirect stderr to file ("2> for Windows") sql/sql_base.cc: Bug #26817: mysqldump fails to backup database containing view with invalid definer be a little more lenient for SHOW FIELDS FROM sql/sql_parse.cc: Bug #26817: mysqldump fails to backup database containing view with invalid definer be a little more lenient for SHOW FIELDS FROM on views on views sql/sql_view.cc: Bug #26817: mysqldump fails to backup database containing view with invalid definer give SHOW FIELDS the same perks as SHOW CREATE sql/table.cc: Bug #26817: mysqldump fails to backup database containing view with invalid definer give SHOW FIELDS the same perks as SHOW CREATE --- client/client_priv.h | 2 +- client/mysqldump.c | 24 +++++++- mysql-test/r/information_schema_db.result | 71 ++++++++++++++++++++++- mysql-test/t/information_schema_db.test | 55 +++++++++++++++++- sql/sql_base.cc | 27 ++++++++- sql/sql_parse.cc | 5 +- sql/sql_view.cc | 7 ++- sql/table.cc | 5 +- 8 files changed, 182 insertions(+), 14 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 7748dc612d6..418bf86f2c8 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -51,5 +51,5 @@ enum options_client OPT_TRIGGERS, OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT, - OPT_DEBUG_INFO + OPT_DEBUG_INFO, OPT_ERROR_LOG_FILE }; diff --git a/client/mysqldump.c b/client/mysqldump.c index 94ab9dac5ac..0d7c0c3a0bf 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -105,7 +105,8 @@ static char *opt_password=0,*current_user=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, *where=0, *order_by=0, *opt_compatible_mode_str= 0, - *err_ptr= 0; + *err_ptr= 0, + *log_error_file= NULL; static char **defaults_argv= 0; static char compatible_mode_normal_str[255]; static ulong opt_compatible_mode= 0; @@ -116,7 +117,9 @@ static my_string opt_mysql_unix_port=0; static int first_error=0; static DYNAMIC_STRING extended_row; #include -FILE *md_result_file= 0; +FILE *md_result_file= 0; +FILE *stderror_file=0; + #ifdef HAVE_SMEM static char *shared_memory_base_name=0; #endif @@ -293,6 +296,9 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables, (gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.", + (gptr*) &log_error_file, (gptr*) &log_error_file, 0, GET_STR, + REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"master-data", OPT_MASTER_DATA, "This causes the binary log position and filename to be appended to the " "output. If equal to 1, will print it as a CHANGE MASTER command; if equal" @@ -3694,6 +3700,16 @@ int main(int argc, char **argv) free_resources(0); exit(exit_code); } + + if (log_error_file) + { + if(!(stderror_file= freopen(log_error_file, "a+", stderr))) + { + free_resources(0); + exit(EX_MYSQLERR); + } + } + if (connect_to_db(current_host, current_user, opt_password)) { free_resources(0); @@ -3746,5 +3762,9 @@ err: if (!path) write_footer(md_result_file); free_resources(); + + if (stderror_file) + fclose(stderror_file); + return(first_error); } /* main */ diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result index 47efe1d17ad..2d330dda333 100644 --- a/mysql-test/r/information_schema_db.result +++ b/mysql-test/r/information_schema_db.result @@ -106,16 +106,82 @@ use testdb_1; create table t1 (f1 char(4)); create view v1 as select f1 from t1; grant insert on v1 to testdb_2@localhost; +create view v5 as select f1 from t1; +grant show view on v5 to testdb_2@localhost; +create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1; +ERROR 42000: Access denied; you need the SUPER privilege for this operation +use testdb_1; +create view v6 as select f1 from t1; +grant show view on v6 to testdb_2@localhost; +create table t2 (f1 char(4)); +create definer=`no_such_user`@`no_such_host` view v7 as select * from t2; +Warnings: +Note 1449 There is no 'no_such_user'@'no_such_host' registered +show fields from testdb_1.v6; +Field Type Null Key Default Extra +f1 char(4) YES NULL +show create view testdb_1.v6; +View Create View +v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v6` AS select `t1`.`f1` AS `f1` from `t1` +show create view testdb_1.v7; +View Create View +v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` +Warnings: +Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +show fields from testdb_1.v7; +Field Type Null Key Default Extra +f1 null YES NULL +Warnings: +Note 1449 There is no 'no_such_user'@'no_such_host' registered create table t3 (f1 char(4), f2 char(4)); create view v3 as select f1,f2 from t3; grant insert(f1), insert(f2) on v3 to testdb_2@localhost; create view v2 as select f1 from testdb_1.v1; create view v4 as select f1,f2 from testdb_1.v3; +show fields from testdb_1.v5; +Field Type Null Key Default Extra +f1 char(4) YES NULL +show create view testdb_1.v5; +View Create View +v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` +show fields from testdb_1.v6; +Field Type Null Key Default Extra +f1 char(4) YES NULL +show create view testdb_1.v6; +View Create View +v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` +show fields from testdb_1.v7; +Field Type Null Key Default Extra +f1 null YES NULL +Warnings: +Note 1449 There is no 'no_such_user'@'no_such_host' registered +show create view testdb_1.v7; +View Create View +v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` +Warnings: +Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them revoke insert(f1) on v3 from testdb_2@localhost; +revoke show view on v5 from testdb_2@localhost; +use testdb_1; +revoke show view on v6 from testdb_2@localhost; +show fields from testdb_1.v5; +ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5' +show create view testdb_1.v5; +ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5' +show fields from testdb_1.v6; +ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v6' +show create view testdb_1.v6; +ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v6' +show fields from testdb_1.v7; +ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v7' +show create view testdb_1.v7; +ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v7' show create view v4; ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table show fields from v4; -ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table +Field Type Null Key Default Extra +f1 null YES NULL +f2 char(4) YES NULL show fields from v2; Field Type Null Key Default Extra f1 char(4) YES NULL @@ -140,7 +206,8 @@ where a.table_name = 'testdb_1.v1'; view_definition select * from v2; ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them -drop view testdb_1.v1,v2, testdb_1.v3, v4; +use test; +drop view testdb_1.v1, v2, testdb_1.v3, v4; drop database testdb_1; drop user testdb_1@localhost; drop user testdb_2@localhost; diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test index e15e50e8766..666f331c7b9 100644 --- a/mysql-test/t/information_schema_db.test +++ b/mysql-test/t/information_schema_db.test @@ -121,6 +121,28 @@ create table t1 (f1 char(4)); create view v1 as select f1 from t1; grant insert on v1 to testdb_2@localhost; +create view v5 as select f1 from t1; +grant show view on v5 to testdb_2@localhost; + +--error 1227 +create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1; + +connection default; +use testdb_1; +create view v6 as select f1 from t1; +grant show view on v6 to testdb_2@localhost; + +create table t2 (f1 char(4)); +create definer=`no_such_user`@`no_such_host` view v7 as select * from t2; + +show fields from testdb_1.v6; +show create view testdb_1.v6; + +show create view testdb_1.v7; +show fields from testdb_1.v7; + +connection testdb_1; + create table t3 (f1 char(4), f2 char(4)); create view v3 as select f1,f2 from t3; grant insert(f1), insert(f2) on v3 to testdb_2@localhost; @@ -129,13 +151,41 @@ connect (testdb_2,localhost,testdb_2,,test); create view v2 as select f1 from testdb_1.v1; create view v4 as select f1,f2 from testdb_1.v3; +show fields from testdb_1.v5; +show create view testdb_1.v5; + +show fields from testdb_1.v6; +show create view testdb_1.v6; + connection testdb_1; +show fields from testdb_1.v7; +show create view testdb_1.v7; + revoke insert(f1) on v3 from testdb_2@localhost; +revoke show view on v5 from testdb_2@localhost; +connection default; +use testdb_1; +revoke show view on v6 from testdb_2@localhost; connection testdb_2; +--error 1142 +show fields from testdb_1.v5; +--error 1142 +show create view testdb_1.v5; + +--error 1142 +show fields from testdb_1.v6; +--error 1142 +show create view testdb_1.v6; + +--error 1142 +show fields from testdb_1.v7; +--error 1142 +show create view testdb_1.v7; + --error 1345 show create view v4; ---error 1345 +#--error 1345 show fields from v4; show fields from v2; @@ -155,7 +205,8 @@ where a.table_name = 'testdb_1.v1'; select * from v2; connection default; -drop view testdb_1.v1,v2, testdb_1.v3, v4; +use test; +drop view testdb_1.v1, v2, testdb_1.v3, v4; drop database testdb_1; drop user testdb_1@localhost; drop user testdb_2@localhost; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 77bb1d9642b..1693c98bab7 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3573,14 +3573,35 @@ find_field_in_tables(THD *thd, Item_ident *item, { Field *cur_field= find_field_in_table_ref(thd, cur_table, name, length, item->name, db, table_name, ref, - check_privileges, allow_rowid, + check_privileges, + allow_rowid, &(item->cached_field_index), register_tree_change, &actual_table); if (cur_field) { if (cur_field == WRONG_GRANT) - return (Field*) 0; + { + if (thd->lex->sql_command != SQLCOM_SHOW_FIELDS) + return (Field*) 0; + + thd->clear_error(); + cur_field= find_field_in_table_ref(thd, cur_table, name, length, + item->name, db, table_name, ref, + false, + allow_rowid, + &(item->cached_field_index), + register_tree_change, + &actual_table); + if (cur_field) + { + Field *nf=new Field_null(NULL,0,Field::NONE, + cur_field->field_name, + cur_field->table, + &my_charset_bin); + cur_field= nf; + } + } /* Store the original table of the field, which may be different from @@ -3603,7 +3624,7 @@ find_field_in_tables(THD *thd, Item_ident *item, report_error == IGNORE_EXCEPT_NON_UNIQUE) my_error(ER_NON_UNIQ_ERROR, MYF(0), table_name ? item->full_name() : name, thd->where); - return (Field*) 0; + return (Field*) 0; } found= cur_field; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1b8bfd38fc4..40914339cf1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5159,7 +5159,10 @@ bool check_single_table_access(THD *thd, ulong privilege, goto deny; /* Show only 1 table for check_grant */ - if (grant_option && check_grant(thd, privilege, all_tables, 0, 1, 0)) + if (grant_option && + !(all_tables->belong_to_view && + (thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) && + check_grant(thd, privilege, all_tables, 0, 1, 0)) goto deny; thd->security_ctx= backup_ctx; diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 7143df8474a..32231a93ef7 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1003,6 +1003,11 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, CHARSET_INFO *save_cs= thd->variables.character_set_client; thd->variables.character_set_client= system_charset_info; res= MYSQLparse((void *)thd); + + if ((old_lex->sql_command == SQLCOM_SHOW_FIELDS) || + (old_lex->sql_command == SQLCOM_SHOW_CREATE)) + lex->sql_command= old_lex->sql_command; + thd->variables.character_set_client= save_cs; thd->variables.sql_mode= save_mode; } @@ -1028,7 +1033,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, } } else if (!table->prelocking_placeholder && - old_lex->sql_command == SQLCOM_SHOW_CREATE && + (old_lex->sql_command == SQLCOM_SHOW_CREATE) && !table->belong_to_view) { if (check_table_access(thd, SHOW_VIEW_ACL, table, 0)) diff --git a/sql/table.cc b/sql/table.cc index 960534bf7d4..6d13514e782 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2085,7 +2085,7 @@ void st_table_list::hide_view_error(THD *thd) thd->net.last_errno == ER_NO_SUCH_TABLE) { TABLE_LIST *top= top_table(); - thd->clear_error(); + thd->clear_error(); my_error(ER_VIEW_INVALID, MYF(0), top->view_db.str, top->view_name.str); } else if (thd->net.last_errno == ER_NO_DEFAULT_FOR_FIELD) @@ -2441,7 +2441,8 @@ bool st_table_list::prepare_view_securety_context(THD *thd) definer.host.str, thd->db)) { - if (thd->lex->sql_command == SQLCOM_SHOW_CREATE) + if ((thd->lex->sql_command == SQLCOM_SHOW_CREATE) || + (thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) { push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_NO_SUCH_USER, From d89329c68586b11984d86f3701f08c4a08f0a895 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 20:37:20 +0200 Subject: [PATCH 341/789] reverted linuxthreads thr_client_alarm fix (not future-proof) fixed differently: wake up select_thread with THR_SERVER_ALARM instead mysys/thr_alarm.c: reverted linuxthreads thr_client_alarm fix (not future-proof) --- mysys/thr_alarm.c | 4 ++++ sql/mysqld.cc | 23 ++++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 396623dea21..759544af17b 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -78,6 +78,10 @@ void init_thr_alarm(uint max_alarms) sigfillset(&full_signal_set); /* Neaded to block signals */ pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_alarm,NULL); + if (thd_lib_detected == THD_LIB_LT) + thr_client_alarm= SIGALRM; + else + thr_client_alarm= SIGUSR1; #ifndef USE_ALARM_THREAD if (thd_lib_detected != THD_LIB_LT) #endif diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 903d49a468c..e26bd31a00a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -622,7 +622,7 @@ static void close_connections(void) DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM - if (pthread_kill(select_thread, thr_client_alarm)) + if (pthread_kill(select_thread, THR_SERVER_ALARM)) break; // allready dead #endif set_timespec(abstime, 2); @@ -2062,17 +2062,6 @@ static void init_signals(void) struct sigaction sa; DBUG_ENTER("init_signals"); - if (thd_lib_detected == THD_LIB_LT) - { - thr_client_alarm= SIGALRM; - thr_kill_signal= SIGINT; - } - else - { - thr_client_alarm= SIGUSR1; - thr_kill_signal= SIGUSR2; - } - if (test_flags & TEST_SIGINT) { my_sigset(thr_kill_signal, end_thread_signal); @@ -2131,14 +2120,11 @@ static void init_signals(void) #ifdef SIGTSTP sigaddset(&set,SIGTSTP); #endif - sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) { // May be SIGINT sigdelset(&set, thr_kill_signal); } - // For alarms - sigdelset(&set, thr_client_alarm); sigprocmask(SIG_SETMASK,&set,NULL); pthread_sigmask(SIG_SETMASK,&set,NULL); DBUG_VOID_RETURN; @@ -3167,6 +3153,13 @@ int main(int argc, char **argv) MY_INIT(argv[0]); // init my_sys library & pthreads + /* Set signal used to kill MySQL */ +#if defined(SIGUSR2) + thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2; +#else + thr_kill_signal= thd_lib_detected == SIGINT; +#endif + #ifdef _CUSTOMSTARTUPCONFIG_ if (_cust_check_startup()) { From 212ecf348cbb43f71cfd14a51ca19b7ef987859f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 22:08:31 +0200 Subject: [PATCH 342/789] Removed not used define YY_MAGIC_BELOW Made year 2000 handling more uniform Removed year 2000 handling out from calc_days() The above removes some bugs in date/datetimes with year between 0 and 200 Now we get a note when we insert a datetime value into a date column For default values to CREATE, don't give errors for warning level NOTE Fixed some compiler failures Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support) Removed duplicate typedef TIME and replaced it with MYSQL_TIME Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE" Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value" Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)" include/my_time.h: Removed not used define YY_MAGIC_BELOW Added prototype for year_2000_handling() mysql-test/r/date_formats.result: Updated results (fixed bug in date_format() with year < 99) mysql-test/r/func_sapdb.result: Added more testing of make_date() mysql-test/r/func_time.result: Fixed bug in date_sub() with years < 200 mysql-test/r/ps_2myisam.result: Now we get a note when we insert a datetime value into a date column mysql-test/r/ps_3innodb.result: Now we get a note when we insert a datetime value into a date column mysql-test/r/ps_4heap.result: Now we get a note when we insert a datetime value into a date column mysql-test/r/ps_5merge.result: Now we get a note when we insert a datetime value into a date column mysql-test/r/ps_7ndb.result: Now we get a note when we insert a datetime value into a date column mysql-test/r/type_date.result: Added test for date conversions mysql-test/r/type_datetime.result: Added testcase for datetime to date conversion. mysql-test/t/date_formats.test: Added testing of dates < 200 mysql-test/t/func_sapdb.test: More testing of makedate() mysql-test/t/type_date.test: Added test for date conversions mysql-test/t/type_datetime.test: Added testcase for datetime to date conversion. sql/CMakeLists.txt: Added library ws2_32 (needed if we want to compile with IOCP support) sql/event_data_objects.cc: TIME -> MYSQL_TIME sql/event_db_repository.cc: TIME -> MYSQL_TIME sql/event_queue.cc: TIME -> MYSQL_TIME sql/field.cc: Give note if we insert a datetime value in a date field Don't give notes if we are doing internal test conversions (like from convert_constant_item()) More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error)) Revert some changes in Field_newdate::store() to get more optimal code Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set. New parameters to make_truncated_value_warning() sql/field.h: TIME -> MYSQL_TIME sql/item.cc: New parameters to make_truncated_value_warning() Fixed get_date() to call number_to_datetime() if argument is not a string. Fixes Bug#23093 Implicit conversion of 9912101 to date does not match cast(9912101 as date) sql/item.h: TIME -> MYSQL_TIME sql/item_cmpfunc.cc: Don't print notes in convert_constant_item() sql/item_func.h: TIME -> MYSQL_TIME sql/item_timefunc.cc: New parameters to make_truncated_value_warning() Moved year 2000 handling out from calc_days() Don't return NULL for years < 200 in date_add/date_sub sql/item_timefunc.h: TIME -> MYSQL_TIME sql/my_decimal.cc: TIME -> MYSQL_TIME sql/my_decimal.h: TIME -> MYSQL_TIME sql/mysql_priv.h: Added error level to make_truncated_value_warning() sql/protocol.cc: TIME -> MYSQL_TIME sql/protocol.h: TIME -> MYSQL_TIME sql/sp.cc: TIME -> MYSQL_TIME sql/sql_base.cc: Make testing of result value of save_in_field() uniform sql-common/my_time.c: Added year_2000_handling() Removed year 2000 handling from calc_daynr() sql/sql_class.h: TIME -> MYSQL_TIME sql/sql_show.cc: TIME -> MYSQL_TIME sql/structs.h: TIME -> MYSQL_TIME sql/time.cc: Added error level to make_truncated_value_warning() sql/tztime.cc: TIME -> MYSQL_TIME sql/tztime.h: TIME -> MYSQL_TIME sql/unireg.cc: For default values to CREATE, don't give errors for warning level NOTE (Fixed failed CREATE when we give a datetime value to a date field) strings/ctype-utf8.c: Fixed compiler failures win/README: More comments --- include/my_time.h | 3 +- mysql-test/r/date_formats.result | 18 ++- mysql-test/r/func_sapdb.result | 6 + mysql-test/r/func_time.result | 10 +- mysql-test/r/ps_2myisam.result | 19 ++- mysql-test/r/ps_3innodb.result | 19 ++- mysql-test/r/ps_4heap.result | 19 ++- mysql-test/r/ps_5merge.result | 38 ++++-- mysql-test/r/ps_7ndb.result | 19 ++- mysql-test/r/type_date.result | 26 ++++ mysql-test/r/type_datetime.result | 35 +++++ mysql-test/t/date_formats.test | 2 + mysql-test/t/func_sapdb.test | 2 + mysql-test/t/type_date.test | 13 ++ mysql-test/t/type_datetime.test | 22 +++ sql-common/my_time.c | 39 +++++- sql/CMakeLists.txt | 2 +- sql/event_data_objects.cc | 22 +-- sql/event_db_repository.cc | 6 +- sql/event_queue.cc | 2 +- sql/field.cc | 121 ++++++++++------- sql/field.h | 30 ++--- sql/item.cc | 73 ++++++---- sql/item.h | 26 ++-- sql/item_cmpfunc.cc | 3 + sql/item_func.h | 4 +- sql/item_timefunc.cc | 217 +++++++++++++++++------------- sql/item_timefunc.h | 48 +++---- sql/my_decimal.cc | 2 +- sql/my_decimal.h | 2 +- sql/mysql_priv.h | 29 ++-- sql/protocol.cc | 12 +- sql/protocol.h | 18 +-- sql/sp.cc | 2 +- sql/sql_base.cc | 2 +- sql/sql_class.h | 2 +- sql/sql_show.cc | 10 +- sql/structs.h | 3 +- sql/time.cc | 48 +++---- sql/tztime.cc | 92 ++++++------- sql/tztime.h | 12 +- sql/unireg.cc | 4 +- strings/ctype-utf8.c | 2 + win/README | 2 +- 44 files changed, 677 insertions(+), 409 deletions(-) diff --git a/include/my_time.h b/include/my_time.h index d96c5822069..ce9f45ad6a4 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -51,8 +51,6 @@ typedef long my_time_t; /* two-digit years < this are 20..; >= this are 19.. */ #define YY_PART_YEAR 70 -/* apply above magic to years < this */ -#define YY_MAGIC_BELOW 200 /* Flags to str_to_datetime */ #define TIME_FUZZY_DATE 1 @@ -93,6 +91,7 @@ int check_time_range(struct st_mysql_time *, int *warning); long calc_daynr(uint year,uint month,uint day); uint calc_days_in_year(uint year); +uint year_2000_handling(uint year); void init_time(void); diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index cf3495ef26d..92170a64b29 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -91,6 +91,8 @@ create table t1 (date char(30), format char(30) not null); insert into t1 values ('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), ('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'), +('0003-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'), +('03-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'), ('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'), ('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'), ('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'), @@ -122,6 +124,8 @@ select date,format,str_to_date(date, format) as str_to_date from t1; date format str_to_date 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12 03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02 08:11:02 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 @@ -153,6 +157,8 @@ select date,format,concat('',str_to_date(date, format)) as con from t1; date format con 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12 03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02 08:11:02 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 @@ -184,6 +190,8 @@ select date,format,cast(str_to_date(date, format) as datetime) as datetime from date format datetime 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12 03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02 08:11:02 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02 2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 @@ -222,6 +230,8 @@ select date,format,DATE(str_to_date(date, format)) as date2 from t1; date format date2 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 0003-01-02 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 2003-01-02 2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 @@ -253,6 +263,8 @@ select date,format,TIME(str_to_date(date, format)) as time from t1; date format time 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 @@ -291,6 +303,8 @@ select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; date format time2 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 @@ -423,14 +437,14 @@ select date,format,str_to_date(date, format) as str_to_date from t1; date format str_to_date 10:20:10AM %h:%i:%s 0000-00-00 10:20:10 2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12 -03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12 +03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 Warnings: Warning 1292 Incorrect datetime value: '10:20:10AM' select date,format,concat(str_to_date(date, format),'') as con from t1; date format con 10:20:10AM %h:%i:%s 0000-00-00 10:20:10 2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12 -03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12 +03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12 Warnings: Warning 1292 Incorrect datetime value: '10:20:10AM' drop table t1; diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index 124b20e9b46..b7dbfc670a8 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -75,6 +75,12 @@ NULL select weekofyear("1997-11-30 23:59:59.000001"); weekofyear("1997-11-30 23:59:59.000001") 48 +select makedate(03,1); +makedate(03,1) +2003-01-01 +select makedate('0003',1); +makedate('0003',1) +2003-01-01 select makedate(1997,1); makedate(1997,1) 1997-01-01 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 16a1e5d01d7..2d59a32218c 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1225,13 +1225,13 @@ TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") End of 5.0 tests select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND) -NULL +0049-12-31 23:59:59 select date_sub("0199-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0199-01-01 00:00:01",INTERVAL 2 SECOND) -NULL +0198-12-31 23:59:59 select date_add("0199-12-31 23:59:59",INTERVAL 2 SECOND); date_add("0199-12-31 23:59:59",INTERVAL 2 SECOND) -NULL +0200-01-01 00:00:01 select date_sub("0200-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0200-01-01 00:00:01",INTERVAL 2 SECOND) 0199-12-31 23:59:59 @@ -1252,8 +1252,8 @@ date_sub("90-01-01 00:00:01",INTERVAL 2 SECOND) 1989-12-31 23:59:59 select date_sub("0069-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0069-01-01 00:00:01",INTERVAL 2 SECOND) -NULL +0068-12-31 23:59:59 select date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND) -NULL +0168-12-31 23:59:59 End of 5.1 tests diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index af7a762c5a8..d18bb8dc434 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -2961,20 +2961,26 @@ delete from t9 ; test_sequence -- insert into date/time columns -- Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1264 Out of range value for column 'c13' at row 1 @@ -3005,6 +3011,7 @@ Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 8c0b9f1e19b..e6ff668760c 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -2944,20 +2944,26 @@ delete from t9 ; test_sequence -- insert into date/time columns -- Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1264 Out of range value for column 'c13' at row 1 @@ -2988,6 +2994,7 @@ Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 7ad6e3ea722..046992806cc 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -2945,20 +2945,26 @@ delete from t9 ; test_sequence -- insert into date/time columns -- Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1264 Out of range value for column 'c13' at row 1 @@ -2989,6 +2995,7 @@ Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 1e2c27e6e4f..bbdb80df5d4 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -2881,20 +2881,26 @@ delete from t9 ; test_sequence -- insert into date/time columns -- Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1264 Out of range value for column 'c13' at row 1 @@ -2925,6 +2931,7 @@ Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 @@ -5895,20 +5902,26 @@ delete from t9 ; test_sequence -- insert into date/time columns -- Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1264 Out of range value for column 'c13' at row 1 @@ -5939,6 +5952,7 @@ Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index e43f6b4ed6c..20d38ba84bd 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -2944,20 +2944,26 @@ delete from t9 ; test_sequence -- insert into date/time columns -- Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1265 Data truncated for column 'c17' at row 1 Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c17' at row 1 Warnings: Warning 1264 Out of range value for column 'c13' at row 1 @@ -2988,6 +2994,7 @@ Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 Warnings: +Note 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 Warning 1264 Out of range value for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 12ce742eab4..4b651c137ad 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -110,3 +110,29 @@ select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_dat 1 1 drop table t1; +select @d:=1111, year(@d), month(@d), day(@d), cast(@d as date); +@d:=1111 year(@d) month(@d) day(@d) cast(@d as date) +1111 2000 11 11 2000-11-11 +select @d:=011111, year(@d), month(@d), day(@d), cast(@d as date); +@d:=011111 year(@d) month(@d) day(@d) cast(@d as date) +11111 2001 11 11 2001-11-11 +select @d:=1311, year(@d), month(@d), day(@d), cast(@d as date); +@d:=1311 year(@d) month(@d) day(@d) cast(@d as date) +1311 NULL NULL NULL NULL +Warnings: +Warning 1292 Incorrect datetime value: '1311' +Warning 1292 Incorrect datetime value: '1311' +Warning 1292 Incorrect datetime value: '1311' +Warning 1292 Incorrect datetime value: '1311' +create table t1 (d date , dt datetime , ts timestamp); +insert into t1 values (9912101,9912101,9912101); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'dt' at row 1 +Warning 1265 Data truncated for column 'ts' at row 1 +insert into t1 values (11111,11111,11111); +select * from t1; +d dt ts +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 +2001-11-11 2001-11-11 00:00:00 2001-11-11 00:00:00 +drop table t1; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index b54bd155c7d..56770371a1e 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -194,3 +194,38 @@ CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMA SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)); CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)) 101112.098700 +set @org_mode=@@sql_mode; +create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03'); +Warnings: +Note 1265 Data truncated for column 'da' at row 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `da` date DEFAULT '1962-03-03', + `dt` datetime DEFAULT '1962-03-03 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (); +insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); +Warnings: +Note 1265 Data truncated for column 'da' at row 1 +set @@sql_mode='ansi,traditional'; +insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); +Warnings: +Note 1265 Data truncated for column 'da' at row 1 +insert into t1 set dt='2007-03-23 13:49:38',da=dt; +Warnings: +Note 1265 Data truncated for column 'da' at row 1 +insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); +ERROR 22007: Incorrect date value: '2007-03-32' for column 'da' at row 1 +select * from t1; +da dt +1962-03-03 1962-03-03 00:00:00 +2007-03-23 2007-03-23 13:49:38 +2007-03-23 2007-03-23 13:49:38 +2007-03-23 2007-03-23 13:49:38 +drop table t1; +create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03'); +ERROR 42000: Invalid default value for 'da' +create table t1 (t time default '916:00:00 a'); +ERROR 42000: Invalid default value for 't' +set @@sql_mode= @org_mode; diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index 64bd69c1855..fe39cd95753 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -132,6 +132,8 @@ create table t1 (date char(30), format char(30) not null); insert into t1 values ('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), ('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'), +('0003-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'), +('03-01-02 8:11:2.123456', '%Y-%m-%d %H:%i:%S.%#'), ('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'), ('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'), ('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'), diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 77d7366afe6..bb65cbaa774 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -41,6 +41,8 @@ select datediff("1997-11-30 23:59:59.000001",null); select weekofyear("1997-11-30 23:59:59.000001"); +select makedate(03,1); +select makedate('0003',1); select makedate(1997,1); select makedate(1997,0); select makedate(9999,365); diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index c6050753943..02cd07e3c16 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -123,3 +123,16 @@ insert into t1 values ('2000-01-01','2000-01-02'); select 1 from t1 where cast('2000-01-01 12:01:01' as datetime) between start_date and end_date; drop table t1; # End of 4.1 tests + +# +# Bug #23093: Implicit conversion of 9912101 to date does not match +# cast(9912101 as date) +# +select @d:=1111, year(@d), month(@d), day(@d), cast(@d as date); +select @d:=011111, year(@d), month(@d), day(@d), cast(@d as date); +select @d:=1311, year(@d), month(@d), day(@d), cast(@d as date); +create table t1 (d date , dt datetime , ts timestamp); +insert into t1 values (9912101,9912101,9912101); +insert into t1 values (11111,11111,11111); +select * from t1; +drop table t1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 9246080630e..b4c10408b37 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -141,3 +141,25 @@ SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6)); SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6)); SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)); +# +# Test of storing datetime into date fields +# + +set @org_mode=@@sql_mode; +create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03'); +show create table t1; +insert into t1 values (); +insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); +set @@sql_mode='ansi,traditional'; +insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); +insert into t1 set dt='2007-03-23 13:49:38',da=dt; +# Test error handling +--error 1292 +insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); +select * from t1; +drop table t1; +--error 1067 +create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03'); +--error 1067 +create table t1 (t time default '916:00:00 a'); +set @@sql_mode= @org_mode; diff --git a/sql-common/my_time.c b/sql-common/my_time.c index e62003d13ed..4aad97f8249 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -730,7 +730,39 @@ void init_time(void) } - /* Calculate nr of day since year 0 in new date-system (from 1615) */ +/* + Handle 2 digit year conversions + + SYNOPSIS + year_2000_handling() + year 2 digit year + + RETURN + Year between 1970-2069 +*/ + +uint year_2000_handling(uint year) +{ + if ((year=year+1900) < 1900+YY_PART_YEAR) + year+=100; + return year; +} + + +/* + Calculate nr of day since year 0 in new date-system (from 1615) + + SYNOPSIS + calc_daynr() + year Year (exact 4 digit year, no year conversions) + month Month + day Day + + NOTES: 0000-00-00 is a valid date, and will return 0 + + RETURN + Days since 0000-00-00 +*/ long calc_daynr(uint year,uint month,uint day) { @@ -740,11 +772,6 @@ long calc_daynr(uint year,uint month,uint day) if (year == 0 && month == 0 && day == 0) DBUG_RETURN(0); /* Skip errors */ - if (year < YY_MAGIC_BELOW) - { - if ((year=year+1900) < 1900+YY_PART_YEAR) - year+=100; - } delsum= (long) (365L * year+ 31*(month-1) +day); if (month <= 2) year--; diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 002aabb91b0..6569d06743e 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -79,7 +79,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc ${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc ${PROJECT_SOURCE_DIR}/sql/lex_hash.h) TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl - taocrypt strings vio regex wsock32) + taocrypt strings vio regex wsock32 ws2_32) IF(WITH_ARCHIVE_STORAGE_ENGINE) TARGET_LINK_LIBRARIES(mysqld archive) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 67ba371772a..cc8768bc58f 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -286,7 +286,7 @@ int Event_parse_data::init_execute_at(THD *thd) { my_bool not_used; - TIME ltime; + MYSQL_TIME ltime; my_time_t ltime_utc; DBUG_ENTER("Event_parse_data::init_execute_at"); @@ -455,7 +455,7 @@ int Event_parse_data::init_starts(THD *thd) { my_bool not_used; - TIME ltime; + MYSQL_TIME ltime; my_time_t ltime_utc; DBUG_ENTER("Event_parse_data::init_starts"); @@ -509,7 +509,7 @@ int Event_parse_data::init_ends(THD *thd) { my_bool not_used; - TIME ltime; + MYSQL_TIME ltime; my_time_t ltime_utc; DBUG_ENTER("Event_parse_data::init_ends"); @@ -909,7 +909,7 @@ int Event_queue_element::load_from_row(THD *thd, TABLE *table) { char *ptr; - TIME time; + MYSQL_TIME time; DBUG_ENTER("Event_queue_element::load_from_row"); @@ -1079,7 +1079,7 @@ error: */ static my_time_t -add_interval(TIME *ltime, const Time_zone *time_zone, +add_interval(MYSQL_TIME *ltime, const Time_zone *time_zone, interval_type scale, INTERVAL interval) { if (date_add_interval(ltime, scale, interval)) @@ -1172,8 +1172,8 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next, } DBUG_PRINT("info", ("seconds: %ld months: %ld", (long) seconds, (long) months)); - TIME local_start; - TIME local_now; + MYSQL_TIME local_start; + MYSQL_TIME local_now; /* Convert times from UTC to local. */ { @@ -1417,7 +1417,7 @@ Event_queue_element::compute_next_execution_time() { /* Both starts and m_ends are set and time_now is between them (incl.) - If last_executed is set then increase with m_expression. The new TIME is + If last_executed is set then increase with m_expression. The new MYSQL_TIME is after m_ends set execute_at to 0. And check for on_completion If not set then schedule for now. */ @@ -1559,7 +1559,7 @@ err: /* - Set the internal last_executed TIME struct to now. NOW is the + Set the internal last_executed MYSQL_TIME struct to now. NOW is the time according to thd->query_start(), so the THD's clock. SYNOPSIS @@ -1626,7 +1626,7 @@ Event_queue_element::update_timing_fields(THD *thd) if (last_executed_changed) { - TIME time; + MYSQL_TIME time; my_tz_UTC->gmt_sec_to_TIME(&time, last_executed); fields[ET_FIELD_LAST_EXECUTED]->set_notnull(); @@ -1665,7 +1665,7 @@ append_datetime(String *buf, Time_zone *time_zone, my_time_t secs, Pass the buffer and the second param tells fills the buffer and returns the number of chars to copy. */ - TIME time; + MYSQL_TIME time; time_zone->gmt_sec_to_TIME(&time, secs); buf->append(dtime_buff, my_datetime_to_str(&time, dtime_buff)); buf->append(STRING_WITH_LEN("'")); diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 0c59d3e92f8..7232390ef69 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -210,7 +210,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, if (!et->starts_null) { - TIME time; + MYSQL_TIME time; my_tz_UTC->gmt_sec_to_TIME(&time, et->starts); fields[ET_FIELD_STARTS]->set_notnull(); @@ -219,7 +219,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, if (!et->ends_null) { - TIME time; + MYSQL_TIME time; my_tz_UTC->gmt_sec_to_TIME(&time, et->ends); fields[ET_FIELD_ENDS]->set_notnull(); @@ -238,7 +238,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, fields[ET_FIELD_STARTS]->set_null(); fields[ET_FIELD_ENDS]->set_null(); - TIME time; + MYSQL_TIME time; my_tz_UTC->gmt_sec_to_TIME(&time, et->execute_at); fields[ET_FIELD_EXECUTE_AT]->set_notnull(); diff --git a/sql/event_queue.cc b/sql/event_queue.cc index ef9dddf9195..f64509ee25c 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -749,7 +749,7 @@ Event_queue::dump_internal_status() mutex_last_attempted_lock_at_line); printf("WOC : %s\n", waiting_on_cond? "YES":"NO"); - TIME time; + MYSQL_TIME time; my_tz_UTC->gmt_sec_to_TIME(&time, next_activation_at); printf("Next activation : %04d-%02d-%02d %02d:%02d:%02d\n", time.year, time.month, time.day, time.hour, time.minute, time.second); diff --git a/sql/field.cc b/sql/field.cc index 7240a59c75f..56e60d81e64 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1500,7 +1500,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy) } -bool Field::get_date(TIME *ltime,uint fuzzydate) +bool Field::get_date(MYSQL_TIME *ltime,uint fuzzydate) { char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; @@ -1511,7 +1511,7 @@ bool Field::get_date(TIME *ltime,uint fuzzydate) return 0; } -bool Field::get_time(TIME *ltime) +bool Field::get_time(MYSQL_TIME *ltime) { char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; @@ -1528,7 +1528,7 @@ bool Field::get_time(TIME *ltime) Needs to be changed if/when we want to support different time formats */ -int Field::store_time(TIME *ltime, timestamp_type type_arg) +int Field::store_time(MYSQL_TIME *ltime, timestamp_type type_arg) { ASSERT_COLUMN_MARKED_FOR_WRITE; char buff[MAX_DATE_STRING_REP_LENGTH]; @@ -2476,7 +2476,7 @@ int Field_new_decimal::store_decimal(const my_decimal *decimal_value) } -int Field_new_decimal::store_time(TIME *ltime, timestamp_type t_type) +int Field_new_decimal::store_time(MYSQL_TIME *ltime, timestamp_type t_type) { my_decimal decimal_value; return store_value(date2my_decimal(ltime, &decimal_value)); @@ -4522,7 +4522,7 @@ timestamp_auto_set_type Field_timestamp::get_auto_set_type() const int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME l_time; + MYSQL_TIME l_time; my_time_t tmp= 0; int error; bool have_smth_to_conv; @@ -4593,7 +4593,7 @@ int Field_timestamp::store(double nr) int Field_timestamp::store(longlong nr, bool unsigned_val) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME l_time; + MYSQL_TIME l_time; my_time_t timestamp= 0; int error; my_bool in_dst_time_gap; @@ -4652,7 +4652,7 @@ longlong Field_timestamp::val_int(void) { ASSERT_COLUMN_MARKED_FOR_READ; uint32 temp; - TIME time_tmp; + MYSQL_TIME time_tmp; THD *thd= table ? table->in_use : current_thd; #ifdef WORDS_BIGENDIAN @@ -4678,7 +4678,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) { ASSERT_COLUMN_MARKED_FOR_READ; uint32 temp, temp2; - TIME time_tmp; + MYSQL_TIME time_tmp; THD *thd= table ? table->in_use : current_thd; char *to; @@ -4747,7 +4747,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) } -bool Field_timestamp::get_date(TIME *ltime, uint fuzzydate) +bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate) { long temp; THD *thd= table ? table->in_use : current_thd; @@ -4771,7 +4771,7 @@ bool Field_timestamp::get_date(TIME *ltime, uint fuzzydate) return 0; } -bool Field_timestamp::get_time(TIME *ltime) +bool Field_timestamp::get_time(MYSQL_TIME *ltime) { return Field_timestamp::get_date(ltime,0); } @@ -4779,7 +4779,7 @@ bool Field_timestamp::get_time(TIME *ltime) bool Field_timestamp::send_binary(Protocol *protocol) { - TIME tm; + MYSQL_TIME tm; Field_timestamp::get_date(&tm, 0); return protocol->store(&tm); } @@ -4855,7 +4855,7 @@ void Field_timestamp::set_time() int Field_time::store(const char *from,uint len,CHARSET_INFO *cs) { - TIME ltime; + MYSQL_TIME ltime; long tmp; int error= 0; int warning; @@ -4870,9 +4870,12 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs) else { if (warning & MYSQL_TIME_WARN_TRUNCATED) - set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + { + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, from, len, MYSQL_TIMESTAMP_TIME, 1); + error= 1; + } if (warning & MYSQL_TIME_WARN_OUT_OF_RANGE) { set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, @@ -4883,8 +4886,6 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs) if (ltime.month) ltime.day=0; tmp=(ltime.day*24L+ltime.hour)*10000L+(ltime.minute*100+ltime.second); - if (error > 1) - error= 2; } if (ltime.neg) @@ -4894,7 +4895,7 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs) } -int Field_time::store_time(TIME *ltime, timestamp_type time_type) +int Field_time::store_time(MYSQL_TIME *ltime, timestamp_type time_type) { long tmp= ((ltime->month ? 0 : ltime->day * 24L) + ltime->hour) * 10000L + (ltime->minute * 100 + ltime->second); @@ -5003,7 +5004,7 @@ String *Field_time::val_str(String *val_buffer, String *val_ptr __attribute__((unused))) { ASSERT_COLUMN_MARKED_FOR_READ; - TIME ltime; + MYSQL_TIME ltime; val_buffer->alloc(19); long tmp=(long) sint3korr(ptr); ltime.neg= 0; @@ -5027,7 +5028,7 @@ String *Field_time::val_str(String *val_buffer, DATE_FORMAT(time, "%l.%i %p") */ -bool Field_time::get_date(TIME *ltime, uint fuzzydate) +bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate) { long tmp; THD *thd= table ? table->in_use : current_thd; @@ -5055,7 +5056,7 @@ bool Field_time::get_date(TIME *ltime, uint fuzzydate) } -bool Field_time::get_time(TIME *ltime) +bool Field_time::get_time(MYSQL_TIME *ltime) { long tmp=(long) sint3korr(ptr); ltime->neg=0; @@ -5077,7 +5078,7 @@ bool Field_time::get_time(TIME *ltime) bool Field_time::send_binary(Protocol *protocol) { - TIME tm; + MYSQL_TIME tm; Field_time::get_time(&tm); tm.day= tm.hour/24; // Move hours to days tm.hour-= tm.day*24; @@ -5226,7 +5227,7 @@ void Field_year::sql_type(String &res) const int Field_date::store(const char *from, uint len,CHARSET_INFO *cs) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME l_time; + MYSQL_TIME l_time; uint32 tmp; int error; THD *thd= table ? table->in_use : current_thd; @@ -5283,7 +5284,7 @@ int Field_date::store(double nr) int Field_date::store(longlong nr, bool unsigned_val) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME not_used; + MYSQL_TIME not_used; int error; longlong initial_nr= nr; THD *thd= table ? table->in_use : current_thd; @@ -5324,7 +5325,7 @@ int Field_date::store(longlong nr, bool unsigned_val) bool Field_date::send_binary(Protocol *protocol) { longlong tmp= Field_date::val_int(); - TIME tm; + MYSQL_TIME tm; tm.year= (uint32) tmp/10000L % 10000; tm.month= (uint32) tmp/100 % 100; tm.day= (uint32) tmp % 100; @@ -5364,7 +5365,7 @@ String *Field_date::val_str(String *val_buffer, String *val_ptr __attribute__((unused))) { ASSERT_COLUMN_MARKED_FOR_READ; - TIME ltime; + MYSQL_TIME ltime; val_buffer->alloc(field_length); int32 tmp; #ifdef WORDS_BIGENDIAN @@ -5433,10 +5434,27 @@ void Field_date::sql_type(String &res) const ** In number context: YYYYMMDD ****************************************************************************/ +/* + Store string into a date field + + SYNOPSIS + Field_newdate::store() + from Date string + len Length of date field + cs Character set (not used) + + RETURN + 0 ok + 1 Value was cut during conversion + 2 Wrong date string + 3 Datetime value that was cut (warning level NOTE) +*/ + int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME l_time; + long tmp; + MYSQL_TIME l_time; int error; THD *thd= table ? table->in_use : current_thd; enum enum_mysql_timestamp_type ret; @@ -5447,20 +5465,23 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs) MODE_INVALID_DATES))), &error)) <= MYSQL_TIMESTAMP_ERROR) { - int3store(ptr,0L); + tmp= 0; error= 2; } else { - int3store(ptr, l_time.day + l_time.month*32 + l_time.year*16*32); - if(!error && (ret != MYSQL_TIMESTAMP_DATE)) - return 2; + tmp= l_time.day + l_time.month*32 + l_time.year*16*32; + if (!error && (ret != MYSQL_TIMESTAMP_DATE)) + error= 3; // Datetime was cut (note) } if (error) - set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, + set_datetime_warning(error == 3 ? MYSQL_ERROR::WARN_LEVEL_NOTE : + MYSQL_ERROR::WARN_LEVEL_WARN, + WARN_DATA_TRUNCATED, from, len, MYSQL_TIMESTAMP_DATE, 1); + int3store(ptr, tmp); return error; } @@ -5481,7 +5502,7 @@ int Field_newdate::store(double nr) int Field_newdate::store(longlong nr, bool unsigned_val) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME l_time; + MYSQL_TIME l_time; longlong tmp; int error; THD *thd= table ? table->in_use : current_thd; @@ -5508,7 +5529,7 @@ int Field_newdate::store(longlong nr, bool unsigned_val) } -int Field_newdate::store_time(TIME *ltime,timestamp_type time_type) +int Field_newdate::store_time(MYSQL_TIME *ltime,timestamp_type time_type) { ASSERT_COLUMN_MARKED_FOR_WRITE; long tmp; @@ -5543,7 +5564,7 @@ int Field_newdate::store_time(TIME *ltime,timestamp_type time_type) bool Field_newdate::send_binary(Protocol *protocol) { - TIME tm; + MYSQL_TIME tm; Field_newdate::get_date(&tm,0); return protocol->store_date(&tm); } @@ -5594,7 +5615,7 @@ String *Field_newdate::val_str(String *val_buffer, } -bool Field_newdate::get_date(TIME *ltime,uint fuzzydate) +bool Field_newdate::get_date(MYSQL_TIME *ltime,uint fuzzydate) { uint32 tmp=(uint32) uint3korr(ptr); ltime->day= tmp & 31; @@ -5607,7 +5628,7 @@ bool Field_newdate::get_date(TIME *ltime,uint fuzzydate) } -bool Field_newdate::get_time(TIME *ltime) +bool Field_newdate::get_time(MYSQL_TIME *ltime) { return Field_newdate::get_date(ltime,0); } @@ -5646,7 +5667,7 @@ void Field_newdate::sql_type(String &res) const int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME time_tmp; + MYSQL_TIME time_tmp; int error; ulonglong tmp= 0; enum enum_mysql_timestamp_type func_res; @@ -5699,7 +5720,7 @@ int Field_datetime::store(double nr) int Field_datetime::store(longlong nr, bool unsigned_val) { ASSERT_COLUMN_MARKED_FOR_WRITE; - TIME not_used; + MYSQL_TIME not_used; int error; longlong initial_nr= nr; THD *thd= table ? table->in_use : current_thd; @@ -5734,7 +5755,7 @@ int Field_datetime::store(longlong nr, bool unsigned_val) } -int Field_datetime::store_time(TIME *ltime,timestamp_type time_type) +int Field_datetime::store_time(MYSQL_TIME *ltime,timestamp_type time_type) { ASSERT_COLUMN_MARKED_FOR_WRITE; longlong tmp; @@ -5780,7 +5801,7 @@ int Field_datetime::store_time(TIME *ltime,timestamp_type time_type) bool Field_datetime::send_binary(Protocol *protocol) { - TIME tm; + MYSQL_TIME tm; Field_datetime::get_date(&tm, TIME_FUZZY_DATE); return protocol->store(&tm); } @@ -5854,7 +5875,7 @@ String *Field_datetime::val_str(String *val_buffer, return val_buffer; } -bool Field_datetime::get_date(TIME *ltime, uint fuzzydate) +bool Field_datetime::get_date(MYSQL_TIME *ltime, uint fuzzydate) { longlong tmp=Field_datetime::val_int(); uint32 part1,part2; @@ -5873,7 +5894,7 @@ bool Field_datetime::get_date(TIME *ltime, uint fuzzydate) return (!(fuzzydate & TIME_FUZZY_DATE) && (!ltime->month || !ltime->day)) ? 1 : 0; } -bool Field_datetime::get_time(TIME *ltime) +bool Field_datetime::get_time(MYSQL_TIME *ltime) { return Field_datetime::get_date(ltime,0); } @@ -9414,10 +9435,13 @@ uint32 Field_blob::max_display_length() NOTE This function won't produce warning and increase cut fields counter - if count_cuted_fields == FIELD_CHECK_IGNORE for current thread. + if count_cuted_fields == CHECK_FIELD_IGNORE for current thread. + + if count_cuted_fields == CHECK_FIELD_IGNORE then we ignore notes. + This allows us to avoid notes in optimisation, like convert_constant_item(). RETURN VALUE - 1 if count_cuted_fields == FIELD_CHECK_IGNORE + 1 if count_cuted_fields == CHECK_FIELD_IGNORE and error level is not NOTE 0 otherwise */ @@ -9437,7 +9461,7 @@ Field::set_warning(MYSQL_ERROR::enum_warning_level level, uint code, thd->row_count); return 0; } - return 1; + return level >= MYSQL_ERROR::WARN_LEVEL_WARN; } @@ -9465,9 +9489,10 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code, timestamp_type ts_type, int cuted_increment) { THD *thd= table ? table->in_use : current_thd; - if (thd->really_abort_on_warning() || + if ((thd->really_abort_on_warning() && + level >= MYSQL_ERROR::WARN_LEVEL_WARN) || set_warning(level, code, cuted_increment)) - make_truncated_value_warning(thd, str, str_length, ts_type, + make_truncated_value_warning(thd, level, str, str_length, ts_type, field_name); } @@ -9500,7 +9525,7 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code, { char str_nr[22]; char *str_end= longlong10_to_str(nr, str_nr, -10); - make_truncated_value_warning(thd, str_nr, (uint) (str_end - str_nr), + make_truncated_value_warning(thd, level, str_nr, (uint) (str_end - str_nr), ts_type, field_name); } } @@ -9533,7 +9558,7 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code, /* DBL_DIG is enough to print '-[digits].E+###' */ char str_nr[DBL_DIG + 8]; uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr)); - make_truncated_value_warning(thd, str_nr, str_len, ts_type, + make_truncated_value_warning(thd, level, str_nr, str_len, ts_type, field_name); } } diff --git a/sql/field.h b/sql/field.h index b96be208e41..a302fd6ce18 100644 --- a/sql/field.h +++ b/sql/field.h @@ -98,7 +98,7 @@ public: virtual int store(double nr)=0; virtual int store(longlong nr, bool unsigned_val)=0; virtual int store_decimal(const my_decimal *d)=0; - virtual int store_time(TIME *ltime, timestamp_type t_type); + virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type); virtual double val_real(void)=0; virtual longlong val_int(void)=0; virtual my_decimal *val_decimal(my_decimal *); @@ -347,8 +347,8 @@ public: } void copy_from_tmp(int offset); uint fill_cache_field(struct st_cache_field *copy); - virtual bool get_date(TIME *ltime,uint fuzzydate); - virtual bool get_time(TIME *ltime); + virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + virtual bool get_time(MYSQL_TIME *ltime); virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; } virtual CHARSET_INFO *sort_charset(void) const { return charset(); } virtual bool has_charset(void) const { return FALSE; } @@ -564,7 +564,7 @@ public: int store(const char *to, uint length, CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); - int store_time(TIME *ltime, timestamp_type t_type); + int store_time(MYSQL_TIME *ltime, timestamp_type t_type); int store_decimal(const my_decimal *); double val_real(void); longlong val_int(void); @@ -907,8 +907,8 @@ public: longget(tmp,ptr); return tmp; } - bool get_date(TIME *ltime,uint fuzzydate); - bool get_time(TIME *ltime); + bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_time(MYSQL_TIME *ltime); timestamp_auto_set_type get_auto_set_type() const; }; @@ -981,7 +981,7 @@ public: int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); - int store_time(TIME *ltime, timestamp_type type); + int store_time(MYSQL_TIME *ltime, timestamp_type type); int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; } double val_real(void); longlong val_int(void); @@ -993,8 +993,8 @@ public: void sql_type(String &str) const; bool can_be_compared_as_longlong() const { return TRUE; } bool zero_pack() const { return 1; } - bool get_date(TIME *ltime,uint fuzzydate); - bool get_time(TIME *ltime); + bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_time(MYSQL_TIME *ltime); }; @@ -1013,7 +1013,7 @@ public: enum_field_types type() const { return MYSQL_TYPE_TIME;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; } enum Item_result cmp_type () const { return INT_RESULT; } - int store_time(TIME *ltime, timestamp_type type); + int store_time(MYSQL_TIME *ltime, timestamp_type type); int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); @@ -1021,9 +1021,9 @@ public: double val_real(void); longlong val_int(void); String *val_str(String*,String *); - bool get_date(TIME *ltime, uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, uint fuzzydate); bool send_binary(Protocol *protocol); - bool get_time(TIME *ltime); + bool get_time(MYSQL_TIME *ltime); int cmp(const char *,const char*); void sort_string(char *buff,uint length); uint32 pack_length() const { return 3; } @@ -1054,7 +1054,7 @@ public: int store(const char *to,uint length,CHARSET_INFO *charset); int store(double nr); int store(longlong nr, bool unsigned_val); - int store_time(TIME *ltime, timestamp_type type); + int store_time(MYSQL_TIME *ltime, timestamp_type type); int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; @@ -1070,8 +1070,8 @@ public: void sql_type(String &str) const; bool can_be_compared_as_longlong() const { return TRUE; } bool zero_pack() const { return 1; } - bool get_date(TIME *ltime,uint fuzzydate); - bool get_time(TIME *ltime); + bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_time(MYSQL_TIME *ltime); }; diff --git a/sql/item.cc b/sql/item.cc index c7935607130..3e3ef2a0bbe 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -267,7 +267,7 @@ my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value) my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_date(<ime, TIME_FUZZY_DATE)) { my_decimal_set_zero(decimal_value); @@ -280,7 +280,7 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value) my_decimal *Item::val_decimal_from_time(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_time(<ime)) { my_decimal_set_zero(decimal_value); @@ -315,7 +315,7 @@ longlong Item::val_int_from_decimal() int Item::save_time_in_field(Field *field) { - TIME ltime; + MYSQL_TIME ltime; if (get_time(<ime)) return set_field_to_null(field); field->set_notnull(); @@ -325,7 +325,7 @@ int Item::save_time_in_field(Field *field) int Item::save_date_in_field(Field *field) { - TIME ltime; + MYSQL_TIME ltime; if (get_date(<ime, TIME_FUZZY_DATE)) return set_field_to_null(field); field->set_notnull(); @@ -853,22 +853,40 @@ bool Item_string::eq(const Item *item, bool binary_cmp) const /* - Get the value of the function as a TIME structure. + Get the value of the function as a MYSQL_TIME structure. As a extra convenience the time structure is reset on error! */ -bool Item::get_date(TIME *ltime,uint fuzzydate) +bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate) { - char buff[40]; - String tmp(buff,sizeof(buff), &my_charset_bin),*res; - if (!(res=val_str(&tmp)) || - str_to_datetime_with_warn(res->ptr(), res->length(), - ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR) + if (result_type() == STRING_RESULT) { - bzero((char*) ltime,sizeof(*ltime)); - return 1; + char buff[40]; + String tmp(buff,sizeof(buff), &my_charset_bin),*res; + if (!(res=val_str(&tmp)) || + str_to_datetime_with_warn(res->ptr(), res->length(), + ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR) + goto err; + } + else + { + longlong value= val_int(); + int was_cut; + if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == LL(-1)) + { + char buff[22], *end; + end= longlong10_to_str(value, buff, -10); + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + buff, (int) (end-buff), MYSQL_TIMESTAMP_NONE, + NullS); + goto err; + } } return 0; + +err: + bzero((char*) ltime,sizeof(*ltime)); + return 1; } /* @@ -876,7 +894,7 @@ bool Item::get_date(TIME *ltime,uint fuzzydate) As a extra convenience the time structure is reset on error! */ -bool Item::get_time(TIME *ltime) +bool Item::get_time(MYSQL_TIME *ltime) { char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; @@ -1868,7 +1886,7 @@ String *Item_field::str_result(String *str) return result_field->val_str(str,&str_value); } -bool Item_field::get_date(TIME *ltime,uint fuzzydate) +bool Item_field::get_date(MYSQL_TIME *ltime,uint fuzzydate) { if ((null_value=field->is_null()) || field->get_date(ltime,fuzzydate)) { @@ -1878,7 +1896,7 @@ bool Item_field::get_date(TIME *ltime,uint fuzzydate) return 0; } -bool Item_field::get_date_result(TIME *ltime,uint fuzzydate) +bool Item_field::get_date_result(MYSQL_TIME *ltime,uint fuzzydate) { if ((null_value=result_field->is_null()) || result_field->get_date(ltime,fuzzydate)) @@ -1889,7 +1907,7 @@ bool Item_field::get_date_result(TIME *ltime,uint fuzzydate) return 0; } -bool Item_field::get_time(TIME *ltime) +bool Item_field::get_time(MYSQL_TIME *ltime) { if ((null_value=field->is_null()) || field->get_time(ltime)) { @@ -2416,7 +2434,7 @@ void Item_param::set_decimal(const char *str, ulong length) /* - Set parameter value from TIME value. + Set parameter value from MYSQL_TIME value. SYNOPSIS set_time() @@ -2430,7 +2448,7 @@ void Item_param::set_decimal(const char *str, ulong length) the fact that even wrong value sent over binary protocol fits into MAX_DATE_STRING_REP_LENGTH buffer. */ -void Item_param::set_time(TIME *tm, timestamp_type time_type, +void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type, uint32 max_length_arg) { DBUG_ENTER("Item_param::set_time"); @@ -2445,7 +2463,8 @@ void Item_param::set_time(TIME *tm, timestamp_type time_type, { char buff[MAX_DATE_STRING_REP_LENGTH]; uint length= my_TIME_to_str(&value.time, buff); - make_truncated_value_warning(current_thd, buff, length, time_type, 0); + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + buff, length, time_type, 0); set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR); } @@ -2647,7 +2666,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions) } -bool Item_param::get_time(TIME *res) +bool Item_param::get_time(MYSQL_TIME *res) { if (state == TIME_VALUE) { @@ -2662,7 +2681,7 @@ bool Item_param::get_time(TIME *res) } -bool Item_param::get_date(TIME *res, uint fuzzydate) +bool Item_param::get_date(MYSQL_TIME *res, uint fuzzydate) { if (state == TIME_VALUE) { @@ -3088,7 +3107,7 @@ String* Item_ref_null_helper::val_str(String* s) } -bool Item_ref_null_helper::get_date(TIME *ltime, uint fuzzydate) +bool Item_ref_null_helper::get_date(MYSQL_TIME *ltime, uint fuzzydate) { return (owner->was_null|= null_value= (*ref)->get_date(ltime, fuzzydate)); } @@ -4923,7 +4942,7 @@ bool Item::send(Protocol *protocol, String *buffer) case MYSQL_TYPE_DATE: case MYSQL_TYPE_TIMESTAMP: { - TIME tm; + MYSQL_TIME tm; get_date(&tm, TIME_FUZZY_DATE); if (!null_value) { @@ -4936,7 +4955,7 @@ bool Item::send(Protocol *protocol, String *buffer) } case MYSQL_TYPE_TIME: { - TIME tm; + MYSQL_TIME tm; get_time(&tm); if (!null_value) result= protocol->store_time(&tm); @@ -5488,7 +5507,7 @@ bool Item_ref::is_null() } -bool Item_ref::get_date(TIME *ltime,uint fuzzydate) +bool Item_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate) { return (null_value=(*ref)->get_date_result(ltime,fuzzydate)); } @@ -5587,7 +5606,7 @@ bool Item_direct_ref::is_null() } -bool Item_direct_ref::get_date(TIME *ltime,uint fuzzydate) +bool Item_direct_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate) { return (null_value=(*ref)->get_date(ltime,fuzzydate)); } diff --git a/sql/item.h b/sql/item.h index 87380b53bfb..ee178a1e379 100644 --- a/sql/item.h +++ b/sql/item.h @@ -730,9 +730,9 @@ public: /* Called for items that really have to be split */ void split_sum_func2(THD *thd, Item **ref_pointer_array, List &fields, Item **ref, bool skip_registered); - virtual bool get_date(TIME *ltime,uint fuzzydate); - virtual bool get_time(TIME *ltime); - virtual bool get_date_result(TIME *ltime,uint fuzzydate) + virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + virtual bool get_time(MYSQL_TIME *ltime); + virtual bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate) { return get_date(ltime,fuzzydate); } /* This function is used only in Item_func_isnull/Item_func_isnotnull @@ -1373,9 +1373,9 @@ public: } Field *get_tmp_table_field() { return result_field; } Field *tmp_table_field(TABLE *t_arg) { return result_field; } - bool get_date(TIME *ltime,uint fuzzydate); - bool get_date_result(TIME *ltime,uint fuzzydate); - bool get_time(TIME *ltime); + bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate); + bool get_time(MYSQL_TIME *ltime); bool is_null() { return field->is_null(); } void update_null_value(); Item *get_tmp_table_item(THD *thd); @@ -1499,7 +1499,7 @@ public: */ CHARSET_INFO *final_character_set_of_str_value; } cs_info; - TIME time; + MYSQL_TIME time; } value; /* Cached values for virtual methods to save us one switch. */ @@ -1531,8 +1531,8 @@ public: longlong val_int(); my_decimal *val_decimal(my_decimal*); String *val_str(String*); - bool get_time(TIME *tm); - bool get_date(TIME *tm, uint fuzzydate); + bool get_time(MYSQL_TIME *tm); + bool get_date(MYSQL_TIME *tm, uint fuzzydate); int save_in_field(Field *field, bool no_conversions); void set_null(); @@ -1541,7 +1541,7 @@ public: void set_decimal(const char *str, ulong length); bool set_str(const char *str, ulong length); bool set_longdata(const char *str, ulong length); - void set_time(TIME *tm, timestamp_type type, uint32 max_length_arg); + void set_time(MYSQL_TIME *tm, timestamp_type type, uint32 max_length_arg); bool set_from_user_var(THD *thd, const user_var_entry *entry); void reset(); /* @@ -1980,7 +1980,7 @@ public: bool val_bool(); String *val_str(String* tmp); bool is_null(); - bool get_date(TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime,uint fuzzydate); double val_result(); longlong val_int_result(); String *str_result(String* tmp); @@ -2057,7 +2057,7 @@ public: my_decimal *val_decimal(my_decimal *); bool val_bool(); bool is_null(); - bool get_date(TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime,uint fuzzydate); virtual Ref_Type ref_type() { return DIRECT_REF; } }; @@ -2143,7 +2143,7 @@ public: String* val_str(String* s); my_decimal *val_decimal(my_decimal *); bool val_bool(); - bool get_date(TIME *ltime, uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, uint fuzzydate); void print(String *str); /* we add RAND_TABLE_BIT to prevent moving this item from HAVING to WHERE diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ffa6b4caf2a..747d37c18d2 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -293,6 +293,7 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item) { TABLE *table= field->table; ulong orig_sql_mode= thd->variables.sql_mode; + enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields; my_bitmap_map *old_write_map; my_bitmap_map *old_read_map; @@ -306,6 +307,7 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item) } /* For comparison purposes allow invalid dates like 2000-01-32 */ thd->variables.sql_mode|= MODE_INVALID_DATES; + thd->count_cuted_fields= CHECK_FIELD_IGNORE; if (!(*item)->save_in_field(field, 1) && !((*item)->null_value)) { Item *tmp= new Item_int_with_ref(field->val_int(), *item, @@ -315,6 +317,7 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item) result= 1; // Item was replaced } thd->variables.sql_mode= orig_sql_mode; + thd->count_cuted_fields= orig_count_cuted_fields; if (table) { dbug_tmp_restore_column_map(table->write_set, old_write_map); diff --git a/sql/item_func.h b/sql/item_func.h index 3306b059097..6464b5757c8 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -147,11 +147,11 @@ public: void count_only_length(); void count_real_length(); void count_decimal_length(); - inline bool get_arg0_date(TIME *ltime, uint fuzzy_date) + inline bool get_arg0_date(MYSQL_TIME *ltime, uint fuzzy_date) { return (null_value=args[0]->get_date(ltime, fuzzy_date)); } - inline bool get_arg0_time(TIME *ltime) + inline bool get_arg0_time(MYSQL_TIME *ltime) { return (null_value=args[0]->get_time(ltime)); } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 7636deab782..4d6ca2a9b3e 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -46,7 +46,7 @@ the microseconds twice. */ -static bool make_datetime(date_time_format_types format, TIME *ltime, +static bool make_datetime(date_time_format_types format, MYSQL_TIME *ltime, String *str) { char *buff; @@ -95,7 +95,7 @@ static bool make_datetime(date_time_format_types format, TIME *ltime, /* - Wrapper over make_datetime() with validation of the input TIME value + Wrapper over make_datetime() with validation of the input MYSQL_TIME value NOTE see make_datetime() for more information @@ -105,7 +105,7 @@ static bool make_datetime(date_time_format_types format, TIME *ltime, 0 otherwise */ -static bool make_datetime_with_warn(date_time_format_types format, TIME *ltime, +static bool make_datetime_with_warn(date_time_format_types format, MYSQL_TIME *ltime, String *str) { int warning= 0; @@ -117,14 +117,15 @@ static bool make_datetime_with_warn(date_time_format_types format, TIME *ltime, if (!warning) return 0; - make_truncated_value_warning(current_thd, str->ptr(), str->length(), + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + str->ptr(), str->length(), MYSQL_TIMESTAMP_TIME, NullS); return make_datetime(format, ltime, str); } /* - Wrapper over make_time() with validation of the input TIME value + Wrapper over make_time() with validation of the input MYSQL_TIME value NOTE see make_time() for more info @@ -135,7 +136,7 @@ static bool make_datetime_with_warn(date_time_format_types format, TIME *ltime, */ static bool make_time_with_warn(const DATE_TIME_FORMAT *format, - TIME *l_time, String *str) + MYSQL_TIME *l_time, String *str) { int warning= 0; make_time(format, l_time, str); @@ -143,7 +144,8 @@ static bool make_time_with_warn(const DATE_TIME_FORMAT *format, return 1; if (warning) { - make_truncated_value_warning(current_thd, str->ptr(), str->length(), + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + str->ptr(), str->length(), MYSQL_TIMESTAMP_TIME, NullS); make_time(format, l_time, str); } @@ -153,16 +155,16 @@ static bool make_time_with_warn(const DATE_TIME_FORMAT *format, /* - Convert seconds to TIME value with overflow checking + Convert seconds to MYSQL_TIME value with overflow checking SYNOPSIS: sec_to_time() seconds number of seconds unsigned_flag 1, if 'seconds' is unsigned, 0, otherwise - ltime output TIME value + ltime output MYSQL_TIME value DESCRIPTION - If the 'seconds' argument is inside TIME data range, convert it to a + If the 'seconds' argument is inside MYSQL_TIME data range, convert it to a corresponding value. Otherwise, truncate the resulting value to the nearest endpoint, and produce a warning message. @@ -172,7 +174,7 @@ static bool make_time_with_warn(const DATE_TIME_FORMAT *format, 0 otherwise */ -static bool sec_to_time(longlong seconds, bool unsigned_flag, TIME *ltime) +static bool sec_to_time(longlong seconds, bool unsigned_flag, MYSQL_TIME *ltime) { uint sec; @@ -205,7 +207,8 @@ overflow: char buf[22]; int len= (int)(longlong10_to_str(seconds, buf, unsigned_flag ? 10 : -10) - buf); - make_truncated_value_warning(current_thd, buf, len, MYSQL_TIMESTAMP_TIME, + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + buf, len, MYSQL_TIMESTAMP_TIME, NullS); return 1; @@ -224,7 +227,7 @@ static DATE_TIME_FORMAT time_24hrs_format= {{0}, '\0', 0, {(char *)"%H:%i:%S", 8}}; /* - Extract datetime value to TIME struct from string value + Extract datetime value to MYSQL_TIME struct from string value according to format string. SYNOPSIS @@ -257,7 +260,7 @@ static DATE_TIME_FORMAT time_24hrs_format= {{0}, '\0', 0, */ static bool extract_date_time(DATE_TIME_FORMAT *format, - const char *val, uint length, TIME *l_time, + const char *val, uint length, MYSQL_TIME *l_time, timestamp_type cached_timestamp_type, const char **sub_pattern_end, const char *date_time_type) @@ -305,13 +308,15 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, case 'Y': tmp= (char*) val + min(4, val_len); l_time->year= (int) my_strtoll10(val, &tmp, &error); + if ((int) (tmp-val) <= 2) + l_time->year= year_2000_handling(l_time->year); val= tmp; break; case 'y': tmp= (char*) val + min(2, val_len); l_time->year= (int) my_strtoll10(val, &tmp, &error); val= tmp; - l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900); + l_time->year= year_2000_handling(l_time->year); break; /* Month */ @@ -514,7 +519,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, if (yearday > 0) { - uint days= calc_daynr(l_time->year,1,1) + yearday - 1; + uint days; + days= calc_daynr(l_time->year,1,1) + yearday - 1; if (days <= 0 || days > MAX_DAY_NUMBER) goto err; get_date_from_daynr(days,&l_time->year,&l_time->month,&l_time->day); @@ -576,7 +582,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, { if (!my_isspace(&my_charset_latin1,*val)) { - make_truncated_value_warning(current_thd, val_begin, length, + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + val_begin, length, cached_timestamp_type, NullS); break; } @@ -600,7 +607,7 @@ err: Create a formated date/time value in a string */ -bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, +bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time, timestamp_type type, String *str) { char intbuff[15]; @@ -921,7 +928,7 @@ longlong Item_func_period_diff::val_int() longlong Item_func_to_days::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_arg0_date(<ime, TIME_NO_ZERO_DATE)) return 0; return (longlong) calc_daynr(ltime.year,ltime.month,ltime.day); @@ -958,7 +965,7 @@ enum_monotonicity_info Item_func_to_days::get_monotonicity_info() const longlong Item_func_dayofyear::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_arg0_date(<ime,TIME_NO_ZERO_DATE)) return 0; return (longlong) calc_daynr(ltime.year,ltime.month,ltime.day) - @@ -968,7 +975,7 @@ longlong Item_func_dayofyear::val_int() longlong Item_func_dayofmonth::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; (void) get_arg0_date(<ime, TIME_FUZZY_DATE); return (longlong) ltime.day; } @@ -976,7 +983,7 @@ longlong Item_func_dayofmonth::val_int() longlong Item_func_month::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; (void) get_arg0_date(<ime, TIME_FUZZY_DATE); return (longlong) ltime.month; } @@ -1006,7 +1013,7 @@ String* Item_func_monthname::val_str(String* str) longlong Item_func_quarter::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_arg0_date(<ime, TIME_FUZZY_DATE)) return 0; return (longlong) ((ltime.month+2)/3); @@ -1015,7 +1022,7 @@ longlong Item_func_quarter::val_int() longlong Item_func_hour::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; (void) get_arg0_time(<ime); return ltime.hour; } @@ -1023,7 +1030,7 @@ longlong Item_func_hour::val_int() longlong Item_func_minute::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; (void) get_arg0_time(<ime); return ltime.minute; } @@ -1032,7 +1039,7 @@ longlong Item_func_minute::val_int() longlong Item_func_second::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; (void) get_arg0_time(<ime); return ltime.second; } @@ -1079,7 +1086,7 @@ longlong Item_func_week::val_int() { DBUG_ASSERT(fixed == 1); uint year; - TIME ltime; + MYSQL_TIME ltime; if (get_arg0_date(<ime, TIME_NO_ZERO_DATE)) return 0; return (longlong) calc_week(<ime, @@ -1092,7 +1099,7 @@ longlong Item_func_yearweek::val_int() { DBUG_ASSERT(fixed == 1); uint year,week; - TIME ltime; + MYSQL_TIME ltime; if (get_arg0_date(<ime, TIME_NO_ZERO_DATE)) return 0; week= calc_week(<ime, @@ -1105,7 +1112,7 @@ longlong Item_func_yearweek::val_int() longlong Item_func_weekday::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_arg0_date(<ime, TIME_NO_ZERO_DATE)) return 0; @@ -1135,7 +1142,7 @@ String* Item_func_dayname::val_str(String* str) longlong Item_func_year::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; (void) get_arg0_date(<ime, TIME_FUZZY_DATE); return (longlong) ltime.year; } @@ -1166,7 +1173,7 @@ enum_monotonicity_info Item_func_year::get_monotonicity_info() const longlong Item_func_unix_timestamp::val_int() { - TIME ltime; + MYSQL_TIME ltime; my_bool not_used; DBUG_ASSERT(fixed == 1); @@ -1197,7 +1204,7 @@ longlong Item_func_unix_timestamp::val_int() longlong Item_func_time_to_sec::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; longlong seconds; (void) get_arg0_time(<ime); seconds=ltime.hour*3600L+ltime.minute*60+ltime.second; @@ -1369,7 +1376,7 @@ bool get_interval_value(Item *args,interval_type int_type, String *Item_date::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_date(<ime, TIME_FUZZY_DATE)) return (String *) 0; if (str->alloc(11)) @@ -1385,19 +1392,19 @@ String *Item_date::val_str(String *str) longlong Item_date::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_date(<ime, TIME_FUZZY_DATE)) return 0; return (longlong) (ltime.year*10000L+ltime.month*100+ltime.day); } -bool Item_func_from_days::get_date(TIME *ltime, uint fuzzy_date) +bool Item_func_from_days::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { longlong value=args[0]->val_int(); if ((null_value=args[0]->null_value)) return 1; - bzero(ltime, sizeof(TIME)); + bzero(ltime, sizeof(MYSQL_TIME)); get_date_from_daynr((long) value, <ime->year, <ime->month, <ime->day); ltime->time_type= MYSQL_TIMESTAMP_DATE; return 0; @@ -1431,10 +1438,10 @@ String *Item_func_curdate::val_str(String *str) } /* - Converts current time in my_time_t to TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole CURDATE function. */ -void Item_func_curdate_local::store_now_in_TIME(TIME *now_time) +void Item_func_curdate_local::store_now_in_TIME(MYSQL_TIME *now_time) { THD *thd= current_thd; thd->variables.time_zone->gmt_sec_to_TIME(now_time, @@ -1444,10 +1451,10 @@ void Item_func_curdate_local::store_now_in_TIME(TIME *now_time) /* - Converts current time in my_time_t to TIME represenatation for UTC + Converts current time in my_time_t to MYSQL_TIME represenatation for UTC time zone. Defines time zone (UTC) used for whole UTC_DATE function. */ -void Item_func_curdate_utc::store_now_in_TIME(TIME *now_time) +void Item_func_curdate_utc::store_now_in_TIME(MYSQL_TIME *now_time) { my_tz_UTC->gmt_sec_to_TIME(now_time, (my_time_t)(current_thd->query_start())); @@ -1458,7 +1465,7 @@ void Item_func_curdate_utc::store_now_in_TIME(TIME *now_time) } -bool Item_func_curdate::get_date(TIME *res, +bool Item_func_curdate::get_date(MYSQL_TIME *res, uint fuzzy_date __attribute__((unused))) { *res=ltime; @@ -1476,7 +1483,7 @@ String *Item_func_curtime::val_str(String *str) void Item_func_curtime::fix_length_and_dec() { - TIME ltime; + MYSQL_TIME ltime; decimals= DATETIME_DEC; collation.set(&my_charset_bin); @@ -1488,10 +1495,10 @@ void Item_func_curtime::fix_length_and_dec() /* - Converts current time in my_time_t to TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole CURTIME function. */ -void Item_func_curtime_local::store_now_in_TIME(TIME *now_time) +void Item_func_curtime_local::store_now_in_TIME(MYSQL_TIME *now_time) { THD *thd= current_thd; thd->variables.time_zone->gmt_sec_to_TIME(now_time, @@ -1501,10 +1508,10 @@ void Item_func_curtime_local::store_now_in_TIME(TIME *now_time) /* - Converts current time in my_time_t to TIME represenatation for UTC + Converts current time in my_time_t to MYSQL_TIME represenatation for UTC time zone. Defines time zone (UTC) used for whole UTC_TIME function. */ -void Item_func_curtime_utc::store_now_in_TIME(TIME *now_time) +void Item_func_curtime_utc::store_now_in_TIME(MYSQL_TIME *now_time) { my_tz_UTC->gmt_sec_to_TIME(now_time, (my_time_t)(current_thd->query_start())); @@ -1537,10 +1544,10 @@ void Item_func_now::fix_length_and_dec() /* - Converts current time in my_time_t to TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole NOW function. */ -void Item_func_now_local::store_now_in_TIME(TIME *now_time) +void Item_func_now_local::store_now_in_TIME(MYSQL_TIME *now_time) { THD *thd= current_thd; thd->variables.time_zone->gmt_sec_to_TIME(now_time, @@ -1550,10 +1557,10 @@ void Item_func_now_local::store_now_in_TIME(TIME *now_time) /* - Converts current time in my_time_t to TIME represenatation for UTC + Converts current time in my_time_t to MYSQL_TIME represenatation for UTC time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function. */ -void Item_func_now_utc::store_now_in_TIME(TIME *now_time) +void Item_func_now_utc::store_now_in_TIME(MYSQL_TIME *now_time) { my_tz_UTC->gmt_sec_to_TIME(now_time, (my_time_t)(current_thd->query_start())); @@ -1564,7 +1571,7 @@ void Item_func_now_utc::store_now_in_TIME(TIME *now_time) } -bool Item_func_now::get_date(TIME *res, +bool Item_func_now::get_date(MYSQL_TIME *res, uint fuzzy_date __attribute__((unused))) { *res= ltime; @@ -1581,10 +1588,10 @@ int Item_func_now::save_in_field(Field *to, bool no_conversions) /* - Converts current time in my_time_t to TIME represenatation for local + Converts current time in my_time_t to MYSQL_TIME represenatation for local time zone. Defines time zone (local) used for whole SYSDATE function. */ -void Item_func_sysdate_local::store_now_in_TIME(TIME *now_time) +void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time) { THD *thd= current_thd; thd->variables.time_zone->gmt_sec_to_TIME(now_time, (my_time_t) time(NULL)); @@ -1626,7 +1633,7 @@ void Item_func_sysdate_local::fix_length_and_dec() } -bool Item_func_sysdate_local::get_date(TIME *res, +bool Item_func_sysdate_local::get_date(MYSQL_TIME *res, uint fuzzy_date __attribute__((unused))) { store_now_in_TIME(<ime); @@ -1647,7 +1654,7 @@ int Item_func_sysdate_local::save_in_field(Field *to, bool no_conversions) String *Item_func_sec_to_time::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; longlong arg_val= args[0]->val_int(); if ((null_value=args[0]->null_value) || str->alloc(19)) @@ -1666,7 +1673,7 @@ String *Item_func_sec_to_time::val_str(String *str) longlong Item_func_sec_to_time::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; longlong arg_val= args[0]->val_int(); if ((null_value=args[0]->null_value)) @@ -1808,7 +1815,7 @@ uint Item_func_date_format::format_length(const String *format) String *Item_func_date_format::val_str(String *str) { String *format; - TIME l_time; + MYSQL_TIME l_time; uint size; DBUG_ASSERT(fixed == 1); @@ -1871,7 +1878,7 @@ void Item_func_from_unixtime::fix_length_and_dec() String *Item_func_from_unixtime::val_str(String *str) { - TIME time_tmp; + MYSQL_TIME time_tmp; DBUG_ASSERT(fixed == 1); @@ -1891,7 +1898,7 @@ String *Item_func_from_unixtime::val_str(String *str) longlong Item_func_from_unixtime::val_int() { - TIME time_tmp; + MYSQL_TIME time_tmp; DBUG_ASSERT(fixed == 1); @@ -1901,7 +1908,7 @@ longlong Item_func_from_unixtime::val_int() return (longlong) TIME_to_ulonglong_datetime(&time_tmp); } -bool Item_func_from_unixtime::get_date(TIME *ltime, +bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime, uint fuzzy_date __attribute__((unused))) { ulonglong tmp= (ulonglong)(args[0]->val_int()); @@ -1929,7 +1936,7 @@ void Item_func_convert_tz::fix_length_and_dec() String *Item_func_convert_tz::val_str(String *str) { - TIME time_tmp; + MYSQL_TIME time_tmp; if (get_date(&time_tmp, 0)) return 0; @@ -1947,7 +1954,7 @@ String *Item_func_convert_tz::val_str(String *str) longlong Item_func_convert_tz::val_int() { - TIME time_tmp; + MYSQL_TIME time_tmp; if (get_date(&time_tmp, 0)) return 0; @@ -1956,7 +1963,7 @@ longlong Item_func_convert_tz::val_int() } -bool Item_func_convert_tz::get_date(TIME *ltime, +bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime, uint fuzzy_date __attribute__((unused))) { my_time_t my_time_tmp; @@ -2018,7 +2025,7 @@ void Item_date_add_interval::fix_length_and_dec() - If first arg is a MYSQL_TYPE_DATE and the interval type uses hours, minutes or seconds then type is MYSQL_TYPE_DATETIME. - Otherwise the result is MYSQL_TYPE_STRING - (This is because you can't know if the string contains a DATE, TIME or + (This is because you can't know if the string contains a DATE, MYSQL_TIME or DATETIME argument) */ cached_field_type= MYSQL_TYPE_STRING; @@ -2038,7 +2045,7 @@ void Item_date_add_interval::fix_length_and_dec() /* Here arg[1] is a Item_interval object */ -bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date) +bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { INTERVAL interval; @@ -2048,8 +2055,6 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date) if (date_sub_interval) interval.neg = !interval.neg; - if (ltime->year < YY_MAGIC_BELOW) - return (null_value=1); return (null_value= date_add_interval(ltime, int_type, interval)); } @@ -2058,7 +2063,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date) String *Item_date_add_interval::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; enum date_time_format_types format; if (Item_date_add_interval::get_date(<ime, TIME_NO_ZERO_DATE)) @@ -2082,7 +2087,7 @@ String *Item_date_add_interval::val_str(String *str) longlong Item_date_add_interval::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; longlong date; if (Item_date_add_interval::get_date(<ime, TIME_NO_ZERO_DATE)) return (longlong) 0; @@ -2172,7 +2177,7 @@ void Item_extract::fix_length_and_dec() longlong Item_extract::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; uint year; ulong week_format; long neg; @@ -2425,7 +2430,7 @@ void Item_char_typecast::fix_length_and_dec() String *Item_datetime_typecast::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (!get_arg0_date(<ime, TIME_FUZZY_DATE) && !make_datetime(ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME, <ime, str)) @@ -2439,7 +2444,7 @@ String *Item_datetime_typecast::val_str(String *str) longlong Item_datetime_typecast::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (get_arg0_date(<ime,1)) { null_value= 1; @@ -2450,7 +2455,7 @@ longlong Item_datetime_typecast::val_int() } -bool Item_time_typecast::get_time(TIME *ltime) +bool Item_time_typecast::get_time(MYSQL_TIME *ltime) { bool res= get_arg0_time(ltime); /* @@ -2466,7 +2471,7 @@ bool Item_time_typecast::get_time(TIME *ltime) longlong Item_time_typecast::val_int() { - TIME ltime; + MYSQL_TIME ltime; if (get_time(<ime)) { null_value= 1; @@ -2478,7 +2483,7 @@ longlong Item_time_typecast::val_int() String *Item_time_typecast::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (!get_arg0_time(<ime) && !make_datetime(ltime.second_part ? TIME_MICROSECOND : TIME_ONLY, @@ -2490,7 +2495,7 @@ String *Item_time_typecast::val_str(String *str) } -bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date) +bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { bool res= get_arg0_date(ltime, TIME_FUZZY_DATE); ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0; @@ -2502,7 +2507,7 @@ bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date) String *Item_date_typecast::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (!get_arg0_date(<ime, TIME_FUZZY_DATE) && !str->alloc(11)) { @@ -2517,7 +2522,7 @@ String *Item_date_typecast::val_str(String *str) longlong Item_date_typecast::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (args[0]->get_date(<ime, TIME_FUZZY_DATE)) { null_value= 1; @@ -2529,21 +2534,29 @@ longlong Item_date_typecast::val_int() /* MAKEDATE(a,b) is a date function that creates a date value from a year and day value. + + NOTES: + As arguments are integers, we can't know if the year is a 2 digit or 4 digit year. + In this case we treat all years < 100 as 2 digit years. Ie, this is not safe + for dates between 0000-01-01 and 0099-12-31 */ String *Item_func_makedate::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME l_time; + MYSQL_TIME l_time; long daynr= (long) args[1]->val_int(); - long yearnr= (long) args[0]->val_int(); + long year= (long) args[0]->val_int(); long days; if (args[0]->null_value || args[1]->null_value || - yearnr < 0 || daynr <= 0) + year < 0 || daynr <= 0) goto err; - days= calc_daynr(yearnr,1,1) + daynr - 1; + if (year < 100) + year= year_2000_handling(year); + + days= calc_daynr(year,1,1) + daynr - 1; /* Day number from year 0 to 9999-12-31 */ if (days >= 0 && days <= MAX_DAY_NUMBER) { @@ -2561,19 +2574,32 @@ err: } +/* + MAKEDATE(a,b) is a date function that creates a date value + from a year and day value. + + NOTES: + As arguments are integers, we can't know if the year is a 2 digit or 4 digit year. + In this case we treat all years < 100 as 2 digit years. Ie, this is not safe + for dates between 0000-01-01 and 0099-12-31 +*/ + longlong Item_func_makedate::val_int() { DBUG_ASSERT(fixed == 1); - TIME l_time; + MYSQL_TIME l_time; long daynr= (long) args[1]->val_int(); - long yearnr= (long) args[0]->val_int(); + long year= (long) args[0]->val_int(); long days; if (args[0]->null_value || args[1]->null_value || - yearnr < 0 || daynr <= 0) + year < 0 || daynr <= 0) goto err; - days= calc_daynr(yearnr,1,1) + daynr - 1; + if (year < 100) + year= year_2000_handling(year); + + days= calc_daynr(year,1,1) + daynr - 1; /* Day number from year 0 to 9999-12-31 */ if (days >= 0 && days < MAX_DAY_NUMBER) { @@ -2628,7 +2654,7 @@ void Item_func_add_time::fix_length_and_dec() String *Item_func_add_time::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME l_time1, l_time2, l_time3; + MYSQL_TIME l_time1, l_time2, l_time3; bool is_time= 0; long days, microseconds; longlong seconds; @@ -2730,7 +2756,7 @@ String *Item_func_timediff::val_str(String *str) longlong seconds; long microseconds; int l_sign= 1; - TIME l_time1 ,l_time2, l_time3; + MYSQL_TIME l_time1 ,l_time2, l_time3; null_value= 0; if (args[0]->get_time(&l_time1) || @@ -2775,7 +2801,7 @@ null_date: String *Item_func_maketime::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; bool overflow= 0; longlong hour= args[0]->val_int(); @@ -2819,7 +2845,8 @@ String *Item_func_maketime::val_str(String *str) char *ptr= longlong10_to_str(hour, buf, args[0]->unsigned_flag ? 10 : -10); int len = (int)(ptr - buf) + my_sprintf(ptr, (ptr, ":%02u:%02u", (uint)minute, (uint)second)); - make_truncated_value_warning(current_thd, buf, len, MYSQL_TIMESTAMP_TIME, + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + buf, len, MYSQL_TIMESTAMP_TIME, NullS); } @@ -2843,7 +2870,7 @@ String *Item_func_maketime::val_str(String *str) longlong Item_func_microsecond::val_int() { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (!get_arg0_time(<ime)) return ltime.second_part; return 0; @@ -2852,7 +2879,7 @@ longlong Item_func_microsecond::val_int() longlong Item_func_timestamp_diff::val_int() { - TIME ltime1, ltime2; + MYSQL_TIME ltime1, ltime2; longlong seconds; long microseconds; long months= 0; @@ -3158,7 +3185,7 @@ void Item_func_str_to_date::fix_length_and_dec() } } -bool Item_func_str_to_date::get_date(TIME *ltime, uint fuzzy_date) +bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { DATE_TIME_FORMAT date_time_format; char val_buff[64], format_buff[64]; @@ -3199,7 +3226,7 @@ null_date: String *Item_func_str_to_date::val_str(String *str) { DBUG_ASSERT(fixed == 1); - TIME ltime; + MYSQL_TIME ltime; if (Item_func_str_to_date::get_date(<ime, TIME_FUZZY_DATE)) return 0; @@ -3212,7 +3239,7 @@ String *Item_func_str_to_date::val_str(String *str) } -bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date) +bool Item_func_last_day::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) || (ltime->month == 0)) diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index ea93619e59a..992b79753ca 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -449,9 +449,9 @@ public: /* Abstract method that defines which time zone is used for conversion. Converts time current time in my_time_t representation to broken-down - TIME representation using UTC-SYSTEM or per-thread time zone. + MYSQL_TIME representation using UTC-SYSTEM or per-thread time zone. */ - virtual void store_now_in_TIME(TIME *now_time)=0; + virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; bool result_as_longlong() { return TRUE; } }; @@ -462,7 +462,7 @@ public: Item_func_curtime_local() :Item_func_curtime() {} Item_func_curtime_local(Item *a) :Item_func_curtime(a) {} const char *func_name() const { return "curtime"; } - virtual void store_now_in_TIME(TIME *now_time); + virtual void store_now_in_TIME(MYSQL_TIME *now_time); }; @@ -472,7 +472,7 @@ public: Item_func_curtime_utc() :Item_func_curtime() {} Item_func_curtime_utc(Item *a) :Item_func_curtime(a) {} const char *func_name() const { return "utc_time"; } - virtual void store_now_in_TIME(TIME *now_time); + virtual void store_now_in_TIME(MYSQL_TIME *now_time); }; @@ -481,14 +481,14 @@ public: class Item_func_curdate :public Item_date { longlong value; - TIME ltime; + MYSQL_TIME ltime; public: Item_func_curdate() :Item_date() {} longlong val_int() { DBUG_ASSERT(fixed == 1); return (value) ; } String *val_str(String *str); void fix_length_and_dec(); - bool get_date(TIME *res, uint fuzzy_date); - virtual void store_now_in_TIME(TIME *now_time)=0; + bool get_date(MYSQL_TIME *res, uint fuzzy_date); + virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; }; @@ -497,7 +497,7 @@ class Item_func_curdate_local :public Item_func_curdate public: Item_func_curdate_local() :Item_func_curdate() {} const char *func_name() const { return "curdate"; } - void store_now_in_TIME(TIME *now_time); + void store_now_in_TIME(MYSQL_TIME *now_time); }; @@ -506,7 +506,7 @@ class Item_func_curdate_utc :public Item_func_curdate public: Item_func_curdate_utc() :Item_func_curdate() {} const char *func_name() const { return "utc_date"; } - void store_now_in_TIME(TIME *now_time); + void store_now_in_TIME(MYSQL_TIME *now_time); }; @@ -518,7 +518,7 @@ protected: longlong value; char buff[20*2+32]; // +32 to make my_snprintf_{8bit|ucs2} happy uint buff_length; - TIME ltime; + MYSQL_TIME ltime; public: Item_func_now() :Item_date_func() {} Item_func_now(Item *a) :Item_date_func(a) {} @@ -527,8 +527,8 @@ public: int save_in_field(Field *to, bool no_conversions); String *val_str(String *str); void fix_length_and_dec(); - bool get_date(TIME *res, uint fuzzy_date); - virtual void store_now_in_TIME(TIME *now_time)=0; + bool get_date(MYSQL_TIME *res, uint fuzzy_date); + virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; }; @@ -538,7 +538,7 @@ public: Item_func_now_local() :Item_func_now() {} Item_func_now_local(Item *a) :Item_func_now(a) {} const char *func_name() const { return "now"; } - virtual void store_now_in_TIME(TIME *now_time); + virtual void store_now_in_TIME(MYSQL_TIME *now_time); virtual enum Functype functype() const { return NOW_FUNC; } }; @@ -549,7 +549,7 @@ public: Item_func_now_utc() :Item_func_now() {} Item_func_now_utc(Item *a) :Item_func_now(a) {} const char *func_name() const { return "utc_timestamp"; } - virtual void store_now_in_TIME(TIME *now_time); + virtual void store_now_in_TIME(MYSQL_TIME *now_time); }; @@ -564,13 +564,13 @@ public: Item_func_sysdate_local(Item *a) :Item_func_now(a) {} bool const_item() const { return 0; } const char *func_name() const { return "sysdate"; } - void store_now_in_TIME(TIME *now_time); + void store_now_in_TIME(MYSQL_TIME *now_time); double val_real(); longlong val_int(); int save_in_field(Field *to, bool no_conversions); String *val_str(String *str); void fix_length_and_dec(); - bool get_date(TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, uint fuzzy_date); void update_used_tables() { Item_func_now::update_used_tables(); @@ -584,7 +584,7 @@ class Item_func_from_days :public Item_date public: Item_func_from_days(Item *a) :Item_date(a) {} const char *func_name() const { return "from_days"; } - bool get_date(TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, uint fuzzy_date); bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -616,7 +616,7 @@ class Item_func_from_unixtime :public Item_date_func String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } void fix_length_and_dec(); - bool get_date(TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, uint fuzzy_date); bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -652,7 +652,7 @@ class Item_func_convert_tz :public Item_date_func String *val_str(String *str); const char *func_name() const { return "convert_tz"; } void fix_length_and_dec(); - bool get_date(TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, uint fuzzy_date); void cleanup(); }; @@ -695,7 +695,7 @@ public: void fix_length_and_dec(); enum_field_types field_type() const { return cached_field_type; } longlong val_int(); - bool get_date(TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, uint fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; void print(String *str); bool check_partition_func_processor(byte *int_arg) {return FALSE;} @@ -783,7 +783,7 @@ public: Item_date_typecast(Item *a) :Item_typecast_maybe_null(a) {} const char *func_name() const { return "cast_as_date"; } String *val_str(String *str); - bool get_date(TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); const char *cast_type() const { return "date"; } enum_field_types field_type() const { return MYSQL_TYPE_DATE; } Field *tmp_table_field(TABLE *table) @@ -817,7 +817,7 @@ public: Item_time_typecast(Item *a) :Item_typecast_maybe_null(a) {} const char *func_name() const { return "cast_as_time"; } String *val_str(String *str); - bool get_time(TIME *ltime); + bool get_time(MYSQL_TIME *ltime); const char *cast_type() const { return "time"; } enum_field_types field_type() const { return MYSQL_TYPE_TIME; } Field *tmp_table_field(TABLE *table) @@ -1020,7 +1020,7 @@ public: :Item_str_func(a, b) {} String *val_str(String *str); - bool get_date(TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); const char *func_name() const { return "str_to_date"; } enum_field_types field_type() const { return cached_field_type; } void fix_length_and_dec(); @@ -1037,5 +1037,5 @@ class Item_func_last_day :public Item_date public: Item_func_last_day(Item *a) :Item_date(a) {} const char *func_name() const { return "last_day"; } - bool get_date(TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, uint fuzzy_date); }; diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index 511942e9a5d..7b2d271639f 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -191,7 +191,7 @@ int str2my_decimal(uint mask, const char *from, uint length, } -my_decimal *date2my_decimal(TIME *ltime, my_decimal *dec) +my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec) { longlong date; date = (ltime->year*100L + ltime->month)*100L + ltime->day; diff --git a/sql/my_decimal.h b/sql/my_decimal.h index cefc5ee00fd..eade029677f 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -296,7 +296,7 @@ int string2my_decimal(uint mask, const String *str, my_decimal *d) } -my_decimal *date2my_decimal(TIME *ltime, my_decimal *dec); +my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec); #endif /*defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) */ diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 9a0bed8d318..0dcdea5c4f4 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1833,19 +1833,20 @@ ulong convert_period_to_month(ulong period); ulong convert_month_to_period(ulong month); void get_date_from_daynr(long daynr,uint *year, uint *month, uint *day); -my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *not_exist); -bool str_to_time_with_warn(const char *str,uint length,TIME *l_time); +my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *not_exist); +bool str_to_time_with_warn(const char *str,uint length,MYSQL_TIME *l_time); timestamp_type str_to_datetime_with_warn(const char *str, uint length, - TIME *l_time, uint flags); -void localtime_to_TIME(TIME *to, struct tm *from); -void calc_time_from_sec(TIME *to, long seconds, long microseconds); + MYSQL_TIME *l_time, uint flags); +void localtime_to_TIME(MYSQL_TIME *to, struct tm *from); +void calc_time_from_sec(MYSQL_TIME *to, long seconds, long microseconds); -void make_truncated_value_warning(THD *thd, const char *str_val, +void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, + const char *str_val, uint str_length, timestamp_type time_type, const char *field_name); -bool date_add_interval(TIME *ltime, interval_type int_type, INTERVAL interval); -bool calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign, +bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, INTERVAL interval); +bool calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign, longlong *seconds_out, long *microseconds_out); extern LEX_STRING interval_type_to_name[]; @@ -1857,15 +1858,15 @@ extern DATE_TIME_FORMAT *date_time_format_copy(THD *thd, DATE_TIME_FORMAT *format); const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format, timestamp_type type); -extern bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, +extern bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time, timestamp_type type, String *str); -void make_datetime(const DATE_TIME_FORMAT *format, const TIME *l_time, +void make_datetime(const DATE_TIME_FORMAT *format, const MYSQL_TIME *l_time, String *str); -void make_date(const DATE_TIME_FORMAT *format, const TIME *l_time, +void make_date(const DATE_TIME_FORMAT *format, const MYSQL_TIME *l_time, String *str); -void make_time(const DATE_TIME_FORMAT *format, const TIME *l_time, +void make_time(const DATE_TIME_FORMAT *format, const MYSQL_TIME *l_time, String *str); -int my_time_compare(TIME *a, TIME *b); +int my_time_compare(MYSQL_TIME *a, MYSQL_TIME *b); int test_if_number(char *str,int *res,bool allow_wildcards); void change_byte(byte *,uint,char,char); @@ -1885,7 +1886,7 @@ double my_double_round(double value, int dec, bool truncate); int get_quick_record(SQL_SELECT *select); int calc_weekday(long daynr,bool sunday_first_day_of_week); -uint calc_week(TIME *l_time, uint week_behaviour, uint *year); +uint calc_week(MYSQL_TIME *l_time, uint week_behaviour, uint *year); void find_date(char *pos,uint *vek,uint flag); TYPELIB *convert_strings_to_array_type(my_string *typelibs, my_string *end); TYPELIB *typelib(MEM_ROOT *mem_root, List &strings); diff --git a/sql/protocol.cc b/sql/protocol.cc index 5aa3b7b5055..d537fd346f9 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -961,7 +961,7 @@ bool Protocol_text::store(Field *field) */ -bool Protocol_text::store(TIME *tm) +bool Protocol_text::store(MYSQL_TIME *tm) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -984,7 +984,7 @@ bool Protocol_text::store(TIME *tm) } -bool Protocol_text::store_date(TIME *tm) +bool Protocol_text::store_date(MYSQL_TIME *tm) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -1003,7 +1003,7 @@ bool Protocol_text::store_date(TIME *tm) we support 0-6 decimals for time. */ -bool Protocol_text::store_time(TIME *tm) +bool Protocol_text::store_time(MYSQL_TIME *tm) { #ifndef DBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -1176,7 +1176,7 @@ bool Protocol_binary::store(Field *field) } -bool Protocol_binary::store(TIME *tm) +bool Protocol_binary::store(MYSQL_TIME *tm) { char buff[12],*pos; uint length; @@ -1202,7 +1202,7 @@ bool Protocol_binary::store(TIME *tm) return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC); } -bool Protocol_binary::store_date(TIME *tm) +bool Protocol_binary::store_date(MYSQL_TIME *tm) { tm->hour= tm->minute= tm->second=0; tm->second_part= 0; @@ -1210,7 +1210,7 @@ bool Protocol_binary::store_date(TIME *tm) } -bool Protocol_binary::store_time(TIME *tm) +bool Protocol_binary::store_time(MYSQL_TIME *tm) { char buff[13], *pos; uint length; diff --git a/sql/protocol.h b/sql/protocol.h index da49cf769ae..e0672240e0e 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -88,9 +88,9 @@ public: CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0; virtual bool store(float from, uint32 decimals, String *buffer)=0; virtual bool store(double from, uint32 decimals, String *buffer)=0; - virtual bool store(TIME *time)=0; - virtual bool store_date(TIME *time)=0; - virtual bool store_time(TIME *time)=0; + virtual bool store(MYSQL_TIME *time)=0; + virtual bool store_date(MYSQL_TIME *time)=0; + virtual bool store_time(MYSQL_TIME *time)=0; virtual bool store(Field *field)=0; #ifdef EMBEDDED_LIBRARY int begin_dataset(); @@ -127,9 +127,9 @@ public: virtual bool store(const char *from, uint length, CHARSET_INFO *cs); virtual bool store(const char *from, uint length, CHARSET_INFO *fromcs, CHARSET_INFO *tocs); - virtual bool store(TIME *time); - virtual bool store_date(TIME *time); - virtual bool store_time(TIME *time); + virtual bool store(MYSQL_TIME *time); + virtual bool store_date(MYSQL_TIME *time); + virtual bool store_time(MYSQL_TIME *time); virtual bool store(float nr, uint32 decimals, String *buffer); virtual bool store(double from, uint32 decimals, String *buffer); virtual bool store(Field *field); @@ -162,9 +162,9 @@ public: virtual bool store(const char *from,uint length, CHARSET_INFO *cs); virtual bool store(const char *from, uint length, CHARSET_INFO *fromcs, CHARSET_INFO *tocs); - virtual bool store(TIME *time); - virtual bool store_date(TIME *time); - virtual bool store_time(TIME *time); + virtual bool store(MYSQL_TIME *time); + virtual bool store_date(MYSQL_TIME *time); + virtual bool store_time(MYSQL_TIME *time); virtual bool store(float nr, uint32 decimals, String *buffer); virtual bool store(double from, uint32 decimals, String *buffer); virtual bool store(Field *field); diff --git a/sql/sp.cc b/sql/sp.cc index c1a9aac0c24..aa6d40f5fc0 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -724,7 +724,7 @@ print_field_values(THD *thd, TABLE *table, switch (used_field->field_type) { case MYSQL_TYPE_TIMESTAMP: { - TIME tmp_time; + MYSQL_TIME tmp_time; bzero((char *)&tmp_time, sizeof(tmp_time)); ((Field_timestamp *) used_field->field)->get_time(&tmp_time); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 4d7c2c485ab..b7ab996105b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6274,7 +6274,7 @@ fill_record(THD *thd, Field **ptr, List &values, bool ignore_errors) TABLE *table= field->table; if (field == table->next_number_field) table->auto_increment_field_not_null= TRUE; - if (value->save_in_field(field, 0) == -1) + if (value->save_in_field(field, 0) < 0) DBUG_RETURN(TRUE); } DBUG_RETURN(thd->net.report_error); diff --git a/sql/sql_class.h b/sql/sql_class.h index a9915fce4ef..6b79917f772 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -278,7 +278,7 @@ struct system_variables Time_zone *time_zone; - /* DATE, DATETIME and TIME formats */ + /* DATE, DATETIME and MYSQL_TIME formats */ DATE_TIME_FORMAT *date_format; DATE_TIME_FORMAT *datetime_format; DATE_TIME_FORMAT *time_format; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ea9b835df4d..5558b02ad78 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1799,7 +1799,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) else table->field[4]->store(command_name[tmp->command].str, command_name[tmp->command].length, cs); - /* TIME */ + /* MYSQL_TIME */ table->field[5]->store((uint32)(tmp->start_time ? now - tmp->start_time : 0), TRUE); /* STATE */ @@ -2836,7 +2836,7 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables, const char *file_name) { const char *tmp_buff; - TIME time; + MYSQL_TIME time; CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("get_schema_tables_record"); @@ -3395,7 +3395,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table, { String tmp_string; String sp_db, sp_name, definer; - TIME time; + MYSQL_TIME time; LEX *lex= thd->lex; CHARSET_INFO *cs= system_charset_info; get_field(thd->mem_root, proc_table->field[0], &sp_db); @@ -3967,7 +3967,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table, TABLE* table= schema_table; CHARSET_INFO *cs= system_charset_info; PARTITION_INFO stat_info; - TIME time; + MYSQL_TIME time; file->get_dynamic_partition_info(&stat_info, part_id); table->field[12]->store((longlong) stat_info.records, TRUE); table->field[13]->store((longlong) stat_info.mean_rec_length, TRUE); @@ -4305,7 +4305,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) { const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS; CHARSET_INFO *scs= system_charset_info; - TIME time; + MYSQL_TIME time; Event_timed et; DBUG_ENTER("fill_events_copy_to_schema_tab"); diff --git a/sql/structs.h b/sql/structs.h index 377d337dcfa..4cf9379d2bb 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -136,12 +136,11 @@ typedef struct st_read_record { /* Parameter to read_record */ /* - Originally MySQL used TIME structure inside server only, but since + Originally MySQL used MYSQL_TIME structure inside server only, but since 4.1 it's exported to user in the new client API. Define aliases for new names to keep existing code simple. */ -typedef struct st_mysql_time TIME; typedef enum enum_mysql_timestamp_type timestamp_type; diff --git a/sql/time.cc b/sql/time.cc index 4854206b1c8..b6c91ff2148 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -96,7 +96,7 @@ int calc_weekday(long daynr,bool sunday_first_day_of_week) next week is week 1. */ -uint calc_week(TIME *l_time, uint week_behaviour, uint *year) +uint calc_week(MYSQL_TIME *l_time, uint week_behaviour, uint *year) { uint days; ulong daynr=calc_daynr(l_time->year,l_time->month,l_time->day); @@ -214,7 +214,7 @@ ulong convert_month_to_period(ulong month) /* - Convert a timestamp string to a TIME value and produce a warning + Convert a timestamp string to a MYSQL_TIME value and produce a warning if string was truncated during conversion. NOTE @@ -222,7 +222,7 @@ ulong convert_month_to_period(ulong month) */ timestamp_type -str_to_datetime_with_warn(const char *str, uint length, TIME *l_time, +str_to_datetime_with_warn(const char *str, uint length, MYSQL_TIME *l_time, uint flags) { int was_cut; @@ -235,13 +235,14 @@ str_to_datetime_with_warn(const char *str, uint length, TIME *l_time, MODE_NO_ZERO_DATE))), &was_cut); if (was_cut || ts_type <= MYSQL_TIMESTAMP_ERROR) - make_truncated_value_warning(current_thd, str, length, ts_type, NullS); + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + str, length, ts_type, NullS); return ts_type; } /* - Convert a datetime from broken-down TIME representation to corresponding + Convert a datetime from broken-down MYSQL_TIME representation to corresponding TIMESTAMP value. SYNOPSIS @@ -257,7 +258,7 @@ str_to_datetime_with_warn(const char *str, uint length, TIME *l_time, 0 - t contains datetime value which is out of TIMESTAMP range. */ -my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *in_dst_time_gap) +my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *in_dst_time_gap) { my_time_t timestamp; @@ -276,20 +277,20 @@ my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *in_dst_time_gap) /* - Convert a time string to a TIME struct and produce a warning + Convert a time string to a MYSQL_TIME struct and produce a warning if string was cut during conversion. NOTE See str_to_time() for more info. */ bool -str_to_time_with_warn(const char *str, uint length, TIME *l_time) +str_to_time_with_warn(const char *str, uint length, MYSQL_TIME *l_time) { int warning; bool ret_val= str_to_time(str, length, l_time, &warning); if (ret_val || warning) - make_truncated_value_warning(current_thd, str, length, - MYSQL_TIMESTAMP_TIME, NullS); + make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + str, length, MYSQL_TIMESTAMP_TIME, NullS); return ret_val; } @@ -298,7 +299,7 @@ str_to_time_with_warn(const char *str, uint length, TIME *l_time) Convert a system time structure to TIME */ -void localtime_to_TIME(TIME *to, struct tm *from) +void localtime_to_TIME(MYSQL_TIME *to, struct tm *from) { to->neg=0; to->second_part=0; @@ -310,7 +311,7 @@ void localtime_to_TIME(TIME *to, struct tm *from) to->second= (int) from->tm_sec; } -void calc_time_from_sec(TIME *to, long seconds, long microseconds) +void calc_time_from_sec(MYSQL_TIME *to, long seconds, long microseconds) { long t_seconds; to->hour= seconds/3600L; @@ -679,7 +680,7 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format, MySQL doesn't support comparing of date/time/datetime strings that are not in arbutary order as dates are compared as strings in some context) - This functions don't check that given TIME structure members are + This functions don't check that given MYSQL_TIME structure members are in valid range. If they are not, return value won't reflect any valid date either. Additionally, make_time doesn't take into account time->day member: it's assumed that days have been converted @@ -687,7 +688,7 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format, ****************************************************************************/ void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)), - const TIME *l_time, String *str) + const MYSQL_TIME *l_time, String *str) { uint length= (uint) my_time_to_str(l_time, (char*) str->ptr()); str->length(length); @@ -696,7 +697,7 @@ void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)), void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)), - const TIME *l_time, String *str) + const MYSQL_TIME *l_time, String *str) { uint length= (uint) my_date_to_str(l_time, (char*) str->ptr()); str->length(length); @@ -705,7 +706,7 @@ void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)), void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)), - const TIME *l_time, String *str) + const MYSQL_TIME *l_time, String *str) { uint length= (uint) my_datetime_to_str(l_time, (char*) str->ptr()); str->length(length); @@ -713,7 +714,8 @@ void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)), } -void make_truncated_value_warning(THD *thd, const char *str_val, +void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, + const char *str_val, uint str_length, timestamp_type time_type, const char *field_name) { @@ -752,14 +754,14 @@ void make_truncated_value_warning(THD *thd, const char *str_val, cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff), ER(ER_WRONG_VALUE), type_str, str.c_ptr()); } - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + push_warning(thd, level, ER_TRUNCATED_WRONG_VALUE, warn_buff); } /* Daynumber from year 0 to 9999-12-31 */ #define MAX_DAY_NUMBER 3652424L -bool date_add_interval(TIME *ltime, interval_type int_type, INTERVAL interval) +bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, INTERVAL interval) { long period, sign; @@ -883,7 +885,7 @@ invalid_date: NOTE This function calculates difference between l_time1 and l_time2 absolute values. So one should set l_sign and correct result if he want to take - signs into account (i.e. for TIME values). + signs into account (i.e. for MYSQL_TIME values). RETURN VALUES Returns sign of difference. @@ -893,7 +895,7 @@ invalid_date: */ bool -calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign, longlong *seconds_out, +calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign, longlong *seconds_out, long *microseconds_out) { long days; @@ -943,7 +945,7 @@ calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign, longlong *seconds_out, /* - Compares 2 TIME structures + Compares 2 MYSQL_TIME structures SYNOPSIS my_time_compare() @@ -961,7 +963,7 @@ calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign, longlong *seconds_out, */ int -my_time_compare(TIME *a, TIME *b) +my_time_compare(MYSQL_TIME *a, MYSQL_TIME *b) { my_ulonglong a_t= TIME_to_ulonglong_datetime(a); my_ulonglong b_t= TIME_to_ulonglong_datetime(b); diff --git a/sql/tztime.cc b/sql/tztime.cc index 65a1a59a5d0..08b93cfd203 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -77,7 +77,7 @@ typedef struct lsinfo /* Structure with information describing ranges of my_time_t shifted to local - time (my_time_t + offset). Used for local TIME -> my_time_t conversion. + time (my_time_t + offset). Used for local MYSQL_TIME -> my_time_t conversion. See comments for TIME_to_gmt_sec() for more info. */ typedef struct revtinfo @@ -292,9 +292,9 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) be used if there are no transitions or we have moment in time before any transitions. Second task is to build "shifted my_time_t" -> my_time_t map used in - TIME -> my_time_t conversion. + MYSQL_TIME -> my_time_t conversion. Note: See description of TIME_to_gmt_sec() function first. - In order to perform TIME -> my_time_t conversion we need to build table + In order to perform MYSQL_TIME -> my_time_t conversion we need to build table which defines "shifted by tz offset and leap seconds my_time_t" -> my_time_t function wich is almost the same (except ranges of ambiguity) as reverse function to piecewise linear function used for my_time_t -> @@ -531,14 +531,14 @@ static const uint year_lengths[2]= offset - local time zone offset DESCRIPTION - Convert my_time_t with offset to TIME struct. Differs from timesub + Convert my_time_t with offset to MYSQL_TIME struct. Differs from timesub (from elsie code) because doesn't contain any leap correction and TM_GMTOFF and is_dst setting and contains some MySQL specific initialization. Funny but with removing of these we almost have glibc's offtime function. */ static void -sec_to_TIME(TIME * tmp, my_time_t t, long offset) +sec_to_TIME(MYSQL_TIME * tmp, my_time_t t, long offset) { long days; long rem; @@ -594,7 +594,7 @@ sec_to_TIME(TIME * tmp, my_time_t t, long offset) tmp->month++; tmp->day= (uint)(days + 1); - /* filling MySQL specific TIME members */ + /* filling MySQL specific MYSQL_TIME members */ tmp->neg= 0; tmp->second_part= 0; tmp->time_type= MYSQL_TIMESTAMP_DATETIME; } @@ -686,7 +686,7 @@ find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp) /* Converts time in my_time_t representation (seconds in UTC since Epoch) to - broken down TIME representation in local time zone. + broken down MYSQL_TIME representation in local time zone. SYNOPSIS gmt_sec_to_TIME() @@ -701,12 +701,12 @@ find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp) (60th and 61st second, look how we calculate them as "hit" in this function). Under realistic assumptions about frequency of transitions the same array - can be used fot TIME -> my_time_t conversion. For this we need to + can be used fot MYSQL_TIME -> my_time_t conversion. For this we need to implement tweaked binary search which will take into account that some - TIME has two matching my_time_t ranges and some of them have none. + MYSQL_TIME has two matching my_time_t ranges and some of them have none. */ static void -gmt_sec_to_TIME(TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp) +gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp) { const TRAN_TYPE_INFO *ttisp; const LS_INFO *lp; @@ -809,11 +809,11 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) /* - Works like sec_since_epoch but expects TIME structure as parameter. + Works like sec_since_epoch but expects MYSQL_TIME structure as parameter. */ my_time_t -sec_since_epoch_TIME(TIME *t) +sec_since_epoch_TIME(MYSQL_TIME *t) { return sec_since_epoch(t->year, t->month, t->day, t->hour, t->minute, t->second); @@ -821,7 +821,7 @@ sec_since_epoch_TIME(TIME *t) /* - Converts local time in broken down TIME representation to my_time_t + Converts local time in broken down MYSQL_TIME representation to my_time_t representation. SYNOPSIS @@ -863,7 +863,7 @@ sec_since_epoch_TIME(TIME *t) We use completely different approach. It is better since it is both faster than iterative implementations and fully determenistic. If you - look at my_time_t to TIME conversion then you'll find that it consist + look at my_time_t to MYSQL_TIME conversion then you'll find that it consist of two steps: The first is calculating shifted my_time_t value and the second - TIME calculation from shifted my_time_t value (well it is a bit simplified @@ -893,7 +893,7 @@ sec_since_epoch_TIME(TIME *t) 0 in case of error. */ static my_time_t -TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, +TIME_to_gmt_sec(const MYSQL_TIME *t, const TIME_ZONE_INFO *sp, my_bool *in_dst_time_gap) { my_time_t local_t; @@ -1020,20 +1020,20 @@ class Time_zone_system : public Time_zone { public: Time_zone_system() {} /* Remove gcc warning */ - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const; - virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; }; /* - Converts local time in system time zone in TIME representation + Converts local time in system time zone in MYSQL_TIME representation to its my_time_t representation. SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time in + t - pointer to MYSQL_TIME structure with local time in broken-down representation. in_dst_time_gap - pointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into @@ -1041,7 +1041,7 @@ public: DESCRIPTION This method uses system function (localtime_r()) for conversion - local time in system time zone in TIME structure to its my_time_t + local time in system time zone in MYSQL_TIME structure to its my_time_t representation. Unlike the same function for Time_zone_db class it it won't handle unnormalized input properly. Still it will return lowest possible my_time_t in case of ambiguity or if we @@ -1053,7 +1053,7 @@ public: Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const +Time_zone_system::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const { long not_used; return my_system_gmt_sec(t, ¬_used, in_dst_time_gap); @@ -1066,7 +1066,7 @@ Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const SYNOPSIS gmt_sec_to_TIME() - tmp - pointer to TIME structure to fill-in + tmp - pointer to MYSQL_TIME structure to fill-in t - my_time_t value to be converted NOTE @@ -1077,7 +1077,7 @@ Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const the 1902 easily. */ void -Time_zone_system::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +Time_zone_system::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const { struct tm tmp_tm; time_t tmp_t= (time_t)t; @@ -1107,26 +1107,26 @@ Time_zone_system::get_name() const /* Instance of this class represents UTC time zone. It uses system gmtime_r function for conversions and is always available. It is used only for - my_time_t -> TIME conversions in various UTC_... functions, it is not - intended for TIME -> my_time_t conversions and shouldn't be exposed to user. + my_time_t -> MYSQL_TIME conversions in various UTC_... functions, it is not + intended for MYSQL_TIME -> my_time_t conversions and shouldn't be exposed to user. */ class Time_zone_utc : public Time_zone { public: Time_zone_utc() {} /* Remove gcc warning */ - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const; - virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; }; /* - Convert UTC time from TIME representation to its my_time_t representation. + Convert UTC time from MYSQL_TIME representation to its my_time_t representation. SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time + t - pointer to MYSQL_TIME structure with local time in broken-down representation. in_dst_time_gap - pointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into @@ -1141,7 +1141,7 @@ public: 0 */ my_time_t -Time_zone_utc::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const +Time_zone_utc::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const { /* Should be never called */ DBUG_ASSERT(0); @@ -1155,14 +1155,14 @@ Time_zone_utc::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const SYNOPSIS gmt_sec_to_TIME() - tmp - pointer to TIME structure to fill-in + tmp - pointer to MYSQL_TIME structure to fill-in t - my_time_t value to be converted NOTE See note for apropriate Time_zone_system method. */ void -Time_zone_utc::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +Time_zone_utc::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const { struct tm tmp_tm; time_t tmp_t= (time_t)t; @@ -1203,9 +1203,9 @@ class Time_zone_db : public Time_zone { public: Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg); - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const; - virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; private: TIME_ZONE_INFO *tz_info; @@ -1239,7 +1239,7 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time + t - pointer to MYSQL_TIME structure with local time in broken-down representation. in_dst_time_gap - pointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into @@ -1253,7 +1253,7 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_db::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const +Time_zone_db::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const { return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap); } @@ -1265,11 +1265,11 @@ Time_zone_db::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const SYNOPSIS gmt_sec_to_TIME() - tmp - pointer to TIME structure to fill-in + tmp - pointer to MYSQL_TIME structure to fill-in t - my_time_t value to be converted */ void -Time_zone_db::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +Time_zone_db::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const { ::gmt_sec_to_TIME(tmp, t, tz_info); } @@ -1299,9 +1299,9 @@ class Time_zone_offset : public Time_zone { public: Time_zone_offset(long tz_offset_arg); - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const; - virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const; virtual const String * get_name() const; /* This have to be public because we want to be able to access it from @@ -1336,11 +1336,11 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg): /* Converts local time in time zone described as offset from UTC - from TIME representation to its my_time_t representation. + from MYSQL_TIME representation to its my_time_t representation. SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time + t - pointer to MYSQL_TIME structure with local time in broken-down representation. in_dst_time_gap - pointer to bool which should be set to true if datetime value passed doesn't really exist @@ -1352,7 +1352,7 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg): Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_offset::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const +Time_zone_offset::TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const { my_time_t local_t; int shift= 0; @@ -1397,11 +1397,11 @@ Time_zone_offset::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const SYNOPSIS gmt_sec_to_TIME() - tmp - pointer to TIME structure to fill-in + tmp - pointer to MYSQL_TIME structure to fill-in t - my_time_t value to be converted */ void -Time_zone_offset::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +Time_zone_offset::gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const { sec_to_TIME(tmp, t, offset); } @@ -2564,7 +2564,7 @@ main(int argc, char **argv) my_bool localtime_negative; TIME_ZONE_INFO tz_info; struct tm tmp; - TIME time_tmp; + MYSQL_TIME time_tmp; time_t t, t1, t2; char fullname[FN_REFLEN+1]; char *str_end; diff --git a/sql/tztime.h b/sql/tztime.h index b6af4b37468..f7cc7042d79 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -22,7 +22,7 @@ /* This class represents abstract time zone and provides - basic interface for TIME <-> my_time_t conversion. + basic interface for MYSQL_TIME <-> my_time_t conversion. Actual time zones which are specified by DB, or via offset or use system functions are its descendants. */ @@ -31,18 +31,18 @@ class Time_zone: public Sql_alloc public: Time_zone() {} /* Remove gcc warning */ /* - Converts local time in broken down TIME representation to + Converts local time in broken down MYSQL_TIME representation to my_time_t (UTC seconds since Epoch) represenation. Returns 0 in case of error. Sets in_dst_time_gap to true if date provided falls into spring time-gap (or lefts it untouched otherwise). */ - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, my_bool *in_dst_time_gap) const = 0; /* Converts time in my_time_t representation to local time in - broken down TIME representation. + broken down MYSQL_TIME representation. */ - virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const = 0; + virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const = 0; /* Because of constness of String returned by get_name() time zone name have to be already zeroended to be able to use String::ptr() instead @@ -62,7 +62,7 @@ extern Time_zone * my_tz_SYSTEM; extern Time_zone * my_tz_find(THD *thd, const String *name); extern my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap); extern void my_tz_free(); -extern my_time_t sec_since_epoch_TIME(TIME *t); +extern my_time_t sec_since_epoch_TIME(MYSQL_TIME *t); /* Number of elements in table list produced by my_tz_get_table_list() diff --git a/sql/unireg.cc b/sql/unireg.cc index d90420313a6..a69a9be6a43 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -936,7 +936,9 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type, (regfield->real_type() != MYSQL_TYPE_YEAR || field->def->val_int() != 0)) { - if (field->def->save_in_field(regfield, 1)) + int res= field->def->save_in_field(regfield, 1); + /* If not ok or warning of level 'note' */ + if (res != 0 && res != 3) { my_error(ER_INVALID_DEFAULT, MYF(0), regfield->field_name); error= 1; diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 0536d445533..aa3689c1b72 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2769,6 +2769,7 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs, const uchar *te=t+tlen; int save_diff = 0; int diff; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -2812,6 +2813,7 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs, const uchar *se= s+slen; const uchar *te= t+tlen; int save_diff = 0; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while ( s < se && t < te ) { diff --git a/win/README b/win/README index 9218b63b05e..88677029e0b 100644 --- a/win/README +++ b/win/README @@ -58,7 +58,7 @@ The options right now are MYSQL_SERVER_SUFFIX= Server suffix, default none COMPILATION_COMMENT= Server comment, default "Source distribution" MYSQL_TCP_PORT= Server port, default 3306 - CYBOZU + CYBOZU Default character set is UTF8 So the command line could look like: From 85e1718e000e74a324c6f5281af111b7b7e4b104 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 22:16:32 +0200 Subject: [PATCH 343/789] bug in im* tests - missing --no-defaults in the mysql command line --- mysql-test/t/wait_for_socket.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/wait_for_socket.sh b/mysql-test/t/wait_for_socket.sh index 8c17c8ac0ac..2fa7d5c5b7e 100755 --- a/mysql-test/t/wait_for_socket.sh +++ b/mysql-test/t/wait_for_socket.sh @@ -61,7 +61,7 @@ fi ########################################################################### -client_args="--silent --socket=$socket_path --connect_timeout=1 " +client_args="--no-defaults --silent --socket=$socket_path --connect_timeout=1 " [ -n "$username" ] && client_args="$client_args --user=$username " [ -n "$password" ] && client_args="$client_args --password=$password " From 27fc5de41aa6005d61c520e050ec0b8795b366eb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 21:49:49 +0100 Subject: [PATCH 344/789] rpl_ndb_sync.result, ndb_partition_key.result: test case mysql-test/r/ndb_partition_key.result: test case mysql-test/r/rpl_ndb_sync.result: test case --- mysql-test/r/ndb_partition_key.result | 1 + mysql-test/r/rpl_ndb_sync.result | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/r/ndb_partition_key.result index e294807b40d..685137b7710 100644 --- a/mysql-test/r/ndb_partition_key.result +++ b/mysql-test/r/ndb_partition_key.result @@ -57,6 +57,7 @@ Number of primary keys: 3 Length of frm data: # Row Checksum: 1 Row GCI: 1 +SingleUserMode: 0 TableStatus: Retrieved -- Attributes -- a Int PRIMARY KEY AT=FIXED ST=MEMORY diff --git a/mysql-test/r/rpl_ndb_sync.result b/mysql-test/r/rpl_ndb_sync.result index a2c3b46db5a..d05367c5fc0 100644 --- a/mysql-test/r/rpl_ndb_sync.result +++ b/mysql-test/r/rpl_ndb_sync.result @@ -93,4 +93,4 @@ select * from mysql.ndb_binlog_index; Position File epoch inserts updates deletes schemaops reset slave; select * from mysql.ndb_apply_status; -server_id epoch +server_id epoch log_name start_pos end_pos From 139c950f11c437230129243bd66d4b7dd9f73c79 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 18:15:11 -0400 Subject: [PATCH 345/789] bug#26346 Added some fixes for an existing memory leak and unitilialized variables, both caught by gcc. --- client/mysqldump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 333bfbff1e6..effeaf68597 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1546,8 +1546,9 @@ static uint dump_routines_for_db(char *db) my_free(query_str, MYF(MY_ALLOW_ZERO_PTR)); } } /* end of routine printing */ + mysql_free_result(routine_res); + } /* end of list of routines */ - mysql_free_result(routine_res); } mysql_free_result(routine_list_res); } /* end of for i (0 .. 1) */ @@ -3373,7 +3374,7 @@ char check_if_ignore_table(const char *table_name, char *table_type) { char result= IGNORE_NONE; char buff[FN_REFLEN+80], show_name_buff[FN_REFLEN]; - MYSQL_RES *res; + MYSQL_RES *res= NULL; MYSQL_ROW row; DBUG_ENTER("check_if_ignore_table"); From eee28a267d658376f349bb54c7481e05f10c0eda Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 16:28:07 -0600 Subject: [PATCH 346/789] Bug #24563: MBROverlaps does not seem to function propertly. Fix is to rewrite the MBR::overlaps() function, to compute the dimension of both arguments, and the dimension of the intersection; test that all three dimensions are the same (e.g., all are Polygons). Add tests for all MBR* functions for various combinations of shapes, lines and points. mysql-test/include/gis_generic.inc: Add tests & checks for bug #24563 and bug #24588 - some GIS functions missing in 5.1; many GIS functions not tested; Overlaps() function was incorrect when MBR shifted only along one axis; Overlaps() needs to take dimension of shape into account. mysql-test/r/archive_gis.result: Update test results. mysql-test/r/bdb_gis.result: Update test results. mysql-test/r/gis.result: Update test results. mysql-test/r/innodb_gis.result: Update test results. mysql-test/r/ndb_gis.result: Update test results. mysql-test/t/gis.test: Add tests & checks for bug #24563 and bug #24588 - some GIS functions missing in 5.1; many GIS functions not tested; Overlaps() function was incorrect when MBR shifted only along one axis; Overlaps() needs to take dimension of shape into account. sql/spatial.h: Add MBR::dimension() (map MBR to integral dimension: point -> 0, line -> 1, polygon -> 2, invalid -> -1) Fix MBR::overlaps() to handle MBRs which are shifted on one dimension only, and to take MBR dimension into account. Also, test both within() and contains() predicates (so that overlaps(a, b) == overlaps(b, a)). --- mysql-test/include/gis_generic.inc | 71 +++++++++++- mysql-test/r/archive_gis.result | 88 ++++++++++++++- mysql-test/r/bdb_gis.result | 63 ++++++++++- mysql-test/r/gis.result | 87 +++++++++++++- mysql-test/r/innodb_gis.result | 88 ++++++++++++++- mysql-test/r/ndb_gis.result | 176 ++++++++++++++++++++++++++++- mysql-test/t/gis.test | 68 +++++++++++ sql/spatial.h | 43 ++++++- 8 files changed, 671 insertions(+), 13 deletions(-) diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc index dc5d95baad9..1b4303da1f8 100644 --- a/mysql-test/include/gis_generic.inc +++ b/mysql-test/include/gis_generic.inc @@ -177,4 +177,73 @@ insert into t1 values (pointfromtext('point(1,1)')); drop table t1; -# End of 5.0 tests +--echo End of 4.1 tests + + +# +# Bug#24563: MBROverlaps does not seem to function propertly +# Bug#54888: MBROverlaps missing in 5.1? +# + +# Test all MBR* functions and their non-MBR-prefixed aliases, +# using shifted squares to verify the spatial relations. + +create table t1 (name VARCHAR(100), square GEOMETRY); + +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); + +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); + +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); + +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); + +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); + +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); + +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; + +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; + +# Overlaps needs a few more tests, with point and line dimensions + +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); + +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +SELECT Overlaps(@horiz1, @point2) FROM DUAL; + +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result index 7fb69e54a4c..97be26178ee 100644 --- a/mysql-test/r/archive_gis.result +++ b/mysql-test/r/archive_gis.result @@ -392,7 +392,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r 120 120 1 1 0 1 0 0 1 0 -120 121 0 0 0 0 0 0 1 0 +120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 0 1 0 explain extended SELECT g1.fid as first, g2.fid as second, @@ -456,3 +456,89 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; +End of 4.1 tests +create table t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrcontains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrdisjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrequal +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrintersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbroverlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrtouches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrwithin +big,center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +contains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +disjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +equals +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +intersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +overlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +touches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +within +big,center +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +overlaps +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +overlaps +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +Overlaps(@horiz1, @vert1) +0 +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +Overlaps(@horiz1, @horiz2) +1 +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +Overlaps(@horiz1, @horiz3) +0 +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +Overlaps(@horiz1, @point1) +0 +SELECT Overlaps(@horiz1, @point2) FROM DUAL; +Overlaps(@horiz1, @point2) +0 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/r/bdb_gis.result b/mysql-test/r/bdb_gis.result index 512d681ff32..bb446badfff 100644 --- a/mysql-test/r/bdb_gis.result +++ b/mysql-test/r/bdb_gis.result @@ -392,7 +392,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r 120 120 1 1 0 1 0 0 1 0 -120 121 0 0 0 0 0 0 1 0 +120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 0 1 0 explain extended SELECT g1.fid as first, g2.fid as second, @@ -456,3 +456,64 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; +End of 4.1 tests +create table t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrcontains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrdisjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrequal +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrintersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbroverlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrtouches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrwithin +big,center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +contains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +disjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +equals +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +intersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +overlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +touches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +within +big,center +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index de034d93dc5..d0e2979a367 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -385,7 +385,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r 120 120 1 1 0 1 0 0 1 0 -120 121 0 0 0 0 0 0 1 0 +120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 0 1 0 explain extended SELECT g1.fid as first, g2.fid as second, @@ -763,3 +763,88 @@ create table t1 (g geometry not null); insert into t1 values(default); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1; +create table t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrcontains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrdisjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrequal +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrintersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbroverlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrtouches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrwithin +big,center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +contains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +disjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +equals +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +intersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +overlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +touches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +within +big,center +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +overlaps +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +overlaps +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +Overlaps(@horiz1, @vert1) +0 +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +Overlaps(@horiz1, @horiz2) +1 +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +Overlaps(@horiz1, @horiz3) +0 +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +Overlaps(@horiz1, @point1) +0 +SELECT Overlaps(@horiz1, @point2) FROM DUAL; +Overlaps(@horiz1, @point2) +0 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result index 41a227a2850..727cf7dbc66 100644 --- a/mysql-test/r/innodb_gis.result +++ b/mysql-test/r/innodb_gis.result @@ -392,7 +392,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r 120 120 1 1 0 1 0 0 1 0 -120 121 0 0 0 0 0 0 1 0 +120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 0 1 0 explain extended SELECT g1.fid as first, g2.fid as second, @@ -456,3 +456,89 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; +End of 4.1 tests +create table t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrcontains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrdisjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrequal +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrintersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbroverlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrtouches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrwithin +big,center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +contains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +disjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +equals +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +intersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +overlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +touches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +within +big,center +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +overlaps +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +overlaps +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +Overlaps(@horiz1, @vert1) +0 +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +Overlaps(@horiz1, @horiz2) +1 +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +Overlaps(@horiz1, @horiz3) +0 +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +Overlaps(@horiz1, @point1) +0 +SELECT Overlaps(@horiz1, @point2) FROM DUAL; +Overlaps(@horiz1, @point2) +0 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result index bdbbc65dd85..5851df9ea6e 100644 --- a/mysql-test/r/ndb_gis.result +++ b/mysql-test/r/ndb_gis.result @@ -392,7 +392,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r 120 120 1 1 0 1 0 0 1 0 -120 121 0 0 0 0 0 0 1 0 +120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 0 1 0 explain extended SELECT g1.fid as first, g2.fid as second, @@ -456,6 +456,92 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; +End of 4.1 tests +create table t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrcontains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrdisjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrequal +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrintersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbroverlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrtouches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrwithin +big,center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +contains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +disjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +equals +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +intersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +overlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +touches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +within +big,center +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +overlaps +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +overlaps +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +Overlaps(@horiz1, @vert1) +0 +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +Overlaps(@horiz1, @horiz2) +1 +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +Overlaps(@horiz1, @horiz3) +0 +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +Overlaps(@horiz1, @point1) +0 +SELECT Overlaps(@horiz1, @point2) FROM DUAL; +Overlaps(@horiz1, @point2) +0 +DROP TABLE t1; +End of 5.0 tests set engine_condition_pushdown = on; DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE gis_point (fid INTEGER, g POINT); @@ -850,7 +936,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r 120 120 1 1 0 1 0 0 1 0 -120 121 0 0 0 0 0 0 1 0 +120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 0 1 0 explain extended SELECT g1.fid as first, g2.fid as second, @@ -914,3 +1000,89 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; +End of 4.1 tests +create table t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrcontains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrdisjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrequal +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrintersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbroverlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrtouches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +mbrwithin +big,center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +contains +center,small +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +disjoint +down3,left3,right3,up3 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +equals +center +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +intersect +big,center,down,down2,left,left2,right,right2,small,up,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +overlaps +down,left,right,up +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +touches +down2,left2,right2,up2 +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +within +big,center +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +overlaps +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +overlaps +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +Overlaps(@horiz1, @vert1) +0 +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +Overlaps(@horiz1, @horiz2) +1 +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +Overlaps(@horiz1, @horiz3) +0 +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +Overlaps(@horiz1, @point1) +0 +SELECT Overlaps(@horiz1, @point2) FROM DUAL; +Overlaps(@horiz1, @point2) +0 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index b32764f1f62..72ed4a2dd37 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -471,3 +471,71 @@ create table t1 (g geometry not null); insert into t1 values(default); drop table t1; + +# +# Bug#24563: MBROverlaps does not seem to function propertly +# Bug#54888: MBROverlaps missing in 5.1? +# + +# Test all MBR* functions and their non-MBR-prefixed aliases, +# using shifted squares to verify the spatial relations. + +create table t1 (name VARCHAR(100), square GEOMETRY); + +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); + +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); + +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); + +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); + +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); + +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); + +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; + +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; +SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; + +# Overlaps needs a few more tests, with point and line dimensions + +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); + +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +SELECT Overlaps(@horiz1, @point2) FROM DUAL; + +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/spatial.h b/sql/spatial.h index 86232fcd524..837ae153310 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -144,15 +144,46 @@ struct MBR return (xminx) && (yminy); } + /** + The dimension maps to an integer as: + - Polygon -> 2 + - Horizontal or vertical line -> 1 + - Point -> 0 + - Invalid MBR -> -1 + */ + int dimension() const + { + int d= 0; + + if (xmin > xmax) + return -1; + else if (xmin < xmax) + d++; + + if (ymin > ymax) + return -1; + else if (ymin < ymax) + d++; + + return d; + } + int overlaps(const MBR *mbr) { - int lb= mbr->inner_point(xmin, ymin); - int rb= mbr->inner_point(xmax, ymin); - int rt= mbr->inner_point(xmax, ymax); - int lt= mbr->inner_point(xmin, ymax); + /* + overlaps() requires that some point inside *this is also inside + *mbr, and that both geometries and their intersection are of the + same dimension. + */ + int d = dimension(); - int a = lb+rb+rt+lt; - return (a>0) && (a<4) && (!within(mbr)); + if (d != mbr->dimension() || d <= 0 || contains(mbr) || within(mbr)) + return 0; + + MBR intersection(max(xmin, mbr->xmin), max(ymin, mbr->ymin), + min(xmax, mbr->xmax), min(ymax, mbr->ymax)); + + return (d == intersection.dimension()); } }; From 7cf2e15dc515e75585b616ee89293ac492ee8b54 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 19:30:25 -0400 Subject: [PATCH 347/789] bug#26346 Fix to a memory leak found by a complier warning. --- client/mysqldump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index c1bb81341ce..f4d56ecc0b0 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1528,11 +1528,11 @@ static uint dump_events_for_db(char *db) fprintf(sql_file, "/*!50106 %s */ %s\n", row[3], delimiter); } } /* end of event printing */ + mysql_free_result(event_res); + } /* end of list of events */ fprintf(sql_file, "DELIMITER ;\n"); fprintf(sql_file, "/*!50106 SET TIME_ZONE= @save_time_zone */ ;\n"); - - mysql_free_result(event_res); } mysql_free_result(event_list_res); From 1801bff37e57afe7e0eb2fa4015862d8e4fc58ef Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 18:02:37 -0600 Subject: [PATCH 348/789] Bug #24588: "MBROverlaps missing in 5.1?" The MBR-prefixed function aliases (e.g., MBROVERLAPS()) were missing in 5.1, after some code refactoring left them out. This simply adds them into the func_array list. sql/item_create.cc: Add MBR* functions to func_array[]; the non-MBR-prefixed aliases were already there --- sql/item_create.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/item_create.cc b/sql/item_create.cc index 6a1e87a3aae..0c3870883c2 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -4792,6 +4792,12 @@ static Native_func_registry func_array[] = { C_STRING_WITH_LEN("MAKE_SET"), BUILDER(Create_func_make_set)}, { C_STRING_WITH_LEN("MASTER_POS_WAIT"), BUILDER(Create_func_master_pos_wait)}, { C_STRING_WITH_LEN("MBRCONTAINS"), GEOM_BUILDER(Create_func_contains)}, + { C_STRING_WITH_LEN("MBRDISJOINT"), GEOM_BUILDER(Create_func_disjoint)}, + { C_STRING_WITH_LEN("MBREQUAL"), GEOM_BUILDER(Create_func_equals)}, + { C_STRING_WITH_LEN("MBRINTERSECTS"), GEOM_BUILDER(Create_func_intersects)}, + { C_STRING_WITH_LEN("MBROVERLAPS"), GEOM_BUILDER(Create_func_overlaps)}, + { C_STRING_WITH_LEN("MBRTOUCHES"), GEOM_BUILDER(Create_func_touches)}, + { C_STRING_WITH_LEN("MBRWITHIN"), GEOM_BUILDER(Create_func_within)}, { C_STRING_WITH_LEN("MD5"), BUILDER(Create_func_md5)}, { C_STRING_WITH_LEN("MLINEFROMTEXT"), GEOM_BUILDER(Create_func_geometry_from_text)}, { C_STRING_WITH_LEN("MLINEFROMWKB"), GEOM_BUILDER(Create_func_geometry_from_wkb)}, From cb5b56c8efc1752d6768547a6f0517455cdbe7e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 17:31:27 -0700 Subject: [PATCH 349/789] Bug#25721 "Concurrent ALTER/CREATE SERVER can lead to deadlock" Deadlock caused by inconsistant use of mutexes in sql_server.cc One mutex has been removed to resolve deadlock. Many functions were made private which should not be exported. Unused variables and function removed. mysql-test/r/federated_server.result: Bug 25721 "Concurrent ALTER/CREATE SERVER can lead to deadlock" New test results mysql-test/t/federated_server.test: Bug 25721 "Concurrent ALTER/CREATE SERVER can lead to deadlock" Test for bug by using stored procedure. Unpatched server would deadlock frequently. sql/sql_parse.cc: Bug 25721 "Concurrent ALTER/CREATE SERVER can lead to deadlock" check for correct error code when dropping server sql/sql_servers.cc: Bug 25721 "Concurrent ALTER/CREATE SERVER can lead to deadlock" Removed unneccessary mutex, only need THR_LOCK_servers rwlock to guard data structures against race conditions. Misuse of other mutex caused deadlock by inconsistant ordering of mutex lock operations. Alter order of some operations to hit memory before disk. Removed unused function. Removed servers_version and servers_cache_initialised variables. Made many internal functions static. sql/sql_servers.h: Bug 25721 "Concurrent ALTER/CREATE SERVER can lead to deadlock" remove internal functions from being exported. --- mysql-test/r/federated_server.result | 25 ++ mysql-test/t/federated_server.test | 35 +++ sql/sql_parse.cc | 2 +- sql/sql_servers.cc | 361 ++++++++++++--------------- sql/sql_servers.h | 30 +-- 5 files changed, 226 insertions(+), 227 deletions(-) diff --git a/mysql-test/r/federated_server.result b/mysql-test/r/federated_server.result index 3682c0c793f..8faf33581d1 100644 --- a/mysql-test/r/federated_server.result +++ b/mysql-test/r/federated_server.result @@ -189,6 +189,31 @@ drop user guest_select@localhost; drop table federated.t1; drop server 's1'; # End of 5.1 tests +use test; +create procedure p1 () +begin +DECLARE v INT DEFAULT 0; +DECLARE e INT DEFAULT 0; +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; +WHILE v < 10000 do +CREATE SERVER s +FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); +ALTER SERVER s OPTIONS (USER 'Remote'); +DROP SERVER s; +SET v = v + 1; +END WHILE; +SELECT e > 0; +END// +use test; +call p1(); +call p1(); +e > 0 +1 +e > 0 +1 +drop procedure p1; +drop server if exists s; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated_server.test b/mysql-test/t/federated_server.test index e65f319f98d..27dd494e5c5 100644 --- a/mysql-test/t/federated_server.test +++ b/mysql-test/t/federated_server.test @@ -234,4 +234,39 @@ drop server 's1'; --echo # End of 5.1 tests + +# +# Bug#25721 - deadlock with ALTER/CREATE SERVER +# +connect (other,localhost,root,,); +connection master; +use test; +delimiter //; +create procedure p1 () +begin + DECLARE v INT DEFAULT 0; + DECLARE e INT DEFAULT 0; + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; + WHILE v < 10000 do + CREATE SERVER s + FOREIGN DATA WRAPPER mysql + OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); + ALTER SERVER s OPTIONS (USER 'Remote'); + DROP SERVER s; + SET v = v + 1; + END WHILE; + SELECT e > 0; +END// +delimiter ;// +connection other; +use test; +send call p1(); +connection master; +call p1(); +connection other; +reap; +drop procedure p1; +drop server if exists s; + + source include/federated_cleanup.inc; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a0e412afdf0..23bbeb594d5 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4320,7 +4320,7 @@ create_sp_error: if ((err_code= drop_server(thd, &lex->server_options))) { - if (! lex->drop_if_exists && err_code == ER_FOREIGN_SERVER_EXISTS) + if (! lex->drop_if_exists && err_code == ER_FOREIGN_SERVER_DOESNT_EXIST) { DBUG_PRINT("info", ("problem dropping server %s", lex->server_options.server_name)); diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 9a5176d9fe3..9b01a1b6889 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -25,14 +25,43 @@ #include "sp_head.h" #include "sp.h" -HASH servers_cache; -pthread_mutex_t servers_cache_mutex; // To init the hash -uint servers_cache_initialised=FALSE; -/* Version of server table. incremented by servers_load */ -static uint servers_version=0; +/* + We only use 1 mutex to guard the data structures - THR_LOCK_servers. + Read locked when only reading data and write-locked for all other access. +*/ + +static HASH servers_cache; static MEM_ROOT mem; static rw_lock_t THR_LOCK_servers; +static bool get_server_from_table_to_cache(TABLE *table); + +/* insert functions */ +static int insert_server(THD *thd, FOREIGN_SERVER *server_options); +static int insert_server_record(TABLE *table, FOREIGN_SERVER *server); +static int insert_server_record_into_cache(FOREIGN_SERVER *server); +static void prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options, + FOREIGN_SERVER *server); +/* drop functions */ +static int delete_server_record(TABLE *table, + char *server_name, + int server_name_length); +static int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options); + +/* update functions */ +static void prepare_server_struct_for_update(LEX_SERVER_OPTIONS *server_options, + FOREIGN_SERVER *existing, + FOREIGN_SERVER *altered); +static int update_server(THD *thd, FOREIGN_SERVER *existing, + FOREIGN_SERVER *altered); +static int update_server_record(TABLE *table, FOREIGN_SERVER *server); +static int update_server_record_in_cache(FOREIGN_SERVER *existing, + FOREIGN_SERVER *altered); +/* utility functions */ +static void merge_server_struct(FOREIGN_SERVER *from, FOREIGN_SERVER *to); + + + static byte *servers_cache_get_key(FOREIGN_SERVER *server, uint *length, my_bool not_used __attribute__((unused))) { @@ -45,6 +74,7 @@ static byte *servers_cache_get_key(FOREIGN_SERVER *server, uint *length, DBUG_RETURN((byte*) server->server_name); } + /* Initialize structures responsible for servers used in federated server scheme information for them from the server @@ -64,35 +94,27 @@ static byte *servers_cache_get_key(FOREIGN_SERVER *server, uint *length, 1 Could not initialize servers */ -my_bool servers_init(bool dont_read_servers_table) +bool servers_init(bool dont_read_servers_table) { THD *thd; - my_bool return_val= 0; + bool return_val= FALSE; DBUG_ENTER("servers_init"); /* init the mutex */ - if (pthread_mutex_init(&servers_cache_mutex, MY_MUTEX_INIT_FAST)) - DBUG_RETURN(1); - if (my_rwlock_init(&THR_LOCK_servers, NULL)) - DBUG_RETURN(1); + DBUG_RETURN(TRUE); /* initialise our servers cache */ if (hash_init(&servers_cache, system_charset_info, 32, 0, 0, (hash_get_key) servers_cache_get_key, 0, 0)) { - return_val= 1; /* we failed, out of memory? */ + return_val= TRUE; /* we failed, out of memory? */ goto end; } /* Initialize the mem root for data */ init_alloc_root(&mem, ACL_ALLOC_BLOCK_SIZE, 0); - /* - at this point, the cache is initialised, let it be known - */ - servers_cache_initialised= TRUE; - if (dont_read_servers_table) goto end; @@ -100,7 +122,7 @@ my_bool servers_init(bool dont_read_servers_table) To be able to run this from boot, we allocate a temporary THD */ if (!(thd=new THD)) - DBUG_RETURN(1); + DBUG_RETURN(TRUE); thd->thread_stack= (char*) &thd; thd->store_globals(); /* @@ -130,19 +152,13 @@ end: TRUE Error */ -static my_bool servers_load(THD *thd, TABLE_LIST *tables) +static bool servers_load(THD *thd, TABLE_LIST *tables) { TABLE *table; READ_RECORD read_record_info; - my_bool return_val= TRUE; + bool return_val= TRUE; DBUG_ENTER("servers_load"); - if (!servers_cache_initialised) - DBUG_RETURN(0); - - /* need to figure out how to utilise this variable */ - servers_version++; /* servers updated */ - /* first, send all cached rows to sleep with the fishes, oblivion! I expect this crappy comment replaced */ free_root(&mem, MYF(MY_MARK_BLOCKS_FREE)); @@ -156,7 +172,7 @@ static my_bool servers_load(THD *thd, TABLE_LIST *tables) goto end; } - return_val=0; + return_val= FALSE; end: end_read_record(&read_record_info); @@ -183,10 +199,10 @@ end: TRUE Failure */ -my_bool servers_reload(THD *thd) +bool servers_reload(THD *thd) { TABLE_LIST tables[1]; - my_bool return_val= 1; + bool return_val= TRUE; DBUG_ENTER("servers_reload"); if (thd->locked_tables) @@ -196,10 +212,9 @@ my_bool servers_reload(THD *thd) close_thread_tables(thd); } - /* - To avoid deadlocks we should obtain table locks before - obtaining servers_cache->lock mutex. - */ + DBUG_PRINT("info", ("locking servers_cache")); + rw_wrlock(&THR_LOCK_servers); + bzero((char*) tables, sizeof(tables)); tables[0].alias= tables[0].table_name= (char*) "servers"; tables[0].db= (char*) "mysql"; @@ -212,12 +227,6 @@ my_bool servers_reload(THD *thd) goto end; } - DBUG_PRINT("info", ("locking servers_cache")); - VOID(pthread_mutex_lock(&servers_cache_mutex)); - - //old_servers_cache= servers_cache; - //old_mem=mem; - if ((return_val= servers_load(thd, tables))) { // Error. Revert to old list /* blast, for now, we have no servers, discuss later way to preserve */ @@ -226,14 +235,14 @@ my_bool servers_reload(THD *thd) servers_free(); } - DBUG_PRINT("info", ("unlocking servers_cache")); - VOID(pthread_mutex_unlock(&servers_cache_mutex)); - end: close_thread_tables(thd); + DBUG_PRINT("info", ("unlocking servers_cache")); + rw_unlock(&THR_LOCK_servers); DBUG_RETURN(return_val); } + /* Initialize structures responsible for servers used in federated server scheme information for them from the server @@ -260,7 +269,8 @@ end: 1 could not insert server struct into global servers cache */ -my_bool get_server_from_table_to_cache(TABLE *table) +static bool +get_server_from_table_to_cache(TABLE *table) { /* alloc a server struct */ char *ptr; @@ -308,69 +318,6 @@ my_bool get_server_from_table_to_cache(TABLE *table) DBUG_RETURN(FALSE); } -/* - SYNOPSIS - server_exists_in_table() - THD *thd - thread pointer - LEX_SERVER_OPTIONS *server_options - pointer to Lex->server_options - - NOTES - This function takes a LEX_SERVER_OPTIONS struct, which is very much the - same type of structure as a FOREIGN_SERVER, it contains the values parsed - in any one of the [CREATE|DELETE|DROP] SERVER statements. Using the - member "server_name", index_read_idx either founds the record and returns - 1, or doesn't find the record, and returns 0 - - RETURN VALUES - 0 record not found - 1 record found -*/ - -my_bool server_exists_in_table(THD *thd, LEX_SERVER_OPTIONS *server_options) -{ - int result= 1; - int error= 0; - TABLE_LIST tables; - TABLE *table; - DBUG_ENTER("server_exists"); - - bzero((char*) &tables, sizeof(tables)); - tables.db= (char*) "mysql"; - tables.alias= tables.table_name= (char*) "servers"; - - /* need to open before acquiring THR_LOCK_plugin or it will deadlock */ - if (! (table= open_ltable(thd, &tables, TL_WRITE))) - DBUG_RETURN(TRUE); - - table->use_all_columns(); - - rw_wrlock(&THR_LOCK_servers); - VOID(pthread_mutex_lock(&servers_cache_mutex)); - - /* set the field that's the PK to the value we're looking for */ - table->field[0]->store(server_options->server_name, - server_options->server_name_length, - system_charset_info); - - if ((error= table->file->index_read_idx(table->record[0], 0, - (byte *)table->field[0]->ptr, - table->key_info[0].key_length, - HA_READ_KEY_EXACT))) - { - if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) - { - table->file->print_error(error, MYF(0)); - result= -1; - } - result= 0; - DBUG_PRINT("info",("record for server '%s' not found!", - server_options->server_name)); - } - - VOID(pthread_mutex_unlock(&servers_cache_mutex)); - rw_unlock(&THR_LOCK_servers); - DBUG_RETURN(result); -} /* SYNOPSIS @@ -382,15 +329,18 @@ my_bool server_exists_in_table(THD *thd, LEX_SERVER_OPTIONS *server_options) This function takes a server object that is has all members properly prepared, ready to be inserted both into the mysql.servers table and the servers cache. + + THR_LOCK_servers must be write locked. RETURN VALUES 0 - no error other - error code */ -int insert_server(THD *thd, FOREIGN_SERVER *server) +static int +insert_server(THD *thd, FOREIGN_SERVER *server) { - int error= 0; + int error= -1; TABLE_LIST tables; TABLE *table; @@ -402,13 +352,7 @@ int insert_server(THD *thd, FOREIGN_SERVER *server) /* need to open before acquiring THR_LOCK_plugin or it will deadlock */ if (! (table= open_ltable(thd, &tables, TL_WRITE))) - DBUG_RETURN(TRUE); - - /* lock mutex to make sure no changes happen */ - VOID(pthread_mutex_lock(&servers_cache_mutex)); - - /* lock table */ - rw_wrlock(&THR_LOCK_servers); + goto end; /* insert the server into the table */ if ((error= insert_server_record(table, server))) @@ -419,12 +363,10 @@ int insert_server(THD *thd, FOREIGN_SERVER *server) goto end; end: - /* unlock the table */ - rw_unlock(&THR_LOCK_servers); - VOID(pthread_mutex_unlock(&servers_cache_mutex)); DBUG_RETURN(error); } + /* SYNOPSIS int insert_server_record_into_cache() @@ -434,13 +376,16 @@ end: This function takes a FOREIGN_SERVER pointer to an allocated (root mem) and inserts it into the global servers cache + THR_LOCK_servers must be write locked. + RETURN VALUE 0 - no error >0 - error code */ -int insert_server_record_into_cache(FOREIGN_SERVER *server) +static int +insert_server_record_into_cache(FOREIGN_SERVER *server) { int error=0; DBUG_ENTER("insert_server_record_into_cache"); @@ -461,6 +406,7 @@ int insert_server_record_into_cache(FOREIGN_SERVER *server) DBUG_RETURN(error); } + /* SYNOPSIS store_server_fields() @@ -478,7 +424,8 @@ int insert_server_record_into_cache(FOREIGN_SERVER *server) */ -void store_server_fields(TABLE *table, FOREIGN_SERVER *server) +static void +store_server_fields(TABLE *table, FOREIGN_SERVER *server) { table->use_all_columns(); @@ -539,6 +486,7 @@ void store_server_fields(TABLE *table, FOREIGN_SERVER *server) */ +static int insert_server_record(TABLE *table, FOREIGN_SERVER *server) { int error; @@ -606,7 +554,7 @@ int insert_server_record(TABLE *table, FOREIGN_SERVER *server) int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options) { - int error= 0; + int error; TABLE_LIST tables; TABLE *table; @@ -618,28 +566,33 @@ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options) tables.db= (char*) "mysql"; tables.alias= tables.table_name= (char*) "servers"; - /* need to open before acquiring THR_LOCK_plugin or it will deadlock */ - if (! (table= open_ltable(thd, &tables, TL_WRITE))) - DBUG_RETURN(TRUE); - rw_wrlock(&THR_LOCK_servers); - VOID(pthread_mutex_lock(&servers_cache_mutex)); - - - if ((error= delete_server_record(table, - server_options->server_name, - server_options->server_name_length))) - goto end; - + /* hit the memory hit first */ if ((error= delete_server_record_in_cache(server_options))) goto end; + if (! (table= open_ltable(thd, &tables, TL_WRITE))) + { + error= my_errno; + goto end; + } + + error= delete_server_record(table, + server_options->server_name, + server_options->server_name_length); + + /* + Perform a reload so we don't have a 'hole' in our mem_root + */ + servers_load(thd, &tables); + end: - VOID(pthread_mutex_unlock(&servers_cache_mutex)); rw_unlock(&THR_LOCK_servers); DBUG_RETURN(error); } + + /* SYNOPSIS @@ -658,10 +611,10 @@ end: */ -int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) +static int +delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) { - - int error= 0; + int error= ER_FOREIGN_SERVER_DOESNT_EXIST; FOREIGN_SERVER *server; DBUG_ENTER("delete_server_record_in_cache"); @@ -677,7 +630,7 @@ int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) DBUG_PRINT("info", ("server_name %s length %d not found!", server_options->server_name, server_options->server_name_length)); - // what should be done if not found in the cache? + goto end; } /* We succeded in deletion of the server to the table, now delete @@ -687,14 +640,15 @@ int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) server->server_name, server->server_name_length)); - if (server) - VOID(hash_delete(&servers_cache, (byte*) server)); - - servers_version++; /* servers updated */ + VOID(hash_delete(&servers_cache, (byte*) server)); + + error= 0; +end: DBUG_RETURN(error); } + /* SYNOPSIS @@ -714,6 +668,8 @@ int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) table for the particular server via the call to update_server_record, and in the servers_cache via update_server_record_in_cache. + THR_LOCK_servers must be write locked. + RETURN VALUE 0 - no error >0 - error code @@ -722,7 +678,7 @@ int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) int update_server(THD *thd, FOREIGN_SERVER *existing, FOREIGN_SERVER *altered) { - int error= 0; + int error; TABLE *table; TABLE_LIST tables; DBUG_ENTER("update_server"); @@ -732,19 +688,26 @@ int update_server(THD *thd, FOREIGN_SERVER *existing, FOREIGN_SERVER *altered) tables.alias= tables.table_name= (char*)"servers"; if (!(table= open_ltable(thd, &tables, TL_WRITE))) - DBUG_RETURN(1); + { + error= my_errno; + goto end; + } - rw_wrlock(&THR_LOCK_servers); if ((error= update_server_record(table, altered))) goto end; - update_server_record_in_cache(existing, altered); + error= update_server_record_in_cache(existing, altered); + + /* + Perform a reload so we don't have a 'hole' in our mem_root + */ + servers_load(thd, &tables); end: - rw_unlock(&THR_LOCK_servers); DBUG_RETURN(error); } + /* SYNOPSIS @@ -761,6 +724,8 @@ end: HASH, then the updated record inserted, in essence replacing the old record. + THR_LOCK_servers must be write locked. + RETURN VALUE 0 - no error 1 - error @@ -791,13 +756,13 @@ int update_server_record_in_cache(FOREIGN_SERVER *existing, { DBUG_PRINT("info", ("had a problem inserting server %s at %lx", altered->server_name, (long unsigned int) altered)); - error= 1; + error= ER_OUT_OF_RESOURCES; } - servers_version++; /* servers updated */ DBUG_RETURN(error); } + /* SYNOPSIS @@ -830,9 +795,9 @@ void merge_server_struct(FOREIGN_SERVER *from, FOREIGN_SERVER *to) to->password= strdup_root(&mem, from->password); if (to->port == -1) to->port= from->port; - if (!to->socket) + if (!to->socket && from->socket) to->socket= strdup_root(&mem, from->socket); - if (!to->scheme) + if (!to->scheme && from->scheme) to->scheme= strdup_root(&mem, from->scheme); if (!to->owner) to->owner= strdup_root(&mem, from->owner); @@ -840,6 +805,7 @@ void merge_server_struct(FOREIGN_SERVER *from, FOREIGN_SERVER *to) DBUG_VOID_RETURN; } + /* SYNOPSIS @@ -862,7 +828,9 @@ void merge_server_struct(FOREIGN_SERVER *from, FOREIGN_SERVER *to) */ -int update_server_record(TABLE *table, FOREIGN_SERVER *server) + +static int +update_server_record(TABLE *table, FOREIGN_SERVER *server) { int error=0; DBUG_ENTER("update_server_record"); @@ -878,10 +846,7 @@ int update_server_record(TABLE *table, FOREIGN_SERVER *server) HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) - { table->file->print_error(error, MYF(0)); - error= 1; - } DBUG_PRINT("info",("server not found!")); error= ER_FOREIGN_SERVER_DOESNT_EXIST; } @@ -901,6 +866,7 @@ end: DBUG_RETURN(error); } + /* SYNOPSIS @@ -916,11 +882,11 @@ end: */ -int delete_server_record(TABLE *table, - char *server_name, - int server_name_length) +static int +delete_server_record(TABLE *table, + char *server_name, int server_name_length) { - int error= 0; + int error; DBUG_ENTER("delete_server_record"); table->use_all_columns(); @@ -933,10 +899,7 @@ int delete_server_record(TABLE *table, HA_READ_KEY_EXACT))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) - { table->file->print_error(error, MYF(0)); - error= 1; - } DBUG_PRINT("info",("server not found!")); error= ER_FOREIGN_SERVER_DOESNT_EXIST; } @@ -965,28 +928,35 @@ int delete_server_record(TABLE *table, int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options) { - int error; + int error= ER_FOREIGN_SERVER_EXISTS; FOREIGN_SERVER *server; DBUG_ENTER("create_server"); DBUG_PRINT("info", ("server_options->server_name %s", server_options->server_name)); + rw_wrlock(&THR_LOCK_servers); + + /* hit the memory first */ + if (hash_search(&servers_cache, (byte*) server_options->server_name, + server_options->server_name_length)) + goto end; + server= (FOREIGN_SERVER *)alloc_root(&mem, sizeof(FOREIGN_SERVER)); - if ((error= prepare_server_struct_for_insert(server_options, server))) - goto end; + prepare_server_struct_for_insert(server_options, server); - if ((error= insert_server(thd, server))) - goto end; + error= insert_server(thd, server); DBUG_PRINT("info", ("error returned %d", error)); end: + rw_unlock(&THR_LOCK_servers); DBUG_RETURN(error); } + /* SYNOPSIS @@ -1003,37 +973,33 @@ end: int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options) { - int error= 0; + int error= ER_FOREIGN_SERVER_DOESNT_EXIST; FOREIGN_SERVER *altered, *existing; DBUG_ENTER("alter_server"); DBUG_PRINT("info", ("server_options->server_name %s", server_options->server_name)); - altered= (FOREIGN_SERVER *)alloc_root(&mem, - sizeof(FOREIGN_SERVER)); - - VOID(pthread_mutex_lock(&servers_cache_mutex)); + rw_wrlock(&THR_LOCK_servers); if (!(existing= (FOREIGN_SERVER *) hash_search(&servers_cache, (byte*) server_options->server_name, server_options->server_name_length))) - { - error= ER_FOREIGN_SERVER_DOESNT_EXIST; - goto end; - } - - if ((error= prepare_server_struct_for_update(server_options, existing, altered))) goto end; - if ((error= update_server(thd, existing, altered))) - goto end; + altered= (FOREIGN_SERVER *)alloc_root(&mem, + sizeof(FOREIGN_SERVER)); + + prepare_server_struct_for_update(server_options, existing, altered); + + error= update_server(thd, existing, altered); end: DBUG_PRINT("info", ("error returned %d", error)); - VOID(pthread_mutex_unlock(&servers_cache_mutex)); + rw_unlock(&THR_LOCK_servers); DBUG_RETURN(error); } + /* SYNOPSIS @@ -1044,19 +1010,17 @@ end: NOTES RETURN VALUE - 0 - no error + none */ -int prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options, - FOREIGN_SERVER *server) +static void +prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options, + FOREIGN_SERVER *server) { - int error; char *unset_ptr= (char*)""; DBUG_ENTER("prepare_server_struct"); - error= 0; - /* these two MUST be set */ server->server_name= strdup_root(&mem, server_options->server_name); server->server_name_length= server_options->server_name_length; @@ -1086,7 +1050,7 @@ int prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options, server->owner= server_options->owner ? strdup_root(&mem, server_options->owner) : unset_ptr; - DBUG_RETURN(error); + DBUG_VOID_RETURN; } /* @@ -1102,13 +1066,12 @@ int prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options, */ -int prepare_server_struct_for_update(LEX_SERVER_OPTIONS *server_options, - FOREIGN_SERVER *existing, - FOREIGN_SERVER *altered) +static void +prepare_server_struct_for_update(LEX_SERVER_OPTIONS *server_options, + FOREIGN_SERVER *existing, + FOREIGN_SERVER *altered) { - int error; DBUG_ENTER("prepare_server_struct_for_update"); - error= 0; altered->server_name= strdup_root(&mem, server_options->server_name); altered->server_name_length= server_options->server_name_length; @@ -1159,7 +1122,7 @@ int prepare_server_struct_for_update(LEX_SERVER_OPTIONS *server_options, (strcmp(server_options->owner, existing->owner))) ? strdup_root(&mem, server_options->owner) : 0; - DBUG_RETURN(error); + DBUG_VOID_RETURN; } /* @@ -1178,17 +1141,15 @@ int prepare_server_struct_for_update(LEX_SERVER_OPTIONS *server_options, void servers_free(bool end) { DBUG_ENTER("servers_free"); - if (!servers_cache_initialised) + if (!hash_inited(&servers_cache)) DBUG_VOID_RETURN; - VOID(pthread_mutex_destroy(&servers_cache_mutex)); - servers_cache_initialised=0; + rwlock_destroy(&THR_LOCK_servers); free_root(&mem,MYF(0)); hash_free(&servers_cache); DBUG_VOID_RETURN; } - /* SYNOPSIS @@ -1220,7 +1181,7 @@ FOREIGN_SERVER *get_server_by_name(const char *server_name) } DBUG_PRINT("info", ("locking servers_cache")); - VOID(pthread_mutex_lock(&servers_cache_mutex)); + rw_rdlock(&THR_LOCK_servers); if (!(server= (FOREIGN_SERVER *) hash_search(&servers_cache, (byte*) server_name, server_name_length))) @@ -1230,7 +1191,7 @@ FOREIGN_SERVER *get_server_by_name(const char *server_name) server= (FOREIGN_SERVER *) NULL; } DBUG_PRINT("info", ("unlocking servers_cache")); - VOID(pthread_mutex_unlock(&servers_cache_mutex)); + rw_unlock(&THR_LOCK_servers); DBUG_RETURN(server); } diff --git a/sql/sql_servers.h b/sql/sql_servers.h index 23b8cefd5bb..9618374dcab 100644 --- a/sql/sql_servers.h +++ b/sql/sql_servers.h @@ -25,40 +25,18 @@ typedef struct st_federated_server } FOREIGN_SERVER; /* cache handlers */ -my_bool servers_init(bool dont_read_server_table); -my_bool servers_reload(THD *thd); -my_bool get_server_from_table_to_cache(TABLE *table); +bool servers_init(bool dont_read_server_table); +bool servers_reload(THD *thd); void servers_free(bool end=0); /* insert functions */ int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options); -int insert_server(THD *thd, FOREIGN_SERVER *server_options); -int insert_server_record(TABLE *table, FOREIGN_SERVER *server); -int insert_server_record_into_cache(FOREIGN_SERVER *server); -void store_server_fields_for_insert(TABLE *table, FOREIGN_SERVER *server); -void store_server_fields_for_insert(TABLE *table, - FOREIGN_SERVER *existing, - FOREIGN_SERVER *altered); -int prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options, - FOREIGN_SERVER *server); /* drop functions */ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options); -int delete_server_record(TABLE *table, - char *server_name, - int server_name_length); -int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options); /* update functions */ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options); -int prepare_server_struct_for_update(LEX_SERVER_OPTIONS *server_options, - FOREIGN_SERVER *existing, - FOREIGN_SERVER *altered); -int update_server(THD *thd, FOREIGN_SERVER *existing, FOREIGN_SERVER *altered); -int update_server_record(TABLE *table, FOREIGN_SERVER *server); -int update_server_record_in_cache(FOREIGN_SERVER *existing, - FOREIGN_SERVER *altered); -/* utility functions */ -void merge_server_struct(FOREIGN_SERVER *from, FOREIGN_SERVER *to); + +/* lookup functions */ FOREIGN_SERVER *get_server_by_name(const char *server_name); -my_bool server_exists_in_table(THD *thd, char *server_name); From 89f5507389b53a662e3157b40d25683804b3a4d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Mar 2007 18:51:56 -0700 Subject: [PATCH 350/789] Added delayed open of file descriptors to cut down on issues surrounding large collections of partitions being open by many threads. storage/archive/azlib.h: Adjusted the buffer down to something reasonable :) storage/archive/ha_archive.cc: Upgraded file descriptors to not be opened until needed. storage/archive/ha_archive.h: New methods for delayed open --- storage/archive/azlib.h | 2 +- storage/archive/ha_archive.cc | 44 +++++++++++++++++++++++++---------- storage/archive/ha_archive.h | 2 ++ 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h index 663b746ec52..a5bee1befae 100644 --- a/storage/archive/azlib.h +++ b/storage/archive/azlib.h @@ -196,7 +196,7 @@ extern "C" { /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ -#define AZ_BUFSIZE_READ 524288 +#define AZ_BUFSIZE_READ 32768 #define AZ_BUFSIZE_WRITE 16384 diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index bb638e1c17b..307f6665c10 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -210,7 +210,8 @@ ha_archive::ha_archive(handlerton *hton, TABLE_SHARE *table_arg) buffer.set((char *)byte_buffer, IO_SIZE, system_charset_info); /* The size of the offset value we will use for position() */ - ref_length = sizeof(my_off_t); + ref_length= sizeof(my_off_t); + archive_reader_open= FALSE; } int archive_discover(handlerton *hton, THD* thd, const char *db, @@ -434,6 +435,29 @@ int ha_archive::init_archive_writer() } +int ha_archive::init_archive_reader() +{ + DBUG_ENTER("ha_archive::init_archive_reader"); + /* + It is expensive to open and close the data files and since you can't have + a gzip file that can be both read and written we keep a writer open + that is shared amoung all open tables. + */ + if (!archive_reader_open) + { + if (!(azopen(&archive, share->data_file_name, O_RDONLY|O_BINARY))) + { + DBUG_PRINT("ha_archive", ("Could not open archive read file")); + share->crashed= TRUE; + DBUG_RETURN(1); + } + archive_reader_open= TRUE; + } + + DBUG_RETURN(0); +} + + /* We just implement one additional file extension. */ @@ -477,7 +501,6 @@ int ha_archive::open(const char *name, int mode, uint open_options) DBUG_ASSERT(share); - record_buffer= create_record_buffer(table->s->reclength + ARCHIVE_ROW_HEADER_SIZE); @@ -489,14 +512,6 @@ int ha_archive::open(const char *name, int mode, uint open_options) thr_lock_data_init(&share->lock, &lock, NULL); - DBUG_PRINT("ha_archive", ("archive data_file_name %s", share->data_file_name)); - if (!(azopen(&archive, share->data_file_name, O_RDONLY|O_BINARY))) - { - if (errno == EROFS || errno == EACCES) - DBUG_RETURN(my_errno= errno); - DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); - } - DBUG_PRINT("ha_archive", ("archive table was crashed %s", rc == HA_ERR_CRASHED_ON_USAGE ? "yes" : "no")); if (rc == HA_ERR_CRASHED_ON_USAGE && open_options & HA_OPEN_FOR_REPAIR) @@ -533,8 +548,11 @@ int ha_archive::close(void) destroy_record_buffer(record_buffer); /* First close stream */ - if (azclose(&archive)) - rc= 1; + if (archive_reader_open) + { + if (azclose(&archive)) + rc= 1; + } /* then also close share */ rc|= free_share(); @@ -979,6 +997,8 @@ int ha_archive::rnd_init(bool scan) if (share->crashed) DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); + init_archive_reader(); + /* We rewind the file so that we can read from the beginning if scan */ if (scan) { diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index 8f56e8ce060..8fc54f6715f 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -71,6 +71,7 @@ class ha_archive: public handler uint current_key_len; uint current_k_offset; archive_record_buffer *record_buffer; + bool archive_reader_open; archive_record_buffer *create_record_buffer(unsigned int length); void destroy_record_buffer(archive_record_buffer *r); @@ -119,6 +120,7 @@ public: ARCHIVE_SHARE *get_share(const char *table_name, int *rc); int free_share(); int init_archive_writer(); + int init_archive_reader(); bool auto_repair() const { return 1; } // For the moment we just do this int read_data_header(azio_stream *file_to_read); void position(const byte *record); From 99c5c28c3cc9eb417f4ca12f606c5abcf6b02a19 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Mar 2007 01:18:19 -0700 Subject: [PATCH 351/789] BUG#26257 New Federated Server Functionality Doesn't support differently named tables * Modified Federated memory allocation to use MEM_ROOT * Modified sql_servers and federated to allocate share connection parameters to use MEM_ROOT * Modified Federated to allow tablename in addition to server name * Implicit flushing of tables using altered/dropped server name * Added tests to prove new functionality works Contributors to this patch: Patrick Galbraith, Antony Curtis mysql-test/r/federated_server.result: BUG #26257 New Federated Server Functionality Doesn't support differently named tables New test results mysql-test/t/federated_server.test: BUG #26257 New Federated Server Functionality Doesn't support differently named tables New test which ensures that one can use the new 'create server' functionality and have tables point to the correct table, using CONNECTION='server', CONNECTION="server/tablename" and CONNECTION="mysql://...url" sql/mysql_priv.h: BUG #26257 New Federated Server Functionality Doesn't support differently named tables new function: close_cached_connection_tables() sql/sql_base.cc: BUG #26257 New Federated Server Functionality Doesn't support differently named tables new function: close_cached_connection_tables() closes all open tables which match connection string provides functionality to allow flushing of altered/dropped server names. sql/sql_servers.cc: BUG #26257 New Federated Server Functionality Doesn't support differently named tables * Added function clone_server() to allocate a new server for use by get_server_by_name() when creating a federated table * Now using MEM_ROOT allocation (mark and sweep) to account for meta data parameters being allocated properly, particularly with regards to to SERVER object. Also cleans up code allocating share. * Tables using the old definition of server name are now flushed on successful execution of ALTER/DROP SERVER. style: fixed some line-wrapping sql/sql_servers.h: BUG #26257 New Federated Server Functionality Doesn't support differently named tables * change in prototype to get_server_by_name() caller can now provide mem_root which strings will be copied in to. storage/federated/ha_federated.cc: BUG #26257 New Federated Server Functionality Doesn't support differently named tables * Simplified share and share member memory allocaton to use MEM_ROOT * Modified parse_url to parse table names along with server names storage/federated/ha_federated.h: BUG #26257 New Federated Server Functionality Doesn't support differently named tables * Added MEM_ROOT share member --- mysql-test/r/federated_server.result | 85 +++++++-- mysql-test/t/federated_server.test | 62 ++++++- sql/mysql_priv.h | 3 + sql/sql_base.cc | 66 +++++++ sql/sql_servers.cc | 110 ++++++++++-- sql/sql_servers.h | 3 +- storage/federated/ha_federated.cc | 258 ++++++++++++++++----------- storage/federated/ha_federated.h | 3 + 8 files changed, 458 insertions(+), 132 deletions(-) diff --git a/mysql-test/r/federated_server.result b/mysql-test/r/federated_server.result index 8faf33581d1..a3e7cd793a6 100644 --- a/mysql-test/r/federated_server.result +++ b/mysql-test/r/federated_server.result @@ -20,6 +20,14 @@ CREATE TABLE first_db.t1 ( `name` varchar(64) NOT NULL default '' ) DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS first_db.t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE first_db.t2 ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ) +DEFAULT CHARSET=latin1; use second_db; DROP TABLE IF EXISTS second_db.t1; Warnings: @@ -29,6 +37,14 @@ CREATE TABLE second_db.t1 ( `name` varchar(64) NOT NULL default '' ) DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS second_db.t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE second_db.t2 ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ) +DEFAULT CHARSET=latin1; drop server if exists 'server_one'; create server 'server_one' foreign data wrapper 'mysql' options (HOST '127.0.0.1', @@ -60,10 +76,10 @@ CREATE TABLE federated.old ( ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/first_db/t1'; -INSERT INTO federated.old (id, name) values (1, 'federated.old url'); +INSERT INTO federated.old (id, name) values (1, 'federated.old-> first_db.t1, url format'); SELECT * FROM federated.old; id name -1 federated.old url +1 federated.old-> first_db.t1, url format DROP TABLE IF EXISTS federated.old2; Warnings: Note 1051 Unknown table 'old2' @@ -72,8 +88,37 @@ CREATE TABLE federated.old2 ( `name` varchar(64) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/first_db/t2'; +INSERT INTO federated.old2 (id, name) values (1, 'federated.old2-> first_db.t2, url format'); +SELECT * FROM federated.old2; +id name +1 federated.old2-> first_db.t2, url format +DROP TABLE IF EXISTS federated.urldb2t1; +Warnings: +Note 1051 Unknown table 'urldb2t1' +CREATE TABLE federated.urldb2t1 ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ) +ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/second_db/t1'; -INSERT INTO federated.old2 (id, name) values (1, 'federated.old2 url'); +INSERT INTO federated.urldb2t1 (id, name) values (1, 'federated.urldb2t1 -> second_db.t1, url format'); +SELECT * FROM federated.urldb2t1; +id name +1 federated.urldb2t1 -> second_db.t1, url format +DROP TABLE IF EXISTS federated.urldb2t2; +Warnings: +Note 1051 Unknown table 'urldb2t2' +CREATE TABLE federated.urldb2t2 ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ) +ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/second_db/t2'; +INSERT INTO federated.urldb2t2 (id, name) values (1, 'federated.urldb2t2 -> second_db.t2, url format'); +SELECT * FROM federated.urldb2t2; +id name +1 federated.urldb2t2 -> second_db.t2, url format DROP TABLE IF EXISTS federated.t1; Warnings: Note 1051 Unknown table 't1' @@ -83,18 +128,38 @@ CREATE TABLE federated.t1 ( ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='server_one'; -INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme'); +INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme, first_db.t1'); SELECT * FROM federated.t1; id name -1 federated.old url -1 server_one, new scheme +1 federated.old-> first_db.t1, url format +1 server_one, new scheme, first_db.t1 +DROP TABLE IF EXISTS federated.whatever; +Warnings: +Note 1051 Unknown table 'whatever' +CREATE TABLE federated.whatever ( +`id` int(20) NOT NULL, +`name` varchar(64) NOT NULL default '' + ) +ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='server_one/t1'; +INSERT INTO federated.whatever (id, name) values (1, 'server_one, new scheme, whatever, first_db.t1'); +SELECT * FROM federated.whatever; +id name +1 federated.old-> first_db.t1, url format +1 server_one, new scheme, first_db.t1 +1 server_one, new scheme, whatever, first_db.t1 ALTER SERVER 'server_one' options(DATABASE 'second_db'); -flush tables; -INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme'); +INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme, second_db.t1'); SELECT * FROM federated.t1; id name -1 federated.old2 url -1 server_two, new scheme +1 federated.urldb2t1 -> second_db.t1, url format +1 server_two, new scheme, second_db.t1 +INSERT INTO federated.whatever (id, name) values (1, 'server_two, new scheme, whatever, second_db.t1'); +SELECT * FROM federated.whatever; +id name +1 federated.urldb2t1 -> second_db.t1, url format +1 server_two, new scheme, second_db.t1 +1 server_two, new scheme, whatever, second_db.t1 drop table federated.t1; drop server 'server_one'; drop server 'server_two'; diff --git a/mysql-test/t/federated_server.test b/mysql-test/t/federated_server.test index 27dd494e5c5..b2075b8e262 100644 --- a/mysql-test/t/federated_server.test +++ b/mysql-test/t/federated_server.test @@ -17,6 +17,13 @@ CREATE TABLE first_db.t1 ( ) DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS first_db.t2; +CREATE TABLE first_db.t2 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) + DEFAULT CHARSET=latin1; + use second_db; DROP TABLE IF EXISTS second_db.t1; CREATE TABLE second_db.t1 ( @@ -25,6 +32,13 @@ CREATE TABLE second_db.t1 ( ) DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS second_db.t2; +CREATE TABLE second_db.t2 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) + DEFAULT CHARSET=latin1; + connection master; drop server if exists 'server_one'; @@ -61,7 +75,7 @@ eval CREATE TABLE federated.old ( ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/first_db/t1'; -INSERT INTO federated.old (id, name) values (1, 'federated.old url'); +INSERT INTO federated.old (id, name) values (1, 'federated.old-> first_db.t1, url format'); SELECT * FROM federated.old; @@ -72,9 +86,32 @@ eval CREATE TABLE federated.old2 ( `name` varchar(64) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t1'; + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/first_db/t2'; -INSERT INTO federated.old2 (id, name) values (1, 'federated.old2 url'); +INSERT INTO federated.old2 (id, name) values (1, 'federated.old2-> first_db.t2, url format'); +SELECT * FROM federated.old2; + +DROP TABLE IF EXISTS federated.urldb2t1; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.urldb2t1 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) + ENGINE="FEDERATED" DEFAULT CHARSET=latin1 + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t1'; +INSERT INTO federated.urldb2t1 (id, name) values (1, 'federated.urldb2t1 -> second_db.t1, url format'); +SELECT * FROM federated.urldb2t1; + +DROP TABLE IF EXISTS federated.urldb2t2; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.urldb2t2 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) + ENGINE="FEDERATED" DEFAULT CHARSET=latin1 + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t2'; +INSERT INTO federated.urldb2t2 (id, name) values (1, 'federated.urldb2t2 -> second_db.t2, url format'); +SELECT * FROM federated.urldb2t2; DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( @@ -84,17 +121,30 @@ CREATE TABLE federated.t1 ( ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='server_one'; -INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme'); +INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme, first_db.t1'); SELECT * FROM federated.t1; +DROP TABLE IF EXISTS federated.whatever; +CREATE TABLE federated.whatever ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) + ENGINE="FEDERATED" DEFAULT CHARSET=latin1 + CONNECTION='server_one/t1'; +INSERT INTO federated.whatever (id, name) values (1, 'server_one, new scheme, whatever, first_db.t1'); +SELECT * FROM federated.whatever; + ALTER SERVER 'server_one' options(DATABASE 'second_db'); -flush tables; +# FLUSH TABLES is now unneccessary -INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme'); +INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme, second_db.t1'); SELECT * FROM federated.t1; +INSERT INTO federated.whatever (id, name) values (1, 'server_two, new scheme, whatever, second_db.t1'); +SELECT * FROM federated.whatever; + drop table federated.t1; drop server 'server_one'; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index efcbdf968bf..2b1b310e67e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1430,6 +1430,9 @@ void close_open_tables_and_downgrade(ALTER_PARTITION_PARAM_TYPE *lpt); void mysql_wait_completed_table(ALTER_PARTITION_PARAM_TYPE *lpt, TABLE *my_table); bool close_cached_tables(THD *thd, bool wait_for_refresh, TABLE_LIST *tables, bool have_lock = FALSE); +bool close_cached_connection_tables(THD *thd, bool wait_for_refresh, + LEX_STRING *connect_string, + bool have_lock = FALSE); void copy_field_from_tmp_record(Field *field,int offset); bool fill_record(THD *thd, Field **field, List &values, bool ignore_errors); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e764c498059..44becc77865 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -858,6 +858,7 @@ void free_io_cache(TABLE *table) DBUG_VOID_RETURN; } + /* Close all tables which aren't in use by any thread @@ -969,6 +970,71 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, } +/* + Close all tables which match specified connection string or + if specified string is NULL, then any table with a connection string. +*/ + +bool close_cached_connection_tables(THD *thd, bool if_wait_for_refresh, + LEX_STRING *connection, bool have_lock) +{ + uint idx; + TABLE_LIST tmp, *tables= NULL; + bool result= FALSE; + DBUG_ENTER("close_cached_connections"); + DBUG_ASSERT(thd); + + bzero(&tmp, sizeof(TABLE_LIST)); + + if (!have_lock) + VOID(pthread_mutex_lock(&LOCK_open)); + + for (idx= 0; idx < table_def_cache.records; idx++) + { + TABLE_SHARE *share= (TABLE_SHARE *) hash_element(&table_def_cache, idx); + + /* Ignore if table is not open or does not have a connect_string */ + if (!share->connect_string.length || !share->ref_count) + continue; + + /* Compare the connection string */ + if (connection && + (connection->length > share->connect_string.length || + (connection->length < share->connect_string.length && + (share->connect_string.str[connection->length] != '/' && + share->connect_string.str[connection->length] != '\\')) || + strncasecmp(connection->str, share->connect_string.str, + connection->length))) + continue; + + /* close_cached_tables() only uses these elements */ + tmp.db= share->db.str; + tmp.table_name= share->table_name.str; + tmp.next_local= tables; + + tables= (TABLE_LIST *) memdup_root(thd->mem_root, (char*)&tmp, + sizeof(TABLE_LIST)); + } + + if (tables) + result= close_cached_tables(thd, FALSE, tables, TRUE); + + if (!have_lock) + VOID(pthread_mutex_unlock(&LOCK_open)); + + if (if_wait_for_refresh) + { + pthread_mutex_lock(&thd->mysys_var->mutex); + thd->mysys_var->current_mutex= 0; + thd->mysys_var->current_cond= 0; + thd->proc_info=0; + pthread_mutex_unlock(&thd->mysys_var->mutex); + } + + DBUG_RETURN(result); +} + + /* Mark all tables in the list which were used by current substatement as free for reuse. diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 9b01a1b6889..71e141b0514 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -16,6 +16,21 @@ /* The servers are saved in the system table "servers" + + Currently, when the user performs an ALTER SERVER or a DROP SERVER + operation, it will cause all open tables which refer to the named + server connection to be flushed. This may cause some undesirable + behaviour with regard to currently running transactions. It is + expected that the DBA knows what s/he is doing when s/he performs + the ALTER SERVER or DROP SERVER operation. + + TODO: + It is desirable for us to implement a callback mechanism instead where + callbacks can be registered for specific server protocols. The callback + will be fired when such a server name has been created/altered/dropped + or when statistics are to be gathered such as how many actual connections. + Storage engines etc will be able to make use of the callback so that + currently running transactions etc will not be disrupted. */ #include "mysql_priv.h" @@ -557,6 +572,8 @@ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options) int error; TABLE_LIST tables; TABLE *table; + LEX_STRING name= { server_options->server_name, + server_options->server_name_length }; DBUG_ENTER("drop_server"); DBUG_PRINT("info", ("server name server->server_name %s", @@ -578,14 +595,16 @@ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options) goto end; } - error= delete_server_record(table, - server_options->server_name, - server_options->server_name_length); + error= delete_server_record(table, name.str, name.length); - /* - Perform a reload so we don't have a 'hole' in our mem_root - */ - servers_load(thd, &tables); + /* close the servers table before we call closed_cached_connection_tables */ + close_thread_tables(thd); + + if (close_cached_connection_tables(thd, TRUE, &name)) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_UNKNOWN_ERROR, "Server connection in use"); + } end: rw_unlock(&THR_LOCK_servers); @@ -975,6 +994,8 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options) { int error= ER_FOREIGN_SERVER_DOESNT_EXIST; FOREIGN_SERVER *altered, *existing; + LEX_STRING name= { server_options->server_name, + server_options->server_name_length }; DBUG_ENTER("alter_server"); DBUG_PRINT("info", ("server_options->server_name %s", server_options->server_name)); @@ -982,8 +1003,8 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options) rw_wrlock(&THR_LOCK_servers); if (!(existing= (FOREIGN_SERVER *) hash_search(&servers_cache, - (byte*) server_options->server_name, - server_options->server_name_length))) + (byte*) name.str, + name.length))) goto end; altered= (FOREIGN_SERVER *)alloc_root(&mem, @@ -993,6 +1014,15 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options) error= update_server(thd, existing, altered); + /* close the servers table before we call closed_cached_connection_tables */ + close_thread_tables(thd); + + if (close_cached_connection_tables(thd, FALSE, &name)) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_UNKNOWN_ERROR, "Server connection in use"); + } + end: DBUG_PRINT("info", ("error returned %d", error)); rw_unlock(&THR_LOCK_servers); @@ -1143,6 +1173,12 @@ void servers_free(bool end) DBUG_ENTER("servers_free"); if (!hash_inited(&servers_cache)) DBUG_VOID_RETURN; + if (!end) + { + free_root(&mem, MYF(MY_MARK_BLOCKS_FREE)); + my_hash_reset(&servers_cache); + DBUG_VOID_RETURN; + } rwlock_destroy(&THR_LOCK_servers); free_root(&mem,MYF(0)); hash_free(&servers_cache); @@ -1150,6 +1186,51 @@ void servers_free(bool end) } +/* + SYNOPSIS + + clone_server(MEM_ROOT *mem_root, FOREIGN_SERVER *orig, FOREIGN_SERVER *buff) + + Create a clone of FOREIGN_SERVER. If the supplied mem_root is of + thd->mem_root then the copy is automatically disposed at end of statement. + + NOTES + + ARGS + MEM_ROOT pointer (strings are copied into this mem root) + FOREIGN_SERVER pointer (made a copy of) + FOREIGN_SERVER buffer (if not-NULL, this pointer is returned) + + RETURN VALUE + FOREIGN_SEVER pointer (copy of one supplied FOREIGN_SERVER) +*/ + +static FOREIGN_SERVER *clone_server(MEM_ROOT *mem, const FOREIGN_SERVER *server, + FOREIGN_SERVER *buffer) +{ + DBUG_ENTER("sql_server.cc:clone_server"); + + if (!buffer) + buffer= (FOREIGN_SERVER *) alloc_root(mem, sizeof(FOREIGN_SERVER)); + + buffer->server_name= strmake_root(mem, server->server_name, + server->server_name_length); + buffer->port= server->port; + buffer->server_name_length= server->server_name_length; + + /* TODO: We need to examine which of these can really be NULL */ + buffer->db= server->db ? strdup_root(mem, server->db) : NULL; + buffer->scheme= server->scheme ? strdup_root(mem, server->scheme) : NULL; + buffer->username= server->username? strdup_root(mem, server->username): NULL; + buffer->password= server->password? strdup_root(mem, server->password): NULL; + buffer->socket= server->socket ? strdup_root(mem, server->socket) : NULL; + buffer->owner= server->owner ? strdup_root(mem, server->owner) : NULL; + buffer->host= server->host ? strdup_root(mem, server->host) : NULL; + + DBUG_RETURN(buffer); +} + + /* SYNOPSIS @@ -1163,11 +1244,11 @@ void servers_free(bool end) */ -FOREIGN_SERVER *get_server_by_name(const char *server_name) +FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name, + FOREIGN_SERVER *buff) { - ulong error_num=0; uint server_name_length; - FOREIGN_SERVER *server= 0; + FOREIGN_SERVER *server; DBUG_ENTER("get_server_by_name"); DBUG_PRINT("info", ("server_name %s", server_name)); @@ -1176,7 +1257,6 @@ FOREIGN_SERVER *get_server_by_name(const char *server_name) if (! server_name || !strlen(server_name)) { DBUG_PRINT("info", ("server_name not defined!")); - error_num= 1; DBUG_RETURN((FOREIGN_SERVER *)NULL); } @@ -1190,6 +1270,10 @@ FOREIGN_SERVER *get_server_by_name(const char *server_name) server_name, server_name_length)); server= (FOREIGN_SERVER *) NULL; } + /* otherwise, make copy of server */ + else + server= clone_server(mem, server, buff); + DBUG_PRINT("info", ("unlocking servers_cache")); rw_unlock(&THR_LOCK_servers); DBUG_RETURN(server); diff --git a/sql/sql_servers.h b/sql/sql_servers.h index 9618374dcab..63c691893d1 100644 --- a/sql/sql_servers.h +++ b/sql/sql_servers.h @@ -39,4 +39,5 @@ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options); int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options); /* lookup functions */ -FOREIGN_SERVER *get_server_by_name(const char *server_name); +FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name, + FOREIGN_SERVER *server_buffer); diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 14ffe5da984..e60dc47f48c 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -43,23 +43,55 @@ The create table will simply create the .frm file, and within the "CREATE TABLE" SQL, there SHALL be any of the following : - comment=scheme://username:password@hostname:port/database/tablename - comment=scheme://username@hostname/database/tablename - comment=scheme://username:password@hostname/database/tablename - comment=scheme://username:password@hostname/database/tablename + connection=scheme://username:password@hostname:port/database/tablename + connection=scheme://username@hostname/database/tablename + connection=scheme://username:password@hostname/database/tablename + connection=scheme://username:password@hostname/database/tablename + + - OR - + + As of 5.1 (See worklog #3031), federated now allows you to use a non-url + format, taking advantage of mysql.servers: + + connection="connection_one" + connection="connection_one/table_foo" An example would be: - comment=mysql://username:password@hostname:port/database/tablename + connection=mysql://username:password@hostname:port/database/tablename - ***IMPORTANT*** + or, if we had: - This is a first release, conceptual release - Only 'mysql://' is supported at this release. + create server 'server_one' foreign data wrapper 'mysql' options + (HOST '127.0.0.1', + DATABASE 'db1', + USER 'root', + PASSWORD '', + PORT 3306, + SOCKET '', + OWNER 'root'); + CREATE TABLE federated.t1 ( + `id` int(20) NOT NULL, + `name` varchar(64) NOT NULL default '' + ) + ENGINE="FEDERATED" DEFAULT CHARSET=latin1 + CONNECTION='server_one'; - This comment connection string is necessary for the handler to be - able to connect to the foreign server. + So, this will have been the equivalent of + + CONNECTION="mysql://root@127.0.0.1:3306/db1/t1" + + Then, we can also change the server to point to a new schema: + + ALTER SERVER 'server_one' options(DATABASE 'db2'); + + All subsequent calls will now be against db2.t1! Guess what? You don't + have to perform an alter table! + + This connecton="connection string" is necessary for the handler to be + able to connect to the foreign server, either by URL, or by server + name. The basic flow is this: @@ -166,7 +198,7 @@ KEY other_key (other)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - COMMENT='root@127.0.0.1:9306/federated/test_federated'; + CONNECTION='mysql://root@127.0.0.1:9306/federated/test_federated'; Notice the "COMMENT" and "ENGINE" field? This is where you respectively set the engine type, "FEDERATED" and foreign @@ -263,7 +295,7 @@ To run these tests, go into ./mysql-test (based in the directory you built the server in) - ./mysql-test-run federatedd + ./mysql-test-run federated To run the test, or if you want to run the test and have debug info: @@ -311,7 +343,7 @@ ------------- These were the files that were modified or created for this - Federated handler to work: + Federated handler to work, in 5.0: ./configure.in ./sql/Makefile.am @@ -329,6 +361,13 @@ ./sql/ha_federated.cc ./sql/ha_federated.h + In 5.1 + + my:~/mysql-build/mysql-5.1-bkbits patg$ ls storage/federated/ + CMakeLists.txt Makefile.in ha_federated.h plug.in + Makefile SCCS libfederated.a + Makefile.am ha_federated.cc libfederated_a-ha_federated.o + */ @@ -547,42 +586,39 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num) int buf_len; DBUG_ENTER("ha_federated parse_url_error"); - if (share->connection_string) - { - DBUG_PRINT("info", - ("error: parse_url. Returning error code %d \ - freeing share->connection_string %lx", - error_num, (long unsigned int) share->connection_string)); - my_free((gptr) share->connection_string, MYF(0)); - share->connection_string= 0; - } buf_len= min(table->s->connect_string.length, FEDERATED_QUERY_BUFFER_SIZE-1); strmake(buf, table->s->connect_string.str, buf_len); my_error(error_num, MYF(0), buf); DBUG_RETURN(error_num); } + /* retrieve server object which contains server meta-data from the system table given a server's name, set share connection parameter members */ -int get_connection(FEDERATED_SHARE *share) +int get_connection(MEM_ROOT *mem_root, FEDERATED_SHARE *share) { int error_num= ER_FOREIGN_SERVER_DOESNT_EXIST; char error_buffer[FEDERATED_QUERY_BUFFER_SIZE]; - FOREIGN_SERVER *server; + FOREIGN_SERVER *server, server_buffer; DBUG_ENTER("ha_federated::get_connection"); + /* + get_server_by_name() clones the server if exists and allocates + copies of strings in the supplied mem_root + */ if (!(server= - get_server_by_name(share->connection_string))) + get_server_by_name(mem_root, share->connection_string, &server_buffer))) { DBUG_PRINT("info", ("get_server_by_name returned > 0 error condition!")); /* need to come up with error handling */ error_num=1; goto error; } - DBUG_PRINT("info", ("get_server_by_name returned server at %lx", (long unsigned int) server)); + DBUG_PRINT("info", ("get_server_by_name returned server at %lx", + (long unsigned int) server)); /* Most of these should never be empty strings, error handling will @@ -591,29 +627,22 @@ int get_connection(FEDERATED_SHARE *share) except there are errors in the trace file of the share being overrun at the address of the share. */ - if (server->server_name) - share->server_name= server->server_name; - share->server_name_length= server->server_name_length ? - server->server_name_length : 0; - if (server->username) - share->username= server->username; - if (server->password) - share->password= server->password; - if (server->db) - share->database= server->db; - - share->port= server->port ? (ushort) server->port : MYSQL_PORT; - - if (server->host) - share->hostname= server->host; - if (server->socket) - share->socket= server->socket; - else if (strcmp(share->hostname, my_localhost) == 0) - share->socket= my_strdup(MYSQL_UNIX_ADDR, MYF(0)); - if (server->scheme) - share->scheme= server->scheme; - else - share->scheme= NULL; + share->server_name_length= server->server_name_length; + share->server_name= server->server_name; + share->username= server->username; + share->password= server->password; + share->database= server->db; +#ifndef I_AM_PARANOID + share->port= server->port > 0 && server->port < 65536 ? +#else + share->port= server->port > 1023 && server->port < 65536 ? +#endif + (ushort) server->port : MYSQL_PORT; + share->hostname= server->host; + if (!(share->socket= server->socket) && + !strcmp(share->hostname, my_localhost)) + share->socket= (char *) MYSQL_UNIX_ADDR; + share->scheme= server->scheme; DBUG_PRINT("info", ("share->username %s", share->username)); DBUG_PRINT("info", ("share->password %s", share->password)); @@ -636,6 +665,7 @@ error: SYNOPSIS parse_url() + mem_root MEM_ROOT pointer for memory allocation share pointer to FEDERATED share table pointer to current TABLE class table_create_flag determines what error to throw @@ -685,7 +715,7 @@ error: */ -static int parse_url(FEDERATED_SHARE *share, TABLE *table, +static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table, uint table_create_flag) { uint error_num= (table_create_flag ? @@ -699,20 +729,19 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, DBUG_PRINT("info", ("Length: %d", table->s->connect_string.length)); DBUG_PRINT("info", ("String: '%.*s'", table->s->connect_string.length, table->s->connect_string.str)); - share->connection_string= my_strndup(table->s->connect_string.str, - table->s->connect_string.length, - MYF(0)); + share->connection_string= strmake_root(mem_root, table->s->connect_string.str, + table->s->connect_string.length); - // Add a null for later termination of table name - share->connection_string[table->s->connect_string.length]= 0; DBUG_PRINT("info",("parse_url alloced share->connection_string %lx", (long unsigned int) share->connection_string)); DBUG_PRINT("info",("share->connection_string %s",share->connection_string)); - /* No delimiters, must be a straight connection name */ - if ( (!strchr(share->connection_string, '/')) && - (!strchr(share->connection_string, '@')) && - (!strchr(share->connection_string, ';'))) + /* + No :// or @ in connection string. Must be a straight connection name of + either "servername" or "servername/tablename" + */ + if ( (!strstr(share->connection_string, "://") && + (!strchr(share->connection_string, '@')))) { DBUG_PRINT("info", @@ -721,17 +750,51 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, share->connection_string, (long unsigned int) share->connection_string)); + /* ok, so we do a little parsing, but not completely! */ share->parsed= FALSE; - if ((error_num= get_connection(share))) - goto error; - /* - connection specifies everything but, resort to - expecting remote and foreign table names to match + If there is a single '/' in the connection string, this means the user is + specifying a table name */ - share->table_name= table->s->table_name.str; - share->table_name_length= table->s->table_name.length; - share->table_name[share->table_name_length]= '\0'; + + if ((share->table_name= strchr(share->connection_string, '/'))) + { + share->connection_string[share->table_name - share->connection_string]= '\0'; + share->table_name++; + share->table_name_length= strlen(share->table_name); + + DBUG_PRINT("info", + ("internal format, parsed table_name share->connection_string \ + %s share->table_name %s", + share->connection_string, share->table_name)); + + /* + there better not be any more '/'s ! + */ + if (strchr(share->table_name, '/')) + goto error; + + } + /* + otherwise, straight server name, use tablename of federated table + as remote table name + */ + else + { + /* + connection specifies everything but, resort to + expecting remote and foreign table names to match + */ + share->table_name= strmake_root(mem_root, table->s->table_name.str, + (share->table_name_length= table->s->table_name.length)); + DBUG_PRINT("info", + ("internal format, default table_name share->connection_string \ + %s share->table_name %s", + share->connection_string, share->table_name)); + } + + if ((error_num= get_connection(mem_root, share))) + goto error; } else { @@ -817,7 +880,7 @@ Then password is a null string, so set to NULL if (!share->port) { if (strcmp(share->hostname, my_localhost) == 0) - share->socket= my_strdup(MYSQL_UNIX_ADDR, MYF(0)); + share->socket= (char *) MYSQL_UNIX_ADDR; else share->port= MYSQL_PORT; } @@ -1421,22 +1484,26 @@ err: static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) { - char *select_query; char query_buffer[FEDERATED_QUERY_BUFFER_SIZE]; Field **field; String query(query_buffer, sizeof(query_buffer), &my_charset_bin); FEDERATED_SHARE *share= NULL, tmp_share; + MEM_ROOT mem_root; + DBUG_ENTER("ha_federated.cc::get_share"); + /* In order to use this string, we must first zero it's length, or it will contain garbage */ query.length(0); + init_alloc_root(&mem_root, 256, 0); + pthread_mutex_lock(&federated_mutex); tmp_share.share_key= table_name; tmp_share.share_key_length= strlen(table_name); - if (parse_url(&tmp_share, table, 0)) + if (parse_url(&mem_root, &tmp_share, table, 0)) goto error; /* TODO: change tmp_share.scheme to LEX_STRING object */ @@ -1457,24 +1524,17 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) query.length(query.length() - sizeof_trailing_comma); query.append(STRING_WITH_LEN(" FROM `")); + query.append(tmp_share.table_name, tmp_share.table_name_length); + query.append(STRING_WITH_LEN("`")); + DBUG_PRINT("info", ("calling alloc_root")); - if (!(share= (FEDERATED_SHARE *) - my_multi_malloc(MYF(MY_WME), - &share, sizeof(*share), - &select_query, - query.length()+table->s->connect_string.length+1, - NullS))) + if (!(share= (FEDERATED_SHARE *) memdup_root(&mem_root, (char*)&tmp_share, sizeof(*share))) || + !(share->select_query= (char*) strmake_root(&mem_root, query.ptr(), query.length()))) goto error; - memcpy(share, &tmp_share, sizeof(tmp_share)); - - share->table_name_length= strlen(share->table_name); - /* TODO: share->table_name to LEX_STRING object */ - query.append(share->table_name, share->table_name_length); - query.append(STRING_WITH_LEN("`")); - share->select_query= select_query; - strmov(share->select_query, query.ptr()); share->use_count= 0; + share->mem_root= mem_root; + DBUG_PRINT("info", ("share->select_query %s", share->select_query)); @@ -1483,17 +1543,18 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) thr_lock_init(&share->lock); pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST); } + else + free_root(&mem_root, MYF(0)); /* prevents memory leak */ + share->use_count++; pthread_mutex_unlock(&federated_mutex); - return share; + DBUG_RETURN(share); error: pthread_mutex_unlock(&federated_mutex); - my_free((gptr) tmp_share.connection_string, MYF(MY_ALLOW_ZERO_PTR)); - tmp_share.connection_string= 0; - my_free((gptr) share, MYF(MY_ALLOW_ZERO_PTR)); - return NULL; + free_root(&mem_root, MYF(0)); + DBUG_RETURN(NULL); } @@ -1505,23 +1566,16 @@ error: static int free_share(FEDERATED_SHARE *share) { + MEM_ROOT mem_root= share->mem_root; DBUG_ENTER("free_share"); pthread_mutex_lock(&federated_mutex); if (!--share->use_count) { hash_delete(&federated_open_tables, (byte*) share); - if (share->parsed) - my_free((gptr) share->socket, MYF(MY_ALLOW_ZERO_PTR)); - /*if (share->connection_string) - { - */ - my_free((gptr) share->connection_string, MYF(MY_ALLOW_ZERO_PTR)); - share->connection_string= 0; - /*}*/ thr_lock_delete(&share->lock); VOID(pthread_mutex_destroy(&share->mutex)); - my_free((gptr) share, MYF(0)); + free_root(&mem_root, MYF(0)); } pthread_mutex_unlock(&federated_mutex); @@ -1590,6 +1644,8 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked) mysql_options(mysql,MYSQL_SET_CHARSET_NAME, this->table->s->table_charset->csname); + DBUG_PRINT("info", ("calling mysql_real_connect hostname %s user %s", + share->hostname, share->username)); if (!mysql || !mysql_real_connect(mysql, share->hostname, share->username, @@ -2832,15 +2888,13 @@ int ha_federated::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info) { int retval; + THD *thd= current_thd; FEDERATED_SHARE tmp_share; // Only a temporary share, to test the url DBUG_ENTER("ha_federated::create"); - if (!(retval= parse_url(&tmp_share, table_arg, 1))) + if (!(retval= parse_url(thd->mem_root, &tmp_share, table_arg, 1))) retval= check_foreign_data_source(&tmp_share, 1); - /* free this because strdup created it in parse_url */ - my_free((gptr) tmp_share.connection_string, MYF(MY_ALLOW_ZERO_PTR)); - tmp_share.connection_string= 0; DBUG_RETURN(retval); } diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index bbc2b2fe9f8..4d2eefdd986 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -43,6 +43,8 @@ The example implements the minimum of what you will probably need. */ typedef struct st_federated_share { + MEM_ROOT mem_root; + bool parsed; /* this key is unique db/tablename */ const char *share_key; @@ -67,6 +69,7 @@ typedef struct st_federated_share { char *sport; int share_key_length; ushort port; + uint table_name_length, server_name_length, connect_string_length, use_count; pthread_mutex_t mutex; THR_LOCK lock; From c59dba87b64179fdaca7519f1433f0547cdcbb68 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Mar 2007 09:59:15 +0100 Subject: [PATCH 352/789] Bug #26817: mysqldump fails to backup database containing view with invalid definer manual merge 5.0->5.1 --- sql/sql_base.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 5fd48f9d356..ce928035b83 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4514,8 +4514,8 @@ find_field_in_tables(THD *thd, Item_ident *item, { Field *nf=new Field_null(NULL,0,Field::NONE, cur_field->field_name, - cur_field->table, &my_charset_bin); + nf->init(cur_table->table); cur_field= nf; } } From d9b8e466bf8258f94ed69a7771d9098d3185fa11 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Mar 2007 13:13:54 +0300 Subject: [PATCH 353/789] Remove files that were checked in by mistake. BitKeeper/deleted/.del-events_restart_phase0.log: Delete: mysql-test/t/events_restart_phase0.log BitKeeper/deleted/.del-events_restart_phase0.result: Delete: mysql-test/t/events_restart_phase0.result BitKeeper/deleted/.del-events_restart_phase0.result~7954c29cea87c6f7: Delete: mysql-test/r/events_restart_phase0.result --- mysql-test/r/events_restart_phase0.result | 22 ---------------------- mysql-test/t/events_restart_phase0.log | 22 ---------------------- mysql-test/t/events_restart_phase0.result | 22 ---------------------- 3 files changed, 66 deletions(-) delete mode 100644 mysql-test/r/events_restart_phase0.result delete mode 100644 mysql-test/t/events_restart_phase0.log delete mode 100644 mysql-test/t/events_restart_phase0.result diff --git a/mysql-test/r/events_restart_phase0.result b/mysql-test/r/events_restart_phase0.result deleted file mode 100644 index 218b804a302..00000000000 --- a/mysql-test/r/events_restart_phase0.result +++ /dev/null @@ -1,22 +0,0 @@ -SHOW VARIABLES LIKE 'event%'; -Variable_name Value -event_scheduler DISABLED -SELECT @@global.event_scheduler; -@@global.event_scheduler -DISABLED -SET GLOBAL event_scheduler=on; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=off; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=0; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=1; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=2; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2' -SET GLOBAL event_scheduler=SUSPEND; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPEND' -SET GLOBAL event_scheduler=SUSPENDED; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPENDED' -SET GLOBAL event_scheduler=disabled; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled' diff --git a/mysql-test/t/events_restart_phase0.log b/mysql-test/t/events_restart_phase0.log deleted file mode 100644 index 218b804a302..00000000000 --- a/mysql-test/t/events_restart_phase0.log +++ /dev/null @@ -1,22 +0,0 @@ -SHOW VARIABLES LIKE 'event%'; -Variable_name Value -event_scheduler DISABLED -SELECT @@global.event_scheduler; -@@global.event_scheduler -DISABLED -SET GLOBAL event_scheduler=on; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=off; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=0; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=1; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=2; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2' -SET GLOBAL event_scheduler=SUSPEND; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPEND' -SET GLOBAL event_scheduler=SUSPENDED; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPENDED' -SET GLOBAL event_scheduler=disabled; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled' diff --git a/mysql-test/t/events_restart_phase0.result b/mysql-test/t/events_restart_phase0.result deleted file mode 100644 index 218b804a302..00000000000 --- a/mysql-test/t/events_restart_phase0.result +++ /dev/null @@ -1,22 +0,0 @@ -SHOW VARIABLES LIKE 'event%'; -Variable_name Value -event_scheduler DISABLED -SELECT @@global.event_scheduler; -@@global.event_scheduler -DISABLED -SET GLOBAL event_scheduler=on; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=off; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=0; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=1; -ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement -SET GLOBAL event_scheduler=2; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2' -SET GLOBAL event_scheduler=SUSPEND; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPEND' -SET GLOBAL event_scheduler=SUSPENDED; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPENDED' -SET GLOBAL event_scheduler=disabled; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled' From a1e7490f411ac2d47c9fd548922e7f0fa21e4e26 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Mar 2007 14:03:27 +0200 Subject: [PATCH 354/789] nptl: typo fixed. sigaddset restored --- sql/mysqld.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e26bd31a00a..51332053df6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -622,7 +622,7 @@ static void close_connections(void) DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM - if (pthread_kill(select_thread, THR_SERVER_ALARM)) + if (pthread_kill(select_thread, thr_client_alarm)) break; // allready dead #endif set_timespec(abstime, 2); @@ -2120,6 +2120,8 @@ static void init_signals(void) #ifdef SIGTSTP sigaddset(&set,SIGTSTP); #endif + if (thd_lib_detected != THD_LIB_LT) + sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) { // May be SIGINT @@ -3157,7 +3159,7 @@ int main(int argc, char **argv) #if defined(SIGUSR2) thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2; #else - thr_kill_signal= thd_lib_detected == SIGINT; + thr_kill_signal= SIGINT; #endif #ifdef _CUSTOMSTARTUPCONFIG_ From d18945535d24107c865239d7c3f071e98f5cd31b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Mar 2007 14:40:38 +0200 Subject: [PATCH 355/789] Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() eliminating the unnecessary option; and replacing site-dependant stuff in the test mysql-test/r/sp_trans.result: results changed, will be changed again after bug#23333 fixed mysql-test/t/sp_trans.test: replacing sensitive stuff sql/mysql_priv.h: removal, as part of Bug#27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() --- mysql-test/r/sp_trans.result | 9 ++++----- mysql-test/t/sp_trans.test | 3 ++- sql/mysql_priv.h | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 513bbc43ce3..57c73bea86e 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -546,12 +546,11 @@ return @a; end| insert into t2 values (bug23333(),1)| ERROR 23000: Duplicate entry '1' for key 1 -show binlog events /* must show the insert */| +show binlog events from 98 /* must show the insert */| Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server ver: 5.0.40-debug-log, Binlog ver: 4 -master-bin.000001 98 Query 1 90 use `test`; insert into t2 values (1,1) -master-bin.000001 188 Xid 1 215 COMMIT /* xid=1165 */ -master-bin.000001 215 Query 1 446 use `test`; CREATE DEFINER=`root`@`localhost` function bug23333() +master-bin.000001 # Query 1 # use `test`; insert into t2 values (1,1) +master-bin.000001 # Xid 1 # COMMIT /* xid=1165 */ +master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` function bug23333() RETURNS int(11) DETERMINISTIC begin diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 579af44f28d..f2ed39c093e 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -580,7 +580,8 @@ end| --error ER_DUP_ENTRY insert into t2 values (bug23333(),1)| -show binlog events /* must show the insert */| +--replace_column 2 # 5 # +show binlog events from 98 /* must show the insert */| select count(*),@a from t1 /* must be 1,1 */| # diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 88bd8576965..cb0586a5e7c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -347,9 +347,6 @@ MY_LOCALE *my_locale_by_number(uint number); in the user query has requested */ #define SELECT_ALL (ULL(1) << 24) // SELECT, user, parser -/* Set if we are updating a non-transaction safe table */ -#define OPTION_STATUS_NO_TRANS_UPDATE (ULL(1) << 25) // THD, intern - /* The following can be set when importing tables in a 'wrong order' to suppress foreign key checks */ #define OPTION_NO_FOREIGN_KEY_CHECKS (ULL(1) << 26) // THD, user, binlog From 79bfd0b958f4bade19e0f49ae379b6502cc145fe Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Mar 2007 15:30:32 +0200 Subject: [PATCH 356/789] Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() fixing wrong written assignment sql/ha_ndbcluster.cc: fixing assignment --- sql/ha_ndbcluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 10567ca2d70..0456f5697a9 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3636,7 +3636,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) { m_transaction_on= FALSE; /* Would be simpler if has_transactions() didn't always say "yes" */ - thd->no_trans_update= {TRUE, TRUE}; + thd->no_trans_update.all= thd->no_trans_update.stmt= TRUE; } else if (!thd->transaction.on) m_transaction_on= FALSE; From ae7283a64b4cbecb9c638979fe63e68d222b2fa1 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Mar 2007 19:20:00 +0200 Subject: [PATCH 357/789] Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() removing test host sensitive stuff for pushbuild mysql-test/r/sp_trans.result: results changed, will be changed again after bug#23333 fixed mysql-test/t/sp_trans.test: replacing sensitive stuff --- mysql-test/r/sp_trans.result | 14 ++------------ mysql-test/t/sp_trans.test | 6 +++--- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 57c73bea86e..f09645703ba 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -534,7 +534,6 @@ drop function if exists bug23333| drop table if exists t1,t2| CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| -reset master| insert into t2 values (1,1)| create function bug23333() RETURNS int(11) @@ -544,20 +543,11 @@ insert into t1 values (null); select count(*) from t1 into @a; return @a; end| +reset master| insert into t2 values (bug23333(),1)| ERROR 23000: Duplicate entry '1' for key 1 -show binlog events from 98 /* must show the insert */| +show binlog events from 98 /* with fixes for #23333 will show there is the query */| Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t2 values (1,1) -master-bin.000001 # Xid 1 # COMMIT /* xid=1165 */ -master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` function bug23333() -RETURNS int(11) -DETERMINISTIC -begin -insert into t1 values (null); -select count(*) from t1 into @a; -return @a; -end select count(*),@a from t1 /* must be 1,1 */| count(*) @a 1 1 diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index f2ed39c093e..d9b34c303ae 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -566,7 +566,6 @@ drop table if exists t1,t2| CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| -reset master| insert into t2 values (1,1)| create function bug23333() @@ -578,10 +577,11 @@ begin return @a; end| +reset master| --error ER_DUP_ENTRY insert into t2 values (bug23333(),1)| ---replace_column 2 # 5 # -show binlog events from 98 /* must show the insert */| +--replace_column 2 # 5 # 6 # +show binlog events from 98 /* with fixes for #23333 will show there is the query */| select count(*),@a from t1 /* must be 1,1 */| # From fa82ebd2d650fe92119ac72169460b80da84e60f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Mar 2007 00:24:39 +0400 Subject: [PATCH 358/789] BUG#24566 - Incorrect key file for table ( the size of table is more than 2G) Accessing a file that is bigger than 2G may report that read/write operation failed. This may affect anything that uses my_pread/my_pwrite functions, e.g. MyISAM, ARCHIVE, binary log. For MyISAM INSERT may report that table is crashed when writing to a table that is bigger than 2G. This is fixed by using proper offset type in my_pread/my_pwrite functions on systems that do not have native pread/pwrite calls. Affects systems that do not have native pread/pwrite calls, e.g. Windows. No test case for this fix, since it requires huge table. mysys/my_pread.c: Use proper offset type for restoring position on systems that do not have native pread/pwrite calls. --- mysys/my_pread.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysys/my_pread.c b/mysys/my_pread.c index 7a09c21e039..f8f0fa49c10 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -37,7 +37,7 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, errno=0; /* Linux doesn't reset this */ #endif #ifndef HAVE_PREAD - off_t old_offset; + os_off_t old_offset; pthread_mutex_lock(&my_file_info[Filedes].mutex); /* @@ -45,7 +45,7 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, before seeking to the given offset */ - error= (old_offset= (off_t)lseek(Filedes, 0L, MY_SEEK_CUR)) == -1L || + error= (old_offset= lseek(Filedes, 0L, MY_SEEK_CUR)) == -1L || lseek(Filedes, offset, MY_SEEK_SET) == -1L; if (!error) /* Seek was successful */ @@ -116,7 +116,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset, { #ifndef HAVE_PREAD int error= 0; - off_t old_offset; + os_off_t old_offset; writenbytes= (uint) -1; pthread_mutex_lock(&my_file_info[Filedes].mutex); @@ -124,7 +124,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset, As we cannot change the file pointer, we save the old position, before seeking to the given offset */ - error= ((old_offset= (off_t)lseek(Filedes, 0L, MY_SEEK_CUR)) == -1L || + error= ((old_offset= lseek(Filedes, 0L, MY_SEEK_CUR)) == -1L || lseek(Filedes, offset, MY_SEEK_SET) == -1L); if (!error) /* Seek was successful */ From e02aa04721fdf5a60d1a34236f846c27597fdcb0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Mar 2007 11:38:49 -0700 Subject: [PATCH 359/789] New comments, additional init for rebuild options. storage/archive/ha_archive.cc: New comments, added specific init for rebuild options. --- storage/archive/ha_archive.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 307f6665c10..72647b58f54 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -81,6 +81,7 @@ TODO: Allow users to set compression level. + Allow adjustable block size. Implement versioning, should be easy. Allow for errors, find a way to mark bad rows. Add optional feature so that rows can be flushed at interval (which will cause less @@ -1303,6 +1304,8 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt) azio_stream writer; char writer_filename[FN_REFLEN]; + init_archive_reader(); + // now we close both our writer and our reader for the rename if (share->archive_write_open) { @@ -1577,6 +1580,8 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt) Now we will rewind the archive file so that we are positioned at the start of the file. */ + init_archive_reader(); + if (!rc) read_data_header(&archive); From d95c307f1d3e7dcbd46db9c77f5303142243dc58 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Mar 2007 23:44:06 -0700 Subject: [PATCH 360/789] This is a fix for the memory corruption occurred in one of test cases from func_group.test after the patch for bug #27229 had been applied. The memory corruption happened because in some rare cases the function count_field_types underestimated the number of elements in in the array param->items_to_copy. sql/item_sum.cc: The return value of the Item_sum::update_used_tables method should not depend on the place of aggregation of the set function for which the Item_sum object has been created. sql/sql_select.cc: This is a fix for the memory corruption occurred in one of test cases from func_group.test after the patch for bug #27229 had been applied. The memory corruption happened because in some rare cases the function count_field_types underestimated the number of elements in in the array param->items_to_copy. Currently it's not guaranteed that after JOIN::prepare() the used_tables attribute is calculated for all items. For example for the expression SUM(outer_ref)+1 used_tables() must return OUTER_REF_TABLE_BIT. Yet by the moment when the used_tables attribute is calculated in JOIN::prepare SUM(outer_ref) has not been substituted for Item_aggregate_ref yet. By this reason additional calls of the method update_used_tables are needed for some items passed as parameters to the function create_tmp_table. --- sql/item_sum.cc | 3 +-- sql/sql_select.cc | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 422e9b4c6ea..368dc9a7d38 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -449,8 +449,7 @@ void Item_sum::update_used_tables () used_tables_cache&= PSEUDO_TABLE_BITS; /* the aggregate function is aggregated into its local context */ - if (aggr_level == nest_level) - used_tables_cache |= (1 << aggr_sel->join->tables) - 1; + used_tables_cache |= (1 << aggr_sel->join->tables) - 1; } } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4fbc5dddb07..bb57764700d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9196,17 +9196,21 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, Item::Type type=item->type(); if (not_all_columns) { - if (item->with_sum_func && type != Item::SUM_FUNC_ITEM && - (type == Item::SUBSELECT_ITEM || - (item->used_tables() & ~PSEUDO_TABLE_BITS))) + if (item->with_sum_func && type != Item::SUM_FUNC_ITEM) { - /* - Mark that the we have ignored an item that refers to a summary - function. We need to know this if someone is going to use - DISTINCT on the result. - */ - param->using_indirect_summary_function=1; - continue; + if (item->used_tables() & OUTER_REF_TABLE_BIT) + item->update_used_tables(); + if (type == Item::SUBSELECT_ITEM || + (item->used_tables() & ~OUTER_REF_TABLE_BIT)) + { + /* + Mark that the we have ignored an item that refers to a summary + function. We need to know this if someone is going to use + DISTINCT on the result. + */ + param->using_indirect_summary_function=1; + continue; + } } if (item->const_item() && (int) hidden_field_count <= 0) continue; // We don't have to store this @@ -9391,6 +9395,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, table->s->default_values= table->record[1]+alloc_length; } copy_func[0]=0; // End marker + param->func_count= copy_func - param->items_to_copy; recinfo=param->start_recinfo; null_flags=(uchar*) table->record[0]; @@ -13571,6 +13576,7 @@ count_field_types(TMP_TABLE_PARAM *param, List &fields, if (!sum_item->quick_group) param->quick_group=0; // UDF SUM function param->sum_func_count++; + param->func_count++; for (uint i=0 ; i < sum_item->arg_count ; i++) { From 9b2e0127f02209a6e93fb3dcf2755b7abaf1d097 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 12:56:41 +0500 Subject: [PATCH 361/789] Fix for bug #25993: mysqldump crashes with merge table and -c option opt_complete_insert was improperly used by accident. Use complete_insert flag instead. client/mysqldump.c: Fix for bug #25993: mysqldump crashes with merge table and -c option - use complete_insert instead of opt_complete_insert. mysql-test/r/mysqldump.result: Fix for bug #25993: mysqldump crashes with merge table and -c option - test result. mysql-test/t/mysqldump.test: Fix for bug #25993: mysqldump crashes with merge table and -c option - test case. --- client/mysqldump.c | 6 ++--- mysql-test/r/mysqldump.result | 47 +++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 10 ++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index effeaf68597..1db6a6b4e2b 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1857,7 +1857,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, dynstr_append_checked(&insert_pat, insert_option); dynstr_append_checked(&insert_pat, "INTO "); dynstr_append_checked(&insert_pat, result_table); - if (opt_complete_insert) + if (complete_insert) dynstr_append_checked(&insert_pat, " ("); else { @@ -1881,7 +1881,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, dynstr_append_checked(&insert_pat, ", "); } init=1; - if (opt_complete_insert) + if (complete_insert) dynstr_append_checked(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); if (!opt_no_create_info) @@ -2039,7 +2039,7 @@ continue_xml: check_io(sql_file); } } - if (opt_complete_insert) + if (complete_insert) { dynstr_append_checked(&insert_pat, ") VALUES "); if (!extended_insert) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index df2effb2a72..6b915d88df5 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3212,6 +3212,53 @@ CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DROP TABLE t1; +CREATE TABLE t2 (a int); +CREATE TABLE t3 (a int); +CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t2`,`t3`); +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +LOCK TABLES `t2` WRITE; +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; +UNLOCK TABLES; +DROP TABLE IF EXISTS `t3`; +CREATE TABLE `t3` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +LOCK TABLES `t3` WRITE; +/*!40000 ALTER TABLE `t3` DISABLE KEYS */; +/*!40000 ALTER TABLE `t3` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE t1, t2, t3; # # End of 5.0 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 0b943e31fdb..5247bbee59c 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1453,6 +1453,16 @@ INSERT INTO t1 VALUES (1), (2); DROP TABLE t1; +# +# Bug #25993: crashe with a merge table and -c +# + +CREATE TABLE t2 (a int); +CREATE TABLE t3 (a int); +CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3); +--exec $MYSQL_DUMP --skip-comments -c test +DROP TABLE t1, t2, t3; + --echo # --echo # End of 5.0 tests --echo # From d37fc3ce1f9163d4fca2179f02e172d194324f63 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 09:58:01 +0200 Subject: [PATCH 362/789] Bug #26900 ndb_restore printout option does not give structured data - set sizes for data --- ndb/tools/restore/Restore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index 7ca7e91acf0..c07bfbc2bd4 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -454,6 +454,7 @@ RestoreDataIterator::getNextTuple(int & res) attr_data->null = false; attr_data->void_value = ptr; + attr_data->size = 4*sz; if(!Twiddle(attr_desc, attr_data)) { @@ -475,6 +476,7 @@ RestoreDataIterator::getNextTuple(int & res) attr_data->null = false; attr_data->void_value = ptr; + attr_data->size = 4*sz; if(!Twiddle(attr_desc, attr_data)) { @@ -511,6 +513,7 @@ RestoreDataIterator::getNextTuple(int & res) attr_data->null = false; attr_data->void_value = &data->Data[0]; + attr_data->size = sz*4; /** * Compute array size @@ -979,7 +982,8 @@ operator<<(NdbOut& ndbout, const AttributeS& attr){ } NdbRecAttr tmprec(0); - tmprec.setup(desc.m_column, (char *)data.void_value); + tmprec.setup(desc.m_column, 0); + tmprec.receive_data((Uint32*)data.void_value, (data.size+3)/4); ndbrecattr_print_formatted(ndbout, tmprec, g_ndbrecord_print_format); return ndbout; From 27c1d3e76d8d628120b7678a2e054d71a3721961 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 13:20:34 +0500 Subject: [PATCH 363/789] after-merge fix: result adjusted. --- mysql-test/r/mysqldump.result | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 57fa2e71bc7..c274b1073e7 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3211,6 +3211,53 @@ CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DROP TABLE t1; +CREATE TABLE t2 (a int); +CREATE TABLE t3 (a int); +CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t2`,`t3`); +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +LOCK TABLES `t2` WRITE; +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; +UNLOCK TABLES; +DROP TABLE IF EXISTS `t3`; +CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +LOCK TABLES `t3` WRITE; +/*!40000 ALTER TABLE `t3` DISABLE KEYS */; +/*!40000 ALTER TABLE `t3` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE t1, t2, t3; # # End of 5.0 tests # From df4d3039c3160ccd76602cf835f48043b5f021ea Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 10:39:11 +0200 Subject: [PATCH 364/789] remove warning --- ndb/test/src/NDBT_Table.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp index 8200747fc96..34db6ed9822 100644 --- a/ndb/test/src/NDBT_Table.cpp +++ b/ndb/test/src/NDBT_Table.cpp @@ -31,7 +31,7 @@ operator <<(class NdbOut& ndbout, const NDBT_Table & tab) ndbout << "Number of attributes: " << tab.getNoOfColumns() << endl; ndbout << "Number of primary keys: " << tab.getNoOfPrimaryKeys() << endl; ndbout << "Length of frm data: " << tab.getFrmLength() << endl; - ndbout << "SingleUserMode: " << tab.getSingleUserMode() << endl; + ndbout << "SingleUserMode: " << (Uint32) tab.getSingleUserMode() << endl; //<< ((tab.getTupleKey() == TupleId) ? " tupleid" : "") < Date: Mon, 26 Mar 2007 02:24:49 -0700 Subject: [PATCH 365/789] Added pre and post option to test run (allows me to adjust an engine once all of the data has been loaded). Kinda obvious that this was going to come up ;) client/client_priv.h: New options client/mysqlslap.c: Added option for pre/post run mysql-test/r/mysqlslap.result: Updated tests mysql-test/t/mysqlslap.test: Updated test --- client/client_priv.h | 2 + client/mysqlslap.c | 106 +++++++++++++++++++++++++++++++++- mysql-test/r/mysqlslap.result | 24 ++++++++ mysql-test/t/mysqlslap.test | 2 + 4 files changed, 132 insertions(+), 2 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 6227dcdee44..4dbf3f7895b 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -63,6 +63,8 @@ enum options_client OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES, OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM, OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM, + OPT_SLAP_PRE_QUERY, + OPT_SLAP_POST_QUERY, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_DEBUG_INFO, OPT_COLUMN_TYPES diff --git a/client/mysqlslap.c b/client/mysqlslap.c index de7a726747e..e4a70cd8d11 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -122,6 +122,8 @@ unsigned long long primary_keys_number_of; static char *host= NULL, *opt_password= NULL, *user= NULL, *user_supplied_query= NULL, + *user_supplied_pre_statements= NULL, + *user_supplied_post_statements= NULL, *default_engine= NULL, *opt_mysql_unix_port= NULL; @@ -226,6 +228,8 @@ struct conclusions { }; static option_string *engine_options= NULL; +static statement *pre_statements= NULL; +static statement *post_statements= NULL; static statement *create_statements= NULL, *query_statements= NULL; @@ -252,6 +256,7 @@ pthread_handler_t run_task(void *p); void statement_cleanup(statement *stmt); void option_cleanup(option_string *stmt); void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr); +static int run_statements(MYSQL *mysql, statement *stmt); static const char ALPHANUMERICS[]= "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz"; @@ -392,6 +397,8 @@ int main(int argc, char **argv) statement_cleanup(create_statements); statement_cleanup(query_statements); + statement_cleanup(pre_statements); + statement_cleanup(post_statements); option_cleanup(engine_options); #ifdef HAVE_SMEM @@ -447,7 +454,13 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr) if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) generate_primary_key_list(mysql, eptr); + if (pre_statements) + run_statements(mysql, pre_statements); + run_scheduler(sptr, query_statements, current, client_limit); + + if (post_statements) + run_statements(mysql, post_statements); /* We are finished with this run */ if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) @@ -574,6 +587,16 @@ static struct my_option my_long_options[] = {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, + {"post-query", OPT_SLAP_POST_QUERY, + "Query to run or file containing query to run after executing.", + (gptr*) &user_supplied_post_statements, + (gptr*) &user_supplied_post_statements, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"pre-query", OPT_SLAP_PRE_QUERY, + "Query to run or file containing query to run before executing.", + (gptr*) &user_supplied_pre_statements, + (gptr*) &user_supplied_pre_statements, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"preserve-schema", OPT_MYSQL_PRESERVE_SCHEMA, "Preserve the schema from the mysqlslap run, this happens unless " "--auto-generate-sql or --create are used.", @@ -1336,6 +1359,66 @@ get_options(int *argc,char ***argv) } } + if (user_supplied_pre_statements && my_stat(user_supplied_pre_statements, &sbuf, MYF(0))) + { + File data_file; + if (!MY_S_ISREG(sbuf.st_mode)) + { + fprintf(stderr,"%s: User query supplied file was not a regular file\n", + my_progname); + exit(1); + } + if ((data_file= my_open(user_supplied_pre_statements, O_RDWR, MYF(0))) == -1) + { + fprintf(stderr,"%s: Could not open query supplied file\n", my_progname); + exit(1); + } + tmp_string= (char *)my_malloc(sbuf.st_size + 1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + my_read(data_file, tmp_string, sbuf.st_size, MYF(0)); + tmp_string[sbuf.st_size]= '\0'; + my_close(data_file,MYF(0)); + if (user_supplied_pre_statements) + actual_queries= parse_delimiter(tmp_string, &pre_statements, + delimiter[0]); + my_free((gptr)tmp_string, MYF(0)); + } + else if (user_supplied_pre_statements) + { + actual_queries= parse_delimiter(user_supplied_pre_statements, &pre_statements, + delimiter[0]); + } + + if (user_supplied_post_statements && my_stat(user_supplied_post_statements, &sbuf, MYF(0))) + { + File data_file; + if (!MY_S_ISREG(sbuf.st_mode)) + { + fprintf(stderr,"%s: User query supplied file was not a regular file\n", + my_progname); + exit(1); + } + if ((data_file= my_open(user_supplied_post_statements, O_RDWR, MYF(0))) == -1) + { + fprintf(stderr,"%s: Could not open query supplied file\n", my_progname); + exit(1); + } + tmp_string= (char *)my_malloc(sbuf.st_size + 1, + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + my_read(data_file, tmp_string, sbuf.st_size, MYF(0)); + tmp_string[sbuf.st_size]= '\0'; + my_close(data_file,MYF(0)); + if (user_supplied_post_statements) + parse_delimiter(tmp_string, &post_statements, + delimiter[0]); + my_free((gptr)tmp_string, MYF(0)); + } + else if (user_supplied_post_statements) + { + parse_delimiter(user_supplied_post_statements, &post_statements, + delimiter[0]); + } + if (verbose >= 2) printf("Parsing engines to use.\n"); @@ -1368,7 +1451,7 @@ generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt) MYSQL_RES *result; MYSQL_ROW row; unsigned long long counter; - DBUG_ENTER("create_schema"); + DBUG_ENTER("generate_primary_key_list"); /* Blackhole is a special case, this allows us to test the upper end @@ -1548,6 +1631,25 @@ drop_schema(MYSQL *mysql, const char *db) DBUG_RETURN(0); } +static int +run_statements(MYSQL *mysql, statement *stmt) +{ + statement *ptr; + DBUG_ENTER("run_statements"); + + for (ptr= stmt; ptr && ptr->length; ptr= ptr->next) + { + if (run_query(mysql, ptr->string, ptr->length)) + { + fprintf(stderr,"%s: Cannot run query %.*s ERROR : %s\n", + my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); + exit(1); + } + } + + DBUG_RETURN(0); +} + static int run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) { @@ -1569,7 +1671,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) pthread_mutex_unlock(&sleeper_mutex); for (x= 0; x < concur; x++) { - /* nowucreate the thread */ + /* now you create the thread */ if (pthread_create(&mainthread, NULL, run_task, (void *)&con) != 0) { diff --git a/mysql-test/r/mysqlslap.result b/mysql-test/r/mysqlslap.result index 1a8b77fde1c..bca7919d78c 100644 --- a/mysql-test/r/mysqlslap.result +++ b/mysql-test/r/mysqlslap.result @@ -143,3 +143,27 @@ select * from t1; select * from t2; select * from t1; DROP SCHEMA IF EXISTS `mysqlslap`; +DROP SCHEMA IF EXISTS `mysqlslap`; +CREATE SCHEMA `mysqlslap`; +use mysqlslap; +set storage_engine=`heap`; +CREATE TABLE t1 (id int, name varchar(64)); +create table t2(foo1 varchar(32), foo2 varchar(32)); +INSERT INTO t1 VALUES (1, 'This is a test'); +insert into t2 values ('test', 'test2'); +SHOW TABLES; +select * from t1; +SHOW TABLES; +DROP SCHEMA IF EXISTS `mysqlslap`; +DROP SCHEMA IF EXISTS `mysqlslap`; +CREATE SCHEMA `mysqlslap`; +use mysqlslap; +set storage_engine=`myisam`; +CREATE TABLE t1 (id int, name varchar(64)); +create table t2(foo1 varchar(32), foo2 varchar(32)); +INSERT INTO t1 VALUES (1, 'This is a test'); +insert into t2 values ('test', 'test2'); +SHOW TABLES; +select * from t1; +SHOW TABLES; +DROP SCHEMA IF EXISTS `mysqlslap`; diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test index a40a01f1f25..2a7bbfed932 100644 --- a/mysql-test/t/mysqlslap.test +++ b/mysql-test/t/mysqlslap.test @@ -34,3 +34,5 @@ --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5 --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=5 --auto-generate-sql-secondary-indexes=3 + +--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES"; From 3d90a07a0666877448c5662aa5dc8b2561d2d4fb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 13:31:23 +0400 Subject: [PATCH 366/789] Fix for bug #26844 "Memory allocation failures ignored by slave IO thread". Pass ME_NOREFRESH flag to an error handler in my_malloc() and _mymalloc() in case of memory allocation failure, so that it gets logged to the error log. mysys/my_malloc.c: Pass ME_NOREFRESH flag to an error handler in my_malloc() in case of memory allocation failure, so that it gets logged to the error log. mysys/safemalloc.c: Pass ME_NOREFRESH flag to an error handler in _mymalloc() in case of memory allocation failure, so that it gets logged to the error log. --- mysys/my_malloc.c | 2 +- mysys/safemalloc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 3baf55d4c57..38d0263b495 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -37,7 +37,7 @@ gptr my_malloc(unsigned int size, myf my_flags) if (my_flags & MY_FAE) error_handler_hook=fatal_error_handler_hook; if (my_flags & (MY_FAE+MY_WME)) - my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH),size); if (my_flags & MY_FAE) exit(1); } diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index f43c860adb0..a7d8f372151 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -150,11 +150,11 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags) char buff[SC_MAXWIDTH]; my_errno=errno; sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename); - my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG)); + my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)", size, (size + 1023L) / 1024L, sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L); - my_message(EE_OUTOFMEMORY,buff,MYF(ME_BELL+ME_WAITTANG)); + my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); } DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", sf_malloc_max_memory,lineno, filename)); From 9e6a59598c2ebfde37b843e23cf16d77c6c69392 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 12:32:51 +0300 Subject: [PATCH 367/789] Bug #26303: Reserve is not called before qs_append(). This may lead to buffer overflow. The String::qs_append() function will append a string without checking if there's enough space. So qs_append() must be called beforehand to ensure there's enough space in the buffer for the subsequent qs_append() calls. Fixed Item_case_expr::print() to make sure there's enough space before appending data by adding a call to String::reserve() to make sure qs_append() will have enough space. mysql-test/r/sp-code.result: Bug #26303: test case mysql-test/t/sp-code.test: Bug #26303: test case sql/item.cc: Bug #26303: added a call to String::reserve() to make sure qs_append will have enough space sql/item.h: Bug #26303: m_case_expr_id made unsigned because it's offset in an array. --- mysql-test/r/sp-code.result | 17 +++++++++++++++++ mysql-test/t/sp-code.test | 18 ++++++++++++++++++ sql/item.cc | 4 +++- sql/item.h | 4 ++-- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result index 67b030f87a4..588f4329368 100644 --- a/mysql-test/r/sp-code.result +++ b/mysql-test/r/sp-code.result @@ -621,3 +621,20 @@ Pos Instruction 0 stmt 2 "CREATE INDEX idx ON t1 (c1)" DROP PROCEDURE p1; End of 5.0 tests. +CREATE PROCEDURE p1() +BEGIN +DECLARE dummy int default 0; +CASE 12 +WHEN 12 +THEN SET dummy = 0; +END CASE; +END// +SHOW PROCEDURE CODE p1; +Pos Instruction +0 set dummy@0 0 +1 set_case_expr (6) 0 12 +2 jump_if_not 5(6) (case_expr@0 = 12) +3 set dummy@0 0 +4 jump 6 +5 error 1339 +DROP PROCEDURE p1; diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test index 97bc29fcad2..1b33680cfaf 100644 --- a/mysql-test/t/sp-code.test +++ b/mysql-test/t/sp-code.test @@ -447,3 +447,21 @@ DROP PROCEDURE p1; --echo End of 5.0 tests. + +# +# Bug #26303: reserve() not called before qs_append() may lead to buffer +# overflow +# +DELIMITER //; +CREATE PROCEDURE p1() +BEGIN + DECLARE dummy int default 0; + + CASE 12 + WHEN 12 + THEN SET dummy = 0; + END CASE; +END// +DELIMITER ;// +SHOW PROCEDURE CODE p1; +DROP PROCEDURE p1; diff --git a/sql/item.cc b/sql/item.cc index 37ebd0b6e20..d675e03d2d7 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1088,7 +1088,7 @@ bool Item_splocal::set_value(THD *thd, sp_rcontext *ctx, Item **it) Item_case_expr methods *****************************************************************************/ -Item_case_expr::Item_case_expr(int case_expr_id) +Item_case_expr::Item_case_expr(uint case_expr_id) :Item_sp_variable( C_STRING_WITH_LEN("case_expr")), m_case_expr_id(case_expr_id) { @@ -1125,6 +1125,8 @@ Item_case_expr::this_item_addr(THD *thd, Item **) void Item_case_expr::print(String *str) { + if (str->reserve(MAX_INT_WIDTH + sizeof("case_expr@"))) + return; /* purecov: inspected */ VOID(str->append(STRING_WITH_LEN("case_expr@"))); str->qs_append(m_case_expr_id); } diff --git a/sql/item.h b/sql/item.h index 955f9c8489a..2cffe985480 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1116,7 +1116,7 @@ inline Item_result Item_splocal::result_type() const class Item_case_expr :public Item_sp_variable { public: - Item_case_expr(int case_expr_id); + Item_case_expr(uint case_expr_id); public: Item *this_item(); @@ -1135,7 +1135,7 @@ public: void print(String *str); private: - int m_case_expr_id; + uint m_case_expr_id; }; /***************************************************************************** From 3335f68d8902fdbbebb2c41d09253a4cafe675bb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 13:17:40 +0300 Subject: [PATCH 368/789] Bug #27164: not reseting the data pointer to 0 causes wrong (large) length to be read from the row in _mi_calc_blob_length() when storing NULL values in (e.g) POINT columns. This large length is then used to allocate a block of memory that (on some OSes) causes trouble. Fixed by calling the base class's Field_blob::reset() from Field_geom::reset() that is called when storing a NULL value into the column. mysql-test/r/gis.result: Bug #27164: test case mysql-test/t/gis.test: Bug #27164: test case sql/field.h: Bug #27164: not reseting the data pointer to 0 causes wrong (large) length to be read from the row in _mi_calc_blob_length() when storing NULL values in (e.g) POINT columns. This large length is then used to allocate a block of memory that (on some OSes) causes trouble. --- mysql-test/r/gis.result | 6 ++++++ mysql-test/t/gis.test | 8 ++++++++ sql/field.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index de7e44ed7b2..643a3d6b434 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -718,4 +718,10 @@ point(b, b) IS NULL linestring(b) IS NULL polygon(b) IS NULL multipoint(b) IS NU 1 1 1 1 1 1 1 0 1 1 1 1 1 1 drop table t1; +CREATE TABLE t1(a POINT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +a +NULL +DROP TABLE t1; End of 4.1 tests diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 6bd0db92152..7182e040d46 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -411,4 +411,12 @@ from t1; drop table t1; +# +# Bug #27164: Crash when mixing InnoDB and MyISAM Geospatial tables +# +CREATE TABLE t1(a POINT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t1; + --echo End of 4.1 tests diff --git a/sql/field.h b/sql/field.h index d3e38db83d1..58177747120 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1115,7 +1115,7 @@ public: int store(const char *to, uint length, CHARSET_INFO *charset); int store(double nr) { return 1; } int store(longlong nr) { return 1; } - int reset(void) { return !maybe_null(); } + int reset(void) { return !maybe_null() || Field_blob::reset(); } void get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type); void set_key_image(char *buff,uint length, CHARSET_INFO *cs); From d25dd07363cbe54d813c2d9cd9cc16ff32e9bde4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 13:44:58 +0300 Subject: [PATCH 369/789] Fixed error found by valgrind in numerical date handling Fixed comments to say MYSQL_TIME instead of old typedef TIME --- sql-common/my_time.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 4aad97f8249..08c3c0f8adc 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -456,7 +456,7 @@ err: /* - Convert a time string to a TIME struct. + Convert a time string to a MYSQL_TIME struct. SYNOPSIS str_to_time() @@ -642,11 +642,11 @@ fractional: l_time->second_part= date[4]; l_time->time_type= MYSQL_TIMESTAMP_TIME; - /* Check if the value is valid and fits into TIME range */ + /* Check if the value is valid and fits into MYSQL_TIME range */ if (check_time_range(l_time, warning)) return 1; - /* Check if there is garbage at end of the TIME specification */ + /* Check if there is garbage at end of the MYSQL_TIME specification */ if (str != end) { do @@ -663,11 +663,11 @@ fractional: /* - Check 'time' value to lie in the TIME range + Check 'time' value to lie in the MYSQL_TIME range SYNOPSIS: check_time_range() - time pointer to TIME value + time pointer to MYSQL_TIME value warning set MYSQL_TIME_WARN_OUT_OF_RANGE flag if the value is out of range DESCRIPTION @@ -1008,7 +1008,7 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type) /* Functions to convert time/date/datetime value to a string, using default format. - This functions don't check that given TIME structure members are + This functions don't check that given MYSQL_TIME structure members are in valid range. If they are not, return value won't reflect any valid date either. Additionally, make_time doesn't take into account time->day member: it's assumed that days have been converted @@ -1094,7 +1094,7 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to) DESCRIPTION Convert a datetime value of formats YYMMDD, YYYYMMDD, YYMMDDHHMSS, - YYYYMMDDHHMMSS to broken-down TIME representation. Return value in + YYYYMMDDHHMMSS to broken-down MYSQL_TIME representation. Return value in YYYYMMDDHHMMSS format as side-effect. This function also checks if datetime value fits in DATETIME range. @@ -1150,6 +1150,7 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, ok: part1=(long) (nr/LL(1000000)); part2=(long) (nr - (longlong) part1*LL(1000000)); + time_res->neg= 0; time_res->year= (int) (part1/10000L); part1%=10000L; time_res->month= (int) part1 / 100; time_res->day= (int) part1 % 100; @@ -1186,7 +1187,7 @@ ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *my_time) } -/* Convert TIME value to integer in YYYYMMDD format */ +/* Convert MYSQL_TIME value to integer in YYYYMMDD format */ ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *my_time) { @@ -1196,7 +1197,7 @@ ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *my_time) /* - Convert TIME value to integer in HHMMSS format. + Convert MYSQL_TIME value to integer in HHMMSS format. This function doesn't take into account time->day member: it's assumed that days have been converted to hours already. */ @@ -1210,7 +1211,7 @@ ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *my_time) /* - Convert struct TIME (date and time split into year/month/day/hour/... + Convert struct MYSQL_TIME (date and time split into year/month/day/hour/... to a number in format YYYYMMDDHHMMSS (DATETIME), YYYYMMDD (DATE) or HHMMSS (TIME). @@ -1224,7 +1225,7 @@ ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *my_time) SELECT ?+1; NOTE - This function doesn't check that given TIME structure members are + This function doesn't check that given MYSQL_TIME structure members are in valid range. If they are not, return value won't reflect any valid date either. */ From e3f3c6f0b61509c17f82a0318570905142127bc7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 14:48:52 +0200 Subject: [PATCH 370/789] Bug #26986 BIT(33) for ndb is broken on solaris. - always store lsw first in ndb --- sql/ha_ndbcluster.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 5f44530b2db..9bd220ab179 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -726,11 +726,8 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, DBUG_PRINT("info", ("bit field")); DBUG_DUMP("value", (char*)&bits, pack_len); #ifdef WORDS_BIGENDIAN - if (pack_len < 5) - { - DBUG_RETURN(ndb_op->setValue(fieldnr, - ((char*)&bits)+4, pack_len) != 0); - } + /* store lsw first */ + bits = (bits >> 32) | (bits << 32); #endif DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)&bits, pack_len) != 0); } @@ -2653,8 +2650,15 @@ void ha_ndbcluster::unpack_record(byte* buf) DBUG_PRINT("info", ("bit field H'%.8X%.8X", *(Uint32 *)(*value).rec->aRef(), *((Uint32 *)(*value).rec->aRef()+1))); +#ifdef WORDS_BIGENDIAN + /* lsw is stored first */ + Uint32 *buf= (Uint32 *)(*value).rec->aRef(); + ((Field_bit *) *field)->store(*buf | (((longlong)*(buf+1)) << 32), + TRUE); +#else ((Field_bit *) *field)->store((longlong) (*value).rec->u_64_value(), TRUE); +#endif } } } From 6e93d2939df73eceb8b39e0c2e08e96fb4c764d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 16:52:52 +0300 Subject: [PATCH 371/789] WL3527: 5.0 part: enabled the optional FOR JOIN to all the three clauses : USE, FORCE and IGNORE mysql-test/r/select.result: WL3527: 5.0 part: test cases mysql-test/t/select.test: WL3527: 5.0 part: test cases --- mysql-test/r/select.result | 6 ++++++ mysql-test/t/select.test | 2 ++ sql/sql_yacc.yy | 12 ++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 31d15981d93..b501d547e0a 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3636,6 +3636,12 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT 1 FROM t1 IGNORE INDEX FOR JOIN (a) WHERE a = 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +EXPLAIN SELECT 1 FROM t1 USE INDEX FOR JOIN (a) WHERE a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where; Using index +EXPLAIN SELECT 1 FROM t1 FORCE INDEX FOR JOIN (a) WHERE a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where; Using index DROP TABLE t1; CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); CREATE TABLE t2 ( f11 int PRIMARY KEY ); diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 883ea7bf0b0..c5c7d07ee25 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3111,6 +3111,8 @@ DROP TABLE t1,t2,t3; CREATE TABLE t1 (a INT, b INT, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,2); EXPLAIN SELECT 1 FROM t1 WHERE a = 1; EXPLAIN SELECT 1 FROM t1 IGNORE INDEX FOR JOIN (a) WHERE a = 1; +EXPLAIN SELECT 1 FROM t1 USE INDEX FOR JOIN (a) WHERE a = 1; +EXPLAIN SELECT 1 FROM t1 FORCE INDEX FOR JOIN (a) WHERE a = 1; DROP TABLE t1; # diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index cc8d1ae9e6d..bbb0d11b942 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1092,7 +1092,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); key_alg opt_btree_or_rtree %type - key_usage_list key_usage_list_inner using_list + key_usage_list using_list %type key_part @@ -5907,19 +5907,15 @@ opt_key_definition: sel->use_index_ptr= &sel->use_index; sel->table_join_options|= TL_OPTION_FORCE_INDEX; } - | IGNORE_SYM key_or_index opt_for_join key_usage_list_inner + | IGNORE_SYM key_usage_list { SELECT_LEX *sel= Select; - sel->ignore_index= *$4; + sel->ignore_index= *$2; sel->ignore_index_ptr= &sel->ignore_index; }; key_usage_list: - key_or_index key_usage_list_inner - { $$= $2; } - ; - -key_usage_list_inner: + key_or_index opt_for_join { Select->interval_list.empty(); } '(' key_list_or_empty ')' { $$= &Select->interval_list; } From d24dab182f8366e1e0ee74248ab38d6df26abcd3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 17:57:00 +0200 Subject: [PATCH 372/789] correct medium int printout correct cit printout correct bit store retrieve ndb/include/ndbapi/NdbRecAttr.hpp: correct medium int printout ndb/src/ndbapi/NdbRecAttr.cpp: correct cit printout sql/ha_ndbcluster.cc: correct bit store retrieve --- ndb/include/ndbapi/NdbRecAttr.hpp | 7 ++----- ndb/src/ndbapi/NdbRecAttr.cpp | 23 ++++++----------------- sql/ha_ndbcluster.cc | 9 +++++++-- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 2f3a2c8383a..7f8add774dc 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -336,10 +336,7 @@ inline Int32 NdbRecAttr::medium_value() const { - Uint32 tmp = *(Uint32*)theRef; - if (tmp & (0x1<<23)) - tmp|= (0xFF<<24); - return (Int32)tmp; + return sint3korr((unsigned char *)theRef); } inline @@ -367,7 +364,7 @@ inline Uint32 NdbRecAttr::u_medium_value() const { - return *(Uint32*)theRef; + return uint3korr((unsigned char*)theRef); } inline diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index a0c394603c5..90808a706d4 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -236,24 +236,13 @@ ndbrecattr_print_formatted(NdbOut& out, const NdbRecAttr &r, break; case NdbDictionary::Column::Bit: out << f.hex_prefix << "0x"; - if (length < 33) { - out.print("%X", r.u_32_value()); - } - else if (length < 65) - { - out.print("%llX", r.u_64_value()); - } - else - { - const unsigned char *buf = (unsigned char *)r.aRef(); - int k = 4*((length+31)/32); - while (k > 0 && (*(buf + --k) == 0)); - do - { - out.print("%X", (Uint32)*(buf + k--)); - } - while (k >= 0); + const Uint32 *buf = (Uint32 *)r.aRef(); + int k = (length+31)/32; + while (k > 0 && (buf[--k] == 0)); + out.print("%X", buf[k]); + while (k > 0) + out.print("%.8X", buf[--k]); } break; case NdbDictionary::Column::Unsigned: diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 9bd220ab179..5c7ba12a5da 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -727,7 +727,8 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, DBUG_DUMP("value", (char*)&bits, pack_len); #ifdef WORDS_BIGENDIAN /* store lsw first */ - bits = (bits >> 32) | (bits << 32); + bits = ((bits >> 32) & 0x00000000FFFFFFFF) + | ((bits << 32) & 0xFFFFFFFF00000000); #endif DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)&bits, pack_len) != 0); } @@ -2653,7 +2654,11 @@ void ha_ndbcluster::unpack_record(byte* buf) #ifdef WORDS_BIGENDIAN /* lsw is stored first */ Uint32 *buf= (Uint32 *)(*value).rec->aRef(); - ((Field_bit *) *field)->store(*buf | (((longlong)*(buf+1)) << 32), + ((Field_bit *) *field)->store((((longlong)*buf) + & 0x000000000FFFFFFFF) + | + ((((longlong)*(buf+1)) << 32) + & 0xFFFFFFFF00000000), TRUE); #else ((Field_bit *) *field)->store((longlong) From 689910ac9c21e7e117a6fd28fb39233edb07fda4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 19:15:30 +0300 Subject: [PATCH 373/789] WL3527: 5.1 renamed "--old-mode" to "--old" to prevent ambiguity. "old" now appears in SHOW VARIABLES as a read-only option. mysql-test/r/group_by.result: WL3527: 5.1 test case mysql-test/t/group_by.test: WL3527: 5.1 test case sql/mysqld.cc: WL3527: 5.1 renamed the "old-mode" to "old" to fit the options naming scheme sql/set_var.cc: WL3527: 5.1 added "-old" as read-only system variable sql/set_var.h: WL3527: 5.1 added class for boolean pointer read-only option to support the "--old" option. sql/sql_base.cc: fixed 5.0->5.1 merge problems. --- mysql-test/r/group_by.result | 5 +++++ mysql-test/t/group_by.test | 7 ++++++- sql/mysqld.cc | 2 +- sql/set_var.cc | 3 +++ sql/set_var.h | 10 ++++++++++ sql/sql_base.cc | 2 -- 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 5cff5fec7ed..c7464bb21d2 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1141,4 +1141,9 @@ EXPLAIN SELECT 1 FROM t2 WHERE a IN id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 256 Using where +SHOW VARIABLES LIKE 'old'; +Variable_name Value +old OFF +SET @@old = off; +ERROR HY000: Variable 'old' is a read only variable DROP TABLE t1, t2; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index a3318745764..fb9c09d4763 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -755,7 +755,8 @@ SET SQL_MODE = ''; # # Bug #21174: Index degrades sort performance and -# optimizer does not honor IGNORE INDEX +# optimizer does not honor IGNORE INDEX. +# a.k.a WL3527. # CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), @@ -819,4 +820,8 @@ EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2; EXPLAIN SELECT 1 FROM t2 WHERE a IN (SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2)); +SHOW VARIABLES LIKE 'old'; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@old = off; + DROP TABLE t1, t2; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a0687929de5..887d14e7f38 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6268,7 +6268,7 @@ The minimum value for this variable is 4096.", (gptr*) &global_system_variables.net_write_timeout, (gptr*) &max_system_variables.net_write_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, - { "old_mode", OPT_OLD_MODE, "Use compatible behaviour.", + { "old", OPT_OLD_MODE, "Use compatible behavior.", (gptr*) &global_system_variables.old_mode, (gptr*) &max_system_variables.old_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/sql/set_var.cc b/sql/set_var.cc index fef6fccfd06..7f55556c134 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -356,6 +356,8 @@ sys_var_thd_ulong sys_net_retry_count("net_retry_count", &SV::net_retry_count, 0, fix_net_retry_count); sys_var_thd_bool sys_new_mode("new", &SV::new_mode); +sys_var_bool_ptr_readonly sys_old_mode("old", + &global_system_variables.old_mode); sys_var_thd_bool sys_old_alter_table("old_alter_table", &SV::old_alter_table); sys_var_thd_bool sys_old_passwords("old_passwords", &SV::old_passwords); @@ -942,6 +944,7 @@ SHOW_VAR init_vars[]= { {sys_net_retry_count.name, (char*) &sys_net_retry_count, SHOW_SYS}, {sys_net_write_timeout.name,(char*) &sys_net_write_timeout, SHOW_SYS}, {sys_new_mode.name, (char*) &sys_new_mode, SHOW_SYS}, + {sys_old_mode.name, (char*) &sys_old_mode, SHOW_SYS}, {sys_old_alter_table.name, (char*) &sys_old_alter_table, SHOW_SYS}, {sys_old_passwords.name, (char*) &sys_old_passwords, SHOW_SYS}, {"open_files_limit", (char*) &open_files_limit, SHOW_LONG}, diff --git a/sql/set_var.h b/sql/set_var.h index 8887d91ec69..eac03fce610 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -169,6 +169,16 @@ public: }; +class sys_var_bool_ptr_readonly :public sys_var_bool_ptr +{ +public: + sys_var_bool_ptr_readonly(const char *name_arg, my_bool *value_arg) + :sys_var_bool_ptr(name_arg, value_arg) + {} + bool is_readonly() const { return 1; } +}; + + class sys_var_str :public sys_var { public: diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 4d7c2c485ab..995ed220d10 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5772,7 +5772,6 @@ bool setup_tables_and_check_access(THD *thd, TABLE_LIST *leaves_tmp= NULL; bool first_table= true; - thd->leaf_count= 0; if (setup_tables(thd, context, from_clause, tables, &leaves_tmp, select_insert)) return TRUE; @@ -5790,7 +5789,6 @@ bool setup_tables_and_check_access(THD *thd, return TRUE; } first_table= 0; - thd->leaf_count++; } return FALSE; } From cdbe7302d77759c318ac42ac205712ed0dec7736 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 21:10:34 +0200 Subject: [PATCH 374/789] correction of manual merge --- sql/ha_ndbcluster.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 84af9451d04..8e8aa162fff 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3159,15 +3159,15 @@ void ndb_unpack_record(TABLE *table, NdbValue *value, #ifdef WORDS_BIGENDIAN /* lsw is stored first */ Uint32 *buf= (Uint32 *)(*value).rec->aRef(); - ((Field_bit *) *field)->store((((longlong)*buf) - & 0x000000000FFFFFFFF) - | - ((((longlong)*(buf+1)) << 32) - & 0xFFFFFFFF00000000), - TRUE); + field_bit->Field_bit::store((((longlong)*buf) + & 0x000000000FFFFFFFF) + | + ((((longlong)*(buf+1)) << 32) + & 0xFFFFFFFF00000000), + TRUE); #else - ((Field_bit *) *field)->store((longlong) - (*value).rec->u_64_value(), TRUE); + field_bit->Field_bit::store((longlong) + (*value).rec->u_64_value(), TRUE); #endif } /* From aaef396b5aee34caa28498b9c50b13815bdb2257 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 16:45:17 -0700 Subject: [PATCH 375/789] Adjusting locks for concurrency issue (not found, but suspect). storage/archive/ha_archive.cc: Adjusted lock positions to handle possible concurrency condition --- storage/archive/ha_archive.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 72647b58f54..aaafcc86168 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1003,7 +1003,6 @@ int ha_archive::rnd_init(bool scan) /* We rewind the file so that we can read from the beginning if scan */ if (scan) { - scan_rows= share->rows_recorded; DBUG_PRINT("info", ("archive will retrieve %llu rows", (unsigned long long) scan_rows)); stats.records= 0; @@ -1012,17 +1011,18 @@ int ha_archive::rnd_init(bool scan) If dirty, we lock, and then reset/flush the data. I found that just calling azflush() doesn't always work. */ + pthread_mutex_lock(&share->mutex); + scan_rows= share->rows_recorded; if (share->dirty == TRUE) { - pthread_mutex_lock(&share->mutex); if (share->dirty == TRUE) { DBUG_PRINT("ha_archive", ("archive flushing out rows for scan")); azflush(&(share->archive_write), Z_SYNC_FLUSH); share->dirty= FALSE; } - pthread_mutex_unlock(&share->mutex); } + pthread_mutex_unlock(&share->mutex); if (read_data_header(&archive)) DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); From ba63bc68419432a9f551d5545b0ba7af4080c55b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 17:15:31 -0700 Subject: [PATCH 376/789] Centralized init logic for starting a scan. storage/archive/ha_archive.cc: Removed multiple execution logic --- storage/archive/ha_archive.cc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 72647b58f54..d0f751fce32 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -923,7 +923,7 @@ int ha_archive::index_read(byte *buf, const byte *key, int ha_archive::index_read_idx(byte *buf, uint index, const byte *key, uint key_len, enum ha_rkey_function find_flag) { - int rc= 0; + int rc; bool found= 0; KEY *mkey= &table->s->key_info[index]; current_k_offset= mkey->key_part->offset; @@ -933,22 +933,10 @@ int ha_archive::index_read_idx(byte *buf, uint index, const byte *key, DBUG_ENTER("ha_archive::index_read_idx"); - /* - All of the buffer must be written out or we won't see all of the - data - */ - pthread_mutex_lock(&share->mutex); - azflush(&(share->archive_write), Z_SYNC_FLUSH); - pthread_mutex_unlock(&share->mutex); + rc= rnd_init(TRUE); - /* - Set the position of the local read thread to the beginning postion. - */ - if (read_data_header(&archive)) - { - rc= HA_ERR_CRASHED_ON_USAGE; + if (rc) goto error; - } while (!(get_row(&archive, buf))) { From e33f3709c8ce7cf535bad4965046b825ae9fe538 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Mar 2007 22:50:08 -0700 Subject: [PATCH 377/789] Making sure thar archive is inited for info AUTO call. storage/archive/ha_archive.cc: Adding init for HA_STATUS_AUTO call --- storage/archive/ha_archive.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index cacee63277a..6853e879f55 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1486,6 +1486,7 @@ int ha_archive::info(uint flag) if (flag & HA_STATUS_AUTO) { + init_archive_reader(); azflush(&archive, Z_SYNC_FLUSH); stats.auto_increment_value= archive.auto_increment; } From 916245f9c41c3f6170e384ed6d9241ed79ca781e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 12:20:20 +0500 Subject: [PATCH 378/789] Bug#27079 Crash while grouping empty ucs2 strings Problem: GROUP BY on empty ucs2 strings crashed server. Reason: sometimes mi_unique_hash() is executed with ptr=null and length=0, which means "empty string". The branch of code handling UCS2 character set was not safe against ptr=null and fell into and endless loop even if length=0 because of poiter arithmetic overflow. Fix: adding special check for length=0 to avoid pointer arithmetic overflow. mysql-test/r/ctype_uca.result: Adding test case mysql-test/t/ctype_uca.test: Adding test case strings/ctype-uca.c: Fix my_uca_scanner_init_ucs2 to be safe against strings with length=0 and ptr=0. --- mysql-test/r/ctype_uca.result | 9 +++++++++ mysql-test/t/ctype_uca.test | 10 ++++++++++ strings/ctype-uca.c | 34 +++++++++++++++++++++++++++------- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 3e286c77c00..1fd1493bf1e 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2654,3 +2654,12 @@ ii 2 ii 2 İİ 4 İİ 4 ii 2 İİ 4 II 2 ıı 4 II 2 DROP TABLE t1; +CREATE TABLE t1 ( +c1 text character set ucs2 collate ucs2_polish_ci NOT NULL +) ENGINE=MyISAM; +insert into t1 values (''),('a'); +SELECT COUNT(*), c1 FROM t1 GROUP BY c1; +COUNT(*) c1 +1 +1 a +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 3e49b9de883..64349bc40a6 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -475,3 +475,13 @@ ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci; SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu FROM t1 ORDER BY id; DROP TABLE t1; + +# +# Bug #27079 Crash while grouping empty ucs2 strings +# +CREATE TABLE t1 ( + c1 text character set ucs2 collate ucs2_polish_ci NOT NULL +) ENGINE=MyISAM; +insert into t1 values (''),('a'); +SELECT COUNT(*), c1 FROM t1 GROUP BY c1; +DROP TABLE IF EXISTS t1; diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 1292d7f5ede..3aad36f858c 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -6744,7 +6744,7 @@ typedef struct my_uca_scanner_handler_st int (*next)(my_uca_scanner *scanner); } my_uca_scanner_handler; -static uint16 nochar[]= {0}; +static uint16 nochar[]= {0,0}; #ifdef HAVE_CHARSET_ucs2 @@ -6769,13 +6769,33 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, CHARSET_INFO *cs __attribute__((unused)), const uchar *str, uint length) { - /* Note, no needs to initialize scanner->wbeg */ - scanner->sbeg= str; - scanner->send= str + length - 2; scanner->wbeg= nochar; - scanner->uca_length= cs->sort_order; - scanner->uca_weight= cs->sort_order_big; - scanner->contractions= cs->contractions; + if (length) + { + scanner->sbeg= str; + scanner->send= str + length - 2; + scanner->uca_length= cs->sort_order; + scanner->uca_weight= cs->sort_order_big; + scanner->contractions= cs->contractions; + } + else + { + /* + Sometimes this function is called with + str=NULL and length=0, which should be + considered as an empty string. + + The above initialization is unsafe for such cases, + because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE. + Then we fall into an endless loop in my_uca_scanner_next_ucs2(). + + Do special initialization for the case when length=0. + Initialize scanner->sbeg to an address greater than scanner->send. + Next call of my_uca_scanner_next_ucs2() will correctly return with -1. + */ + scanner->sbeg= (uchar*) &nochar[1]; + scanner->send= (uchar*) &nochar[0]; + } } From 27b333b75c989ed820b8b10612c96cfe9f887822 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 13:30:43 +0500 Subject: [PATCH 379/789] Bug#25946 Namespace not include for xsi usage within --xml output with null/nil values Fix: adding namespace reference into "mysql --xml" output, to make it work similary to "mysqldump --xml". client/mysql.cc: Adding namespace reference. mysql-test/r/client_xml.result: Fixing test results --- client/mysql.cc | 3 ++- mysql-test/r/client_xml.result | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 2faa2f31a50..510420fdf3d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2529,7 +2529,8 @@ print_table_data_xml(MYSQL_RES *result) tee_fputs("\n\n", PAGER); + tee_fputs("\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">", + PAGER); fields = mysql_fetch_fields(result); while ((cur = mysql_fetch_row(result))) diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index 7395b2433e8..6a148954fcd 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -7,7 +7,7 @@ insert into t1 values (1, 2, 'a&b ab'); +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 1 2 @@ -34,7 +34,7 @@ insert into t1 values (1, 2, 'a&b ab'); +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 1 @@ -42,7 +42,7 @@ insert into t1 values (1, 2, 'a&b ab'); +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 1 @@ -50,7 +50,7 @@ insert into t1 values (1, 2, 'a&b ab'); +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 0 @@ -58,7 +58,7 @@ insert into t1 values (1, 2, 'a&b ab'); +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 1 @@ -66,7 +66,7 @@ insert into t1 values (1, 2, 'a&b ab'); +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> From 1fd0ba8909465f70c3b4e5d4dea4dc56b132896a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 10:49:48 +0200 Subject: [PATCH 380/789] Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE causes incorrect duplicate entries Keys for BTREE indexes on ENUM and SET columns of MEMORY tables with character set UTF8 were computed incorrectly. Many different column values got the same key value. Apart of possible performance problems, it made unique indexes of this type unusable because it rejected many different values as duplicates. The problem was that multibyte character detection was tried on the internal numeric column value. Many values were not identified as characters. Their key value became blank filled. Thanks to Alexander Barkov and Ramil Kalimullin for the patch, which sets the character set of ENUM and SET key segments to the pseudo binary character set. mysql-test/r/heap_btree.result: Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE causes incorrect duplicate entries Added test result. mysql-test/t/heap_btree.test: Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE causes incorrect duplicate entries Added test. sql/ha_heap.cc: Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE causes incorrect duplicate entries Set key segment charset to my_charset_bin for ENUM and SET columns. --- mysql-test/r/heap_btree.result | 12 ++++++++++++ mysql-test/t/heap_btree.test | 17 +++++++++++++++++ sql/ha_heap.cc | 5 ++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result index e6492e90b80..512a8a52845 100644 --- a/mysql-test/r/heap_btree.result +++ b/mysql-test/r/heap_btree.result @@ -280,4 +280,16 @@ a 1 1 drop table t1; +CREATE TABLE t1 ( +c1 ENUM('1', '2'), +UNIQUE USING BTREE(c1) +) ENGINE= MEMORY DEFAULT CHARSET= utf8; +INSERT INTO t1 VALUES('1'), ('2'); +DROP TABLE t1; +CREATE TABLE t1 ( +c1 SET('1', '2'), +UNIQUE USING BTREE(c1) +) ENGINE= MEMORY DEFAULT CHARSET= utf8; +INSERT INTO t1 VALUES('1'), ('2'); +DROP TABLE t1; End of 4.1 tests diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 9aa820becd9..eb4672473f6 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -182,4 +182,21 @@ delete from t1 where a >= 2; select a from t1 order by a; drop table t1; +# +# Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE +# causes incorrect duplicate entries +# +CREATE TABLE t1 ( + c1 ENUM('1', '2'), + UNIQUE USING BTREE(c1) +) ENGINE= MEMORY DEFAULT CHARSET= utf8; +INSERT INTO t1 VALUES('1'), ('2'); +DROP TABLE t1; +CREATE TABLE t1 ( + c1 SET('1', '2'), + UNIQUE USING BTREE(c1) +) ENGINE= MEMORY DEFAULT CHARSET= utf8; +INSERT INTO t1 VALUES('1'), ('2'); +DROP TABLE t1; + --echo End of 4.1 tests diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 3e981087df7..dd3a84aaaee 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -549,7 +549,10 @@ int ha_heap::create(const char *name, TABLE *table_arg, seg->start= (uint) key_part->offset; seg->length= (uint) key_part->length; seg->flag = 0; - seg->charset= field->charset(); + if (field->flags & (ENUM_FLAG | SET_FLAG)) + seg->charset= &my_charset_bin; + else + seg->charset= field->charset(); if (field->null_ptr) { seg->null_bit= field->null_bit; From d393fc102d3498ac85acaa83e93e15357a9d3a8c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 11:12:26 +0200 Subject: [PATCH 381/789] Bug #27444 DataMemory missing from report in cluster logs - error in initial signal length giving uninitialized variable --- storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 9f998dc4517..7563712d481 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -517,7 +517,7 @@ void Dbtup::execNDB_STTOR(Signal* signal) /*****************************************/ signal->theData[0] = ZREPORT_MEMORY_USAGE; signal->theData[1] = 0; - sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 1); + sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 2); break; default: ljam(); From b1c23f112f00a7e9ab05c69dbf314cea2466ba98 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 15:06:41 +0500 Subject: [PATCH 382/789] Bug#22378 Make error, strings/ctype-utf8.c, uni_plane undeclared - Fixing utf8_general_cs according to recent changes. - Compiling utf8_general_cs in pentium-debug-max configuration to avoid these problems in the future. BUILD/compile-pentium-debug-max: Enable compiling of experimental collations in compile-pentium-debug-max config/ac-macros/character_sets.m4: Adding hidden flag --with-experimental-collations, not seen in "configure --help". strings/ctype-utf8.c: Compilation failure changes: catching up with previous character set changes: - uni_plane is now not a global variables - adding new parameter into my_strnncollsp_utf8_cs - adding my_strnxfrm_len into MY_COLLATION_HANDLER for utf8_general_cs --- BUILD/compile-pentium-debug-max | 2 +- config/ac-macros/character_sets.m4 | 13 +++++++++++++ strings/ctype-utf8.c | 7 ++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max index 7a11ad24c44..a69513ac6bb 100755 --- a/BUILD/compile-pentium-debug-max +++ b/BUILD/compile-pentium-debug-max @@ -6,6 +6,6 @@ path=`dirname $0` extra_flags="$pentium_cflags $debug_cflags $max_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" -extra_configs="$pentium_configs $debug_configs $max_configs" +extra_configs="$pentium_configs $debug_configs $max_configs --with-experimental-collations" . "$path/FINISH.sh" diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4 index 1ab6e7dd780..8c3e8ca73b7 100644 --- a/config/ac-macros/character_sets.m4 +++ b/config/ac-macros/character_sets.m4 @@ -429,3 +429,16 @@ then else AC_MSG_RESULT(no) fi + + +# Shall we build experimental collations +AC_ARG_WITH(experimental-collations, + [], + [with_exp_coll=$withval], + [with_exp_coll=no] +) + +if test "$with_exp_coll" = "yes" +then + AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer]) +fi diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 0e28ff7e342..387ce16a43d 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2764,6 +2764,7 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs, const uchar *te=t+tlen; int save_diff = 0; int diff; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -2800,13 +2801,16 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs, static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs, const uchar *s, uint slen, - const uchar *t, uint tlen) + const uchar *t, uint tlen, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) { int s_res,t_res; my_wc_t s_wc,t_wc; const uchar *se= s+slen; const uchar *te= t+tlen; int save_diff = 0; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -2875,6 +2879,7 @@ static MY_COLLATION_HANDLER my_collation_cs_handler = my_strnncoll_utf8_cs, my_strnncollsp_utf8_cs, my_strnxfrm_utf8, + my_strnxfrmlen_utf8, my_like_range_simple, my_wildcmp_mb, my_strcasecmp_utf8, From 32b9ab07de3bdc4ab61bd50310176f1361954606 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 12:17:51 +0200 Subject: [PATCH 383/789] BUG#27441 (There is no COLS bitmap for the after image of an update rows event): Adding a after image COLS bitmap to Update_rows_log_event (for telling what columns that are present in the after image of each row update). Also fixing case where Rows_log_event length was not correctly computed (happened when the number of columns in a table was more than 251). mysql-test/r/rpl_row_inexist_tbl.result: Result change. sql/log_event.cc: Extending Rows_log_event with two new fields: m_bitbuf_ai and m_cols_ai. These fields are only used for the Update_rows_log_event. Adding implementation of Update_rows_log_event destructor. Using new after image fields inside the Update_rows_log_event. Factoring out common constructor bodies into Update_rows_log_event::init() function. Fixing case where length of Rows_log_event was not correctly computed (for tables with more than 251 columns). sql/log_event.h: Moving implementation of Rows_log_event::get_data_size() into .cc file. Adding Update_rows_log_event constructor accepting both before image and after image COLS vector. Adding Update_rows_log_vector destructor. Adding fields m_bitbuf_ai and m_cols_ai to Rows_log_event. Fixing is_valid() to look at m_cols_ai as well. --- mysql-test/r/rpl_row_inexist_tbl.result | 2 +- sql/log_event.cc | 160 +++++++++++++++++++++--- sql/log_event.h | 47 +++++-- 3 files changed, 177 insertions(+), 32 deletions(-) diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/r/rpl_row_inexist_tbl.result index 188dfd5924a..d482f6f5e94 100644 --- a/mysql-test/r/rpl_row_inexist_tbl.result +++ b/mysql-test/r/rpl_row_inexist_tbl.result @@ -39,7 +39,7 @@ Replicate_Wild_Ignore_Table Last_Errno 1146 Last_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1` Skip_Counter 0 -Exec_Master_Log_Pos 522 +Exec_Master_Log_Pos 523 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/sql/log_event.cc b/sql/log_event.cc index ac8984c64bc..b146fe044d2 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5604,7 +5604,10 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, memcpy(m_cols.bitmap, cols->bitmap, no_bytes_in_map(cols)); } else - m_cols.bitmap= 0; // to not free it + { + // Needed because bitmap_init() does not set it to null on failure + m_cols.bitmap= 0; + } } #endif @@ -5641,14 +5644,57 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, m_flags= uint2korr(post_start); - byte const *const var_start= (const byte *)buf + common_header_len + - post_header_len; + byte const *const var_start= + (const byte *)buf + common_header_len + post_header_len; byte const *const ptr_width= var_start; uchar *ptr_after_width= (uchar*) ptr_width; + DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); m_width = net_field_length(&ptr_after_width); + DBUG_PRINT("debug", ("m_width=%lu", m_width)); + /* if bitmap_init fails, catched in is_valid() */ + if (likely(!bitmap_init(&m_cols, + m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, + (m_width + 7) & ~7UL, + false))) + { + DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); + memcpy(m_cols.bitmap, ptr_after_width, (m_width + 7) / 8); + ptr_after_width+= (m_width + 7) / 8; + DBUG_DUMP("m_cols", (char*) m_cols.bitmap, no_bytes_in_map(&m_cols)); + } + else + { + // Needed because bitmap_init() does not set it to null on failure + m_cols.bitmap= NULL; + DBUG_VOID_RETURN; + } - const uint byte_count= (m_width + 7) / 8; - const byte* const ptr_rows_data= var_start + byte_count + 1; + m_cols_ai.bitmap= m_cols.bitmap; /* See explanation in is_valid() */ + + if (event_type == UPDATE_ROWS_EVENT) + { + DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); + + /* if bitmap_init fails, catched in is_valid() */ + if (likely(!bitmap_init(&m_cols_ai, + m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL, + (m_width + 7) & ~7UL, + false))) + { + DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); + memcpy(m_cols_ai.bitmap, ptr_after_width, (m_width + 7) / 8); + ptr_after_width+= (m_width + 7) / 8; + DBUG_DUMP("m_cols_ai", (char*) m_cols_ai.bitmap, no_bytes_in_map(&m_cols_ai)); + } + else + { + // Needed because bitmap_init() does not set it to null on failure + m_cols_ai.bitmap= 0; + DBUG_VOID_RETURN; + } + } + + const byte* const ptr_rows_data= (const byte*) ptr_after_width; my_size_t const data_size= event_len - (ptr_rows_data - (const byte *) buf); DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %lu", @@ -5657,12 +5703,6 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, m_rows_buf= (byte*)my_malloc(data_size, MYF(MY_WME)); if (likely((bool)m_rows_buf)) { - /* if bitmap_init fails, catched in is_valid() */ - if (likely(!bitmap_init(&m_cols, - m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, - (m_width + 7) & ~7UL, - false))) - memcpy(m_cols.bitmap, ptr_after_width, byte_count); m_rows_end= m_rows_buf + data_size; m_rows_cur= m_rows_end; memcpy(m_rows_buf, ptr_rows_data, data_size); @@ -5681,6 +5721,29 @@ Rows_log_event::~Rows_log_event() my_free((gptr)m_rows_buf, MYF(MY_ALLOW_ZERO_PTR)); } +int Rows_log_event::get_data_size() +{ + int const type_code= get_type_code(); + + char buf[sizeof(m_width)+1]; + char *end= net_store_length(buf, (m_width + 7) / 8); + + DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", + return 6 + no_bytes_in_map(&m_cols) + (end - buf) + + (type_code == UPDATE_ROWS_EVENT ? no_bytes_in_map(&m_cols_ai) : 0) + + (m_rows_cur - m_rows_buf);); + int data_size= ROWS_HEADER_LEN; + data_size+= no_bytes_in_map(&m_cols); + data_size+= end - buf; + + if (type_code == UPDATE_ROWS_EVENT) + data_size+= no_bytes_in_map(&m_cols_ai); + + data_size+= (m_rows_cur - m_rows_buf); + return data_size; +} + + #ifndef MYSQL_CLIENT int Rows_log_event::do_add_row_data(byte *const row_data, my_size_t const length) @@ -5911,7 +5974,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) If m_table_id == ~0UL, then we have a dummy event that does not contain any data. In that case, we just remove all tables in the tables_to_lock list, close the thread tables, and return with - success. The relay log position will be stepped in + success. */ if (m_table_id == ~0UL) { @@ -6291,15 +6354,35 @@ bool Rows_log_event::write_data_body(IO_CACHE*file) */ char sbuf[sizeof(m_width)]; my_ptrdiff_t const data_size= m_rows_cur - m_rows_buf; + bool res= false; char *const sbuf_end= net_store_length((char*) sbuf, (uint) m_width); DBUG_ASSERT(static_cast(sbuf_end - sbuf) <= sizeof(sbuf)); - return (my_b_safe_write(file, reinterpret_cast(sbuf), - sbuf_end - sbuf) || - my_b_safe_write(file, reinterpret_cast(m_cols.bitmap), - no_bytes_in_map(&m_cols)) || - my_b_safe_write(file, m_rows_buf, (uint) data_size)); + DBUG_DUMP("m_width", sbuf, sbuf_end - sbuf); + res= res || my_b_safe_write(file, + reinterpret_cast(sbuf), + sbuf_end - sbuf); + + DBUG_DUMP("m_cols", (char*) m_cols.bitmap, no_bytes_in_map(&m_cols)); + res= res || my_b_safe_write(file, + reinterpret_cast(m_cols.bitmap), + no_bytes_in_map(&m_cols)); + /* + TODO[refactor write]: Remove the "down cast" here (and elsewhere). + */ + if (get_type_code() == UPDATE_ROWS_EVENT) + { + DBUG_DUMP("m_cols_ai", (char*) m_cols_ai.bitmap, no_bytes_in_map(&m_cols_ai)); + res= res || my_b_safe_write(file, + reinterpret_cast(m_cols_ai.bitmap), + no_bytes_in_map(&m_cols_ai)); + } + DBUG_DUMP("rows", m_rows_buf, data_size); + res= res || my_b_safe_write(file, m_rows_buf, (uint) data_size); + + return res; + } #endif @@ -7584,16 +7667,55 @@ void Delete_rows_log_event::print(FILE *file, */ #if !defined(MYSQL_CLIENT) Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg, - ulong tid, MY_BITMAP const *cols, + ulong tid, + MY_BITMAP const *cols_bi, + MY_BITMAP const *cols_ai, + bool is_transactional) +: Rows_log_event(thd_arg, tbl_arg, tid, cols_bi, is_transactional) +#ifdef HAVE_REPLICATION + , m_memory(NULL), m_key(NULL) + +#endif +{ + init(cols_ai); +} + +Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg, + ulong tid, + MY_BITMAP const *cols, bool is_transactional) : Rows_log_event(thd_arg, tbl_arg, tid, cols, is_transactional) #ifdef HAVE_REPLICATION , m_memory(NULL), m_key(NULL) #endif { + init(cols); +} + +void Update_rows_log_event::init(MY_BITMAP const *cols) +{ + /* if bitmap_init fails, catched in is_valid() */ + if (likely(!bitmap_init(&m_cols_ai, + m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL, + (m_width + 7) & ~7UL, + false))) + { + /* Cols can be zero if this is a dummy binrows event */ + if (likely(cols != NULL)) + memcpy(m_cols_ai.bitmap, cols->bitmap, no_bytes_in_map(cols)); + } } #endif /* !defined(MYSQL_CLIENT) */ + +Update_rows_log_event::~Update_rows_log_event() +{ + if (m_cols_ai.bitmap == m_bitbuf_ai) // no my_malloc happened + m_cols_ai.bitmap= 0; // so no my_free in bitmap_free + bitmap_free(&m_cols_ai); // To pair with bitmap_init(). +} + + /* Constructor used by slave to read the event from the binary log. */ @@ -7678,7 +7800,7 @@ int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli, store_record(table, record[1]); char const *next_start = *row_end; /* m_after_image is the after image for the update */ - error= unpack_row(rli, table, m_width, next_start, &m_cols, row_end, + error= unpack_row(rli, table, m_width, next_start, &m_cols_ai, row_end, &m_master_reclength, table->write_set, UPDATE_ROWS_EVENT); bmove_align(m_after_image, table->record[0], table->s->reclength); restore_record(table, record[1]); diff --git a/sql/log_event.h b/sql/log_event.h index a573140ef33..a5dbaed6855 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2160,14 +2160,7 @@ public: #endif /* Member functions to implement superclass interface */ - virtual int get_data_size() - { - DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", - return 6 + 1 + no_bytes_in_map(&m_cols) + - (m_rows_cur - m_rows_buf);); - return ROWS_HEADER_LEN + 1 + no_bytes_in_map(&m_cols) + - (m_rows_cur - m_rows_buf); - } + virtual int get_data_size(); MY_BITMAP const *get_cols() const { return &m_cols; } my_size_t get_width() const { return m_width; } @@ -2178,9 +2171,14 @@ public: virtual bool write_data_body(IO_CACHE *file); virtual const char *get_db() { return m_table->s->db.str; } #endif + /* + Check that malloc() succeeded in allocating memory for the rows + buffer and the COLS vector. Checking that an Update_rows_log_event + is valid is done in the Update_rows_log_event::is_valid() + function. + */ virtual bool is_valid() const { - /* that's how we check malloc() succeeded */ return m_rows_buf && m_cols.bitmap; } @@ -2213,10 +2211,20 @@ protected: ulong m_table_id; /* Table ID */ MY_BITMAP m_cols; /* Bitmap denoting columns available */ ulong m_width; /* The width of the columns bitmap */ + /* + Bitmap for columns available in the after image, if present. These + fields are only available for Update_rows events. Observe that the + width of both the before image COLS vector and the after image + COLS vector is the same: the number of columns of the table on the + master. + */ + MY_BITMAP m_cols_ai; + ulong m_master_reclength; /* Length of record on master side */ - /* Bit buffer in the same memory as the class */ + /* Bit buffers in the same memory as the class */ uint32 m_bitbuf[128/(sizeof(uint32)*8)]; + uint32 m_bitbuf_ai[128/(sizeof(uint32)*8)]; byte *m_rows_buf; /* The rows in packed format */ byte *m_rows_cur; /* One-after the end of the data */ @@ -2376,10 +2384,20 @@ public: }; #ifndef MYSQL_CLIENT - Update_rows_log_event(THD*, TABLE*, ulong table_id, - MY_BITMAP const *cols, bool is_transactional); + Update_rows_log_event(THD*, TABLE*, ulong table_id, + MY_BITMAP const *cols_bi, + MY_BITMAP const *cols_ai, + bool is_transactional); + + Update_rows_log_event(THD*, TABLE*, ulong table_id, + MY_BITMAP const *cols, + bool is_transactional); + + void init(MY_BITMAP const *cols); #endif + virtual ~Update_rows_log_event(); + #ifdef HAVE_REPLICATION Update_rows_log_event(const char *buf, uint event_len, const Format_description_log_event *description_event); @@ -2398,6 +2416,11 @@ public: } #endif + virtual bool is_valid() const + { + return Rows_log_event::is_valid() && m_cols_ai.bitmap; + } + private: virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; } From de3c37195691a19ac504dd60daf516219d59c503 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 12:39:31 +0200 Subject: [PATCH 384/789] Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE causes incorrect duplicate entries After merge fix --- mysql-test/t/heap_btree.test | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 14b1779bd1a..d2891943a4e 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -182,6 +182,23 @@ delete from t1 where a >= 2; select a from t1 order by a; drop table t1; +# +# Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE +# causes incorrect duplicate entries +# +CREATE TABLE t1 ( + c1 ENUM('1', '2'), + UNIQUE USING BTREE(c1) +) ENGINE= MEMORY DEFAULT CHARSET= utf8; +INSERT INTO t1 VALUES('1'), ('2'); +DROP TABLE t1; +CREATE TABLE t1 ( + c1 SET('1', '2'), + UNIQUE USING BTREE(c1) +) ENGINE= MEMORY DEFAULT CHARSET= utf8; +INSERT INTO t1 VALUES('1'), ('2'); +DROP TABLE t1; + --echo End of 4.1 tests # @@ -204,22 +221,4 @@ CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY; INSERT INTO t1 VALUES(NULL),(NULL); DROP TABLE t1; -# -# Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE -# causes incorrect duplicate entries -# -CREATE TABLE t1 ( - c1 ENUM('1', '2'), - UNIQUE USING BTREE(c1) -) ENGINE= MEMORY DEFAULT CHARSET= utf8; -INSERT INTO t1 VALUES('1'), ('2'); -DROP TABLE t1; -CREATE TABLE t1 ( - c1 SET('1', '2'), - UNIQUE USING BTREE(c1) -) ENGINE= MEMORY DEFAULT CHARSET= utf8; -INSERT INTO t1 VALUES('1'), ('2'); -DROP TABLE t1; - ---echo End of 4.1 tests --echo End of 5.0 tests From 6da1cec05255cf0fff6f08c79f7c9ceecec1ae2c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 14:27:43 +0200 Subject: [PATCH 385/789] ndb - bug#27466 nf during nr can leave cluster in inconsistent state (recommit in 5.1) Fix race condition between NODE_FAILREP and local INCL_NODEREQ loop Also retry on ZNODE_START_DISALLOWED_ERROR storage/ndb/include/kernel/signaldata/StartPerm.hpp: Move error code storage/ndb/src/kernel/blocks/ERROR_codes.txt: new error code storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Move error code storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: 1) retry also on ZNODE_START_DISALLOWED_ERROR 2) Change if() else in INCL_NODECONF to for-loop instead 3) (last but not least) fix bug, that could cause different block withing same node to have different opinion about node status solution is to check if node is still alive before sening next local INCL_NODEREQ storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Add error insert to allow node to die during INCL_NODEREQ storage/ndb/src/kernel/blocks/suma/Suma.cpp: 1) let suma be well behaved (i.e reply to INCL_NODEREQ) 2) Add dump to print c_connceted_nodes/c_subscriber_nodes (8010) storage/ndb/test/ndbapi/testNodeRestart.cpp: new testcase storage/ndb/test/run-test/daily-basic-tests.txt: new testcase --- .../include/kernel/signaldata/StartPerm.hpp | 1 + storage/ndb/src/kernel/blocks/ERROR_codes.txt | 4 +- storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 1 - .../ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 91 ++++++++++--------- .../ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 13 +++ storage/ndb/src/kernel/blocks/suma/Suma.cpp | 14 ++- storage/ndb/test/ndbapi/testNodeRestart.cpp | 53 +++++++++++ .../ndb/test/run-test/daily-basic-tests.txt | 4 + 8 files changed, 130 insertions(+), 51 deletions(-) diff --git a/storage/ndb/include/kernel/signaldata/StartPerm.hpp b/storage/ndb/include/kernel/signaldata/StartPerm.hpp index ffb16bfec9d..16229f6552f 100644 --- a/storage/ndb/include/kernel/signaldata/StartPerm.hpp +++ b/storage/ndb/include/kernel/signaldata/StartPerm.hpp @@ -67,6 +67,7 @@ private: enum ErrorCode { ZNODE_ALREADY_STARTING_ERROR = 305, + ZNODE_START_DISALLOWED_ERROR = 309, InitialStartRequired = 320 }; }; diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt index 8639c1a360a..b3405679978 100644 --- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt @@ -6,7 +6,7 @@ Next DBTUP 4029 Next DBLQH 5045 Next DBDICT 6007 Next DBDIH 7183 -Next DBTC 8039 +Next DBTC 8040 Next CMVMI 9000 Next BACKUP 10038 Next DBUTIL 11002 @@ -327,6 +327,8 @@ Test Crashes in handling node restarts 7170: Crash when receiving START_PERMREF (InitialStartRequired) +8039: DBTC delay INCL_NODECONF and kill starting node + 7174: Crash starting node before sending DICT_LOCK_REQ 7175: Master sends one fake START_PERMREF (ZNODE_ALREADY_STARTING_ERROR) 7176: Slave NR pretends master does not support DICT lock (rolling upgrade) diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 06e417106c6..4c060ff4e2b 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -74,7 +74,6 @@ #define ZWRONG_FAILURE_NUMBER_ERROR 302 #define ZWRONG_START_NODE_ERROR 303 #define ZNO_REPLICA_FOUND_ERROR 304 -#define ZNODE_START_DISALLOWED_ERROR 309 // -------------------------------------- // Codes from LQH diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index a5b17d3e166..21c9dcbb4e7 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -1709,7 +1709,8 @@ void Dbdih::execSTART_PERMREF(Signal* signal) { jamEntry(); Uint32 errorCode = signal->theData[1]; - if (errorCode == StartPermRef::ZNODE_ALREADY_STARTING_ERROR) { + if (errorCode == StartPermRef::ZNODE_ALREADY_STARTING_ERROR || + errorCode == StartPermRef::ZNODE_START_DISALLOWED_ERROR) { jam(); /*-----------------------------------------------------------------------*/ // The master was busy adding another node. We will wait for a second and @@ -2056,49 +2057,49 @@ void Dbdih::execINCL_NODECONF(Signal* signal) TstartNode_or_blockref = signal->theData[0]; TsendNodeId = signal->theData[1]; - if (TstartNode_or_blockref == clocallqhblockref) { - jam(); - /*-----------------------------------------------------------------------*/ - // THIS SIGNAL CAME FROM THE LOCAL LQH BLOCK. - // WE WILL NOW SEND INCLUDE TO THE TC BLOCK. - /*-----------------------------------------------------------------------*/ - signal->theData[0] = reference(); - signal->theData[1] = c_nodeStartSlave.nodeId; - sendSignal(clocaltcblockref, GSN_INCL_NODEREQ, signal, 2, JBB); - return; - }//if - if (TstartNode_or_blockref == clocaltcblockref) { - jam(); - /*----------------------------------------------------------------------*/ - // THIS SIGNAL CAME FROM THE LOCAL LQH BLOCK. - // WE WILL NOW SEND INCLUDE TO THE DICT BLOCK. - /*----------------------------------------------------------------------*/ - signal->theData[0] = reference(); - signal->theData[1] = c_nodeStartSlave.nodeId; - sendSignal(cdictblockref, GSN_INCL_NODEREQ, signal, 2, JBB); - return; - }//if - if (TstartNode_or_blockref == cdictblockref) { - jam(); - /*-----------------------------------------------------------------------*/ - // THIS SIGNAL CAME FROM THE LOCAL DICT BLOCK. WE WILL NOW SEND CONF TO THE - // BACKUP. - /*-----------------------------------------------------------------------*/ - signal->theData[0] = reference(); - signal->theData[1] = c_nodeStartSlave.nodeId; - sendSignal(BACKUP_REF, GSN_INCL_NODEREQ, signal, 2, JBB); - - // Suma will not send response to this for now, later... - sendSignal(SUMA_REF, GSN_INCL_NODEREQ, signal, 2, JBB); - return; - }//if - if (TstartNode_or_blockref == numberToRef(BACKUP, getOwnNodeId())){ - jam(); - signal->theData[0] = c_nodeStartSlave.nodeId; - signal->theData[1] = cownNodeId; - sendSignal(cmasterdihref, GSN_INCL_NODECONF, signal, 2, JBB); - c_nodeStartSlave.nodeId = 0; - return; + static Uint32 blocklist[] = { + clocallqhblockref, + clocaltcblockref, + cdictblockref, + 0, + 0, + 0 + }; + blocklist[3] = numberToRef(BACKUP, getOwnNodeId()); + blocklist[4] = numberToRef(SUMA, getOwnNodeId()); + + Uint32 i = 0; + for (Uint32 i = 0; blocklist[i] != 0; i++) + { + if (TstartNode_or_blockref == blocklist[i]) + { + jam(); + if (getNodeStatus(c_nodeStartSlave.nodeId) == NodeRecord::ALIVE && + blocklist[i+1] != 0) + { + /** + * Send to next in block list + */ + jam(); + signal->theData[0] = reference(); + signal->theData[1] = c_nodeStartSlave.nodeId; + sendSignal(blocklist[i+1], GSN_INCL_NODEREQ, signal, 2, JBB); + return; + } + else + { + /** + * All done, reply to master + */ + jam(); + signal->theData[0] = c_nodeStartSlave.nodeId; + signal->theData[1] = cownNodeId; + sendSignal(cmasterdihref, GSN_INCL_NODECONF, signal, 2, JBB); + + c_nodeStartSlave.nodeId = 0; + return; + } + } } ndbrequire(cmasterdihref = reference()); @@ -2217,7 +2218,7 @@ void Dbdih::execSTART_INFOREQ(Signal* signal) StartInfoRef *const ref =(StartInfoRef*)&signal->theData[0]; ref->startingNodeId = startNode; ref->sendingNodeId = cownNodeId; - ref->errorCode = ZNODE_START_DISALLOWED_ERROR; + ref->errorCode = StartPermRef::ZNODE_START_DISALLOWED_ERROR; sendSignal(cmasterdihref, GSN_START_INFOREF, signal, StartInfoRef::SignalLength, JBB); return; diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index c4cfc149f9d..3baad90a5f0 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -311,6 +311,19 @@ void Dbtc::execINCL_NODEREQ(Signal* signal) hostptr.p->hostStatus = HS_ALIVE; signal->theData[0] = cownref; c_alive_nodes.set(hostptr.i); + + if (ERROR_INSERTED(8039)) + { + CLEAR_ERROR_INSERT_VALUE; + Uint32 save = signal->theData[0]; + signal->theData[0] = 9999; + sendSignal(numberToRef(CMVMI, hostptr.i), + GSN_NDB_TAMPER, signal, 1, JBB); + signal->theData[0] = save; + sendSignalWithDelay(tblockref, GSN_INCL_NODECONF, signal, 5000, 1); + return; + } + sendSignal(tblockref, GSN_INCL_NODECONF, signal, 1, JBB); } diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index 5ebb075d636..1197ffdad94 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -813,17 +813,14 @@ void Suma::execINCL_NODEREQ(Signal* signal){ jamEntry(); - //const Uint32 senderRef = signal->theData[0]; + const Uint32 senderRef = signal->theData[0]; const Uint32 nodeId = signal->theData[1]; ndbrequire(!c_alive_nodes.get(nodeId)); c_alive_nodes.set(nodeId); -#if 0 // if we include this DIH's got to be prepared, later if needed... signal->theData[0] = reference(); - sendSignal(senderRef, GSN_INCL_NODECONF, signal, 1, JBB); -#endif } void @@ -953,6 +950,15 @@ Suma::execDUMP_STATE_ORD(Signal* signal){ CLEAR_ERROR_INSERT_VALUE; } + if (tCase == 8010) + { + char buf1[255], buf2[255]; + c_subscriber_nodes.getText(buf1); + c_connected_nodes.getText(buf2); + infoEvent("c_subscriber_nodes: %s", buf1); + infoEvent("c_connected_nodes: %s", buf2); + } + if (tCase == 8009) { if (ERROR_INSERTED(13030)) diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp index 3f77945047c..03229ca029f 100644 --- a/storage/ndb/test/ndbapi/testNodeRestart.cpp +++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp @@ -1423,6 +1423,56 @@ runBug27283(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runBug27466(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + NdbRestarter res; + + if (res.getNumDbNodes() < 2) + { + return NDBT_OK; + } + + Uint32 pos = 0; + for (Uint32 i = 0; i Date: Tue, 27 Mar 2007 18:39:11 +0500 Subject: [PATCH 386/789] Bug #27359 Partition: memory allocation error message if ndbcluster's nodes aren't set, the handlerton can return zero partitions in the partitioned table. So we should check for that. sql/partition_info.cc: check for zero return added mysql-test/r/ndb_partition_error2.result: New BitKeeper file ``mysql-test/r/ndb_partition_error2.result'' mysql-test/t/ndb_partition_error2-master.opt: New BitKeeper file ``mysql-test/t/ndb_partition_error2-master.opt'' mysql-test/t/ndb_partition_error2.test: New BitKeeper file ``mysql-test/t/ndb_partition_error2.test'' --- mysql-test/r/ndb_partition_error2.result | 3 +++ mysql-test/t/ndb_partition_error2-master.opt | 1 + mysql-test/t/ndb_partition_error2.test | 14 ++++++++++++++ sql/partition_info.cc | 6 +++++- 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/ndb_partition_error2.result create mode 100644 mysql-test/t/ndb_partition_error2-master.opt create mode 100644 mysql-test/t/ndb_partition_error2.test diff --git a/mysql-test/r/ndb_partition_error2.result b/mysql-test/r/ndb_partition_error2.result new file mode 100644 index 00000000000..fd477306858 --- /dev/null +++ b/mysql-test/r/ndb_partition_error2.result @@ -0,0 +1,3 @@ +drop table if exists t1; +create table t1 (s1 int) engine=ndbcluster; +ERROR HY000: For the partitioned engine it is necessary to define all partition diff --git a/mysql-test/t/ndb_partition_error2-master.opt b/mysql-test/t/ndb_partition_error2-master.opt new file mode 100644 index 00000000000..955f7692c8b --- /dev/null +++ b/mysql-test/t/ndb_partition_error2-master.opt @@ -0,0 +1 @@ +--ndbcluster diff --git a/mysql-test/t/ndb_partition_error2.test b/mysql-test/t/ndb_partition_error2.test new file mode 100644 index 00000000000..afedd0e3c5c --- /dev/null +++ b/mysql-test/t/ndb_partition_error2.test @@ -0,0 +1,14 @@ +disable_query_log; +--require r/true.require +select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; +enable_query_log; + +--disable_warnings +drop table if exists t1; +--enable_warnings +# +# Bug #27359 Partitions: memory allocation error message +# +--error ER_PARTITION_NOT_DEFINED_ERROR +create table t1 (s1 int) engine=ndbcluster; + diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a7f9bd413c6..39aa3a6db92 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -753,7 +753,11 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, } if (unlikely(set_up_defaults_for_partitioning(file, info, (uint)0))) goto end; - tot_partitions= get_tot_partitions(); + if (!(tot_partitions= get_tot_partitions())) + { + my_error(ER_PARTITION_NOT_DEFINED_ERROR, MYF(0), "partitions"); + goto end; + } if (unlikely(tot_partitions > MAX_PARTITIONS)) { my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0)); From 2d0fe6920fbbee0a05c24e6d2643117dfbb29024 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 15:57:36 +0200 Subject: [PATCH 387/789] ndb - remove compiler warning from last changeset storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: remove compiler warning from last changeset --- storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 21c9dcbb4e7..e330afcef36 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -2068,7 +2068,6 @@ void Dbdih::execINCL_NODECONF(Signal* signal) blocklist[3] = numberToRef(BACKUP, getOwnNodeId()); blocklist[4] = numberToRef(SUMA, getOwnNodeId()); - Uint32 i = 0; for (Uint32 i = 0; blocklist[i] != 0; i++) { if (TstartNode_or_blockref == blocklist[i]) From 59ce334d4526e86b6e9210af1fb6723c54c3d0ba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 16:15:22 +0200 Subject: [PATCH 388/789] ndb - reformat code a bit to be more compiler friendly storage/ndb/test/src/NdbRestarts.cpp: more verbosity --- storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 13 +++++-------- storage/ndb/test/src/NdbRestarts.cpp | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index e330afcef36..76ff0dcc41b 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -2057,16 +2057,13 @@ void Dbdih::execINCL_NODECONF(Signal* signal) TstartNode_or_blockref = signal->theData[0]; TsendNodeId = signal->theData[1]; - static Uint32 blocklist[] = { - clocallqhblockref, - clocaltcblockref, - cdictblockref, - 0, - 0, - 0 - }; + Uint32 blocklist[6]; + blocklist[0] = clocallqhblockref; + blocklist[1] = clocaltcblockref; + blocklist[2] = cdictblockref; blocklist[3] = numberToRef(BACKUP, getOwnNodeId()); blocklist[4] = numberToRef(SUMA, getOwnNodeId()); + blocklist[5] = 0; for (Uint32 i = 0; blocklist[i] != 0; i++) { diff --git a/storage/ndb/test/src/NdbRestarts.cpp b/storage/ndb/test/src/NdbRestarts.cpp index 013c7a97d1f..6ec520887b5 100644 --- a/storage/ndb/test/src/NdbRestarts.cpp +++ b/storage/ndb/test/src/NdbRestarts.cpp @@ -630,8 +630,8 @@ int restartNFDuringNR(NdbRestarter& _restarter, int nodeId = _restarter.getDbNodeId(randomId); int error = NFDuringNR_codes[i]; - g_info << _restart->m_name << ": node = " << nodeId - << " error code = " << error << endl; + g_err << _restart->m_name << ": node = " << nodeId + << " error code = " << error << endl; CHECK(_restarter.restartOneDbNode(nodeId, false, true, true) == 0, "Could not restart node "<< nodeId); From 1178ab902b580274e97833aa77ba53f3acfbd545 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 16:47:08 +0200 Subject: [PATCH 389/789] ndb - remove compiler warning/error storage/ndb/test/ndbapi/testScanFilter.cpp: remove compiler warning/error --- storage/ndb/test/ndbapi/testScanFilter.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/storage/ndb/test/ndbapi/testScanFilter.cpp b/storage/ndb/test/ndbapi/testScanFilter.cpp index ba869dc8ce4..958b50d6701 100644 --- a/storage/ndb/test/ndbapi/testScanFilter.cpp +++ b/storage/ndb/test/ndbapi/testScanFilter.cpp @@ -765,18 +765,20 @@ void ndbapi_tuples(Ndb *ndb, char *str, bool *res) * str: a random string of scan opearation and condition * return: true stands for ndbapi ok, false stands for ndbapi failed */ +template class Vector; bool compare_cal_ndb(char *str, Ndb *ndb) { - bool res_cal[TUPLE_NUM], res_ndb[TUPLE_NUM]; + Vector res_cal; + Vector res_ndb; for(int i = 0; i < TUPLE_NUM; i++) { - res_cal[i] = false; - res_ndb[i] = false; + res_cal.push_back(false); + res_ndb.push_back(false); } - check_all_tuples(str, res_cal); - ndbapi_tuples(ndb, str, res_ndb); + check_all_tuples(str, res_cal.getBase()); + ndbapi_tuples(ndb, str, res_ndb.getBase()); for(int i = 0; i < TUPLE_NUM; i++) { From 47d5ed7f2b493e0c9eb20d46d6eab3e8f3651653 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 17:21:47 +0200 Subject: [PATCH 390/789] BUG#22583 (RBR between MyISAM and non-MyISAM tables containing a BIT field does not work): Enabling previously disabled test. mysql-test/t/disabled.def: Enabling test rpl_multi_engine. --- mysql-test/t/disabled.def | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 769c9ab1512..5ac1952edba 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -27,7 +27,6 @@ rpl_ndb_ddl : BUG#18946 result file needs update + test needs to ch rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly -rpl_multi_engine : BUG#22583 2006-09-23 lars synchronization : Bug#24529 Test 'synchronization' fails on Mac pushbuild; Also on Linux 64 bit. # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open From 60fb9a03a4e94e651ba459e60bebf38e1de86344 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 11:30:53 -0400 Subject: [PATCH 391/789] Bug#26600: table PROFILING in INFORMATION SCHEMA has wrong data type Bug#27047[partial]: INFORMATION_SCHEMA table cannot have BIGINT \ fields No Information_schema table has ever needed floating-point data before. Transforming all floating point to a string and back to a number causes a real data problem on Windows, where the libc may pad the exponent with more leading zeroes than we expect and the significant digits are truncated away. This also makes interpreting an unimplemented type as a string into a fatal error in debug builds. Thus, we will catch problems when we try to use those types in new I_S tables. sql/sql_show.cc: Add floating-point types to information_schema output. --- sql/sql_show.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 659dd49d537..d9984552048 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3592,7 +3592,16 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(0); } break; + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + if ((item= new Item_float(fields_info->field_name, 0.0, NOT_FIXED_DEC, + fields_info->field_length)) == NULL) + DBUG_RETURN(NULL); + break; default: + /* Don't let unimplemented types pass through. Could be a grave error. */ + DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING); + /* this should be changed when Item_empty_string is fixed(in 4.1) */ if (!(item= new Item_empty_string("", 0, cs))) { From 0d5a969acea2297d459f8f23c0030796a68cf00e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 17:42:55 +0200 Subject: [PATCH 392/789] mysql.spec.sh, Makefile.am: Don't use explicit calls to mysql-test-run in spec Makefile.am: Don't use explicit calls to mysql-test-run in spec support-files/mysql.spec.sh: Don't use explicit calls to mysql-test-run in spec --- Makefile.am | 6 ++++++ support-files/mysql.spec.sh | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 70ed8fa7bfe..f620f5d8ab8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,6 +132,12 @@ test-force-full: test-force-mem: $(MAKE) 'force=--force --mem' test +test-bt: + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=normal --report-features + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=ps --ps-protocol + # Keep these for a while test-pl: test test-full-pl: test-full diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 15c3e4910d8..ab544b65f74 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -319,10 +319,7 @@ then cp -fp config.log "$MYSQL_MAXCONFLOG_DEST" fi -( cd mysql-test - perl ./mysql-test-run.pl --force --report-features - perl ./mysql-test-run.pl --force --ps-protocol - true ) +make test-bt # Save mysqld-max ./libtool --mode=execute cp sql/mysqld sql/mysqld-max From 04c0f3cb6a40284962854e6859ededf1eb227084 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 17:45:23 +0200 Subject: [PATCH 393/789] Eliminating some compiler warnings. sql/log_event.cc: Adding non-reachable return statement at end of function to keep compiler happy. sql/slave.cc: In order to keep compiler happy: using variable only used in debug code instead of recalling virtual function. --- sql/log_event.cc | 1 + sql/slave.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index b146fe044d2..6a5add0599e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3683,6 +3683,7 @@ Rotate_log_event::do_shall_skip(RELAY_LOG_INFO *rli) return Log_event::EVENT_SKIP_IGNORE; } DBUG_ASSERT(0); + return Log_event::EVENT_SKIP_NOT; // To keep compiler happy } #endif diff --git a/sql/slave.cc b/sql/slave.cc index 278edae99f4..55a774fd747 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1722,7 +1722,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) } if (ev) { - int type_code = ev->get_type_code(); + int const type_code= ev->get_type_code(); int exec_res= 0; /* @@ -1828,7 +1828,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) used to read info about the relay log's format; it will be deleted when the SQL thread does not need it, i.e. when this thread terminates. */ - if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT) + if (type_code != FORMAT_DESCRIPTION_EVENT) { DBUG_PRINT("info", ("Deleting the event after it has been executed")); delete ev; From 57693826d1d2d8347a738a33083c9588caa6b78b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 18:48:05 +0300 Subject: [PATCH 394/789] Small fixes. sql/mysqld.cc: Added use of find_type_or_exit() for another option. sql/net_serv.cc: Bug in version number check, could occassionally make a tree red. --- sql/mysqld.cc | 18 +++++++----------- sql/net_serv.cc | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 083f0eb1373..65c4e360c4c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -280,7 +280,11 @@ static TYPELIB tc_heuristic_recover_typelib= }; static const char *thread_handling_names[]= -{ "one-thread-per-connection", "no-threads", "pool-of-threads", NullS}; +{ "one-thread-per-connection", "no-threads", +#if HAVE_POOL_OF_THREADS == 1 + "pool-of-threads", +#endif + NullS}; TYPELIB thread_handling_typelib= { @@ -7860,16 +7864,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case OPT_THREAD_HANDLING: { - if ((global_system_variables.thread_handling= - find_type(argument, &thread_handling_typelib, 2)) <= 0 || - (global_system_variables.thread_handling == SCHEDULER_POOL_OF_THREADS - && !HAVE_POOL_OF_THREADS)) - { - /* purecov: begin tested */ - fprintf(stderr,"Unknown/unsupported thread-handling: %s\n",argument); - exit(1); - /* purecov: end */ - } + global_system_variables.thread_handling= + find_type_or_exit(argument, &thread_handling_typelib, opt->name); break; } case OPT_FT_BOOLEAN_SYNTAX: diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 2156888b8cf..041a7fb67f6 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -298,7 +298,7 @@ void net_clear(NET *net, my_bool clear_buffer) { DBUG_PRINT("info",("skipped %d bytes from file: %s", count, vio_description(net->vio))); -#if defined(EXTRA_DEBUG) && (MYSQL_VERSION_ID < 51000) +#if defined(EXTRA_DEBUG) && (MYSQL_VERSION_ID < 50100) fprintf(stderr,"Error: net_clear() skipped %d bytes from file: %s\n", count, vio_description(net->vio)); #endif From 454e889f44912774738b96ab9c1dcd5fb1c96288 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 18:51:02 +0300 Subject: [PATCH 395/789] Fixes for 4.1 to be as in 5.0 and above. client/mysql.cc: Fixed to be as in 5.0 and above. client/mysqldump.c: Fixed to be as in 5.0 and above. include/my_sys.h: Fixed to be as in 5.0 and above. mysys/my_static.c: Fixed to be as in 5.0 and above. --- client/mysql.cc | 2 +- client/mysqldump.c | 2 +- include/my_sys.h | 2 +- mysys/my_static.c | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index d8810ba3c28..babfa870829 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -440,7 +440,7 @@ int main(int argc,char *argv[]) put_info((char*) glob_buffer.ptr(),INFO_INFO); #ifdef HAVE_READLINE - initialize_readline(my_progname); + initialize_readline((char*) my_progname); if (!status.batch && !quick && !opt_html && !opt_xml) { /* read-history from file, default ~/.mysql_history*/ diff --git a/client/mysqldump.c b/client/mysqldump.c index e9d48f3edfa..3bf9fff1b86 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2654,7 +2654,7 @@ int main(int argc, char **argv) default_charset= (char *)mysql_universal_client_charset; bzero((char*) &ignore_table, sizeof(ignore_table)); - MY_INIT(argv[0]); + MY_INIT("mysqldump"); if (get_options(&argc, &argv)) { my_end(0); diff --git a/include/my_sys.h b/include/my_sys.h index 4c9a7a7964c..e44f29ffdd8 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -203,7 +203,7 @@ extern int errno; /* declare errno */ extern const char ** NEAR my_errmsg[]; extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ -extern char *my_progname; /* program-name (printed in errors) */ +extern const char *my_progname; /* program-name (printed in errors) */ extern char NEAR curr_dir[]; /* Current directory for user */ extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); extern int (*fatal_error_handler_hook)(uint my_err, const char *str, diff --git a/mysys/my_static.c b/mysys/my_static.c index 5f034555156..041569c7f07 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -26,7 +26,8 @@ #endif /* from my_init */ -my_string home_dir=0,my_progname=0; +my_string home_dir=0; +const char *my_progname=0; char NEAR curr_dir[FN_REFLEN]= {0}, NEAR home_dir_buff[FN_REFLEN]= {0}; ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0; From 0e9a844feed02723df14101ee9b627710f16df3d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 18:04:02 +0200 Subject: [PATCH 396/789] Eliminating a warning for unused variable in non-debug build. --- sql/log_event.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/log_event.cc b/sql/log_event.cc index 6a5add0599e..6b5c234681b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5906,7 +5906,9 @@ unpack_row(RELAY_LOG_INFO const *rli, /* We only unpack the field if it was non-null */ +#ifndef DBUG_OFF const char *const old_ptr= pack_ptr; +#endif pack_ptr= f->unpack(f->ptr, pack_ptr); DBUG_PRINT("debug", ("Unpacking field '%s' from %d bytes", f->field_name, pack_ptr - old_ptr)); From e4dcf4e39c51d9045564163b6bc442bd7307a9f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 18:05:17 +0200 Subject: [PATCH 397/789] Corrected error in test case: - 1.84e+15 converted to unsigned bigint should be 18400000000000000000 < 18446744073709551615. - The test will still fail on windows, and is extracted into a new bug report. --- mysql-test/r/sp.result | 3 --- mysql-test/t/sp.test | 1 - 2 files changed, 4 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index a30584b3ef2..c75697b93a2 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6018,9 +6018,6 @@ upper bounds unsigned bigint + 1 select bug20777(-1) as 'lower bounds unsigned bigint - 1'; lower bounds unsigned bigint - 1 0 -select bug20777(1.84e+19) as 'submitter value, 1.84e19'; -submitter value, 1.84e19 -9223372036854775808 create table examplebug20777 as select 0 as 'i', bug20777(9223372036854775806) as '2**63-2', diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index ca506104ab7..8403c8589ef 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6955,7 +6955,6 @@ select bug20777(0) as 'lower bounds unsigned bigint'; select bug20777(18446744073709551615) as 'upper bounds unsigned bigint'; select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1'; select bug20777(-1) as 'lower bounds unsigned bigint - 1'; -select bug20777(1.84e+19) as 'submitter value, 1.84e19'; create table examplebug20777 as select 0 as 'i', From 66fcdd5403ba20a9f9f760c545fe49a297188f96 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 20:27:58 +0400 Subject: [PATCH 398/789] Change find_type family to accept const TYPELIB*. include/mysql_h.ic: Change find_type family to accept const TYPELIB*. This sort of change can not break the ABI. --- include/mysql_h.ic | 2 +- include/typelib.h | 3 ++- mysys/typelib.c | 2 +- sql/mysql_priv.h | 6 ++++-- sql/strfunc.cc | 6 ++++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/mysql_h.ic b/include/mysql_h.ic index 44c51b34c1d..7d16a886fd8 100644 --- a/include/mysql_h.ic +++ b/include/mysql_h.ic @@ -638,7 +638,7 @@ extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from); # 415 "mysql_com.h" extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st); # 30 "typelib.h" -extern int find_type(char * x, TYPELIB * typelib, unsigned int); +extern int find_type(char * x, const TYPELIB * typelib, unsigned int); # 429 "mysql_com.h" extern void get_salt_from_password(unsigned char * res, char const * password); # 422 "mysql_com.h" diff --git a/include/typelib.h b/include/typelib.h index 75d170e59d3..79d3acd2d64 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -26,7 +26,8 @@ typedef struct st_typelib { /* Different types saved here */ unsigned int *type_lengths; } TYPELIB; -extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name); +extern int find_type(const char *x, const TYPELIB *typelib, + unsigned int full_name); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/mysys/typelib.c b/mysys/typelib.c index 4fab6f20493..97b03b72b24 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -42,7 +42,7 @@ >0 Offset+1 in typelib for matched string */ -int find_type(my_string x, TYPELIB *typelib, uint full_name) +int find_type(const char *x, const TYPELIB *typelib, uint full_name) { int find,pos,findpos; reg1 my_string i; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 608fb697d4f..81c82cf3ac8 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1561,8 +1561,10 @@ extern bool check_reserved_words(LEX_STRING *name); /* strfunc.cc */ ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs, char **err_pos, uint *err_len, bool *set_warning); -uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match); -uint find_type2(TYPELIB *lib, const char *find, uint length, CHARSET_INFO *cs); +uint find_type(const TYPELIB *lib, const char *find, uint length, + bool part_match); +uint find_type2(const TYPELIB *lib, const char *find, uint length, + CHARSET_INFO *cs); void unhex_type2(TYPELIB *lib); uint check_word(TYPELIB *lib, const char *val, const char *end, const char **end_of_word); diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 71b52a5145d..9ffc5fd127f 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -104,7 +104,8 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, > 0 position in TYPELIB->type_names +1 */ -uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match) +uint find_type(const TYPELIB *lib, const char *find, uint length, + bool part_match) { uint found_count=0, found_pos=0; const char *end= find+length; @@ -144,7 +145,8 @@ uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match) >0 Offset+1 in typelib for matched string */ -uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) +uint find_type2(const TYPELIB *typelib, const char *x, uint length, + CHARSET_INFO *cs) { int pos; const char *j; From 8aa2d6bf920d513c6d9ffb260251ec893232f5da Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 19:28:04 +0300 Subject: [PATCH 399/789] Bug #26815: When creating a temporary table the concise column type of a string expression is decided based on its length: - if its length is under 512 it is stored as either varchar or char. - otherwise it is stored as a BLOB. There is a flag (convert_blob_length) to create_tmp_field that, when >0 allows to force creation of a varchar if the max blob length is under convert_blob_length. However it must be verified that convert_blob_length (settable through a SQL option in some cases) is under the maximum that can be stored in a varchar column. While performing that check for expressions in create_tmp_field_from_item the max length of the blob was used instead. This causes blob columns to be created in the heap temp table used by GROUP_CONCAT (where blobs must not be created in the temp table because of the constant convert_blob_length that is passed to create_tmp_field() ). And since these blob columns are not expected in that place we get wrong results. Fixed by checking that the value of the flag variable is in the limits that fit into VARCHAR instead of the max length of the blob column. mysql-test/r/func_gconcat.result: Bug #26815: test case mysql-test/t/func_gconcat.test: Bug #26815: test case sql/item_sum.cc: Bug #26815: wrong length was checked sql/sql_select.cc: Bug #26815: wrong length was checked --- mysql-test/r/func_gconcat.result | 10 ++++++++++ mysql-test/t/func_gconcat.test | 12 +++++++++++- sql/item_sum.cc | 3 +-- sql/sql_select.cc | 3 +-- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 6989b89833b..71419b5b2c3 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -728,3 +728,13 @@ f2 group_concat(f1) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2 drop table t1; +CREATE TABLE t1(a TEXT, b CHAR(20)); +INSERT INTO t1 VALUES ("one.1","one.1"),("two.2","two.2"),("one.3","one.3"); +SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1; +GROUP_CONCAT(DISTINCT UCASE(a)) +ONE.1,TWO.2,ONE.3 +SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; +GROUP_CONCAT(DISTINCT UCASE(b)) +ONE.1,TWO.2,ONE.3 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 3ff4b35873b..0dd82864520 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -497,4 +497,14 @@ select f2,group_concat(f1) from t1 group by f2; --disable_metadata drop table t1; -# End of 4.1 tests +# +# Bug #26815: Unexpected built-in function behavior: group_concat(distinct +# substring_index()) +# +CREATE TABLE t1(a TEXT, b CHAR(20)); +INSERT INTO t1 VALUES ("one.1","one.1"),("two.2","two.2"),("one.3","one.3"); +SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1; +SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 368dc9a7d38..9d626cb7733 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -417,8 +417,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table, 2-byte lenght. */ if (max_length/collation.collation->mbmaxlen > 255 && - max_length/collation.collation->mbmaxlen < UINT_MAX16 && - convert_blob_length) + convert_blob_length < UINT_MAX16 && convert_blob_length) return new Field_varstring(convert_blob_length, maybe_null, name, table, collation.collation); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bb57764700d..7e9b1fec12e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8805,8 +8805,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, 2-byte lenght. */ else if (item->max_length/item->collation.collation->mbmaxlen > 255 && - item->max_length/item->collation.collation->mbmaxlen < UINT_MAX16 - && convert_blob_length) + convert_blob_length < UINT_MAX16 && convert_blob_length) new_field= new Field_varstring(convert_blob_length, maybe_null, item->name, table, item->collation.collation); From 609277f942e5479976d5a1f31da55fd2cf646109 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 12:31:44 -0400 Subject: [PATCH 400/789] Bug#23491 MySQLDump prefix function call in a view by database name - mysqldump executes a SHOW CREATE VIEW statement to generate the text that it outputs. When the function name is retrieved it's database name is unconditionally prepended. This change causes the function's database name to be prepended only when it was used to define the function. mysql-test/r/information_schema.result: Bug#23491 MySQLDump prefix function call in a view by database name - Updated Results. mysql-test/r/mysqldump.result: Bug#23491 MySQLDump prefix function call in a view by database name - Added new results. mysql-test/r/sp-code.result: Bug#23491 MySQLDump prefix function call in a view by database name - Updated Results. mysql-test/r/udf.result: Bug#23491 MySQLDump prefix function call in a view by database name - Updated Results. mysql-test/t/mysqldump.test: Bug#23491 MySQLDump prefix function call in a view by database name - Added new testcase. sql/item_func.cc: Bug#23491 MySQLDump prefix function call in a view by database name - Use new m_explicit_name member when deciding whether or not to prepend the db name while building the function name. sql/sp.cc: Bug#23491 MySQLDump prefix function call in a view by database name - Use new sp_name constructor. sql/sp_head.h: Bug#23491 MySQLDump prefix function call in a view by database name - Add m_explicit_name member to sp_name object. - Redefined sp_name constructor to include new member. sql/sql_yacc.yy: Bug#23491 MySQLDump prefix function call in a view by database name - Use new sp_name constructors. --- mysql-test/r/information_schema.result | 2 +- mysql-test/r/mysqldump.result | 23 ++++++++++++++++++ mysql-test/r/sp-code.result | 2 +- mysql-test/r/udf.result | 2 +- mysql-test/t/mysqldump.test | 32 ++++++++++++++++++++++++++ sql/item_func.cc | 9 +++++--- sql/sp.cc | 2 +- sql/sp_head.h | 6 +++-- sql/sql_yacc.yy | 8 +++---- 9 files changed, 73 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 436bb70d0e7..db703df1f52 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -687,7 +687,7 @@ Warnings: Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them show create table v3; View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `test`.`sub1`(1) AS `c` +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `sub1`(1) AS `c` Warnings: Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them drop view v2; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 2d32984e4ef..fd0ddae538a 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3218,5 +3218,28 @@ INSERT INTO t1 VALUES(1,0xff00fef0); DROP TABLE t1; # +# Bug #23491: MySQLDump prefix function call in a view by database name +# +create database bug23491_original; +create database bug23491_restore; +use bug23491_original; +create table t1 (c1 int); +create view v1 as select * from t1; +create procedure p1() select 1; +create function f1() returns int return 1; +create view v2 as select f1(); +create function f2() returns int return f1(); +create view v3 as select bug23491_original.f1(); +use bug23491_restore; +show create view bug23491_restore.v2; +View Create View +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()` +show create view bug23491_restore.v3; +View Create View +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()` +drop database bug23491_original; +drop database bug23491_restore; +use test; +# # End of 5.0 tests # diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result index 67b030f87a4..9d86a6bc08d 100644 --- a/mysql-test/r/sp-code.result +++ b/mysql-test/r/sp-code.result @@ -187,7 +187,7 @@ Pos Instruction 32 set v_dig@4 (v_dig@4 + 1) 33 stmt 4 "update sudoku_work set dig = v_dig wh..." 34 set v_tcounter@6 (v_tcounter@6 + 1) -35 jump_if_not 37(37) (not(`test`.`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4))) +35 jump_if_not 37(37) (not(`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4))) 36 jump 15 37 set v_i@3 (v_i@3 + 1) 38 jump 15 diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index d5f59247084..7c52e7da496 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -159,7 +159,7 @@ EXPLAIN EXTENDED SELECT myfunc_int(fn(MIN(b))) as c FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort Warnings: -Note 1003 select myfunc_int(`test`.`fn`(min(`test`.`t1`.`b`)) AS `fn(MIN(b))`) AS `c` from `test`.`t1` group by `test`.`t1`.`a` +Note 1003 select myfunc_int(`fn`(min(`test`.`t1`.`b`)) AS `fn(MIN(b))`) AS `c` from `test`.`t1` group by `test`.`t1`.`a` EXPLAIN EXTENDED SELECT myfunc_int(test.fn(MIN(b))) as c FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 31741cdba9f..d1d3aae5eb7 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1429,6 +1429,38 @@ INSERT INTO t1 VALUES(1,0xff00fef0); DROP TABLE t1; +--echo # +--echo # Bug #23491: MySQLDump prefix function call in a view by database name +--echo # + +# Setup +create database bug23491_original; +create database bug23491_restore; +use bug23491_original; +create table t1 (c1 int); +create view v1 as select * from t1; +create procedure p1() select 1; +create function f1() returns int return 1; +create view v2 as select f1(); +create function f2() returns int return f1(); +create view v3 as select bug23491_original.f1(); + +# Backup. +--exec $MYSQL_DUMP --skip-comments -uroot --opt --routines bug23491_original > $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql; + +# Restore. +--exec $MYSQL bug23491_restore < $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql; + +# Verify +use bug23491_restore; +show create view bug23491_restore.v2; +show create view bug23491_restore.v3; + +# Cleanup +drop database bug23491_original; +drop database bug23491_restore; +use test; + --echo # --echo # End of 5.0 tests --echo # diff --git a/sql/item_func.cc b/sql/item_func.cc index e8ecd6b8f1c..44daab91244 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5034,7 +5034,7 @@ Item_func_sp::func_name() const { THD *thd= current_thd; /* Calculate length to avoid reallocation of string for sure */ - uint len= ((m_name->m_db.length + + uint len= ((m_name->m_explicit_name ? m_name->m_db.length : 0 + m_name->m_name.length)*2 + //characters*quoting 2 + // ` and ` 1 + // . @@ -5044,8 +5044,11 @@ Item_func_sp::func_name() const system_charset_info); qname.length(0); - append_identifier(thd, &qname, m_name->m_db.str, m_name->m_db.length); - qname.append('.'); + if (m_name->m_explicit_name) + { + append_identifier(thd, &qname, m_name->m_db.str, m_name->m_db.length); + qname.append('.'); + } append_identifier(thd, &qname, m_name->m_name.str, m_name->m_name.length); return qname.ptr(); } diff --git a/sql/sp.cc b/sql/sp.cc index 2bb13b02e14..c8701aa2c87 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1068,7 +1068,7 @@ sp_exist_routines(THD *thd, TABLE_LIST *routines, bool any, bool no_error) lex_name.length= strlen(routine->table_name); lex_db.str= thd->strmake(routine->db, lex_db.length); lex_name.str= thd->strmake(routine->table_name, lex_name.length); - name= new sp_name(lex_db, lex_name); + name= new sp_name(lex_db, lex_name, true); name->init_qname(thd); sp_object_found= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, name, &thd->sp_proc_cache, FALSE) != NULL || diff --git a/sql/sp_head.h b/sql/sp_head.h index 10eada43721..e0622e0b776 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -59,9 +59,10 @@ public: calling set_routine_type(). */ LEX_STRING m_sroutines_key; + bool m_explicit_name; /**< Prepend the db name? */ - sp_name(LEX_STRING db, LEX_STRING name) - : m_db(db), m_name(name) + sp_name(LEX_STRING db, LEX_STRING name, bool use_explicit_name) + : m_db(db), m_name(name), m_explicit_name(use_explicit_name) { m_qname.str= m_sroutines_key.str= 0; m_qname.length= m_sroutines_key.length= 0; @@ -79,6 +80,7 @@ public: m_name.length= m_qname.length= key_len - 1; m_db.str= 0; m_db.length= 0; + m_explicit_name= false; } // Init. the qualified name from the db and name. diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 258283d113e..ac5adb0d832 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1577,7 +1577,7 @@ sp_name: my_error(ER_SP_WRONG_NAME, MYF(0), $3.str); MYSQL_YYABORT; } - $$= new sp_name($1, $3); + $$= new sp_name($1, $3, true); $$->init_qname(YYTHD); } | ident @@ -1591,7 +1591,7 @@ sp_name: } if (thd->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; - $$= new sp_name(db, $1); + $$= new sp_name(db, $1, false); if ($$) $$->init_qname(YYTHD); } @@ -5052,7 +5052,7 @@ simple_expr: | ident '.' ident '(' opt_expr_list ')' { LEX *lex= Lex; - sp_name *name= new sp_name($1, $3); + sp_name *name= new sp_name($1, $3, true); name->init_qname(YYTHD); sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION); @@ -5167,7 +5167,7 @@ simple_expr: LEX_STRING db; if (thd->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; - sp_name *name= new sp_name(db, $1); + sp_name *name= new sp_name(db, $1, false); if (name) name->init_qname(thd); From afac8bcce1ebcaa780b33bcdf3917c839cda348c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 18:46:53 +0200 Subject: [PATCH 401/789] manual merge mysql-test/r/sp.result: Corrected error in test case: - 1.84e+19 converted to unsigned bigint should be converted to 1840000000000000000 < 18446744073709551615. - This fails on windows and the failing test is extracted to a new bugreport. --- mysql-test/r/sp.result | 3 --- 1 file changed, 3 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 954249a99ce..04e1be9f9f7 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6110,9 +6110,6 @@ upper bounds unsigned bigint + 1 select bug20777(-1) as 'lower bounds unsigned bigint - 1'; lower bounds unsigned bigint - 1 0 -select bug20777(1.84e+19) as 'submitter value, 1.84e19'; -submitter value, 1.84e19 -9223372036854775808 create table examplebug20777 as select 0 as 'i', bug20777(9223372036854775806) as '2**63-2', From ec3de56263e748603b954e29ca35bacb3e386176 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 09:48:10 -0700 Subject: [PATCH 402/789] Fixed bug #27348. If a set function with a outer reference s(outer_ref) cannot be aggregated the outer query against which the reference has been resolved then MySQL interpretes s(outer_ref) in the same way as it would interpret s(const). Hovever the standard requires throwing an error in this situation. Added some code to support this requirement in ansi mode. Corrected another minor bug in Item_sum::check_sum_func. mysql-test/r/subselect.result: Added a test case for bug #27348. mysql-test/t/subselect.test: Added a test case for bug #27348. sql/item_sum.cc: Fixed bug #27348. If a set function with a outer reference s(outer_ref) cannot be aggregated the outer query against which the reference has been resolved then MySQL interprets s(outer_ref) in the same way as it would interpret s(const). Hovever the standard requires throwing an error in this situation. Added some code to support this requirement in ansi mode. Corrected another minor bug in Item_sum::check_sum_func. --- mysql-test/r/subselect.result | 23 +++++++++++++++++++++++ mysql-test/t/subselect.test | 27 +++++++++++++++++++++++++++ sql/item_sum.cc | 7 +++++-- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 81f087fe8fa..d5a1c0b2451 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3924,3 +3924,26 @@ c a (SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a) 3 3 4 1 4 2,2 DROP table t1,t2; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (2,22),(1,11),(2,22); +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +a +1 +2 +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; +a +SELECT a FROM t1 t0 +WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; +a +1 +2 +SET @@sql_mode='ansi'; +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +ERROR HY000: Invalid use of group function +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; +ERROR HY000: Invalid use of group function +SELECT a FROM t1 t0 +WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; +ERROR HY000: Invalid use of group function +SET @@sql_mode=default; +DROP TABLE t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index efd54ca95d1..182b9b27ef7 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2782,3 +2782,30 @@ SELECT COUNT(*) c, a, FROM t1 GROUP BY a; DROP table t1,t2; + +# +# Bug #27348: SET FUNCTION used in a subquery from WHERE condition +# + +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (2,22),(1,11),(2,22); + +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; + +SELECT a FROM t1 t0 + WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; + +SET @@sql_mode='ansi'; +--error 1111 +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +--error 1111 +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; + +--error 1111 +SELECT a FROM t1 t0 + WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; + +SET @@sql_mode=default; + +DROP TABLE t1; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 368dc9a7d38..e10357dc0e0 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -149,6 +149,8 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) if (register_sum_func(thd, ref)) return TRUE; invalid= aggr_level < 0 && !(allow_sum_func & (1 << nest_level)); + if (!invalid && thd->variables.sql_mode & MODE_ANSI) + invalid= aggr_level < 0 && max_arg_level < nest_level; } if (!invalid && aggr_level < 0) { @@ -164,8 +166,9 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) Additionally we have to check whether possible nested set functions are acceptable here: they are not, if the level of aggregation of some of them is less than aggr_level. - */ - invalid= aggr_level <= max_sum_func_level; + */ + if (!invalid) + invalid= aggr_level <= max_sum_func_level; if (invalid) { my_message(ER_INVALID_GROUP_FUNC_USE, ER(ER_INVALID_GROUP_FUNC_USE), From f5940fe904186aa196ffc0084d9c81db7492d222 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 21:09:56 +0400 Subject: [PATCH 403/789] Remove unnecessary casts to uchar. The casts are stemming from the lexer API which internally uses unsigned char variables to address its state map. The implementation of the lexer should be internal to the lexer, and not influence the rest of the code. sql/event_data_objects.cc: Clean up unnecessary type casts. sql/event_data_objects.h: Clean up unnecessary type casts. sql/ha_ndbcluster.cc: Clean up unnecessary type casts. sql/mysql_priv.h: Clean up unnecessary type casts. sql/partition_info.h: Clean up unnecessary type casts. sql/sp.cc: Clean up unnecessary type casts. sql/sp_head.cc: Clean up unnecessary type casts. sql/sp_head.h: Clean up unnecessary type casts. sql/sql_lex.cc: Clean up unnecessary type casts. sql/sql_lex.h: Clean up unnecessary type casts. sql/sql_parse.cc: Clean up unnecessary type casts. sql/sql_partition.cc: Clean up unnecessary type casts. sql/sql_partition.h: Clean up unnecessary type casts. sql/sql_prepare.cc: Clean up unnecessary type casts. sql/sql_trigger.cc: Clean up unnecessary type casts. sql/sql_view.cc: Clean up unnecessary type casts. sql/sql_yacc.yy: Clean up unnecessary type casts. sql/table.cc: Clean up unnecessary type casts. sql/table.h: Clean up unnecessary type casts. --- sql/event_data_objects.cc | 4 +-- sql/event_data_objects.h | 2 +- sql/ha_ndbcluster.cc | 2 +- sql/mysql_priv.h | 2 +- sql/partition_info.h | 2 +- sql/sp.cc | 2 +- sql/sp_head.cc | 9 +++---- sql/sp_head.h | 4 +-- sql/sql_lex.cc | 56 ++++++++++++++++----------------------- sql/sql_lex.h | 18 ++++++------- sql/sql_parse.cc | 8 +++--- sql/sql_partition.cc | 6 ++--- sql/sql_partition.h | 4 +-- sql/sql_prepare.cc | 2 +- sql/sql_trigger.cc | 2 +- sql/sql_view.cc | 10 +++---- sql/sql_yacc.yy | 16 +++++------ sql/table.cc | 6 ++--- sql/table.h | 4 +-- 19 files changed, 73 insertions(+), 86 deletions(-) diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index c3ac488fb14..e87a78a5e37 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -168,7 +168,7 @@ Event_parse_data::init_body(THD *thd) (long) body_begin, (long) thd->lex->ptr)); body.length= thd->lex->ptr - body_begin; - const uchar *body_end= body_begin + body.length - 1; + const char *body_end= body_begin + body.length - 1; /* Trim nuls or close-comments ('*'+'/') or spaces at the end */ while (body_begin < body_end) @@ -1919,7 +1919,7 @@ Event_job_data::compile(THD *thd, MEM_ROOT *mem_root) event_change_security_context(thd, definer_user, definer_host, dbname, &save_ctx); thd->lex= &lex; - mysql_init_query(thd, (uchar*) thd->query, thd->query_length); + mysql_init_query(thd, thd->query, thd->query_length); if (MYSQLparse((void *)thd) || thd->is_fatal_error) { DBUG_PRINT("error", ("error during compile or thd->is_fatal_error: %d", diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index 513f60df657..358373889e5 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -217,7 +217,7 @@ public: */ bool do_not_create; - const uchar *body_begin; + const char *body_begin; LEX_STRING dbname; LEX_STRING name; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index bc1c3c8e324..bef58339e5b 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6339,7 +6339,7 @@ int ndb_create_table_from_engine(THD *thd, const char *db, LEX *old_lex= thd->lex, newlex; thd->lex= &newlex; newlex.current_select= NULL; - lex_start(thd, (const uchar*) "", 0); + lex_start(thd, "", 0); int res= ha_create_table_from_engine(thd, db, table_name); thd->lex= old_lex; return res; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 81c82cf3ac8..f807dcdf21a 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -841,7 +841,7 @@ bool is_update_query(enum enum_sql_command command); bool alloc_query(THD *thd, const char *packet, uint packet_length); void mysql_init_select(LEX *lex); void mysql_reset_thd_for_next_command(THD *thd); -void mysql_init_query(THD *thd, uchar *buf, uint length); +void mysql_init_query(THD *thd, const char *buf, uint length); bool mysql_new_select(LEX *lex, bool move_down); void create_select_for_variable(const char *var_name); void mysql_init_multi_delete(LEX *lex); diff --git a/sql/partition_info.h b/sql/partition_info.h index 8bcc769054f..6c21002c184 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -156,7 +156,7 @@ public: char *part_func_string; char *subpart_func_string; - uchar *part_state; + const char *part_state; partition_element *curr_part_elem; partition_element *current_partition; diff --git a/sql/sp.cc b/sql/sp.cc index c1a9aac0c24..d8dd9b3d67e 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -384,7 +384,7 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, if ((ret= sp_use_new_db(thd, name->m_db, &old_db, 1, &dbchanged))) goto end; - lex_start(thd, (uchar*)defstr.c_ptr(), defstr.length()); + lex_start(thd, defstr.c_ptr(), defstr.length()); thd->spcont= 0; if (MYSQLparse(thd) || thd->is_fatal_error || newlex.sphead == NULL) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index f5e32847fb0..8eeec741dcf 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -541,15 +541,14 @@ void sp_head::init_strings(THD *thd, LEX *lex) { DBUG_ENTER("sp_head::init_strings"); - const uchar *endp; /* Used to trim the end */ + const char *endp; /* Used to trim the end */ /* During parsing, we must use thd->mem_root */ MEM_ROOT *root= thd->mem_root; if (m_param_begin && m_param_end) { m_params.length= m_param_end - m_param_begin; - m_params.str= strmake_root(root, - (char *)m_param_begin, m_params.length); + m_params.str= strmake_root(root, m_param_begin, m_params.length); } /* If ptr has overrun end_of_query then end_of_query is the end */ @@ -561,9 +560,9 @@ sp_head::init_strings(THD *thd, LEX *lex) endp= skip_rear_comments(m_body_begin, endp); m_body.length= endp - m_body_begin; - m_body.str= strmake_root(root, (char *)m_body_begin, m_body.length); + m_body.str= strmake_root(root, m_body_begin, m_body.length); m_defstr.length= endp - lex->buf; - m_defstr.str= strmake_root(root, (char *)lex->buf, m_defstr.length); + m_defstr.str= strmake_root(root, lex->buf, m_defstr.length); DBUG_VOID_RETURN; } diff --git a/sql/sp_head.h b/sql/sp_head.h index 19dc2dac476..9aee9e9389e 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -126,7 +126,7 @@ public: create_field m_return_field_def; /* This is used for FUNCTIONs only. */ - const uchar *m_tmp_query; // Temporary pointer to sub query string + const char *m_tmp_query; // Temporary pointer to sub query string st_sp_chistics *m_chistics; ulong m_sql_mode; // For SHOW CREATE and execution LEX_STRING m_qname; // db.name @@ -174,7 +174,7 @@ public: */ HASH m_sroutines; // Pointers set during parsing - const uchar *m_param_begin, *m_param_end, *m_body_begin; + const char *m_param_begin, *m_param_end, *m_body_begin; /* Security context for stored routine which should be run under diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index ad54289a9cc..26955c18342 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -33,10 +33,10 @@ sys_var *trg_new_row_fake_var= (sys_var*) 0x01; /* Macros to look like lex */ -#define yyGet() *(lex->ptr++) -#define yyGetLast() lex->ptr[-1] -#define yyPeek() lex->ptr[0] -#define yyPeek2() lex->ptr[1] +#define yyGet() ((uchar) *(lex->ptr++)) +#define yyGetLast() ((uchar) lex->ptr[-1]) +#define yyPeek() ((uchar) lex->ptr[0]) +#define yyPeek2() ((uchar) lex->ptr[1]) #define yyUnget() lex->ptr-- #define yySkip() lex->ptr++ #define yyLength() ((uint) (lex->ptr - lex->tok_start)-1) @@ -127,7 +127,7 @@ st_parsing_options::reset() (We already do too much here) */ -void lex_start(THD *thd, const uchar *buf, uint length) +void lex_start(THD *thd, const char *buf, uint length) { LEX *lex= thd->lex; DBUG_ENTER("lex_start"); @@ -238,9 +238,9 @@ void lex_end(LEX *lex) static int find_keyword(LEX *lex, uint len, bool function) { - const uchar *tok=lex->tok_start; + const char *tok= lex->tok_start; - SYMBOL *symbol= get_hash_symbol((const char *)tok,len,function); + SYMBOL *symbol= get_hash_symbol(tok, len, function); if (symbol) { lex->yylval->symbol.symbol=symbol; @@ -305,16 +305,16 @@ static LEX_STRING get_token(LEX *lex,uint length) static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote) { LEX_STRING tmp; - const uchar *from, *end; - uchar *to; + const char *from, *end; + char *to; yyUnget(); // ptr points now after last token char tmp.length=lex->yytoklen=length; tmp.str=(char*) lex->thd->alloc(tmp.length+1); - for (from= lex->tok_start, to= (uchar*) tmp.str, end= to+length ; + for (from= lex->tok_start, to= tmp.str, end= to+length ; to != end ; ) { - if ((*to++= *from++) == (uchar) quote) + if ((*to++= *from++) == quote) from++; // Skip double quotes } *to= 0; // End null for safety @@ -341,9 +341,7 @@ static char *get_text(LEX *lex) { int l; if (use_mb(cs) && - (l = my_ismbchar(cs, - (const char *)lex->ptr-1, - (const char *)lex->end_of_query))) { + (l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query))) { lex->ptr += l-1; continue; } @@ -368,12 +366,12 @@ static char *get_text(LEX *lex) yyUnget(); /* Found end. Unescape and return string */ - const uchar *str, *end; - uchar *start; + const char *str, *end; + char *start; str=lex->tok_start+1; end=lex->ptr-1; - if (!(start=(uchar*) lex->thd->alloc((uint) (end-str)+1))) + if (!(start= (char*) lex->thd->alloc((uint) (end-str)+1))) return (char*) ""; // Sql_alloc has set error flag if (!found_escape) { @@ -383,15 +381,14 @@ static char *get_text(LEX *lex) } else { - uchar *to; + char *to; for (to=start ; str != end ; str++) { #ifdef USE_MB int l; if (use_mb(cs) && - (l = my_ismbchar(cs, - (const char *)str, (const char *)end))) { + (l = my_ismbchar(cs, str, end))) { while (l--) *to++ = *str++; str--; @@ -437,7 +434,7 @@ static char *get_text(LEX *lex) *to=0; lex->yytoklen=(uint) (to-start); } - return (char*) start; + return start; } } return 0; // unexpected end of query @@ -556,7 +553,6 @@ int MYSQLlex(void *arg, void *yythd) lex->yylval=yylval; // The global state - lex->tok_end_prev= lex->tok_end; lex->tok_start_prev= lex->tok_start; lex->tok_start=lex->tok_end=lex->ptr; @@ -640,16 +636,14 @@ int MYSQLlex(void *arg, void *yythd) break; } case MY_LEX_IDENT: - const uchar *start; + const char *start; #if defined(USE_MB) && defined(USE_MB_IDENT) if (use_mb(cs)) { result_state= IDENT_QUOTED; if (my_mbcharlen(cs, yyGetLast()) > 1) { - int l = my_ismbchar(cs, - (const char *)lex->ptr-1, - (const char *)lex->end_of_query); + int l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query); if (l == 0) { state = MY_LEX_CHAR; continue; @@ -661,9 +655,7 @@ int MYSQLlex(void *arg, void *yythd) if (my_mbcharlen(cs, c) > 1) { int l; - if ((l = my_ismbchar(cs, - (const char *)lex->ptr-1, - (const char *)lex->end_of_query)) == 0) + if ((l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query)) == 0) break; lex->ptr += l-1; } @@ -786,9 +778,7 @@ int MYSQLlex(void *arg, void *yythd) if (my_mbcharlen(cs, c) > 1) { int l; - if ((l = my_ismbchar(cs, - (const char *)lex->ptr-1, - (const char *)lex->end_of_query)) == 0) + if ((l = my_ismbchar(cs, lex->ptr-1, lex->end_of_query)) == 0) break; lex->ptr += l-1; } @@ -1122,7 +1112,7 @@ int MYSQLlex(void *arg, void *yythd) Pointer to the last non-comment symbol of the statement. */ -const uchar *skip_rear_comments(const uchar *begin, const uchar *end) +const char *skip_rear_comments(const char *begin, const char *end) { while (begin < end && (end[-1] <= ' ' || end[-1] == '*' || end[-1] == '/' || end[-1] == ';')) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 13786606412..d8a5a0b04f0 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -542,7 +542,7 @@ public: void set_limit(st_select_lex *values); void set_thd(THD *thd_arg) { thd= thd_arg; } - friend void lex_start(THD *thd, const uchar *buf, uint length); + friend void lex_start(THD *thd, const char *buf, uint length); friend int subselect_union_engine::exec(); List *get_unit_column_types(); @@ -743,7 +743,7 @@ public: void cut_subtree() { slave= 0; } bool test_limit(); - friend void lex_start(THD *thd, const uchar *buf, uint length); + friend void lex_start(THD *thd, const char *buf, uint length); st_select_lex() : n_sum_items(0), n_child_sum_items(0) {} void make_empty_select() { @@ -996,11 +996,11 @@ typedef struct st_lex : public Query_tables_list SELECT_LEX *current_select; /* list of all SELECT_LEX */ SELECT_LEX *all_selects_list; - const uchar *buf; /* The beginning of string, used by SPs */ - const uchar *ptr,*tok_start,*tok_end,*end_of_query; + const char *buf; /* The beginning of string, used by SPs */ + const char *ptr,*tok_start,*tok_end,*end_of_query; - /* The values of tok_start/tok_end as they were one call of MYSQLlex before */ - const uchar *tok_start_prev, *tok_end_prev; + /* The value of tok_start as they were one call of MYSQLlex before */ + const char *tok_start_prev; char *length,*dec,*change; LEX_STRING name; @@ -1202,7 +1202,7 @@ typedef struct st_lex : public Query_tables_list Pointers to part of LOAD DATA statement that should be rewritten during replication ("LOCAL 'filename' REPLACE INTO" part). */ - const uchar *fname_start, *fname_end; + const char *fname_start, *fname_end; /* Reference to a struct that contains information in various commands @@ -1319,10 +1319,10 @@ struct st_lex_local: public st_lex extern void lex_init(void); extern void lex_free(void); -extern void lex_start(THD *thd, const uchar *buf, uint length); +extern void lex_start(THD *thd, const char *buf, uint length); extern void lex_end(LEX *lex); extern int MYSQLlex(void *arg, void *yythd); -extern const uchar *skip_rear_comments(const uchar *ubegin, const uchar *uend); +extern const char *skip_rear_comments(const char *ubegin, const char *uend); extern bool is_lex_native_function(const LEX_STRING *name); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 4c85ba252e5..7720f293b10 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -983,7 +983,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, break; /* init structures for VIEW processing */ table_list.select_lex= &(thd->lex->select_lex); - mysql_init_query(thd, (uchar*)"", 0); + mysql_init_query(thd, "", 0); thd->lex-> select_lex.table_list.link_in_list((byte*) &table_list, (byte**) &table_list.next_local); @@ -4970,7 +4970,7 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize) ****************************************************************************/ void -mysql_init_query(THD *thd, uchar *buf, uint length) +mysql_init_query(THD *thd, const char *buf, uint length) { DBUG_ENTER("mysql_init_query"); lex_start(thd, buf, length); @@ -5193,7 +5193,7 @@ void mysql_parse(THD *thd, char *inBuf, uint length) DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on();); - mysql_init_query(thd, (uchar*) inBuf, length); + mysql_init_query(thd, inBuf, length); if (query_cache_send_result_to_client(thd, inBuf, length) <= 0) { LEX *lex= thd->lex; @@ -5272,7 +5272,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) bool error= 0; DBUG_ENTER("mysql_test_parse_for_slave"); - mysql_init_query(thd, (uchar*) inBuf, length); + mysql_init_query(thd, inBuf, length); if (!MYSQLparse((void*) thd) && ! thd->is_fatal_error && all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first)) error= 1; /* Ignore question */ diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index dbac53ed5f6..65a10a2120c 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3700,9 +3700,9 @@ void get_partition_set(const TABLE *table, byte *buf, const uint index, possible to retrace this given an item tree. */ -bool mysql_unpack_partition(THD *thd, const uchar *part_buf, - uint part_info_len, - uchar *part_state, uint part_state_len, +bool mysql_unpack_partition(THD *thd, + const char *part_buf, uint part_info_len, + const char *part_state, uint part_state_len, TABLE* table, bool is_create_table_ind, handlerton *default_db_type) { diff --git a/sql/sql_partition.h b/sql/sql_partition.h index 7ed43527688..e0c0f1c5bd3 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -77,9 +77,9 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf, KEY *key_info, const key_range *key_spec, part_id_range *part_spec); -bool mysql_unpack_partition(THD *thd, const uchar *part_buf, +bool mysql_unpack_partition(THD *thd, const char *part_buf, uint part_info_len, - uchar *part_state, uint part_state_len, + const char *part_state, uint part_state_len, TABLE *table, bool is_create_table_ind, handlerton *default_db_type); void make_used_partitions_str(partition_info *part_info, String *parts_str); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 37a6f68cfe8..e97670ab2b1 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2850,7 +2850,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) old_stmt_arena= thd->stmt_arena; thd->stmt_arena= this; - lex_start(thd, (uchar*) thd->query, thd->query_length); + lex_start(thd, thd->query, thd->query_length); lex->stmt_prepare_mode= TRUE; error= MYSQLparse((void *)thd) || thd->is_fatal_error || diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 311bd089c64..66132efb8e4 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -976,7 +976,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, LEX_STRING *trg_definer= it_definer++; thd->variables.sql_mode= (ulong)*trg_sql_mode; - lex_start(thd, (uchar*)trg_create_str->str, trg_create_str->length); + lex_start(thd, trg_create_str->str, trg_create_str->length); thd->spcont= 0; if (MYSQLparse((void *)thd) || thd->is_fatal_error) diff --git a/sql/sql_view.cc b/sql/sql_view.cc index b619e451b22..b0c9de1453c 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -675,7 +675,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, char md5[MD5_BUFF_LENGTH]; bool can_be_merged; char dir_buff[FN_REFLEN], path_buff[FN_REFLEN]; - const uchar *endp; + const char *endp; LEX_STRING dir, file, path; DBUG_ENTER("mysql_register_view"); @@ -759,9 +759,9 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, view->query.str= (char*)str.ptr(); view->query.length= str.length()-1; // we do not need last \0 view->source.str= thd->query + thd->lex->create_view_select_start; - endp= (uchar*) view->source.str; - endp= skip_rear_comments(endp, (uchar*) (thd->query + thd->query_length)); - view->source.length= endp - (uchar*) view->source.str; + endp= view->source.str; + endp= skip_rear_comments(endp, thd->query + thd->query_length); + view->source.length= endp - view->source.str; view->file_version= 1; view->calc_md5(md5); view->md5.str= md5; @@ -970,7 +970,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, now Lex placed in statement memory */ table->view= lex= thd->lex= (LEX*) new(thd->mem_root) st_lex_local; - lex_start(thd, (uchar*)table->query.str, table->query.length); + lex_start(thd, table->query.str, table->query.length); view_select= &lex->select_lex; view_select->select_number= ++thd->select_number; { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 963146f3cb4..9d4c62052dd 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2695,7 +2695,7 @@ sp_proc_stmt_statement: else i->m_query.length= lex->tok_end - sp->m_tmp_query; i->m_query.str= strmake_root(YYTHD->mem_root, - (char *)sp->m_tmp_query, + sp->m_tmp_query, i->m_query.length); sp->add_instr(i); } @@ -9299,7 +9299,7 @@ param_marker: my_error(ER_VIEW_SELECT_VARIABLE, MYF(0)); MYSQL_YYABORT; } - item= new Item_param((uint) (lex->tok_start - (uchar *) thd->query)); + item= new Item_param((uint) (lex->tok_start - thd->query)); if (!($$= item) || lex->param_list.push_back(item)) { my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); @@ -10135,7 +10135,7 @@ option_type_value: if (!(qbuff.str= alloc_root(YYTHD->mem_root, qbuff.length + 5))) MYSQL_YYABORT; - strmake(strmake(qbuff.str, "SET ", 4), (char *)sp->m_tmp_query, + strmake(strmake(qbuff.str, "SET ", 4), sp->m_tmp_query, qbuff.length); qbuff.length+= 4; i->m_query= qbuff; @@ -11354,18 +11354,16 @@ view_select_aux: { THD *thd= YYTHD; LEX *lex= thd->lex; - char *stmt_beg= (lex->sphead ? - (char *)lex->sphead->m_tmp_query : - thd->query); + const char *stmt_beg= (lex->sphead ? + lex->sphead->m_tmp_query : thd->query); lex->create_view_select_start= $2 - stmt_beg; } | '(' remember_name select_paren ')' union_opt { THD *thd= YYTHD; LEX *lex= thd->lex; - char *stmt_beg= (lex->sphead ? - (char *)lex->sphead->m_tmp_query : - thd->query); + const char *stmt_beg= (lex->sphead ? + lex->sphead->m_tmp_query : thd->query); lex->create_view_select_start= $2 - stmt_beg; } ; diff --git a/sql/table.cc b/sql/table.cc index 4123473cf1e..71e510bf0ac 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -682,8 +682,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if ((share->partition_info_len= partition_info_len)) { if (!(share->partition_info= - (uchar*) memdup_root(&share->mem_root, next_chunk + 4, - partition_info_len + 1))) + memdup_root(&share->mem_root, next_chunk + 4, + partition_info_len + 1))) { my_free(buff, MYF(0)); goto err; @@ -1528,7 +1528,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, tmp= mysql_unpack_partition(thd, share->partition_info, share->partition_info_len, - (uchar*)share->part_state, + share->part_state, share->part_state_len, outparam, is_create_table, share->default_part_db_type); diff --git a/sql/table.h b/sql/table.h index aa053f207b3..0eb372e9cca 100644 --- a/sql/table.h +++ b/sql/table.h @@ -236,9 +236,9 @@ typedef struct st_table_share bool log_table; #ifdef WITH_PARTITION_STORAGE_ENGINE bool auto_partitioned; - const uchar *partition_info; + const char *partition_info; uint partition_info_len; - const uchar *part_state; + const char *part_state; uint part_state_len; handlerton *default_part_db_type; #endif From f7acb850c29dc06219da2a51d2da0a55d389df60 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 19:26:01 +0200 Subject: [PATCH 404/789] Bug#24121 Incorrect test for SSL_VERIFY_SERVER_CERT - Interpret the pointer passed to 'mysql_options' for MYSQL_OPT_SSL_VERIFY_SERVER_CERT as a my_bool - In 5.1 the mysql_options signature will be chanegd to take a 'void*' in order to further emphasize the need for a pointer to correct type client/mysqltest.c: Turn on ssl_verify_server_cert for all connections to "localhost" in mysqltest sql-common/client.c: The pointer passed to 'mysql_options' for MYSQL_OPT_SSL_VERIFY_SERVER_CERT should be interpreted as a my_bool pointer (aka char*). --- client/mysqltest.c | 8 +++----- sql-common/client.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 30f95dd4340..568d33f7385 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3534,7 +3534,7 @@ void do_connect(struct st_command *command) opt_ssl_capath, opt_ssl_cipher); #if MYSQL_VERSION_ID >= 50000 /* Turn on ssl_verify_server_cert only if host is "localhost" */ - opt_ssl_verify_server_cert= !strcmp(ds_connection_name.str, "localhost"); + opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost"); mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &opt_ssl_verify_server_cert); #endif @@ -6002,15 +6002,13 @@ int main(int argc, char **argv) #ifdef HAVE_OPENSSL -#if MYSQL_VERSION_ID >= 50000 - opt_ssl_verify_server_cert= TRUE; /* Always on in mysqltest */ -#endif - if (opt_use_ssl) { mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, opt_ssl_capath, opt_ssl_cipher); #if MYSQL_VERSION_ID >= 50000 + /* Turn on ssl_verify_server_cert only if host is "localhost" */ + opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost"); mysql_options(&cur_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &opt_ssl_verify_server_cert); #endif diff --git a/sql-common/client.c b/sql-common/client.c index 1acaaea9a79..3342db4bcfe 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -3022,7 +3022,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg) mysql->reconnect= *(my_bool *) arg; break; case MYSQL_OPT_SSL_VERIFY_SERVER_CERT: - if (!arg || test(*(uint*) arg)) + if (*(my_bool*) arg) mysql->options.client_flag|= CLIENT_SSL_VERIFY_SERVER_CERT; else mysql->options.client_flag&= ~CLIENT_SSL_VERIFY_SERVER_CERT; From 6a594ffd18f52b4bf825eed9714c94207235d22c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 21:55:01 +0400 Subject: [PATCH 405/789] Fix for BUG#25082: default database change on trigger execution breaks replication. When a stored routine is executed, we switch current database to the database, in which the routine has been created. When the stored routine finishes, we switch back to the original database. The problem was that if the original database does not exist (anymore) after routine execution, we raised an error. The fix is to report a warning, and switch to the NULL database. mysql-test/r/sp.result: Updated result file. mysql-test/t/sp.test: Added test case for BUG#25082. sql/mysql_priv.h: 1. Change mysql_change_db() prototype; 2. Polishing. sql/sp.cc: Polishing. sql/sp_head.cc: Polishing. sql/sql_db.cc: 1. Polishing. 2. Fix mysql_change_db(). sql/sql_parse.cc: Polishing. sql/sql_show.cc: Polishing. --- mysql-test/r/sp.result | 15 ++ mysql-test/t/sp.test | 41 +++++ sql/mysql_priv.h | 7 +- sql/sp.cc | 6 +- sql/sp_head.cc | 2 +- sql/sql_db.cc | 336 +++++++++++++++++++++++++++-------------- sql/sql_parse.cc | 24 +-- sql/sql_show.cc | 21 +-- 8 files changed, 309 insertions(+), 143 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index ddd2369d36d..6773facb641 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5969,6 +5969,21 @@ SUM(f2) bug25373(f1) 21.300000071526 NULL DROP FUNCTION bug25373| DROP TABLE t3| +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1| +CREATE DATABASE mysqltest2| +CREATE PROCEDURE mysqltest1.p1() +DROP DATABASE mysqltest2| +use mysqltest2| +CALL mysqltest1.p1()| +Warnings: +Note 1049 Unknown database 'mysqltest2' +SELECT DATABASE()| +DATABASE() +NULL +DROP DATABASE mysqltest1| +use test| drop table t1,t2; CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM; CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index fd158408fb6..6aab1ae3c6a 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6929,6 +6929,47 @@ INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| DROP FUNCTION bug25373| DROP TABLE t3| + + +# +# BUG#25082: Default database change on trigger execution breaks replication. +# +# As it turned out, this bug has actually two bugs. So, here we have two test +# cases -- one in sp.test, the other in sp-security.test. +# + +# +# Test case 1: error on dropping the current database. +# + +# Prepare. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +--enable_warnings + +CREATE DATABASE mysqltest1| +CREATE DATABASE mysqltest2| + +# Test. + +CREATE PROCEDURE mysqltest1.p1() + DROP DATABASE mysqltest2| + +use mysqltest2| + +CALL mysqltest1.p1()| + +SELECT DATABASE()| + +# Cleanup. + +DROP DATABASE mysqltest1| + +use test| + + # # NOTE: The delimiter is `|`, and not `;`. It is changed to `;` # at the end of the file! diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4d08b381a2e..5e37cd8987f 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -693,7 +693,8 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list); bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name, char *new_table_alias, bool skip_error); -bool mysql_change_db(THD *thd,const char *name,bool no_access_check); +bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, + bool force_switch); void mysql_parse(THD *thd,char *inBuf,uint length); bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length); bool is_update_query(enum enum_sql_command command); @@ -937,7 +938,7 @@ void append_definer(THD *thd, String *buffer, const LEX_STRING *definer_user, /* information schema */ -extern LEX_STRING information_schema_name; +extern LEX_STRING INFORMATION_SCHEMA_NAME; LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str, const char* str, uint length, bool allocate_lex_string); @@ -955,7 +956,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond); bool get_schema_tables_result(JOIN *join, enum enum_schema_table_state executed_place); #define is_schema_db(X) \ - !my_strcasecmp(system_charset_info, information_schema_name.str, (X)) + !my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, (X)) /* sql_prepare.cc */ diff --git a/sql/sp.cc b/sql/sp.cc index 2bb13b02e14..506b0bcd92b 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -441,14 +441,14 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, { sp_head *sp= newlex.sphead; - if (dbchanged && (ret= mysql_change_db(thd, old_db.str, 1))) + if (dbchanged && (ret= mysql_change_db(thd, &old_db, TRUE))) goto end; delete sp; ret= SP_PARSE_ERROR; } else { - if (dbchanged && (ret= mysql_change_db(thd, old_db.str, 1))) + if (dbchanged && (ret= mysql_change_db(thd, &old_db, TRUE))) goto end; *sphp= newlex.sphead; (*sphp)->set_definer(&definer_user_name, &definer_host_name); @@ -1896,7 +1896,7 @@ sp_use_new_db(THD *thd, LEX_STRING new_db, LEX_STRING *old_db, DBUG_RETURN(0); } - ret= mysql_change_db(thd, new_db.str, no_access_check); + ret= mysql_change_db(thd, &new_db, no_access_check); *dbchangedp= ret == 0; DBUG_RETURN(ret); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 9d7fc55ff70..bba231ba685 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1130,7 +1130,7 @@ sp_head::execute(THD *thd) (It would generate an error from mysql_change_db() when old_db=="") */ if (! thd->killed) - err_status|= mysql_change_db(thd, old_db.str, 1); + err_status|= mysql_change_db(thd, &old_db, TRUE); } m_flags&= ~IS_INVOKED; DBUG_PRINT("info", diff --git a/sql/sql_db.cc b/sql/sql_db.cc index f95ed8b6fc9..d7aecb78363 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -461,7 +461,7 @@ bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, DBUG_ENTER("mysql_create_db"); /* do not create 'information_schema' db */ - if (!my_strcasecmp(system_charset_info, db, information_schema_name.str)) + if (!my_strcasecmp(system_charset_info, db, INFORMATION_SCHEMA_NAME.str)) { my_error(ER_DB_CREATE_EXISTS, MYF(0), db); DBUG_RETURN(-1); @@ -1126,154 +1126,256 @@ err: } -/* - Change the current database. +/** + @brief Internal implementation: switch current database to a valid one. - SYNOPSIS - mysql_change_db() - thd thread handle - name database name - no_access_check if TRUE, don't do access check. In this - case name may be "" - - DESCRIPTION - Check that the database name corresponds to a valid and - existent database, check access rights (unless called with - no_access_check), and set the current database. This function - is called to change the current database upon user request - (COM_CHANGE_DB command) or temporarily, to execute a stored - routine. - - NOTES - This function is not the only way to switch the database that - is currently employed. When the replication slave thread - switches the database before executing a query, it calls - thd->set_db directly. However, if the query, in turn, uses - a stored routine, the stored routine will use this function, - even if it's run on the slave. - - This function allocates the name of the database on the system - heap: this is necessary to be able to uniformly change the - database from any module of the server. Up to 5.0 different - modules were using different memory to store the name of the - database, and this led to memory corruption: a stack pointer - set by Stored Procedures was used by replication after the - stack address was long gone. - - This function does not send anything, including error - messages, to the client. If that should be sent to the client, - call net_send_error after this function. - - RETURN VALUES - 0 OK - 1 error + @param thd Thread context. + @param new_db_name Name of the database to switch to. The function will + take ownership of the name (the caller must not free + the allocated memory). If the name is NULL, we're + going to switch to NULL db. + @param new_db_access Privileges of the new database. + @param new_db_charset Character set of the new database. */ -bool mysql_change_db(THD *thd, const char *name, bool no_access_check) +static void mysql_change_db_impl(THD *thd, + LEX_STRING *new_db_name, + ulong new_db_access, + CHARSET_INFO *new_db_charset) { - int db_length; - char *db_name; - bool system_db= 0; -#ifndef NO_EMBEDDED_ACCESS_CHECKS - ulong db_access; - Security_context *sctx= thd->security_ctx; - LINT_INIT(db_access); -#endif - DBUG_ENTER("mysql_change_db"); - DBUG_PRINT("enter",("name: '%s'",name)); + /* 1. Change current database in THD. */ - if (name == NULL || name[0] == '\0' && no_access_check == FALSE) + if (new_db_name == NULL) { - my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0)); - DBUG_RETURN(1); /* purecov: inspected */ + /* + THD::set_db() does all the job -- it frees previous database name and + sets the new one. + */ + + thd->set_db(NULL, 0); } - else if (name[0] == '\0') + else if (new_db_name == &INFORMATION_SCHEMA_NAME) { - /* Called from SP to restore the original database, which was NULL */ - DBUG_ASSERT(no_access_check); - system_db= 1; - db_name= NULL; - db_length= 0; - goto end; + /* + Here we must use THD::set_db(), because we want to copy + INFORMATION_SCHEMA_NAME constant. + */ + + thd->set_db(INFORMATION_SCHEMA_NAME.str, INFORMATION_SCHEMA_NAME.length); } + else + { + /* + Here we already have a copy of database name to be used in THD. So, + we just call THD::reset_db(). Since THD::reset_db() does not releases + the previous database name, we should do it explicitly. + */ + + x_free(thd->db); + + thd->reset_db(new_db_name->str, new_db_name->length); + } + + /* 2. Update security context. */ + +#ifndef NO_EMBEDDED_ACCESS_CHECKS + thd->security_ctx->db_access= new_db_access; +#endif + + /* 3. Update db-charset environment variables. */ + + thd->db_charset= new_db_charset; + thd->variables.collation_database= new_db_charset; +} + + +/** + @brief Change the current database. + + @param thd thread handle + @param name database name + @param force_switch if this flag is set (TRUE), mysql_change_db() will + switch to NULL db if the specified database is not + available anymore. Corresponding warning will be + thrown in this case. This flag is used to change + database in stored-routine-execution code. + + @details Check that the database name corresponds to a valid and existent + database, check access rights (unless called with no_access_check), and + set the current database. This function is called to change the current + database upon user request (COM_CHANGE_DB command) or temporarily, to + execute a stored routine. + + This function is not the only way to switch the database that is + currently employed. When the replication slave thread switches the + database before executing a query, it calls thd->set_db directly. + However, if the query, in turn, uses a stored routine, the stored routine + will use this function, even if it's run on the slave. + + This function allocates the name of the database on the system heap: this + is necessary to be able to uniformly change the database from any module + of the server. Up to 5.0 different modules were using different memory to + store the name of the database, and this led to memory corruption: + a stack pointer set by Stored Procedures was used by replication after + the stack address was long gone. + + @return Operation status + @retval FALSE Success + @retval TRUE Error +*/ + +bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) +{ + LEX_STRING new_db_file_name; + + Security_context *sctx= thd->security_ctx; + ulong db_access= sctx->db_access; + + DBUG_ENTER("mysql_change_db"); + DBUG_PRINT("enter",("name: '%s'", new_db_name->str)); + + if (new_db_name == NULL || + new_db_name->length == 0 || + new_db_name->str == NULL) + { + if (force_switch) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR)); + + /* Change db to NULL. */ + + mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server); + + DBUG_RETURN(FALSE); + } + else + { + my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0)); + + DBUG_RETURN(TRUE); + } + } + + if (my_strcasecmp(system_charset_info, new_db_name->str, + INFORMATION_SCHEMA_NAME.str) == 0) + { + /* Switch database to INFORMATION_SCHEMA. */ + + mysql_change_db_impl(thd, &INFORMATION_SCHEMA_NAME, SELECT_ACL, + system_charset_info); + + DBUG_RETURN(FALSE); + } + /* Now we need to make a copy because check_db_name requires a - non-constant argument. TODO: fix check_db_name. + non-constant argument. Actually, it takes database file name. + + TODO: fix check_db_name(). */ - if ((db_name= my_strdup(name, MYF(MY_WME))) == NULL) - DBUG_RETURN(1); /* the error is set */ - db_length= strlen(db_name); - if (check_db_name(db_name)) + + new_db_file_name.str= my_strdup(new_db_name->str, MYF(MY_WME)); + new_db_file_name.length= new_db_name->length; + + if (new_db_file_name.str == NULL) + DBUG_RETURN(TRUE); /* the error is set */ + + /* + NOTE: if check_db_name() fails, we should throw an error in any case, + even if we are called from sp_head::execute(). + + It's next to impossible however to get this error when we are called + from sp_head::execute(). But let's switch database to NULL in this case + to be sure. + */ + + if (check_db_name(new_db_file_name.str)) { - my_error(ER_WRONG_DB_NAME, MYF(0), db_name); - my_free(db_name, MYF(0)); - DBUG_RETURN(1); - } - DBUG_PRINT("info",("Use database: %s", db_name)); - if (!my_strcasecmp(system_charset_info, db_name, information_schema_name.str)) - { - system_db= 1; -#ifndef NO_EMBEDDED_ACCESS_CHECKS - db_access= SELECT_ACL; -#endif - goto end; + my_error(ER_WRONG_DB_NAME, MYF(0), new_db_file_name.str); + my_free(new_db_file_name.str, MYF(0)); + + if (force_switch) + { + /* Change db to NULL. */ + + mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server); + } + + DBUG_RETURN(TRUE); } + DBUG_PRINT("info",("Use database: %s", new_db_file_name.str)); + #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!no_access_check) + if (!force_switch) /* FIXME: this is BUG#27337. */ { - if (test_all_bits(sctx->master_access, DB_ACLS)) - db_access=DB_ACLS; - else - db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name, 0) | - sctx->master_access); - if (!(db_access & DB_ACLS) && (!grant_option || - check_grant_db(thd,db_name))) + db_access= + test_all_bits(sctx->master_access, DB_ACLS) ? + DB_ACLS : + acl_get(sctx->host, + sctx->ip, + sctx->priv_user, + new_db_file_name.str, + FALSE) | sctx->master_access; + + if (!force_switch && + !(db_access & DB_ACLS) && + (!grant_option || check_grant_db(thd, new_db_file_name.str))) { my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), sctx->priv_user, sctx->priv_host, - db_name); + new_db_file_name.str); mysql_log.write(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), - sctx->priv_user, sctx->priv_host, db_name); - my_free(db_name, MYF(0)); - DBUG_RETURN(1); + sctx->priv_user, sctx->priv_host, new_db_file_name.str); + my_free(new_db_file_name.str, MYF(0)); + DBUG_RETURN(TRUE); } } #endif - if (check_db_dir_existence(db_name)) + if (check_db_dir_existence(new_db_file_name.str)) { - my_error(ER_BAD_DB_ERROR, MYF(0), db_name); - my_free(db_name, MYF(0)); - DBUG_RETURN(1); + if (force_switch) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_BAD_DB_ERROR, ER(ER_BAD_DB_ERROR), + new_db_file_name.str); + + my_free(new_db_file_name.str, MYF(0)); + + /* Change db to NULL. */ + + mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server); + + DBUG_RETURN(FALSE); + } + else + { + my_error(ER_BAD_DB_ERROR, MYF(0), new_db_file_name.str); + my_free(new_db_file_name.str, MYF(0)); + DBUG_RETURN(TRUE); + } } -end: - x_free(thd->db); - DBUG_ASSERT(db_name == NULL || db_name[0] != '\0'); - thd->reset_db(db_name, db_length); // THD::~THD will free this -#ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!no_access_check) - sctx->db_access= db_access; -#endif - if (system_db) - { - thd->db_charset= system_charset_info; - thd->variables.collation_database= system_charset_info; - } - else - { - HA_CREATE_INFO create; + /* + NOTE: in mysql_change_db_impl() new_db_file_name is assigned to THD + attributes and will be freed in THD::~THD(). + */ - load_db_opt_by_name(thd, db_name, &create); + { + HA_CREATE_INFO db_options; - thd->db_charset= create.default_table_charset ? - create.default_table_charset : - thd->variables.collation_server; - thd->variables.collation_database= thd->db_charset; + load_db_opt_by_name(thd, new_db_name->str, &db_options); + + mysql_change_db_impl(thd, &new_db_file_name, db_access, + db_options.default_table_charset ? + db_options.default_table_charset : + thd->variables.collation_server); } - DBUG_RETURN(0); + + DBUG_RETURN(FALSE); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 486942a8bb9..cbf9e374dac 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -290,7 +290,8 @@ int check_user(THD *thd, enum enum_server_command command, bool check_count) { DBUG_ENTER("check_user"); - + LEX_STRING db_str= { (char *) db, db ? strlen(db) : 0 }; + #ifdef NO_EMBEDDED_ACCESS_CHECKS thd->main_security_ctx.master_access= GLOBAL_ACLS; // Full rights /* Change database if necessary */ @@ -301,7 +302,7 @@ int check_user(THD *thd, enum enum_server_command command, function returns 0 */ thd->reset_db(NULL, 0); - if (mysql_change_db(thd, db, FALSE)) + if (mysql_change_db(thd, &db_str, FALSE)) { /* Send the error to the client */ net_send_error(thd); @@ -443,7 +444,7 @@ int check_user(THD *thd, enum enum_server_command command, /* Change database if necessary */ if (db && db[0]) { - if (mysql_change_db(thd, db, FALSE)) + if (mysql_change_db(thd, &db_str, FALSE)) { /* Send error to the client */ net_send_error(thd); @@ -1638,7 +1639,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, &LOCK_status); thd->convert_string(&tmp, system_charset_info, packet, strlen(packet), thd->charset()); - if (!mysql_change_db(thd, tmp.str, FALSE)) + if (!mysql_change_db(thd, &tmp, FALSE)) { mysql_log.write(thd,command,"%s",thd->db); send_ok(thd); @@ -1862,7 +1863,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, packet= pend+1; if (!my_strcasecmp(system_charset_info, table_list.db, - information_schema_name.str)) + INFORMATION_SCHEMA_NAME.str)) { ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, table_list.alias); if (schema_table) @@ -3753,9 +3754,14 @@ end_with_restore_list: } #endif case SQLCOM_CHANGE_DB: - if (!mysql_change_db(thd,select_lex->db,FALSE)) + { + LEX_STRING db_str= { (char *) select_lex->db, strlen(select_lex->db) }; + + if (!mysql_change_db(thd, &db_str, FALSE)) send_ok(thd); + break; + } case SQLCOM_LOAD: { @@ -5436,7 +5442,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, if (!no_errors) my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), sctx->priv_user, sctx->priv_host, - information_schema_name.str); + INFORMATION_SCHEMA_NAME.str); return TRUE; } /* @@ -6256,7 +6262,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, ptr->ignore_leaves= test(table_options & TL_OPTION_IGNORE_LEAVES); ptr->derived= table->sel; if (!ptr->derived && !my_strcasecmp(system_charset_info, ptr->db, - information_schema_name.str)) + INFORMATION_SCHEMA_NAME.str)) { ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name); if (!schema_table || @@ -6264,7 +6270,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, lex->orig_sql_command == SQLCOM_END)) // not a 'show' command { my_error(ER_UNKNOWN_TABLE, MYF(0), - ptr->table_name, information_schema_name.str); + ptr->table_name, INFORMATION_SCHEMA_NAME.str); DBUG_RETURN(0); } ptr->schema_table_name= ptr->table_name; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 286799a44f6..cf0cb9ba8d2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -496,9 +496,9 @@ bool mysqld_show_create_db(THD *thd, char *dbname, } #endif if (!my_strcasecmp(system_charset_info, dbname, - information_schema_name.str)) + INFORMATION_SCHEMA_NAME.str)) { - dbname= information_schema_name.str; + dbname= INFORMATION_SCHEMA_NAME.str; create.default_table_charset= system_charset_info; } else @@ -1823,7 +1823,8 @@ LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str, /* INFORMATION_SCHEMA name */ -LEX_STRING information_schema_name= {(char*)"information_schema", 18}; +LEX_STRING INFORMATION_SCHEMA_NAME= + { (char *) STRING_WITH_LEN("information_schema") }; /* This is only used internally, but we need it here as a forward reference */ extern ST_SCHEMA_TABLE schema_tables[]; @@ -2039,11 +2040,11 @@ int make_db_list(THD *thd, List *files, */ if (!idx_field_vals->db_value || !wild_case_compare(system_charset_info, - information_schema_name.str, + INFORMATION_SCHEMA_NAME.str, idx_field_vals->db_value)) { *with_i_schema= 1; - if (files->push_back(thd->strdup(information_schema_name.str))) + if (files->push_back(thd->strdup(INFORMATION_SCHEMA_NAME.str))) return 1; } return (find_files(thd, files, NullS, mysql_data_home, @@ -2058,11 +2059,11 @@ int make_db_list(THD *thd, List *files, */ if (lex->orig_sql_command != SQLCOM_END) { - if (!my_strcasecmp(system_charset_info, information_schema_name.str, + if (!my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, idx_field_vals->db_value)) { *with_i_schema= 1; - return files->push_back(thd->strdup(information_schema_name.str)); + return files->push_back(thd->strdup(INFORMATION_SCHEMA_NAME.str)); } return files->push_back(thd->strdup(idx_field_vals->db_value)); } @@ -2071,7 +2072,7 @@ int make_db_list(THD *thd, List *files, Create list of existing databases. It is used in case of select from information schema table */ - if (files->push_back(thd->strdup(information_schema_name.str))) + if (files->push_back(thd->strdup(INFORMATION_SCHEMA_NAME.str))) return 1; *with_i_schema= 1; return (find_files(thd, files, NullS, @@ -3927,8 +3928,8 @@ int make_schema_select(THD *thd, SELECT_LEX *sel, We have to make non const db_name & table_name because of lower_case_table_names */ - make_lex_string(thd, &db, information_schema_name.str, - information_schema_name.length, 0); + make_lex_string(thd, &db, INFORMATION_SCHEMA_NAME.str, + INFORMATION_SCHEMA_NAME.length, 0); make_lex_string(thd, &table, schema_table->table_name, strlen(schema_table->table_name), 0); if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */ From 587942a792f5c31d0c5fc900dcacb454a0000e13 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 21:57:33 +0400 Subject: [PATCH 406/789] Fix warnings. include/typelib.h: Fix a compile warning. char *x is actually updated if it's found in the typelib (a peculiar way to return canonical value in case of a partial match) mysys/typelib.c: Fix a warning. sql/item_func.cc: Fix a compile-time warning. --- include/typelib.h | 2 +- mysys/typelib.c | 2 +- sql/item_func.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/typelib.h b/include/typelib.h index 79d3acd2d64..e04ec20f2bc 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -26,7 +26,7 @@ typedef struct st_typelib { /* Different types saved here */ unsigned int *type_lengths; } TYPELIB; -extern int find_type(const char *x, const TYPELIB *typelib, +extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); diff --git a/mysys/typelib.c b/mysys/typelib.c index 97b03b72b24..dc9f0850bbc 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -42,7 +42,7 @@ >0 Offset+1 in typelib for matched string */ -int find_type(const char *x, const TYPELIB *typelib, uint full_name) +int find_type(char *x, const TYPELIB *typelib, uint full_name) { int find,pos,findpos; reg1 my_string i; diff --git a/sql/item_func.cc b/sql/item_func.cc index cf3a4d3d758..59894c981af 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5069,7 +5069,7 @@ Item_func_sp::init_result_field(THD *thd) { DBUG_ENTER("Item_func_sp::init_result_field"); - LEX_STRING empty_name= { STRING_WITH_LEN("") }; + LEX_STRING empty_name= { C_STRING_WITH_LEN("") }; TABLE_SHARE *share; From fce728059116b131eebed402635210d4fe82ef1c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 22:15:51 +0400 Subject: [PATCH 407/789] Fix spelling (recursivity -> recursion) mysql-test/r/events.result: Fix spelling. mysql-test/r/events_bugs.result: Fix spelling. mysql-test/r/ps.result: Fix spelling. mysql-test/t/events.test: Fix spelling. mysql-test/t/events_bugs.test: Fix spelling. mysql-test/t/ps.test: Fix spelling. sql/sql_yacc.yy: Fix spelling. sql/share/errmsg.txt: Fix spelling. --- mysql-test/r/events.result | 4 ++-- mysql-test/r/events_bugs.result | 2 +- mysql-test/r/ps.result | 2 +- mysql-test/t/events.test | 4 ++-- mysql-test/t/events_bugs.test | 2 +- mysql-test/t/ps.test | 2 +- sql/share/errmsg.txt | 4 ++-- sql/sql_yacc.yy | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index 641de1571c3..b0640af0b13 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -73,7 +73,7 @@ DROP EVENT event_starts_test; create table test_nested(a int); create event e_43 on schedule every 1 second do set @a = 5; alter event e_43 do alter event e_43 do set @a = 4; -ERROR HY000: Recursivity of EVENT DDL statements is forbidden when body is present +ERROR HY000: Recursion of EVENT DDL statements is forbidden when body is present alter event e_43 do begin alter event e_43 on schedule every 5 minute; @@ -367,7 +367,7 @@ root localhost events_test Connect User lock select get_lock("test_lock2_1", 20) drop event закачка21; create table t_16 (s1 int); create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5; -ERROR HY000: Recursivity of EVENT DDL statements is forbidden when body is present +ERROR HY000: Recursion of EVENT DDL statements is forbidden when body is present drop table t_16; create event white_space on schedule every 10 hour diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 1a34f098b12..6835ecd7fde 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -17,7 +17,7 @@ DROP EVENT ДОЛЕÐ_региÑтър_утф8; SET NAMES latin1; set @a=3; CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5; -ERROR HY000: Recursivity of EVENT DDL statements is forbidden when body is present +ERROR HY000: Recursion of EVENT DDL statements is forbidden when body is present create event e_55 on schedule at 99990101000000 do drop table t; ERROR HY000: Incorrect AT value: '99990101000000' create event e_55 on schedule every 10 hour starts 99990101000000 do drop table t; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index c4e44945ec4..12608c48bf5 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -2285,7 +2285,7 @@ drop user pstest_xyz@localhost; deallocate prepare abc; drop event if exists xyz; create function func_1() returns int begin create event xyz on schedule at now() do select 123; return 1; end| -ERROR HY000: Recursivity of EVENT DDL statements is forbidden when body is present +ERROR HY000: Recursion of EVENT DDL statements is forbidden when body is present select func_1(), func_1(), func_1() from dual; ERROR 42000: FUNCTION test.func_1 does not exist drop function func_1; diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index 24f4b4eccab..39bc1063ace 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -74,7 +74,7 @@ DROP EVENT event_starts_test; # create table test_nested(a int); create event e_43 on schedule every 1 second do set @a = 5; ---error ER_EVENT_RECURSIVITY_FORBIDDEN +--error ER_EVENT_RECURSION_FORBIDDEN alter event e_43 do alter event e_43 do set @a = 4; delimiter |; alter event e_43 do @@ -351,7 +351,7 @@ drop event закачка21; # Bug #16410 Events: CREATE EVENT is legal in a CREATE TRIGGER statement # create table t_16 (s1 int); ---error ER_EVENT_RECURSIVITY_FORBIDDEN +--error ER_EVENT_RECURSION_FORBIDDEN create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5; drop table t_16; # diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index c1016f1752b..56c44dc3a9f 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -30,7 +30,7 @@ SET NAMES latin1; # START - BUG#16408: Events: crash for an event in a procedure # set @a=3; ---error ER_EVENT_RECURSIVITY_FORBIDDEN +--error ER_EVENT_RECURSION_FORBIDDEN CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5; # # END - BUG#16408: Events: crash for an event in a procedure diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 9f670f9973f..44f9bf350b2 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -2324,7 +2324,7 @@ drop event if exists xyz; #drop event xyz; #drop procedure proc_1; delimiter |; ---error ER_EVENT_RECURSIVITY_FORBIDDEN +--error ER_EVENT_RECURSION_FORBIDDEN create function func_1() returns int begin create event xyz on schedule at now() do select 123; return 1; end| delimiter ;| --error ER_SP_DOES_NOT_EXIST diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index c0da7053ac2..0a40f2b9ed1 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5978,8 +5978,8 @@ ER_BASE64_DECODE_ERROR ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA eng "Triggers can not be created on system tables" ger "Trigger können nicht auf Systemtabellen erzeugt werden" -ER_EVENT_RECURSIVITY_FORBIDDEN - eng "Recursivity of EVENT DDL statements is forbidden when body is present" +ER_EVENT_RECURSION_FORBIDDEN + eng "Recursion of EVENT DDL statements is forbidden when body is present" ger "Rekursivität von EVENT-DDL-Anweisungen ist unzulässig wenn ein Hauptteil (Body) existiert" ER_EVENTS_DB_ERROR eng "Cannot proceed because system tables used by Event Scheduler were found damaged at server start" diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 9d4c62052dd..b8dc377bb82 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1847,7 +1847,7 @@ ev_sql_stmt: */ if (lex->sphead) { - my_error(ER_EVENT_RECURSIVITY_FORBIDDEN, MYF(0)); + my_error(ER_EVENT_RECURSION_FORBIDDEN, MYF(0)); MYSQL_YYABORT; } From 3556deebd5e26ad5b48bdc52ac97af2e306c2bac Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 21:04:05 +0200 Subject: [PATCH 408/789] Bug #24121 Incorrect test for SSL_VERIFY_SERVER_CERT - Change 'mysql_options' third argment "arg" to "const void*" include/mysql.h: Change 'mysql_options' third argment "arg" to "const void*" sql-common/client.c: Change 'mysql_options' third argment "arg" to "const void*" --- include/mysql.h | 2 +- sql-common/client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mysql.h b/include/mysql.h index f76ae10ca16..33bdf80ef73 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -525,7 +525,7 @@ MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, - const char *arg); + const void *arg); void STDCALL mysql_free_result(MYSQL_RES *result); void STDCALL mysql_data_seek(MYSQL_RES *result, my_ulonglong offset); diff --git a/sql-common/client.c b/sql-common/client.c index 16fd20209b2..89d69b4bd1f 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2948,7 +2948,7 @@ mysql_fetch_lengths(MYSQL_RES *res) int STDCALL -mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg) +mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) { DBUG_ENTER("mysql_option"); DBUG_PRINT("enter",("option: %d",(int) option)); From 563a50770e5a079c8415d587eb8a0ecbc21246c4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 21:29:45 +0200 Subject: [PATCH 409/789] Remove remnants of ssl_des.test BitKeeper/deleted/.del-ssl_des-master.opt: Delete: mysql-test/t/ssl_des-master.opt --- mysql-test/t/ssl_des-master.opt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 mysql-test/t/ssl_des-master.opt diff --git a/mysql-test/t/ssl_des-master.opt b/mysql-test/t/ssl_des-master.opt deleted file mode 100644 index 0b2b8cb85ac..00000000000 --- a/mysql-test/t/ssl_des-master.opt +++ /dev/null @@ -1 +0,0 @@ ---loose_ssl-cert=std_data/server-cert-des.pem --loose_ssl-key=std_data/server-key-des.pem From c2d2ede33c4c67258676f26f7030ee3d79be5ef2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Mar 2007 23:56:48 +0200 Subject: [PATCH 410/789] Bug#22508 BUILD/compile-dist fails due to problem with readline/libedit - Move the link_sources command from top level Makefile into each subdir that need to link files BitKeeper/etc/ignore: Added libmysqld/link_sources libmysql/link_sources include/link_sources client/link_sources to the ignore list Makefile.am: Move link_sources down into each sub directory that might need it client/Makefile.am: Add "link_sources" to BUILT_SOURCES configure.in: Move link_sources down into each sub directory that might need it include/Makefile.am: Add "link_sources" to BUILT_SOURCES libmysql/Makefile.am: Add "link_sources" to BUILT_SOURCES libmysql/Makefile.shared: Add "link_sources" to BUILT_SOURCES libmysqld/Makefile.am: Add "link_sources" to BUILT_SOURCES libmysqld/examples/Makefile.am: Add "link_sources" to BUILT_SOURCES netware/Makefile.am: Add "link_sources" to BUILT_SOURCES sql/Makefile.am: Add "link_sources" to BUILT_SOURCES --- .bzrignore | 4 ++++ Makefile.am | 40 ---------------------------------- client/Makefile.am | 5 +++++ configure.in | 12 ++-------- include/Makefile.am | 5 +++-- libmysql/Makefile.am | 1 + libmysql/Makefile.shared | 8 ++++--- libmysqld/Makefile.am | 15 +++++++------ libmysqld/examples/Makefile.am | 5 +++-- netware/Makefile.am | 8 +++++-- sql/Makefile.am | 4 ++-- 11 files changed, 39 insertions(+), 68 deletions(-) diff --git a/.bzrignore b/.bzrignore index c4ccbfd4a3c..7010014f037 100644 --- a/.bzrignore +++ b/.bzrignore @@ -2937,3 +2937,7 @@ win/vs71cache.txt win/vs8cache.txt zlib/*.ds? zlib/*.vcproj +libmysqld/link_sources +libmysql/link_sources +include/link_sources +client/link_sources diff --git a/Makefile.am b/Makefile.am index 6d435bff85a..825f77846c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,48 +31,8 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \ DIST_SUBDIRS = $(SUBDIRS) BUILD -# Run these targets before any others, also make part of clean target, -# to make sure we create new links after a clean. -BUILT_SOURCES = linked_client_sources linked_server_sources \ - @linked_client_targets@ \ - @linked_libmysqld_targets@ \ - linked_include_sources @linked_netware_sources@ - -CLEANFILES = $(BUILT_SOURCES) DISTCLEANFILES = ac_available_languages_fragment -linked_include_sources: - cd include; $(MAKE) link_sources - echo timestamp > linked_include_sources - -linked_client_sources: @linked_client_targets@ - cd client; $(MAKE) link_sources - echo timestamp > linked_client_sources - -linked_libmysql_sources: - cd libmysql; $(MAKE) link_sources - echo timestamp > linked_libmysql_sources - -linked_libmysql_r_sources: linked_libmysql_sources - cd libmysql_r; $(MAKE) link_sources - echo timestamp > linked_libmysql_r_sources - -linked_libmysqld_sources: - cd libmysqld; $(MAKE) link_sources - echo timestamp > linked_libmysqld_sources - -linked_libmysqldex_sources: - cd libmysqld/examples; $(MAKE) link_sources - echo timestamp > linked_libmysqldex_sources - -linked_netware_sources: - cd @netware_dir@; $(MAKE) link_sources - echo timestamp > linked_netware_sources - -linked_server_sources: - cd sql; $(MAKE) link_sources - echo timestamp > linked_server_sources - # Create permission databases init-db: all $(top_builddir)/scripts/mysql_install_db diff --git a/client/Makefile.am b/client/Makefile.am index 747b27e9aa0..c2993c5a0d5 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -36,6 +36,10 @@ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ EXTRA_DIST = get_password.c CMakeLists.txt +BUILT_SOURCES = link_sources + +CLEANFILES = $(BUILT_SOURCES) + bin_PROGRAMS = mysql \ mysqladmin \ mysqlbinlog \ @@ -108,6 +112,7 @@ link_sources: done; \ rm -f $(srcdir)/my_user.c; \ @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c; + echo timestamp > link_sources; # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/configure.in b/configure.in index 45ea1b8b5c5..5922acbc1cc 100644 --- a/configure.in +++ b/configure.in @@ -2257,11 +2257,10 @@ AC_SUBST(tools_dirs) #MYSQL_CHECK_CPU libmysqld_dirs= -linked_libmysqld_targets= if test "$with_embedded_server" = "yes" then libmysqld_dirs=libmysqld - linked_libmysqld_targets="linked_libmysqld_sources linked_libmysqldex_sources" + AC_CONFIG_FILES(libmysqld/Makefile libmysqld/examples/Makefile) # We can't build embedded library without building the server, because # we depend on libmysys, libmystrings, libmyisam, etc. @@ -2271,7 +2270,6 @@ fi # mysql_config --libmysqld-libs will print out something like # -L/path/to/lib/mysql -lmysqld -lmyisam -lmysys -lmystrings -ldbug ... AC_SUBST([libmysqld_dirs]) -AC_SUBST([linked_libmysqld_targets]) # Shall we build the docs? AC_ARG_WITH(docs, @@ -2446,7 +2444,6 @@ thread_dirs= dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. sql_client_dirs= -linked_client_targets="linked_libmysql_sources" AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no") @@ -2455,7 +2452,6 @@ then sql_client_dirs="strings regex mysys dbug extra libmysql client" else sql_client_dirs="strings regex mysys dbug extra libmysql libmysql_r client" - linked_client_targets="$linked_client_targets linked_libmysql_r_sources" AC_CONFIG_FILES(libmysql_r/Makefile) AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe]) fi @@ -2467,18 +2463,14 @@ AC_SUBST(CLIENT_THREAD_LIBS) AC_SUBST(NON_THREADED_LIBS) AC_SUBST(STATIC_NSS_FLAGS) AC_SUBST(sql_client_dirs) -AC_SUBST(linked_client_targets) -# If configuring for NetWare, set up to link sources from and build the netware directory +# If configuring for NetWare, build the netware directory netware_dir= -linked_netware_sources= if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null then netware_dir="netware" - linked_netware_sources="linked_netware_sources" fi AC_SUBST(netware_dir) -AC_SUBST(linked_netware_sources) AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware") if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no" diff --git a/include/Makefile.am b/include/Makefile.am index d40df7d8343..9be6738b3f4 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -16,7 +16,7 @@ # MA 02111-1307, USA # FIXME 'abi_check' should be in BUILT_SOURCES, disabled for now -BUILT_SOURCES = $(HEADERS_GEN) +BUILT_SOURCES = $(HEADERS_GEN) link_sources HEADERS_GEN = mysql_version.h my_config.h HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \ my_list.h my_alloc.h typelib.h @@ -48,9 +48,10 @@ EXTRA_DIST = mysql_h.ic DISTCLEANFILES = sched.h $(CLEANFILES) link_sources: - -$(RM) -fr readline + -$(RM) -f readline openssl @readline_h_ln_cmd@ @yassl_h_ln_cmd@ + echo timestamp > link_sources my_config.h: ../config.h $(CP) ../config.h my_config.h diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index 38680c98d53..ebfe15774ff 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -70,6 +70,7 @@ link_sources: @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc net.c ; \ rm -f password.c; \ @LN_CP_F@ $(top_srcdir)/sql/password.c password.c + echo timestamp > link_sources # This part requires GNUmake # diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index dc6d658fcdf..c24c6ab52db 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -79,8 +79,11 @@ target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \ $(sql_cmn_objects) $(vio_objects) $(sqlobjects) target_ldflags = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@ vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo + +BUILT_SOURCES = link_sources + CLEANFILES = $(target_libadd) $(SHLIBOBJS) \ - $(target) + $(target) $(BUILT_SOURCES) DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DDEFAULT_HOME_ENV=MYSQL_HOME \ @@ -103,8 +106,7 @@ clean-local: `echo $(vio_objects) | sed "s;\.lo;.c;g"` \ `echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \ $(CHARSET_SRCS) $(CHARSET_OBJS) \ - $(mystringsextra) $(mysysheaders) $(vioheaders)\ - ../linked_libmysql_sources ../linked_libmysql_r_sources \ + $(mystringsextra) $(mysysheaders) $(vioheaders) \ net.c conf_to_src_SOURCES = conf_to_src.c diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 0f57d01108c..0f49acfc8c5 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -176,11 +176,11 @@ endif #libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@ #CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la -# This is called from the toplevel makefile. If we can link now -# to an existing file in source, we do that, else we assume it -# will show up in the build tree eventually (generated file). +BUILT_SOURCES = link_sources + +CLEANFILES = $(BUILT_SOURCES) + link_sources: - set -x; \ for f in $(sqlsources); do \ rm -f $$f; \ if test -e $(top_srcdir)/sql/$$f ; \ @@ -214,12 +214,13 @@ link_sources: done; \ fi; \ rm -f client_settings.h; \ - @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h + @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \ + client_settings.h; \ + echo timestamp > link_sources clean-local: - rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"` \ - $(top_srcdir)/linked_libmysqld_sources; \ + rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \ rm -f client_settings.h # Don't update the files from bitkeeper diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index f8c60ab3694..3e4769c564d 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -17,10 +17,10 @@ noinst_PROGRAMS = mysql bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES) tests_sources = $(mysql_client_test_embedded_SOURCES) -CLEANFILES = $(client_sources) $(tests_sources) +BUILT_SOURCES = link_sources +CLEANFILES = $(client_sources) $(tests_sources) $(BUILT_SOURCES) link_sources: - set -x; \ for f in $(client_sources); do \ rm -f $$f; \ @LN_CP_F@ $(top_srcdir)/client/$$f $$f; \ @@ -29,6 +29,7 @@ link_sources: rm -f $$f; \ @LN_CP_F@ $(top_srcdir)/tests/$$f $$f; \ done + echo timestamp > link_sources DEFS = -DEMBEDDED_LIBRARY INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \ diff --git a/netware/Makefile.am b/netware/Makefile.am index f68e8476156..0b62a90073e 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -44,16 +44,20 @@ netware_build_files = client/mysql.def client/mysqladmin.def \ storage/myisam/myisam_ftdump.def link_sources: - set -x; \ for f in $(netware_build_files); do \ rm -f ../$$f; \ org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \ @LN_CP_F@ $(srcdir)/$$org ../$$f; \ done + echo timestamp > link_sources + +BUILT_SOURCES = link_sources +CLEANFILES = $(BUILT_SOURCES) + else BUILT_SOURCES = libmysql.imp -DISTCLEANFILES = $(BUILT_SOURCES) +CLEANFILES = $(BUILT_SOURCES) # Create the libmysql.imp from libmysql/libmysql.def libmysql.imp: $(top_srcdir)/libmysql/libmysql.def diff --git a/sql/Makefile.am b/sql/Makefile.am index 43331e3d0c9..8beca9c2eab 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -123,11 +123,11 @@ DEFS = -DMYSQL_SERVER \ @DEFS@ BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h -BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h +BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h link_sources EXTRA_DIST = udf_example.c udf_example.def $(BUILT_MAINT_SRC) \ nt_servc.cc nt_servc.h message.mc CMakeLists.txt \ udf_example.c udf_example.def -CLEANFILES = lex_hash.h sql_yacc.output +CLEANFILES = lex_hash.h sql_yacc.output link_sources MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC) AM_YFLAGS = -d --verbose From c36e06dd90fa60c6a81264863291a088acb08be2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 10:32:06 +0800 Subject: [PATCH 411/789] Bug#26898, Alter table to empty merge from ndb causes mysqld to crash sql/ha_ndbcluster.cc: remove the assertion, when trans is NULL, return 0 directly since the transaction is possibly released in ha_ndbcluster::external_lock(...) function --- sql/ha_ndbcluster.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 1def6f221f7..8e38f2eb128 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4366,7 +4366,9 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all) DBUG_PRINT("transaction",("%s", trans == thd_ndb->stmt ? "stmt" : "all")); - DBUG_ASSERT(ndb && trans); + DBUG_ASSERT(ndb); + if (trans == NULL) + DBUG_RETURN(0); if (execute_commit(thd,trans) != 0) { From e9b606bf3e0ccc9d9ff27541371cc5faf72dd813 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 09:32:49 +0200 Subject: [PATCH 412/789] Bug#25197 repeat function returns null when using table field directly as count - Add extra test case from bug#27073 - Change "if" to be optimized for count > 0 mysql-test/r/func_str.result: Add test case from bug#27073 mysql-test/t/func_str.test: Add test case from bug#27073 sql/item_strfunc.cc: Change the if statemnet to be optimized for the normal case where count > 0 --- mysql-test/r/func_str.result | 9 +++++++++ mysql-test/t/func_str.test | 4 ++++ sql/item_strfunc.cc | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index e716a89132c..6abd3a61a4b 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1953,5 +1953,14 @@ A B tire 0 # # 1 ## ## 2 +SELECT REPEAT('0', CAST(0 AS UNSIGNED)); +REPEAT('0', CAST(0 AS UNSIGNED)) + +SELECT REPEAT('0', -2); +REPEAT('0', -2) + +SELECT REPEAT('0', 2); +REPEAT('0', 2) +00 DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 7cf7ef2cab6..80e4b9fe40c 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1028,6 +1028,10 @@ INSERT INTO `t1` (`id`, `tire`) VALUES ('A', 0), ('B', 1),('C', 2); SELECT REPEAT( '#', tire ) AS A, REPEAT( '#', tire % 999 ) AS B, tire FROM `t1`; +SELECT REPEAT('0', CAST(0 AS UNSIGNED)); +SELECT REPEAT('0', -2); +SELECT REPEAT('0', 2); + DROP TABLE t1; --echo End of 5.0 tests diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 627751a1106..0ffda000e60 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2252,7 +2252,7 @@ String *Item_func_repeat::val_str(String *str) goto err; // string and/or delim are null null_value= 0; - if (count == 0 || count < 0 && !args[1]->unsigned_flag) + if (count <= 0 && (count == 0 || !args[1]->unsigned_flag)) return &my_empty_string; /* Assumes that the maximum length of a String is < INT_MAX32. */ From e0f5f280a756d14adb57e9ace0cf913dc0c7b483 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 10:08:26 +0200 Subject: [PATCH 413/789] Use mtr_verbose instead of "if ($opt_verbose)" --- mysql-test/mysql-test-run.pl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 95457b7bd66..97889e53b89 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2798,10 +2798,7 @@ sub initialize_servers () { } else { - if ($opt_verbose) - { - mtr_report("No need to create '$opt_vardir' it already exists"); - } + mtr_verbose("No need to create '$opt_vardir' it already exists"); } } else From a6f6c7d5cf8d4a0af658d023e34834268d77844b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 10:10:27 +0200 Subject: [PATCH 414/789] Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes - test case --- mysql-test/r/ndb_single_user.result | 3 +++ mysql-test/t/ndb_single_user.test | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result index 907cb17fecf..7959d8478e1 100644 --- a/mysql-test/r/ndb_single_user.result +++ b/mysql-test/r/ndb_single_user.result @@ -53,4 +53,7 @@ update t1 set b=b+100 where a=4; ERROR HY000: Got error 299 'Operation not allowed or aborted due to single user mode' from ndbcluster COMMIT; ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +create table t2 (a int) engine myisam; +alter table t2 add column (b int); +drop table t2; drop table t1; diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/t/ndb_single_user.test index b191e573996..f2f47becb0c 100644 --- a/mysql-test/t/ndb_single_user.test +++ b/mysql-test/t/ndb_single_user.test @@ -97,9 +97,21 @@ update t1 set b=b+100 where a=4; --error 1296 COMMIT; +# Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb +# tables for other mysqld nodes +--connection server2 +create table t2 (a int) engine myisam; +alter table t2 add column (b int); + +# exit single user mode --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT # cleanup +--connection server2 +drop table t2; --connection server1 drop table t1; + +# End of 5.0 tests + From 1747a6b60c7fd9d7c5ddd6559821c35690553c64 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 10:12:33 +0200 Subject: [PATCH 415/789] Bug#27490 Function to log to NT event log could allocate memory - Change 'print_buffer_to_nt_event_log' to overwrite the string if the buffer is not long enough to hold the ending CR/LF's - Make functions static - Remove the "hack" intended to force 'print_buffer_to_nt_event_log' never to use "new" sql/log.cc: -Change 'print_buffer_to_nt_event_log' to overwrite the string if the buffer is not long enough to hold the ending CR/LF's - Make functions static - Remove the "hack" intended to force 'print_buffer_to_nt_event_log' never to use "new" --- sql/log.cc | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 1961a5b6f88..5979b688ccf 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -283,7 +283,7 @@ err: #ifdef __NT__ static int eventSource = 0; -void setup_windows_event_source() +static void setup_windows_event_source() { HKEY hRegKey= NULL; DWORD dwError= 0; @@ -2228,7 +2228,7 @@ static bool test_if_number(register const char *str, } /* test_if_number */ -void print_buffer_to_file(enum loglevel level, const char *buffer) +static void print_buffer_to_file(enum loglevel level, const char *buffer) { time_t skr; struct tm tm_tmp; @@ -2325,23 +2325,15 @@ void MYSQL_LOG::signal_update() } #ifdef __NT__ -void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, - uint length, int buffLen) +static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, + uint length, int buffLen) { HANDLE event; - char *buffptr; - LPCSTR *buffmsgptr; + char *buffptr= buff; DBUG_ENTER("print_buffer_to_nt_eventlog"); - buffptr= buff; - if (length > (uint)(buffLen-5)) - { - char *newBuff= new char[length + 5]; - strcpy(newBuff, buff); - buffptr= newBuff; - } - strmov(buffptr+length, "\r\n\r\n"); - buffmsgptr= (LPCSTR*) &buffptr; // Keep windows happy + /* Add ending CR/LF's to string, overwrite last chars if necessary */ + strmov(buffptr+min(length, buffLen-5), "\r\n\r\n"); setup_windows_event_source(); if ((event= RegisterEventSource(NULL,"MySQL"))) @@ -2349,24 +2341,20 @@ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, switch (level) { case ERROR_LEVEL: ReportEvent(event, EVENTLOG_ERROR_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, - buffmsgptr, NULL); + (LPCSTR*)&buffptr, NULL); break; case WARNING_LEVEL: ReportEvent(event, EVENTLOG_WARNING_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, - buffmsgptr, NULL); + (LPCSTR*) &buffptr, NULL); break; case INFORMATION_LEVEL: ReportEvent(event, EVENTLOG_INFORMATION_TYPE, 0, MSG_DEFAULT, NULL, 1, - 0, buffmsgptr, NULL); + 0, (LPCSTR*) &buffptr, NULL); break; } DeregisterEventSource(event); } - /* if we created a string buffer, then delete it */ - if (buffptr != buff) - delete[] buffptr; - DBUG_VOID_RETURN; } #endif /* __NT__ */ @@ -2404,7 +2392,7 @@ void vprint_msg_to_log(enum loglevel level, const char *format, va_list args) uint length; DBUG_ENTER("vprint_msg_to_log"); - length= my_vsnprintf(buff, sizeof(buff)-5, format, args); + length= my_vsnprintf(buff, sizeof(buff), format, args); print_buffer_to_file(level, buff); #ifdef __NT__ From 2bc57a692c228141a86d382019fad33a4a6ae9ea Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 10:24:33 +0200 Subject: [PATCH 416/789] Dont' redirect stderr in ActiveState perl Improve comments --- mysql-test/lib/mtr_process.pl | 45 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 690ca8313dd..53bf37bcc83 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -38,8 +38,8 @@ sub mtr_kill_processes ($); sub mtr_ping_with_timeout($); sub mtr_ping_port ($); -# static in C -sub spawn_impl ($$$$$$$$); +# Local function +sub spawn_impl ($$$$$$$); ############################################################################## # @@ -47,18 +47,16 @@ sub spawn_impl ($$$$$$$$); # ############################################################################## -# This function try to mimic the C version used in "netware/mysql_test_run.c" - sub mtr_run ($$$$$$;$) { my $path= shift; my $arg_list_t= shift; my $input= shift; my $output= shift; my $error= shift; - my $pid_file= shift; + my $pid_file= shift; # Not used my $spawn_opts= shift; - return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,$pid_file, + return spawn_impl($path,$arg_list_t,'run',$input,$output,$error, $spawn_opts); } @@ -68,10 +66,10 @@ sub mtr_run_test ($$$$$$;$) { my $input= shift; my $output= shift; my $error= shift; - my $pid_file= shift; + my $pid_file= shift; # Not used my $spawn_opts= shift; - return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,$pid_file, + return spawn_impl($path,$arg_list_t,'test',$input,$output,$error, $spawn_opts); } @@ -81,28 +79,22 @@ sub mtr_spawn ($$$$$$;$) { my $input= shift; my $output= shift; my $error= shift; - my $pid_file= shift; + my $pid_file= shift; # Not used my $spawn_opts= shift; - return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,$pid_file, + return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error, $spawn_opts); } -############################################################################## -# -# If $join is set, we return the error code, else we return the PID -# -############################################################################## -sub spawn_impl ($$$$$$$$) { +sub spawn_impl ($$$$$$$) { my $path= shift; my $arg_list_t= shift; my $mode= shift; my $input= shift; my $output= shift; my $error= shift; - my $pid_file= shift; # FIXME my $spawn_opts= shift; if ( $::opt_script_debug ) @@ -155,10 +147,6 @@ sub spawn_impl ($$$$$$$$) { else { # Child, redirect output and exec - # FIXME I tried POSIX::setsid() here to detach and, I hoped, - # avoid zombies. But everything went wild, somehow the parent - # became a deamon as well, and was hard to kill ;-) - # Need to catch SIGCHLD and do waitpid or something instead...... $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't @@ -196,7 +184,15 @@ sub spawn_impl ($$$$$$$$) { } else { - if ( ! open(STDERR,$log_file_open_mode,$error) ) + if ( $::glob_win32_perl ) + { + # Don't redirect stdout on ActiveState perl since this is + # just another thread in the same process. + # Should be fixed so that the thread that is created with fork + # executes the exe in another process and wait's for it to return. + # In the meanwhile, we get all the output from mysqld's to screen + } + elsif ( ! open(STDERR,$log_file_open_mode,$error) ) { mtr_child_error("can't redirect STDERR to \"$error\": $!"); } @@ -259,9 +255,7 @@ sub spawn_parent_impl { # We do blocking waitpid() until we get the return from the # "mysqltest" call. But if a mysqld process dies that we # started, we take this as an error, and kill mysqltest. - # - # FIXME is this as it should be? Can't mysqld terminate - # normally from running a test case? + my $exit_value= -1; my $saved_exit_value; @@ -450,7 +444,6 @@ sub mtr_kill_leftovers () { # We scan the "var/run/" directory for other process id's to kill - # FIXME $path_run_dir or something my $rundir= "$::opt_vardir/run"; mtr_debug("Processing PID files in directory '$rundir'..."); From 04dc7c88309c270bb8607a2a195bb93aeccb4988 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 12:09:30 +0300 Subject: [PATCH 417/789] disabled a test reuturning wrong result (reported separately) --- mysql-test/r/subselect3.result | 6 ------ mysql-test/t/subselect3.test | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index 6a7a601ccf9..96a3ee00a59 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -661,12 +661,6 @@ SELECT * FROM t1 GROUP by t1.a HAVING (MAX(t1.b) > (SELECT MAX(t2.b) FROM t2 WHERE t2.c < t1.c HAVING MAX(t2.b+t1.a) < 10)); a b c -SELECT a, AVG(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b)) -AS test FROM t1 GROUP BY a; -a AVG(b) test -1 4.0000 NULL -2 2.0000 k -3 2.5000 NULL SELECT a,b,c FROM t1 WHERE b in (9,3,4) ORDER BY b,c; a b c 1 3 c diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test index e3703c0da16..e8eae3e2452 100644 --- a/mysql-test/t/subselect3.test +++ b/mysql-test/t/subselect3.test @@ -507,8 +507,9 @@ SELECT a, MAX(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) SELECT * FROM t1 GROUP by t1.a HAVING (MAX(t1.b) > (SELECT MAX(t2.b) FROM t2 WHERE t2.c < t1.c HAVING MAX(t2.b+t1.a) < 10)); -SELECT a, AVG(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b)) - AS test FROM t1 GROUP BY a; +#FIXME: Enable this test after fixing bug #27321 +#SELECT a, AVG(b), (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b)) +# AS test FROM t1 GROUP BY a; SELECT a,b,c FROM t1 WHERE b in (9,3,4) ORDER BY b,c; From 230a116ed201ace7d9b4b703cfc2b65d9076cf36 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 11:16:50 +0200 Subject: [PATCH 418/789] Turn off im if extern Remove strange comment Add run_query function --- mysql-test/mysql-test-run.pl | 65 +++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 69103334252..b97c3917285 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -848,20 +848,22 @@ sub command_line_setup () { # -------------------------------------------------------------------------- # Check im suport # -------------------------------------------------------------------------- - if (!$opt_extern) + if ($opt_extern) { - if ( $mysql_version_id < 50000 ) { - # Instance manager is not supported until 5.0 - $opt_skip_im= 1; - - } - - if ( $glob_win32 ) { - mtr_report("Disable Instance manager - not supported on Windows"); - $opt_skip_im= 1; - } - + mtr_report("Disable instance manager when running with extern mysqld"); + $opt_skip_im= 1; } + elsif ( $mysql_version_id < 50000 ) + { + # Instance manager is not supported until 5.0 + $opt_skip_im= 1; + } + elsif ( $glob_win32 ) + { + mtr_report("Disable Instance manager - testing not supported on Windows"); + $opt_skip_im= 1; + } + # -------------------------------------------------------------------------- # Record flag # -------------------------------------------------------------------------- @@ -1055,8 +1057,6 @@ sub command_line_setup () { # socket path names. $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 ); - # Put this into a hash, will be a C struct - $master->[0]= { pid => 0, @@ -1328,7 +1328,7 @@ sub collect_mysqld_features () { # # Execute "mysqld --no-defaults --help --verbose" to get a - # of all features and settings + # list of all features and settings # my $list= `$exe_mysqld --no-defaults --verbose --help`; @@ -1392,6 +1392,40 @@ sub collect_mysqld_features () { } +sub run_query($$) { + my ($mysqld, $query)= @_; + + my $args; + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--user=%s", $opt_user); + mtr_add_arg($args, "--port=%d", $mysqld->{'port'}); + mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'}); + mtr_add_arg($args, "--silent"); # Tab separated output + mtr_add_arg($args, "-e '%s'", $query); + + my $cmd= "$exe_mysql " . join(' ', @$args); + mtr_verbose("cmd: $cmd"); + return `$cmd`; +} + + +sub collect_mysqld_features_from_running_server () +{ + my $list= run_query($master->[0], "use mysql; SHOW VARIABLES"); + + foreach my $line (split('\n', $list)) + { + # Put variables into hash + if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ ) + { + print "$1=\"$2\"\n"; + $mysqld_variables{$1}= $2; + } + } +} + sub executable_setup_im () { # Look for instance manager binary - mysqlmanager @@ -1485,7 +1519,6 @@ sub executable_setup () { $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow"); $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog"); $exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin"); - $exe_mysql= mtr_exe_exists("$path_client_bindir/mysql"); if (!$opt_extern) { From cd36f9cf949cc393f2ab49da9add1f132dbedc37 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 12:18:06 +0300 Subject: [PATCH 419/789] Bug#27015 s_query.q_append() called without s_query.reserve()? there is a way to miss allocation for the punctuation marks, namely if (q == EOF) is true inside of append_identifier(), i.e in case names are not quoted (not by default). Replacing q_append with the method with reallocation if needed. sql/sql_base.cc: changing the method that uses reallocation if necessary --- sql/sql_base.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 02191959233..16f30038c81 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1328,10 +1328,10 @@ void close_temporary_tables(THD *thd) due to special characters in the names */ append_identifier(thd, &s_query, table->s->db.str, strlen(table->s->db.str)); - s_query.q_append('.'); + s_query.append('.'); append_identifier(thd, &s_query, table->s->table_name.str, strlen(table->s->table_name.str)); - s_query.q_append(','); + s_query.append(','); next= table->next; close_temporary(table, 1, 1); } From 660cb2fdea23bbea8c5d94f257e53d1fd6dd31ab Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 12:11:44 +0200 Subject: [PATCH 420/789] After merge fix --- mysql-test/t/heap_btree.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 8d0c17c8ef5..d5a4fb7a734 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -235,3 +235,5 @@ CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY; INSERT INTO t1 VALUES(NULL),(NULL); DROP TABLE t1; +--echo End of 5.0 tests + From 40df5f68b53b67514cf45c4b7d241b8f31d5f368 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 12:23:55 +0200 Subject: [PATCH 421/789] Bug#25309 SSL connections without CA certificate broken since MySQL 5.0.23 - Turn off verification of peer if both ca_path and ca_file is null i.e from only passing --ssl-key= and --ssl-cert= to the mysql utility programs. The server will authenticate the client accoring to GRANT tables but the client won't authenticate the server mysql-test/r/openssl_1.result: Update result file mysql-test/t/openssl_1.test: Test that it's possible to connect with --ssl-ca set to /dev/null vio/viosslfactories.c: Turn off verification of peer if both ca_file and ca_path is NULL --- mysql-test/r/openssl_1.result | 2 ++ mysql-test/t/openssl_1.test | 9 ++++++++- vio/viosslfactories.c | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 34d8e3ab768..92900ac1a83 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -51,3 +51,5 @@ SSL error: Unable to get private key from '' mysqltest: Could not open connection 'default': 2026 SSL connection error SSL error: Unable to get certificate from '' mysqltest: Could not open connection 'default': 2026 SSL connection error +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 3d614514de3..2eb3251c862 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -95,4 +95,11 @@ drop table t1; --error 1 --exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 - +# +# Bug#25309 SSL connections without CA certificate broken since MySQL 5.0.23 +# +# Test that we can open encrypted connection to server without +# verification of servers certificate by setting both ca certificate +# and ca path to NULL +# +--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1 diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 55d3792365f..a12a45df648 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -301,6 +301,14 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file, { struct st_VioSSLFd *ssl_fd; int verify= SSL_VERIFY_PEER; + + /* + Turn off verification of servers certificate if both + ca_file and ca_path is set to NULL + */ + if (ca_file == 0 && ca_path == 0) + verify= SSL_VERIFY_NONE; + if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file, ca_path, cipher, TLSv1_client_method()))) { From c8f1cf4cf95279ad5726230603630cff2e6f7212 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 14:35:23 +0300 Subject: [PATCH 422/789] Bug #27300: Geometry fields have a result type string and a special subclass to cater for the differences between them and the base class (just like DATE/TIME). When creating temporary tables for results of functions that return results of type GEOMETRY we must construct fields of the derived class instead of the base class. Fixed by creating a GEOMETRY field (Field_geom) instead of a generic BLOB (Field_blob) in temp tables for the results of GIS functions that have GEOMETRY return type (Item_geometry_func). mysql-test/r/gis.result: Bug #27300: test case mysql-test/t/gis.test: Bug #27300: test case sql/item.cc: Bug #27300: Create a GEOMETRY field (Field_geom) instead of a generic BLOB (Field_blob) in temp tables for the results of GIS functions (Item_geometry_func). sql/sql_select.cc: Bug #27300: Create a GEOMETRY field (Field_geom) instead of a generic BLOB (Field_blob) in temp tables for the results of GIS functions (Item_geometry_func). --- mysql-test/r/gis.result | 11 +++++++++++ mysql-test/t/gis.test | 11 +++++++++++ sql/item.cc | 5 ++++- sql/sql_select.cc | 6 +++--- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 58149d68ca3..749c84a1a6f 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -769,3 +769,14 @@ create table t1 (g geometry not null); insert into t1 values(default); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1; +CREATE TABLE t1 (a GEOMETRY); +CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1; +CREATE VIEW v2 AS SELECT a FROM t1; +DESCRIBE v1; +Field Type Null Key Default Extra +GeomFromwkb(ASBINARY(a)) geometry YES NULL +DESCRIBE v2; +Field Type Null Key Default Extra +a geometry YES NULL +DROP VIEW v1,v2; +DROP TABLE t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index d92ff804ccb..4f6104aab3e 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -479,3 +479,14 @@ create table t1 (g geometry not null); insert into t1 values(default); drop table t1; +# +# Bug #27300: create view with geometry functions lost columns types +# +CREATE TABLE t1 (a GEOMETRY); +CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1; +CREATE VIEW v2 AS SELECT a FROM t1; +DESCRIBE v1; +DESCRIBE v2; + +DROP VIEW v1,v2; +DROP TABLE t1; diff --git a/sql/item.cc b/sql/item.cc index 808e7925729..8568a44c547 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4275,7 +4275,6 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table) case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_GEOMETRY: if (this->type() == Item::TYPE_HOLDER) return new Field_blob(max_length, maybe_null, name, table, collation.collation, 1); @@ -4283,6 +4282,10 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table) return new Field_blob(max_length, maybe_null, name, table, collation.collation); break; // Blob handled outside of case + case MYSQL_TYPE_GEOMETRY: + return new Field_geom(max_length, maybe_null, name, table, + (Field::geometry_type) + ((Item_geometry_func *)this)->get_geometry_type()); } } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bb57764700d..d983146da93 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8793,12 +8793,12 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, enum enum_field_types type; /* - DATE/TIME fields have STRING_RESULT result type. To preserve - type they needed to be handled separately. + DATE/TIME and GEOMETRY fields have STRING_RESULT result type. + To preserve type they needed to be handled separately. */ if ((type= item->field_type()) == MYSQL_TYPE_DATETIME || type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE || - type == MYSQL_TYPE_TIMESTAMP) + type == MYSQL_TYPE_TIMESTAMP || type == MYSQL_TYPE_GEOMETRY) new_field= item->tmp_table_field_from_field_type(table); /* Make sure that the blob fits into a Field_varstring which has From 8de46d0d53173388c67b9a9984bc471b7cbc35bc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 15:30:03 +0200 Subject: [PATCH 423/789] Eliminating some warnings. sql/field.h: Using my_ptrdiff_t for offset instead of uint. sql/log_event.cc: Removing debug code that generated warnings on Windows build. --- sql/field.h | 8 ++++---- sql/log_event.cc | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sql/field.h b/sql/field.h index f27ed8b9394..27eac2be729 100644 --- a/sql/field.h +++ b/sql/field.h @@ -193,9 +193,9 @@ public: */ virtual void sql_type(String &str) const =0; virtual uint size_of() const =0; // For new field - inline bool is_null(uint row_offset=0) + inline bool is_null(my_ptrdiff_t row_offset= 0) { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : table->null_row; } - inline bool is_real_null(uint row_offset=0) + inline bool is_real_null(my_ptrdiff_t row_offset= 0) { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : 0; } inline bool is_null_in_record(const uchar *record) { @@ -210,9 +210,9 @@ public: return 0; return test(null_ptr[offset] & null_bit); } - inline void set_null(int row_offset=0) + inline void set_null(my_ptrdiff_t row_offset= 0) { if (null_ptr) null_ptr[row_offset]|= null_bit; } - inline void set_notnull(int row_offset=0) + inline void set_notnull(my_ptrdiff_t row_offset= 0) { if (null_ptr) null_ptr[row_offset]&= (uchar) ~null_bit; } inline bool maybe_null(void) { return null_ptr != 0 || table->maybe_null; } inline bool real_maybe_null(void) { return null_ptr != 0; } diff --git a/sql/log_event.cc b/sql/log_event.cc index 6b5c234681b..c9d93a2d53a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5906,12 +5906,7 @@ unpack_row(RELAY_LOG_INFO const *rli, /* We only unpack the field if it was non-null */ -#ifndef DBUG_OFF - const char *const old_ptr= pack_ptr; -#endif pack_ptr= f->unpack(f->ptr, pack_ptr); - DBUG_PRINT("debug", ("Unpacking field '%s' from %d bytes", - f->field_name, pack_ptr - old_ptr)); } bitmap_set_bit(rw_set, f->field_index); From f8eed3c1cef8049a81839fb8d526719437bc0d0b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 15:33:29 +0200 Subject: [PATCH 424/789] restored run-time thread lib detection sql/stacktrace.c: removed code duplication sql/stacktrace.h: removed code duplication --- include/my_pthread.h | 9 +++++++++ include/thr_alarm.h | 8 +++----- mysys/my_pthread.c | 10 +++++----- mysys/my_thr_init.c | 21 +++++++++++++++++++++ mysys/thr_alarm.c | 44 ++++++++++++++++++++++---------------------- sql/mysqld.cc | 34 +++++++++++++++++++--------------- sql/stacktrace.c | 17 ++--------------- sql/stacktrace.h | 2 -- 8 files changed, 81 insertions(+), 64 deletions(-) diff --git a/include/my_pthread.h b/include/my_pthread.h index 4df105e1b20..340dc32981a 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -701,6 +701,15 @@ extern uint my_thread_end_wait_time; Keep track of shutdown,signal, and main threads so that my_end() will not report errors with them */ + +/* Which kind of thread library is in use */ + +#define THD_LIB_OTHER 1 +#define THD_LIB_NPTL 2 +#define THD_LIB_LT 4 + +extern uint thd_lib_detected; + /* statistics_xxx functions are for not essential statistic */ #ifndef thread_safe_increment diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 14dd538c9e4..a2694ba105b 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -24,11 +24,6 @@ extern "C" { #ifndef USE_ALARM_THREAD #define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ #endif -#ifdef HAVE_LINUXTHREADS -#define THR_CLIENT_ALARM SIGALRM -#else -#define THR_CLIENT_ALARM SIGUSR1 -#endif #ifdef HAVE_rts_threads #undef USE_ONE_SIGNAL_HAND #define USE_ALARM_THREAD @@ -90,6 +85,9 @@ typedef struct st_alarm { my_bool malloced; } ALARM; +extern uint thr_client_alarm; +extern pthread_t alarm_thread; + #define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)!= 0) void init_thr_alarm(uint max_alarm); diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 74ba98c321a..db01602f4ab 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -31,6 +31,8 @@ uint thd_lib_detected= 0; +uint thd_lib_detected; + #ifndef my_pthread_setprio void my_pthread_setprio(pthread_t thread_id,int prior) { @@ -51,8 +53,6 @@ int my_pthread_getprio(pthread_t thread_id) int policy; if (!pthread_getschedparam(thread_id,&policy,&tmp_sched_param)) { - DBUG_PRINT("thread",("policy: %d priority: %d", - policy,tmp_sched_param.sched_priority)); return tmp_sched_param.sched_priority; } #endif @@ -314,8 +314,6 @@ void sigwait_handle_sig(int sig) pthread_mutex_unlock(&LOCK_sigwait); } -extern pthread_t alarm_thread; - void *sigwait_thread(void *set_arg) { sigset_t *set=(sigset_t*) set_arg; @@ -334,7 +332,9 @@ void *sigwait_thread(void *set_arg) sigaction(i, &sact, (struct sigaction*) 0); } } - sigaddset(set,THR_CLIENT_ALARM); + /* Ensure that init_thr_alarm() is called */ + DBUG_ASSERT(thr_client_alarm); + sigaddset(set, thr_client_alarm); pthread_sigmask(SIG_UNBLOCK,(sigset_t*) set,(sigset_t*) 0); alarm_thread=pthread_self(); /* For thr_alarm */ diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 61e6e640027..464edb77f99 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -20,6 +20,7 @@ #include "mysys_priv.h" #include +#include #ifdef THREAD #ifdef USE_TLS @@ -63,6 +64,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) #endif +static uint get_thread_lib(void); + /* initialize thread environment @@ -76,6 +79,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) my_bool my_thread_global_init(void) { + thd_lib_detected= get_thread_lib(); + if (pthread_key_create(&THR_KEY_mysys,0)) { fprintf(stderr,"Can't initialize threads: error %d\n",errno); @@ -395,4 +400,20 @@ const char *my_thread_name(void) } #endif /* DBUG_OFF */ + +static uint get_thread_lib(void) +{ + char buff[64]; + +#ifdef _CS_GNU_LIBPTHREAD_VERSION + confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff)); + + if (!strncasecmp(buff, "NPTL", 4)) + return THD_LIB_NPTL; + if (!strncasecmp(buff, "linuxthreads", 12)) + return THD_LIB_LT; +#endif + return THD_LIB_OTHER; +} + #endif /* THREAD */ diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 3fd70790281..57670c9ac14 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -34,6 +34,7 @@ #define ETIME ETIMEDOUT #endif +uint thr_client_alarm; static int alarm_aborted=1; /* No alarm thread */ my_bool thr_alarm_inited= 0; volatile my_bool alarm_thread_running= 0; @@ -56,9 +57,7 @@ static void *alarm_handler(void *arg); #define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM) #endif -#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) static sig_handler thread_alarm(int sig __attribute__((unused))); -#endif static int compare_ulong(void *not_used __attribute__((unused)), byte *a_ptr,byte* b_ptr) @@ -77,9 +76,13 @@ void init_thr_alarm(uint max_alarms) sigfillset(&full_signal_set); /* Neaded to block signals */ pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_alarm,NULL); -#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) - my_sigset(THR_CLIENT_ALARM,thread_alarm); + thr_client_alarm= thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1; +#ifndef USE_ALARM_THREAD + if (thd_lib_detected != THD_LIB_LT) #endif + { + my_sigset(thr_client_alarm, thread_alarm); + } sigemptyset(&s); sigaddset(&s, THR_SERVER_ALARM); alarm_thread=pthread_self(); @@ -97,10 +100,11 @@ void init_thr_alarm(uint max_alarms) } #elif defined(USE_ONE_SIGNAL_HAND) pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ -#if THR_SERVER_ALARM == THR_CLIENT_ALARM - my_sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */ - pthread_sigmask(SIG_UNBLOCK, &s, NULL); -#endif + if (thd_lib_detected == THD_LIB_LT) + { + my_sigset(thr_client_alarm, process_alarm); /* Linuxthreads */ + pthread_sigmask(SIG_UNBLOCK, &s, NULL); + } #else my_sigset(THR_SERVER_ALARM, process_alarm); pthread_sigmask(SIG_UNBLOCK, &s, NULL); @@ -152,7 +156,7 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data) now=(ulong) time((time_t*) 0); pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask); - pthread_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */ + pthread_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */ if (alarm_aborted > 0) { /* No signal thread */ DBUG_PRINT("info", ("alarm aborted")); @@ -273,18 +277,17 @@ sig_handler process_alarm(int sig __attribute__((unused))) This must be first as we can't call DBUG inside an alarm for a normal thread */ -#if THR_SERVER_ALARM == THR_CLIENT_ALARM - if (!pthread_equal(pthread_self(),alarm_thread)) + if (thd_lib_detected == THD_LIB_LT && + !pthread_equal(pthread_self(),alarm_thread)) { #if defined(MAIN) && !defined(__bsdi__) printf("thread_alarm in process_alarm\n"); fflush(stdout); #endif #ifdef DONT_REMEMBER_SIGNAL - my_sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */ + my_sigset(thr_client_alarm, process_alarm); /* int. thread system calls */ #endif return; } -#endif /* We have to do do the handling of the alarm in a sub function, @@ -328,7 +331,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) alarm_data=(ALARM*) queue_element(&alarm_queue,i); alarm_data->alarmed=1; /* Info to thread */ if (pthread_equal(alarm_data->thread,alarm_thread) || - pthread_kill(alarm_data->thread, THR_CLIENT_ALARM)) + pthread_kill(alarm_data->thread, thr_client_alarm)) { #ifdef MAIN printf("Warning: pthread_kill couldn't find thread!!!\n"); @@ -352,7 +355,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) alarm_data->alarmed=1; /* Info to thread */ DBUG_PRINT("info",("sending signal to waiting thread")); if (pthread_equal(alarm_data->thread,alarm_thread) || - pthread_kill(alarm_data->thread, THR_CLIENT_ALARM)) + pthread_kill(alarm_data->thread, thr_client_alarm)) { #ifdef MAIN printf("Warning: pthread_kill couldn't find thread!!!\n"); @@ -488,7 +491,7 @@ void thr_alarm_info(ALARM_INFO *info) ARGSUSED */ -#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) + static sig_handler thread_alarm(int sig) { #ifdef MAIN @@ -498,7 +501,6 @@ static sig_handler thread_alarm(int sig) my_sigset(sig,thread_alarm); /* int. thread system calls */ #endif } -#endif #ifdef HAVE_TIMESPEC_TS_SEC @@ -784,9 +786,7 @@ static void *signal_hand(void *arg __attribute__((unused))) sigaddset(&set,SIGINT); sigaddset(&set,SIGQUIT); sigaddset(&set,SIGTERM); -#if THR_CLIENT_ALARM != SIGHUP sigaddset(&set,SIGHUP); -#endif #ifdef SIGTSTP sigaddset(&set,SIGTSTP); #endif @@ -797,7 +797,7 @@ static void *signal_hand(void *arg __attribute__((unused))) puts("Starting signal handling thread"); #endif printf("server alarm: %d thread alarm: %d\n", - THR_SERVER_ALARM,THR_CLIENT_ALARM); + THR_SERVER_ALARM, thr_client_alarm); DBUG_PRINT("info",("Starting signal and alarm handling thread")); for(;;) { @@ -865,11 +865,11 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) sigaddset(&set,SIGTSTP); #endif sigaddset(&set,THR_SERVER_ALARM); - sigdelset(&set,THR_CLIENT_ALARM); + sigdelset(&set, thr_client_alarm); (void) pthread_sigmask(SIG_SETMASK,&set,NULL); #ifdef NOT_USED sigemptyset(&set); - sigaddset(&set,THR_CLIENT_ALARM); + sigaddset(&set, thr_client_alarm); VOID(pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0)); #endif diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a0687929de5..c5933484675 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -195,12 +195,6 @@ inline void reset_floating_point_exceptions() } /* cplusplus */ - -#if defined(HAVE_LINUXTHREADS) -#define THR_KILL_SIGNAL SIGINT -#else -#define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads -#endif #define MYSQL_KILL_SIGNAL SIGTERM #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R @@ -605,6 +599,7 @@ pthread_mutex_t LOCK_server_started; pthread_cond_t COND_server_started; int mysqld_server_started= 0; +static uint thr_kill_signal; File_parser_dummy_hook file_parser_dummy_hook; @@ -788,7 +783,7 @@ static void close_connections(void) DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM - if (pthread_kill(select_thread,THR_CLIENT_ALARM)) + if (pthread_kill(select_thread, thr_client_alarm)) break; // allready dead #endif set_timespec(abstime, 2); @@ -2294,7 +2289,9 @@ static void init_signals(void) DBUG_ENTER("init_signals"); if (test_flags & TEST_SIGINT) - my_sigset(THR_KILL_SIGNAL,end_thread_signal); + { + my_sigset(thr_kill_signal, end_thread_signal); + } my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) @@ -2351,8 +2348,12 @@ static void init_signals(void) #endif sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) - sigdelset(&set,THR_KILL_SIGNAL); // May be SIGINT - sigdelset(&set,THR_CLIENT_ALARM); // For alarms + { + // May be SIGINT + sigdelset(&set, thr_kill_signal); + } + // For alarms + sigdelset(&set, thr_client_alarm); sigprocmask(SIG_SETMASK,&set,NULL); pthread_sigmask(SIG_SETMASK,&set,NULL); DBUG_VOID_RETURN; @@ -2415,23 +2416,19 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) */ init_thr_alarm(thread_scheduler.max_threads + global_system_variables.max_insert_delayed_threads + 10); -#if SIGINT != THR_KILL_SIGNAL - if (test_flags & TEST_SIGINT) + if (thd_lib_detected != THD_LIB_LT && (test_flags & TEST_SIGINT)) { (void) sigemptyset(&set); // Setup up SIGINT for debug (void) sigaddset(&set,SIGINT); // For debugging (void) pthread_sigmask(SIG_UNBLOCK,&set,NULL); } -#endif (void) sigemptyset(&set); // Setup up SIGINT for debug #ifdef USE_ONE_SIGNAL_HAND (void) sigaddset(&set,THR_SERVER_ALARM); // For alarms #endif #ifndef IGNORE_SIGHUP_SIGQUIT (void) sigaddset(&set,SIGQUIT); -#if THR_CLIENT_ALARM != SIGHUP (void) sigaddset(&set,SIGHUP); -#endif #endif (void) sigaddset(&set,SIGTERM); (void) sigaddset(&set,SIGTSTP); @@ -3626,6 +3623,13 @@ int main(int argc, char **argv) MY_INIT(argv[0]); // init my_sys library & pthreads /* nothing should come before this line ^^^ */ + /* Set signal used to kill MySQL */ +#if defined(SIGUSR2) + thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2; +#else + thr_kill_signal= SIGINT; +#endif + /* Perform basic logger initialization logger. Should be called after MY_INIT, as it initializes mutexes. Log tables are inited later. diff --git a/sql/stacktrace.c b/sql/stacktrace.c index d8e9b7fd883..0dbf4522a71 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -55,19 +55,6 @@ void safe_print_str(const char* name, const char* val, int max_len) static my_bool is_nptl; -/* Check if we are using NPTL or LinuxThreads on Linux */ -void check_thread_lib(void) -{ - char buf[5]; - -#ifdef _CS_GNU_LIBPTHREAD_VERSION - confstr(_CS_GNU_LIBPTHREAD_VERSION, buf, sizeof(buf)); - is_nptl = !strncasecmp(buf, "NPTL", sizeof(buf)); -#else - is_nptl = 0; -#endif -} - #if defined(__alpha__) && defined(__GNUC__) /* The only way to backtrace without a symbol table on alpha @@ -173,8 +160,8 @@ terribly wrong...\n"); #endif /* __alpha__ */ /* We are 1 frame above signal frame with NPTL and 2 frames above with LT */ - sigreturn_frame_count = is_nptl ? 1 : 2; - + sigreturn_frame_count = thd_lib_detected == THD_LIB_LT ? 2 : 1; + while (fp < (uchar**) stack_bottom) { #if defined(__i386__) || defined(__x86_64__) diff --git a/sql/stacktrace.h b/sql/stacktrace.h index f5c92e54e1c..56b9877180a 100644 --- a/sql/stacktrace.h +++ b/sql/stacktrace.h @@ -27,11 +27,9 @@ extern char* heap_start; #define init_stacktrace() do { \ heap_start = (char*) &__bss_start; \ - check_thread_lib(); \ } while(0); void print_stacktrace(gptr stack_bottom, ulong thread_stack); void safe_print_str(const char* name, const char* val, int max_len); -void check_thread_lib(void); #endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */ #endif /* TARGET_OS_LINUX */ From ff7db598a270ba3342ec0f2fc290e43003699241 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 15:34:52 +0200 Subject: [PATCH 425/789] Set yaSSL to use same type as MySQL do for socket handles extra/yassl/include/openssl/ssl.h: Import patch yassl.diff extra/yassl/src/ssl.cpp: Import patch yassl.diff --- extra/yassl/include/openssl/ssl.h | 10 ++++++++-- extra/yassl/src/ssl.cpp | 2 +- include/violite.h | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 29add5ca37d..7dd33e3fcad 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -190,11 +190,17 @@ enum { /* ERR Constants */ EVP_R_BAD_DECRYPT = 2 }; - +/* + Allow type used by SSL_set_fd to be changed, default to int + in order to be compatible with OpenSSL + */ +#ifndef YASSL_SOCKET_T_DEFINED +typedef int YASSL_SOCKET_T; +#endif SSL_CTX* SSL_CTX_new(SSL_METHOD*); SSL* SSL_new(SSL_CTX*); -int SSL_set_fd (SSL*, int); +int SSL_set_fd (SSL*, YASSL_SOCKET_T); int SSL_connect(SSL*); int SSL_write(SSL*, const void*, int); int SSL_read(SSL*, void*, int); diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 5bbde13a652..5ccc45ded2a 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -229,7 +229,7 @@ void SSL_free(SSL* ssl) } -int SSL_set_fd(SSL* ssl, int fd) +int SSL_set_fd(SSL* ssl, YASSL_SOCKET_T fd) { ssl->useSocket().set_fd(fd); return SSL_SUCCESS; diff --git a/include/violite.h b/include/violite.h index 4122e581a0f..63388c170c9 100644 --- a/include/violite.h +++ b/include/violite.h @@ -102,6 +102,9 @@ void vio_timeout(Vio *vio,uint which, uint timeout); #define HEADER_DES_LOCL_H dummy_something #define YASSL_MYSQL_COMPATIBLE #define YASSL_PREFIX +/* Set yaSSL to use same type as MySQL do for socket handles */ +typedef my_socket YASSL_SOCKET_T; +#define YASSL_SOCKET_T_DEFINED #include #include From 1778d177be6363c88c58cb8eafaa0f530a97d593 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 15:56:57 +0200 Subject: [PATCH 426/789] Add back the look for exe_mysql --- mysql-test/mysql-test-run.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b97c3917285..9187e3d23ec 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1519,6 +1519,7 @@ sub executable_setup () { $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow"); $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog"); $exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin"); + $exe_mysql= mtr_exe_exists("$path_client_bindir/mysql"); if (!$opt_extern) { From b5cc4fa61d615800ab13d428fae0296dbef82b81 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 18:57:30 +0500 Subject: [PATCH 427/789] Bug#22638 SOUNDEX broken for international characters Problem: SOUNDEX returned an invalid string for international characters in multi-byte character sets. For example: for a Chinese/Japanese 3-byte long character _utf8 0xE99885 it took only the very first byte 0xE9, put it into the outout string and then appended with three DIGIT ZERO characters, so the result was 0xE9303030 - which is an invalide utf8 string. Fix: make SOUNDEX() multi-byte aware and - put only complete characters into result, thus return only valid strings. This patch also makes SOUNDEX() compatible with UCS2. mysql-test/r/ctype_ucs.result: Adding tests mysql-test/r/ctype_utf8.result: Adding tests mysql-test/t/ctype_ucs.test: Adding tests mysql-test/t/ctype_utf8.test: Adding tests sql/item_strfunc.cc: Making soundex multi-byte aware. --- mysql-test/r/ctype_ucs.result | 18 +++++ mysql-test/r/ctype_utf8.result | 12 +++ mysql-test/t/ctype_ucs.test | 14 ++++ mysql-test/t/ctype_utf8.test | 8 ++ sql/item_strfunc.cc | 133 ++++++++++++++++++++++++++------- 5 files changed, 157 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index e32c1e8aae0..960953b3c5e 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -839,6 +839,24 @@ lily river drop table t1; deallocate prepare stmt; +set names latin1; +set character_set_connection=ucs2; +select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); +soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb') + H000 H4142 I51231 +select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb')); +hex(soundex('')) hex(soundex('he')) hex(soundex('hello all folks')) hex(soundex('#3556 in bugdb')) + 0048003000300030 00480034003100340032 004900350031003200330031 +select 'mood' sounds like 'mud'; +'mood' sounds like 'mud' +1 +select hex(soundex(_ucs2 0x041004110412)); +hex(soundex(_ucs2 0x041004110412)) +0410003000300030 +select hex(soundex(_ucs2 0x00BF00C0)); +hex(soundex(_ucs2 0x00BF00C0)) +00C0003000300030 +set names latin1; create table t1(a blob, b text charset utf8, c text charset ucs2); select data_type, character_octet_length, character_maximum_length from information_schema.columns where table_name='t1'; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index be1e1742ba6..1c6bc0e05b6 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -854,6 +854,18 @@ select * from t1 where soundex(a) = soundex('test'); id a 1 Test drop table t1; +select soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB); +soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB) +阅000 +select hex(soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)); +hex(soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)) +E99885303030 +select soundex(_utf8 0xD091D092D093); +soundex(_utf8 0xD091D092D093) +Б000 +select hex(soundex(_utf8 0xD091D092D093)); +hex(soundex(_utf8 0xD091D092D093)) +D091303030 SET collation_connection='utf8_general_ci'; create table t1 select repeat('a',4000) a; delete from t1; diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 5a3720dc431..c3320159c41 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -572,6 +572,20 @@ select utext from t1 where utext like '%%'; drop table t1; deallocate prepare stmt; +# +# Bug#22638 SOUNDEX broken for international characters +# +set names latin1; +set character_set_connection=ucs2; +select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); +select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb')); +select 'mood' sounds like 'mud'; +# Cyrillic A, BE, VE +select hex(soundex(_ucs2 0x041004110412)); +# Make sure that "U+00BF INVERTED QUESTION MARK" is not considered as letter +select hex(soundex(_ucs2 0x00BF00C0)); +set names latin1; + # # Bug #14290: character_maximum_length for text fields # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 04b7ec78842..79b73fc7880 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -702,6 +702,14 @@ select * from t1 where soundex(a) = soundex('TEST'); select * from t1 where soundex(a) = soundex('test'); drop table t1; +# +# Bug#22638 SOUNDEX broken for international characters +# +select soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB); +select hex(soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)); +select soundex(_utf8 0xD091D092D093); +select hex(soundex(_utf8 0xD091D092D093)); + SET collation_connection='utf8_general_ci'; -- source include/ctype_filesort.inc diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 6b1921e5bc8..03887629519 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1805,7 +1805,8 @@ void Item_func_soundex::fix_length_and_dec() { collation.set(args[0]->collation); max_length=args[0]->max_length; - set_if_bigger(max_length,4); + set_if_bigger(max_length, 4 * collation.collation->mbminlen); + tmp_value.set_charset(collation.collation); } @@ -1815,14 +1816,15 @@ void Item_func_soundex::fix_length_and_dec() else return 0 */ -static char soundex_toupper(char ch) +static int soundex_toupper(int ch) { return (ch >= 'a' && ch <= 'z') ? ch - 'a' + 'A' : ch; } -static char get_scode(char *ptr) + +static char get_scode(int wc) { - uchar ch= soundex_toupper(*ptr); + int ch= soundex_toupper(wc); if (ch < 'A' || ch > 'Z') { // Thread extended alfa (country spec) @@ -1832,46 +1834,121 @@ static char get_scode(char *ptr) } +static bool my_uni_isalpha(int wc) +{ + /* + Return true for all Basic Latin letters: a..z A..Z. + Return true for all Unicode characters with code higher than U+00C0: + - characters between 'z' and U+00C0 are controls and punctuations. + - "U+00C0 LATIN CAPITAL LETTER A WITH GRAVE" is the first letter after 'z'. + */ + return (wc >= 'a' && wc <= 'z') || + (wc >= 'A' && wc <= 'Z') || + (wc >= 0xC0); +} + + String *Item_func_soundex::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *res =args[0]->val_str(str); char last_ch,ch; CHARSET_INFO *cs= collation.collation; + my_wc_t wc; + uint nchars; + int rc; - if ((null_value=args[0]->null_value)) + if ((null_value= args[0]->null_value)) return 0; /* purecov: inspected */ - if (tmp_value.alloc(max(res->length(),4))) + if (tmp_value.alloc(max(res->length(), 4 * cs->mbminlen))) return str; /* purecov: inspected */ char *to= (char *) tmp_value.ptr(); - char *from= (char *) res->ptr(), *end=from+res->length(); - tmp_value.set_charset(cs); + char *to_end= to + tmp_value.alloced_length(); + char *from= (char *) res->ptr(), *end= from + res->length(); - while (from != end && !my_isalpha(cs,*from)) // Skip pre-space - from++; /* purecov: inspected */ - if (from == end) - return &my_empty_string; // No alpha characters. - *to++ = soundex_toupper(*from); // Copy first letter - last_ch = get_scode(from); // code of the first letter - // for the first 'double-letter check. - // Loop on input letters until - // end of input (null) or output - // letter code count = 3 - for (from++ ; from < end ; from++) + for ( ; ; ) /* Skip pre-space */ { - if (!my_isalpha(cs,*from)) - continue; - ch=get_scode(from); + if ((rc= cs->cset->mb_wc(cs, &wc, (uchar*) from, (uchar*) end)) <= 0) + return &my_empty_string; /* EOL or invalid byte sequence */ + + if (rc == 1 && cs->ctype) + { + /* Single byte letter found */ + if (my_isalpha(cs, *from)) + { + last_ch= get_scode(*from); // Code of the first letter + *to++= soundex_toupper(*from++); // Copy first letter + break; + } + from++; + } + else + { + from+= rc; + if (my_uni_isalpha(wc)) + { + /* Multibyte letter found */ + wc= soundex_toupper(wc); + last_ch= get_scode(wc); // Code of the first letter + if ((rc= cs->cset->wc_mb(cs, wc, (uchar*) to, (uchar*) to_end)) <= 0) + { + /* Extra safety - should not really happen */ + DBUG_ASSERT(false); + return &my_empty_string; + } + to+= rc; + break; + } + } + } + + /* + last_ch is now set to the first 'double-letter' check. + loop on input letters until end of input + */ + for (nchars= 1 ; ; ) + { + if ((rc= cs->cset->mb_wc(cs, &wc, (uchar*) from, (uchar*) end)) <= 0) + break; /* EOL or invalid byte sequence */ + + if (rc == 1 && cs->ctype) + { + if (!my_isalpha(cs, *from++)) + continue; + } + else + { + from+= rc; + if (!my_uni_isalpha(wc)) + continue; + } + + ch= get_scode(wc); if ((ch != '0') && (ch != last_ch)) // if not skipped or double { - *to++ = ch; // letter, copy to output - last_ch = ch; // save code of last input letter - } // for next double-letter check + // letter, copy to output + if ((rc= cs->cset->wc_mb(cs, (my_wc_t) ch, + (uchar*) to, (uchar*) to_end)) <= 0) + { + // Extra safety - should not really happen + DBUG_ASSERT(false); + break; + } + to+= rc; + nchars++; + last_ch= ch; // save code of last input letter + } // for next double-letter check } - for (end=(char*) tmp_value.ptr()+4 ; to < end ; to++) - *to = '0'; - *to=0; // end string + + /* Pad up to 4 characters with DIGIT ZERO, if the string is shorter */ + if (nchars < 4) + { + uint nbytes= (4 - nchars) * cs->mbminlen; + cs->cset->fill(cs, to, nbytes, '0'); + to+= nbytes; + } + tmp_value.length((uint) (to-tmp_value.ptr())); return &tmp_value; } From 8f93150d20e9af978c43deb4f90cc21457bd29db Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 16:23:44 +0200 Subject: [PATCH 428/789] restored run-time thread lib detection sql/stacktrace.c: removed code duplication sql/stacktrace.h: removed code duplication --- include/my_pthread.h | 9 +++++++++ include/thr_alarm.h | 8 +++----- mysys/my_pthread.c | 10 +++++----- mysys/my_thr_init.c | 21 +++++++++++++++++++++ mysys/thr_alarm.c | 44 ++++++++++++++++++++++---------------------- sql/mysqld.cc | 34 +++++++++++++++++++--------------- sql/stacktrace.c | 17 ++--------------- sql/stacktrace.h | 2 -- 8 files changed, 81 insertions(+), 64 deletions(-) diff --git a/include/my_pthread.h b/include/my_pthread.h index 4df105e1b20..340dc32981a 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -701,6 +701,15 @@ extern uint my_thread_end_wait_time; Keep track of shutdown,signal, and main threads so that my_end() will not report errors with them */ + +/* Which kind of thread library is in use */ + +#define THD_LIB_OTHER 1 +#define THD_LIB_NPTL 2 +#define THD_LIB_LT 4 + +extern uint thd_lib_detected; + /* statistics_xxx functions are for not essential statistic */ #ifndef thread_safe_increment diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 14dd538c9e4..a2694ba105b 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -24,11 +24,6 @@ extern "C" { #ifndef USE_ALARM_THREAD #define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ #endif -#ifdef HAVE_LINUXTHREADS -#define THR_CLIENT_ALARM SIGALRM -#else -#define THR_CLIENT_ALARM SIGUSR1 -#endif #ifdef HAVE_rts_threads #undef USE_ONE_SIGNAL_HAND #define USE_ALARM_THREAD @@ -90,6 +85,9 @@ typedef struct st_alarm { my_bool malloced; } ALARM; +extern uint thr_client_alarm; +extern pthread_t alarm_thread; + #define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)!= 0) void init_thr_alarm(uint max_alarm); diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 74ba98c321a..db01602f4ab 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -31,6 +31,8 @@ uint thd_lib_detected= 0; +uint thd_lib_detected; + #ifndef my_pthread_setprio void my_pthread_setprio(pthread_t thread_id,int prior) { @@ -51,8 +53,6 @@ int my_pthread_getprio(pthread_t thread_id) int policy; if (!pthread_getschedparam(thread_id,&policy,&tmp_sched_param)) { - DBUG_PRINT("thread",("policy: %d priority: %d", - policy,tmp_sched_param.sched_priority)); return tmp_sched_param.sched_priority; } #endif @@ -314,8 +314,6 @@ void sigwait_handle_sig(int sig) pthread_mutex_unlock(&LOCK_sigwait); } -extern pthread_t alarm_thread; - void *sigwait_thread(void *set_arg) { sigset_t *set=(sigset_t*) set_arg; @@ -334,7 +332,9 @@ void *sigwait_thread(void *set_arg) sigaction(i, &sact, (struct sigaction*) 0); } } - sigaddset(set,THR_CLIENT_ALARM); + /* Ensure that init_thr_alarm() is called */ + DBUG_ASSERT(thr_client_alarm); + sigaddset(set, thr_client_alarm); pthread_sigmask(SIG_UNBLOCK,(sigset_t*) set,(sigset_t*) 0); alarm_thread=pthread_self(); /* For thr_alarm */ diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 61e6e640027..464edb77f99 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -20,6 +20,7 @@ #include "mysys_priv.h" #include +#include #ifdef THREAD #ifdef USE_TLS @@ -63,6 +64,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) #endif +static uint get_thread_lib(void); + /* initialize thread environment @@ -76,6 +79,8 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) my_bool my_thread_global_init(void) { + thd_lib_detected= get_thread_lib(); + if (pthread_key_create(&THR_KEY_mysys,0)) { fprintf(stderr,"Can't initialize threads: error %d\n",errno); @@ -395,4 +400,20 @@ const char *my_thread_name(void) } #endif /* DBUG_OFF */ + +static uint get_thread_lib(void) +{ + char buff[64]; + +#ifdef _CS_GNU_LIBPTHREAD_VERSION + confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff)); + + if (!strncasecmp(buff, "NPTL", 4)) + return THD_LIB_NPTL; + if (!strncasecmp(buff, "linuxthreads", 12)) + return THD_LIB_LT; +#endif + return THD_LIB_OTHER; +} + #endif /* THREAD */ diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 3fd70790281..57670c9ac14 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -34,6 +34,7 @@ #define ETIME ETIMEDOUT #endif +uint thr_client_alarm; static int alarm_aborted=1; /* No alarm thread */ my_bool thr_alarm_inited= 0; volatile my_bool alarm_thread_running= 0; @@ -56,9 +57,7 @@ static void *alarm_handler(void *arg); #define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM) #endif -#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) static sig_handler thread_alarm(int sig __attribute__((unused))); -#endif static int compare_ulong(void *not_used __attribute__((unused)), byte *a_ptr,byte* b_ptr) @@ -77,9 +76,13 @@ void init_thr_alarm(uint max_alarms) sigfillset(&full_signal_set); /* Neaded to block signals */ pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_alarm,NULL); -#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) - my_sigset(THR_CLIENT_ALARM,thread_alarm); + thr_client_alarm= thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1; +#ifndef USE_ALARM_THREAD + if (thd_lib_detected != THD_LIB_LT) #endif + { + my_sigset(thr_client_alarm, thread_alarm); + } sigemptyset(&s); sigaddset(&s, THR_SERVER_ALARM); alarm_thread=pthread_self(); @@ -97,10 +100,11 @@ void init_thr_alarm(uint max_alarms) } #elif defined(USE_ONE_SIGNAL_HAND) pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ -#if THR_SERVER_ALARM == THR_CLIENT_ALARM - my_sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */ - pthread_sigmask(SIG_UNBLOCK, &s, NULL); -#endif + if (thd_lib_detected == THD_LIB_LT) + { + my_sigset(thr_client_alarm, process_alarm); /* Linuxthreads */ + pthread_sigmask(SIG_UNBLOCK, &s, NULL); + } #else my_sigset(THR_SERVER_ALARM, process_alarm); pthread_sigmask(SIG_UNBLOCK, &s, NULL); @@ -152,7 +156,7 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data) now=(ulong) time((time_t*) 0); pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask); - pthread_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */ + pthread_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */ if (alarm_aborted > 0) { /* No signal thread */ DBUG_PRINT("info", ("alarm aborted")); @@ -273,18 +277,17 @@ sig_handler process_alarm(int sig __attribute__((unused))) This must be first as we can't call DBUG inside an alarm for a normal thread */ -#if THR_SERVER_ALARM == THR_CLIENT_ALARM - if (!pthread_equal(pthread_self(),alarm_thread)) + if (thd_lib_detected == THD_LIB_LT && + !pthread_equal(pthread_self(),alarm_thread)) { #if defined(MAIN) && !defined(__bsdi__) printf("thread_alarm in process_alarm\n"); fflush(stdout); #endif #ifdef DONT_REMEMBER_SIGNAL - my_sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */ + my_sigset(thr_client_alarm, process_alarm); /* int. thread system calls */ #endif return; } -#endif /* We have to do do the handling of the alarm in a sub function, @@ -328,7 +331,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) alarm_data=(ALARM*) queue_element(&alarm_queue,i); alarm_data->alarmed=1; /* Info to thread */ if (pthread_equal(alarm_data->thread,alarm_thread) || - pthread_kill(alarm_data->thread, THR_CLIENT_ALARM)) + pthread_kill(alarm_data->thread, thr_client_alarm)) { #ifdef MAIN printf("Warning: pthread_kill couldn't find thread!!!\n"); @@ -352,7 +355,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused))) alarm_data->alarmed=1; /* Info to thread */ DBUG_PRINT("info",("sending signal to waiting thread")); if (pthread_equal(alarm_data->thread,alarm_thread) || - pthread_kill(alarm_data->thread, THR_CLIENT_ALARM)) + pthread_kill(alarm_data->thread, thr_client_alarm)) { #ifdef MAIN printf("Warning: pthread_kill couldn't find thread!!!\n"); @@ -488,7 +491,7 @@ void thr_alarm_info(ALARM_INFO *info) ARGSUSED */ -#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) + static sig_handler thread_alarm(int sig) { #ifdef MAIN @@ -498,7 +501,6 @@ static sig_handler thread_alarm(int sig) my_sigset(sig,thread_alarm); /* int. thread system calls */ #endif } -#endif #ifdef HAVE_TIMESPEC_TS_SEC @@ -784,9 +786,7 @@ static void *signal_hand(void *arg __attribute__((unused))) sigaddset(&set,SIGINT); sigaddset(&set,SIGQUIT); sigaddset(&set,SIGTERM); -#if THR_CLIENT_ALARM != SIGHUP sigaddset(&set,SIGHUP); -#endif #ifdef SIGTSTP sigaddset(&set,SIGTSTP); #endif @@ -797,7 +797,7 @@ static void *signal_hand(void *arg __attribute__((unused))) puts("Starting signal handling thread"); #endif printf("server alarm: %d thread alarm: %d\n", - THR_SERVER_ALARM,THR_CLIENT_ALARM); + THR_SERVER_ALARM, thr_client_alarm); DBUG_PRINT("info",("Starting signal and alarm handling thread")); for(;;) { @@ -865,11 +865,11 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) sigaddset(&set,SIGTSTP); #endif sigaddset(&set,THR_SERVER_ALARM); - sigdelset(&set,THR_CLIENT_ALARM); + sigdelset(&set, thr_client_alarm); (void) pthread_sigmask(SIG_SETMASK,&set,NULL); #ifdef NOT_USED sigemptyset(&set); - sigaddset(&set,THR_CLIENT_ALARM); + sigaddset(&set, thr_client_alarm); VOID(pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0)); #endif diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a0687929de5..c5933484675 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -195,12 +195,6 @@ inline void reset_floating_point_exceptions() } /* cplusplus */ - -#if defined(HAVE_LINUXTHREADS) -#define THR_KILL_SIGNAL SIGINT -#else -#define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads -#endif #define MYSQL_KILL_SIGNAL SIGTERM #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R @@ -605,6 +599,7 @@ pthread_mutex_t LOCK_server_started; pthread_cond_t COND_server_started; int mysqld_server_started= 0; +static uint thr_kill_signal; File_parser_dummy_hook file_parser_dummy_hook; @@ -788,7 +783,7 @@ static void close_connections(void) DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM - if (pthread_kill(select_thread,THR_CLIENT_ALARM)) + if (pthread_kill(select_thread, thr_client_alarm)) break; // allready dead #endif set_timespec(abstime, 2); @@ -2294,7 +2289,9 @@ static void init_signals(void) DBUG_ENTER("init_signals"); if (test_flags & TEST_SIGINT) - my_sigset(THR_KILL_SIGNAL,end_thread_signal); + { + my_sigset(thr_kill_signal, end_thread_signal); + } my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) @@ -2351,8 +2348,12 @@ static void init_signals(void) #endif sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) - sigdelset(&set,THR_KILL_SIGNAL); // May be SIGINT - sigdelset(&set,THR_CLIENT_ALARM); // For alarms + { + // May be SIGINT + sigdelset(&set, thr_kill_signal); + } + // For alarms + sigdelset(&set, thr_client_alarm); sigprocmask(SIG_SETMASK,&set,NULL); pthread_sigmask(SIG_SETMASK,&set,NULL); DBUG_VOID_RETURN; @@ -2415,23 +2416,19 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) */ init_thr_alarm(thread_scheduler.max_threads + global_system_variables.max_insert_delayed_threads + 10); -#if SIGINT != THR_KILL_SIGNAL - if (test_flags & TEST_SIGINT) + if (thd_lib_detected != THD_LIB_LT && (test_flags & TEST_SIGINT)) { (void) sigemptyset(&set); // Setup up SIGINT for debug (void) sigaddset(&set,SIGINT); // For debugging (void) pthread_sigmask(SIG_UNBLOCK,&set,NULL); } -#endif (void) sigemptyset(&set); // Setup up SIGINT for debug #ifdef USE_ONE_SIGNAL_HAND (void) sigaddset(&set,THR_SERVER_ALARM); // For alarms #endif #ifndef IGNORE_SIGHUP_SIGQUIT (void) sigaddset(&set,SIGQUIT); -#if THR_CLIENT_ALARM != SIGHUP (void) sigaddset(&set,SIGHUP); -#endif #endif (void) sigaddset(&set,SIGTERM); (void) sigaddset(&set,SIGTSTP); @@ -3626,6 +3623,13 @@ int main(int argc, char **argv) MY_INIT(argv[0]); // init my_sys library & pthreads /* nothing should come before this line ^^^ */ + /* Set signal used to kill MySQL */ +#if defined(SIGUSR2) + thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2; +#else + thr_kill_signal= SIGINT; +#endif + /* Perform basic logger initialization logger. Should be called after MY_INIT, as it initializes mutexes. Log tables are inited later. diff --git a/sql/stacktrace.c b/sql/stacktrace.c index d8e9b7fd883..0dbf4522a71 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -55,19 +55,6 @@ void safe_print_str(const char* name, const char* val, int max_len) static my_bool is_nptl; -/* Check if we are using NPTL or LinuxThreads on Linux */ -void check_thread_lib(void) -{ - char buf[5]; - -#ifdef _CS_GNU_LIBPTHREAD_VERSION - confstr(_CS_GNU_LIBPTHREAD_VERSION, buf, sizeof(buf)); - is_nptl = !strncasecmp(buf, "NPTL", sizeof(buf)); -#else - is_nptl = 0; -#endif -} - #if defined(__alpha__) && defined(__GNUC__) /* The only way to backtrace without a symbol table on alpha @@ -173,8 +160,8 @@ terribly wrong...\n"); #endif /* __alpha__ */ /* We are 1 frame above signal frame with NPTL and 2 frames above with LT */ - sigreturn_frame_count = is_nptl ? 1 : 2; - + sigreturn_frame_count = thd_lib_detected == THD_LIB_LT ? 2 : 1; + while (fp < (uchar**) stack_bottom) { #if defined(__i386__) || defined(__x86_64__) diff --git a/sql/stacktrace.h b/sql/stacktrace.h index f5c92e54e1c..56b9877180a 100644 --- a/sql/stacktrace.h +++ b/sql/stacktrace.h @@ -27,11 +27,9 @@ extern char* heap_start; #define init_stacktrace() do { \ heap_start = (char*) &__bss_start; \ - check_thread_lib(); \ } while(0); void print_stacktrace(gptr stack_bottom, ulong thread_stack); void safe_print_str(const char* name, const char* val, int max_len); -void check_thread_lib(void); #endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */ #endif /* TARGET_OS_LINUX */ From 425304f5626a2b2a0fc2ada1e0f306a3465341b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 18:38:42 +0400 Subject: [PATCH 429/789] BUG#26625: crash in range optimizer (out of mem) - Define Sql_alloc::operator new() as thow() so that C++ compiler handles NULL return values (there is no testcase as there is no portable way to set limit on the amount of memory that a process can allocate) sql/sql_list.h: BUG#26625: crash in range optimizer (out of mem) - Define Sql_alloc::operator new() as thow() so that C++ compiler handles NULL return values --- sql/sql_list.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_list.h b/sql/sql_list.h index 47379ab1ddf..2075361a398 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -30,7 +30,7 @@ class Sql_alloc { public: - static void *operator new(size_t size) + static void *operator new(size_t size) throw () { return (void*) sql_alloc((uint) size); } @@ -38,7 +38,7 @@ public: { return (void*) sql_alloc((uint) size); } - static void *operator new(size_t size, MEM_ROOT *mem_root) + static void *operator new(size_t size, MEM_ROOT *mem_root) throw () { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } static void operator delete(void *ptr, MEM_ROOT *mem_root) From 60189d3512798b054220f65468cddce88f8c3166 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 19:05:30 +0400 Subject: [PATCH 430/789] Delete: sql/mysqld.cc.rej --- sql/mysqld.cc.rej | 161 ---------------------------------------------- 1 file changed, 161 deletions(-) delete mode 100644 sql/mysqld.cc.rej diff --git a/sql/mysqld.cc.rej b/sql/mysqld.cc.rej deleted file mode 100644 index bd7338143ae..00000000000 --- a/sql/mysqld.cc.rej +++ /dev/null @@ -1,161 +0,0 @@ -*************** -*** 177,188 **** - } /* cplusplus */ - - -- #if defined(HAVE_LINUXTHREADS) -- #define THR_KILL_SIGNAL SIGINT -- #else -- #define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads -- #endif -- - #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R - #include - #else ---- 177,182 ---- - } /* cplusplus */ - - - #ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R - #include - #else -*************** -*** 505,510 **** - static void clean_up_mutexes(void); - static int test_if_case_insensitive(const char *dir_name); - static void create_pid_file(); - - /**************************************************************************** - ** Code to end mysqld ---- 499,505 ---- - static void clean_up_mutexes(void); - static int test_if_case_insensitive(const char *dir_name); - static void create_pid_file(); -+ static uint get_thread_lib(void); - - /**************************************************************************** - ** Code to end mysqld -*************** -*** 544,550 **** - DBUG_PRINT("info",("Waiting for select_thread")); - - #ifndef DONT_USE_THR_ALARM -! if (pthread_kill(select_thread,THR_CLIENT_ALARM)) - break; // allready dead - #endif - set_timespec(abstime, 2); ---- 539,546 ---- - DBUG_PRINT("info",("Waiting for select_thread")); - - #ifndef DONT_USE_THR_ALARM -! if (pthread_kill(select_thread, -! thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1)) - break; // allready dead - #endif - set_timespec(abstime, 2); -*************** -*** 844,850 **** - sig,my_thread_id()); - } - #ifdef DONT_REMEMBER_SIGNAL -! sigset(sig,print_signal_warning); /* int. thread system calls */ - #endif - #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) - if (sig == SIGALRM) ---- 840,846 ---- - sig,my_thread_id()); - } - #ifdef DONT_REMEMBER_SIGNAL -! my_sigset(sig, print_signal_warning); /* int. thread system calls */ - #endif - #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) - if (sig == SIGALRM) -*************** -*** 1841,1848 **** - DBUG_ENTER("init_signals"); - - if (test_flags & TEST_SIGINT) -! sigset(THR_KILL_SIGNAL,end_thread_signal); -! sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! - - if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) - { ---- 1837,1847 ---- - DBUG_ENTER("init_signals"); - - if (test_flags & TEST_SIGINT) -! { -! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2, -! end_thread_signal); -! } -! my_sigset(THR_SERVER_ALARM, print_signal_warning); // Should never be called! - - if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) - { -*************** -*** 1877,1883 **** - #endif - (void) sigemptyset(&set); - #ifdef THREAD_SPECIFIC_SIGPIPE -! sigset(SIGPIPE,abort_thread); - sigaddset(&set,SIGPIPE); - #else - (void) signal(SIGPIPE,SIG_IGN); // Can't know which thread ---- 1876,1882 ---- - #endif - (void) sigemptyset(&set); - #ifdef THREAD_SPECIFIC_SIGPIPE -! my_sigset(SIGPIPE, abort_thread); - sigaddset(&set,SIGPIPE); - #else - (void) signal(SIGPIPE,SIG_IGN); // Can't know which thread -*************** -*** 2237,2244 **** - MY_INIT(argv[0]); // init my_sys library & pthreads - tzset(); // Set tzname - - start_time=time((time_t*) 0); -- - #ifdef OS2 - { - // fix timezone for daylight saving ---- 2236,2243 ---- - MY_INIT(argv[0]); // init my_sys library & pthreads - tzset(); // Set tzname - -+ thd_lib_detected= get_thread_lib(); - start_time=time((time_t*) 0); - #ifdef OS2 - { - // fix timezone for daylight saving -*************** -*** 5547,5552 **** - (void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME)); - (void) my_close(file, MYF(0)); - } - } - - ---- 5546,5567 ---- - (void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME)); - (void) my_close(file, MYF(0)); - } -+ } -+ -+ -+ static uint get_thread_lib(void) -+ { -+ char buff[64]; -+ -+ #ifdef _CS_GNU_LIBPTHREAD_VERSION -+ confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff)); -+ -+ if (!strncasecmp(buff, "NPTL", 4)) -+ return THD_LIB_NPTL; -+ else if (!strncasecmp(buff, "linuxthreads", 12)) -+ return THD_LIB_LT; -+ #endif -+ return THD_LIB_OTHER; - } - - From 2cdd8359ef3d4052e8bfa2effe660ff87ea00649 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 17:12:38 +0200 Subject: [PATCH 431/789] compiler warnings --- sql/mysqld.cc | 2 +- sql/stacktrace.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ce53cd22669..51feb197713 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -599,7 +599,6 @@ pthread_mutex_t LOCK_server_started; pthread_cond_t COND_server_started; int mysqld_server_started= 0; -static uint thr_kill_signal; File_parser_dummy_hook file_parser_dummy_hook; @@ -633,6 +632,7 @@ struct rand_struct sql_rand; // used by sql_class.cc:THD::THD() #ifndef EMBEDDED_LIBRARY struct passwd *user_info; static pthread_t select_thread; +static uint thr_kill_signal; #endif /* OS specific variables */ diff --git a/sql/stacktrace.c b/sql/stacktrace.c index 0dbf4522a71..078f62c6b2b 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -53,8 +53,6 @@ void safe_print_str(const char* name, const char* val, int max_len) #define SIGRETURN_FRAME_OFFSET 23 #endif -static my_bool is_nptl; - #if defined(__alpha__) && defined(__GNUC__) /* The only way to backtrace without a symbol table on alpha From e8a25c95d3f8daf292b133b98f47d80167e915e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 21:09:16 +0500 Subject: [PATCH 432/789] BUG#25521 - optimize table, delete, show table status leads to table losing it's .MYD When OPTIMIZE TABLE is completed it attempts to rename temporary file to original name. This step may fail on windows when a file is opened. As a result data file might be deleted and optimized copy of file (table_name.MYD) remains. This situation is handled properly by my_delete_allow_opened, so use it instead of my_delete when attempting to rename a file on windows. No suitable test case for this bug. mysys/my_redel.c: Attempting to delete an opened file and to immediately create a new one with the same name may result in my_redel failure on windows. It may fail because file is not deleted until it is closed. This situation is handled properly by my_delete_allow_opened, so use it instead of my_delete. --- mysys/my_redel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/my_redel.c b/mysys/my_redel.c index 1e3cfceb495..0aec395cf65 100644 --- a/mysys/my_redel.c +++ b/mysys/my_redel.c @@ -60,7 +60,7 @@ int my_redel(const char *org_name, const char *tmp_name, myf MyFlags) MyFlags)) goto end; } - else if (my_delete(org_name,MyFlags)) + else if (my_delete_allow_opened(org_name, MyFlags)) goto end; if (my_rename(tmp_name,org_name,MyFlags)) goto end; From 9639eb3dda5347ecc342de94da3cc0e025e5c058 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 20:16:01 +0400 Subject: [PATCH 433/789] BUG#26624: high mem usage (crash) in range optimizer - Added PARAM::alloced_sel_args where we count the # of SEL_ARGs created by SEL_ARG tree cloning operations. - Made the range analyzer to shortcut and not do any more cloning if we've already created MAX_SEL_ARGS SEL_ARG objects in cloning. - Added comments about space complexity of SEL_ARG-graph representation. mysql-test/r/range.result: BUG#26624: Testcase mysql-test/t/range.test: BUG#26624: Testcase --- mysql-test/r/range.result | 28 +++++++ mysql-test/t/range.test | 32 ++++++++ sql/opt_range.cc | 162 ++++++++++++++++++++++++++++++-------- 3 files changed, 191 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 4d6cafb61d1..15d5f1a0183 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -701,4 +701,32 @@ d8c4177d225791924.30714720 d8c4177d2380fc201.39666693 d8c4177d24ccef970.14957924 DROP TABLE t1; +create table t1 ( +c1 char(10), c2 char(10), c3 char(10), c4 char(10), +c5 char(10), c6 char(10), c7 char(10), c8 char(10), +c9 char(10), c10 char(10), c11 char(10), c12 char(10), +c13 char(10), c14 char(10), c15 char(10), c16 char(10), +index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16) +); +insert into t1 (c1) values ('1'),('1'),('1'),('1'); +select * from t1 where +c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c11 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c12 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c13 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c14 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c15 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +and c16 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 +drop table t1; End of 4.1 tests diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 68ba43a8ba9..1e4cb91c03f 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -563,4 +563,36 @@ SELECT s.oxid FROM t1 v, t1 s DROP TABLE t1; +# BUG#26624 high mem usage (crash) in range optimizer (depends on order of fields in where) +create table t1 ( + c1 char(10), c2 char(10), c3 char(10), c4 char(10), + c5 char(10), c6 char(10), c7 char(10), c8 char(10), + c9 char(10), c10 char(10), c11 char(10), c12 char(10), + c13 char(10), c14 char(10), c15 char(10), c16 char(10), + index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16) +); + +insert into t1 (c1) values ('1'),('1'),('1'),('1'); + +# This must run without crash and fast: +select * from t1 where + c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c11 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c12 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c13 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c14 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c15 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") + and c16 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") +; +drop table t1; + --echo End of 4.1 tests diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 06e42ff363f..11ba6c0e465 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -128,6 +128,89 @@ static char is_null_string[2]= {1,0}; - get_quick_select() - Walk the SEL_ARG, materialize the key intervals, and create QUICK_RANGE_SELECT object that will read records within these intervals. + + 4. SPACE COMPLEXITY NOTES + + SEL_ARG graph is a representation of an ordered disjoint sequence of + intervals over the ordered set of index tuple values. + + For multi-part keys, one can construct a WHERE expression such that its + list of intervals will be of combinatorial size. Here is an example: + + (keypart1 IN (1,2, ..., n1)) AND + (keypart2 IN (1,2, ..., n2)) AND + (keypart3 IN (1,2, ..., n3)) + + For this WHERE clause the list of intervals will have n1*n2*n3 intervals + of form + + (keypart1, keypart2, keypart3) = (k1, k2, k3), where 1 <= k{i} <= n{i} + + SEL_ARG graph structure aims to reduce the amount of required space by + "sharing" the elementary intervals when possible (the pic at the + beginning of this comment has examples of such sharing). The sharing may + prevent combinatorial blowup: + + There are WHERE clauses that have combinatorial-size interval lists but + will be represented by a compact SEL_ARG graph. + Example: + (keypartN IN (1,2, ..., n1)) AND + ... + (keypart2 IN (1,2, ..., n2)) AND + (keypart1 IN (1,2, ..., n3)) + + but not in all cases: + + - There are WHERE clauses that do have a compact SEL_ARG-graph + representation but get_mm_tree() and its callees will construct a + graph of combinatorial size. + Example: + (keypart1 IN (1,2, ..., n1)) AND + (keypart2 IN (1,2, ..., n2)) AND + ... + (keypartN IN (1,2, ..., n3)) + + - There are WHERE clauses for which the minimal possible SEL_ARG graph + representation will have combinatorial size. + Example: + By induction: Let's take any interval on some keypart in the middle: + + kp15=1 + + Then let's AND it with this interval 'structure' from preceding and + following keyparts: + + (kp14=c1 AND kp16=c3) OR keypart14=c2) (*) + + We will obtain this SEL_ARG graph: + + kp14 $ kp15 $ kp16 + $ $ + +---------+ $ +--------+ $ +---------+ + | kp14=c1 |--$-->| kp15=1 |--$-->| kp16=c3 | + +---------+ $ +--------+ $ +---------+ + | $ $ + +---------+ $ +--------+ $ + | kp14=c2 |--$-->| kp15=1 | $ + +---------+ $ +--------+ $ + $ $ + + Note that we had to duplicate "kp15=1" and there was no way to avoid + that. + The induction step: AND the obtained expression with another "wrapping" + expression like (*). + When the process ends because of the limit on max. number of keyparts + we'll have: + + WHERE clause length is O(3*#max_keyparts) + SEL_ARG graph size is O(2^(#max_keyparts/2)) + + (it is also possible to construct a case where instead of 2 in 2^n we + have a bigger constant, e.g. 4, and get a graph with 4^(31/2)= 2^31 + nodes) + + We avoid consuming too much memory by setting a limit on the number of + SEL_ARG object we can construct during one range analysis invocation. */ class SEL_ARG :public Sql_alloc @@ -158,6 +241,8 @@ public: enum leaf_color { BLACK,RED } color; enum Type { IMPOSSIBLE, MAYBE, MAYBE_KEY, KEY_RANGE } type; + enum { MAX_SEL_ARGS = 64000 }; + SEL_ARG() {} SEL_ARG(SEL_ARG &); SEL_ARG(Field *,const char *,const char *); @@ -227,7 +312,8 @@ public: return new SEL_ARG(field, part, min_value, arg->max_value, min_flag, arg->max_flag, maybe_flag | arg->maybe_flag); } - SEL_ARG *clone(SEL_ARG *new_parent,SEL_ARG **next); + SEL_ARG *clone(struct st_qsel_param *param, SEL_ARG *new_parent, + SEL_ARG **next); bool copy_min(SEL_ARG* arg) { // Get overlapping range @@ -365,7 +451,7 @@ public: { return parent->left == this ? &parent->left : &parent->right; } - SEL_ARG *clone_tree(); + SEL_ARG *clone_tree(struct st_qsel_param *param); }; @@ -391,6 +477,8 @@ typedef struct st_qsel_param { max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH]; bool quick; // Don't calulate possible keys COND *cond; + /* Numbr of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */ + uint alloced_sel_args; } PARAM; static SEL_TREE * get_mm_parts(PARAM *param,COND *cond_func,Field *field, @@ -413,8 +501,8 @@ static void print_quick(QUICK_SELECT *quick,const key_map* needed_reg); static SEL_TREE *tree_and(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2); static SEL_TREE *tree_or(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2); static SEL_ARG *sel_add(SEL_ARG *key1,SEL_ARG *key2); -static SEL_ARG *key_or(SEL_ARG *key1,SEL_ARG *key2); -static SEL_ARG *key_and(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag); +static SEL_ARG *key_or(PARAM *param, SEL_ARG *key1,SEL_ARG *key2); +static SEL_ARG *key_and(PARAM *param, SEL_ARG *key1,SEL_ARG *key2,uint clone_flag); static bool get_range(SEL_ARG **e1,SEL_ARG **e2,SEL_ARG *root1); static bool get_quick_keys(PARAM *param,QUICK_SELECT *quick,KEY_PART *key, SEL_ARG *key_tree,char *min_key,uint min_key_flag, @@ -424,6 +512,7 @@ static bool eq_tree(SEL_ARG* a,SEL_ARG *b); static SEL_ARG null_element(SEL_ARG::IMPOSSIBLE); static bool null_part_in_key(KEY_PART *key_part, const char *key, uint length); + /*************************************************************************** ** Basic functions for SQL_SELECT and QUICK_SELECT ***************************************************************************/ @@ -568,12 +657,17 @@ SEL_ARG::SEL_ARG(Field *field_,uint8 part_,char *min_value_,char *max_value_, left=right= &null_element; } -SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg) +SEL_ARG *SEL_ARG::clone(PARAM *param, SEL_ARG *new_parent, SEL_ARG **next_arg) { SEL_ARG *tmp; + + /* Bail out if we have already generated too many SEL_ARGs */ + if (++param->alloced_sel_args > MAX_SEL_ARGS) + return 0; + if (type != KEY_RANGE) { - if (!(tmp= new SEL_ARG(type))) + if (!(tmp= new (param->mem_root) SEL_ARG(type))) return 0; // out of memory tmp->prev= *next_arg; // Link into next/prev chain (*next_arg)->next=tmp; @@ -581,20 +675,20 @@ SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg) } else { - if (!(tmp= new SEL_ARG(field,part, min_value,max_value, - min_flag, max_flag, maybe_flag))) + if (!(tmp= new (param->mem_root) SEL_ARG(field,part, min_value,max_value, + min_flag, max_flag, maybe_flag))) return 0; // OOM tmp->parent=new_parent; tmp->next_key_part=next_key_part; if (left != &null_element) - tmp->left=left->clone(tmp,next_arg); + tmp->left=left->clone(param, tmp, next_arg); tmp->prev= *next_arg; // Link into next/prev chain (*next_arg)->next=tmp; (*next_arg)= tmp; if (right != &null_element) - if (!(tmp->right= right->clone(tmp,next_arg))) + if (!(tmp->right= right->clone(param, tmp, next_arg))) return 0; // OOM } increment_use_count(1); @@ -672,11 +766,12 @@ static int sel_cmp(Field *field, char *a,char *b,uint8 a_flag,uint8 b_flag) } -SEL_ARG *SEL_ARG::clone_tree() +SEL_ARG *SEL_ARG::clone_tree(PARAM *param) { SEL_ARG tmp_link,*next_arg,*root; next_arg= &tmp_link; - root= clone((SEL_ARG *) 0, &next_arg); + if (!(root= clone(param, (SEL_ARG *) 0, &next_arg))) + return 0; next_arg->next=0; // Fix last link tmp_link.next->prev=0; // Fix first link if (root) // If not OOM @@ -890,6 +985,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, param.real_keynr[param.keys++]=idx; } param.key_parts_end=key_parts; + param.alloced_sel_args= 0; if ((tree=get_mm_tree(¶m,cond))) { @@ -991,7 +1087,8 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond) while ((item=li++)) { SEL_TREE *new_tree=get_mm_tree(param,item); - if (param->thd->is_fatal_error) + if (param->thd->is_fatal_error || + param->alloced_sel_args > SEL_ARG::MAX_SEL_ARGS) DBUG_RETURN(0); // out of memory tree=tree_and(param,tree,new_tree); if (tree && tree->type == SEL_TREE::IMPOSSIBLE) @@ -1524,7 +1621,7 @@ tree_and(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) tree1->type=SEL_TREE::KEY_SMALLER; DBUG_RETURN(tree1); } - + /* Join the trees key per key */ SEL_ARG **key1,**key2,**end; for (key1= tree1->keys,key2= tree2->keys,end=key1+param->keys ; @@ -1537,7 +1634,7 @@ tree_and(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) flag|=CLONE_KEY1_MAYBE; if (*key2 && !(*key2)->simple_key()) flag|=CLONE_KEY2_MAYBE; - *key1=key_and(*key1,*key2,flag); + *key1=key_and(param, *key1, *key2, flag); if (*key1 && (*key1)->type == SEL_ARG::IMPOSSIBLE) { tree1->type= SEL_TREE::IMPOSSIBLE; @@ -1574,7 +1671,7 @@ tree_or(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) for (key1= tree1->keys,key2= tree2->keys,end=key1+param->keys ; key1 != end ; key1++,key2++) { - *key1=key_or(*key1,*key2); + *key1= key_or(param, *key1, *key2); if (*key1) { result=tree1; // Added to tree1 @@ -1590,14 +1687,14 @@ tree_or(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) /* And key trees where key1->part < key2 -> part */ static SEL_ARG * -and_all_keys(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) +and_all_keys(PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) { SEL_ARG *next; ulong use_count=key1->use_count; if (key1->elements != 1) { - key2->use_count+=key1->elements-1; + key2->use_count+=key1->elements-1; //psergey: why we don't count that key1 has n-k-p? key2->increment_use_count((int) key1->elements-1); } if (key1->type == SEL_ARG::MAYBE_KEY) @@ -1609,7 +1706,7 @@ and_all_keys(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) { if (next->next_key_part) { - SEL_ARG *tmp=key_and(next->next_key_part,key2,clone_flag); + SEL_ARG *tmp= key_and(param, next->next_key_part, key2, clone_flag); if (tmp && tmp->type == SEL_ARG::IMPOSSIBLE) { key1=key1->tree_delete(next); @@ -1618,6 +1715,8 @@ and_all_keys(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) next->next_key_part=tmp; if (use_count) next->increment_use_count(use_count); + if (param->alloced_sel_args > SEL_ARG::MAX_SEL_ARGS) + break; } else next->next_key_part=key2; @@ -1644,7 +1743,7 @@ and_all_keys(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) */ static SEL_ARG * -key_and(SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) +key_and(PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) { if (!key1) return key2; @@ -1660,9 +1759,9 @@ key_and(SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) // key1->part < key2->part key1->use_count--; if (key1->use_count > 0) - if (!(key1= key1->clone_tree())) + if (!(key1= key1->clone_tree(param))) return 0; // OOM - return and_all_keys(key1,key2,clone_flag); + return and_all_keys(param, key1, key2, clone_flag); } if (((clone_flag & CLONE_KEY2_MAYBE) && @@ -1680,14 +1779,14 @@ key_and(SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) if (key1->use_count > 1) { key1->use_count--; - if (!(key1=key1->clone_tree())) + if (!(key1=key1->clone_tree(param))) return 0; // OOM key1->use_count++; } if (key1->type == SEL_ARG::MAYBE_KEY) { // Both are maybe key - key1->next_key_part=key_and(key1->next_key_part,key2->next_key_part, - clone_flag); + key1->next_key_part=key_and(param, key1->next_key_part, + key2->next_key_part, clone_flag); if (key1->next_key_part && key1->next_key_part->type == SEL_ARG::IMPOSSIBLE) return key1; @@ -1698,7 +1797,7 @@ key_and(SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) if (key2->next_key_part) { key1->use_count--; // Incremented in and_all_keys - return and_all_keys(key1,key2,clone_flag); + return and_all_keys(param, key1, key2, clone_flag); } key2->use_count--; // Key2 doesn't have a tree } @@ -1727,7 +1826,8 @@ key_and(SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) } else if (get_range(&e2,&e1,key2)) continue; - SEL_ARG *next=key_and(e1->next_key_part,e2->next_key_part,clone_flag); + SEL_ARG *next=key_and(param, e1->next_key_part, e2->next_key_part, + clone_flag); e1->increment_use_count(1); e2->increment_use_count(1); if (!next || next->type != SEL_ARG::IMPOSSIBLE) @@ -1775,7 +1875,7 @@ get_range(SEL_ARG **e1,SEL_ARG **e2,SEL_ARG *root1) static SEL_ARG * -key_or(SEL_ARG *key1,SEL_ARG *key2) +key_or(PARAM *param, SEL_ARG *key1,SEL_ARG *key2) { if (!key1) { @@ -1823,7 +1923,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2) { swap_variables(SEL_ARG *,key1,key2); } - if (key1->use_count > 0 || !(key1=key1->clone_tree())) + if (key1->use_count > 0 || !(key1=key1->clone_tree(param))) return 0; // OOM } @@ -1967,7 +2067,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2) { // tmp.min. <= x <= tmp.max tmp->maybe_flag|= key.maybe_flag; key.increment_use_count(key1->use_count+1); - tmp->next_key_part=key_or(tmp->next_key_part,key.next_key_part); + tmp->next_key_part= key_or(param, tmp->next_key_part, key.next_key_part); if (!cmp) // Key2 is ready break; key.copy_max_to_min(tmp); @@ -1998,7 +2098,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2) tmp->increment_use_count(key1->use_count+1); /* Increment key count as it may be used for next loop */ key.increment_use_count(1); - new_arg->next_key_part=key_or(tmp->next_key_part,key.next_key_part); + new_arg->next_key_part= key_or(param, tmp->next_key_part, key.next_key_part); key1=key1->insert(new_arg); break; } From f7c4ed0abe5cb7578fa9be6b8b8da25053e5840c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 10:19:10 -0600 Subject: [PATCH 434/789] Bug #26262: Add option to skip binary logging for mysqlcheck Add the --skip-write-binlog option, which adds NO_WRITE_TO_BINLOG to REPAIR, ANALYZE, and OPTIMIZE commands. Use this option when these SQL commands should not be sent to replication slaves, nor run when using the binary logs for recovery from backup client/client_priv.h: Add OPT_WRITE_BINLOG client option client/mysqlcheck.c: Add --skip-write-binlog option, which adds NO_WRITE_TO_BINLOG to REPAIR, ANALYZE, and OPTIMIZE commands. --- client/client_priv.h | 2 +- client/mysqlcheck.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 646619f62b1..5b3b3890603 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -60,5 +60,5 @@ enum options_client OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, OPT_SLAP_AUTO_GENERATE_WRITE_NUM, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, - OPT_DEBUG_INFO, OPT_COLUMN_TYPES + OPT_DEBUG_INFO, OPT_COLUMN_TYPES, OPT_WRITE_BINLOG }; diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 1a9d07804b4..2f5d435d0a5 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -34,7 +34,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0, opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, tty_password= 0, opt_frm= 0, info_flag= 0, - opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0; + opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, + opt_write_binlog= 1; static uint verbose = 0, opt_mysql_port=0; static my_string opt_mysql_unix_port = 0; static char *opt_password = 0, *current_user = 0, @@ -123,6 +124,10 @@ static struct my_option my_long_options[] = {"medium-check", 'm', "Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"write-binlog", OPT_WRITE_BINLOG, + "Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.", + (gptr*) &opt_write_binlog, (gptr*) &opt_write_binlog, 0, GET_BOOL, NO_ARG, + 1, 0, 0, 0, 0, 0}, {"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', @@ -598,16 +603,16 @@ static int handle_request_for_tables(char *tables, uint length) if (opt_upgrade) end = strmov(end, " FOR UPGRADE"); break; case DO_REPAIR: - op = "REPAIR"; + op= (opt_write_binlog) ? "REPAIR" : "REPAIR NO_WRITE_TO_BINLOG"; if (opt_quick) end = strmov(end, " QUICK"); if (opt_extended) end = strmov(end, " EXTENDED"); if (opt_frm) end = strmov(end, " USE_FRM"); break; case DO_ANALYZE: - op = "ANALYZE"; + op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG"; break; case DO_OPTIMIZE: - op = "OPTIMIZE"; + op= (opt_write_binlog) ? "OPTIMIZE" : "OPTIMIZE NO_WRITE_TO_BINLOG"; break; case DO_UPGRADE: return fix_object_name("TABLE", tables); From 94b6ec6b1e6894b751913b72fe066ec2890353c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 18:47:51 +0200 Subject: [PATCH 435/789] Import yaSSL extra/yassl/include/lock.hpp: Import patch yassl.diff extra/yassl/include/openssl/ssl.h: Import patch yassl.diff extra/yassl/include/socket_wrapper.hpp: Import patch yassl.diff extra/yassl/include/yassl.hpp: Import patch yassl.diff extra/yassl/src/ssl.cpp: Import patch yassl.diff extra/yassl/taocrypt/mySTL/algorithm.hpp: Import patch yassl.diff --- extra/yassl/include/lock.hpp | 2 +- extra/yassl/include/openssl/ssl.h | 1 + extra/yassl/include/socket_wrapper.hpp | 5 +++-- extra/yassl/include/yassl.hpp | 2 +- extra/yassl/src/ssl.cpp | 1 - extra/yassl/taocrypt/mySTL/algorithm.hpp | 2 -- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp index b961ec3e478..0525943e45d 100644 --- a/extra/yassl/include/lock.hpp +++ b/extra/yassl/include/lock.hpp @@ -28,7 +28,7 @@ namespace yaSSL { #ifdef MULTI_THREADED - #if defined(_WIN32) || defined(_WIN64) + #ifdef _WIN32 #include class Mutex { diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index c7cd103841c..7dd33e3fcad 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -189,6 +189,7 @@ enum { /* ERR Constants */ ERR_TXT_STRING = 1, EVP_R_BAD_DECRYPT = 2 }; + /* Allow type used by SSL_set_fd to be changed, default to int in order to be compatible with OpenSSL diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp index ba52dbab3ec..308704c2af0 100644 --- a/extra/yassl/include/socket_wrapper.hpp +++ b/extra/yassl/include/socket_wrapper.hpp @@ -28,8 +28,9 @@ #include -#include "openssl/ssl.h" /* for socket_t */ -#if !defined(_WIN32) && !defined(_WIN64) +#ifdef _WIN32 + #include +#else #include #include #include diff --git a/extra/yassl/include/yassl.hpp b/extra/yassl/include/yassl.hpp index b8190c484f7..29e0a5d94ec 100644 --- a/extra/yassl/include/yassl.hpp +++ b/extra/yassl/include/yassl.hpp @@ -28,7 +28,7 @@ namespace yaSSL { -#if defined(_WIN32) || defined(_WIN64) +#ifdef _WIN32 typedef unsigned int SOCKET_T; #else typedef int SOCKET_T; diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index cbd84efcdba..86dfa1c6ebd 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -39,7 +39,6 @@ #include "coding.hpp" // HexDecoder #include "helpers.hpp" // for placement new hack #include -#include #ifdef _WIN32 #include // FindFirstFile etc.. diff --git a/extra/yassl/taocrypt/mySTL/algorithm.hpp b/extra/yassl/taocrypt/mySTL/algorithm.hpp index f6a29cf4bdb..d8bc29a0bb9 100644 --- a/extra/yassl/taocrypt/mySTL/algorithm.hpp +++ b/extra/yassl/taocrypt/mySTL/algorithm.hpp @@ -27,8 +27,6 @@ namespace mySTL { -#undef max -#undef min template inline const T& max(const T& a, const T&b) From d167071bed81f3dccf109b79b2a2fe77eccfd3c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 19:01:49 +0200 Subject: [PATCH 436/789] mysys/my_thr_init.c : Avoid warnings of "unused variable" by extending a '#ifdef'. mysys/my_thr_init.c: Enclose a variable declaration in the same '#ifdef' that also controls all access to the variable. This avoids warnings of "unused variable". --- mysys/my_thr_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 464edb77f99..75da07390ba 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -403,9 +403,9 @@ const char *my_thread_name(void) static uint get_thread_lib(void) { +#ifdef _CS_GNU_LIBPTHREAD_VERSION char buff[64]; -#ifdef _CS_GNU_LIBPTHREAD_VERSION confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff)); if (!strncasecmp(buff, "NPTL", 4)) From 05853ab055d629c6cc7e1860a5275754133756fa Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 19:10:18 +0200 Subject: [PATCH 437/789] Import yaSSL extra/yassl/src/ssl.cpp: Import patch yassl.diff --- extra/yassl/src/ssl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 5ccc45ded2a..86dfa1c6ebd 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -58,6 +58,9 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM) return SSL_BAD_FILETYPE; + if (file == NULL || !file[0]) + return SSL_BAD_FILE; + FILE* input = fopen(file, "rb"); if (!input) return SSL_BAD_FILE; From 406fd12ad42268b42631c27772a292d5787ff0a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 23:00:50 +0200 Subject: [PATCH 438/789] configure.in: Don't install ndb man pages if no ndb configured config-win.h, CMakeLists.txt, README, configure.js: Removed Cybozu patches configure.in: Don't install ndb man pages if no ndb configured CMakeLists.txt: Removed Cybozu patches include/config-win.h: Removed Cybozu patches win/README: Removed Cybozu patches win/configure.js: Removed Cybozu patches --- CMakeLists.txt | 3 --- configure.in | 12 +++++++++--- include/config-win.h | 14 -------------- win/README | 1 - win/configure.js | 1 - 5 files changed, 9 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a76361693a..3a286071bb0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,9 +80,6 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh IF(__NT__) ADD_DEFINITIONS(-D __NT__) ENDIF(__NT__) -IF(CYBOZU) - ADD_DEFINITIONS(-D CYBOZU) -ENDIF(CYBOZU) # in some places we use DBUG_OFF SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF") diff --git a/configure.in b/configure.in index 7867bf444ad..9b0505a594f 100644 --- a/configure.in +++ b/configure.in @@ -2376,12 +2376,18 @@ AC_ARG_WITH(man, [with_man=yes] ) -if test "$with_man" = "yes" +if test X"$with_man" = Xyes then man_dirs="man" - man1_files=`ls -1 $srcdir/man/*.1 | sed -e 's;^.*man/;;'` + if test X"$have_ndbcluster" = Xyes + then + man1_files=`ls $srcdir/man/*.1 | sed -e 's;^.*man/;;'` + man8_files=`ls $srcdir/man/*.8 | sed -e 's;^.*man/;;'` + else + man1_files=`ls $srcdir/man/*.1 | grep -v '/ndb' | sed -e 's;^.*man/;;'` + man8_files=`ls $srcdir/man/*.8 | grep -v '/ndb' | sed -e 's;^.*man/;;'` + fi man1_files=`echo $man1_files` - man8_files=`ls -1 $srcdir/man/*.8 | sed -e 's;^.*man/;;'` man8_files=`echo $man8_files` else man_dirs="" diff --git a/include/config-win.h b/include/config-win.h index 34e828e01e8..279be7aa5e4 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -408,14 +408,8 @@ inline double ulonglong2double(ulonglong value) #define shared_memory_buffer_length 16000 #define default_shared_memory_base_name "MYSQL" -#ifdef CYBOZU -#define MYSQL_DEFAULT_CHARSET_NAME "utf8" -#define MYSQL_DEFAULT_COLLATION_NAME "utf8_general_cs" -#define HAVE_UTF8_GENERAL_CS 1 -#else #define MYSQL_DEFAULT_CHARSET_NAME "latin1" #define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" -#endif #define HAVE_SPATIAL 1 #define HAVE_RTREE_KEYS 1 @@ -426,10 +420,8 @@ inline double ulonglong2double(ulonglong value) /* Define charsets you want */ /* #undef HAVE_CHARSET_armscii8 */ /* #undef HAVE_CHARSET_ascii */ -#ifndef CYBOZU #define HAVE_CHARSET_big5 1 #define HAVE_CHARSET_cp1250 1 -#endif /* #undef HAVE_CHARSET_cp1251 */ /* #undef HAVE_CHARSET_cp1256 */ /* #undef HAVE_CHARSET_cp1257 */ @@ -438,33 +430,27 @@ inline double ulonglong2double(ulonglong value) /* #undef HAVE_CHARSET_cp866 */ #define HAVE_CHARSET_cp932 1 /* #undef HAVE_CHARSET_dec8 */ -#ifndef CYBOZU #define HAVE_CHARSET_eucjpms 1 #define HAVE_CHARSET_euckr 1 #define HAVE_CHARSET_gb2312 1 #define HAVE_CHARSET_gbk 1 -#endif /* #undef HAVE_CHARSET_greek */ /* #undef HAVE_CHARSET_hebrew */ /* #undef HAVE_CHARSET_hp8 */ /* #undef HAVE_CHARSET_keybcs2 */ /* #undef HAVE_CHARSET_koi8r */ /* #undef HAVE_CHARSET_koi8u */ -#ifndef CYBOZU #define HAVE_CHARSET_latin1 1 #define HAVE_CHARSET_latin2 1 -#endif /* #undef HAVE_CHARSET_latin5 */ /* #undef HAVE_CHARSET_latin7 */ /* #undef HAVE_CHARSET_macce */ /* #undef HAVE_CHARSET_macroman */ #define HAVE_CHARSET_sjis 1 /* #undef HAVE_CHARSET_swe7 */ -#ifndef CYBOZU #define HAVE_CHARSET_tis620 1 #define HAVE_CHARSET_ucs2 1 #define HAVE_CHARSET_ujis 1 -#endif #define HAVE_CHARSET_utf8 1 #define HAVE_UCA_COLLATIONS 1 diff --git a/win/README b/win/README index 8fe3dc21d1e..871ae4efee7 100644 --- a/win/README +++ b/win/README @@ -48,7 +48,6 @@ The options right now are MYSQL_SERVER_SUFFIX= Server suffix, default none COMPILATION_COMMENT= Server comment, default "Source distribution" MYSQL_TCP_PORT= Server port, default 3306 - CYBOZU DISABLE_GRANT_OPTIONS Disables the use of --init-file and --skip-grant-tables options of mysqld.exe diff --git a/win/configure.js b/win/configure.js index 59c73fc2fab..3488efacba3 100755 --- a/win/configure.js +++ b/win/configure.js @@ -46,7 +46,6 @@ try case "WITH_INNOBASE_STORAGE_ENGINE": case "WITH_PARTITION_STORAGE_ENGINE": case "__NT__": - case "CYBOZU": case "DISABLE_GRANT_OPTIONS": configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); break; From 53b9d044dba0221892a192fc456972ceeffed16e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 23:18:43 +0200 Subject: [PATCH 439/789] Makefile.am: Extended test section Removed duplicate EXTRA_DIST client/Makefile.am: Removed duplicate EXTRA_DIST Makefile.am: Extended test section --- Makefile.am | 18 +++++++++++++++--- client/Makefile.am | 3 +-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index d742539da26..c4a4a040a40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,13 +149,25 @@ test-force-mem: test-bt: -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=normal --report-features + @PERL@ ./mysql-test-run.pl --comment=normal --force --timer \ + --skip-ndbcluster --report-features -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=ps --ps-protocol + @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \ + --skip-ndbcluster --ps-protocol + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=normal+rowrepl --force --timer \ + --skip-ndbcluster --mysqld=--binlog-format=row + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=ps+rowrepl+NDB --force --timer \ + --ps-protocol --mysqld=--binlog-format=row + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \ + --with-ndbcluster-only test-bt-debug: -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=debug --report-features + @PERL@ ./mysql-test-run.pl --comment=debug --force --timer \ + --skip-ndbcluster --skip-rpl --report-features # Keep these for a while test-pl: test diff --git a/client/Makefile.am b/client/Makefile.am index 1c908ea715e..5960095778b 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -34,7 +34,7 @@ LDADD= @CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ client_priv.h -EXTRA_DIST = get_password.c CMakeLists.txt +EXTRA_DIST = get_password.c CMakeLists.txt echo.c bin_PROGRAMS = mysql \ mysqladmin \ @@ -96,7 +96,6 @@ DEFS = -DUNDEF_THREADS_HACK \ sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc strings_src=decimal.c -EXTRA_DIST = get_password.c CMakeLists.txt echo.c link_sources: for f in $(sql_src) ; do \ From 0b72b7f0a4c98f202b078e39afacacb442df3585 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 15:25:13 -0600 Subject: [PATCH 440/789] Bug #26642: create index corrupts table definition in .frm Thanks to Martin Friebe for finding and submitting a fix for this bug! A table with maximum number of key segments and maximum length key name would have a corrupted .frm file, due to an incorrect calculation of the complete key length. Now the key length is computed correctly (I hope) :-) MyISAM would reject a table with the maximum number of keys and the maximum number of key segments in all keys. It would allow one less than this total maximum. Now MyISAM accepts a table defined with the maximum. (This is a very minor issue.) myisam/mi_open.c: change >= to > in a comparison (i.e., error only if key_parts_in_table really is greater than MAX_KEY * MAX_KEY_SEG) mysql-test/r/create.result: Add test results for bug #26642 (create index corrupts table definition in .frm) mysql-test/t/create.test: Add test case for bug #26642 (create index corrupts table definition in .frm) sql/table.cc: In create_frm(), fix formula for key_length; it was too small by (keys * 2) bytes --- myisam/mi_open.c | 2 +- mysql-test/r/create.result | 517 +++++++++++++++++++++++++++++++++++++ mysql-test/t/create.test | 212 ++++++++++++++- sql/table.cc | 13 +- 4 files changed, 741 insertions(+), 3 deletions(-) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index b007eb63e63..12d31616128 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -219,7 +219,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) key_parts+=fulltext_keys*FT_SEGS; if (share->base.max_key_length > MI_MAX_KEY_BUFF || keys > MI_MAX_KEY || - key_parts >= MI_MAX_KEY * MI_MAX_KEY_SEG) + key_parts > MI_MAX_KEY * MI_MAX_KEY_SEG) { DBUG_PRINT("error",("Wrong key info: Max_key_length: %d keys: %d key_parts: %d", share->base.max_key_length, keys, key_parts)); my_errno=HA_ERR_UNSUPPORTED; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index aa25c55f394..a8a5b62bc81 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -701,3 +701,520 @@ t2 CREATE TABLE `t2` ( drop table t1, t2; create table t1(a set("a,b","c,d") not null); ERROR HY000: Illegal set 'a,b' value found during parsing +create table t1 ( +c1 char(10), c2 char(10), c3 char(10), c4 char(10), +c5 char(10), c6 char(10), c7 char(10), c8 char(10), +c9 char(10), c10 char(10), c11 char(10), c12 char(10), +c13 char(10), c14 char(10), c15 char(10), c16 char(10), +key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(10) default NULL, + `c2` char(10) default NULL, + `c3` char(10) default NULL, + `c4` char(10) default NULL, + `c5` char(10) default NULL, + `c6` char(10) default NULL, + `c7` char(10) default NULL, + `c8` char(10) default NULL, + `c9` char(10) default NULL, + `c10` char(10) default NULL, + `c11` char(10) default NULL, + `c12` char(10) default NULL, + `c13` char(10) default NULL, + `c14` char(10) default NULL, + `c15` char(10) default NULL, + `c16` char(10) default NULL, + KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +flush tables; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(10) default NULL, + `c2` char(10) default NULL, + `c3` char(10) default NULL, + `c4` char(10) default NULL, + `c5` char(10) default NULL, + `c6` char(10) default NULL, + `c7` char(10) default NULL, + `c8` char(10) default NULL, + `c9` char(10) default NULL, + `c10` char(10) default NULL, + `c11` char(10) default NULL, + `c12` char(10) default NULL, + `c13` char(10) default NULL, + `c14` char(10) default NULL, + `c15` char(10) default NULL, + `c16` char(10) default NULL, + KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 ( +c1 char(10), c2 char(10), c3 char(10), c4 char(10), +c5 char(10), c6 char(10), c7 char(10), c8 char(10), +c9 char(10), c10 char(10), c11 char(10), c12 char(10), +c13 char(10), c14 char(10), c15 char(10), c16 char(10) +); +alter table t1 +add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(10) default NULL, + `c2` char(10) default NULL, + `c3` char(10) default NULL, + `c4` char(10) default NULL, + `c5` char(10) default NULL, + `c6` char(10) default NULL, + `c7` char(10) default NULL, + `c8` char(10) default NULL, + `c9` char(10) default NULL, + `c10` char(10) default NULL, + `c11` char(10) default NULL, + `c12` char(10) default NULL, + `c13` char(10) default NULL, + `c14` char(10) default NULL, + `c15` char(10) default NULL, + `c16` char(10) default NULL, + KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +flush tables; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(10) default NULL, + `c2` char(10) default NULL, + `c3` char(10) default NULL, + `c4` char(10) default NULL, + `c5` char(10) default NULL, + `c6` char(10) default NULL, + `c7` char(10) default NULL, + `c8` char(10) default NULL, + `c9` char(10) default NULL, + `c10` char(10) default NULL, + `c11` char(10) default NULL, + `c12` char(10) default NULL, + `c13` char(10) default NULL, + `c14` char(10) default NULL, + `c15` char(10) default NULL, + `c16` char(10) default NULL, + KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 add key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); +ERROR 42000: Too many keys specified; max 64 keys allowed +drop table t1; +create table t1 ( +c1 char(10), c2 char(10), c3 char(10), c4 char(10), +c5 char(10), c6 char(10), c7 char(10), c8 char(10), +c9 char(10), c10 char(10), c11 char(10), c12 char(10), +c13 char(10), c14 char(10), c15 char(10), c16 char(10), +c17 char(10) +); +alter table t1 add key i1 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`, `c17`); +ERROR 42000: Too many key parts specified; max 16 parts allowed +alter table t1 add key a001_long_123456789_123456789_123456789_123456789_123456789_12345 (`c1`); +ERROR 42000: Identifier name 'a001_long_123456789_123456789_123456789_123456789_123456789_12345' is too long +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` char(10) default NULL, + `c2` char(10) default NULL, + `c3` char(10) default NULL, + `c4` char(10) default NULL, + `c5` char(10) default NULL, + `c6` char(10) default NULL, + `c7` char(10) default NULL, + `c8` char(10) default NULL, + `c9` char(10) default NULL, + `c10` char(10) default NULL, + `c11` char(10) default NULL, + `c12` char(10) default NULL, + `c13` char(10) default NULL, + `c14` char(10) default NULL, + `c15` char(10) default NULL, + `c16` char(10) default NULL, + `c17` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +End of 4.1 tests diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 57b16a13c01..a3458298ff9 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -609,4 +609,214 @@ drop table t1, t2; --error 1105 create table t1(a set("a,b","c,d") not null); -# End of 4.1 tests + +# +# Bug #26642: create index corrupts table definition in .frm +# +# Problem with creating keys with maximum key-parts and maximum name length +# This test is made for a mysql server supporting names up to 64 bytes +# and a maximum of 16 key segements per Key +# + +create table t1 ( +c1 char(10), c2 char(10), c3 char(10), c4 char(10), +c5 char(10), c6 char(10), c7 char(10), c8 char(10), +c9 char(10), c10 char(10), c11 char(10), c12 char(10), +c13 char(10), c14 char(10), c15 char(10), c16 char(10), + +key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) +); + +# Check that the table is not corrupted +show create table t1; +flush tables; +show create table t1; + +# Repeat test using ALTER to add indexes + +drop table t1; +create table t1 ( +c1 char(10), c2 char(10), c3 char(10), c4 char(10), +c5 char(10), c6 char(10), c7 char(10), c8 char(10), +c9 char(10), c10 char(10), c11 char(10), c12 char(10), +c13 char(10), c14 char(10), c15 char(10), c16 char(10) +); + +alter table t1 + +add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), + +add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), +add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); + +show create table t1; +flush tables; +show create table t1; + +# Test the server limits; if any of these pass, all above tests need +# to be rewritten to hit the limit +# +# Ensure limit is really 64 keys +--error 1069 +alter table t1 add key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); + +drop table t1; + +# Ensure limit is really 16 key parts per key + +create table t1 ( +c1 char(10), c2 char(10), c3 char(10), c4 char(10), +c5 char(10), c6 char(10), c7 char(10), c8 char(10), +c9 char(10), c10 char(10), c11 char(10), c12 char(10), +c13 char(10), c14 char(10), c15 char(10), c16 char(10), +c17 char(10) +); + +# Get error for max key parts +--error 1070 +alter table t1 add key i1 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`, `c17`); + +# Get error for max key-name length +--error 1059 +alter table t1 add key a001_long_123456789_123456789_123456789_123456789_123456789_12345 (`c1`); + +show create table t1; + +drop table t1; + +--echo End of 4.1 tests diff --git a/sql/table.cc b/sql/table.cc index a85da8395e7..f4f3fcf81dc 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1283,7 +1283,18 @@ File create_frm(register my_string name, const char *db, const char *table, fileinfo[3]= (uchar) ha_checktype(create_info->db_type); fileinfo[4]=1; int2store(fileinfo+6,IO_SIZE); /* Next block starts here */ - key_length=keys*(7+NAME_LEN+MAX_REF_PARTS*9)+16; + /* + For each key (see unireg.cc::pack_keys()): + 8 bytes for the key header + 9 bytes for each key-part (MAX_REF_PARTS) + NAME_LEN bytes for the name + 1 byte for the NAMES_SEP_CHAR (before the name) + For all keys: + 6 bytes for the header + 1 byte for the NAMES_SEP_CHAR (after the last name) + 9 extra bytes (padding for safety? alignment?) + */ + key_length= keys * (8 + MAX_REF_PARTS * 9 + NAME_LEN + 1) + 16; length=(ulong) next_io_size((ulong) (IO_SIZE+key_length+reclength)); int4store(fileinfo+10,length); if (key_length > 0xffff) key_length=0xffff; From 942bb0dfd9fcd30c035b0cf572f9dc6c78231951 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 17:40:42 -0600 Subject: [PATCH 441/789] Update test for bug #24563 (MBROverlaps does not seem to function propertly.): - Add primary key to test table, so NDB with binlog doesn't complain - Add extra results for bdb_gis.result mysql-test/include/gis_generic.inc: Update test for bug #24563 (MBROverlaps does not seem to function propertly.): - Add primary key to test table, so NDB with binlog doesn't complain mysql-test/r/archive_gis.result: update test results mysql-test/r/bdb_gis.result: update test results mysql-test/r/innodb_gis.result: update test results mysql-test/r/ndb_gis.result: update test results --- mysql-test/include/gis_generic.inc | 33 +++++++-------- mysql-test/r/archive_gis.result | 32 +++++++-------- mysql-test/r/bdb_gis.result | 57 ++++++++++++++++++-------- mysql-test/r/innodb_gis.result | 32 +++++++-------- mysql-test/r/ndb_gis.result | 64 +++++++++++++++--------------- 5 files changed, 122 insertions(+), 96 deletions(-) diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc index 1b4303da1f8..9eb555a5401 100644 --- a/mysql-test/include/gis_generic.inc +++ b/mysql-test/include/gis_generic.inc @@ -188,28 +188,29 @@ drop table t1; # Test all MBR* functions and their non-MBR-prefixed aliases, # using shifted squares to verify the spatial relations. -create table t1 (name VARCHAR(100), square GEOMETRY); +# Primary key is needed for NDB with binlog +CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result index 97be26178ee..72641ce979d 100644 --- a/mysql-test/r/archive_gis.result +++ b/mysql-test/r/archive_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -create table t1 (name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/bdb_gis.result b/mysql-test/r/bdb_gis.result index bb446badfff..7835dfbb9b8 100644 --- a/mysql-test/r/bdb_gis.result +++ b/mysql-test/r/bdb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -create table t1 (name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small @@ -515,5 +515,30 @@ down2,left2,right2,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within big,center +SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); +SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); +SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); +SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); +SET @point1 = GeomFromText('POLYGON ((0 0))'); +SET @point2 = GeomFromText('POLYGON ((-2 0))'); +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name; +overlaps +SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name; +overlaps +SELECT Overlaps(@horiz1, @vert1) FROM DUAL; +Overlaps(@horiz1, @vert1) +0 +SELECT Overlaps(@horiz1, @horiz2) FROM DUAL; +Overlaps(@horiz1, @horiz2) +1 +SELECT Overlaps(@horiz1, @horiz3) FROM DUAL; +Overlaps(@horiz1, @horiz3) +0 +SELECT Overlaps(@horiz1, @point1) FROM DUAL; +Overlaps(@horiz1, @point1) +0 +SELECT Overlaps(@horiz1, @point2) FROM DUAL; +Overlaps(@horiz1, @point2) +0 DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result index 727cf7dbc66..8fb939e29fa 100644 --- a/mysql-test/r/innodb_gis.result +++ b/mysql-test/r/innodb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -create table t1 (name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result index 5851df9ea6e..7e5e23b0eb6 100644 --- a/mysql-test/r/ndb_gis.result +++ b/mysql-test/r/ndb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -create table t1 (name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small @@ -1001,22 +1001,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -create table t1 (name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small From 465cf7380aad2f370d97ec38a1c72d6acb174b16 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 17:50:06 -0600 Subject: [PATCH 442/789] Remove warning when compiling libmysqld/log.cc sql/log.cc: define print_buffer_to_file only ifdef EMBEDDED_LIBRARY, to avoid "defined but not used" warning --- sql/log.cc | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index ea82648b553..e0378f74f00 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2229,37 +2229,6 @@ static bool test_if_number(register const char *str, } /* test_if_number */ -static void print_buffer_to_file(enum loglevel level, const char *buffer) -{ - time_t skr; - struct tm tm_tmp; - struct tm *start; - DBUG_ENTER("print_buffer_to_file"); - DBUG_PRINT("enter",("buffer: %s", buffer)); - - VOID(pthread_mutex_lock(&LOCK_error_log)); - - skr=time(NULL); - localtime_r(&skr, &tm_tmp); - start=&tm_tmp; - fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d [%s] %s\n", - start->tm_year % 100, - start->tm_mon+1, - start->tm_mday, - start->tm_hour, - start->tm_min, - start->tm_sec, - (level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ? - "Warning" : "Note"), - buffer); - - fflush(stderr); - - VOID(pthread_mutex_unlock(&LOCK_error_log)); - DBUG_VOID_RETURN; -} - - void sql_perror(const char *message) { #ifdef HAVE_STRERROR @@ -2387,6 +2356,37 @@ void vprint_msg_to_log(enum loglevel level __attribute__((unused)), va_list argsi __attribute__((unused))) {} #else /*!EMBEDDED_LIBRARY*/ +static void print_buffer_to_file(enum loglevel level, const char *buffer) +{ + time_t skr; + struct tm tm_tmp; + struct tm *start; + DBUG_ENTER("print_buffer_to_file"); + DBUG_PRINT("enter",("buffer: %s", buffer)); + + VOID(pthread_mutex_lock(&LOCK_error_log)); + + skr=time(NULL); + localtime_r(&skr, &tm_tmp); + start=&tm_tmp; + fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d [%s] %s\n", + start->tm_year % 100, + start->tm_mon+1, + start->tm_mday, + start->tm_hour, + start->tm_min, + start->tm_sec, + (level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ? + "Warning" : "Note"), + buffer); + + fflush(stderr); + + VOID(pthread_mutex_unlock(&LOCK_error_log)); + DBUG_VOID_RETURN; +} + + void vprint_msg_to_log(enum loglevel level, const char *format, va_list args) { char buff[1024]; From b9fd97f5506376d64d470de2e9ac7ced02e33873 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 19:39:43 -0600 Subject: [PATCH 443/789] Update test for bug #24563 (MBROverlaps does not seem to function propertly.); ARCHIVE doesn't support AUTO_INCREMENT, so specify PK values explicitly mysql-test/r/archive_gis.result: update test result mysql-test/r/bdb_gis.result: update test result mysql-test/r/innodb_gis.result: update test result mysql-test/r/ndb_gis.result: update test result --- mysql-test/include/gis_generic.inc | 35 ++++++++-------- mysql-test/r/archive_gis.result | 32 +++++++-------- mysql-test/r/bdb_gis.result | 32 +++++++-------- mysql-test/r/innodb_gis.result | 32 +++++++-------- mysql-test/r/ndb_gis.result | 64 +++++++++++++++--------------- 5 files changed, 98 insertions(+), 97 deletions(-) diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc index 9eb555a5401..d83db08ad6b 100644 --- a/mysql-test/include/gis_generic.inc +++ b/mysql-test/include/gis_generic.inc @@ -188,29 +188,30 @@ drop table t1; # Test all MBR* functions and their non-MBR-prefixed aliases, # using shifted squares to verify the spatial relations. -# Primary key is needed for NDB with binlog -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +# Primary key is needed for NDB with binlog; bug ARCHIVE doesn't +# support AUTO_INCREMENT, so specify id values explicitly +CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result index 72641ce979d..4301befb18d 100644 --- a/mysql-test/r/archive_gis.result +++ b/mysql-test/r/archive_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/bdb_gis.result b/mysql-test/r/bdb_gis.result index 7835dfbb9b8..108e2cc7a94 100644 --- a/mysql-test/r/bdb_gis.result +++ b/mysql-test/r/bdb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result index 8fb939e29fa..399ff697416 100644 --- a/mysql-test/r/innodb_gis.result +++ b/mysql-test/r/innodb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result index 7e5e23b0eb6..df0ff8e972e 100644 --- a/mysql-test/r/ndb_gis.result +++ b/mysql-test/r/ndb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small @@ -1001,22 +1001,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 (name, square) VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 (name, square) VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 (name, square) VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 (name, square) VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 (name, square) VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 (name, square) VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 (name, square) VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 (name, square) VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 (name, square) VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 (name, square) VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 (name, square) VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 (name, square) VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 (name, square) VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small From db9af0d82239e2ff016d565e54f2f541f05bb9a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 19:49:30 -0600 Subject: [PATCH 444/789] Fix warning on Windows sql/log.cc: Change print_buffer_to_nt_eventlog() to take size_t instead of int/uint for buffer sizes --- sql/log.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index e0378f74f00..c2b4eb1a441 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2296,7 +2296,7 @@ void MYSQL_LOG::signal_update() #ifdef __NT__ static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, - uint length, int buffLen) + size_t length, size_t buffLen) { HANDLE event; char *buffptr= buff; @@ -2390,7 +2390,7 @@ static void print_buffer_to_file(enum loglevel level, const char *buffer) void vprint_msg_to_log(enum loglevel level, const char *format, va_list args) { char buff[1024]; - uint length; + size_t length; DBUG_ENTER("vprint_msg_to_log"); length= my_vsnprintf(buff, sizeof(buff), format, args); From 18f10e353093a192d2465794c2273d598d939ac0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 10:59:05 +0800 Subject: [PATCH 445/789] Bug#24521, ndbd node crashes if try to create many datafiles for tablespace storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: change MaxNoOfOpenFiles's default value to 0, that means no max openning files limitation in ndbfs when user doesnot set explicitly the value in config.ini; Meanwhile, if user set a specific value of MaxNoOfOpenFile and hit the max limiation, he deserves the result. storage/ndb/src/mgmsrv/ConfigInfo.cpp: change default to 0 storage/ndb/src/mgmsrv/ParamInfo.cpp: change default to 0 --- storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp | 6 +++--- storage/ndb/src/mgmsrv/ConfigInfo.cpp | 2 +- storage/ndb/src/mgmsrv/ParamInfo.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 6fb9ef774d0..aa124770d23 100644 --- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -105,11 +105,11 @@ Ndbfs::execREAD_CONFIG_REQ(Signal* signal) theRequestPool = new Pool; - m_maxFiles = 40; + m_maxFiles = 0; ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles); Uint32 noIdleFiles = 27; ndb_mgm_get_int_parameter(p, CFG_DB_INITIAL_OPEN_FILES, &noIdleFiles); - if (noIdleFiles > m_maxFiles) + if (noIdleFiles > m_maxFiles && m_maxFiles != 0) m_maxFiles = noIdleFiles; // Create idle AsyncFiles for (Uint32 i = 0; i < noIdleFiles; i++){ @@ -650,7 +650,7 @@ AsyncFile* Ndbfs::createAsyncFile(){ // Check limit of open files - if (theFiles.size()+1 == m_maxFiles) { + if (m_maxFiles !=0 && theFiles.size()+1 == m_maxFiles) { // Print info about all open files for (unsigned i = 0; i < theFiles.size(); i++){ AsyncFile* file = theFiles[i]; diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp index 6351af7246e..224758f8c5f 100644 --- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp @@ -879,7 +879,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::CI_USED, false, ConfigInfo::CI_INT, - "40", + "0", "20", STR_VALUE(MAX_INT_RNIL) }, diff --git a/storage/ndb/src/mgmsrv/ParamInfo.cpp b/storage/ndb/src/mgmsrv/ParamInfo.cpp index 888b7948c05..a05472de2cb 100644 --- a/storage/ndb/src/mgmsrv/ParamInfo.cpp +++ b/storage/ndb/src/mgmsrv/ParamInfo.cpp @@ -705,7 +705,7 @@ const ParamInfo ParamInfoArray[] = { CI_USED, false, CI_INT, - "40", + "0", "20", STR_VALUE(MAX_INT_RNIL) }, From 86010101e294559d83d0c99def8160eddcf4ce55 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 09:08:30 +0500 Subject: [PATCH 446/789] Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode Problems: 1. storing a string to an integer field we don't check if strntoull10rnd() returns MY_ERRNO_EDOM error. Fix: check for MY_ERRNO_EDOM. 2. storing a string to an year field we use my_strntol() function. Fix: use strntoull10rnd() instead. mysql-test/r/strict.result: Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode - test result. mysql-test/r/type_date.result: Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode - test result. mysql-test/r/type_year.result: Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode - test result. mysql-test/t/strict.test: Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode - test case. mysql-test/t/type_year.test: Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode sql/field.cc: Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode - Field_num::get_int() method introduced. It converts a string to integer then check errors and bounds. - similar Field_tiny::store(const char...), Field_short::store(const char...), Field_medium::store(const char...), Field_long::store(const char...) rewritten, now they just call Field_num::get_int() then store value returned. - Field_num::check_int() simplified. - Field_year::store(const char...) now uses strntoull10rnd() and properly checks errors returned. sql/field.h: Fix for bugs #27176: Assigning a string to an year column has unexpected results #26359: Strings becoming truncated and converted to numbers under STRICT mode - check_int() moved to Field_num. - get_int() introduced. --- mysql-test/r/strict.result | 41 ++++ mysql-test/r/type_date.result | 2 +- mysql-test/r/type_year.result | 12 ++ mysql-test/t/strict.test | 50 +++++ mysql-test/t/type_year.test | 10 +- sql/field.cc | 371 +++++++++++++--------------------- sql/field.h | 7 +- 7 files changed, 263 insertions(+), 230 deletions(-) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 702fc68bb25..93ce4fb8f7c 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1352,3 +1352,44 @@ t1 CREATE TABLE `t1` ( `i` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*' drop table t1; +set sql_mode= 'traditional'; +create table t1(col1 tinyint, col2 tinyint unsigned, +col3 smallint, col4 smallint unsigned, +col5 mediumint, col6 mediumint unsigned, +col7 int, col8 int unsigned, +col9 bigint, col10 bigint unsigned); +insert into t1(col1) values('-'); +ERROR HY000: Incorrect integer value: '-' for column 'col1' at row 1 +insert into t1(col2) values('+'); +ERROR HY000: Incorrect integer value: '+' for column 'col2' at row 1 +insert into t1(col3) values('-'); +ERROR HY000: Incorrect integer value: '-' for column 'col3' at row 1 +insert into t1(col4) values('+'); +ERROR HY000: Incorrect integer value: '+' for column 'col4' at row 1 +insert into t1(col5) values('-'); +ERROR HY000: Incorrect integer value: '-' for column 'col5' at row 1 +insert into t1(col6) values('+'); +ERROR HY000: Incorrect integer value: '+' for column 'col6' at row 1 +insert into t1(col7) values('-'); +ERROR HY000: Incorrect integer value: '-' for column 'col7' at row 1 +insert into t1(col8) values('+'); +ERROR HY000: Incorrect integer value: '+' for column 'col8' at row 1 +insert into t1(col9) values('-'); +ERROR HY000: Incorrect integer value: '-' for column 'col9' at row 1 +insert into t1(col10) values('+'); +ERROR HY000: Incorrect integer value: '+' for column 'col10' at row 1 +drop table t1; +set sql_mode='traditional'; +create table t1(a year); +insert into t1 values ('-'); +ERROR HY000: Incorrect integer value: '-' for column 'a' at row 1 +insert into t1 values ('+'); +ERROR HY000: Incorrect integer value: '+' for column 'a' at row 1 +insert into t1 values (''); +ERROR HY000: Incorrect integer value: '' for column 'a' at row 1 +insert into t1 values ('2000a'); +ERROR 01000: Data truncated for column 'a' at row 1 +insert into t1 values ('2E3x'); +ERROR 01000: Data truncated for column 'a' at row 1 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index ed15293bb45..644d4d971c6 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -99,7 +99,7 @@ DROP TABLE t1, t2, t3; CREATE TABLE t1 (y YEAR); INSERT INTO t1 VALUES ('abc'); Warnings: -Warning 1264 Out of range value adjusted for column 'y' at row 1 +Warning 1366 Incorrect integer value: 'abc' for column 'y' at row 1 SELECT * FROM t1; y 0000 diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 84b688429db..e52947455c8 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -34,3 +34,15 @@ select if(y = now(), 1, 0) from t1; if(y = now(), 1, 0) 1 drop table t1; +create table t1(a year); +insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 3 +select * from t1; +a +2001 +2001 +2001 +2001 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 224a7422de1..53b3bc03ff7 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -1208,3 +1208,53 @@ create table t1 (i int) comment '123456789*123456789*123456789*123456789*123456789*123456789*'; show create table t1; drop table t1; + +# +# Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode +# +set sql_mode= 'traditional'; +create table t1(col1 tinyint, col2 tinyint unsigned, + col3 smallint, col4 smallint unsigned, + col5 mediumint, col6 mediumint unsigned, + col7 int, col8 int unsigned, + col9 bigint, col10 bigint unsigned); +--error 1366 +insert into t1(col1) values('-'); +--error 1366 +insert into t1(col2) values('+'); +--error 1366 +insert into t1(col3) values('-'); +--error 1366 +insert into t1(col4) values('+'); +--error 1366 +insert into t1(col5) values('-'); +--error 1366 +insert into t1(col6) values('+'); +--error 1366 +insert into t1(col7) values('-'); +--error 1366 +insert into t1(col8) values('+'); +--error 1366 +insert into t1(col9) values('-'); +--error 1366 +insert into t1(col10) values('+'); +drop table t1; + +# +# Bug #27176: Assigning a string to an year column has unexpected results +# +set sql_mode='traditional'; +create table t1(a year); +--error 1366 +insert into t1 values ('-'); +--error 1366 +insert into t1 values ('+'); +--error 1366 +insert into t1 values (''); +--error 1265 +insert into t1 values ('2000a'); +--error 1265 +insert into t1 values ('2E3x'); +drop table t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index 9744da24c02..0e174a556d6 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -21,4 +21,12 @@ insert into t1 values (now()); select if(y = now(), 1, 0) from t1; drop table t1; -# End of 4.1 tests +# +# Bug #27176: Assigning a string to an year column has unexpected results +# +create table t1(a year); +insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3'); +select * from t1; +drop table t1; + +--echo End of 5.0 tests diff --git a/sql/field.cc b/sql/field.cc index a95d0069985..352f08e40ce 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -963,6 +963,31 @@ static Item_result field_types_result_type [FIELDTYPE_NUM]= }; +/* + Test if the given string contains important data: + not spaces for character string, + or any data for binary string. + + SYNOPSIS + test_if_important_data() + cs Character set + str String to test + strend String end + + RETURN + FALSE - If string does not have important data + TRUE - If string has some important data +*/ + +static bool +test_if_important_data(CHARSET_INFO *cs, const char *str, const char *strend) +{ + if (cs != &my_charset_bin) + str+= cs->cset->scan(cs, str, strend, MY_SEQ_SPACES); + return (str < strend); +} + + /* Detect Item_result by given field type of UNION merge result @@ -1051,65 +1076,114 @@ void Field_num::prepend_zeros(String *value) } /* - Test if given number is a int (or a fixed format float with .000) + Test if given number is a int. SYNOPSIS - test_if_int() + Field_num::check_int + cs Character set str String to test end Pointer to char after last used digit - cs Character set + length String length + error Error returned by strntoull10rnd() - NOTES - This is called after one has called my_strntol() or similar function. - This is only used to give warnings in ALTER TABLE or LOAD DATA... - - TODO - Make this multi-byte-character safe + NOTE + This is called after one has called strntoull10rnd() function. RETURN - 0 OK - 1 error. A warning is pushed if field_name != 0 + 0 ok + 1 error: empty string or wrong integer. + 2 error: garbage at the end of string. */ -bool Field::check_int(const char *str, int length, const char *int_end, - CHARSET_INFO *cs) +int Field_num::check_int(CHARSET_INFO *cs, const char *str, int length, + const char *int_end, int error) { - const char *end; - if (str == int_end) + /* Test if we get an empty string or wrong integer */ + if (str == int_end || error == MY_ERRNO_EDOM) { char buff[128]; - String tmp(buff,(uint32) sizeof(buff), system_charset_info); + String tmp(buff, (uint32) sizeof(buff), system_charset_info); tmp.copy(str, length, system_charset_info); push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN, ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), "integer", tmp.c_ptr(), field_name, (ulong) table->in_use->row_count); - return 1; // Empty string + return 1; } - end= str+length; - if ((str= int_end) == end) - return 0; // OK; All digits was used - - /* Allow end .0000 */ - if (*str == '.') + /* Test if we have garbage at the end of the given string. */ + if (test_if_important_data(cs, int_end, str + length)) { - for (str++ ; str != end && *str == '0'; str++) - ; - } - /* Allow end space */ - for ( ; str != end ; str++) - { - if (!my_isspace(cs,*str)) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); - return 1; - } + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); + return 2; } return 0; } +/* + Conver a string to an integer then check bounds. + + SYNOPSIS + Field_num::get_int + cs Character set + from String to convert + len Length of the string + rnd OUT longlong value + unsigned_max max unsigned value + signed_min min signed value + signed_max max signed value + + DESCRIPTION + The function calls strntoull10rnd() to get an integer value then + check bounds and errors returned. In case of any error a warning + is raised. + + RETURN + 0 ok + 1 error +*/ + +bool Field_num::get_int(CHARSET_INFO *cs, const char *from, uint len, + longlong *rnd, ulonglong unsigned_max, + longlong signed_min, longlong signed_max) +{ + char *end; + int error; + + *rnd= (longlong) cs->cset->strntoull10rnd(cs, from, len, unsigned_flag, &end, + &error); + if (unsigned_flag) + { + + if (((ulonglong) *rnd > unsigned_max) && (*rnd= (longlong) unsigned_max) || + error == MY_ERRNO_ERANGE) + { + goto out_of_range; + } + } + else + { + if (*rnd < signed_min) + { + *rnd= signed_min; + goto out_of_range; + } + else if (*rnd > signed_max) + { + *rnd= signed_max; + goto out_of_range; + } + } + if (table->in_use->count_cuted_fields && check_int(cs, from, len, end, error)) + return 1; + return 0; + +out_of_range: + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + return 1; +} + /* Process decimal library return codes and issue warnings for overflow and truncation. @@ -2505,45 +2579,11 @@ void Field_new_decimal::sql_type(String &str) const int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs) { - char *end; int error; - - if (unsigned_flag) - { - ulonglong tmp= cs->cset->strntoull10rnd(cs, from, len, 1, &end, &error); - if (error == MY_ERRNO_ERANGE || tmp > 255) - { - set_if_smaller(tmp, 255); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; - ptr[0]= (char) tmp; - } - else - { - longlong tmp= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error); - if (tmp < -128) - { - tmp= -128; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (tmp >= 128) - { - tmp= 127; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; - ptr[0]= (char) tmp; - } + longlong rnd; + + error= get_int(cs, from, len, &rnd, 255, -128, 127); + ptr[0]= unsigned_flag ? (char) (ulonglong) rnd : (char) rnd; return error; } @@ -2708,59 +2748,20 @@ void Field_tiny::sql_type(String &res) const int Field_short::store(const char *from,uint len,CHARSET_INFO *cs) { - char *end; + int store_tmp; int error; - - if (unsigned_flag) - { - ulonglong tmp= cs->cset->strntoull10rnd(cs, from, len, 1, &end, &error); - if (error == MY_ERRNO_ERANGE || tmp > UINT_MAX16) - { - set_if_smaller(tmp, UINT_MAX16); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; + longlong rnd; + + error= get_int(cs, from, len, &rnd, UINT_MAX16, INT_MIN16, INT_MAX16); + store_tmp= unsigned_flag ? (int) (ulonglong) rnd : (int) rnd; #ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) - { - int2store(ptr,tmp); - } - else -#endif - shortstore(ptr,(short) tmp); + if (table->s->db_low_byte_first) + { + int2store(ptr, store_tmp); } else - { - longlong tmp= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error); - if (tmp < INT_MIN16) - { - tmp= INT_MIN16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (tmp > INT_MAX16) - { - tmp=INT_MAX16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; -#ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) - { - int2store(ptr,tmp); - } - else #endif - shortstore(ptr,(short) tmp); - } + shortstore(ptr, (short) store_tmp); return error; } @@ -2988,45 +2989,13 @@ void Field_short::sql_type(String &res) const int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs) { - char *end; + int store_tmp; int error; - - if (unsigned_flag) - { - ulonglong tmp= cs->cset->strntoull10rnd(cs, from, len, 1, &end, &error); - if (error == MY_ERRNO_ERANGE || tmp > UINT_MAX24) - { - set_if_smaller(tmp, UINT_MAX24); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; - int3store(ptr,tmp); - } - else - { - longlong tmp= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error); - if (tmp < INT_MIN24) - { - tmp= INT_MIN24; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (tmp > INT_MAX24) - { - tmp=INT_MAX24; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; - int3store(ptr,tmp); - } + longlong rnd; + + error= get_int(cs, from, len, &rnd, UINT_MAX24, INT_MIN24, INT_MAX24); + store_tmp= unsigned_flag ? (int) (ulonglong) rnd : (int) rnd; + int3store(ptr, store_tmp); return error; } @@ -3205,45 +3174,10 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) { long store_tmp; int error; - char *end; - - if (unsigned_flag) - { - ulonglong tmp= cs->cset->strntoull10rnd(cs, from, len, 1, &end, &error); - if (error == MY_ERRNO_ERANGE || tmp > (ulonglong) UINT_MAX32) - { - set_if_smaller(tmp, (ulonglong) UINT_MAX32); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; - store_tmp= (long) tmp; - } - else - { - longlong tmp= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error); - if (tmp < INT_MIN32) - { - tmp= INT_MIN32; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (tmp > INT_MAX32) - { - tmp=INT_MAX32; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) - error= 1; - else - error= 0; - store_tmp= (long) tmp; - } - + longlong rnd; + + error= get_int(cs, from, len, &rnd, UINT_MAX32, INT_MIN32, INT_MAX32); + store_tmp= unsigned_flag ? (long) (ulonglong) rnd : (long) rnd; #ifdef WORDS_BIGENDIAN if (table->s->db_low_byte_first) { @@ -3489,7 +3423,8 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) + else if (table->in_use->count_cuted_fields && + check_int(cs, from, len, end, error)) error= 1; else error= 0; @@ -5007,16 +4942,25 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs) { char *end; int error; - long nr= my_strntol(cs, from, len, 10, &end, &error); + longlong nr= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error); - if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155 || error) + if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155 || + error == MY_ERRNO_ERANGE) { *ptr=0; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } - if (table->in_use->count_cuted_fields && check_int(from,len,end,cs)) + if (table->in_use->count_cuted_fields && + (error= check_int(cs, from, len, end, error))) + { + if (error == 1) /* empty or incorrect string */ + { + *ptr= 0; + return 1; + } error= 1; + } if (nr != 0 || len != 4) { @@ -5906,31 +5850,6 @@ report_data_too_long(Field_str *field) } -/* - Test if the given string contains important data: - not spaces for character string, - or any data for binary string. - - SYNOPSIS - test_if_important_data() - cs Character set - str String to test - strend String end - - RETURN - FALSE - If string does not have important data - TRUE - If string has some important data -*/ - -static bool -test_if_important_data(CHARSET_INFO *cs, const char *str, const char *strend) -{ - if (cs != &my_charset_bin) - str+= cs->cset->scan(cs, str, strend, MY_SEQ_SPACES); - return (str < strend); -} - - /* Copy a string and fill with space */ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) diff --git a/sql/field.h b/sql/field.h index 524380800f3..32553573433 100644 --- a/sql/field.h +++ b/sql/field.h @@ -306,8 +306,6 @@ public: virtual void set_derivation(enum Derivation derivation_arg) { } bool set_warning(MYSQL_ERROR::enum_warning_level, unsigned int code, int cuted_increment); - bool check_int(const char *str, int length, const char *int_end, - CHARSET_INFO *cs); void set_datetime_warning(MYSQL_ERROR::enum_warning_level, uint code, const char *str, uint str_len, timestamp_type ts_type, int cuted_increment); @@ -369,6 +367,11 @@ public: bool eq_def(Field *field); int store_decimal(const my_decimal *); my_decimal *val_decimal(my_decimal *); + int check_int(CHARSET_INFO *cs, const char *str, int length, + const char *int_end, int error); + bool get_int(CHARSET_INFO *cs, const char *from, uint len, + longlong *rnd, ulonglong unsigned_max, + longlong signed_min, longlong signed_max); }; From 3832b71b994714a45616cd8860a899a151d32697 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 22:41:21 -0600 Subject: [PATCH 447/789] Apply innodb-5.0-ss1372 snapshot Bug #27381: InnoDB exits when attempting to rename table to non-existant database Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of os_file_handle_error(). innobase/dict/dict0dict.c: Apply innodb-5.0-ss1372 snapshot Revision r1351: branches/5.0: Merge r1350 from trunk: Lock the data dictionary during rollback. This removes the rare debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in dict_table_get_on_id() after the rollback following crash recovery. innobase/os/os0file.c: Apply innodb-5.0-ss1372 snapshot Revision r1354: branches/5.0: Merge r1352 from trunk: (also make indentation the same as in 5.1 to ease further merges) Fix typo in comment in os/os0file.c Revision r1370: branches/5.0: Merge r1366 from trunk: Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of os_file_handle_error(). innobase/row/row0undo.c: Apply innodb-5.0-ss1372 snapshot Revision r1351: branches/5.0: Merge r1350 from trunk: Lock the data dictionary during rollback. This removes the rare debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in dict_table_get_on_id() after the rollback following crash recovery. --- innobase/dict/dict0dict.c | 3 ++- innobase/os/os0file.c | 20 ++++++++++---------- innobase/row/row0undo.c | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 33aebb25071..96c822857df 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -628,7 +628,8 @@ dict_table_get_on_id( CREATE, for example, we already have the mutex! */ #ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&(dict_sys->mutex))); + ut_ad(mutex_own(&(dict_sys->mutex)) + || trx->dict_operation_lock_mode == RW_X_LATCH); #endif /* UNIV_SYNC_DEBUG */ return(dict_table_get_on_id_low(table_id, trx)); diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 5e5c4b19eb0..72f1f837fee 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -920,14 +920,14 @@ try_again: } file = CreateFile((LPCTSTR) name, - access, - FILE_SHARE_READ | FILE_SHARE_WRITE, - /* file can be read ansd written also - by other processes */ - NULL, /* default security attributes */ - create_flag, - attributes, - NULL); /* no template file */ + access, + FILE_SHARE_READ | FILE_SHARE_WRITE, + /* file can be read and written also + by other processes */ + NULL, /* default security attributes */ + create_flag, + attributes, + NULL); /* no template file */ if (file == INVALID_HANDLE_VALUE) { *success = FALSE; @@ -1494,7 +1494,7 @@ os_file_rename( return(TRUE); } - os_file_handle_error(oldpath, "rename"); + os_file_handle_error_no_exit(oldpath, "rename"); return(FALSE); #else @@ -1503,7 +1503,7 @@ os_file_rename( ret = rename((const char*)oldpath, (const char*)newpath); if (ret != 0) { - os_file_handle_error(oldpath, "rename"); + os_file_handle_error_no_exit(oldpath, "rename"); return(FALSE); } diff --git a/innobase/row/row0undo.c b/innobase/row/row0undo.c index 435c0279dbb..c9727e0098e 100644 --- a/innobase/row/row0undo.c +++ b/innobase/row/row0undo.c @@ -212,7 +212,7 @@ row_undo( ulint err; trx_t* trx; dulint roll_ptr; - ibool froze_data_dict = FALSE; + ibool locked_data_dict; ut_ad(node && thr); @@ -263,15 +263,15 @@ row_undo( } /* Prevent DROP TABLE etc. while we are rolling back this row. - If we are doing a TABLE CREATE or some other dictionary operation, - then we already have dict_operation_lock locked in x-mode. Do not - try to lock again in s-mode, because that would cause a hang. */ + If we are doing a TABLE CREATE or some other dictionary operation, + then we already have dict_operation_lock locked in x-mode. Do not + try to lock again, because that would cause a hang. */ - if (trx->dict_operation_lock_mode == 0) { - - row_mysql_freeze_data_dictionary(trx); + locked_data_dict = (trx->dict_operation_lock_mode == 0); - froze_data_dict = TRUE; + if (locked_data_dict) { + + row_mysql_lock_data_dictionary(trx); } if (node->state == UNDO_NODE_INSERT) { @@ -284,9 +284,9 @@ row_undo( err = row_undo_mod(node, thr); } - if (froze_data_dict) { + if (locked_data_dict) { - row_mysql_unfreeze_data_dictionary(trx); + row_mysql_unlock_data_dictionary(trx); } /* Do some cleanup */ From f3009f3f061a4177255111c1f853dd814aea7bdd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 22:46:28 -0600 Subject: [PATCH 448/789] Applied innodb-5.1-ss1381 snapshot Bug #27381: InnoDB exits when attempting to rename table to non-existant database Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of os_file_handle_error(). mysql-test/t/innodb.test: Applied innodb-5.1-ss1381 snapshot Revision r1373: Port r1372 from branches/5.0: Merge a change from MySQL AB, and remove the innodb_gis test case. ChangeSet 2007/02/19 13:57:06+03:00 kaa@polly.local Bug#18743: Several test cases fails if "classic" configuration in 5.0 The problem happened because those tests were using "cp932" and "ucs2" without checking whether these character sets are available. This fix moves test parts to make character set specific parts be tested only if they are: - some parts were moved to "ctype_ucs.test" and "ctype_cp932.test" - some parts were moved to the newly added tests "innodb-ucs2.test", "mysqlbinglog-cp932.test" and "sp-ucs2.test" mysql-test/t/innodb.test 2007/02/19 13:57:02+03:00 kaa@polly.local +0 -222 Moved ucs2-specific test cases to innodb-ucs2.test storage/innobase/Makefile.am: Applied innodb-5.1-ss1381 snapshot Revision r1353: Makefile.am: EXTRA_DIST: Add the grammar source files to the source distribution of MySQL. storage/innobase/dict/dict0dict.c: Applied innodb-5.1-ss1381 snapshot Revision r1350: Lock the data dictionary during rollback. This removes the rare debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in dict_table_get_on_id() after the rollback following crash recovery. storage/innobase/handler/ha_innodb.cc: Applied innodb-5.1-ss1381 snapshot Revision r1377: Add static qualifiers to some symbols in ha_innodb.cc that are not referenced from other modules. Revision r1380: Remove ha_innobase::last_query_id and references to thd->query_id. MySQL calls external_lock at the beginning and end of a statement when it is not calling start_stmt or commit or rollback. Thus, statement boundaries can be (and are already) detected without monitoring thd->query_id. The function innobase_commit() seemingly lacks the call to innobase_release_stat_resources(), which should be called at the end of every SQL statement. The call was replaced by equivalent statements by Vadim Tkachenko when he implemented innodb_commit_concurrency in MySQL 5.0: http://mysql.bkbits.net:8080/mysql-5.0/?PAGE=patch&REV=1.1886.70.1 Revision r1355: class ha_innobase: Replace statistic_increment() with ha_statistic_increment(). ha_innobase::change_active_index(): Do not call current_thd unless UNIV_DEBUG is defined. Revision r1369: Merge a change from MySQL AB: ChangeSet@1.2409.1.83 2007-03-06 10:36:15-07:00 tsmith@hindu.god Bug #26598: Create variable to allow turning off of statistic gathering on metadata commands Add innodb_stats_on_metadata option, which enables gathering index statistics when processing metadata commands such as SHOW TABLE STATUS. Default behavior of the server does not change (this option is enabled by default). Revision r1342: Minor cleanup in ha_innodb.cc. Remove the unused constants HA_INNOBASE_ROWS_IN_TABLE and HA_INNOBASE_RANGE_COUNT. Declare innobase_active_counter static. Revision r1381: innobase_commit(): Correct the comments and formatting that were broken when innodb_commit_concurrency was implemented. Revision r1360: Minor cleanup. innobase_query_caching_of_table_permitted(): Make static. ha_innobase::register_query_cache_table(): Move the function definition from ha_innodb.h to ha_innodb.cc. Add comments. storage/innobase/handler/ha_innodb.h: Applied innodb-5.1-ss1381 snapshot Revision r1377: Add static qualifiers to some symbols in ha_innodb.cc that are not referenced from other modules. Revision r1380: Remove ha_innobase::last_query_id and references to thd->query_id. MySQL calls external_lock at the beginning and end of a statement when it is not calling start_stmt or commit or rollback. Thus, statement boundaries can be (and are already) detected without monitoring thd->query_id. The function innobase_commit() seemingly lacks the call to innobase_release_stat_resources(), which should be called at the end of every SQL statement. The call was replaced by equivalent statements by Vadim Tkachenko when he implemented innodb_commit_concurrency in MySQL 5.0: http://mysql.bkbits.net:8080/mysql-5.0/?PAGE=patch&REV=1.1886.70.1 Revision r1369: Merge a change from MySQL AB: ChangeSet@1.2409.1.83 2007-03-06 10:36:15-07:00 tsmith@hindu.god Bug #26598: Create variable to allow turning off of statistic gathering on metadata commands Add innodb_stats_on_metadata option, which enables gathering index statistics when processing metadata commands such as SHOW TABLE STATUS. Default behavior of the server does not change (this option is enabled by default). Revision r1360: Minor cleanup. innobase_query_caching_of_table_permitted(): Make static. ha_innobase::register_query_cache_table(): Move the function definition from ha_innodb.h to ha_innodb.cc. Add comments. storage/innobase/include/trx0trx.h: Applied innodb-5.1-ss1381 snapshot Revision r1344: Rename the Boolean field trx->type to trx->is_purge and remove the constants TRX_USER and TRX_PURGE. Revision r1343: trx_sig_struct: Remove state. It is always assigned to TRX_SIG_WAITING and never tested. storage/innobase/os/os0file.c: Applied innodb-5.1-ss1381 snapshot Revision r1352: Fix typo in comment in os/os0file.c Approved by: heikki Revision r1366: Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of os_file_handle_error(). Approved by: Heikki storage/innobase/row/row0undo.c: Applied innodb-5.1-ss1381 snapshot Revision r1350: Lock the data dictionary during rollback. This removes the rare debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in dict_table_get_on_id() after the rollback following crash recovery. storage/innobase/trx/trx0purge.c: Applied innodb-5.1-ss1381 snapshot Revision r1344: Rename the Boolean field trx->type to trx->is_purge and remove the constants TRX_USER and TRX_PURGE. storage/innobase/trx/trx0trx.c: Applied innodb-5.1-ss1381 snapshot Revision r1344: Rename the Boolean field trx->type to trx->is_purge and remove the constants TRX_USER and TRX_PURGE. Revision r1343: trx_sig_struct: Remove state. It is always assigned to TRX_SIG_WAITING and never tested. --- mysql-test/t/innodb.test | 1 - storage/innobase/Makefile.am | 2 + storage/innobase/dict/dict0dict.c | 3 +- storage/innobase/handler/ha_innodb.cc | 156 ++++++++++---------------- storage/innobase/handler/ha_innodb.h | 16 +-- storage/innobase/include/trx0trx.h | 13 +-- storage/innobase/os/os0file.c | 6 +- storage/innobase/row/row0undo.c | 14 +-- storage/innobase/trx/trx0purge.c | 2 +- storage/innobase/trx/trx0trx.c | 7 +- 10 files changed, 82 insertions(+), 138 deletions(-) diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index c4b8491b39d..75f2796abc6 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1810,7 +1810,6 @@ select a,hex(s1) from t1; select hex(s1) from t2; drop table t2,t1; - # Ensure that _ibfk_0 is not mistreated as a # generated foreign key identifier. (Bug #16387) diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am index f433604f9d4..d694d1ab811 100644 --- a/storage/innobase/Makefile.am +++ b/storage/innobase/Makefile.am @@ -89,6 +89,8 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \ include/ut0list.h include/ut0list.ic \ include/ut0wqueue.h \ + pars/make_bison.sh pars/make_flex.sh \ + pars/pars0grm.y pars/pars0lex.l CMakeLists.txt plug.in noinst_LIBRARIES = libinnobase.a diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index e07d84a1ee0..f450d3553eb 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -689,7 +689,8 @@ dict_table_get_on_id( if we are doing a rollback to handle an error in TABLE CREATE, for example, we already have the mutex! */ - ut_ad(mutex_own(&(dict_sys->mutex))); + ut_ad(mutex_own(&(dict_sys->mutex)) + || trx->dict_operation_lock_mode == RW_X_LATCH); return(dict_table_get_on_id_low(table_id)); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2d8f3eb0ef9..5faefe83a85 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -92,9 +92,6 @@ extern "C" { #include "../storage/innobase/include/ha_prototypes.h" } -#define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */ -#define HA_INNOBASE_RANGE_COUNT 100 - ulong innobase_large_page_size = 0; /* The default values for the following, type long or longlong, start-up @@ -142,7 +139,7 @@ srv_active_wake_master_thread after each fetch or search, we only do it every INNOBASE_WAKE_INTERVAL'th step. */ #define INNOBASE_WAKE_INTERVAL 32 -ulong innobase_active_counter = 0; +static ulong innobase_active_counter = 0; static HASH innobase_open_tables; @@ -311,13 +308,13 @@ bool innobase_show_status(handlerton *hton, THD* thd, /********************************************************************* Commits a transaction in an InnoDB database. */ - +static void innobase_commit_low( /*================*/ trx_t* trx); /* in: transaction handle */ -SHOW_VAR innodb_status_variables[]= { +static SHOW_VAR innodb_status_variables[]= { {"buffer_pool_pages_data", (char*) &export_vars.innodb_buffer_pool_pages_data, SHOW_LONG}, {"buffer_pool_pages_dirty", @@ -1140,7 +1137,7 @@ holding any InnoDB semaphores. The calling thread is holding the query cache mutex, and this function will reserver the InnoDB kernel mutex. Thus, the 'rank' in sync0sync.h of the MySQL query cache mutex is above the InnoDB kernel mutex. */ - +static my_bool innobase_query_caching_of_table_permitted( /*======================================*/ @@ -1765,7 +1762,7 @@ innobase_flush_logs(handlerton *hton) /********************************************************************* Commits a transaction in an InnoDB database. */ - +static void innobase_commit_low( /*================*/ @@ -1849,12 +1846,11 @@ innobase_commit( /* Update the info whether we should skip XA steps that eat CPU time */ trx->support_xa = (ibool)(thd->variables.innodb_support_xa); - /* Release a possible FIFO ticket and search latch. Since we will - reserve the kernel mutex, we have to release the search system latch - first to obey the latching order. */ + /* Since we will reserve the kernel mutex, we have to release + the search system latch first to obey the latching order. */ if (trx->has_search_latch) { - trx_search_latch_release_if_reserved(trx); + trx_search_latch_release_if_reserved(trx); } /* The flag trx->active_trans is set to 1 in @@ -1941,18 +1937,20 @@ retry: trx_mark_sql_stat_end(trx); } + if (trx->declared_to_be_inside_innodb) { + /* Release our possible ticket in the FIFO */ + + srv_conc_force_exit_innodb(trx); + } + /* Tell the InnoDB server that there might be work for utility threads: */ - if (trx->declared_to_be_inside_innodb) { - /* Release our possible ticket in the FIFO */ - - srv_conc_force_exit_innodb(trx); - } srv_active_wake_master_thread(); DBUG_RETURN(0); } +#if 0 /* TODO: put the MySQL-4.1 functionality back to 5.0. This is needed to get InnoDB Hot Backup to work. */ @@ -1965,7 +1963,7 @@ transaction inside InnoDB but does NOT flush InnoDB log files to disk. To flush you have to call innobase_commit_complete(). We have separated flushing to eliminate the bottleneck of LOCK_log in log.cc which disabled InnoDB's group commit capability. */ - +static int innobase_report_binlog_offset_and_commit( /*=====================================*/ @@ -1995,7 +1993,6 @@ innobase_report_binlog_offset_and_commit( return(0); } -#if 0 /*********************************************************************** This function stores the binlog offset and flushes logs. */ static @@ -2026,12 +2023,11 @@ innobase_store_binlog_offset_and_flush_log( /* Synchronous flush of the log buffer to disk */ log_buffer_flush_to_disk(); } -#endif /********************************************************************* This is called after MySQL has written the binlog entry for the current transaction. Flushes the InnoDB log files to disk if required. */ - +static int innobase_commit_complete( /*=====================*/ @@ -2057,6 +2053,7 @@ innobase_commit_complete( return(0); } +#endif /********************************************************************* Rolls back a transaction or the latest SQL statement. */ @@ -2110,7 +2107,7 @@ innobase_rollback( /********************************************************************* Rolls back a transaction */ - +static int innobase_rollback_trx( /*==================*/ @@ -2405,8 +2402,6 @@ ha_innobase::open( user_thd = NULL; - last_query_id = (ulong)-1; - if (!(share=get_share(name))) { DBUG_RETURN(1); @@ -3374,8 +3369,7 @@ ha_innobase::write_row( ut_error; } - statistic_increment(thd->status_var.ha_write_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_write_count); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); @@ -3450,13 +3444,6 @@ no_commit: num_write_row++; - if (last_query_id != user_thd->query_id) { - prebuilt->sql_stat_start = TRUE; - last_query_id = user_thd->query_id; - - innobase_release_stat_resources(prebuilt->trx); - } - if (table->next_number_field && record == table->record[0]) { /* This is the case where the table has an auto-increment column */ @@ -3611,13 +3598,6 @@ calc_row_difference( for (i = 0; i < n_fields; i++) { field = table->field[i]; - /* if (thd->query_id != field->query_id) { */ - /* TODO: check that these fields cannot have - changed! */ - - /* goto skip_field; - }*/ - o_ptr = (byte*) old_row + get_field_offset(table, field); n_ptr = (byte*) new_row + get_field_offset(table, field); @@ -3749,13 +3729,6 @@ ha_innobase::update_row( if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); - if (last_query_id != user_thd->query_id) { - prebuilt->sql_stat_start = TRUE; - last_query_id = user_thd->query_id; - - innobase_release_stat_resources(trx); - } - if (prebuilt->upd_node) { uvect = prebuilt->upd_node->update; } else { @@ -3806,13 +3779,6 @@ ha_innobase::delete_row( ut_a(prebuilt->trx == trx); - if (last_query_id != user_thd->query_id) { - prebuilt->sql_stat_start = TRUE; - last_query_id = user_thd->query_id; - - innobase_release_stat_resources(trx); - } - if (!prebuilt->upd_node) { row_get_prebuilt_update_vector(prebuilt); } @@ -3848,15 +3814,6 @@ ha_innobase::unlock_row(void) { DBUG_ENTER("ha_innobase::unlock_row"); - if (UNIV_UNLIKELY(last_query_id != user_thd->query_id)) { - ut_print_timestamp(stderr); - sql_print_error("last_query_id is %lu != user_thd_query_id is " - "%lu", (ulong) last_query_id, - (ulong) user_thd->query_id); - mem_analyze_corruption(prebuilt->trx); - ut_error; - } - /* Consistent read does not take any locks, thus there is nothing to unlock. */ @@ -4062,15 +4019,7 @@ ha_innobase::index_read( ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); - statistic_increment(current_thd->status_var.ha_read_key_count, - &LOCK_status); - - if (last_query_id != user_thd->query_id) { - prebuilt->sql_stat_start = TRUE; - last_query_id = user_thd->query_id; - - innobase_release_stat_resources(prebuilt->trx); - } + ha_statistic_increment(&SSV::ha_read_key_count); index = prebuilt->index; @@ -4168,12 +4117,11 @@ ha_innobase::change_active_index( InnoDB */ { KEY* key=0; - THD* thd = current_thd; - statistic_increment(thd->status_var.ha_read_key_count, &LOCK_status); + ha_statistic_increment(&SSV::ha_read_key_count); DBUG_ENTER("change_active_index"); - ut_ad(user_thd == thd); - ut_a(prebuilt->trx == thd_to_trx(thd, ht)); + ut_ad(user_thd == current_thd); + ut_a(prebuilt->trx == thd_to_trx(user_thd, ht)); active_index = keynr; @@ -4300,8 +4248,7 @@ ha_innobase::index_next( mysql_byte* buf) /* in/out: buffer for next row in MySQL format */ { - statistic_increment(current_thd->status_var.ha_read_next_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_next_count); return(general_fetch(buf, ROW_SEL_NEXT, 0)); } @@ -4318,8 +4265,7 @@ ha_innobase::index_next_same( const mysql_byte* key, /* in: key value */ uint keylen) /* in: key value length */ { - statistic_increment(current_thd->status_var.ha_read_next_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_next_count); return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode)); } @@ -4336,8 +4282,7 @@ ha_innobase::index_prev( mysql_byte* buf) /* in/out: buffer for previous row in MySQL format */ { - statistic_increment(current_thd->status_var.ha_read_prev_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_prev_count); return(general_fetch(buf, ROW_SEL_PREV, 0)); } @@ -4356,8 +4301,7 @@ ha_innobase::index_first( int error; DBUG_ENTER("index_first"); - statistic_increment(current_thd->status_var.ha_read_first_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_first_count); error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY); @@ -4383,8 +4327,7 @@ ha_innobase::index_last( int error; DBUG_ENTER("index_last"); - statistic_increment(current_thd->status_var.ha_read_last_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_last_count); error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY); @@ -4454,8 +4397,7 @@ ha_innobase::rnd_next( int error; DBUG_ENTER("rnd_next"); - statistic_increment(current_thd->status_var.ha_read_rnd_next_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_rnd_next_count); if (start_of_scan) { error = index_first(buf); @@ -4490,8 +4432,7 @@ ha_innobase::rnd_pos( DBUG_ENTER("rnd_pos"); DBUG_DUMP("key", (char*) pos, ref_length); - statistic_increment(current_thd->status_var.ha_read_rnd_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_rnd_count); ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); @@ -6534,7 +6475,7 @@ ha_innobase::transactional_table_lock( /**************************************************************************** Here we export InnoDB status variables to MySQL. */ - +static int innodb_export_status() /*==================*/ @@ -6640,7 +6581,7 @@ innodb_show_status( /**************************************************************************** Implements the SHOW MUTEX STATUS command. . */ - +static bool innodb_mutex_show_status( /*=====================*/ @@ -7325,6 +7266,33 @@ ha_innobase::cmp_ref( return(0); } +/*********************************************************************** +Ask InnoDB if a query to a table can be cached. */ + +my_bool +ha_innobase::register_query_cache_table( +/*====================================*/ + /* out: TRUE if query caching + of the table is permitted */ + THD* thd, /* in: user thread handle */ + char* table_key, /* in: concatenation of database name, + the null character '\0', + and the table name */ + uint key_length, /* in: length of the full name, i.e. + len(dbname) + len(tablename) + 1 */ + qc_engine_callback* + call_back, /* out: pointer to function for + checking if query caching + is permitted */ + ulonglong *engine_data) /* in/out: data to call_back */ +{ + *call_back = innobase_query_caching_of_table_permitted; + *engine_data = 0; + return(innobase_query_caching_of_table_permitted(thd, table_key, + key_length, + engine_data)); +} + char* ha_innobase::get_mysql_bin_log_name() { @@ -7702,12 +7670,12 @@ static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff) return 0; } -SHOW_VAR innodb_status_variables_export[]= { +static SHOW_VAR innodb_status_variables_export[]= { {"Innodb", (char*) &show_innodb_vars, SHOW_FUNC}, {NullS, NullS, SHOW_LONG} }; -struct st_mysql_storage_engine innobase_storage_engine= +static struct st_mysql_storage_engine innobase_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; mysql_declare_plugin(innobase) diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index eb977ed6bd5..f5df362b490 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -35,10 +35,6 @@ typedef struct st_innobase_share { struct row_prebuilt_struct; typedef struct row_prebuilt_struct row_prebuilt_t; -my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name, - uint full_name_len, - ulonglong *unused); - /* The class defining a handle to an Innodb table */ class ha_innobase: public handler { @@ -48,8 +44,6 @@ class ha_innobase: public handler THD* user_thd; /* the thread handle of the user currently using the handle; this is set in external_lock function */ - query_id_t last_query_id; /* the latest query id where the - handle was used */ THR_LOCK_DATA lock; INNOBASE_SHARE *share; @@ -186,14 +180,7 @@ class ha_innobase: public handler my_bool register_query_cache_table(THD *thd, char *table_key, uint key_length, qc_engine_callback *call_back, - ulonglong *engine_data) - { - *call_back= innobase_query_caching_of_table_permitted; - *engine_data= 0; - return innobase_query_caching_of_table_permitted(thd, table_key, - key_length, - engine_data); - } + ulonglong *engine_data); static char *get_mysql_bin_log_name(); static ulonglong get_mysql_bin_log_pos(); bool primary_key_is_clustered() { return true; } @@ -202,7 +189,6 @@ class ha_innobase: public handler uint table_changes); }; -extern SHOW_VAR innodb_status_variables[]; extern ulong innobase_fast_shutdown; extern ulong innobase_large_page_size; extern long innobase_mirrored_log_groups, innobase_log_files_in_group; diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 8232699c7f9..fe36b0d1a01 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -375,8 +375,6 @@ trx_is_interrupted( /* Signal to a transaction */ struct trx_sig_struct{ ulint type; /* signal type */ - ulint state; /* TRX_SIG_WAITING or - TRX_SIG_BEING_HANDLED */ ulint sender; /* TRX_SIG_SELF or TRX_SIG_OTHER_SESS */ que_thr_t* receiver; /* non-NULL if the sender of the signal @@ -404,7 +402,7 @@ struct trx_struct{ const char* op_info; /* English text describing the current operation, or an empty string */ - ulint type; /* TRX_USER, TRX_PURGE */ + unsigned is_purge:1; /* 0=user transaction, 1=purge */ ulint conc_state; /* state of the trx from the point of view of concurrency control: TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY, @@ -675,12 +673,6 @@ struct trx_struct{ single operation of a transaction, e.g., a parallel query */ -/* Transaction types */ -#define TRX_USER 1 /* normal user transaction */ -#define TRX_PURGE 2 /* purge transaction: this is not - inserted to the trx list of trx_sys - and no rollback segment is assigned to - this */ /* Transaction concurrency states */ #define TRX_NOT_STARTED 1 #define TRX_ACTIVE 2 @@ -742,9 +734,6 @@ struct trx_struct{ session */ #define TRX_SIG_OTHER_SESS 2 /* sent by another session (which must hold rights to this) */ -/* Signal states */ -#define TRX_SIG_WAITING 1 -#define TRX_SIG_BEING_HANDLED 2 /* Commit command node in a query graph */ struct commit_node_struct{ diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c index c4d051ec771..60ba941dbbf 100644 --- a/storage/innobase/os/os0file.c +++ b/storage/innobase/os/os0file.c @@ -930,7 +930,7 @@ try_again: file = CreateFile((LPCTSTR) name, access, FILE_SHARE_READ | FILE_SHARE_WRITE, - /* file can be read ansd written also + /* file can be read and written also by other processes */ NULL, /* default security attributes */ create_flag, @@ -1509,7 +1509,7 @@ os_file_rename( return(TRUE); } - os_file_handle_error(oldpath, "rename"); + os_file_handle_error_no_exit(oldpath, "rename"); return(FALSE); #else @@ -1518,7 +1518,7 @@ os_file_rename( ret = rename((const char*)oldpath, (const char*)newpath); if (ret != 0) { - os_file_handle_error(oldpath, "rename"); + os_file_handle_error_no_exit(oldpath, "rename"); return(FALSE); } diff --git a/storage/innobase/row/row0undo.c b/storage/innobase/row/row0undo.c index 2f04e65e8ee..f03f84ed1b0 100644 --- a/storage/innobase/row/row0undo.c +++ b/storage/innobase/row/row0undo.c @@ -213,7 +213,7 @@ row_undo( ulint err; trx_t* trx; dulint roll_ptr; - ibool froze_data_dict = FALSE; + ibool locked_data_dict; ut_ad(node && thr); @@ -266,13 +266,13 @@ row_undo( /* Prevent DROP TABLE etc. while we are rolling back this row. If we are doing a TABLE CREATE or some other dictionary operation, then we already have dict_operation_lock locked in x-mode. Do not - try to lock again in s-mode, because that would cause a hang. */ + try to lock again, because that would cause a hang. */ - if (trx->dict_operation_lock_mode == 0) { + locked_data_dict = (trx->dict_operation_lock_mode == 0); - row_mysql_freeze_data_dictionary(trx); + if (locked_data_dict) { - froze_data_dict = TRUE; + row_mysql_lock_data_dictionary(trx); } if (node->state == UNDO_NODE_INSERT) { @@ -285,9 +285,9 @@ row_undo( err = row_undo_mod(node, thr); } - if (froze_data_dict) { + if (locked_data_dict) { - row_mysql_unfreeze_data_dictionary(trx); + row_mysql_unlock_data_dictionary(trx); } /* Do some cleanup */ diff --git a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c index 25519a09a1d..f0e85ef1604 100644 --- a/storage/innobase/trx/trx0purge.c +++ b/storage/innobase/trx/trx0purge.c @@ -221,7 +221,7 @@ trx_purge_sys_create(void) purge_sys->trx = purge_sys->sess->trx; - purge_sys->trx->type = TRX_PURGE; + purge_sys->trx->is_purge = 1; ut_a(trx_start_low(purge_sys->trx, ULINT_UNDEFINED)); diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index 2f0c25c323a..cdea3e9c477 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -109,7 +109,7 @@ trx_create( trx->op_info = ""; - trx->type = TRX_USER; + trx->is_purge = 0; trx->conc_state = TRX_NOT_STARTED; trx->start_time = time(NULL); @@ -667,7 +667,7 @@ trx_start_low( ut_ad(mutex_own(&kernel_mutex)); ut_ad(trx->rseg == NULL); - if (trx->type == TRX_PURGE) { + if (trx->is_purge) { trx->id = ut_dulint_zero; trx->conc_state = TRX_ACTIVE; trx->start_time = time(NULL); @@ -1262,7 +1262,6 @@ trx_sig_send( UT_LIST_ADD_LAST(signals, trx->signals, sig); sig->type = type; - sig->state = TRX_SIG_WAITING; sig->sender = sender; sig->receiver = receiver_thr; @@ -1709,7 +1708,7 @@ trx_print( fputs(trx->op_info, f); } - if (trx->type != TRX_USER) { + if (trx->is_purge) { fputs(" purge trx", f); } From ee0475bf5d5b9256d599aa6b9dcc641d4857d301 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 10:32:38 +0500 Subject: [PATCH 449/789] Code layout fix for bug N 27079 Thanks to Gluh for suggestion. --- strings/ctype-uca.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 3aad36f858c..1263882846d 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -6777,25 +6777,24 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, scanner->uca_length= cs->sort_order; scanner->uca_weight= cs->sort_order_big; scanner->contractions= cs->contractions; + return; } - else - { - /* - Sometimes this function is called with - str=NULL and length=0, which should be - considered as an empty string. + + /* + Sometimes this function is called with + str=NULL and length=0, which should be + considered as an empty string. + + The above initialization is unsafe for such cases, + because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE. + Then we fall into an endless loop in my_uca_scanner_next_ucs2(). - The above initialization is unsafe for such cases, - because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE. - Then we fall into an endless loop in my_uca_scanner_next_ucs2(). - - Do special initialization for the case when length=0. - Initialize scanner->sbeg to an address greater than scanner->send. - Next call of my_uca_scanner_next_ucs2() will correctly return with -1. - */ - scanner->sbeg= (uchar*) &nochar[1]; - scanner->send= (uchar*) &nochar[0]; - } + Do special initialization for the case when length=0. + Initialize scanner->sbeg to an address greater than scanner->send. + Next call of my_uca_scanner_next_ucs2() will correctly return with -1. + */ + scanner->sbeg= (uchar*) &nochar[1]; + scanner->send= (uchar*) &nochar[0]; } From 9b358f811b046ce5e188235d7e3d60424d5579e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 10:27:58 +0400 Subject: [PATCH 450/789] BUG#26624: high mem usage (crash) in range optimizer - Post-review fixes --- sql/opt_range.cc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 11ba6c0e465..ca8f31f5775 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -175,7 +175,7 @@ static char is_null_string[2]= {1,0}; Example: By induction: Let's take any interval on some keypart in the middle: - kp15=1 + kp15=c0 Then let's AND it with this interval 'structure' from preceding and following keyparts: @@ -184,18 +184,18 @@ static char is_null_string[2]= {1,0}; We will obtain this SEL_ARG graph: - kp14 $ kp15 $ kp16 - $ $ - +---------+ $ +--------+ $ +---------+ - | kp14=c1 |--$-->| kp15=1 |--$-->| kp16=c3 | - +---------+ $ +--------+ $ +---------+ - | $ $ - +---------+ $ +--------+ $ - | kp14=c2 |--$-->| kp15=1 | $ - +---------+ $ +--------+ $ - $ $ + kp14 $ kp15 $ kp16 + $ $ + +---------+ $ +---------+ $ +---------+ + | kp14=c1 |--$-->| kp15=c0 |--$-->| kp16=c3 | + +---------+ $ +---------+ $ +---------+ + | $ $ + +---------+ $ +---------+ $ + | kp14=c2 |--$-->| kp15=c0 | $ + +---------+ $ +---------+ $ + $ $ - Note that we had to duplicate "kp15=1" and there was no way to avoid + Note that we had to duplicate "kp15=c0" and there was no way to avoid that. The induction step: AND the obtained expression with another "wrapping" expression like (*). @@ -477,7 +477,7 @@ typedef struct st_qsel_param { max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH]; bool quick; // Don't calulate possible keys COND *cond; - /* Numbr of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */ + /* Number of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */ uint alloced_sel_args; } PARAM; @@ -681,7 +681,8 @@ SEL_ARG *SEL_ARG::clone(PARAM *param, SEL_ARG *new_parent, SEL_ARG **next_arg) tmp->parent=new_parent; tmp->next_key_part=next_key_part; if (left != &null_element) - tmp->left=left->clone(param, tmp, next_arg); + if (!(tmp->left=left->clone(param, tmp, next_arg))) + return 0; // OOM tmp->prev= *next_arg; // Link into next/prev chain (*next_arg)->next=tmp; From ef003911af812d2228fd897f839e74877216c4a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 11:05:32 +0200 Subject: [PATCH 451/789] Bug #27512 Inconsistent tuples when using variable size and >16Gb datamemory - increase var part reference from 32 to 64 bits on 64 bit systems - note current patch does not allow for online upgrade from 32 to 64 bit systems or vice versa --- storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 35 ++++++++++++++++--- .../src/kernel/blocks/dbtup/DbtupAbort.cpp | 8 +++-- .../src/kernel/blocks/dbtup/DbtupCommit.cpp | 9 ++--- .../kernel/blocks/dbtup/DbtupExecQuery.cpp | 11 +++--- .../src/kernel/blocks/dbtup/DbtupIndex.cpp | 2 +- .../ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 2 +- .../ndb/src/kernel/blocks/dbtup/DbtupScan.cpp | 2 +- .../src/kernel/blocks/dbtup/DbtupVarAlloc.cpp | 25 +++++++------ 8 files changed, 65 insertions(+), 29 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 357dec6fde7..b96a7bf4fcb 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -1206,9 +1206,35 @@ typedef Ptr HostBufferPtr; */ struct Var_part_ref { +#if NDB_SIZEOF_CHARP == 4 Uint32 m_ref; - }; + STATIC_CONST( SZ32 = 1 ); + void copyout(Local_key* dst) const { + dst->m_page_no = m_ref >> MAX_TUPLES_BITS; + dst->m_page_idx = m_ref & MAX_TUPLES_PER_PAGE; + } + + void assign(const Local_key* src) { + m_ref = (src->m_page_no << MAX_TUPLES_BITS) | src->m_page_idx; + } +#else + Uint32 m_page_no; + Uint32 m_page_idx; + STATIC_CONST( SZ32 = 2 ); + + void copyout(Local_key* dst) const { + dst->m_page_no = m_page_no; + dst->m_page_idx = m_page_idx; + } + + void assign(const Local_key* src) { + m_page_no = src->m_page_no; + m_page_idx = src->m_page_idx; + } +#endif + }; + struct Tuple_header { union { @@ -2847,12 +2873,13 @@ Uint32* Dbtup::get_ptr(Ptr* pagePtr, Var_part_ref ref) { PagePtr tmp; - Uint32 page_idx= ref.m_ref & MAX_TUPLES_PER_PAGE; - tmp.i= ref.m_ref >> MAX_TUPLES_BITS; + Local_key key; + ref.copyout(&key); + tmp.i = key.m_page_no; c_page_pool.getPtr(tmp); memcpy(pagePtr, &tmp, sizeof(tmp)); - return ((Var_page*)tmp.p)->get_ptr(page_idx); + return ((Var_page*)tmp.p)->get_ptr(key.m_page_idx); } inline diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp index 904629fff77..4eb8f4d845d 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp @@ -153,12 +153,14 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags) ndbassert(tuple_ptr->m_header_bits & Tuple_header::CHAINED_ROW); - Uint32 ref= * tuple_ptr->get_var_part_ptr(regTabPtr.p); + Var_part_ref *ref = + (Var_part_ref*)tuple_ptr->get_var_part_ptr(regTabPtr.p); + Local_key tmp; - tmp.assref(ref); + ref->copyout(&tmp); idx= tmp.m_page_idx; - var_part= get_ptr(&vpage, *(Var_part_ref*)&ref); + var_part= get_ptr(&vpage, *ref); Var_page* pageP = (Var_page*)vpage.p; Uint32 len= pageP->get_entry_len(idx) & ~Var_page::CHAIN; Uint32 sz = ((((mm_vars + 1) << 1) + (((Uint16*)var_part)[mm_vars]) + 3)>> 2); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp index 1f703599cf5..f218f3beee8 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp @@ -236,13 +236,14 @@ Dbtup::commit_operation(Signal* signal, } else { - Uint32 *ref= tuple_ptr->get_var_part_ptr(regTabPtr); + Var_part_ref *ref= (Var_part_ref*)tuple_ptr->get_var_part_ptr(regTabPtr); memcpy(tuple_ptr, copy, 4*(Tuple_header::HeaderSize+fixsize)); - Local_key tmp; tmp.assref(*ref); - + Local_key tmp; + ref->copyout(&tmp); + PagePtr vpagePtr; - Uint32 *dst= get_ptr(&vpagePtr, *(Var_part_ref*)ref); + Uint32 *dst= get_ptr(&vpagePtr, *ref); Var_page* vpagePtrP = (Var_page*)vpagePtr.p; Uint32 *src= copy->get_var_part_ptr(regTabPtr); Uint32 sz= ((mm_vars + 1) << 1) + (((Uint16*)src)[mm_vars]); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 30778a2e273..03a18a20d96 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -2851,11 +2851,11 @@ Dbtup::handle_size_change_after_update(KeyReqStruct* req_struct, Ptr pagePtr = req_struct->m_varpart_page_ptr; Var_page* pageP= (Var_page*)pagePtr.p; Uint32 idx, alloc, needed; - Uint32 *refptr = org->get_var_part_ptr(regTabPtr); + Var_part_ref *refptr = (Var_part_ref*)org->get_var_part_ptr(regTabPtr); ndbassert(bits & Tuple_header::CHAINED_ROW); Local_key ref; - ref.assref(*refptr); + refptr->copyout(&ref); idx= ref.m_page_idx; if (! (copy_bits & Tuple_header::CHAINED_ROW)) { @@ -2878,7 +2878,7 @@ Dbtup::handle_size_change_after_update(KeyReqStruct* req_struct, } copy_bits |= Tuple_header::MM_GROWN; if (unlikely(realloc_var_part(regFragPtr, regTabPtr, pagePtr, - (Var_part_ref*)refptr, alloc, needed))) + refptr, alloc, needed))) return -1; } req_struct->m_tuple_ptr->m_header_bits = copy_bits; @@ -2945,9 +2945,10 @@ Dbtup::nr_read_pk(Uint32 fragPtrI, PagePtr page_ptr; if (tablePtr.p->m_attributes[MM].m_no_of_varsize) { - tablePtr.p->m_offsets[MM].m_fix_header_size += Tuple_header::HeaderSize+1; + const Uint32 XXX = Tuple_header::HeaderSize+Var_part_ref::SZ32; + tablePtr.p->m_offsets[MM].m_fix_header_size += XXX; ret = alloc_page(tablePtr.p, fragPtr.p, &page_ptr, tmp.m_page_no); - tablePtr.p->m_offsets[MM].m_fix_header_size -= Tuple_header::HeaderSize+1; + tablePtr.p->m_offsets[MM].m_fix_header_size -= XXX; } else { diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp index 3f42f0151e6..4d49d961ac7 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp @@ -479,7 +479,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) const Uint32 firstTupleNo = 0; const Uint32 tupheadsize = tablePtr.p->m_offsets[MM].m_fix_header_size + - (buildPtr.p->m_build_vs ? Tuple_header::HeaderSize + 1: 0); + (buildPtr.p->m_build_vs? Tuple_header::HeaderSize + Var_part_ref::SZ32: 0); #ifdef TIME_MEASUREMENT MicroSecondTimer start; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index b5010205880..7c200344032 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -542,7 +542,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) { Uint32 fix_tupheader = regTabPtr.p->m_offsets[MM].m_fix_header_size; if(regTabPtr.p->m_attributes[MM].m_no_of_varsize != 0) - fix_tupheader += Tuple_header::HeaderSize + 1; + fix_tupheader += Tuple_header::HeaderSize + Var_part_ref::SZ32; ndbassert(fix_tupheader > 0); Uint32 noRowsPerPage = ZWORDS_ON_PAGE / fix_tupheader; Uint32 noAllocatedPages = diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index 653a24ba6a1..3ccf5e58ab9 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -597,7 +597,7 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) Uint32 lcp_list = fragPtr.p->m_lcp_keep_list; Uint32 size = table.m_offsets[mm].m_fix_header_size + - (bits & ScanOp::SCAN_VS ? Tuple_header::HeaderSize + 1: 0); + (bits&ScanOp::SCAN_VS ? Tuple_header::HeaderSize + Var_part_ref::SZ32 : 0); if (lcp && lcp_list != RNIL) goto found_lcp_keep; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp index 28543882255..1e2596cfcb4 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp @@ -71,9 +71,10 @@ Uint32* Dbtup::alloc_var_rec(Fragrecord* fragPtr, /** * TODO alloc fix+var part */ - tabPtr->m_offsets[MM].m_fix_header_size += Tuple_header::HeaderSize + 1; + const Uint32 XXX = Tuple_header::HeaderSize + Var_part_ref::SZ32; + tabPtr->m_offsets[MM].m_fix_header_size += XXX; Uint32 *ptr = alloc_fix_rec(fragPtr, tabPtr, key, out_frag_page_id); - tabPtr->m_offsets[MM].m_fix_header_size -= Tuple_header::HeaderSize + 1; + tabPtr->m_offsets[MM].m_fix_header_size -= XXX; if (unlikely(ptr == 0)) { return 0; @@ -90,7 +91,8 @@ Uint32* Dbtup::alloc_var_rec(Fragrecord* fragPtr, if (likely(alloc_var_part(fragPtr, tabPtr, alloc_size, &varref) != 0)) { Tuple_header* tuple = (Tuple_header*)ptr; - * tuple->get_var_part_ptr(tabPtr) = varref.ref(); + Var_part_ref* dst = (Var_part_ref*)tuple->get_var_part_ptr(tabPtr); + dst->assign(&varref); return ptr; } @@ -168,7 +170,8 @@ void Dbtup::free_var_rec(Fragrecord* fragPtr, Tuple_header* tuple = (Tuple_header*)ptr; Local_key ref; - ref.assref(* tuple->get_var_part_ptr(tabPtr)); + Var_part_ref * varref = (Var_part_ref*)tuple->get_var_part_ptr(tabPtr); + varref->copyout(&ref); free_fix_rec(fragPtr, tabPtr, key, (Fix_page*)pagePtr.p); @@ -194,12 +197,12 @@ void Dbtup::free_var_rec(Fragrecord* fragPtr, int Dbtup::realloc_var_part(Fragrecord* fragPtr, Tablerec* tabPtr, PagePtr pagePtr, - Var_part_ref* ref, Uint32 oldsz, Uint32 newsz) + Var_part_ref* refptr, Uint32 oldsz, Uint32 newsz) { Uint32 add = newsz - oldsz; Var_page* pageP = (Var_page*)pagePtr.p; Local_key oldref; - oldref.assref(*(Uint32*)ref); + refptr->copyout(&oldref); if (pageP->free_space >= add) { @@ -238,7 +241,7 @@ Dbtup::realloc_var_part(Fragrecord* fragPtr, Tablerec* tabPtr, PagePtr pagePtr, ndbassert(oldref.m_page_no != newref.m_page_no); ndbassert(pageP->get_entry_len(oldref.m_page_idx) == oldsz); memcpy(dst, src, 4*oldsz); - * ((Uint32*)ref) = newref.ref(); + refptr->assign(&newref); pageP->free_record(oldref.m_page_idx, Var_page::CHAIN); update_free_page_list(fragPtr, pagePtr); @@ -399,9 +402,10 @@ Dbtup::alloc_var_rowid(Fragrecord* fragPtr, Local_key* key, Uint32 * out_frag_page_id) { - tabPtr->m_offsets[MM].m_fix_header_size += Tuple_header::HeaderSize + 1; + const Uint32 XXX = Tuple_header::HeaderSize + Var_part_ref::SZ32; + tabPtr->m_offsets[MM].m_fix_header_size += XXX; Uint32 *ptr = alloc_fix_rowid(fragPtr, tabPtr, key, out_frag_page_id); - tabPtr->m_offsets[MM].m_fix_header_size -= Tuple_header::HeaderSize + 1; + tabPtr->m_offsets[MM].m_fix_header_size -= XXX; if (unlikely(ptr == 0)) { return 0; @@ -417,7 +421,8 @@ Dbtup::alloc_var_rowid(Fragrecord* fragPtr, if (likely(alloc_var_part(fragPtr, tabPtr, alloc_size, &varref) != 0)) { Tuple_header* tuple = (Tuple_header*)ptr; - * tuple->get_var_part_ptr(tabPtr) = varref.ref(); + Var_part_ref* dst = (Var_part_ref*)tuple->get_var_part_ptr(tabPtr); + dst->assign(&varref); return ptr; } From 4e907a7fdc8f7654111f62419e3fd4927626ac69 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 11:20:08 +0200 Subject: [PATCH 452/789] gis_generic test cases: Revert test case to NOT define any keys; the NDB warning can be handled, and ARCHIVE does not allow indexes mysql-test/include/gis_generic.inc: Revert test case to NOT define any keys; the NDB warning can be handled, and ARCHIVE does not allow indexes mysql-test/r/archive_gis.result: Revert test case to NOT define any keys; the NDB warning can be handled, and ARCHIVE does not allow indexes mysql-test/r/bdb_gis.result: Revert test case to NOT define any keys; the NDB warning can be handled, and ARCHIVE does not allow indexes mysql-test/r/innodb_gis.result: Revert test case to NOT define any keys; the NDB warning can be handled, and ARCHIVE does not allow indexes mysql-test/r/ndb_gis.result: Revert test case to NOT define any keys; the NDB warning can be handled, and ARCHIVE does not allow indexes --- mysql-test/include/gis_generic.inc | 34 ++++++++-------- mysql-test/r/archive_gis.result | 32 +++++++-------- mysql-test/r/bdb_gis.result | 32 +++++++-------- mysql-test/r/innodb_gis.result | 32 +++++++-------- mysql-test/r/ndb_gis.result | 64 +++++++++++++++--------------- 5 files changed, 96 insertions(+), 98 deletions(-) diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc index d83db08ad6b..70e82a13364 100644 --- a/mysql-test/include/gis_generic.inc +++ b/mysql-test/include/gis_generic.inc @@ -188,30 +188,28 @@ drop table t1; # Test all MBR* functions and their non-MBR-prefixed aliases, # using shifted squares to verify the spatial relations. -# Primary key is needed for NDB with binlog; bug ARCHIVE doesn't -# support AUTO_INCREMENT, so specify id values explicitly -CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); +CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result index 4301befb18d..3137d43ec3a 100644 --- a/mysql-test/r/archive_gis.result +++ b/mysql-test/r/archive_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/bdb_gis.result b/mysql-test/r/bdb_gis.result index 108e2cc7a94..d48b5a26e1d 100644 --- a/mysql-test/r/bdb_gis.result +++ b/mysql-test/r/bdb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result index 399ff697416..2c62537aa94 100644 --- a/mysql-test/r/innodb_gis.result +++ b/mysql-test/r/innodb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result index df0ff8e972e..ec064ace651 100644 --- a/mysql-test/r/ndb_gis.result +++ b/mysql-test/r/ndb_gis.result @@ -457,22 +457,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small @@ -1001,22 +1001,22 @@ insert into t1 values (pointfromtext('point(1,1)')); ERROR 23000: Column 'fl' cannot be null drop table t1; End of 4.1 tests -CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); -INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); -INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); -INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); -INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); -INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); -INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); -INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); -INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); -INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); -INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); -INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); -INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); -INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); -INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); -INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); +CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); +INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); +INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); +INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); +INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); +INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); +INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); +INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); +INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); +INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); +INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); +INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); +INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); +INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); +INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); +INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrcontains center,small From 8b873c3f640722026eca5d35c847ac6a7959daba Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 11:31:50 +0200 Subject: [PATCH 453/789] Make the script detect --default-storage-engine=x and mark the test as requiring that storage engine(if we need to do that) Make --ndb and --with-ndbcluster and alias for --mysqld=--default-storage-engine=ndbcluster --- mysql-test/lib/mtr_cases.pl | 11 +++++++++++ mysql-test/mysql-test-run.pl | 29 +++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 22290a88d39..28c78fbffeb 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -498,6 +498,17 @@ sub collect_one_test_case($$$$$$$) { { mtr_options_from_test_file($tinfo,"$testdir/${tname}.test"); + if ( defined $::used_default_engine ) + { + # Different default engine is used + # tag test to require that engine + $tinfo->{'ndb_test'}= 1 + if ( $::used_default_engine =~ /^ndb/i ); + + $tinfo->{'innodb_test'}= 1 + if ( $::used_default_engine =~ /^innodb/i ); + } + if ( $tinfo->{'big_test'} and ! $::opt_big_test ) { $tinfo->{'skip'}= 1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 9187e3d23ec..3166672dd89 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -304,6 +304,7 @@ our $path_sql_dir; our @data_dir_lst; our $used_binlog_format; +our $used_default_engine; our $debug_compiled_binaries; our $glob_tot_real_time= 0; @@ -519,7 +520,7 @@ sub command_line_setup () { 'compress' => \$opt_compress, 'bench' => \$opt_bench, 'small-bench' => \$opt_small_bench, - 'with-ndbcluster' => \$opt_with_ndbcluster, + 'with-ndbcluster|ndb' => \$opt_with_ndbcluster, 'vs-config' => \$opt_vs_config, # Control what test suites or cases to run @@ -776,6 +777,26 @@ sub command_line_setup () { mtr_report("Using binlog format '$used_binlog_format'"); } + + # -------------------------------------------------------------------------- + # Find out default storage engine being used(if any) + # -------------------------------------------------------------------------- + if ( $opt_with_ndbcluster ) + { + # --ndb or --with-ndbcluster turns on --default-storage-engine=ndbcluster + push(@opt_extra_mysqld_opt, "--default-storage-engine=ndbcluster"); + } + + foreach my $arg ( @opt_extra_mysqld_opt ) + { + if ( $arg =~ /default-storage-engine=(\S+)/ ) + { + $used_default_engine= $1; + } + } + mtr_report("Using default engine '$used_default_engine'") + if defined $used_default_engine; + # -------------------------------------------------------------------------- # Check if we should speed up tests by trying to run on tmpfs # -------------------------------------------------------------------------- @@ -901,10 +922,6 @@ sub command_line_setup () { # -------------------------------------------------------------------------- # Ndb cluster flags # -------------------------------------------------------------------------- - if ( $opt_with_ndbcluster and !$opt_bench) - { - mtr_error("Can only use --with-ndbcluster togheter with --bench"); - } if ( $opt_ndbconnectstring ) { @@ -5015,7 +5032,7 @@ Options to control what engine/variation to run skip-ssl Dont start server with support for ssl connections bench Run the benchmark suite small-bench Run the benchmarks with --small-tests --small-tables - with-ndbcluster Use cluster as default table type for benchmark + ndb|with-ndbcluster Use cluster as default table type vs-config Visual Studio configuration used to create executables (default: MTR_VS_CONFIG environment variable) From f839f78c9f188e8176e267e9429ce020c608631c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 12:45:23 +0200 Subject: [PATCH 454/789] ndb_gis.result: post-merge fixup of test result mysql-test/r/ndb_gis.result: post-merge fixup of test result --- mysql-test/r/ndb_gis.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result index f0d88098eb1..279a0884b5b 100644 --- a/mysql-test/r/ndb_gis.result +++ b/mysql-test/r/ndb_gis.result @@ -463,7 +463,7 @@ drop table t1; End of 4.1 tests CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); Warnings: -Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); @@ -1013,7 +1013,7 @@ drop table t1; End of 4.1 tests CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); Warnings: -Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); From 6b603c9aa08c92d9ecefc738cee0e6832643f3dd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 14:54:08 +0400 Subject: [PATCH 455/789] BUG#26624, merge to 5.1: make partition pruning module account for the changes made by the bug fix. mysql-test/r/subselect.result: Post-merge fixes --- mysql-test/r/subselect.result | 1 + sql/opt_range.cc | 35 ++++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 4b2ca585d61..089fb10aaae 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3946,6 +3946,7 @@ SELECT a FROM t1 t0 WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; ERROR HY000: Invalid use of group function SET @@sql_mode=default; +DROP TABLE t1; CREATE TABLE t1 (s1 char(1)); INSERT INTO t1 VALUES ('a'); SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 0c94a58c429..88e0eb27d80 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -84,7 +84,7 @@ static int sel_cmp(Field *f,char *a,char *b,uint8 a_flag,uint8 b_flag); static char is_null_string[2]= {1,0}; - +class RANGE_OPT_PARAM; /* A construction block of the SEL_ARG-graph. @@ -356,8 +356,7 @@ public: return new SEL_ARG(field, part, min_value, arg->max_value, min_flag, arg->max_flag, maybe_flag | arg->maybe_flag); } - SEL_ARG *clone(struct st_qsel_param *param, SEL_ARG *new_parent, - SEL_ARG **next); + SEL_ARG *clone(RANGE_OPT_PARAM *param, SEL_ARG *new_parent, SEL_ARG **next); bool copy_min(SEL_ARG* arg) { // Get overlapping range @@ -551,7 +550,7 @@ public: } return !field->key_cmp(min_val, max_val); } - SEL_ARG *clone_tree(struct st_qsel_param *param); + SEL_ARG *clone_tree(RANGE_OPT_PARAM *param); }; class SEL_IMERGE; @@ -631,6 +630,8 @@ public: using_real_indexes==TRUE */ uint real_keynr[MAX_KEY]; + /* Number of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */ + uint alloced_sel_args; }; class PARAM : public RANGE_OPT_PARAM @@ -659,8 +660,6 @@ public: /* Number of ranges in the last checked tree->key */ uint n_ranges; uint8 first_null_comp; /* first null component if any, 0 - otherwise */ - /* Number of SEL_ARG objects allocated by SEL_ARG::clone_tree operations */ - uint alloced_sel_args; }; class TABLE_READ_PLAN; @@ -722,8 +721,9 @@ static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg); static SEL_TREE *tree_and(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2); static SEL_TREE *tree_or(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2); static SEL_ARG *sel_add(SEL_ARG *key1,SEL_ARG *key2); -static SEL_ARG *key_or(PARAM *param, SEL_ARG *key1,SEL_ARG *key2); -static SEL_ARG *key_and(PARAM *param, SEL_ARG *key1,SEL_ARG *key2,uint clone_flag); +static SEL_ARG *key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2); +static SEL_ARG *key_and(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2, + uint clone_flag); static bool get_range(SEL_ARG **e1,SEL_ARG **e2,SEL_ARG *root1); bool get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key, SEL_ARG *key_tree,char *min_key,uint min_key_flag, @@ -1599,7 +1599,8 @@ SEL_ARG::SEL_ARG(Field *field_,uint8 part_,char *min_value_,char *max_value_, left=right= &null_element; } -SEL_ARG *SEL_ARG::clone(PARAM *param, SEL_ARG *new_parent, SEL_ARG **next_arg) +SEL_ARG *SEL_ARG::clone(RANGE_OPT_PARAM *param, SEL_ARG *new_parent, + SEL_ARG **next_arg) { SEL_ARG *tmp; @@ -1709,7 +1710,7 @@ static int sel_cmp(Field *field, char *a,char *b,uint8 a_flag,uint8 b_flag) } -SEL_ARG *SEL_ARG::clone_tree(PARAM *param) +SEL_ARG *SEL_ARG::clone_tree(RANGE_OPT_PARAM *param) { SEL_ARG tmp_link,*next_arg,*root; next_arg= &tmp_link; @@ -2609,6 +2610,7 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond) range_par->using_real_indexes= FALSE; range_par->remove_jump_scans= FALSE; range_par->real_keynr[0]= 0; + range_par->alloced_sel_args= 0; thd->no_errors=1; // Don't warn about NULL thd->mem_root=&alloc; @@ -6156,7 +6158,8 @@ tree_or(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) /* And key trees where key1->part < key2 -> part */ static SEL_ARG * -and_all_keys(PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) +and_all_keys(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2, + uint clone_flag) { SEL_ARG *next; ulong use_count=key1->use_count; @@ -6202,8 +6205,10 @@ and_all_keys(PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) SYNOPSIS key_and() - key1 First argument, root of its RB-tree - key2 Second argument, root of its RB-tree + param Range analysis context (needed to track if we have allocated + too many SEL_ARGs) + key1 First argument, root of its RB-tree + key2 Second argument, root of its RB-tree RETURN RB-tree root of the resulting SEL_ARG graph. @@ -6211,7 +6216,7 @@ and_all_keys(PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) */ static SEL_ARG * -key_and(PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) +key_and(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2, uint clone_flag) { if (!key1) return key2; @@ -6350,7 +6355,7 @@ get_range(SEL_ARG **e1,SEL_ARG **e2,SEL_ARG *root1) static SEL_ARG * -key_or(PARAM *param, SEL_ARG *key1,SEL_ARG *key2) +key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1,SEL_ARG *key2) { if (!key1) { From 13a2fad97c8d9d6f2b56e53f9ca2ec29e9cf1d86 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 13:27:38 +0200 Subject: [PATCH 456/789] create.result: post-merge test result fixup mysql-test/r/create.result: post-merge test result fixup --- mysql-test/r/create.result | 162 ++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index e0283273420..a8767c83215 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -836,22 +836,22 @@ key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`, show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, + `c1` char(10) DEFAULT NULL, + `c2` char(10) DEFAULT NULL, + `c3` char(10) DEFAULT NULL, + `c4` char(10) DEFAULT NULL, + `c5` char(10) DEFAULT NULL, + `c6` char(10) DEFAULT NULL, + `c7` char(10) DEFAULT NULL, + `c8` char(10) DEFAULT NULL, + `c9` char(10) DEFAULT NULL, + `c10` char(10) DEFAULT NULL, + `c11` char(10) DEFAULT NULL, + `c12` char(10) DEFAULT NULL, + `c13` char(10) DEFAULT NULL, + `c14` char(10) DEFAULT NULL, + `c15` char(10) DEFAULT NULL, + `c16` char(10) DEFAULT NULL, KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), @@ -921,22 +921,22 @@ flush tables; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, + `c1` char(10) DEFAULT NULL, + `c2` char(10) DEFAULT NULL, + `c3` char(10) DEFAULT NULL, + `c4` char(10) DEFAULT NULL, + `c5` char(10) DEFAULT NULL, + `c6` char(10) DEFAULT NULL, + `c7` char(10) DEFAULT NULL, + `c8` char(10) DEFAULT NULL, + `c9` char(10) DEFAULT NULL, + `c10` char(10) DEFAULT NULL, + `c11` char(10) DEFAULT NULL, + `c12` char(10) DEFAULT NULL, + `c13` char(10) DEFAULT NULL, + `c14` char(10) DEFAULT NULL, + `c15` char(10) DEFAULT NULL, + `c16` char(10) DEFAULT NULL, KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), @@ -1077,22 +1077,22 @@ add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,` show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, + `c1` char(10) DEFAULT NULL, + `c2` char(10) DEFAULT NULL, + `c3` char(10) DEFAULT NULL, + `c4` char(10) DEFAULT NULL, + `c5` char(10) DEFAULT NULL, + `c6` char(10) DEFAULT NULL, + `c7` char(10) DEFAULT NULL, + `c8` char(10) DEFAULT NULL, + `c9` char(10) DEFAULT NULL, + `c10` char(10) DEFAULT NULL, + `c11` char(10) DEFAULT NULL, + `c12` char(10) DEFAULT NULL, + `c13` char(10) DEFAULT NULL, + `c14` char(10) DEFAULT NULL, + `c15` char(10) DEFAULT NULL, + `c16` char(10) DEFAULT NULL, KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), @@ -1162,22 +1162,22 @@ flush tables; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, + `c1` char(10) DEFAULT NULL, + `c2` char(10) DEFAULT NULL, + `c3` char(10) DEFAULT NULL, + `c4` char(10) DEFAULT NULL, + `c5` char(10) DEFAULT NULL, + `c6` char(10) DEFAULT NULL, + `c7` char(10) DEFAULT NULL, + `c8` char(10) DEFAULT NULL, + `c9` char(10) DEFAULT NULL, + `c10` char(10) DEFAULT NULL, + `c11` char(10) DEFAULT NULL, + `c12` char(10) DEFAULT NULL, + `c13` char(10) DEFAULT NULL, + `c14` char(10) DEFAULT NULL, + `c15` char(10) DEFAULT NULL, + `c16` char(10) DEFAULT NULL, KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), @@ -1260,23 +1260,23 @@ ERROR 42000: Identifier name 'a001_long_123456789_123456789_123456789_123456789_ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, - `c17` char(10) default NULL + `c1` char(10) DEFAULT NULL, + `c2` char(10) DEFAULT NULL, + `c3` char(10) DEFAULT NULL, + `c4` char(10) DEFAULT NULL, + `c5` char(10) DEFAULT NULL, + `c6` char(10) DEFAULT NULL, + `c7` char(10) DEFAULT NULL, + `c8` char(10) DEFAULT NULL, + `c9` char(10) DEFAULT NULL, + `c10` char(10) DEFAULT NULL, + `c11` char(10) DEFAULT NULL, + `c12` char(10) DEFAULT NULL, + `c13` char(10) DEFAULT NULL, + `c14` char(10) DEFAULT NULL, + `c15` char(10) DEFAULT NULL, + `c16` char(10) DEFAULT NULL, + `c17` char(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; End of 4.1 tests From 686842b9a3839b9270604a54d2835725f88f9dfd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 14:10:21 +0200 Subject: [PATCH 457/789] Bug #27512 Inconsistent tuples when using variable size and >16Gb datamemory - also run this patch on 32 bit machines to allow online upgrade --- storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index b96a7bf4fcb..2b723d745b2 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -1206,7 +1206,12 @@ typedef Ptr HostBufferPtr; */ struct Var_part_ref { -#if NDB_SIZEOF_CHARP == 4 +#ifdef NDB_32BIT_VAR_REF + /* + In versions prior to ndb 6.1.6, 6.2.1 and mysql 5.1.17 + Running this code limits DataMemory to 16G, also online + upgrade not possible between versions + */ Uint32 m_ref; STATIC_CONST( SZ32 = 1 ); From a5c60b3f29953e9da891ca39a709cff23f2fa1d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 14:12:32 +0200 Subject: [PATCH 458/789] Bug#25482 GRANT statements are not replicated if you use "replicate-ignore-table" - GRANT and REVOKE statments didn't have the "updating" flag set and thus statements with a table specified would not replicate if slave filtering rules where turned on. For example "GRANT ... ON test.t1 TO ..." would not replicate. mysql-test/r/rpl_ignore_table.result: Add test results mysql-test/t/rpl_ignore_table.test: Add tests sql/sql_yacc.yy: Pass option TL_OPTION_UPDATING to 'add_table_to_list' when parsing a GRANT or REVOKE and a table specifier is found. This will set the property "updating" on the table and thus the slave filtering rules will be applied. Without setting updating the statement will be not replicated - since "it's not updating anything" - an optimization to quickly skip SELECT's and similar. --- mysql-test/r/rpl_ignore_table.result | 103 +++++++++++++++++++++++++++ mysql-test/t/rpl_ignore_table.test | 98 +++++++++++++++++++++++++ sql/sql_yacc.yy | 3 +- 3 files changed, 203 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/r/rpl_ignore_table.result index 356a9dcb2f8..28bb4a448e0 100644 --- a/mysql-test/r/rpl_ignore_table.result +++ b/mysql-test/r/rpl_ignore_table.result @@ -14,3 +14,106 @@ SELECT * FROM t4; a DROP TABLE t1; DROP TABLE t4; +**** Test case for BUG#25482 **** +**** Adding GRANTS on master **** +create table test.t1(a int); +create table test.t4(a int); +GRANT SELECT ON test.t1 TO mysqltest1@localhost; +GRANT INSERT ON test.t4 TO mysqltest2@localhost; +GRANT select, update, insert, references on t1 +to mysqltest2@localhost; +GRANT SELECT ON test.* TO mysqltest3@localhost; +GRANT INSERT ON test.t4 TO mysqltest3@localhost; +GRANT select(a), update(a), insert(a), references(a) on t4 +to mysqltest3@localhost; +create database mysqltest2; +create table mysqltest2.t2 (id int); +GRANT SELECT ON mysqltest2.t2 TO mysqltest4@localhost IDENTIFIED BY 'pass'; +insert into mysql.user (user, host) values ("mysqltest5", "somehost"); +GRANT SELECT ON *.* TO mysqltest6@localhost; +GRANT INSERT ON *.* TO mysqltest6@localhost; +GRANT INSERT ON test.* TO mysqltest6@localhost; +GRANT INSERT ON test.t1 TO mysqltest6@localhost; +show grants for mysqltest1@localhost; +Grants for mysqltest1@localhost +GRANT USAGE ON *.* TO 'mysqltest1'@'localhost' +GRANT SELECT ON `test`.`t1` TO 'mysqltest1'@'localhost' +show grants for mysqltest2@localhost; +Grants for mysqltest2@localhost +GRANT USAGE ON *.* TO 'mysqltest2'@'localhost' +GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO 'mysqltest2'@'localhost' +GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost' +show grants for mysqltest3@localhost; +Grants for mysqltest3@localhost +GRANT USAGE ON *.* TO 'mysqltest3'@'localhost' +GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost' +GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost' +show grants for mysqltest4@localhost; +Grants for mysqltest4@localhost +GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' +GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost' +show grants for mysqltest6@localhost; +Grants for mysqltest6@localhost +GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost' +GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost' +GRANT INSERT ON `test`.`t1` TO 'mysqltest6'@'localhost' +flush privileges; +show grants for mysqltest5@somehost; +Grants for mysqltest5@somehost +GRANT USAGE ON *.* TO 'mysqltest5'@'somehost' +**** Checking grants on slave **** +show grants for mysqltest2@localhost; +Grants for mysqltest2@localhost +GRANT USAGE ON *.* TO 'mysqltest2'@'localhost' +GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost' +show grants for mysqltest3@localhost; +Grants for mysqltest3@localhost +GRANT USAGE ON *.* TO 'mysqltest3'@'localhost' +GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost' +GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost' +show grants for mysqltest4@localhost; +Grants for mysqltest4@localhost +GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' +GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost' +show grants for mysqltest5@somehost; +Grants for mysqltest5@somehost +GRANT USAGE ON *.* TO 'mysqltest5'@'somehost' +show grants for mysqltest6@localhost; +Grants for mysqltest6@localhost +GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost' +GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost' +show grants for mysqltest1@localhost; +ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost' +**** Revoking grants on master **** +REVOKE SELECT ON test.t1 FROM mysqltest1@localhost; +REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost; +REVOKE select(a) on t4 +from mysqltest3@localhost; +show grants for mysqltest1@localhost; +Grants for mysqltest1@localhost +GRANT USAGE ON *.* TO 'mysqltest1'@'localhost' +show grants for mysqltest3@localhost; +Grants for mysqltest3@localhost +GRANT USAGE ON *.* TO 'mysqltest3'@'localhost' +GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost' +GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost' +show grants for mysqltest4@localhost; +Grants for mysqltest4@localhost +GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' +**** Checking grants on slave **** +show grants for mysqltest1@localhost; +ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost' +show grants for mysqltest3@localhost; +Grants for mysqltest3@localhost +GRANT USAGE ON *.* TO 'mysqltest3'@'localhost' +GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost' +GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost' +show grants for mysqltest4@localhost; +Grants for mysqltest4@localhost +GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' +drop table t1, t4, mysqltest2.t2; +drop database mysqltest2; +delete from mysql.user where user like "mysqltest%"; +delete from mysql.db where user like "mysqltest%"; +delete from mysql.tables_priv where user like "mysqltest%"; +delete from mysql.columns_priv where user like "mysqltest%"; diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/t/rpl_ignore_table.test index bc651779208..660921a94be 100644 --- a/mysql-test/t/rpl_ignore_table.test +++ b/mysql-test/t/rpl_ignore_table.test @@ -26,3 +26,101 @@ SELECT * FROM t4; connection master; DROP TABLE t1; DROP TABLE t4; + + +# +# Bug#25482 GRANT statements are not replicated if +# you use "replicate-ignore-table" +# + +--echo **** Test case for BUG#25482 **** +--echo **** Adding GRANTS on master **** + +connection master; +create table test.t1(a int); +create table test.t4(a int); + +# Simple user that should not replicate +GRANT SELECT ON test.t1 TO mysqltest1@localhost; + +# Partial replicate +GRANT INSERT ON test.t4 TO mysqltest2@localhost; +GRANT select, update, insert, references on t1 + to mysqltest2@localhost; + +# Partial replicate 2 +GRANT SELECT ON test.* TO mysqltest3@localhost; +GRANT INSERT ON test.t4 TO mysqltest3@localhost; +GRANT select(a), update(a), insert(a), references(a) on t4 + to mysqltest3@localhost; + +# Create another database and table +create database mysqltest2; +create table mysqltest2.t2 (id int); +# Create a grant that should replicate +GRANT SELECT ON mysqltest2.t2 TO mysqltest4@localhost IDENTIFIED BY 'pass'; + +# Create a grant manually +insert into mysql.user (user, host) values ("mysqltest5", "somehost"); + +# Partial replicate 3 with *.* +GRANT SELECT ON *.* TO mysqltest6@localhost; +GRANT INSERT ON *.* TO mysqltest6@localhost; +GRANT INSERT ON test.* TO mysqltest6@localhost; +GRANT INSERT ON test.t1 TO mysqltest6@localhost; + +show grants for mysqltest1@localhost; +show grants for mysqltest2@localhost; +show grants for mysqltest3@localhost; +show grants for mysqltest4@localhost; +show grants for mysqltest6@localhost; + +flush privileges; +show grants for mysqltest5@somehost; + + +sync_slave_with_master; + +--echo **** Checking grants on slave **** + +# Check that grants are replicated to slave +show grants for mysqltest2@localhost; +show grants for mysqltest3@localhost; +show grants for mysqltest4@localhost; +show grants for mysqltest5@somehost; +show grants for mysqltest6@localhost; + +# mysqltest1 should not be on slave +--error 1141 +show grants for mysqltest1@localhost; + +--echo **** Revoking grants on master **** +connection master; +REVOKE SELECT ON test.t1 FROM mysqltest1@localhost; +REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost; +REVOKE select(a) on t4 + from mysqltest3@localhost; + +show grants for mysqltest1@localhost; +show grants for mysqltest3@localhost; +show grants for mysqltest4@localhost; + +sync_slave_with_master; + +--echo **** Checking grants on slave **** + +# mysqltest1 should not be on slave +--error 1141 +show grants for mysqltest1@localhost; +show grants for mysqltest3@localhost; +show grants for mysqltest4@localhost; + +# Cleanup +connection master; +drop table t1, t4, mysqltest2.t2; +drop database mysqltest2; +delete from mysql.user where user like "mysqltest%"; +delete from mysql.db where user like "mysqltest%"; +delete from mysql.tables_priv where user like "mysqltest%"; +delete from mysql.columns_priv where user like "mysqltest%"; +sync_slave_with_master; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ee57a4d611c..b72caac46a0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5926,7 +5926,8 @@ opt_table: | table_ident { LEX *lex=Lex; - if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL,0)) + if (!lex->current_select->add_table_to_list(lex->thd, $1,NULL, + TL_OPTION_UPDATING)) YYABORT; if (lex->grant == GLOBAL_ACLS) lex->grant = TABLE_ACLS & ~GRANT_ACL; From 2c8ef7c4a1aa97b057b5ac06436dbde844d86bc9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 14:14:42 +0200 Subject: [PATCH 459/789] Bug #27378 update becomes delete on slave - quick workaround, better patch is needed later - test case mysql-test/r/rpl_ndb_basic.result: Bug #27378 update becomes delete on slave - test case mysql-test/t/rpl_ndb_basic.test: Bug #27378 update becomes delete on slave - test case sql/ha_ndbcluster.cc: Bug #27378 update becomes delete on slave - quick workaround, better patch is needed later --- mysql-test/r/rpl_ndb_basic.result | 35 +++++++++++++++++++++++++ mysql-test/t/rpl_ndb_basic.test | 43 +++++++++++++++++++++++++++++++ sql/ha_ndbcluster.cc | 3 ++- 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/rpl_ndb_basic.result b/mysql-test/r/rpl_ndb_basic.result index 32a1c790c99..40fb639d8d8 100644 --- a/mysql-test/r/rpl_ndb_basic.result +++ b/mysql-test/r/rpl_ndb_basic.result @@ -65,6 +65,41 @@ nid nom prenom 4 CCP DDD 5 EEE FFF DROP table t1; +CREATE TABLE `t1` ( +`prid` int(10) unsigned NOT NULL, +`id_type` enum('IMSI','SIP') NOT NULL, +`fkimssub` varchar(50) NOT NULL, +`user_id` varchar(20) DEFAULT NULL, +`password` varchar(20) DEFAULT NULL, +`ptg_nbr` varchar(20) DEFAULT NULL, +`old_tmsi` int(10) unsigned DEFAULT NULL, +`new_tmsi` int(10) unsigned DEFAULT NULL, +`dev_capability` int(10) unsigned DEFAULT NULL, +`dev_oid` bigint(20) unsigned DEFAULT NULL, +`lac_cell_id` bigint(20) unsigned DEFAULT NULL, +`ms_classmark1` int(10) unsigned DEFAULT NULL, +`cipher_key` int(10) unsigned DEFAULT NULL, +`priid_master` int(10) unsigned DEFAULT NULL, +PRIMARY KEY (`prid`), +UNIQUE KEY `fkimssub` (`fkimssub`,`ptg_nbr`) USING HASH +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +Warnings: +Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan +INSERT INTO `t1` VALUES (183342,'IMSI','config3_sub_2Privates_3Publics_imssub_36668','user_id_73336','user_id_73336','73336',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(47617,'IMSI','config3_sub_2Privates_3Publics_imssub_9523','user_id_19046','user_id_19046','19046',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(200332,'IMSI','config3_sub_2Privates_3Publics_imssub_40066','user_id_80132','user_id_80132','80132',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(478882,'IMSI','config3_sub_2Privates_3Publics_imssub_95776','user_id_191552','user_id_191552','191552',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(490146,'IMSI','config3_sub_2Privates_3Publics_imssub_98029','user_id_196057','user_id_196057','196057',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(499301,'IMSI','config3_sub_2Privates_3Publics_imssub_99860','user_id_199719','user_id_199719','199719',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(506101,'IMSI','config3_sub_2Privates_3Publics_imssub_101220','user_id_202439','user_id_202439','202439',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(510142,'IMSI','config3_sub_2Privates_3Publics_imssub_102028','user_id_204056','user_id_204056','204056',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(515871,'IMSI','config3_sub_2Privates_3Publics_imssub_103174','user_id_206347','user_id_206347','206347',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(209842,'IMSI','config3_sub_2Privates_3Publics_imssub_41968','user_id_83936','user_id_83936','83936',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(365902,'IMSI','config3_sub_2Privates_3Publics_imssub_73180','user_id_146360','user_id_146360','146360',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(11892,'IMSI','config3_sub_2Privates_3Publics_imssub_2378','user_id_4756','user_id_4756','4756',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL); +select count(*) from t1; +count(*) +12 +select count(*) from t1; +count(*) +12 +update t1 set dev_oid=dev_oid+1; +select count(*) from t1; +count(*) +12 +select count(*) from t1; +count(*) +12 +DROP table t1; CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0', `nom` char(4) default NULL, `prenom` char(4) default NULL, diff --git a/mysql-test/t/rpl_ndb_basic.test b/mysql-test/t/rpl_ndb_basic.test index 5290dc377c2..a230b9da622 100644 --- a/mysql-test/t/rpl_ndb_basic.test +++ b/mysql-test/t/rpl_ndb_basic.test @@ -79,6 +79,49 @@ select * from t1 order by nid; --connection master DROP table t1; +# +# Bug #27378 update becomes delete on slave +# + +--connection master +CREATE TABLE `t1` ( + `prid` int(10) unsigned NOT NULL, + `id_type` enum('IMSI','SIP') NOT NULL, + `fkimssub` varchar(50) NOT NULL, + `user_id` varchar(20) DEFAULT NULL, + `password` varchar(20) DEFAULT NULL, + `ptg_nbr` varchar(20) DEFAULT NULL, + `old_tmsi` int(10) unsigned DEFAULT NULL, + `new_tmsi` int(10) unsigned DEFAULT NULL, + `dev_capability` int(10) unsigned DEFAULT NULL, + `dev_oid` bigint(20) unsigned DEFAULT NULL, + `lac_cell_id` bigint(20) unsigned DEFAULT NULL, + `ms_classmark1` int(10) unsigned DEFAULT NULL, + `cipher_key` int(10) unsigned DEFAULT NULL, + `priid_master` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`prid`), + UNIQUE KEY `fkimssub` (`fkimssub`,`ptg_nbr`) USING HASH +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; + +INSERT INTO `t1` VALUES (183342,'IMSI','config3_sub_2Privates_3Publics_imssub_36668','user_id_73336','user_id_73336','73336',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(47617,'IMSI','config3_sub_2Privates_3Publics_imssub_9523','user_id_19046','user_id_19046','19046',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(200332,'IMSI','config3_sub_2Privates_3Publics_imssub_40066','user_id_80132','user_id_80132','80132',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(478882,'IMSI','config3_sub_2Privates_3Publics_imssub_95776','user_id_191552','user_id_191552','191552',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(490146,'IMSI','config3_sub_2Privates_3Publics_imssub_98029','user_id_196057','user_id_196057','196057',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(499301,'IMSI','config3_sub_2Privates_3Publics_imssub_99860','user_id_199719','user_id_199719','199719',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(506101,'IMSI','config3_sub_2Privates_3Publics_imssub_101220','user_id_202439','user_id_202439','202439',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(510142,'IMSI','config3_sub_2Privates_3Publics_imssub_102028','user_id_204056','user_id_204056','204056',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(515871,'IMSI','config3_sub_2Privates_3Publics_imssub_103174','user_id_206347','user_id_206347','206347',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(209842,'IMSI','config3_sub_2Privates_3Publics_imssub_41968','user_id_83936','user_id_83936','83936',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL),(365902,'IMSI','config3_sub_2Privates_3Publics_imssub_73180','user_id_146360','user_id_146360','146360',NULL,NULL,NULL,1010,NULL,NULL,NULL,NULL),(11892,'IMSI','config3_sub_2Privates_3Publics_imssub_2378','user_id_4756','user_id_4756','4756',NULL,NULL,NULL,123456789,NULL,NULL,NULL,NULL); + +select count(*) from t1; + +--sync_slave_with_master +--connection slave +select count(*) from t1; + +--connection master +update t1 set dev_oid=dev_oid+1; +select count(*) from t1; + +--sync_slave_with_master +--connection slave +select count(*) from t1; + +--connection master +DROP table t1; + ################################################################## # # Check that retries are made on the slave on some temporary errors diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 8e8aa162fff..353dd806448 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3873,7 +3873,8 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) break; case HA_EXTRA_WRITE_CAN_REPLACE: DBUG_PRINT("info", ("HA_EXTRA_WRITE_CAN_REPLACE")); - if (!m_has_unique_index) + if (!m_has_unique_index || + current_thd->slave_thread) /* always set if slave, quick fix for bug 27378 */ { DBUG_PRINT("info", ("Turning ON use of write instead of insert")); m_use_write= TRUE; From 75686dc73f0e2d5af85a9cd77fccbf2896189a42 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 08:17:19 -0400 Subject: [PATCH 460/789] WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge as a result of updating the local repository and includes changes necessary to correct problems found during the recalculation of next execution of events in RBR. mysql-test/include/rpl_events.inc: WL#3629 - Replication of Invocation and Invoked Features This patch changes the rpl_events test to be more comprehensive in catching errors as a result of RBR. Changes include clarification of SELECTs with WHERE clauses and synchronization with master and slave. mysql-test/r/rpl_events.result: WL#3629 - Replication of Invocation and Invoked Features This patch changes the results for the rpl_events test to accomodate the changes in the test. scripts/mysql_system_tables.sql: WL#3629 - Replication of Invocation and Invoked Features This patch adds the originator column and a new enum value to the mysql.event table. This change was necessary to accomodate changes as a result of other patches. sql/event_data_objects.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. The status check was changed to include either ENABLED or DISABLED in the gate to change the status to SLAVESIDE_DISABLED for events replicated to the slave. This patch also includes an update to correct a problem encountered during testing after the local merge. The update_timing_fields method is replicating the timing changes in RBR to the slave thereby over writing the change to the status column in the process. This code includes a check to turn off the next binlog event if in RBR. sql/event_queue.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. The code was corrected to include both types of disabled status enums (DISABLED, SLAVESIDE_DISABLED) in the create_event and update_event methods. sql/sql_show.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in merging that occurred during manual merge. It corrects the order in which the originator column appears in the show structures. The error caused incorrect output on SHOW EVENTS commands. --- mysql-test/include/rpl_events.inc | 34 ++++++------ mysql-test/r/rpl_events.result | 86 +++++++++++++++++-------------- scripts/mysql_system_tables.sql | 2 +- sql/event_data_objects.cc | 10 +++- sql/event_queue.cc | 7 +-- sql/sql_show.cc | 2 +- 6 files changed, 80 insertions(+), 61 deletions(-) diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc index 5f4cc3c6985..b8fac61c383 100644 --- a/mysql-test/include/rpl_events.inc +++ b/mysql-test/include/rpl_events.inc @@ -6,7 +6,7 @@ ################################################################## --disable_warnings -DROP EVENT IF EXISTS justonce; +DROP EVENT IF EXISTS test.justonce; drop table if exists t1,t2; --enable_warnings @@ -23,9 +23,11 @@ CURRENT_TIMESTAMP, INSERT INTO t1 (c) VALUES ('manually'); # then, we create the event -CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1 +CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1 (c) VALUES ('from justonce'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; + # wait 3 seconds, so the event can trigger --real_sleep 3 @@ -37,7 +39,6 @@ SELECT * FROM t1; --disable_info sync_slave_with_master; -connection slave; --echo "in the slave" --enable_info @@ -45,6 +46,8 @@ connection slave; SELECT * FROM t1; --disable_info +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; + # Create an event on the slave and check to see what the originator is. --disable_warnings DROP EVENT IF EXISTS test.slave_once; @@ -52,7 +55,7 @@ DROP EVENT IF EXISTS test.slave_once; CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO INSERT INTO t1(c) VALUES ('from slave_once'); -SELECT db, name, status, originator FROM mysql.event; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once'; --disable_warnings DROP EVENT IF EXISTS test.slave_once; @@ -61,39 +64,40 @@ DROP EVENT IF EXISTS test.slave_once; connection master; # BUG#20384 - disable events on slave +--disable_warnings DROP EVENT IF EXISTS test.justonce; +--enable_warnings + CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO INSERT INTO t1(c) VALUES ('from er'); -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; sync_slave_with_master; -connection slave; + --echo "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; connection master; --echo "in the master" ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er'); -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; sync_slave_with_master; -connection slave; + --echo "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; connection master; --echo "in the master" DROP EVENT test.er; ---replace column 8 DATETIME -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; --disable_info sync_slave_with_master; -connection slave; + --echo "in the slave" ---replace column 8 DATETIME -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; --echo "in the master" connection master; diff --git a/mysql-test/r/rpl_events.result b/mysql-test/r/rpl_events.result index 59bd16adbf6..332d8cf1c0c 100644 --- a/mysql-test/r/rpl_events.result +++ b/mysql-test/r/rpl_events.result @@ -6,7 +6,7 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; set binlog_format=row; -DROP EVENT IF EXISTS justonce; +DROP EVENT IF EXISTS test.justonce; drop table if exists t1,t2; CREATE TABLE `t1` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, @@ -16,8 +16,11 @@ CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO t1 (c) VALUES ('manually'); -CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1 +CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1 (c) VALUES ('from justonce'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; +db name status originator +test justonce ENABLED 1 "in the master" SELECT * FROM t1; id c ts @@ -30,46 +33,46 @@ id c ts 1 manually TIMESTAMP 2 from justonce TIMESTAMP affected rows: 2 +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; +db name status originator +test justonce SLAVESIDE_DISABLED 1 DROP EVENT IF EXISTS test.slave_once; CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO INSERT INTO t1(c) VALUES ('from slave_once'); -SELECT db, name, status, originator FROM mysql.event; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once'; db name status originator -test justonce SLAVESIDE_DISABLED 1 test slave_once ENABLED 2 DROP EVENT IF EXISTS test.slave_once; DROP EVENT IF EXISTS test.justonce; -Warnings: -Note 1305 Event justonce does not exist CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO INSERT INTO t1(c) VALUES ('from er'); -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er ENABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er ENABLED 1 INSERT INTO t1(c) VALUES ('from er') "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er SLAVESIDE_DISABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er SLAVESIDE_DISABLED 1 INSERT INTO t1(c) VALUES ('from er') "in the master" ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er'); -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er ENABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er ENABLED 1 INSERT into t1(c) VALUES ('from alter er') "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er SLAVESIDE_DISABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er SLAVESIDE_DISABLED 1 INSERT into t1(c) VALUES ('from alter er') "in the master" DROP EVENT test.er; -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator "in the master" DROP TABLE t1; set binlog_format=statement; -DROP EVENT IF EXISTS justonce; +DROP EVENT IF EXISTS test.justonce; drop table if exists t1,t2; CREATE TABLE `t1` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, @@ -79,8 +82,11 @@ CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO t1 (c) VALUES ('manually'); -CREATE EVENT justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTo t1 +CREATE EVENT test.justonce ON SCHEDULE AT NOW() + INTERVAL 2 SECOND DO INSERT INTO t1 (c) VALUES ('from justonce'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; +db name status originator +test justonce ENABLED 1 "in the master" SELECT * FROM t1; id c ts @@ -93,41 +99,41 @@ id c ts 1 manually TIMESTAMP 2 from justonce TIMESTAMP affected rows: 2 +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; +db name status originator +test justonce SLAVESIDE_DISABLED 1 DROP EVENT IF EXISTS test.slave_once; CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO INSERT INTO t1(c) VALUES ('from slave_once'); -SELECT db, name, status, originator FROM mysql.event; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once'; db name status originator -test justonce SLAVESIDE_DISABLED 1 test slave_once ENABLED 2 DROP EVENT IF EXISTS test.slave_once; DROP EVENT IF EXISTS test.justonce; -Warnings: -Note 1305 Event justonce does not exist CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO INSERT INTO t1(c) VALUES ('from er'); -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er ENABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er ENABLED 1 INSERT INTO t1(c) VALUES ('from er') "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er SLAVESIDE_DISABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er SLAVESIDE_DISABLED 1 INSERT INTO t1(c) VALUES ('from er') "in the master" ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO INSERT into t1(c) VALUES ('from alter er'); -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er ENABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er ENABLED 1 INSERT into t1(c) VALUES ('from alter er') "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator -test er SLAVESIDE_DISABLED 1 +SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; +db name status originator body +test er SLAVESIDE_DISABLED 1 INSERT into t1(c) VALUES ('from alter er') "in the master" DROP EVENT test.er; -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator "in the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'er'; +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator "in the master" DROP TABLE t1; diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7be5c94ad80..0c386fdc9c2 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -70,7 +70,7 @@ CALL create_slow_log_table(); DROP PROCEDURE create_slow_log_table; -CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index a639ff89fbe..7f54ac0dfe7 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -658,7 +658,8 @@ void Event_parse_data::check_originator_id(THD *thd) (thd->system_thread == SYSTEM_THREAD_SLAVE_IO)) { DBUG_PRINT("info", ("Invoked object status set to SLAVESIDE_DISABLED.")); - if (status == Event_basic::ENABLED) + if ((status == Event_basic::ENABLED) || + (status == Event_basic::DISABLED)) status = Event_basic::SLAVESIDE_DISABLED; originator = thd->server_id; } @@ -1590,6 +1591,13 @@ Event_queue_element::update_timing_fields(THD *thd) status_changed= FALSE; } + /* + Turn off row binlogging of event timing updates. These are not used + for RBR of events replicated to the slave. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + if ((table->file->ha_update_row(table->record[1], table->record[0]))) ret= TRUE; diff --git a/sql/event_queue.cc b/sql/event_queue.cc index c0f3166777c..4858becdf0d 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -197,8 +197,8 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element) DBUG_PRINT("enter", ("thd: 0x%lx et=%s.%s", (long) thd, new_element->dbname.str, new_element->name.str)); - if (res || new_element->status == Event_queue_element::DISABLED - || new_element->status == Event_queue_element::SLAVESIDE_DISABLED) + if ((new_element->status == Event_queue_element::DISABLED) + || (new_element->status == Event_queue_element::SLAVESIDE_DISABLED)) delete new_element; else { @@ -234,7 +234,8 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name, DBUG_ENTER("Event_queue::update_event"); DBUG_PRINT("enter", ("thd: 0x%lx et=[%s.%s]", (long) thd, dbname.str, name.str)); - if (new_element->status == Event_queue_element::DISABLED) + if ((new_element->status == Event_queue_element::DISABLED) || + (new_element->status == Event_queue_element::SLAVESIDE_DISABLED)) { DBUG_PRINT("info", ("The event is disabled.")); /* diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bb3f4a82e1b..2e2b661f932 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5447,8 +5447,8 @@ ST_FIELD_INFO events_fields_info[]= {"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0}, {"LAST_ALTERED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0}, {"LAST_EXECUTED", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, 0}, - {"ORIGINATOR", 10, MYSQL_TYPE_LONG, 0, 0, "Originator"}, {"EVENT_COMMENT", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"ORIGINATOR", 10, MYSQL_TYPE_LONG, 0, 0, "Originator"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; From cbbb40346ffaed733ba9784c7ee9f461667d45fd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 14:21:44 +0200 Subject: [PATCH 461/789] post-merge test fixes --- mysql-test/r/rpl_ndb_log.result | 8 ++-- mysql-test/r/rpl_truncate_7ndb.result | 60 +++++++++++++-------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result index f34f74aff2d..8d305e27bed 100644 --- a/mysql-test/r/rpl_ndb_log.result +++ b/mysql-test/r/rpl_ndb_log.result @@ -89,12 +89,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT show binary logs; Log_name File_size -master-bin.000001 1734 -master-bin.000002 596 +master-bin.000001 1774 +master-bin.000002 616 start slave; show binary logs; Log_name File_size -slave-bin.000001 1829 +slave-bin.000001 1869 slave-bin.000002 201 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info @@ -129,7 +129,7 @@ slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Query 2 # COMMIT show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 596 # # master-bin.000002 Yes Yes # 0 0 596 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 616 # # master-bin.000002 Yes Yes # 0 0 616 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result index 59c285d8a82..a41b89bfbc5 100644 --- a/mysql-test/r/rpl_truncate_7ndb.result +++ b/mysql-test/r/rpl_truncate_7ndb.result @@ -33,13 +33,13 @@ master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 222 Query 1 286 BEGIN master-bin.000001 286 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 326 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 381 Write_rows 1 137 table_id: # -master-bin.000001 423 Write_rows 1 175 table_id: # -master-bin.000001 461 Write_rows 1 213 table_id: # flags: STMT_END_F -master-bin.000001 499 Query 1 564 COMMIT -master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1 -master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1 +master-bin.000001 326 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 384 Write_rows 1 157 table_id: # +master-bin.000001 443 Write_rows 1 195 table_id: # +master-bin.000001 481 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 519 Query 1 584 COMMIT +master-bin.000001 584 Query 1 664 use `test`; TRUNCATE TABLE t1 +master-bin.000001 664 Query 1 740 use `test`; DROP TABLE t1 **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; INSERT INTO t1 VALUES (1,1), (2,2); @@ -70,26 +70,26 @@ master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 222 Query 1 286 BEGIN master-bin.000001 286 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 326 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 381 Write_rows 1 137 table_id: # -master-bin.000001 423 Write_rows 1 175 table_id: # -master-bin.000001 461 Write_rows 1 213 table_id: # flags: STMT_END_F -master-bin.000001 499 Query 1 564 COMMIT -master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1 -master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1 -master-bin.000001 720 Query 1 837 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 837 Query 1 901 BEGIN -master-bin.000001 901 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 941 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 996 Write_rows 1 137 table_id: # -master-bin.000001 1038 Write_rows 1 175 table_id: # -master-bin.000001 1076 Write_rows 1 213 table_id: # flags: STMT_END_F -master-bin.000001 1114 Query 1 1179 COMMIT -master-bin.000001 1179 Query 1 1243 BEGIN -master-bin.000001 1243 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 1283 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1338 Write_rows 1 137 table_id: # -master-bin.000001 1380 Delete_rows 1 171 table_id: # -master-bin.000001 1414 Delete_rows 1 205 table_id: # flags: STMT_END_F -master-bin.000001 1448 Query 1 1513 COMMIT -master-bin.000001 1513 Query 1 1589 use `test`; DROP TABLE t1 +master-bin.000001 326 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 384 Write_rows 1 157 table_id: # +master-bin.000001 443 Write_rows 1 195 table_id: # +master-bin.000001 481 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 519 Query 1 584 COMMIT +master-bin.000001 584 Query 1 664 use `test`; TRUNCATE TABLE t1 +master-bin.000001 664 Query 1 740 use `test`; DROP TABLE t1 +master-bin.000001 740 Query 1 857 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 857 Query 1 921 BEGIN +master-bin.000001 921 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 961 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1019 Write_rows 1 157 table_id: # +master-bin.000001 1078 Write_rows 1 195 table_id: # +master-bin.000001 1116 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 1154 Query 1 1219 COMMIT +master-bin.000001 1219 Query 1 1283 BEGIN +master-bin.000001 1283 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 1323 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1381 Write_rows 1 157 table_id: # +master-bin.000001 1440 Delete_rows 1 191 table_id: # +master-bin.000001 1474 Delete_rows 1 225 table_id: # flags: STMT_END_F +master-bin.000001 1508 Query 1 1573 COMMIT +master-bin.000001 1573 Query 1 1649 use `test`; DROP TABLE t1 From fff440d921738412f6386577ea3aaebdd962a5c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 14:21:45 +0200 Subject: [PATCH 462/789] Update test result after merge --- mysql-test/r/rpl_ignore_table.result | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/r/rpl_ignore_table.result index ce21913c5d4..80cff7c9a1e 100644 --- a/mysql-test/r/rpl_ignore_table.result +++ b/mysql-test/r/rpl_ignore_table.result @@ -30,6 +30,10 @@ create database mysqltest2; create table mysqltest2.t2 (id int); GRANT SELECT ON mysqltest2.t2 TO mysqltest4@localhost IDENTIFIED BY 'pass'; insert into mysql.user (user, host) values ("mysqltest5", "somehost"); +Warnings: +Warning 1364 Field 'ssl_cipher' doesn't have a default value +Warning 1364 Field 'x509_issuer' doesn't have a default value +Warning 1364 Field 'x509_subject' doesn't have a default value GRANT SELECT ON *.* TO mysqltest6@localhost; GRANT INSERT ON *.* TO mysqltest6@localhost; GRANT INSERT ON test.* TO mysqltest6@localhost; From d6422f61bab6cd227e2f854493e0ec1a2af97794 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 15:09:57 +0200 Subject: [PATCH 463/789] Bug#19991 CHANGE MASTER need option ssl-verify-server-cert - Add MASTER_SSL_VERIFY_SERVER_CERT option to CHANGE MASTER TO - Add Master_Ssl_Serify_Server_Cert to SHOW SLAVE STATUS - Save and restore ssl_verify_server_cert to master info file setting it to disabled as default. mysql-test/r/rpl_000015.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_change_master.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_empty_master_crash.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_flushlog_loop.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_loaddata.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_log_pos.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_rbr_to_sbr.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_redirect.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_replicate_do.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_rotate_logs.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_row_max_relay_size.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_server_id1.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_server_id2.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_slave_status.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_ssl1.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_stm_log.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_stm_max_relay_size.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_stm_reset_slave.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/r/rpl_stm_until.result: Update test result after adding new column to SHOW SLAVE STATUS mysql-test/t/rpl_ssl1.test: Change to "query_vertical show slave status" sql/lex.h: Add new token for MASTER_SSL_VERIFY_SERVER_CERT sql/repl_failsafe.cc: Turn on verification of master cert if so requested sql/rpl_mi.cc: Add new variable to MASTER_INFo and save/restore it from/to line 15 of master info file sql/rpl_mi.h: Add variable for ssl_verify_server_cert to MASTER_INFO sql/slave.cc: Turn on verification of master cert if so requested Add new column to SHOW SLAVE STATUS sql/sql_lex.h: Add ssl_verify_server_cert to "st_lex_master_info" struct - allow it to be UNCHANGED just like the ssl option. sql/sql_repl.cc: Add ssl_verify_server_cert to "st_lex_master_info" struct - allow it to be UNCHANGED just like the ssl option. sql/sql_yacc.yy: Add MASTER_SSL_VERIFY_SERVER_CERT to CHANGE MASTER TO mysql-test/t/rpl_ssl_verify_server.test: New BitKeeper file ``mysql-test/t/rpl_ssl_verify_server.test'' mysql-test/r/rpl_ssl_verify_server.result: New BitKeeper file ``mysql-test/r/rpl_ssl_verify_server.result'' --- mysql-test/r/rpl_000015.result | 14 +-- mysql-test/r/rpl_change_master.result | 8 +- mysql-test/r/rpl_empty_master_crash.result | 2 +- mysql-test/r/rpl_flushlog_loop.result | 1 + mysql-test/r/rpl_loaddata.result | 12 +-- mysql-test/r/rpl_log_pos.result | 16 ++-- mysql-test/r/rpl_openssl.result | 31 ------ mysql-test/r/rpl_rbr_to_sbr.result | 1 + mysql-test/r/rpl_redirect.result | 2 +- mysql-test/r/rpl_replicate_do.result | 4 +- mysql-test/r/rpl_rotate_logs.result | 12 +-- mysql-test/r/rpl_row_max_relay_size.result | 6 ++ mysql-test/r/rpl_server_id1.result | 4 +- mysql-test/r/rpl_server_id2.result | 4 +- mysql-test/r/rpl_slave_status.result | 1 + mysql-test/r/rpl_ssl1.result | 95 +++++++++++++++++++ mysql-test/r/rpl_ssl_verify_server.result | 57 +++++++++++ mysql-test/r/rpl_stm_log.result | 4 +- mysql-test/r/rpl_stm_max_relay_size.result | 6 ++ mysql-test/r/rpl_stm_reset_slave.result | 16 ++-- mysql-test/r/rpl_stm_until.result | 4 + .../t/{rpl_openssl.test => rpl_ssl1.test} | 4 +- mysql-test/t/rpl_ssl_verify_server.test | 34 +++++++ sql/lex.h | 1 + sql/repl_failsafe.cc | 4 + sql/rpl_mi.cc | 72 +++++++++----- sql/rpl_mi.h | 1 + sql/slave.cc | 9 ++ sql/sql_lex.h | 12 +-- sql/sql_repl.cc | 8 +- sql/sql_yacc.yy | 6 ++ 31 files changed, 340 insertions(+), 111 deletions(-) delete mode 100644 mysql-test/r/rpl_openssl.result create mode 100644 mysql-test/r/rpl_ssl1.result create mode 100644 mysql-test/r/rpl_ssl_verify_server.result rename mysql-test/t/{rpl_openssl.test => rpl_ssl1.test} (96%) create mode 100644 mysql-test/t/rpl_ssl_verify_server.test diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/r/rpl_000015.result index a53750f82ad..930d4cc4f11 100644 --- a/mysql-test/r/rpl_000015.result +++ b/mysql-test/r/rpl_000015.result @@ -4,20 +4,20 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 102 reset slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert change master to master_host='127.0.0.1'; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test DEFAULT_MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 test DEFAULT_MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # No change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # No start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # No drop table if exists t1; create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result index 513de9494ba..a3cd070b1b1 100644 --- a/mysql-test/r/rpl_change_master.result +++ b/mysql-test/r/rpl_change_master.result @@ -12,12 +12,12 @@ insert into t1 values(1); insert into t1 values(2); stop slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # No change master to master_user='root'; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # No start slave; select * from t1; n diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/r/rpl_empty_master_crash.result index 3e234d4ef59..d57600d7396 100644 --- a/mysql-test/r/rpl_empty_master_crash.result +++ b/mysql-test/r/rpl_empty_master_crash.result @@ -5,7 +5,7 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert load table t1 from master; ERROR 08S01: Error connecting to master: Master is not configured load table t1 from master; diff --git a/mysql-test/r/rpl_flushlog_loop.result b/mysql-test/r/rpl_flushlog_loop.result index 16d8ba251f4..03b7a10cde6 100644 --- a/mysql-test/r/rpl_flushlog_loop.result +++ b/mysql-test/r/rpl_flushlog_loop.result @@ -51,3 +51,4 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index cae11e98caa..ddcaa788ecf 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -38,8 +38,8 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; set global sql_slave_skip_counter=1; start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1793 # # master-bin.000001 Yes Yes # 0 0 1793 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1793 # # master-bin.000001 Yes Yes # 0 0 1793 # None 0 No # No set sql_log_bin=0; delete from t1; set sql_log_bin=1; @@ -48,8 +48,8 @@ stop slave; change master to master_user='test'; change master to master_user='root'; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1828 # # master-bin.000001 No No # 0 0 1828 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1828 # # master-bin.000001 No No # 0 0 1828 # None 0 No # No set global sql_slave_skip_counter=1; start slave; set sql_log_bin=0; @@ -59,8 +59,8 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1; stop slave; reset slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No reset master; create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)) engine=MyISAM; diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result index c7484022b23..8fca1f69fbf 100644 --- a/mysql-test/r/rpl_log_pos.result +++ b/mysql-test/r/rpl_log_pos.result @@ -8,26 +8,26 @@ show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 102 show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # No stop slave; change master to master_log_pos=74; start slave; stop slave; change master to master_log_pos=74; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No No 0 0 74 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No No 0 0 74 # None 0 No # No start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No Yes 0 0 74 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No Yes 0 0 74 # None 0 No # No stop slave; change master to master_log_pos=177; start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No # No show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 102 diff --git a/mysql-test/r/rpl_openssl.result b/mysql-test/r/rpl_openssl.result deleted file mode 100644 index 4fe02088632..00000000000 --- a/mysql-test/r/rpl_openssl.result +++ /dev/null @@ -1,31 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -grant replication slave on *.* to replssl@localhost require ssl; -create table t1 (t int); -stop slave; -change master to master_user='replssl',master_password=''; -start slave; -insert into t1 values (1); -select * from t1; -t -stop slave; -change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem'; -start slave; -select * from t1; -t -1 -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 replssl MASTER_MYPORT 1 # # # # # # Yes # 0 0 # # None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # -stop slave; -change master to master_user='root',master_password='', master_ssl=0; -start slave; -drop user replssl@localhost; -drop table t1; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 # # # # # # Yes # 0 0 # # None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/r/rpl_rbr_to_sbr.result index 4b2d129c732..46739ace854 100644 --- a/mysql-test/r/rpl_rbr_to_sbr.result +++ b/mysql-test/r/rpl_rbr_to_sbr.result @@ -55,6 +55,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 diff --git a/mysql-test/r/rpl_redirect.result b/mysql-test/r/rpl_redirect.result index dd16626cbe3..64866df1c15 100644 --- a/mysql-test/r/rpl_redirect.result +++ b/mysql-test/r/rpl_redirect.result @@ -5,7 +5,7 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert SHOW SLAVE HOSTS; Server_id Host Port Rpl_recovery_rank Master_id 2 127.0.0.1 SLAVE_PORT 2 1 diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result index 43e7c6779bf..f3eab5fe798 100644 --- a/mysql-test/r/rpl_replicate_do.result +++ b/mysql-test/r/rpl_replicate_do.result @@ -27,8 +27,8 @@ select * from t11; ERROR 42S02: Table 'test.t11' doesn't exist drop table if exists t1,t2,t11; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes test.t1 # 0 0 # # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes test.t1 # 0 0 # # None 0 No # No create table t1 (ts timestamp); set one_shot time_zone='met'; insert into t1 values('2005-08-12 00:00:00'); diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 264f5d224bd..85b867861a3 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -15,8 +15,8 @@ insert into temp_table values ("testing temporary tables"); create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 552 # # master-bin.000001 Yes Yes # 0 0 552 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 552 # # master-bin.000001 Yes Yes # 0 0 552 # None 0 No # No select * from t1; s Could not break slave @@ -56,8 +56,8 @@ Log_name File_size master-bin.000003 411 insert into t2 values (65); show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 500 # # master-bin.000003 Yes Yes # 0 0 500 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 500 # # master-bin.000003 Yes Yes # 0 0 500 # None 0 No # No select * from t2; m 34 @@ -84,8 +84,8 @@ select * from t4; a testing temporary tables part 2 show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2036 # # master-bin.000005 Yes Yes # 0 0 2036 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2036 # # master-bin.000005 Yes Yes # 0 0 2036 # None 0 No # No lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/r/rpl_row_max_relay_size.result b/mysql-test/r/rpl_row_max_relay_size.result index 8bb10ffb080..7b7d87ab6f4 100644 --- a/mysql-test/r/rpl_row_max_relay_size.result +++ b/mysql-test/r/rpl_row_max_relay_size.result @@ -57,6 +57,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 2 # @@ -100,6 +101,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 3: max_relay_log_size = 0 # @@ -143,6 +145,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # @@ -183,6 +186,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 5 # @@ -224,6 +228,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # @@ -263,6 +268,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No flush logs; show master status; File master-bin.000002 diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result index c94a7748fcd..4aff9a6f1f6 100644 --- a/mysql-test/r/rpl_server_id1.result +++ b/mysql-test/r/rpl_server_id1.result @@ -9,8 +9,8 @@ reset master; stop slave; change master to master_port=SLAVE_PORT; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 102 None 0 No NULL +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 102 None 0 No NULL No start slave; insert into t1 values (1); show status like "slave_running"; diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result index 72db862040e..41235c080c2 100644 --- a/mysql-test/r/rpl_server_id2.result +++ b/mysql-test/r/rpl_server_id2.result @@ -9,8 +9,8 @@ reset master; stop slave; change master to master_port=SLAVE_PORT; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 102 None 0 No NULL +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 102 None 0 No NULL No start slave; insert into t1 values (1); select * from t1; diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result index 641a65f5ed7..67bad8554c2 100644 --- a/mysql-test/r/rpl_slave_status.result +++ b/mysql-test/r/rpl_slave_status.result @@ -52,5 +52,6 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master NULL +Master_SSL_Verify_Server_Cert No drop table t1; drop table t1; diff --git a/mysql-test/r/rpl_ssl1.result b/mysql-test/r/rpl_ssl1.result new file mode 100644 index 00000000000..2cb9a8a7c48 --- /dev/null +++ b/mysql-test/r/rpl_ssl1.result @@ -0,0 +1,95 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +grant replication slave on *.* to replssl@localhost require ssl; +create table t1 (t int); +stop slave; +change master to master_user='replssl',master_password=''; +start slave; +insert into t1 values (1); +select * from t1; +t +stop slave; +change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem'; +start slave; +select * from t1; +t +1 +show slave status; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User replssl +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File # +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File # +Slave_IO_Running # +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table # +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed Yes +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem +Master_SSL_CA_Path +Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem +Master_SSL_Cipher +Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +stop slave; +change master to master_user='root',master_password='', master_ssl=0; +start slave; +drop user replssl@localhost; +drop table t1; +show slave status; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File # +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File # +Slave_IO_Running # +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table # +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem +Master_SSL_CA_Path +Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem +Master_SSL_Cipher +Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No diff --git a/mysql-test/r/rpl_ssl_verify_server.result b/mysql-test/r/rpl_ssl_verify_server.result new file mode 100644 index 00000000000..18265ca2ec8 --- /dev/null +++ b/mysql-test/r/rpl_ssl_verify_server.result @@ -0,0 +1,57 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +change master to +master_host="localhost", +master_ssl=1 , +master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', +master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', +master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem', +master_ssl_verify_server_cert=1; +start slave; +create table t1 (t int); +insert into t1 values (1); +on slave +select * from t1; +t +1 +show slave status; +Slave_IO_State # +Master_Host localhost +Master_User root +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File # +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File # +Slave_IO_Running # +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table # +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed Yes +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem +Master_SSL_CA_Path +Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem +Master_SSL_Cipher +Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert Yes +drop table t1; diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result index e0b1aa12c9b..b1e08d2176f 100644 --- a/mysql-test/r/rpl_stm_log.result +++ b/mysql-test/r/rpl_stm_log.result @@ -91,8 +91,8 @@ slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1) show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 388 # # master-bin.000002 Yes Yes # 0 0 388 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 388 # # master-bin.000002 Yes Yes # 0 0 388 # None 0 No # No show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/r/rpl_stm_max_relay_size.result index c4a9a5bd3ff..e963f229cc4 100644 --- a/mysql-test/r/rpl_stm_max_relay_size.result +++ b/mysql-test/r/rpl_stm_max_relay_size.result @@ -55,6 +55,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 2 # @@ -98,6 +99,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 3: max_relay_log_size = 0 # @@ -141,6 +143,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # @@ -181,6 +184,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 5 # @@ -222,6 +226,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # @@ -261,6 +266,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No flush logs; show master status; File master-bin.000002 diff --git a/mysql-test/r/rpl_stm_reset_slave.result b/mysql-test/r/rpl_stm_reset_slave.result index 834b9add089..81c71ba6891 100644 --- a/mysql-test/r/rpl_stm_reset_slave.result +++ b/mysql-test/r/rpl_stm_reset_slave.result @@ -5,21 +5,21 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # No stop slave; change master to master_user='test'; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # No reset slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # No stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_stm_until.result b/mysql-test/r/rpl_stm_until.result index e8e33b66864..f186473804e 100644 --- a/mysql-test/r/rpl_stm_until.result +++ b/mysql-test/r/rpl_stm_until.result @@ -53,6 +53,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; select * from t1; n @@ -94,6 +95,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; select * from t2; n @@ -133,6 +135,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No start slave; stop slave; start slave until master_log_file='master-bin.000001', master_log_pos=776; @@ -170,6 +173,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No start slave until master_log_file='master-bin', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_ssl1.test similarity index 96% rename from mysql-test/t/rpl_openssl.test rename to mysql-test/t/rpl_ssl1.test index 00ae5c935bf..c48155c0fa1 100644 --- a/mysql-test/t/rpl_openssl.test +++ b/mysql-test/t/rpl_ssl1.test @@ -46,7 +46,7 @@ select * from t1; #checking show slave status --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # -show slave status; +query_vertical show slave status; #checking if replication works without ssl also performing clean up stop slave; @@ -60,6 +60,6 @@ connection slave; sync_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # -show slave status; +query_vertical show slave status; # End of 4.1 tests diff --git a/mysql-test/t/rpl_ssl_verify_server.test b/mysql-test/t/rpl_ssl_verify_server.test new file mode 100644 index 00000000000..de83abdf566 --- /dev/null +++ b/mysql-test/t/rpl_ssl_verify_server.test @@ -0,0 +1,34 @@ +source include/have_openssl.inc; +source include/master-slave.inc; + +# Start replication with ssl_verify_server_cert turned on +connection slave; +stop slave; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval change master to + master_host="localhost", + master_ssl=1 , + master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', + master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', + master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem', + master_ssl_verify_server_cert=1; +start slave; + +connection master; +create table t1 (t int); +insert into t1 values (1); + +sync_slave_with_master; + +echo on slave; +#checking that replication is ok +select * from t1; + +#checking show slave status +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT +--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # +query_vertical show slave status; + +connection master; +drop table t1; +sync_slave_with_master; diff --git a/sql/lex.h b/sql/lex.h index 2bf0e08c825..99f7b1734ce 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -312,6 +312,7 @@ static SYMBOL symbols[] = { { "MASTER_SSL_CERT", SYM(MASTER_SSL_CERT_SYM)}, { "MASTER_SSL_CIPHER",SYM(MASTER_SSL_CIPHER_SYM)}, { "MASTER_SSL_KEY", SYM(MASTER_SSL_KEY_SYM)}, + { "MASTER_SSL_VERIFY_SERVER_CERT", SYM(MASTER_SSL_VERIFY_SERVER_CERT_SYM)}, { "MASTER_USER", SYM(MASTER_USER_SYM)}, { "MATCH", SYM(MATCH)}, { "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR)}, diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 16b00cab516..33caaf975a8 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -696,12 +696,16 @@ int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi) #ifdef HAVE_OPENSSL if (mi->ssl) + { mysql_ssl_set(mysql, mi->ssl_key[0]?mi->ssl_key:0, mi->ssl_cert[0]?mi->ssl_cert:0, mi->ssl_ca[0]?mi->ssl_ca:0, mi->ssl_capath[0]?mi->ssl_capath:0, mi->ssl_cipher[0]?mi->ssl_cipher:0); + mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, + &mi->ssl_verify_server_cert); + } #endif mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname); diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 1c426eff768..354a97cefde 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -29,12 +29,13 @@ int init_strvar_from_file(char *var, int max_size, IO_CACHE *f, MASTER_INFO::MASTER_INFO() :ssl(0), fd(-1), io_thd(0), inited(0), - abort_slave(0),slave_running(0), slave_run_id(0) + abort_slave(0),slave_running(0), slave_run_id(0), + ssl_verify_server_cert(0) { host[0] = 0; user[0] = 0; password[0] = 0; ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0; ssl_cipher[0]= 0; ssl_key[0]= 0; - + bzero((char*) &file, sizeof(file)); pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST); pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST); @@ -80,12 +81,21 @@ void init_master_info_with_options(MASTER_INFO* mi) strmake(mi->ssl_cipher, master_ssl_cipher, sizeof(mi->ssl_cipher)-1); if (master_ssl_key) strmake(mi->ssl_key, master_ssl_key, sizeof(mi->ssl_key)-1); + /* Intentionally init ssl_verify_server_cert to 0, no option available */ + mi->ssl_verify_server_cert= 0; DBUG_VOID_RETURN; } -#define LINES_IN_MASTER_INFO_WITH_SSL 14 +enum { + LINES_IN_MASTER_INFO_WITH_SSL= 14, + /* 5.1.16 added value of master_ssl_verify_server_cert */ + LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT= 15, + + /* Number of lines currently used when saving master info file */ + LINES_IN_MASTER_INFO= LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT +}; int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, @@ -184,7 +194,8 @@ file '%s')", fname); } mi->fd = fd; - int port, connect_retry, master_log_pos, ssl= 0, lines; + int port, connect_retry, master_log_pos, lines; + int ssl= 0, ssl_verify_server_cert= 0; char *first_non_digit; /* @@ -195,7 +206,8 @@ file '%s')", fname); file since versions before 4.1.x could generate files with more lines than needed. If first line doesn't contain a number or contain number less than - 14 then such file is treated like file from pre 4.1.1 version. + LINES_IN_MASTER_INFO_WITH_SSL then such file is treated like file + from pre 4.1.1 version. There is no ambiguity when reading an old master.info, as before 4.1.1, the first line contained the binlog's name, which is either empty or has an extension (contains a '.'), so can't be confused @@ -219,7 +231,8 @@ file '%s')", fname); if (mi->master_log_name[0]!='\0' && *first_non_digit=='\0' && lines >= LINES_IN_MASTER_INFO_WITH_SSL) - { // Seems to be new format + { + /* Seems to be new format => read master log name from next line */ if (init_strvar_from_file(mi->master_log_name, sizeof(mi->master_log_name), &mi->file, "")) goto errwithmsg; @@ -245,19 +258,31 @@ file '%s')", fname); slave will try connect to master, so in this case warning is printed. */ - if (lines >= LINES_IN_MASTER_INFO_WITH_SSL && - (init_intvar_from_file(&ssl, &mi->file, master_ssl) || - init_strvar_from_file(mi->ssl_ca, sizeof(mi->ssl_ca), - &mi->file, master_ssl_ca) || - init_strvar_from_file(mi->ssl_capath, sizeof(mi->ssl_capath), - &mi->file, master_ssl_capath) || - init_strvar_from_file(mi->ssl_cert, sizeof(mi->ssl_cert), - &mi->file, master_ssl_cert) || - init_strvar_from_file(mi->ssl_cipher, sizeof(mi->ssl_cipher), - &mi->file, master_ssl_cipher) || - init_strvar_from_file(mi->ssl_key, sizeof(mi->ssl_key), - &mi->file, master_ssl_key))) - goto errwithmsg; + if (lines >= LINES_IN_MASTER_INFO_WITH_SSL) + { + if (init_intvar_from_file(&ssl, &mi->file, master_ssl) || + init_strvar_from_file(mi->ssl_ca, sizeof(mi->ssl_ca), + &mi->file, master_ssl_ca) || + init_strvar_from_file(mi->ssl_capath, sizeof(mi->ssl_capath), + &mi->file, master_ssl_capath) || + init_strvar_from_file(mi->ssl_cert, sizeof(mi->ssl_cert), + &mi->file, master_ssl_cert) || + init_strvar_from_file(mi->ssl_cipher, sizeof(mi->ssl_cipher), + &mi->file, master_ssl_cipher) || + init_strvar_from_file(mi->ssl_key, sizeof(mi->ssl_key), + &mi->file, master_ssl_key)) + goto errwithmsg; + + /* + Starting from 5.1.16 ssl_verify_server_cert might be + in the file + */ + if (lines >= LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT && + init_intvar_from_file(&ssl_verify_server_cert, &mi->file, 0)) + goto errwithmsg; + + } + #ifndef HAVE_OPENSSL if (ssl) sql_print_warning("SSL information in the master info file " @@ -273,6 +298,7 @@ file '%s')", fname); mi->port= (uint) port; mi->connect_retry= (uint) connect_retry; mi->ssl= (my_bool) ssl; + mi->ssl_verify_server_cert= ssl_verify_server_cert; } DBUG_PRINT("master_info",("log_file_name: %s position: %ld", mi->master_log_name, @@ -315,6 +341,7 @@ int flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache) { IO_CACHE* file = &mi->file; char lbuf[22]; + DBUG_ENTER("flush_master_info"); DBUG_PRINT("enter",("master_pos: %ld", (long) mi->master_log_pos)); @@ -352,13 +379,14 @@ int flush_master_info(MASTER_INFO* mi, bool flush_relay_log_cache) */ my_b_seek(file, 0L); - my_b_printf(file, "%u\n%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n%s\n%s\n%s\n%s\n%s\n", - LINES_IN_MASTER_INFO_WITH_SSL, + my_b_printf(file, + "%u\n%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n%s\n%s\n%s\n%s\n%s\n%d\n", + LINES_IN_MASTER_INFO, mi->master_log_name, llstr(mi->master_log_pos, lbuf), mi->host, mi->user, mi->password, mi->port, mi->connect_retry, (int)(mi->ssl), mi->ssl_ca, mi->ssl_capath, mi->ssl_cert, - mi->ssl_cipher, mi->ssl_key); + mi->ssl_cipher, mi->ssl_key, mi->ssl_verify_server_cert); DBUG_RETURN(-flush_io_cache(file)); } diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index ae77e64d93a..c39a89a35b3 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -65,6 +65,7 @@ class MASTER_INFO my_bool ssl; // enables use of SSL connection if true char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN]; char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN]; + my_bool ssl_verify_server_cert; my_off_t master_log_pos; File fd; // we keep the file open, so we need to remember the file pointer diff --git a/sql/slave.cc b/sql/slave.cc index 6f3c5926023..65a97162f32 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1248,6 +1248,8 @@ bool show_master_info(THD* thd, MASTER_INFO* mi) sizeof(mi->ssl_key))); field_list.push_back(new Item_return_int("Seconds_Behind_Master", 10, MYSQL_TYPE_LONGLONG)); + field_list.push_back(new Item_empty_string("Master_SSL_Verify_Server_Cert", + 3)); if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) @@ -1354,7 +1356,10 @@ bool show_master_info(THD* thd, MASTER_INFO* mi) max(0, time_diff) : 0)); } else + { protocol->store_null(); + } + protocol->store(mi->ssl_verify_server_cert? "Yes":"No", &my_charset_bin); pthread_mutex_unlock(&mi->rli.data_lock); pthread_mutex_unlock(&mi->data_lock); @@ -3092,12 +3097,16 @@ static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi, #ifdef HAVE_OPENSSL if (mi->ssl) + { mysql_ssl_set(mysql, mi->ssl_key[0]?mi->ssl_key:0, mi->ssl_cert[0]?mi->ssl_cert:0, mi->ssl_ca[0]?mi->ssl_ca:0, mi->ssl_capath[0]?mi->ssl_capath:0, mi->ssl_cipher[0]?mi->ssl_cipher:0); + mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, + &mi->ssl_verify_server_cert); + } #endif mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 821af3f946d..2b69baa3ec1 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -188,12 +188,12 @@ typedef struct st_lex_master_info uint port, connect_retry; ulonglong pos; ulong server_id; - /* - Variable for MASTER_SSL option. - MASTER_SSL=0 in CHANGE MASTER TO corresponds to SSL_DISABLE - MASTER_SSL=1 corresponds to SSL_ENABLE - */ - enum {SSL_UNCHANGED=0, SSL_DISABLE, SSL_ENABLE} ssl; + /* + Enum is used for making it possible to detect if the user + changed variable or if it should be left at old value + */ + enum {SSL_UNCHANGED, SSL_DISABLE, SSL_ENABLE} + ssl, ssl_verify_server_cert; char *ssl_key, *ssl_cert, *ssl_ca, *ssl_capath, *ssl_cipher; char *relay_log_name; ulong relay_log_pos; diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 17163fb1940..250ab596b02 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1126,6 +1126,11 @@ bool change_master(THD* thd, MASTER_INFO* mi) if (lex_mi->ssl != LEX_MASTER_INFO::SSL_UNCHANGED) mi->ssl= (lex_mi->ssl == LEX_MASTER_INFO::SSL_ENABLE); + + if (lex_mi->ssl_verify_server_cert != LEX_MASTER_INFO::SSL_UNCHANGED) + mi->ssl_verify_server_cert= + (lex_mi->ssl_verify_server_cert == LEX_MASTER_INFO::SSL_ENABLE); + if (lex_mi->ssl_ca) strmake(mi->ssl_ca, lex_mi->ssl_ca, sizeof(mi->ssl_ca)-1); if (lex_mi->ssl_capath) @@ -1138,7 +1143,8 @@ bool change_master(THD* thd, MASTER_INFO* mi) strmake(mi->ssl_key, lex_mi->ssl_key, sizeof(mi->ssl_key)-1); #ifndef HAVE_OPENSSL if (lex_mi->ssl || lex_mi->ssl_ca || lex_mi->ssl_capath || - lex_mi->ssl_cert || lex_mi->ssl_cipher || lex_mi->ssl_key ) + lex_mi->ssl_cert || lex_mi->ssl_cipher || lex_mi->ssl_key || + lex_mi->ssl_verify_server_cert ) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_IGNORED_SSL_PARAMS, ER(ER_SLAVE_IGNORED_SSL_PARAMS)); #endif diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 424fd98c4fc..3aa56cea4d7 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -645,6 +645,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token MASTER_SSL_CIPHER_SYM %token MASTER_SSL_KEY_SYM %token MASTER_SSL_SYM +%token MASTER_SSL_VERIFY_SERVER_CERT_SYM %token MASTER_SYM %token MASTER_USER_SYM %token MATCH /* SQL-2003-R */ @@ -1390,6 +1391,11 @@ master_def: { Lex->mi.ssl_key= $3.str; } + | MASTER_SSL_VERIFY_SERVER_CERT_SYM EQ ulong_num + { + Lex->mi.ssl_verify_server_cert= $3 ? + LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE; + } | master_file_def ; From 0d6367f6692b66e16f5861d42ee21ebd4128d12d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 18:42:27 +0500 Subject: [PATCH 464/789] bug #24633 (sql_mode NO_DIR_IN_CREATE doesn't work with partitioned tables) additional patch to fix SHOW CREATE behaviour mysql-test/r/partition.result: result fixed mysql-test/t/partition.test: testcase sql/sql_partition.cc: check MODE_NO_DIR_IN_CREATE for partitioned tables in SHOW CREATE statement --- mysql-test/r/partition.result | 8 +++++++- mysql-test/t/partition.test | 14 +++++++++++++- sql/sql_partition.cc | 15 +++++++++------ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 35b760cfc9d..2e5fa4b9195 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1231,5 +1231,11 @@ partition p01 values less than (1000) data directory='/not/existing' index directory='/not/existing' ); -DROP TABLE t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `i` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ +DROP TABLE t1, t2; +set @@sql_mode=@org_mode; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 814d96d087d..399f3c4a41d 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1467,6 +1467,16 @@ drop table t1, t2; # Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables # +disable_query_log; +eval create table t2 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory="$MYSQLTEST_VARDIR/master-data/test/" + index directory="$MYSQLTEST_VARDIR/master-data/test/" +); +enable_query_log; + set @org_mode=@@sql_mode; set @@sql_mode='NO_DIR_IN_CREATE'; select @@sql_mode; @@ -1478,6 +1488,8 @@ partition by range (i) index directory='/not/existing' ); -DROP TABLE t1; +show create table t2; +DROP TABLE t1, t2; +set @@sql_mode=@org_mode; --echo End of 5.1 tests diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index dbac53ed5f6..0dae41e7bad 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1892,12 +1892,15 @@ static int add_partition_options(File fptr, partition_element *p_elem) err+= add_keyword_int(fptr,"MAX_ROWS",(longlong)p_elem->part_max_rows); if (p_elem->part_min_rows) err+= add_keyword_int(fptr,"MIN_ROWS",(longlong)p_elem->part_min_rows); - if (p_elem->data_file_name) - err+= add_keyword_string(fptr, "DATA DIRECTORY", TRUE, - p_elem->data_file_name); - if (p_elem->index_file_name) - err+= add_keyword_string(fptr, "INDEX DIRECTORY", TRUE, - p_elem->index_file_name); + if (!(current_thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)) + { + if (p_elem->data_file_name) + err+= add_keyword_string(fptr, "DATA DIRECTORY", TRUE, + p_elem->data_file_name); + if (p_elem->index_file_name) + err+= add_keyword_string(fptr, "INDEX DIRECTORY", TRUE, + p_elem->index_file_name); + } if (p_elem->part_comment) err+= add_keyword_string(fptr, "COMMENT", TRUE, p_elem->part_comment); return err + add_engine(fptr,p_elem->engine_type); From 9bf9e226ca45e02f8f83cebaedb395ed84141dc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 16:11:02 +0200 Subject: [PATCH 465/789] After merge fixes BitKeeper/deleted/.del-rpl_ssl_verify_server.test: Delete: mysql-test/t/rpl_ssl_verify_server.test BitKeeper/deleted/.del-rpl_ssl_verify_server.result: Delete: mysql-test/r/rpl_ssl_verify_server.result mysql-test/r/rpl_known_bugs_detection.result: Add new column after merge mysql-test/r/rpl_ssl.result: Add new column after merge mysql-test/r/rpl_ssl1.result: Merge test and result file mysql-test/t/rpl_ssl1.test: Merge test and result file --- mysql-test/r/rpl_known_bugs_detection.result | 2 + mysql-test/r/rpl_ssl.result | 2 + mysql-test/r/rpl_ssl1.result | 51 ++++++++++++++++++ mysql-test/r/rpl_ssl_verify_server.result | 57 -------------------- mysql-test/t/rpl_ssl1.test | 32 +++++++++++ mysql-test/t/rpl_ssl_verify_server.test | 34 ------------ 6 files changed, 87 insertions(+), 91 deletions(-) delete mode 100644 mysql-test/r/rpl_ssl_verify_server.result delete mode 100644 mysql-test/t/rpl_ssl_verify_server.test diff --git a/mysql-test/r/rpl_known_bugs_detection.result b/mysql-test/r/rpl_known_bugs_detection.result index eabc6185780..a09d63a5848 100644 --- a/mysql-test/r/rpl_known_bugs_detection.result +++ b/mysql-test/r/rpl_known_bugs_detection.result @@ -45,6 +45,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SELECT * FROM t1; a b stop slave; @@ -127,6 +128,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SELECT * FROM t1; id field_1 field_2 field_3 drop table t1, t2; diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result index 33deb9a8c92..f68b639b12d 100644 --- a/mysql-test/r/rpl_ssl.result +++ b/mysql-test/r/rpl_ssl.result @@ -53,6 +53,7 @@ Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No STOP SLAVE; select * from t1; t @@ -91,3 +92,4 @@ Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No diff --git a/mysql-test/r/rpl_ssl1.result b/mysql-test/r/rpl_ssl1.result index 2cb9a8a7c48..6bc4b53849f 100644 --- a/mysql-test/r/rpl_ssl1.result +++ b/mysql-test/r/rpl_ssl1.result @@ -93,3 +93,54 @@ Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No +stop slave; +change master to +master_host="localhost", +master_ssl=1 , +master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', +master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', +master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem', +master_ssl_verify_server_cert=1; +start slave; +create table t1 (t int); +insert into t1 values (1); +on slave +select * from t1; +t +1 +show slave status; +Slave_IO_State # +Master_Host localhost +Master_User root +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File # +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File # +Slave_IO_Running # +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table # +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed Yes +Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem +Master_SSL_CA_Path +Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem +Master_SSL_Cipher +Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert Yes +drop table t1; diff --git a/mysql-test/r/rpl_ssl_verify_server.result b/mysql-test/r/rpl_ssl_verify_server.result deleted file mode 100644 index 18265ca2ec8..00000000000 --- a/mysql-test/r/rpl_ssl_verify_server.result +++ /dev/null @@ -1,57 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -stop slave; -change master to -master_host="localhost", -master_ssl=1 , -master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', -master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', -master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem', -master_ssl_verify_server_cert=1; -start slave; -create table t1 (t int); -insert into t1 values (1); -on slave -select * from t1; -t -1 -show slave status; -Slave_IO_State # -Master_Host localhost -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File # -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File # -Slave_IO_Running # -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed Yes -Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem -Master_SSL_CA_Path -Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem -Master_SSL_Cipher -Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert Yes -drop table t1; diff --git a/mysql-test/t/rpl_ssl1.test b/mysql-test/t/rpl_ssl1.test index cb7bee8e6d3..6ca1484bb17 100644 --- a/mysql-test/t/rpl_ssl1.test +++ b/mysql-test/t/rpl_ssl1.test @@ -63,3 +63,35 @@ sync_with_master; query_vertical show slave status; # End of 4.1 tests + +# Start replication with ssl_verify_server_cert turned on +connection slave; +stop slave; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval change master to + master_host="localhost", + master_ssl=1 , + master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', + master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', + master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem', + master_ssl_verify_server_cert=1; +start slave; + +connection master; +create table t1 (t int); +insert into t1 values (1); + +sync_slave_with_master; + +echo on slave; +#checking that replication is ok +select * from t1; + +#checking show slave status +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT +--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # +query_vertical show slave status; + +connection master; +drop table t1; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_ssl_verify_server.test b/mysql-test/t/rpl_ssl_verify_server.test deleted file mode 100644 index de83abdf566..00000000000 --- a/mysql-test/t/rpl_ssl_verify_server.test +++ /dev/null @@ -1,34 +0,0 @@ -source include/have_openssl.inc; -source include/master-slave.inc; - -# Start replication with ssl_verify_server_cert turned on -connection slave; -stop slave; ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval change master to - master_host="localhost", - master_ssl=1 , - master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', - master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', - master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem', - master_ssl_verify_server_cert=1; -start slave; - -connection master; -create table t1 (t int); -insert into t1 values (1); - -sync_slave_with_master; - -echo on slave; -#checking that replication is ok -select * from t1; - -#checking show slave status ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # -query_vertical show slave status; - -connection master; -drop table t1; -sync_slave_with_master; From 169771462158ec5da9112322d803f027ed39e19b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 16:42:08 +0200 Subject: [PATCH 466/789] Bug#26922 Test 'varbinary' fails to do copy_file on Windows - Copy all *.MY* files from std_data/, we have some .MYD and .MYI files from 4.1 there 5.0 version of make_win_bin_dist copies everything in std_data/ scripts/make_win_bin_dist: Copy all *.MY* files from std_data/, we have some .MYD and .MYI files from 4.1 there 5.0 version of make_win_bin_dist copies everything in std_data/ --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 146dcad95f1..1cd4141f532 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -302,6 +302,7 @@ cp mysql-test/std_data/*.cnf $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.dat $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.frm $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.pem $DESTDIR/mysql-test/std_data/ +cp mysql-test/std_data/*.MY* $DESTDIR/mysql-test/std_data/ cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/ cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/ cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ From cc88dd89949a0cf7f712c957b66172cc11984cf5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 16:47:38 +0200 Subject: [PATCH 467/789] Fix compiler warnings sql/mysqld.cc: Fix compiler warning sql/stacktrace.c: Fix compiler warning --- sql/mysqld.cc | 2 ++ sql/stacktrace.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ce53cd22669..7d12c66e7e5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -599,7 +599,9 @@ pthread_mutex_t LOCK_server_started; pthread_cond_t COND_server_started; int mysqld_server_started= 0; +#ifndef EMBEDDED_LIBRARY static uint thr_kill_signal; +#endif File_parser_dummy_hook file_parser_dummy_hook; diff --git a/sql/stacktrace.c b/sql/stacktrace.c index 0dbf4522a71..078f62c6b2b 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -53,8 +53,6 @@ void safe_print_str(const char* name, const char* val, int max_len) #define SIGRETURN_FRAME_OFFSET 23 #endif -static my_bool is_nptl; - #if defined(__alpha__) && defined(__GNUC__) /* The only way to backtrace without a symbol table on alpha From af26b2b87efe108fbaa19c83506411a43a005b33 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 11:11:28 -0400 Subject: [PATCH 468/789] WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the originator column in the results of the SHOW EVENTS command for a series of tests. The only code change is to correct references to the classname in enums. mysql-test/r/events.result: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the originator column in the results of the SHOW EVENTS command. mysql-test/r/events_bugs.result: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the originator column in the results of the SHOW EVENTS command. mysql-test/r/events_time_zone.result: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the originator column in the results of the SHOW EVENTS command. mysql-test/r/mysqldump.result: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the originator column in the results of the SHOW EVENTS command. mysql-test/r/ps.result: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the originator column in the results of the SHOW EVENTS command. mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the originator column in the results of the SHOW EVENTS command. sql/event_data_objects.cc: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge. It adds the classname to the enums appearing in another patch. --- mysql-test/r/events.result | 6 +- mysql-test/r/events_bugs.result | 2 +- mysql-test/r/events_time_zone.result | 62 +++++++++---------- mysql-test/r/mysqldump.result | 24 +++---- mysql-test/r/ps.result | 12 ++-- .../suite/rpl/r/rpl_innodb_mixed_dml.result | 12 ++-- sql/event_data_objects.cc | 6 +- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index efb8fb2fd91..59073358185 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -229,10 +229,10 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 ALTER TABLE mysql.event ADD dummy INT FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 19. Table probably corrupted ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 19. Table probably corrupted ALTER TABLE mysql.event DROP dummy2; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator @@ -281,7 +281,7 @@ SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. ALTER TABLE mysql.event DROP comment, DROP starts; SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. Table probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 16. Table probably corrupted DROP TABLE mysql.event; CREATE TABLE mysql.event like event_like; INSERT INTO mysql.event SELECT * FROM event_like; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 1a34f098b12..9b58420465e 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -30,7 +30,7 @@ create event e_55 on schedule at 20000101000000 do drop table t; Warnings: Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starts 10000101000000 do drop table t' at line 1 create event e_55 on schedule at 20200101000000 ends 10000101000000 do drop table t; diff --git a/mysql-test/r/events_time_zone.result b/mysql-test/r/events_time_zone.result index 3d5ff794848..ec5cae88f4f 100644 --- a/mysql-test/r/events_time_zone.result +++ b/mysql-test/r/events_time_zone.result @@ -7,30 +7,30 @@ SET TIME_ZONE= '+00:00'; SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1 SET TIME_ZONE= '-01:00'; ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED 1 SET TIME_ZONE= '+02:00'; ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 SET TIME_ZONE= '-03:00'; ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' ON COMPLETION PRESERVE DISABLE; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1 SET TIME_ZONE= '+04:00'; ALTER EVENT e1 DO SELECT 2; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1 DROP EVENT e1; SET TIME_ZONE='+05:00'; CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO @@ -44,15 +44,15 @@ SET TIME_ZONE='+00:00'; CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO SELECT 1; SELECT * FROM INFORMATION_SCHEMA.EVENTS; -EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT -NULL mysqltest_db1 e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL -NULL mysqltest_db1 e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL -NULL mysqltest_db1 e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR +NULL mysqltest_db1 e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 +NULL mysqltest_db1 e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 +NULL mysqltest_db1 e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 SHOW CREATE EVENT e1; Event sql_mode time_zone Create Event e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 @@ -92,10 +92,10 @@ SELECT 1; Warnings: Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 The following should succeed giving a warning. ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; @@ -128,15 +128,15 @@ CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' DO SELECT 1; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED -mysqltest_db1 e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +mysqltest_db1 e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 +mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +mysqltest_db1 e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +mysqltest_db1 e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 +mysqltest_db1 e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 +mysqltest_db1 e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +mysqltest_db1 e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 DROP EVENT e8; DROP EVENT e7; DROP EVENT e6; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index da90ff2cf6b..895e5dd46fa 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3440,8 +3440,8 @@ use first; set time_zone = 'UTC'; create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 show create event ee1; Event sql_mode time_zone Create Event ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 @@ -3449,26 +3449,26 @@ drop database first; create database second; use second; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 show create event ee1; Event sql_mode time_zone Create Event ee1 NO_AUTO_VALUE_ON_ZERO UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5; create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED -second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED -second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 +second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 +second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 drop database second; create database third; use third; show events; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED -third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED -third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 +third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 +third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 drop database third; set time_zone = 'SYSTEM'; use test; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index c4e44945ec4..1df845850b8 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1968,11 +1968,11 @@ prepare abc from "show master logs"; deallocate prepare abc; create procedure proc_1() show events; call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator drop procedure proc_1; create function func_1() returns int begin show events; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -1982,11 +1982,11 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show events"; execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator deallocate prepare abc; drop procedure if exists a; create procedure a() select 42; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 183c57c0c04..8c625dc70a4 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -683,12 +683,12 @@ INSERT INTO t1 VALUES(1, 'test1'); CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1; ==========MASTER========== SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator test_rpl e1 root@localhost RECURRING NULL 1 SECOND # # ENABLED ==========SLAVE=========== USE test_rpl; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator ==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) @@ -742,12 +742,12 @@ a b ALTER EVENT e1 RENAME TO e2; ==========MASTER========== SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator test_rpl e2 root@localhost RECURRING NULL 1 SECOND # # ENABLED ==========SLAVE=========== USE test_rpl; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator ==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) @@ -776,11 +776,11 @@ a b DROP EVENT e2; ==========MASTER========== SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator ==========SLAVE=========== USE test_rpl; SHOW EVENTS; -Db Name Definer Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator DELETE FROM t1; DELETE FROM t2; diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 9f9e778658f..a3fb9a284d5 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -244,7 +244,7 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc) if (ltime_utc >= (my_time_t) thd->query_start()) return; - if (on_completion == ON_COMPLETION_DROP) + if (on_completion == Event_basic::ON_COMPLETION_DROP) { switch (thd->lex->sql_command) { case SQLCOM_CREATE_EVENT: @@ -261,9 +261,9 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc) do_not_create= TRUE; } - else if (status == ENABLED) + else if (status == Event_basic::ENABLED) { - status= DISABLED; + status= Event_basic::DISABLED; push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_EVENT_EXEC_TIME_IN_THE_PAST, ER(ER_EVENT_EXEC_TIME_IN_THE_PAST)); From 09eff0aa5bdbfaebe47c155084d5d84e6f5adec4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 11:12:12 -0400 Subject: [PATCH 469/789] Bug #23491 MySQLDump prefix function call in a view by database name - 5.0 merged to 5.1 differences. sql/item_create.cc: Bug #23491 MySQLDump prefix function call in a view by database name - Added use_explicit_name to Create_sp_func::create method. - Default use_explicit_name to false when db name not specified. - Use use_explicit_name when creating sp_name object. sql/item_create.h: Bug #23491 MySQLDump prefix function call in a view by database name - Updated virtual function definition. sql/sql_yacc.yy: Bug #23491 MySQLDump prefix function call in a view by database name - Use new create method. --- sql/item_create.cc | 8 ++++---- sql/item_create.h | 3 ++- sql/sql_yacc.yy | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sql/item_create.cc b/sql/item_create.cc index ff5825ef389..617a24fac45 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -167,7 +167,7 @@ class Create_sp_func : public Create_qfunc { public: virtual Item* create(THD *thd, LEX_STRING db, LEX_STRING name, - List *item_list); + bool use_explicit_name, List *item_list); static Create_sp_func s_singleton; @@ -2316,7 +2316,7 @@ Create_qfunc::create(THD *thd, LEX_STRING name, List *item_list) if (thd->copy_db_to(&db.str, &db.length)) return NULL; - return create(thd, db, name, item_list); + return create(thd, db, name, false, item_list); } @@ -2433,7 +2433,7 @@ Create_sp_func Create_sp_func::s_singleton; Item* Create_sp_func::create(THD *thd, LEX_STRING db, LEX_STRING name, - List *item_list) + bool use_explicit_name, List *item_list) { int arg_count= 0; Item *func= NULL; @@ -2458,7 +2458,7 @@ Create_sp_func::create(THD *thd, LEX_STRING db, LEX_STRING name, if (item_list != NULL) arg_count= item_list->elements; - qname= new (thd->mem_root) sp_name(db, name); + qname= new (thd->mem_root) sp_name(db, name, use_explicit_name); qname->init_qname(thd); sp_add_used_routine(lex, thd, qname, TYPE_ENUM_FUNCTION); diff --git a/sql/item_create.h b/sql/item_create.h index 985c4428d8f..0a668b3e67f 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -87,11 +87,12 @@ public: @param thd The current thread @param db The database name @param name The function name + @param use_explicit_name Should the function be represented as 'db.name'? @param item_list The list of arguments to the function, can be NULL @return An item representing the parsed function call */ virtual Item* create(THD *thd, LEX_STRING db, LEX_STRING name, - List *item_list) = 0; + bool use_explicit_name, List *item_list) = 0; protected: /** Constructor. */ diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2a187f0138d..d6f8dd33588 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6921,7 +6921,7 @@ function_call_generic: builder= find_qualified_function_builder(thd); DBUG_ASSERT(builder); - item= builder->create(thd, $1, $3, $5); + item= builder->create(thd, $1, $3, true, $5); if (! ($$= item)) { From 40c1a3f9a23e687c61e55419b5b56072c8e2e7f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 19:19:31 +0300 Subject: [PATCH 470/789] Bug #26815: When creating a temporary table the concise column type of a string expression is decided based on its length: - if its length is under 512 it is stored as either varchar or char. - otherwise it is stored as a BLOB. There is a flag (convert_blob_length) to create_tmp_field that, when >0 allows to force creation of a varchar if the max blob length is under convert_blob_length. However it must be verified that convert_blob_length (settable through a SQL option in some cases) is under the maximum that can be stored in a varchar column. While performing that check for expressions in create_tmp_field_from_item the max length of the blob was used instead. This causes blob columns to be created in the heap temp table used by GROUP_CONCAT (where blobs must not be created in the temp table because of the constant convert_blob_length that is passed to create_tmp_field() ). And since these blob columns are not expected in that place we get wrong results. Fixed by checking that the value of the flag variable is in the limits that fit into VARCHAR instead of the max length of the blob column. mysql-test/r/func_gconcat.result: Bug #26815: test case mysql-test/t/func_gconcat.test: Bug #26815: test case sql/item_sum.cc: Bug #26815: wrong length was checked sql/sql_select.cc: Bug #26815: wrong length was checked --- mysql-test/r/func_gconcat.result | 10 ++++++++++ mysql-test/t/func_gconcat.test | 12 +++++++++++- sql/item_sum.cc | 3 +-- sql/sql_select.cc | 3 +-- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 6989b89833b..71419b5b2c3 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -728,3 +728,13 @@ f2 group_concat(f1) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2 drop table t1; +CREATE TABLE t1(a TEXT, b CHAR(20)); +INSERT INTO t1 VALUES ("one.1","one.1"),("two.2","two.2"),("one.3","one.3"); +SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1; +GROUP_CONCAT(DISTINCT UCASE(a)) +ONE.1,TWO.2,ONE.3 +SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; +GROUP_CONCAT(DISTINCT UCASE(b)) +ONE.1,TWO.2,ONE.3 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 3ff4b35873b..0dd82864520 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -497,4 +497,14 @@ select f2,group_concat(f1) from t1 group by f2; --disable_metadata drop table t1; -# End of 4.1 tests +# +# Bug #26815: Unexpected built-in function behavior: group_concat(distinct +# substring_index()) +# +CREATE TABLE t1(a TEXT, b CHAR(20)); +INSERT INTO t1 VALUES ("one.1","one.1"),("two.2","two.2"),("one.3","one.3"); +SELECT GROUP_CONCAT(DISTINCT UCASE(a)) FROM t1; +SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 368dc9a7d38..9d626cb7733 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -417,8 +417,7 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table, 2-byte lenght. */ if (max_length/collation.collation->mbmaxlen > 255 && - max_length/collation.collation->mbmaxlen < UINT_MAX16 && - convert_blob_length) + convert_blob_length < UINT_MAX16 && convert_blob_length) return new Field_varstring(convert_blob_length, maybe_null, name, table, collation.collation); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bb57764700d..7e9b1fec12e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8805,8 +8805,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, 2-byte lenght. */ else if (item->max_length/item->collation.collation->mbmaxlen > 255 && - item->max_length/item->collation.collation->mbmaxlen < UINT_MAX16 - && convert_blob_length) + convert_blob_length < UINT_MAX16 && convert_blob_length) new_field= new Field_varstring(convert_blob_length, maybe_null, item->name, table, item->collation.collation); From 0fdd64ba6391e556c3438733cb4f479f2c3395cf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 19:31:42 +0300 Subject: [PATCH 471/789] Merged from 5.0 --- mysys/thr_alarm.c | 5 ++++- sql/mysqld.cc | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 57670c9ac14..471ec0ab10d 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -76,7 +76,10 @@ void init_thr_alarm(uint max_alarms) sigfillset(&full_signal_set); /* Neaded to block signals */ pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_alarm,NULL); - thr_client_alarm= thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1; + if (thd_lib_detected == THD_LIB_LT) + thr_client_alarm= SIGALRM; + else + thr_client_alarm= SIGUSR1; #ifndef USE_ALARM_THREAD if (thd_lib_detected != THD_LIB_LT) #endif diff --git a/sql/mysqld.cc b/sql/mysqld.cc index cf9a139c0f9..b7858b3178d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2351,7 +2351,8 @@ static void init_signals(void) #ifdef SIGTSTP sigaddset(&set,SIGTSTP); #endif - sigaddset(&set,THR_SERVER_ALARM); + if (thd_lib_detected != THD_LIB_LT) + sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) { // May be SIGINT From a304bcac676e6cebdd356682c3855817c2bb4311 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 18:42:00 +0200 Subject: [PATCH 472/789] Bug #27529: Slave crashes on lots of updates - do not try to perge binlog when purge comes from slave, it never purges binlog anyways --- sql/ha_ndbcluster_binlog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 38b640d5f55..3a5dd21df2c 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -492,7 +492,7 @@ static int ndbcluster_reset_logs(THD *thd) static int ndbcluster_binlog_index_purge_file(THD *thd, const char *file) { - if (!ndb_binlog_running) + if (!ndb_binlog_running || thd->slave_thread) return 0; DBUG_ENTER("ndbcluster_binlog_index_purge_file"); From 442afcf452c9211efecccd3e7c60e5ee0c9f05be Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 19:51:42 +0300 Subject: [PATCH 473/789] Fixed memory leak in mysql_upgrade client/mysql_upgrade.c: Fixed memory leak Fixed indentation --- client/mysql_upgrade.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 21242818b21..33dab4e1909 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -171,7 +171,7 @@ void set_extra_default(int id, const struct my_option *opt) } d= (extra_default_t *)my_malloc(sizeof(extra_default_t), - MYF(MY_FAE|MY_ZEROFILL)); + MYF(MY_FAE | MY_ZEROFILL)); d->id= id; d->name= opt->name; d->n_len= strlen(opt->name); @@ -345,15 +345,17 @@ static int create_defaults_file(const char *path, const char *forced_path) } dynstr_set(&buf, NULL); } - if (dynstr_append_mem(&buf, "\n", 1) - || dynstr_append_mem(&buf, d->name, d->n_len) - || (d->v_len && (dynstr_append_mem(&buf, "=", 1) - || dynstr_append_mem(&buf, d->value, d->v_len)))) + if (dynstr_append_mem(&buf, "\n", 1) || + dynstr_append_mem(&buf, d->name, d->n_len) || + (d->v_len && (dynstr_append_mem(&buf, "=", 1) || + dynstr_append_mem(&buf, d->value, d->v_len)))) { ret= 1; goto error; } my_delete((gptr)d, MYF(0)); + my_free((gptr) d, MYF(0)); + list_pop(extra_defaults); /* pop off the head */ } if (my_write(defaults_file, buf.str, buf.length, MYF(MY_FNABP | MY_WME))) @@ -451,10 +453,10 @@ int main(int argc, char **argv) char *forced_extra_defaults; char *local_defaults_group_suffix; const char *script_line; - char *upgrade_defaults_path; + char *upgrade_defaults_path= NULL; char *defaults_to_use= NULL; int upgrade_defaults_created= 0; - + int no_defaults; char path[FN_REFLEN]; DYNAMIC_STRING cmdline; @@ -464,6 +466,10 @@ int main(int argc, char **argv) #endif /* Check if we are forced to use specific defaults */ + no_defaults= 0; + if (argc >= 2 && !strcmp(argv[1],"--no-defaults")) + no_defaults= 1; + get_defaults_options(argc, argv, &forced_defaults_file, &forced_extra_defaults, &local_defaults_group_suffix); @@ -652,7 +658,9 @@ fix_priv_tables: if (defaults_to_use) { dynstr_append(&cmdline, " "); - dynstr_append_os_quoted(&cmdline, "--defaults-extra-file=", + dynstr_append_os_quoted(&cmdline, + (no_defaults ? "--defaults-file=" : + "--defaults-extra-file="), defaults_to_use, NullS); } dynstr_append(&cmdline, " "); @@ -684,6 +692,7 @@ error: if (upgrade_defaults_created) my_delete(upgrade_defaults_path, MYF(0)); + my_free(upgrade_defaults_path, MYF(MY_ALLOW_ZERO_PTR)); my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); return ret; } From b35b11ee2215b314e7261328d92b0771bd268f8a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 13:04:27 -0400 Subject: [PATCH 474/789] Post Merge Cleanup. mysql-test/r/mysqldump.result: Post Merge Cleanup --- mysql-test/r/mysqldump.result | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 330c86f6518..7b16d02658a 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3205,29 +3205,6 @@ INSERT INTO t1 VALUES(1,0xff00fef0); DROP TABLE t1; # -# Bug #23491: MySQLDump prefix function call in a view by database name -# -create database bug23491_original; -create database bug23491_restore; -use bug23491_original; -create table t1 (c1 int); -create view v1 as select * from t1; -create procedure p1() select 1; -create function f1() returns int return 1; -create view v2 as select f1(); -create function f2() returns int return f1(); -create view v3 as select bug23491_original.f1(); -use bug23491_restore; -show create view bug23491_restore.v2; -View Create View -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()` -show create view bug23491_restore.v3; -View Create View -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()` -drop database bug23491_original; -drop database bug23491_restore; -use test; -# # Bug#26346: stack + buffer overrun in mysqldump # CREATE TABLE t1(a int); @@ -3282,6 +3259,29 @@ UNLOCK TABLES; DROP TABLE t1, t2, t3; # +# Bug #23491: MySQLDump prefix function call in a view by database name +# +create database bug23491_original; +create database bug23491_restore; +use bug23491_original; +create table t1 (c1 int); +create view v1 as select * from t1; +create procedure p1() select 1; +create function f1() returns int return 1; +create view v2 as select f1(); +create function f2() returns int return f1(); +create view v3 as select bug23491_original.f1(); +use bug23491_restore; +show create view bug23491_restore.v2; +View Create View +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()` +show create view bug23491_restore.v3; +View Create View +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()` +drop database bug23491_original; +drop database bug23491_restore; +use test; +# # End of 5.0 tests # drop table if exists t1; From 092c052280dbd0392367eb0f51e5af1a8bc50436 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 13:21:59 -0400 Subject: [PATCH 475/789] WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in the header file concerning a method declaration in the header file. Compiles ok on Windows, but not on Linux. sql/event_data_objects.h: WL#3629 - Replication of Invocation and Invoked Features This patch corrects an error in the header file concerning a method declaration in the header file. --- sql/event_data_objects.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index 18e8aeb21cf..d1d213901f0 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -294,7 +294,7 @@ private: check_if_in_the_past(THD *thd, my_time_t ltime_utc); Event_parse_data(const Event_parse_data &); /* Prevent use of these */ - void Event_parse_data::check_originator_id(THD *thd); + void check_originator_id(THD *thd); void operator=(Event_parse_data &); }; From a9f4be70547229da701fb3f7c91c38096e31b00d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 21:06:32 +0300 Subject: [PATCH 476/789] Initialize thd->no_trans_update (Fixes valgrind warnings) --- sql/sql_class.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 971d7e9d1b1..07f94ce768a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -333,6 +333,7 @@ void THD::init(void) if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; options= thd_startup_options; + no_trans_update.stmt= no_trans_update.all= FALSE; open_options=ha_open_options; update_lock_default= (variables.low_priority_updates ? TL_WRITE_LOW_PRIORITY : From e57c8007a4e2c7d1f8bda44b0af6599126673ef4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 21:11:17 +0300 Subject: [PATCH 477/789] Manual merge from 5.0 --- sql/event_db_repository.cc | 4 ++-- sql/set_var.cc | 5 +---- sql/sql_connect.cc | 5 +++-- sql/sql_db.cc | 10 ++++++---- sql/sql_insert.cc | 6 +++--- sql/sql_parse.cc | 12 +++++++----- sql/sql_update.cc | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 7232390ef69..7328e2184e4 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -644,7 +644,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, ok: if (dbchanged) - (void) mysql_change_db(thd, old_db.str, 1); + (void) mysql_change_db(thd, &old_db, 1); /* This statement may cause a spooky valgrind warning at startup inside init_key_cache on my system (ahristov, 2006/08/10) @@ -654,7 +654,7 @@ ok: err: if (dbchanged) - (void) mysql_change_db(thd, old_db.str, 1); + (void) mysql_change_db(thd, &old_db, 1); if (table) close_thread_tables(thd); DBUG_RETURN(TRUE); diff --git a/sql/set_var.cc b/sql/set_var.cc index b8459c33bc2..de214164c0a 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3083,9 +3083,7 @@ static bool set_option_autocommit(THD *thd, set_var *var) if ((org_options & OPTION_NOT_AUTOCOMMIT)) { /* We changed to auto_commit mode */ - thd->options&= ~(ulonglong) (OPTION_BEGIN | - OPTION_STATUS_NO_TRANS_UPDATE | - OPTION_KEEP_LOG); + thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG); thd->no_trans_update.all= FALSE; thd->server_status|= SERVER_STATUS_AUTOCOMMIT; if (ha_commit(thd)) @@ -3094,7 +3092,6 @@ static bool set_option_autocommit(THD *thd, set_var *var) else { thd->no_trans_update.all= FALSE; - thd->options&= ~(ulonglong) (OPTION_STATUS_NO_TRANS_UPDATE); thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT; } } diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 09ee4962235..d03a17079d8 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -315,6 +315,7 @@ int check_user(THD *thd, enum enum_server_command command, bool check_count) { DBUG_ENTER("check_user"); + LEX_STRING db_str= { (char *) db, db ? strlen(db) : 0 }; #ifdef NO_EMBEDDED_ACCESS_CHECKS thd->main_security_ctx.master_access= GLOBAL_ACLS; // Full rights @@ -326,7 +327,7 @@ int check_user(THD *thd, enum enum_server_command command, function returns 0 */ thd->reset_db(NULL, 0); - if (mysql_change_db(thd, db, FALSE)) + if (mysql_change_db(thd, &db_str, FALSE)) { /* Send the error to the client */ net_send_error(thd); @@ -472,7 +473,7 @@ int check_user(THD *thd, enum enum_server_command command, /* Change database if necessary */ if (db && db[0]) { - if (mysql_change_db(thd, db, FALSE)) + if (mysql_change_db(thd, &db_str, FALSE)) { /* Send error to the client */ net_send_error(thd); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 4e96a987d99..f529a21b109 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -22,6 +22,7 @@ #include "events.h" #include #include +#include "log.h" #ifdef __WIN__ #include #endif @@ -1420,7 +1421,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) to be sure. */ - if (check_db_name(new_db_file_name.str)) + if (check_db_name(&new_db_file_name)) { my_error(ER_WRONG_DB_NAME, MYF(0), new_db_file_name.str); my_free(new_db_file_name.str, MYF(0)); @@ -1454,8 +1455,9 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) sctx->priv_user, sctx->priv_host, new_db_file_name.str); - mysql_log.write(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), - sctx->priv_user, sctx->priv_host, new_db_file_name.str); + general_log_print(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), + sctx->priv_user, sctx->priv_host, + new_db_file_name.str); my_free(new_db_file_name.str, MYF(0)); DBUG_RETURN(TRUE); } @@ -1801,7 +1803,7 @@ bool mysql_rename_db(THD *thd, LEX_STRING *old_db, LEX_STRING *new_db) /* Step9: Let's do "use newdb" if we renamed the current database */ if (change_to_newdb) - error|= mysql_change_db(thd, new_db->str, 0); + error|= mysql_change_db(thd, new_db, 0); exit: pthread_mutex_lock(&LOCK_lock_db); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 4eff7e4edeb..9c20ad6922b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -712,7 +712,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, } } if (!transactional_table) - thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; + thd->no_trans_update.all= TRUE; } } if (transactional_table) @@ -1322,7 +1322,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) goto err; info->deleted++; if (!table->file->has_transactions()) - thd->no_trans_update= 1; + thd->no_trans_update.stmt= TRUE; if (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_DELETE, TRG_ACTION_AFTER, TRUE)) @@ -2638,7 +2638,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) if (info.handle_duplicates == DUP_REPLACE && (!table->triggers || !table->triggers->has_delete_triggers())) table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); - thd->no_trans_update= 0; + thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= (!info.ignore && (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ff7e06e1875..3665d7f0b03 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -720,7 +720,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, &LOCK_status); thd->convert_string(&tmp, system_charset_info, packet, packet_length-1, thd->charset()); - if (!mysql_change_db(thd, tmp.str, FALSE)) + if (!mysql_change_db(thd, &tmp, FALSE)) { general_log_print(thd, command, "%s",thd->db); send_ok(thd); @@ -4208,8 +4208,8 @@ create_sp_error: xa_state_names[thd->transaction.xid_state.xa_state]); break; } - thd->options&= ~(OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE | - OPTION_KEEP_LOG); + thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG); + thd->no_trans_update.all= FALSE; thd->server_status&= ~SERVER_STATUS_IN_TRANS; xid_cache_delete(&thd->transaction.xid_state); thd->transaction.xid_state.xa_state=XA_NOTR; @@ -5023,8 +5023,10 @@ void mysql_reset_thd_for_next_command(THD *thd) in ha_rollback_trans() about some tables couldn't be rolled back. */ if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) - thd->options&= ~(OPTION_STATUS_NO_TRANS_UPDATE | OPTION_KEEP_LOG); - + { + thd->options&= ~OPTION_KEEP_LOG; + thd->no_trans_update.all= FALSE; + } DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx); thd->tmp_table_used= 0; if (!thd->in_sub_stmt) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index f438e04e6c9..988e81033c7 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -535,7 +535,7 @@ int mysql_update(THD *thd, if (!error) { updated++; - thd->no_trans_update= !transactional_table; + thd->no_trans_update.stmt= !transactional_table; if (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, From adaf162bc206c3833001a11feaeddfa41c223dcf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 20:31:09 +0200 Subject: [PATCH 478/789] WL#3464: Add replication event to denote gap in replication Adding an event that can be used to denote that an incident occured on the master. The event can be used to denote a gap in the replication stream, but can also be used to denote other incidents. In addition, the injector interface is extended with functions to generate an incident event. The function will also rotate the binary log after generating an incident event to get a fresh binary log. client/Makefile.am: Adding file rpl_constants.h with constants for replication. mysql-test/extra/binlog_tests/binlog.test: Binlog position change mysql-test/extra/binlog_tests/binlog_insert_delayed.test: Binlog position change mysql-test/extra/binlog_tests/ctype_cp932_binlog.test: Binlog position change mysql-test/extra/binlog_tests/ctype_ucs_binlog.test: Binlog position change mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Binlog position change mysql-test/extra/rpl_tests/rpl_deadlock.test: Binlog position change mysql-test/extra/rpl_tests/rpl_log.test: Binlog position change mysql-test/extra/rpl_tests/rpl_multi_query.test: Binlog position change mysql-test/extra/rpl_tests/rpl_row_charset.test: Binlog position change mysql-test/extra/rpl_tests/rpl_row_sp002.test: Binlog position change mysql-test/extra/rpl_tests/rpl_row_sp003.test: Binlog position change mysql-test/extra/rpl_tests/rpl_stm_charset.test: Binlog position change mysql-test/include/show_binlog_events.inc: Binlog position change mysql-test/r/binlog_row_binlog.result: Result change mysql-test/r/binlog_row_ctype_ucs.result: Result change mysql-test/r/binlog_row_insert_select.result: Result change mysql-test/r/binlog_row_mix_innodb_myisam.result: Result change mysql-test/r/binlog_stm_binlog.result: Result change mysql-test/r/binlog_stm_ctype_ucs.result: Result change mysql-test/r/binlog_stm_insert_select.result: Result change mysql-test/r/binlog_stm_mix_innodb_myisam.result: Result change mysql-test/r/ctype_cp932_binlog_row.result: Result change mysql-test/r/ctype_cp932_binlog_stm.result: Result change mysql-test/r/flush_block_commit_notembedded.result: Result change mysql-test/r/rpl_000015.result: Result change mysql-test/r/rpl_change_master.result: Result change mysql-test/r/rpl_deadlock_innodb.result: Result change mysql-test/r/rpl_flushlog_loop.result: Result change mysql-test/r/rpl_loaddata.result: Result change mysql-test/r/rpl_loaddata_s.result: Result change mysql-test/r/rpl_log_pos.result: Result change mysql-test/r/rpl_ndb_charset.result: Result change mysql-test/r/rpl_ndb_log.result: Result change mysql-test/r/rpl_ndb_multi.result: Result change mysql-test/r/rpl_rbr_to_sbr.result: Result change mysql-test/r/rpl_rotate_logs.result: Result change mysql-test/r/rpl_row_basic_11bugs.result: Result change mysql-test/r/rpl_row_charset.result: Result change mysql-test/r/rpl_row_create_table.result: Result change mysql-test/r/rpl_row_delayed_ins.result: Result change mysql-test/r/rpl_row_drop.result: Result change mysql-test/r/rpl_row_flsh_tbls.result: Result change mysql-test/r/rpl_row_inexist_tbl.result: Result change mysql-test/r/rpl_row_log.result: Result change mysql-test/r/rpl_row_log_innodb.result: Result change mysql-test/r/rpl_row_max_relay_size.result: Result change mysql-test/r/rpl_row_reset_slave.result: Result change mysql-test/r/rpl_row_until.result: Result change mysql-test/r/rpl_server_id1.result: Result change mysql-test/r/rpl_server_id2.result: Result change mysql-test/r/rpl_sp.result: Result change mysql-test/r/rpl_stm_charset.result: Result change mysql-test/r/rpl_stm_flsh_tbls.result: Result change mysql-test/r/rpl_stm_log.result: Result change mysql-test/r/rpl_stm_max_relay_size.result: Result change mysql-test/r/rpl_stm_multi_query.result: Result change mysql-test/r/rpl_stm_reset_slave.result: Result change mysql-test/r/rpl_stm_until.result: Result change mysql-test/r/rpl_switch_stm_row_mixed.result: Result change mysql-test/r/rpl_truncate_2myisam.result: Result change mysql-test/r/rpl_truncate_3innodb.result: Result change mysql-test/r/rpl_truncate_7ndb.result: Result change mysql-test/r/user_var-binlog.result: Result change mysql-test/t/binlog_row_mix_innodb_myisam.test: Binlog position change mysql-test/t/binlog_stm_mix_innodb_myisam.test: Binlog position change mysql-test/t/ctype_cp932_binlog_stm.test: Binlog position change mysql-test/t/mysqlbinlog.test: Binlog position change mysql-test/t/mysqlbinlog2.test: Binlog position change mysql-test/t/rpl_loaddata_s.test: Binlog position change mysql-test/t/rpl_log_pos.test: Binlog position change mysql-test/t/rpl_row_basic_11bugs.test: Binlog position change mysql-test/t/rpl_row_create_table.test: Binlog position change mysql-test/t/rpl_row_flsh_tbls.test: Binlog position change mysql-test/t/rpl_row_mysqlbinlog.test: Binlog position change mysql-test/t/rpl_sp.test: Binlog position change mysql-test/t/rpl_stm_flsh_tbls.test: Binlog position change mysql-test/t/rpl_switch_stm_row_mixed.test: Binlog position change mysql-test/t/user_var-binlog.test: Binlog position change sql/Makefile.am: Adding file rpl_constants.h with constants for replication. sql/log_event.cc: Changing prototype for read_str() to be const-correct and changing code to match that. Adding incident log event. sql/log_event.h: Adding incident log event. sql/rpl_injector.cc: Adding support for generating incidents into the binary log. sql/rpl_injector.h: Adding support for generating incidents into the binary log. sql/share/errmsg.txt: Adding new error message to indicate an incident. sql/sql_parse.cc: Adding code to generate an incident log event just before executing a REPLACE if the variable "incident_database_resync_on_replace" is set. mysql-test/r/rpl_incident.result: New BitKeeper file ``mysql-test/r/rpl_incident.result'' mysql-test/t/rpl_incident.test: New BitKeeper file ``mysql-test/t/rpl_incident.test'' sql/rpl_constants.h: New BitKeeper file ``sql/rpl_constants.h'' --- client/Makefile.am | 3 +- mysql-test/extra/binlog_tests/binlog.test | 8 +- .../binlog_tests/binlog_insert_delayed.test | 2 +- .../binlog_tests/ctype_cp932_binlog.test | 2 +- .../extra/binlog_tests/ctype_ucs_binlog.test | 2 +- .../mix_innodb_myisam_binlog.test | 28 +- mysql-test/extra/rpl_tests/rpl_deadlock.test | 4 +- mysql-test/extra/rpl_tests/rpl_log.test | 6 +- .../extra/rpl_tests/rpl_multi_query.test | 2 +- .../extra/rpl_tests/rpl_row_charset.test | 2 +- mysql-test/extra/rpl_tests/rpl_row_sp002.test | 2 +- mysql-test/extra/rpl_tests/rpl_row_sp003.test | 2 +- .../extra/rpl_tests/rpl_stm_charset.test | 2 +- mysql-test/include/show_binlog_events.inc | 2 +- mysql-test/r/binlog_row_binlog.result | 10 +- mysql-test/r/binlog_row_ctype_ucs.result | 6 +- mysql-test/r/binlog_row_insert_select.result | 8 +- .../r/binlog_row_mix_innodb_myisam.result | 28 +- mysql-test/r/binlog_stm_binlog.result | 20 +- mysql-test/r/binlog_stm_ctype_ucs.result | 6 +- mysql-test/r/binlog_stm_insert_select.result | 6 +- .../r/binlog_stm_mix_innodb_myisam.result | 28 +- mysql-test/r/ctype_cp932_binlog_row.result | 2 +- mysql-test/r/ctype_cp932_binlog_stm.result | 14 +- .../r/flush_block_commit_notembedded.result | 4 +- mysql-test/r/rpl_000015.result | 4 +- mysql-test/r/rpl_change_master.result | 4 +- mysql-test/r/rpl_deadlock_innodb.result | 4 +- mysql-test/r/rpl_flushlog_loop.result | 4 +- mysql-test/r/rpl_incident.result | 108 ++ mysql-test/r/rpl_loaddata.result | 6 +- mysql-test/r/rpl_loaddata_s.result | 2 +- mysql-test/r/rpl_log_pos.result | 20 +- mysql-test/r/rpl_ndb_charset.result | 2 +- mysql-test/r/rpl_ndb_log.result | 16 +- mysql-test/r/rpl_ndb_multi.result | 4 +- mysql-test/r/rpl_rbr_to_sbr.result | 4 +- mysql-test/r/rpl_rotate_logs.result | 30 +- mysql-test/r/rpl_row_basic_11bugs.result | 16 +- mysql-test/r/rpl_row_charset.result | 2 +- mysql-test/r/rpl_row_create_table.result | 102 +- mysql-test/r/rpl_row_delayed_ins.result | 18 +- mysql-test/r/rpl_row_drop.result | 8 +- mysql-test/r/rpl_row_flsh_tbls.result | 4 +- mysql-test/r/rpl_row_inexist_tbl.result | 2 +- mysql-test/r/rpl_row_log.result | 16 +- mysql-test/r/rpl_row_log_innodb.result | 16 +- mysql-test/r/rpl_row_max_relay_size.result | 22 +- mysql-test/r/rpl_row_reset_slave.result | 6 +- mysql-test/r/rpl_row_until.result | 8 +- mysql-test/r/rpl_server_id1.result | 2 +- mysql-test/r/rpl_server_id2.result | 2 +- mysql-test/r/rpl_sp.result | 2 +- mysql-test/r/rpl_stm_charset.result | 2 +- mysql-test/r/rpl_stm_flsh_tbls.result | 4 +- mysql-test/r/rpl_stm_log.result | 16 +- mysql-test/r/rpl_stm_max_relay_size.result | 22 +- mysql-test/r/rpl_stm_multi_query.result | 2 +- mysql-test/r/rpl_stm_reset_slave.result | 6 +- mysql-test/r/rpl_stm_until.result | 16 +- mysql-test/r/rpl_switch_stm_row_mixed.result | 948 +++++++++--------- mysql-test/r/rpl_truncate_2myisam.result | 66 +- mysql-test/r/rpl_truncate_3innodb.result | 90 +- mysql-test/r/rpl_truncate_7ndb.result | 68 +- mysql-test/r/user_var-binlog.result | 12 +- .../t/binlog_row_mix_innodb_myisam.test | 2 +- .../t/binlog_stm_mix_innodb_myisam.test | 2 +- mysql-test/t/ctype_cp932_binlog_stm.test | 2 +- mysql-test/t/mysqlbinlog.test | 4 +- mysql-test/t/mysqlbinlog2.test | 16 +- mysql-test/t/rpl_incident.test | 47 + mysql-test/t/rpl_loaddata_s.test | 5 +- mysql-test/t/rpl_log_pos.test | 8 +- mysql-test/t/rpl_row_basic_11bugs.test | 2 +- mysql-test/t/rpl_row_create_table.test | 12 +- mysql-test/t/rpl_row_flsh_tbls.test | 2 +- mysql-test/t/rpl_row_mysqlbinlog.test | 6 +- mysql-test/t/rpl_sp.test | 2 +- mysql-test/t/rpl_stm_flsh_tbls.test | 2 +- mysql-test/t/rpl_switch_stm_row_mixed.test | 8 +- mysql-test/t/user_var-binlog.test | 5 +- sql/Makefile.am | 2 +- sql/log_event.cc | 132 ++- sql/log_event.h | 98 +- sql/rpl_constants.h | 18 + sql/rpl_injector.cc | 18 + sql/rpl_injector.h | 6 +- sql/share/errmsg.txt | 2 + sql/sql_parse.cc | 32 + 89 files changed, 1377 insertions(+), 941 deletions(-) create mode 100644 mysql-test/r/rpl_incident.result create mode 100644 mysql-test/t/rpl_incident.test create mode 100644 sql/rpl_constants.h diff --git a/client/Makefile.am b/client/Makefile.am index 747b27e9aa0..aba763abde4 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -94,7 +94,8 @@ DEFS = -DUNDEF_THREADS_HACK \ -DDEFAULT_MYSQL_HOME="\"$(prefix)\"" \ -DDATADIR="\"$(localstatedir)\"" -sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc +sql_src=log_event.h mysql_priv.h rpl_constants.h \ + log_event.cc my_decimal.h my_decimal.cc strings_src=decimal.c link_sources: diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 48d9b859c26..9959e35552c 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -22,7 +22,7 @@ commit; # first COMMIT must be Query_log_event, second - Xid_log_event --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; drop table t1,t2; # @@ -44,10 +44,10 @@ commit; drop table t1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 103; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events in 'master-bin.000002' from 102; +show binlog events in 'master-bin.000002' from 103; # Test of a too big SET INSERT_ID: see if the truncated value goes # into binlog (right), or the too big value (wrong); we look at the @@ -69,7 +69,7 @@ create table if not exists t3 like tt1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; drop table t1,t2,t3,tt1; -- source extra/binlog_tests/binlog_insert_delayed.test diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test index 4da883b9e60..2b087946054 100644 --- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test +++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test @@ -25,7 +25,7 @@ inc $count; # the way --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 103; insert delayed into t1 values (null),(null),(null),(null); inc $count; inc $count; inc $count; inc $count; diff --git a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test index 5e93d6e126e..016644bc7ac 100644 --- a/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test +++ b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test @@ -28,7 +28,7 @@ SET @var1= x'8300'; EXECUTE stmt1 USING @var1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 103; SELECT HEX(f1) FROM t1; DROP table t1; # end test for bug#11338 diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test index fcf39e38163..061847823dd 100644 --- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test +++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test @@ -10,7 +10,7 @@ set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 103; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index bdc49573ae5..0bd093893c9 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -31,7 +31,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; delete from t1; delete from t2; @@ -45,7 +45,7 @@ rollback; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; delete from t1; delete from t2; @@ -61,7 +61,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; delete from t1; delete from t2; @@ -79,7 +79,7 @@ select a from t1 order by a; # check that savepoints work :) --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; # and when ROLLBACK is not explicit? delete from t1; @@ -101,7 +101,7 @@ connection con2; select get_lock("a",10); --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; # and when not in a transact1on? delete from t1; @@ -113,7 +113,7 @@ insert into t2 select * from t1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; # Check that when the query updat1ng the MyISAM table is the first in the # transaction, we log it immediately. @@ -126,13 +126,13 @@ begin; insert into t2 select * from t1; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; insert into t1 values(11); commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; # Check that things work like before this BEGIN/ROLLBACK code was added, @@ -151,7 +151,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; delete from t1; delete from t2; @@ -164,7 +164,7 @@ rollback; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; delete from t1; delete from t2; @@ -180,7 +180,7 @@ commit; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; delete from t1; delete from t2; @@ -198,7 +198,7 @@ select a from t1 order by a; # check that savepoints work :) --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; # Test for BUG#5714, where a MyISAM update in the transaction used to # release row-level locks in InnoDB @@ -259,7 +259,7 @@ connection con3; select get_lock("lock1",60); --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; do release_lock("lock1"); drop table t0,t2; @@ -326,7 +326,7 @@ SELECT * from t2; DROP TABLE t1,t2; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// -show binlog events from 102; +show binlog events from 103; # Test for BUG#16559 (ROLLBACK should always have a zero error code in # binlog). Has to be here and not earlier, as the SELECTs influence diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test index 236a5f801b0..07851a664a8 100644 --- a/mysql-test/extra/rpl_tests/rpl_deadlock.test +++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test @@ -82,7 +82,7 @@ show slave status; stop slave; delete from t3; -change master to master_log_pos=544; # the BEGIN log event +change master to master_log_pos=545; # the BEGIN log event begin; select * from t2 for update; # hold lock start slave; @@ -107,7 +107,7 @@ set global max_relay_log_size=0; # This is really copy-paste of 2) of above stop slave; delete from t3; -change master to master_log_pos=544; +change master to master_log_pos=545; begin; select * from t2 for update; start slave; diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test index cc3a9b4ffb5..726807b9089 100644 --- a/mysql-test/extra/rpl_tests/rpl_log.test +++ b/mysql-test/extra/rpl_tests/rpl_log.test @@ -42,13 +42,13 @@ select count(*) from t1; show binlog events; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 102 limit 1; +show binlog events from 103 limit 1; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 102 limit 2; +show binlog events from 103 limit 2; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 102 limit 2,1; +show binlog events from 103 limit 2,1; flush logs; # We need an extra update before doing save_master_pos. diff --git a/mysql-test/extra/rpl_tests/rpl_multi_query.test b/mysql-test/extra/rpl_tests/rpl_multi_query.test index 30a83886a86..a863f17b94e 100644 --- a/mysql-test/extra/rpl_tests/rpl_multi_query.test +++ b/mysql-test/extra/rpl_tests/rpl_multi_query.test @@ -25,6 +25,6 @@ select * from mysqltest.t1; connection master; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 103; drop database mysqltest; sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_row_charset.test b/mysql-test/extra/rpl_tests/rpl_row_charset.test index 336a038db10..520293788b6 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_row_charset.test @@ -115,7 +115,7 @@ drop database mysqltest2; drop database mysqltest3; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 103; sync_slave_with_master; # Check that we can change global.collation_server (since 5.0.3) diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-test/extra/rpl_tests/rpl_row_sp002.test index 9d056626cf2..47afcce875b 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_sp002.test +++ b/mysql-test/extra/rpl_tests/rpl_row_sp002.test @@ -222,7 +222,7 @@ sync_with_master; select * from test.t3; connection master; -#show binlog events from 1626; +#show binlog events from 1627; # First lets cleanup diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test index 0934e2d6f98..df318ee0c0b 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test +++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test @@ -65,7 +65,7 @@ sync_slave_with_master; connection slave; SELECT * FROM test.t1; connection master; -#show binlog events from 719; +#show binlog events from 720; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; diff --git a/mysql-test/extra/rpl_tests/rpl_stm_charset.test b/mysql-test/extra/rpl_tests/rpl_stm_charset.test index 5657b06e88f..787d57aea82 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_charset.test @@ -111,7 +111,7 @@ drop database mysqltest2; drop database mysqltest3; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +show binlog events from 103; sync_slave_with_master; # Check that we can change global.collation_server (since 5.0.3) diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index ae848d10687..eddd4e42df3 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -1,4 +1,4 @@ ---let $binlog_start=102 +--let $binlog_start=103 --replace_result $binlog_start --replace_column 2 # 4 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result index aee270bd7f6..1b3c37d6edc 100644 --- a/mysql-test/r/binlog_row_binlog.result +++ b/mysql-test/r/binlog_row_binlog.result @@ -8,7 +8,7 @@ commit; begin; insert t2 values (5); commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb @@ -26,7 +26,7 @@ create table t1 (n int) engine=innodb; begin; commit; drop table t1; -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb master-bin.000001 # Query 1 # use `test`; BEGIN @@ -232,7 +232,7 @@ master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Xid 1 # COMMIT /* xid= */ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002' from 102; +show binlog events in 'master-bin.000002' from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 reset master; @@ -249,7 +249,7 @@ create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -268,7 +268,7 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Table_map 1 # table_id: # (test.t1) diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/r/binlog_row_ctype_ucs.result index 4eeff79e13a..0a8ba129261 100644 --- a/mysql-test/r/binlog_row_ctype_ucs.result +++ b/mysql-test/r/binlog_row_ctype_ucs.result @@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 102 Table_map 1 141 table_id: # (test.t2) -master-bin.000001 141 Write_rows 1 231 table_id: # flags: STMT_END_F +master-bin.000001 103 Table_map 1 142 table_id: # (test.t2) +master-bin.000001 142 Write_rows 1 232 table_id: # flags: STMT_END_F flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/r/binlog_row_insert_select.result b/mysql-test/r/binlog_row_insert_select.result index 14cef6709b6..26e61c37c20 100644 --- a/mysql-test/r/binlog_row_insert_select.result +++ b/mysql-test/r/binlog_row_insert_select.result @@ -8,9 +8,9 @@ insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Table_map 1 141 table_id: # (test.t1) -master-bin.000001 141 Write_rows 1 175 table_id: # flags: STMT_END_F +master-bin.000001 4 Format_desc 1 103 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 103 Table_map 1 142 table_id: # (test.t1) +master-bin.000001 142 Write_rows 1 176 table_id: # flags: STMT_END_F select * from t1; a 1 @@ -23,5 +23,5 @@ create table t2(unique(a)) select a from t1; ERROR 23000: Duplicate entry '1' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 4 Format_desc 1 103 Server ver: VERSION, Binlog ver: 4 drop table t1; diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/r/binlog_row_mix_innodb_myisam.result index 185ca33d4db..5a9e0c7604e 100644 --- a/mysql-test/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_row_mix_innodb_myisam.result @@ -6,7 +6,7 @@ begin; insert into t1 values(1); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -23,7 +23,7 @@ insert into t2 select * from t1; rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -43,7 +43,7 @@ rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -72,7 +72,7 @@ select a from t1 order by a; a 5 7 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -98,7 +98,7 @@ insert into t2 select * from t1; select get_lock("a",10); get_lock("a",10) 1 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -111,7 +111,7 @@ delete from t2; reset master; insert into t1 values(9); insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F @@ -124,7 +124,7 @@ reset master; insert into t1 values(10); begin; insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F @@ -133,7 +133,7 @@ master-bin.000001 # Table_map 1 # table_id: # (test.t2) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F insert into t1 values(11); commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F @@ -152,7 +152,7 @@ begin; insert into t1 values(12); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -167,7 +167,7 @@ begin; insert into t1 values(13); insert into t2 select * from t1; rollback; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; delete from t2; @@ -179,7 +179,7 @@ insert into t1 values(15); insert into t2 select * from t1; rollback to savepoint my_savepoint; commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -200,7 +200,7 @@ select a from t1 order by a; a 16 18 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -252,7 +252,7 @@ insert into t2 values (3); select get_lock("lock1",60); get_lock("lock1",60) 1 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) @@ -355,7 +355,7 @@ SELECT * from t2; a b 100 100 DROP TABLE t1,t2; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index a9b3f69ecee..58d5f07ce94 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -4,11 +4,11 @@ insert into t1 values (1,2); commit; show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # -master-bin.000001 102 Query 1 209 use `test`; create table t1 (a int, b int) engine=innodb -master-bin.000001 209 Query 1 277 use `test`; BEGIN -master-bin.000001 277 Query 1 90 use `test`; insert into t1 values (1,2) -master-bin.000001 367 Xid 1 394 COMMIT /* XID */ +master-bin.000001 4 Format_desc 1 103 Server ver: #, Binlog ver: # +master-bin.000001 103 Query 1 210 use `test`; create table t1 (a int, b int) engine=innodb +master-bin.000001 210 Query 1 278 use `test`; BEGIN +master-bin.000001 278 Query 1 90 use `test`; insert into t1 values (1,2) +master-bin.000001 368 Xid 1 395 COMMIT /* XID */ drop table t1; drop table if exists t1, t2; reset master; @@ -20,7 +20,7 @@ commit; begin; insert t2 values (5); commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb @@ -36,7 +36,7 @@ create table t1 (n int) engine=innodb; begin; commit; drop table t1; -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb master-bin.000001 # Query 1 # use `test`; BEGIN @@ -142,7 +142,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4) master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4) master-bin.000001 # Xid 1 # COMMIT /* xid= */ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 -show binlog events in 'master-bin.000002' from 102; +show binlog events in 'master-bin.000002' from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 reset master; @@ -159,7 +159,7 @@ create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Intvar 1 # INSERT_ID=127 @@ -175,7 +175,7 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Intvar 1 # INSERT_ID=127 diff --git a/mysql-test/r/binlog_stm_ctype_ucs.result b/mysql-test/r/binlog_stm_ctype_ucs.result index 76f3a3b06b9..837d05ca1b9 100644 --- a/mysql-test/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/r/binlog_stm_ctype_ucs.result @@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 102 User var 1 142 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci -master-bin.000001 142 Query 1 231 use `test`; insert into t2 values (@v) +master-bin.000001 103 User var 1 143 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci +master-bin.000001 143 Query 1 232 use `test`; insert into t2 values (@v) flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/r/binlog_stm_insert_select.result b/mysql-test/r/binlog_stm_insert_select.result index 646a76b254d..62a80b7edda 100644 --- a/mysql-test/r/binlog_stm_insert_select.result +++ b/mysql-test/r/binlog_stm_insert_select.result @@ -8,8 +8,8 @@ insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 196 use `test`; insert into t1 select * from t2 +master-bin.000001 4 Format_desc 1 103 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 197 use `test`; insert into t1 select * from t2 select * from t1; a 1 @@ -22,5 +22,5 @@ create table t2(unique(a)) select a from t1; ERROR 23000: Duplicate entry '1' for key 'a' show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 4 Format_desc 1 103 Server ver: VERSION, Binlog ver: 4 drop table t1; diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/r/binlog_stm_mix_innodb_myisam.result index 23f4e50826a..3374ac4881d 100644 --- a/mysql-test/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_stm_mix_innodb_myisam.result @@ -6,7 +6,7 @@ begin; insert into t1 values(1); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) @@ -21,7 +21,7 @@ insert into t2 select * from t1; rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(2) @@ -39,7 +39,7 @@ rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(3) @@ -65,7 +65,7 @@ select a from t1 order by a; a 5 7 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(5) @@ -87,7 +87,7 @@ insert into t2 select * from t1; select get_lock("a",10); get_lock("a",10) 1 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(8) @@ -98,7 +98,7 @@ delete from t2; reset master; insert into t1 values(9); insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values(9) master-bin.000001 # Xid 1 # COMMIT /* xid= */ @@ -109,14 +109,14 @@ reset master; insert into t1 values(10); begin; insert into t2 select * from t1; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values(10) master-bin.000001 # Xid 1 # COMMIT /* xid= */ master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 insert into t1 values(11); commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values(10) master-bin.000001 # Xid 1 # COMMIT /* xid= */ @@ -132,7 +132,7 @@ begin; insert into t1 values(12); insert into t2 select * from t1; commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(12) @@ -145,7 +145,7 @@ begin; insert into t1 values(13); insert into t2 select * from t1; rollback; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info delete from t1; delete from t2; @@ -157,7 +157,7 @@ insert into t1 values(15); insert into t2 select * from t1; rollback to savepoint my_savepoint; commit; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(14) @@ -177,7 +177,7 @@ select a from t1 order by a; a 16 18 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(16) @@ -227,7 +227,7 @@ insert into t2 values (3); select get_lock("lock1",60); get_lock("lock1",60) 1 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert into t1 values(16) @@ -331,7 +331,7 @@ SELECT * from t2; a b 100 100 DROP TABLE t1,t2; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (1,1),(1,2) master-bin.000001 # Query 1 # use `test`; DROP TABLE if exists t2 diff --git a/mysql-test/r/ctype_cp932_binlog_row.result b/mysql-test/r/ctype_cp932_binlog_row.result index f1a64241fbb..c40b1d59a72 100644 --- a/mysql-test/r/ctype_cp932_binlog_row.result +++ b/mysql-test/r/ctype_cp932_binlog_row.result @@ -6,7 +6,7 @@ CREATE TABLE t1(f1 blob); PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; SET @var1= x'8300'; EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) master-bin.000001 # Table_map 1 # table_id: # (test.t1) diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index ef1067e7c5d..c3d895e0c04 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -6,7 +6,7 @@ CREATE TABLE t1(f1 blob); PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; SET @var1= x'8300'; EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary @@ -30,17 +30,17 @@ HEX(s1) HEX(s2) d 466F6F2773206120426172 ED40ED41ED42 47.93 DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 397| +SHOW BINLOG EVENTS FROM 398| Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 397 Query 1 560 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, +master-bin.000001 398 Query 1 561 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, s2 CHAR(50) CHARACTER SET cp932, d DECIMAL(10,2)) -master-bin.000001 560 Query 1 805 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50), +master-bin.000001 561 Query 1 806 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50), IN ins2 CHAR(50) CHARACTER SET cp932, IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 805 Query 1 1021 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) -master-bin.000001 1021 Query 1 1107 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1107 Query 1 1183 use `test`; DROP TABLE t4 +master-bin.000001 806 Query 1 1022 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) +master-bin.000001 1022 Query 1 1108 use `test`; DROP PROCEDURE bug18293 +master-bin.000001 1108 Query 1 1184 use `test`; DROP TABLE t4 diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result index 1d045b21763..eecabb7ccd9 100644 --- a/mysql-test/r/flush_block_commit_notembedded.result +++ b/mysql-test/r/flush_block_commit_notembedded.result @@ -5,11 +5,11 @@ insert t1 values (1); flush tables with read lock; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 103 commit; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 103 unlock tables; drop table t1; set autocommit=1; diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/r/rpl_000015.result index a53750f82ad..95945eb6e7a 100644 --- a/mysql-test/r/rpl_000015.result +++ b/mysql-test/r/rpl_000015.result @@ -1,7 +1,7 @@ reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 103 reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -17,7 +17,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 103 # # master-bin.000001 Yes Yes 0 0 103 # None 0 No # drop table if exists t1; create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result index 513de9494ba..151f71b899a 100644 --- a/mysql-test/r/rpl_change_master.result +++ b/mysql-test/r/rpl_change_master.result @@ -13,11 +13,11 @@ insert into t1 values(2); stop slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 188 # None 0 No # change master to master_user='root'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 188 # None 0 No # start slave; select * from t1; n diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/r/rpl_deadlock_innodb.result index caf040c0997..f1843750210 100644 --- a/mysql-test/r/rpl_deadlock_innodb.result +++ b/mysql-test/r/rpl_deadlock_innodb.result @@ -80,7 +80,7 @@ Master_SSL_Key Seconds_Behind_Master # stop slave; delete from t3; -change master to master_log_pos=544; +change master to master_log_pos=545; begin; select * from t2 for update; a @@ -136,7 +136,7 @@ set @my_max_relay_log_size= @@global.max_relay_log_size; set global max_relay_log_size=0; stop slave; delete from t3; -change master to master_log_pos=544; +change master to master_log_pos=545; begin; select * from t2 for update; a diff --git a/mysql-test/r/rpl_flushlog_loop.result b/mysql-test/r/rpl_flushlog_loop.result index 16d8ba251f4..7aad1e226d6 100644 --- a/mysql-test/r/rpl_flushlog_loop.result +++ b/mysql-test/r/rpl_flushlog_loop.result @@ -24,7 +24,7 @@ Master_User root Master_Port SLAVE_PORT Connect_Retry 60 Master_Log_File slave-bin.000001 -Read_Master_Log_Pos 212 +Read_Master_Log_Pos 213 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File slave-bin.000001 @@ -39,7 +39,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 212 +Exec_Master_Log_Pos 213 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/r/rpl_incident.result new file mode 100644 index 00000000000..5becaf37068 --- /dev/null +++ b/mysql-test/r/rpl_incident.result @@ -0,0 +1,108 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +**** On Master **** +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +SELECT * FROM t1; +a +1 +2 +3 +SET @saved = @@debug; +SET SESSION debug="d,incident_database_resync_on_replace"; +REPLACE INTO t1 VALUES (4); +SET SESSION debug=@saved; +SELECT * FROM t1; +a +1 +2 +3 +4 +**** On Slave **** +SELECT * FROM t1; +a +1 +2 +3 +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_PORT +Connect_Retry 1 +Master_Log_File master-bin.000002 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1583 +Last_Error The incident LOST_EVENTS occured on the master. Message: +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +SELECT * FROM t1; +a +1 +2 +3 +4 +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_PORT +Connect_Retry 1 +Master_Log_File master-bin.000002 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000002 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +DROP TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index cae11e98caa..7b13e7f3758 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -28,7 +28,7 @@ day id category name 2003-03-22 2416 a bbbbb show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -slave-bin.000001 1276 +slave-bin.000001 1277 drop table t1; drop table t2; drop table t3; @@ -39,7 +39,7 @@ set global sql_slave_skip_counter=1; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1793 # # master-bin.000001 Yes Yes # 0 0 1793 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1794 # # master-bin.000001 Yes Yes # 0 0 1794 # None 0 No # set sql_log_bin=0; delete from t1; set sql_log_bin=1; @@ -49,7 +49,7 @@ change master to master_user='test'; change master to master_user='root'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1828 # # master-bin.000001 No No # 0 0 1828 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1829 # # master-bin.000001 No No # 0 0 1829 # None 0 No # set global sql_slave_skip_counter=1; start slave; set sql_log_bin=0; diff --git a/mysql-test/r/rpl_loaddata_s.result b/mysql-test/r/rpl_loaddata_s.result index f0c79c81c15..4fc33eee20d 100644 --- a/mysql-test/r/rpl_loaddata_s.result +++ b/mysql-test/r/rpl_loaddata_s.result @@ -10,6 +10,6 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1; select count(*) from test.t1; count(*) 2 -show binlog events from 102; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info drop table test.t1; diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result index c7484022b23..d03ed609d29 100644 --- a/mysql-test/r/rpl_log_pos.result +++ b/mysql-test/r/rpl_log_pos.result @@ -6,37 +6,37 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 103 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 103 # # master-bin.000001 Yes Yes 0 0 103 # None 0 No # stop slave; -change master to master_log_pos=74; +change master to master_log_pos=75; start slave; stop slave; -change master to master_log_pos=74; +change master to master_log_pos=75; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No No 0 0 74 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No No 0 0 75 # None 0 No # start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No Yes 0 0 74 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No Yes 0 0 75 # None 0 No # stop slave; -change master to master_log_pos=177; +change master to master_log_pos=178; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 102 +master-bin.000001 103 create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); stop slave; -change master to master_log_pos=102; +change master to master_log_pos=103; start slave; select * from t1 ORDER BY n; n diff --git a/mysql-test/r/rpl_ndb_charset.result b/mysql-test/r/rpl_ndb_charset.result index 0ce4446c8a5..52ecd5909f0 100644 --- a/mysql-test/r/rpl_ndb_charset.result +++ b/mysql-test/r/rpl_ndb_charset.result @@ -109,7 +109,7 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest2 master-bin.000001 # Query 1 # drop database if exists mysqltest3 diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result index 66db8c24bb2..1022031d120 100644 --- a/mysql-test/r/rpl_ndb_log.result +++ b/mysql-test/r/rpl_ndb_log.result @@ -34,14 +34,14 @@ master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT -show binlog events from 102 limit 1; +show binlog events from 103 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -show binlog events from 102 limit 2; +show binlog events from 103 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # BEGIN -show binlog events from 102 limit 2,1; +show binlog events from 103 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) flush logs; @@ -87,13 +87,13 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT show binary logs; Log_name File_size -master-bin.000001 1702 -master-bin.000002 593 +master-bin.000001 1703 +master-bin.000002 594 start slave; show binary logs; Log_name File_size -slave-bin.000001 1797 -slave-bin.000002 198 +slave-bin.000001 1798 +slave-bin.000002 199 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -126,7 +126,7 @@ slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Query 2 # COMMIT show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 593 # # master-bin.000002 Yes Yes # 0 0 593 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 594 # # master-bin.000002 Yes Yes # 0 0 594 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_ndb_multi.result b/mysql-test/r/rpl_ndb_multi.result index 66819c2c9c8..a1be6dde898 100644 --- a/mysql-test/r/rpl_ndb_multi.result +++ b/mysql-test/r/rpl_ndb_multi.result @@ -26,11 +26,11 @@ stop slave; SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) FROM mysql.ndb_binlog_index WHERE epoch = ; @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) -102 master-bin1.000001 +103 master-bin1.000001 CHANGE MASTER TO master_port=, master_log_file = 'master-bin1.000001', -master_log_pos = 102 ; +master_log_pos = 103 ; start slave; INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); DELETE FROM t1 WHERE c3 = 1; diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/r/rpl_rbr_to_sbr.result index 4b2d129c732..578fb96428d 100644 --- a/mysql-test/r/rpl_rbr_to_sbr.result +++ b/mysql-test/r/rpl_rbr_to_sbr.result @@ -28,7 +28,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 450 +Read_Master_Log_Pos 451 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 450 +Exec_Master_Log_Pos 451 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 264f5d224bd..54a6e3dfae9 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -16,7 +16,7 @@ create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 552 # # master-bin.000001 Yes Yes # 0 0 552 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 553 # # master-bin.000001 Yes Yes # 0 0 553 # None 0 No # select * from t1; s Could not break slave @@ -27,9 +27,9 @@ insert into t2 values (34),(67),(123); flush logs; show binary logs; Log_name File_size -master-bin.000001 596 -master-bin.000002 367 -master-bin.000003 102 +master-bin.000001 597 +master-bin.000002 368 +master-bin.000003 103 create table t3 select * from temp_table; select * from t3; a @@ -43,21 +43,21 @@ start slave; purge master logs to 'master-bin.000002'; show master logs; Log_name File_size -master-bin.000002 367 -master-bin.000003 411 +master-bin.000002 368 +master-bin.000003 412 purge binary logs to 'master-bin.000002'; show binary logs; Log_name File_size -master-bin.000002 367 -master-bin.000003 411 +master-bin.000002 368 +master-bin.000003 412 purge master logs before now(); show binary logs; Log_name File_size -master-bin.000003 411 +master-bin.000003 412 insert into t2 values (65); show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 500 # # master-bin.000003 Yes Yes # 0 0 500 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 501 # # master-bin.000003 Yes Yes # 0 0 501 # None 0 No # select * from t2; m 34 @@ -74,18 +74,18 @@ count(*) create table t4 select * from temp_table; show binary logs; Log_name File_size -master-bin.000003 4189 -master-bin.000004 4194 -master-bin.000005 2036 +master-bin.000003 4190 +master-bin.000004 4195 +master-bin.000005 2037 show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000005 2036 +master-bin.000005 2037 select * from t4; a testing temporary tables part 2 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2036 # # master-bin.000005 Yes Yes # 0 0 2036 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2037 # # master-bin.000005 Yes Yes # 0 0 2037 # None 0 No # lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/r/rpl_row_basic_11bugs.result b/mysql-test/r/rpl_row_basic_11bugs.result index 8af2e8639aa..ef007c2a211 100644 --- a/mysql-test/r/rpl_row_basic_11bugs.result +++ b/mysql-test/r/rpl_row_basic_11bugs.result @@ -24,11 +24,11 @@ SHOW TABLES; Tables_in_test_ignore t2 INSERT INTO t2 VALUES (3,3), (4,4); -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 103; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 102 Query 1 195 use `test`; CREATE TABLE t1 (a INT, b INT) -master-bin.000001 195 Table_map 1 235 table_id: # (test.t1) -master-bin.000001 235 Write_rows 1 282 table_id: # flags: STMT_END_F +master-bin.000001 103 Query 1 196 use `test`; CREATE TABLE t1 (a INT, b INT) +master-bin.000001 196 Table_map 1 236 table_id: # (test.t1) +master-bin.000001 236 Write_rows 1 283 table_id: # flags: STMT_END_F **** On Slave **** SHOW DATABASES; Database @@ -54,10 +54,10 @@ DELETE FROM t1 WHERE a = 0; UPDATE t1 SET a=99 WHERE a = 0; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) -master-bin.000001 227 Write_rows 1 266 table_id: # flags: STMT_END_F +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 189 use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 189 Table_map 1 228 table_id: # (test.t1) +master-bin.000001 228 Write_rows 1 267 table_id: # flags: STMT_END_F DROP TABLE t1; ================ Test for BUG#17620 ================ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl_row_charset.result b/mysql-test/r/rpl_row_charset.result index 79cf75c8cc1..32af62e8229 100644 --- a/mysql-test/r/rpl_row_charset.result +++ b/mysql-test/r/rpl_row_charset.result @@ -109,7 +109,7 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest2 master-bin.000001 # Query 1 # drop database if exists mysqltest3 diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result index 8f587fb5796..9ddbc6eb7e1 100644 --- a/mysql-test/r/rpl_row_create_table.result +++ b/mysql-test/r/rpl_row_create_table.result @@ -8,27 +8,27 @@ CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT) ENGINE=Merge; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; -SHOW BINLOG EVENTS FROM 212; +SHOW BINLOG EVENTS FROM 213; Log_name # -Pos 212 +Pos 213 Event_type Query Server_id # End_log_pos # Info use `test`; CREATE TABLE t1 (a INT, b INT) Log_name # -Pos 305 +Pos 306 Event_type Query Server_id # End_log_pos # Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge Log_name # -Pos 411 +Pos 412 Event_type Query Server_id # End_log_pos # Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8 Log_name # -Pos 517 +Pos 518 Event_type Query Server_id # End_log_pos # @@ -127,7 +127,7 @@ NULL 5 10 NULL 6 12 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; ERROR 23000: Duplicate entry '2' for key 'b' -SHOW BINLOG EVENTS FROM 1118; +SHOW BINLOG EVENTS FROM 1119; Log_name Pos Event_type Server_id End_log_pos Info CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; @@ -137,11 +137,11 @@ a b 1 2 2 4 3 6 -SHOW BINLOG EVENTS FROM 1118; +SHOW BINLOG EVENTS FROM 1119; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1118 Query 1 1218 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) -master-bin.000001 1218 Table_map 1 1258 table_id: # (test.t7) -master-bin.000001 1258 Write_rows 1 1314 table_id: # flags: STMT_END_F +master-bin.000001 1119 Query 1 1219 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) +master-bin.000001 1219 Table_map 1 1259 table_id: # (test.t7) +master-bin.000001 1259 Write_rows 1 1315 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -154,10 +154,10 @@ INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -SHOW BINLOG EVENTS FROM 1314; +SHOW BINLOG EVENTS FROM 1315; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1314 Table_map 1 1354 table_id: # (test.t7) -master-bin.000001 1354 Write_rows 1 1410 table_id: # flags: STMT_END_F +master-bin.000001 1315 Table_map 1 1355 table_id: # (test.t7) +master-bin.000001 1355 Write_rows 1 1411 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -192,10 +192,10 @@ Create Table CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW BINLOG EVENTS FROM 1410; +SHOW BINLOG EVENTS FROM 1411; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 1410 Query 1 1496 use `test`; CREATE TABLE t8 LIKE t4 -master-bin.000001 1496 Query 1 1635 use `test`; CREATE TABLE `t9` ( +master-bin.000001 1411 Query 1 1497 use `test`; CREATE TABLE t8 LIKE t4 +master-bin.000001 1497 Query 1 1636 use `test`; CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) @@ -274,33 +274,33 @@ a 3 SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) -master-bin.000001 227 Write_rows 1 271 table_id: # flags: STMT_END_F -master-bin.000001 271 Query 1 339 use `test`; BEGIN -master-bin.000001 339 Query 1 125 use `test`; CREATE TABLE `t2` ( +master-bin.000001 4 Format_desc 1 103 Server ver: #, Binlog ver: # +master-bin.000001 103 Query 1 189 use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 189 Table_map 1 228 table_id: # (test.t1) +master-bin.000001 228 Write_rows 1 272 table_id: # flags: STMT_END_F +master-bin.000001 272 Query 1 340 use `test`; BEGIN +master-bin.000001 340 Query 1 125 use `test`; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -master-bin.000001 464 Table_map 1 164 table_id: # (test.t2) -master-bin.000001 503 Write_rows 1 208 table_id: # flags: STMT_END_F -master-bin.000001 547 Xid 1 574 COMMIT /* XID */ -master-bin.000001 574 Query 1 642 use `test`; BEGIN -master-bin.000001 642 Query 1 125 use `test`; CREATE TABLE `t3` ( +master-bin.000001 465 Table_map 1 164 table_id: # (test.t2) +master-bin.000001 504 Write_rows 1 208 table_id: # flags: STMT_END_F +master-bin.000001 548 Xid 1 575 COMMIT /* XID */ +master-bin.000001 575 Query 1 643 use `test`; BEGIN +master-bin.000001 643 Query 1 125 use `test`; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -master-bin.000001 767 Table_map 1 164 table_id: # (test.t3) -master-bin.000001 806 Write_rows 1 208 table_id: # flags: STMT_END_F -master-bin.000001 850 Xid 1 877 COMMIT /* XID */ -master-bin.000001 877 Query 1 945 use `test`; BEGIN -master-bin.000001 945 Query 1 125 use `test`; CREATE TABLE `t4` ( +master-bin.000001 768 Table_map 1 164 table_id: # (test.t3) +master-bin.000001 807 Write_rows 1 208 table_id: # flags: STMT_END_F +master-bin.000001 851 Xid 1 878 COMMIT /* XID */ +master-bin.000001 878 Query 1 946 use `test`; BEGIN +master-bin.000001 946 Query 1 125 use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -master-bin.000001 1070 Table_map 1 164 table_id: # (test.t4) -master-bin.000001 1109 Write_rows 1 208 table_id: # flags: STMT_END_F -master-bin.000001 1153 Xid 1 1180 COMMIT /* XID */ -master-bin.000001 1180 Table_map 1 1219 table_id: # (test.t1) -master-bin.000001 1219 Write_rows 1 1263 table_id: # flags: STMT_END_F +master-bin.000001 1071 Table_map 1 164 table_id: # (test.t4) +master-bin.000001 1110 Write_rows 1 208 table_id: # flags: STMT_END_F +master-bin.000001 1154 Xid 1 1181 COMMIT /* XID */ +master-bin.000001 1181 Table_map 1 1220 table_id: # (test.t1) +master-bin.000001 1220 Write_rows 1 1264 table_id: # flags: STMT_END_F SHOW TABLES; Tables_in_test t1 @@ -365,17 +365,17 @@ a 9 SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: # -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 188 Table_map 1 227 table_id: # (test.t1) -master-bin.000001 227 Write_rows 1 271 table_id: # flags: STMT_END_F -master-bin.000001 271 Query 1 371 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB -master-bin.000001 371 Query 1 439 use `test`; BEGIN -master-bin.000001 439 Table_map 1 39 table_id: # (test.t2) -master-bin.000001 478 Write_rows 1 83 table_id: # flags: STMT_END_F -master-bin.000001 522 Table_map 1 122 table_id: # (test.t2) -master-bin.000001 561 Write_rows 1 161 table_id: # flags: STMT_END_F -master-bin.000001 600 Xid 1 627 COMMIT /* XID */ +master-bin.000001 4 Format_desc 1 103 Server ver: #, Binlog ver: # +master-bin.000001 103 Query 1 189 use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 189 Table_map 1 228 table_id: # (test.t1) +master-bin.000001 228 Write_rows 1 272 table_id: # flags: STMT_END_F +master-bin.000001 272 Query 1 372 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB +master-bin.000001 372 Query 1 440 use `test`; BEGIN +master-bin.000001 440 Table_map 1 39 table_id: # (test.t2) +master-bin.000001 479 Write_rows 1 83 table_id: # flags: STMT_END_F +master-bin.000001 523 Table_map 1 122 table_id: # (test.t2) +master-bin.000001 562 Write_rows 1 161 table_id: # flags: STMT_END_F +master-bin.000001 601 Xid 1 628 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a 1 @@ -394,10 +394,10 @@ INSERT INTO t2 SELECT a+2 FROM tt2; ROLLBACK; SELECT * FROM t2 ORDER BY a; a -SHOW BINLOG EVENTS FROM 627; +SHOW BINLOG EVENTS FROM 628; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 627 Query 1 80 use `test`; TRUNCATE TABLE t2 -master-bin.000001 707 Xid 1 734 COMMIT /* XID */ +master-bin.000001 628 Query 1 80 use `test`; TRUNCATE TABLE t2 +master-bin.000001 708 Xid 1 735 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a DROP TABLE t1,t2; diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/r/rpl_row_delayed_ins.result index 21b251db193..fff774fcfde 100644 --- a/mysql-test/r/rpl_row_delayed_ins.result +++ b/mysql-test/r/rpl_row_delayed_ins.result @@ -16,15 +16,15 @@ a 3 show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 222 use `test`; create table t1(a int not null primary key) engine=myisam -master-bin.000001 222 Table_map 1 261 table_id: # (test.t1) -master-bin.000001 261 Write_rows 1 295 table_id: # flags: STMT_END_F -master-bin.000001 295 Table_map 1 334 table_id: # (test.t1) -master-bin.000001 334 Write_rows 1 368 table_id: # flags: STMT_END_F -master-bin.000001 368 Table_map 1 407 table_id: # (test.t1) -master-bin.000001 407 Write_rows 1 441 table_id: # flags: STMT_END_F -master-bin.000001 441 Query 1 516 use `test`; flush tables +master-bin.000001 4 Format_desc 1 103 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 223 use `test`; create table t1(a int not null primary key) engine=myisam +master-bin.000001 223 Table_map 1 262 table_id: # (test.t1) +master-bin.000001 262 Write_rows 1 296 table_id: # flags: STMT_END_F +master-bin.000001 296 Table_map 1 335 table_id: # (test.t1) +master-bin.000001 335 Write_rows 1 369 table_id: # flags: STMT_END_F +master-bin.000001 369 Table_map 1 408 table_id: # (test.t1) +master-bin.000001 408 Write_rows 1 442 table_id: # flags: STMT_END_F +master-bin.000001 442 Query 1 517 use `test`; flush tables SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/r/rpl_row_drop.result b/mysql-test/r/rpl_row_drop.result index 4ef21884fda..3fb3d979ee5 100644 --- a/mysql-test/r/rpl_row_drop.result +++ b/mysql-test/r/rpl_row_drop.result @@ -43,10 +43,10 @@ t2 DROP TABLE t1,t2; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a int) -master-bin.000001 188 Query 1 274 use `test`; CREATE TABLE t2 (a int) -master-bin.000001 274 Query 1 378 use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 4 Format_desc 1 103 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 189 use `test`; CREATE TABLE t1 (a int) +master-bin.000001 189 Query 1 275 use `test`; CREATE TABLE t2 (a int) +master-bin.000001 275 Query 1 379 use `test`; DROP TABLE `t1` /* generated by server */ SHOW TABLES; Tables_in_test t2 diff --git a/mysql-test/r/rpl_row_flsh_tbls.result b/mysql-test/r/rpl_row_flsh_tbls.result index e2352b8605b..d36a5f4df80 100644 --- a/mysql-test/r/rpl_row_flsh_tbls.result +++ b/mysql-test/r/rpl_row_flsh_tbls.result @@ -12,13 +12,13 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 615 ; +SHOW BINLOG EVENTS FROM 616 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 615 ; +SHOW BINLOG EVENTS FROM 616 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 # Query 1 # use `test`; flush tables diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/r/rpl_row_inexist_tbl.result index 5f5a4556d76..eeffe02ab4e 100644 --- a/mysql-test/r/rpl_row_inexist_tbl.result +++ b/mysql-test/r/rpl_row_inexist_tbl.result @@ -39,7 +39,7 @@ Replicate_Wild_Ignore_Table Last_Errno 1146 Last_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1` Skip_Counter 0 -Exec_Master_Log_Pos 519 +Exec_Master_Log_Pos 520 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result index 89163e1e37b..550ef163be8 100644 --- a/mysql-test/r/rpl_row_log.result +++ b/mysql-test/r/rpl_row_log.result @@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -show binlog events from 102 limit 1; +show binlog events from 103 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 102 limit 2; +show binlog events from 103 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Table_map 1 # table_id: # (test.t1) -show binlog events from 102 limit 2,1; +show binlog events from 103 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F flush logs; @@ -67,13 +67,13 @@ master-bin.000002 # Table_map 1 # table_id: # (test.t2) master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F show binary logs; Log_name File_size -master-bin.000001 1256 -master-bin.000002 373 +master-bin.000001 1257 +master-bin.000002 374 start slave; show binary logs; Log_name File_size -slave-bin.000001 1354 -slave-bin.000002 274 +slave-bin.000001 1355 +slave-bin.000002 275 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -94,7 +94,7 @@ slave-bin.000002 # Table_map 1 # table_id: # (test.t2) slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 373 # # master-bin.000002 Yes Yes # 0 0 373 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 374 # # master-bin.000002 Yes Yes # 0 0 374 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/r/rpl_row_log_innodb.result index 3bcd8a6a0fb..20e3975dc2a 100644 --- a/mysql-test/r/rpl_row_log_innodb.result +++ b/mysql-test/r/rpl_row_log_innodb.result @@ -28,14 +28,14 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not nul master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Xid 1 # COMMIT /* XID */ -show binlog events from 102 limit 1; +show binlog events from 103 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -show binlog events from 102 limit 2; +show binlog events from 103 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB master-bin.000001 # Table_map 1 # table_id: # (test.t1) -show binlog events from 102 limit 2,1; +show binlog events from 103 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F flush logs; @@ -72,13 +72,13 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Xid 1 # COMMIT /* XID */ show binary logs; Log_name File_size -master-bin.000001 1310 -master-bin.000002 400 +master-bin.000001 1311 +master-bin.000002 401 start slave; show binary logs; Log_name File_size -slave-bin.000001 1408 -slave-bin.000002 301 +slave-bin.000001 1409 +slave-bin.000002 302 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -102,7 +102,7 @@ slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Xid 1 # COMMIT /* XID */ show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 400 # # master-bin.000002 Yes Yes # 0 0 400 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 401 # # master-bin.000002 Yes Yes # 0 0 401 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_row_max_relay_size.result b/mysql-test/r/rpl_row_max_relay_size.result index 8bb10ffb080..ad16293bdb5 100644 --- a/mysql-test/r/rpl_row_max_relay_size.result +++ b/mysql-test/r/rpl_row_max_relay_size.result @@ -30,7 +30,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58664 +Read_Master_Log_Pos 58665 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -45,7 +45,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58664 +Exec_Master_Log_Pos 58665 Relay_Log_Space # Until_Condition None Until_Log_File @@ -73,7 +73,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58664 +Read_Master_Log_Pos 58665 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -88,7 +88,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58664 +Exec_Master_Log_Pos 58665 Relay_Log_Space # Until_Condition None Until_Log_File @@ -116,7 +116,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58664 +Read_Master_Log_Pos 58665 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -131,7 +131,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58664 +Exec_Master_Log_Pos 58665 Relay_Log_Space # Until_Condition None Until_Log_File @@ -197,7 +197,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58750 +Read_Master_Log_Pos 58751 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -212,7 +212,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58750 +Exec_Master_Log_Pos 58751 Relay_Log_Space # Until_Condition None Until_Log_File @@ -236,7 +236,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58826 +Read_Master_Log_Pos 58827 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -251,7 +251,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58826 +Exec_Master_Log_Pos 58827 Relay_Log_Space # Until_Condition None Until_Log_File @@ -266,7 +266,7 @@ Seconds_Behind_Master # flush logs; show master status; File master-bin.000002 -Position 102 +Position 103 Binlog_Do_DB Binlog_Ignore_DB set global max_binlog_size= @my_max_binlog_size; diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/r/rpl_row_reset_slave.result index 57fc95708e5..b1f16c80619 100644 --- a/mysql-test/r/rpl_row_reset_slave.result +++ b/mysql-test/r/rpl_row_reset_slave.result @@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 103 # # master-bin.000001 Yes Yes # 0 0 103 # None 0 No # stop slave; change master to master_user='test'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 103 # # master-bin.000001 No No # 0 0 103 # None 0 No # reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 103 # # master-bin.000001 Yes Yes # 0 0 103 # None 0 No # stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/r/rpl_row_until.result index 8d4b0d6b591..66c8c951857 100644 --- a/mysql-test/r/rpl_row_until.result +++ b/mysql-test/r/rpl_row_until.result @@ -21,7 +21,7 @@ n 4 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-bin.000001 311 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 741 slave-relay-bin.000004 # master-bin.000001 # No 0 0 312 # Master master-bin.000001 311 No # start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; select * from t1; n @@ -31,7 +31,7 @@ n 4 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-no-such-bin.000001 291 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 741 slave-relay-bin.000004 # master-bin.000001 # No 0 0 312 # Master master-no-such-bin.000001 291 No # start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; select * from t2; n @@ -39,13 +39,13 @@ n 2 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 586 # Relay slave-relay-bin.000004 728 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 741 slave-relay-bin.000004 # master-bin.000001 # No 0 0 587 # Relay slave-relay-bin.000004 728 No # start slave; stop slave; start slave until master_log_file='master-bin.000001', master_log_pos=740; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 740 # Master master-bin.000001 740 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 741 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 741 # Master master-bin.000001 740 No # start slave until master_log_file='master-bin', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result index c94a7748fcd..73f6d9d7536 100644 --- a/mysql-test/r/rpl_server_id1.result +++ b/mysql-test/r/rpl_server_id1.result @@ -10,7 +10,7 @@ stop slave; change master to master_port=SLAVE_PORT; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 102 None 0 No NULL + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 103 None 0 No NULL start slave; insert into t1 values (1); show status like "slave_running"; diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result index 72db862040e..4b014a19219 100644 --- a/mysql-test/r/rpl_server_id2.result +++ b/mysql-test/r/rpl_server_id2.result @@ -10,7 +10,7 @@ stop slave; change master to master_port=SLAVE_PORT; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 102 None 0 No NULL + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 103 None 0 No NULL start slave; insert into t1 values (1); select * from t1; diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 34ff77996be..477518b5491 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -381,7 +381,7 @@ return 0; end| use mysqltest; set @a:= mysqltest2.f1(); -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest1 master-bin.000001 # Query 1 # create database mysqltest1 diff --git a/mysql-test/r/rpl_stm_charset.result b/mysql-test/r/rpl_stm_charset.result index f1691608bc7..ac29bf5b618 100644 --- a/mysql-test/r/rpl_stm_charset.result +++ b/mysql-test/r/rpl_stm_charset.result @@ -103,7 +103,7 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest2 master-bin.000001 # Query 1 # drop database if exists mysqltest3 diff --git a/mysql-test/r/rpl_stm_flsh_tbls.result b/mysql-test/r/rpl_stm_flsh_tbls.result index a6123d75cb3..af3a6c87c5e 100644 --- a/mysql-test/r/rpl_stm_flsh_tbls.result +++ b/mysql-test/r/rpl_stm_flsh_tbls.result @@ -12,13 +12,13 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 652 ; +SHOW BINLOG EVENTS FROM 653 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 652 ; +SHOW BINLOG EVENTS FROM 653 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 # Query 1 # use `test`; flush tables diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result index e0b1aa12c9b..61202cf43e7 100644 --- a/mysql-test/r/rpl_stm_log.result +++ b/mysql-test/r/rpl_stm_log.result @@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 -show binlog events from 102 limit 1; +show binlog events from 103 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 102 limit 2; +show binlog events from 103 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Intvar 1 # INSERT_ID=1 -show binlog events from 102 limit 2,1; +show binlog events from 103 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) flush logs; @@ -66,13 +66,13 @@ master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM master-bin.000002 # Query 1 # use `test`; insert into t2 values (1) show binary logs; Log_name File_size -master-bin.000001 1343 -master-bin.000002 388 +master-bin.000001 1344 +master-bin.000002 389 start slave; show binary logs; Log_name File_size -slave-bin.000001 1443 -slave-bin.000002 289 +slave-bin.000001 1444 +slave-bin.000002 290 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -92,7 +92,7 @@ slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1) show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 388 # # master-bin.000002 Yes Yes # 0 0 388 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 389 # # master-bin.000002 Yes Yes # 0 0 389 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/r/rpl_stm_max_relay_size.result index c4a9a5bd3ff..87fdf9dd20a 100644 --- a/mysql-test/r/rpl_stm_max_relay_size.result +++ b/mysql-test/r/rpl_stm_max_relay_size.result @@ -28,7 +28,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72956 +Read_Master_Log_Pos 72957 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72956 +Exec_Master_Log_Pos 72957 Relay_Log_Space # Until_Condition None Until_Log_File @@ -71,7 +71,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72956 +Read_Master_Log_Pos 72957 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -86,7 +86,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72956 +Exec_Master_Log_Pos 72957 Relay_Log_Space # Until_Condition None Until_Log_File @@ -114,7 +114,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72956 +Read_Master_Log_Pos 72957 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -129,7 +129,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72956 +Exec_Master_Log_Pos 72957 Relay_Log_Space # Until_Condition None Until_Log_File @@ -195,7 +195,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 73042 +Read_Master_Log_Pos 73043 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -210,7 +210,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 73042 +Exec_Master_Log_Pos 73043 Relay_Log_Space # Until_Condition None Until_Log_File @@ -234,7 +234,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 73118 +Read_Master_Log_Pos 73119 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -249,7 +249,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 73118 +Exec_Master_Log_Pos 73119 Relay_Log_Space # Until_Condition None Until_Log_File @@ -264,7 +264,7 @@ Seconds_Behind_Master # flush logs; show master status; File master-bin.000002 -Position 102 +Position 103 Binlog_Do_DB Binlog_Ignore_DB set global max_binlog_size= @my_max_binlog_size; diff --git a/mysql-test/r/rpl_stm_multi_query.result b/mysql-test/r/rpl_stm_multi_query.result index bf914e6ce6c..f49c0d58497 100644 --- a/mysql-test/r/rpl_stm_multi_query.result +++ b/mysql-test/r/rpl_stm_multi_query.result @@ -19,7 +19,7 @@ n 3 4 5 -show binlog events from 102; +show binlog events from 103; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest master-bin.000001 # Query 1 # create database mysqltest diff --git a/mysql-test/r/rpl_stm_reset_slave.result b/mysql-test/r/rpl_stm_reset_slave.result index 834b9add089..4c09772a879 100644 --- a/mysql-test/r/rpl_stm_reset_slave.result +++ b/mysql-test/r/rpl_stm_reset_slave.result @@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 103 # # master-bin.000001 Yes Yes # 0 0 103 # None 0 No # stop slave; change master to master_user='test'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 103 # # master-bin.000001 No No # 0 0 103 # None 0 No # reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 103 # # master-bin.000001 Yes Yes # 0 0 103 # None 0 No # stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_stm_until.result b/mysql-test/r/rpl_stm_until.result index e8e33b66864..668d49a4d0b 100644 --- a/mysql-test/r/rpl_stm_until.result +++ b/mysql-test/r/rpl_stm_until.result @@ -26,7 +26,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 781 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 323 +Exec_Master_Log_Pos 324 Relay_Log_Space # Until_Condition Master Until_Log_File master-bin.000001 @@ -67,7 +67,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 781 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -82,7 +82,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 323 +Exec_Master_Log_Pos 324 Relay_Log_Space # Until_Condition Master Until_Log_File master-no-such-bin.000001 @@ -106,7 +106,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 781 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -121,7 +121,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 612 +Exec_Master_Log_Pos 613 Relay_Log_Space # Until_Condition Relay Until_Log_File slave-relay-bin.000004 @@ -143,7 +143,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 780 +Read_Master_Log_Pos 781 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -158,7 +158,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 780 +Exec_Master_Log_Pos 781 Relay_Log_Space # Until_Condition Master Until_Log_File master-bin.000001 diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/r/rpl_switch_stm_row_mixed.result index 48b228550a7..08dd7b6506c 100644 --- a/mysql-test/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/r/rpl_switch_stm_row_mixed.result @@ -404,84 +404,84 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; -show binlog events from 102; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest1 -master-bin.000001 # Query 1 # create database mysqltest1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_8_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_9_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_10_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_11_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_13_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_14_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_15_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_16_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_18_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_21_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_24_" -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t2` ( +master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Query # # create database mysqltest1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_" +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` ( `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t3` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` ( `1` varbinary(36) NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t4` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` ( `a` varchar(100) DEFAULT NULL ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t4) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t5) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() begin insert into t1 values("work_25_"); insert into t1 values(concat("for_26_",UUID())); insert into t1 select "yesterday_27_"; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() begin insert into t1 values(concat("emergency_28_",UUID())); insert into t1 values("work_29_"); @@ -490,308 +490,308 @@ set session binlog_format=row; # accepted for stored procs insert into t1 values("more work_31_"); set session binlog_format=mixed; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin set session binlog_format=row; # rejected for stored funcs insert into t1 values("alarm"); return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) begin insert into t1 values(concat("work_250_",x)); insert into t1 select "yesterday_270_"; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Query 1 # use `mysqltest1`; drop function foo3 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Query # # use `mysqltest1`; drop function foo3 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin insert into t1 values("foo3_32_"); call foo(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned begin insert into t2 select foo3(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned begin insert into t2 select UUID(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned begin insert into t2 select x; return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() -master-bin.000001 # Query 1 # use `mysqltest1`; create table t11 (data varchar(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() +master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row begin set NEW.data = concat(NEW.data,UUID()); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t20 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t21 select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t22 select * from t3 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1,t2,t3 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t3 (b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Intvar 1 # INSERT_ID=3 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_44_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') -master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f -master-bin.000001 # Query 1 # use `mysqltest1`; create table t14 (unique (a)) select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; truncate table t2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') +master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; drop function f +master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; truncate table t2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); return 1; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin declare y int; insert into t1 values(null,x); set y = (select count(*) from t2); return y; end -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row begin insert into t2 values(null,"try_55_"); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; alter table t1 modify a int, drop primary key -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_57_") -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t16` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_") +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` ( `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t16 values("try_66_") -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t11 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t12 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t12 (data LONG) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -show binlog events from 102; +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_") +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest1 -master-bin.000001 # Query 1 # create database mysqltest1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_8_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_9_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_10_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_11_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_13_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_14_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_15_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_16_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_18_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_21_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_24_" -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t2` ( +master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Query # # create database mysqltest1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_" +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` ( `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t3` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` ( `1` varbinary(36) NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t4` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` ( `a` varchar(100) DEFAULT NULL ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t4) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t5) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() begin insert into t1 values("work_25_"); insert into t1 values(concat("for_26_",UUID())); insert into t1 select "yesterday_27_"; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() begin insert into t1 values(concat("emergency_28_",UUID())); insert into t1 values("work_29_"); @@ -800,228 +800,228 @@ set session binlog_format=row; # accepted for stored procs insert into t1 values("more work_31_"); set session binlog_format=mixed; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin set session binlog_format=row; # rejected for stored funcs insert into t1 values("alarm"); return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) begin insert into t1 values(concat("work_250_",x)); insert into t1 select "yesterday_270_"; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Query 1 # use `mysqltest1`; drop function foo3 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Query # # use `mysqltest1`; drop function foo3 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin insert into t1 values("foo3_32_"); call foo(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned begin insert into t2 select foo3(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned begin insert into t2 select UUID(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned begin insert into t2 select x; return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() -master-bin.000001 # Query 1 # use `mysqltest1`; create table t11 (data varchar(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() +master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row begin set NEW.data = concat(NEW.data,UUID()); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t20 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t21 select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t22 select * from t3 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1,t2,t3 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t3 (b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Intvar 1 # INSERT_ID=3 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_44_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') -master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f -master-bin.000001 # Query 1 # use `mysqltest1`; create table t14 (unique (a)) select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; truncate table t2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') +master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; drop function f +master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; truncate table t2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); return 1; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin declare y int; insert into t1 values(null,x); set y = (select count(*) from t2); return y; end -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row begin insert into t2 values(null,"try_55_"); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; alter table t1 modify a int, drop primary key -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_57_") -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t16` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_") +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` ( `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t16 values("try_66_") -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t11 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t12 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t12 (data LONG) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_") +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F drop database mysqltest1; diff --git a/mysql-test/r/rpl_truncate_2myisam.result b/mysql-test/r/rpl_truncate_2myisam.result index 41640a709b9..8070ca03b6e 100644 --- a/mysql-test/r/rpl_truncate_2myisam.result +++ b/mysql-test/r/rpl_truncate_2myisam.result @@ -31,11 +31,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 387 use `test`; TRUNCATE TABLE t1 -master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 211 Query 1 308 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Query 1 388 use `test`; TRUNCATE TABLE t1 +master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -63,11 +63,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 387 use `test`; TRUNCATE TABLE t1 -master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 211 Query 1 308 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Query 1 388 use `test`; TRUNCATE TABLE t1 +master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -95,12 +95,12 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Table_map 1 250 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 297 table_id: # flags: STMT_END_F -master-bin.000001 297 Query 1 377 use `test`; TRUNCATE TABLE t1 -master-bin.000001 377 Query 1 453 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 211 Table_map 1 251 table_id: # (test.t1) +master-bin.000001 251 Write_rows 1 298 table_id: # flags: STMT_END_F +master-bin.000001 298 Query 1 378 use `test`; TRUNCATE TABLE t1 +master-bin.000001 378 Query 1 454 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -128,11 +128,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 384 use `test`; DELETE FROM t1 -master-bin.000001 384 Query 1 460 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 211 Query 1 308 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Query 1 385 use `test`; DELETE FROM t1 +master-bin.000001 385 Query 1 461 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -160,11 +160,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Query 1 307 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Query 1 384 use `test`; DELETE FROM t1 -master-bin.000001 384 Query 1 460 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 211 Query 1 308 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Query 1 385 use `test`; DELETE FROM t1 +master-bin.000001 385 Query 1 461 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -193,10 +193,10 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 210 Table_map 1 250 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 297 table_id: # flags: STMT_END_F -master-bin.000001 297 Table_map 1 337 table_id: # (test.t1) -master-bin.000001 337 Delete_rows 1 384 table_id: # flags: STMT_END_F -master-bin.000001 384 Query 1 460 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 211 Table_map 1 251 table_id: # (test.t1) +master-bin.000001 251 Write_rows 1 298 table_id: # flags: STMT_END_F +master-bin.000001 298 Table_map 1 338 table_id: # (test.t1) +master-bin.000001 338 Delete_rows 1 385 table_id: # flags: STMT_END_F +master-bin.000001 385 Query 1 461 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/rpl_truncate_3innodb.result b/mysql-test/r/rpl_truncate_3innodb.result index 062c9704ae0..08ec24c3275 100644 --- a/mysql-test/r/rpl_truncate_3innodb.result +++ b/mysql-test/r/rpl_truncate_3innodb.result @@ -31,13 +31,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ -master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 211 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Xid 1 335 COMMIT /* xid= */ +master-bin.000001 335 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ +master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -65,13 +65,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ -master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 211 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Xid 1 335 COMMIT /* xid= */ +master-bin.000001 335 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ +master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -99,14 +99,14 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 297 Xid 1 324 COMMIT /* xid= */ -master-bin.000001 324 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 404 Xid 1 431 COMMIT /* xid= */ -master-bin.000001 431 Query 1 507 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 211 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 251 Write_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 298 Xid 1 325 COMMIT /* xid= */ +master-bin.000001 325 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 405 Xid 1 432 COMMIT /* xid= */ +master-bin.000001 432 Query 1 508 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -134,13 +134,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 411 Xid 1 438 COMMIT /* xid= */ -master-bin.000001 438 Query 1 514 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 211 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Xid 1 335 COMMIT /* xid= */ +master-bin.000001 335 Query 1 77 use `test`; DELETE FROM t1 +master-bin.000001 412 Xid 1 439 COMMIT /* xid= */ +master-bin.000001 439 Query 1 515 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -168,13 +168,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 307 Xid 1 334 COMMIT /* xid= */ -master-bin.000001 334 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 411 Xid 1 438 COMMIT /* xid= */ -master-bin.000001 438 Query 1 514 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 211 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 308 Xid 1 335 COMMIT /* xid= */ +master-bin.000001 335 Query 1 77 use `test`; DELETE FROM t1 +master-bin.000001 412 Xid 1 439 COMMIT /* xid= */ +master-bin.000001 439 Query 1 515 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -203,12 +203,12 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 210 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 210 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 250 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 297 Xid 1 324 COMMIT /* xid= */ -master-bin.000001 324 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 364 Delete_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 411 Xid 1 438 COMMIT /* xid= */ -master-bin.000001 438 Query 1 514 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 211 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 211 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 251 Write_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 298 Xid 1 325 COMMIT /* xid= */ +master-bin.000001 325 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 365 Delete_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 412 Xid 1 439 COMMIT /* xid= */ +master-bin.000001 439 Query 1 515 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result index 63d4b0f9411..c68b703993d 100644 --- a/mysql-test/r/rpl_truncate_7ndb.result +++ b/mysql-test/r/rpl_truncate_7ndb.result @@ -29,16 +29,16 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 219 Query 1 283 BEGIN -master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 378 Write_rows 1 137 table_id: # -master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 467 Query 1 532 COMMIT -master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1 -master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 220 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 220 Query 1 284 BEGIN +master-bin.000001 284 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 324 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 379 Write_rows 1 137 table_id: # +master-bin.000001 421 Write_rows 1 184 table_id: # flags: STMT_END_F +master-bin.000001 468 Query 1 533 COMMIT +master-bin.000001 533 Query 1 613 use `test`; TRUNCATE TABLE t1 +master-bin.000001 613 Query 1 689 use `test`; DROP TABLE t1 **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; INSERT INTO t1 VALUES (1,1), (2,2); @@ -65,27 +65,27 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 219 Query 1 283 BEGIN -master-bin.000001 283 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 378 Write_rows 1 137 table_id: # -master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 467 Query 1 532 COMMIT -master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1 -master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1 -master-bin.000001 688 Query 1 805 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 805 Query 1 869 BEGIN -master-bin.000001 869 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 909 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 964 Write_rows 1 137 table_id: # -master-bin.000001 1006 Write_rows 1 184 table_id: # flags: STMT_END_F -master-bin.000001 1053 Query 1 1118 COMMIT -master-bin.000001 1118 Query 1 1182 BEGIN -master-bin.000001 1182 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 1222 Table_map 1 95 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1277 Write_rows 1 137 table_id: # -master-bin.000001 1319 Delete_rows 1 176 table_id: # flags: STMT_END_F -master-bin.000001 1358 Query 1 1423 COMMIT -master-bin.000001 1423 Query 1 1499 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 103 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 103 Query 1 220 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 220 Query 1 284 BEGIN +master-bin.000001 284 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 324 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 379 Write_rows 1 137 table_id: # +master-bin.000001 421 Write_rows 1 184 table_id: # flags: STMT_END_F +master-bin.000001 468 Query 1 533 COMMIT +master-bin.000001 533 Query 1 613 use `test`; TRUNCATE TABLE t1 +master-bin.000001 613 Query 1 689 use `test`; DROP TABLE t1 +master-bin.000001 689 Query 1 806 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 806 Query 1 870 BEGIN +master-bin.000001 870 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 910 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 965 Write_rows 1 137 table_id: # +master-bin.000001 1007 Write_rows 1 184 table_id: # flags: STMT_END_F +master-bin.000001 1054 Query 1 1119 COMMIT +master-bin.000001 1119 Query 1 1183 BEGIN +master-bin.000001 1183 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 1223 Table_map 1 95 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1278 Write_rows 1 137 table_id: # +master-bin.000001 1320 Delete_rows 1 176 table_id: # flags: STMT_END_F +master-bin.000001 1359 Query 1 1424 COMMIT +master-bin.000001 1424 Query 1 1500 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 1c50289a85d..b76b399c9e2 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -6,13 +6,13 @@ INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; SET @var2=char(ascii('a')); insert into t1 values (@var1),(@var2); -show binlog events from 102; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # User var 1 # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@`a b`) -master-bin.000001 # User var 1 # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci -master-bin.000001 # User var 1 # @`var2`=_binary 0x61 COLLATE binary -master-bin.000001 # Query 1 # use `test`; insert into t1 values (@var1),(@var2) +master-bin.000001 # User var # # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@`a b`) +master-bin.000001 # User var # # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci +master-bin.000001 # User var # # @`var2`=_binary 0x61 COLLATE binary +master-bin.000001 # Query # # use `test`; insert into t1 values (@var1),(@var2) flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/t/binlog_row_mix_innodb_myisam.test index b131e5350af..be03bc10983 100644 --- a/mysql-test/t/binlog_row_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_row_mix_innodb_myisam.test @@ -20,7 +20,7 @@ # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) flush logs; ---exec $MYSQL_BINLOG --start-position=516 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output +--exec $MYSQL_BINLOG --start-position=517 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test index 8d7399b918e..586ebfd97cf 100644 --- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test @@ -12,7 +12,7 @@ # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) flush logs; ---exec $MYSQL_BINLOG --start-position=551 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output +--exec $MYSQL_BINLOG --start-position=552 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test index 6b591fbe5f5..b0fae5cd4f6 100644 --- a/mysql-test/t/ctype_cp932_binlog_stm.test +++ b/mysql-test/t/ctype_cp932_binlog_stm.test @@ -22,7 +22,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)| SELECT HEX(s1),HEX(s2),d FROM t4| DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 397| +SHOW BINLOG EVENTS FROM 398| delimiter ;| # End of 5.0 tests diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index ad6a16810c5..ce5077faa94 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -65,7 +65,7 @@ select "--- --database --" as ""; select "--- --position --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=235 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=236 $MYSQLTEST_VARDIR/log/master-bin.000002 # These are tests for remote binlog. # They should return the same as previous test. @@ -97,7 +97,7 @@ select "--- --database --" as ""; select "--- --position --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=235 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=236 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 # Bug#7853 (mysqlbinlog does not accept input from stdin) --disable_query_log diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 85a678055d4..084ad18a7d7 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -52,11 +52,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=605 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=605 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -82,11 +82,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=605 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=130 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --stop-position=131 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -109,11 +109,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=605 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=605 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -136,11 +136,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=605 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=130 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form --stop-position=131 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log diff --git a/mysql-test/t/rpl_incident.test b/mysql-test/t/rpl_incident.test new file mode 100644 index 00000000000..9c30d29b6fd --- /dev/null +++ b/mysql-test/t/rpl_incident.test @@ -0,0 +1,47 @@ +--source include/master-slave.inc +--source include/have_debug.inc + +--echo **** On Master **** +CREATE TABLE t1 (a INT); + +INSERT INTO t1 VALUES (1),(2),(3); +SELECT * FROM t1; + +SET @saved = @@debug; +SET SESSION debug="d,incident_database_resync_on_replace"; + +# This will generate an incident log event and store it in the binary +# log before the replace statement. +REPLACE INTO t1 VALUES (4); +SET SESSION debug=@saved; +--save_master_pos +SELECT * FROM t1; + +connection slave; +--wait_for_slave_to_stop + +# The 4 should not be inserted into the table, since the incident log +# event should have stop the slave. +--echo **** On Slave **** +SELECT * FROM t1; + +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # +--query_vertical SHOW SLAVE STATUS + +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +--sync_with_master + +# Now, we should have inserted the row into the table and the slave +# should be running. We should also have rotated to a new binary log. + +SELECT * FROM t1; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # +--query_vertical SHOW SLAVE STATUS + +DROP TABLE t1; +connection master; +DROP TABLE t1; + diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/t/rpl_loaddata_s.test index 2c94c8ef953..817f2f1531f 100644 --- a/mysql-test/t/rpl_loaddata_s.test +++ b/mysql-test/t/rpl_loaddata_s.test @@ -20,9 +20,8 @@ save_master_pos; connection slave; sync_with_master; select count(*) from test.t1; # check that LOAD was replicated ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; # should be nothing +# Should be nothing +source include/show_binlog_events.inc; # Cleanup connection master; diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test index 61c24da514e..01278aa51f9 100644 --- a/mysql-test/t/rpl_log_pos.test +++ b/mysql-test/t/rpl_log_pos.test @@ -18,12 +18,12 @@ sync_slave_with_master; --replace_column 1 # 8 # 9 # 23 # 33 # show slave status; stop slave; -change master to master_log_pos=74; +change master to master_log_pos=75; start slave; sleep 5; stop slave; -change master to master_log_pos=74; +change master to master_log_pos=75; --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 8 # 9 # 23 # 33 # show slave status; @@ -33,7 +33,7 @@ sleep 5; --replace_column 1 # 8 # 9 # 23 # 33 # show slave status; stop slave; -change master to master_log_pos=177; +change master to master_log_pos=178; start slave; sleep 2; --replace_result $MASTER_MYPORT MASTER_PORT @@ -49,7 +49,7 @@ insert into t1 values (1),(2),(3); save_master_pos; connection slave; stop slave; -change master to master_log_pos=102; +change master to master_log_pos=103; start slave; sync_with_master; select * from t1 ORDER BY n; diff --git a/mysql-test/t/rpl_row_basic_11bugs.test b/mysql-test/t/rpl_row_basic_11bugs.test index 5b28af75d33..abef8399414 100644 --- a/mysql-test/t/rpl_row_basic_11bugs.test +++ b/mysql-test/t/rpl_row_basic_11bugs.test @@ -25,7 +25,7 @@ CREATE TABLE t2 (a INT, b INT); SHOW TABLES; INSERT INTO t2 VALUES (3,3), (4,4); --replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 102; +SHOW BINLOG EVENTS FROM 103; sync_slave_with_master; --echo **** On Slave **** SHOW DATABASES; diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test index 6accf0c8bef..d675a3f5a89 100644 --- a/mysql-test/t/rpl_row_create_table.test +++ b/mysql-test/t/rpl_row_create_table.test @@ -36,7 +36,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; --replace_column 1 # 4 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ ---query_vertical SHOW BINLOG EVENTS FROM 212 +--query_vertical SHOW BINLOG EVENTS FROM 213 --echo **** On Master **** --query_vertical SHOW CREATE TABLE t1 --query_vertical SHOW CREATE TABLE t2 @@ -71,7 +71,7 @@ connection master; CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; # Shouldn't be written to the binary log --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1118; +SHOW BINLOG EVENTS FROM 1119; # Test that INSERT-SELECT works the same way as for SBR. CREATE TABLE t7 (a INT, b INT UNIQUE); @@ -80,7 +80,7 @@ INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1118; +SHOW BINLOG EVENTS FROM 1119; sync_slave_with_master; SELECT * FROM t7 ORDER BY a,b; @@ -91,7 +91,7 @@ BEGIN; INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1314; +SHOW BINLOG EVENTS FROM 1315; SELECT * FROM t7 ORDER BY a,b; sync_slave_with_master; SELECT * FROM t7 ORDER BY a,b; @@ -106,7 +106,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1; --query_vertical SHOW CREATE TABLE t8 --query_vertical SHOW CREATE TABLE t9 --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 1410; +SHOW BINLOG EVENTS FROM 1411; sync_slave_with_master; --echo **** On Slave **** --query_vertical SHOW CREATE TABLE t8 @@ -220,7 +220,7 @@ ROLLBACK; SELECT * FROM t2 ORDER BY a; --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS FROM 627; +SHOW BINLOG EVENTS FROM 628; sync_slave_with_master; SELECT * FROM t2 ORDER BY a; diff --git a/mysql-test/t/rpl_row_flsh_tbls.test b/mysql-test/t/rpl_row_flsh_tbls.test index 9e8efc1ac9c..e050d993897 100644 --- a/mysql-test/t/rpl_row_flsh_tbls.test +++ b/mysql-test/t/rpl_row_flsh_tbls.test @@ -1,7 +1,7 @@ # depends on the binlog output -- source include/have_binlog_format_row.inc -let $rename_event_pos= 615; +let $rename_event_pos= 616; # Bug#18326: Do not lock table for writing during prepare of statement # The use of the ps protocol causes extra table maps in the binlog, so diff --git a/mysql-test/t/rpl_row_mysqlbinlog.test b/mysql-test/t/rpl_row_mysqlbinlog.test index 3b4c8db86d8..7ca8ca39621 100644 --- a/mysql-test/t/rpl_row_mysqlbinlog.test +++ b/mysql-test/t/rpl_row_mysqlbinlog.test @@ -162,12 +162,12 @@ connection master; # this test for position option -# By setting this position to 412, we should only get the create of t3 +# By setting this position to 413, we should only get the create of t3 --disable_query_log select "--- Test 2 position test --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=412 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=413 $MYSQLTEST_VARDIR/log/master-bin.000001 # These are tests for remote binlog. # They should return the same as previous test. @@ -263,7 +263,7 @@ select "--- Test 6 reading stdin --" as ""; select "--- Test 7 reading stdin w/position --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --position=412 - < $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --position=413 - < $MYSQLTEST_VARDIR/log/master-bin.000001 # Bug#16217 (mysql client did not know how not switch its internal charset) --disable_query_log diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index 9a1960db647..a9eb40091a6 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -566,7 +566,7 @@ connection master; # were written to the binary log. --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events in 'master-bin.000001' from 102; +show binlog events in 'master-bin.000001' from 103; # Restore log_bin_trust_function_creators to its original value. diff --git a/mysql-test/t/rpl_stm_flsh_tbls.test b/mysql-test/t/rpl_stm_flsh_tbls.test index 43a5234ccc7..a8c5395a621 100644 --- a/mysql-test/t/rpl_stm_flsh_tbls.test +++ b/mysql-test/t/rpl_stm_flsh_tbls.test @@ -1,7 +1,7 @@ # depends on the binlog output --source include/have_binlog_format_mixed_or_statement.inc -let $rename_event_pos= 652; +let $rename_event_pos= 653; -- source extra/rpl_tests/rpl_flsh_tbls.test # End of 4.1 tests diff --git a/mysql-test/t/rpl_switch_stm_row_mixed.test b/mysql-test/t/rpl_switch_stm_row_mixed.test index bffa5905f1f..f8b51d6406a 100644 --- a/mysql-test/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/t/rpl_switch_stm_row_mixed.test @@ -517,9 +517,7 @@ LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +source include/show_binlog_events.inc; sync_slave_with_master; # as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID @@ -534,9 +532,7 @@ sync_slave_with_master; --exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; connection master; ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +source include/show_binlog_events.inc; # Now test that mysqlbinlog works fine on a binlog generated by the # mixed mode diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index ce1a476eb43..3ce01a0927b 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -13,9 +13,8 @@ INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; SET @var2=char(ascii('a')); insert into t1 values (@var1),(@var2); ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; +source include/show_binlog_events.inc; + # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). diff --git a/sql/Makefile.am b/sql/Makefile.am index 6cb9467c32c..9423f974f99 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -51,7 +51,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ sql_error.h field.h handler.h mysqld_suffix.h \ ha_partition.h \ ha_ndbcluster.h ha_ndbcluster_binlog.h \ - ha_ndbcluster_tables.h \ + ha_ndbcluster_tables.h rpl_constants.h \ opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \ log.h sql_show.h rpl_rli.h rpl_mi.h \ sql_select.h structs.h table.h sql_udf.h hash_filo.h \ diff --git a/sql/log_event.cc b/sql/log_event.cc index 767c69959ee..8b8244a326f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -321,7 +321,7 @@ static bool write_str(IO_CACHE *file, char *str, uint length) read_str() */ -static inline int read_str(char **buf, char *buf_end, char **str, +static inline int read_str(const char **buf, const char *buf_end, const char **str, uint8 *len) { if (*buf + ((uint) (uchar) **buf) >= buf_end) @@ -434,6 +434,7 @@ const char* Log_event::get_type_str() case DELETE_ROWS_EVENT: return "Delete_rows"; case BEGIN_LOAD_QUERY_EVENT: return "Begin_load_query"; case EXECUTE_LOAD_QUERY_EVENT: return "Execute_load_query"; + case INCIDENT_EVENT: return "Incident"; default: return "Unknown"; /* impossible */ } } @@ -1011,7 +1012,10 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Begin_load_query_log_event(buf, event_len, description_event); break; case EXECUTE_LOAD_QUERY_EVENT: - ev = new Execute_load_query_log_event(buf, event_len, description_event); + ev= new Execute_load_query_log_event(buf, event_len, description_event); + break; + case INCIDENT_EVENT: + ev = new Incident_log_event(buf, event_len, description_event); break; default: DBUG_PRINT("error",("Unknown evernt code: %d",(int) buf[EVENT_TYPE_OFFSET])); @@ -2420,6 +2424,7 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver) post_header_len[DELETE_ROWS_EVENT-1]= 6;); post_header_len[BEGIN_LOAD_QUERY_EVENT-1]= post_header_len[APPEND_BLOCK_EVENT-1]; post_header_len[EXECUTE_LOAD_QUERY_EVENT-1]= EXECUTE_LOAD_QUERY_HEADER_LEN; + post_header_len[INCIDENT_EVENT-1]= INCIDENT_HEADER_LEN; } break; @@ -5291,7 +5296,7 @@ bool sql_ex_info::write_data(IO_CACHE* file) sql_ex_info::init() */ -char* sql_ex_info::init(char* buf,char* buf_end,bool use_new_format) +char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format) { cached_new_format = use_new_format; if (use_new_format) @@ -5304,11 +5309,12 @@ char* sql_ex_info::init(char* buf,char* buf_end,bool use_new_format) the case when we have old format because we will be reusing net buffer to read the actual file before we write out the Create_file event. */ - if (read_str(&buf, buf_end, &field_term, &field_term_len) || - read_str(&buf, buf_end, &enclosed, &enclosed_len) || - read_str(&buf, buf_end, &line_term, &line_term_len) || - read_str(&buf, buf_end, &line_start, &line_start_len) || - read_str(&buf, buf_end, &escaped, &escaped_len)) + const char *ptr= buf; + if (read_str(&ptr, buf_end, (const char **) &field_term, &field_term_len) || + read_str(&ptr, buf_end, (const char **) &enclosed, &enclosed_len) || + read_str(&ptr, buf_end, (const char **) &line_term, &line_term_len) || + read_str(&ptr, buf_end, (const char **) &line_start, &line_start_len) || + read_str(&ptr, buf_end, (const char **) &escaped, &escaped_len)) return 0; opt_flags = *buf++; } @@ -7337,3 +7343,113 @@ void Update_rows_log_event::print(FILE *file, } #endif + +Incident_log_event::Incident_log_event(const char *buf, uint event_len, + const Format_description_log_event *descr_event) + : Log_event(buf, descr_event) +{ + DBUG_ENTER("Incident_log_event::Incident_log_event"); + uint8 const common_header_len= + descr_event->common_header_len; + uint8 const post_header_len= + descr_event->post_header_len[INCIDENT_EVENT-1]; + + DBUG_PRINT("info",("event_len: %u; common_header_len: %d; post_header_len: %d", + event_len, common_header_len, post_header_len)); + + m_incident= static_cast(uint2korr(buf + common_header_len)); + char const *ptr= buf + common_header_len + post_header_len; + char const *const str_end= buf + event_len; + uint8 len; + const char *str; + read_str(&ptr, str_end, &str, &len); + m_message.str= const_cast(str); + m_message.length= len; + DBUG_PRINT("info", ("m_incident: %d", m_incident)); + DBUG_VOID_RETURN; +} + + +Incident_log_event::~Incident_log_event() +{ +} + + +const char * +Incident_log_event::description() const +{ + static const char *const description[]= { + "NOTHING", // Not used + "LOST_EVENTS" + }; + + DBUG_PRINT("info", ("m_incident: %d", m_incident)); + + DBUG_ASSERT(0 <= m_incident); + DBUG_ASSERT((my_size_t) m_incident <= sizeof(description)/sizeof(*description)); + + return description[m_incident]; +} + + +#ifndef MYSQL_CLIENT +void Incident_log_event::pack_info(Protocol *protocol) +{ + char buf[256]; + my_size_t bytes; + if (m_message.length > 0) + bytes= my_snprintf(buf, sizeof(buf), "#%d (%s)", + m_incident, description()); + else + bytes= my_snprintf(buf, sizeof(buf), "#%d (%s): %s", + m_incident, description(), m_message.str); + protocol->store(buf, bytes, &my_charset_bin); +} +#endif + + +#ifdef MYSQL_CLIENT +void +Incident_log_event::print(FILE *file, + PRINT_EVENT_INFO *print_event_info) +{ + if (print_event_info->short_form) + return; + + Write_on_release_cache cache(&print_event_info->head_cache, file); + print_header(&cache, print_event_info, FALSE); + my_b_printf(&cache, "\n# Incident: %s", description()); +} +#endif + +#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) +int +Incident_log_event::exec_event(st_relay_log_info *rli) +{ + DBUG_ENTER("Incident_log_event::exec_event"); + slave_print_msg(ERROR_LEVEL, rli, ER_SLAVE_INCIDENT, + ER(ER_SLAVE_INCIDENT), + description(), + m_message.length > 0 ? m_message.str : ""); + DBUG_RETURN(1); +} +#endif + +bool +Incident_log_event::write_data_header(IO_CACHE *file) +{ + DBUG_ENTER("Incident_log_event::write_data_header"); + DBUG_PRINT("enter", ("m_incident: %d", m_incident)); + byte buf[sizeof(int16)]; + int2store(buf, (int16) m_incident); + DBUG_RETURN(my_b_safe_write(file, buf, sizeof(buf))); +} + +bool +Incident_log_event::write_data_body(IO_CACHE *file) +{ + DBUG_ENTER("Incident_log_event::write_data_body"); + DBUG_RETURN(write_str(file, m_message.str, m_message.length)); +} + + diff --git a/sql/log_event.h b/sql/log_event.h index 5994beb0df3..9a38bfb51fd 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -22,6 +22,7 @@ #endif #include +#include "rpl_constants.h" #define LOG_READ_EOF -1 #define LOG_READ_BOGUS -2 @@ -198,7 +199,7 @@ struct sql_ex_info #define TABLE_MAP_HEADER_LEN 8 #define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1) #define EXECUTE_LOAD_QUERY_HEADER_LEN (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN) - +#define INCIDENT_HEADER_LEN 2 /* Max number of possible extra bytes in a replication event compared to a packet (i.e. a query) sent from client to master; @@ -472,6 +473,11 @@ enum Log_event_type UPDATE_ROWS_EVENT = 21, DELETE_ROWS_EVENT = 22, + /* + Something out of the ordinary happened on the master + */ + INCIDENT_EVENT= 23, + /* Add new events here - right above this comment! Existing events (except ENUM_END_EVENT) should never change their numbers @@ -2207,4 +2213,94 @@ private: #endif }; + +/** + Class representing an incident, an occurance out of the ordinary, + that happened on the master. + + The event is used to inform the slave that something out of the + ordinary happened on the master that might cause the database to be + in an inconsistent state. + +
+ + + + + + + + + + + + + + + + + + + + + +
Incident event format
SymbolSize
(bytes)
Description
INCIDENT2Incident number as an unsigned integer
MSGLEN1Message length as an unsigned integer
MESSAGEMSGLENThe message, if present. Not null terminated.
+ */ +class Incident_log_event : public Log_event { +public: +#ifndef MYSQL_CLIENT + Incident_log_event(THD *thd_arg, Incident incident) + : Log_event(thd_arg, 0, FALSE), m_incident(incident) + { + DBUG_ENTER("Incident_log_event::Incident_log_event"); + DBUG_PRINT("enter", ("m_incident: %d", m_incident)); + m_message.str= NULL; /* Just as a precaution */ + m_message.length= 0; + DBUG_VOID_RETURN; + } + + Incident_log_event(THD *thd_arg, Incident incident, LEX_STRING const msg) + : Log_event(thd_arg, 0, FALSE), m_incident(incident) + { + DBUG_ENTER("Incident_log_event::Incident_log_event"); + DBUG_PRINT("enter", ("m_incident: %d", m_incident)); + m_message= msg; + DBUG_VOID_RETURN; + } +#endif + +#ifndef MYSQL_CLIENT + void pack_info(Protocol*); +#endif + + Incident_log_event(const char *buf, uint event_len, + const Format_description_log_event *descr_event); + + virtual ~Incident_log_event(); + +#ifdef MYSQL_CLIENT + virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info); +#endif + +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual int exec_event(struct st_relay_log_info *rli); +#endif + + virtual bool write_data_header(IO_CACHE *file); + virtual bool write_data_body(IO_CACHE *file); + + virtual Log_event_type get_type_code() { return INCIDENT_EVENT; } + + virtual bool is_valid() const { return 1; } + virtual int get_data_size() { + return INCIDENT_HEADER_LEN + 1 + m_message.length; + } + +private: + const char *description() const; + + Incident m_incident; + LEX_STRING m_message; +}; + #endif /* _log_event_h */ diff --git a/sql/rpl_constants.h b/sql/rpl_constants.h new file mode 100644 index 00000000000..426e80a328d --- /dev/null +++ b/sql/rpl_constants.h @@ -0,0 +1,18 @@ +#ifndef RPL_CONSTANTS_H +#define RPL_CONSTANTS_H + +/** + Enumeration of the incidents that can occur for the server. + */ +enum Incident { + /** No incident */ + INCIDENT_NONE, + + /** There are possibly lost events in the replication stream */ + INCIDENT_LOST_EVENTS, + + /** Shall be last event of the enumeration */ + INCIDENT_COUNT +}; + +#endif /* RPL_CONSTANTS_H */ diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index 95b5ecba895..b22b052a105 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -188,3 +188,21 @@ void injector::new_trans(THD *thd, injector::transaction *ptr) DBUG_VOID_RETURN; } + +int injector::record_incident(THD *thd, Incident incident) +{ + Incident_log_event ev(thd, incident); + if (int error= mysql_bin_log.write(&ev)) + return error; + mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE); + return 0; +} + +int injector::record_incident(THD *thd, Incident incident, LEX_STRING message) +{ + Incident_log_event ev(thd, incident, message); + if (int error= mysql_bin_log.write(&ev)) + return error; + mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE); + return 0; +} diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h index 8b08c0672c9..a596538d3b9 100644 --- a/sql/rpl_injector.h +++ b/sql/rpl_injector.h @@ -18,9 +18,10 @@ /* Pull in 'byte', 'my_off_t', and 'uint32' */ #include - #include +#include "rpl_constants.h" + /* Forward declarations */ class handler; class MYSQL_BIN_LOG; @@ -320,6 +321,9 @@ public: transaction new_trans(THD *); void new_trans(THD *, transaction *); + int record_incident(THD*, Incident incident); + int record_incident(THD*, Incident incident, LEX_STRING message); + private: explicit injector(); ~injector() { } /* Nothing needs to be done */ diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 671dbbd9c03..289d6f06bef 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6021,3 +6021,5 @@ ER_NATIVE_FCT_NAME_COLLISION eng "This function '%-.64s' has the same name as a native function." ER_BINLOG_PURGE_EMFILE eng "Too many files opened, please execute the command again" +ER_SLAVE_INCIDENT + eng "The incident %s occured on the master. Message: %-.64s" diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e314177e845..41cbcfd4276 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3439,6 +3439,36 @@ end_with_restore_list: break; } case SQLCOM_REPLACE: +#ifndef DBUG_OFF + if (mysql_bin_log.is_open()) + { + /* + Generate an incident log event before writing the real event + to the binary log. We put this event is before the statement + since that makes it simpler to check that the statement was + not executed on the slave (since incidents usually stop the + slave). + + Observe that any row events that are generated will be + generated before. + + This is only for testing purposes and will not be present in a + release build. + */ + + Incident incident= INCIDENT_NONE; + DBUG_PRINT("debug", ("Just before generate_incident()")); + DBUG_EXECUTE_IF("incident_database_resync_on_replace", + incident= INCIDENT_LOST_EVENTS;); + if (incident) + { + Incident_log_event ev(thd, incident); + mysql_bin_log.write(&ev); + mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE); + } + DBUG_PRINT("debug", ("Just after generate_incident()")); + } +#endif case SQLCOM_INSERT: { DBUG_ASSERT(first_table == all_tables && first_table != 0); @@ -6102,6 +6132,7 @@ void mysql_init_multi_delete(LEX *lex) lex->query_tables_last= &lex->query_tables; } + /* When you modify mysql_parse(), you may need to mofify mysql_test_parse_for_slave() in this same file. @@ -6114,6 +6145,7 @@ void mysql_parse(THD *thd, char *inBuf, uint length) DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on();); mysql_init_query(thd, (uchar*) inBuf, length); + if (query_cache_send_result_to_client(thd, inBuf, length) <= 0) { LEX *lex= thd->lex; From b07be12e517af5adcbd5aebbec4cf707d11fcd10 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 21:59:06 +0200 Subject: [PATCH 479/789] Update result for bug#19991 --- mysql-test/r/rpl_deadlock_innodb.result | 3 +++ mysql-test/r/rpl_extraCol_innodb.result | 8 ++++++++ mysql-test/r/rpl_extraCol_myisam.result | 8 ++++++++ mysql-test/r/rpl_ndb_basic.result | 1 + mysql-test/r/rpl_ndb_extraCol.result | 8 ++++++++ mysql-test/r/rpl_ndb_idempotent.result | 12 ++++++------ mysql-test/r/rpl_ndb_log.result | 4 ++-- mysql-test/r/rpl_ndb_sync.result | 4 ++-- mysql-test/r/rpl_row_inexist_tbl.result | 1 + mysql-test/r/rpl_row_log.result | 4 ++-- mysql-test/r/rpl_row_log_innodb.result | 4 ++-- mysql-test/r/rpl_row_reset_slave.result | 16 ++++++++-------- mysql-test/r/rpl_row_tabledefs_2myisam.result | 6 ++++++ mysql-test/r/rpl_row_tabledefs_3innodb.result | 6 ++++++ mysql-test/r/rpl_row_until.result | 16 ++++++++-------- 15 files changed, 71 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/r/rpl_deadlock_innodb.result index caf040c0997..61a70112b2f 100644 --- a/mysql-test/r/rpl_deadlock_innodb.result +++ b/mysql-test/r/rpl_deadlock_innodb.result @@ -78,6 +78,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No stop slave; delete from t3; change master to master_log_pos=544; @@ -132,6 +133,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No set @my_max_relay_log_size= @@global.max_relay_log_size; set global max_relay_log_size=0; stop slave; @@ -191,6 +193,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No drop table t1,t2,t3,t4; set global max_relay_log_size= @my_max_relay_log_size; End of 5.1 tests diff --git a/mysql-test/r/rpl_extraCol_innodb.result b/mysql-test/r/rpl_extraCol_innodb.result index ff505364124..a237edc8063 100644 --- a/mysql-test/r/rpl_extraCol_innodb.result +++ b/mysql-test/r/rpl_extraCol_innodb.result @@ -87,6 +87,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -144,6 +145,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -201,6 +203,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -257,6 +260,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -364,6 +368,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -420,6 +425,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -605,6 +611,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Try to insert in master **** @@ -735,6 +742,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/r/rpl_extraCol_myisam.result b/mysql-test/r/rpl_extraCol_myisam.result index b5ccab8ff4c..95f99ba1014 100644 --- a/mysql-test/r/rpl_extraCol_myisam.result +++ b/mysql-test/r/rpl_extraCol_myisam.result @@ -87,6 +87,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -144,6 +145,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -201,6 +203,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -257,6 +260,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -364,6 +368,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -420,6 +425,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -605,6 +611,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Try to insert in master **** @@ -735,6 +742,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/r/rpl_ndb_basic.result b/mysql-test/r/rpl_ndb_basic.result index 32a1c790c99..7aa50bbbac4 100644 --- a/mysql-test/r/rpl_ndb_basic.result +++ b/mysql-test/r/rpl_ndb_basic.result @@ -112,6 +112,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +Master_SSL_Verify_Server_Cert No set GLOBAL slave_transaction_retries=10; START SLAVE; select * from t1 order by nid; diff --git a/mysql-test/r/rpl_ndb_extraCol.result b/mysql-test/r/rpl_ndb_extraCol.result index bc40e24ecac..305cbabb6e6 100644 --- a/mysql-test/r/rpl_ndb_extraCol.result +++ b/mysql-test/r/rpl_ndb_extraCol.result @@ -87,6 +87,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -144,6 +145,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -201,6 +203,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -257,6 +260,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -364,6 +368,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -420,6 +425,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -605,6 +611,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Try to insert in master **** @@ -736,6 +743,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/r/rpl_ndb_idempotent.result b/mysql-test/r/rpl_ndb_idempotent.result index 982cab33482..2f2273c145e 100644 --- a/mysql-test/r/rpl_ndb_idempotent.result +++ b/mysql-test/r/rpl_ndb_idempotent.result @@ -33,15 +33,15 @@ c1 c2 c3 row3 C 3 row4 D 4 SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert + 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No No STOP SLAVE; CHANGE MASTER TO master_log_file = 'master-bin.000001', master_log_pos = ; SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 No No 0 0 None 0 No +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert + 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 No No 0 0 None 0 No No START SLAVE; SELECT * FROM t1 ORDER BY c3; c1 c2 c3 @@ -68,6 +68,6 @@ SELECT * FROM t1; c1 c2 c3 row2 new on slave 2 SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert + 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No No DROP TABLE IF EXISTS t1; diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result index 543af3b9abe..2bcf226577c 100644 --- a/mysql-test/r/rpl_ndb_log.result +++ b/mysql-test/r/rpl_ndb_log.result @@ -125,8 +125,8 @@ slave-bin.000002 # Write_rows 2 # table_id: # slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Query 2 # COMMIT show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 593 # # master-bin.000002 Yes Yes # 0 0 593 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 593 # # master-bin.000002 Yes Yes # 0 0 593 # None 0 No # No show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_ndb_sync.result b/mysql-test/r/rpl_ndb_sync.result index a2c3b46db5a..f584a909455 100644 --- a/mysql-test/r/rpl_ndb_sync.result +++ b/mysql-test/r/rpl_ndb_sync.result @@ -72,8 +72,8 @@ master_log_file = 'master-bin.000001', master_log_pos = ; START SLAVE; SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert + 127.0.0.1 root MASTER_PORT 1 master-bin.000001 master-bin.000001 Yes Yes 0 0 None 0 No No SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; hex(c1) hex(c2) c3 1 1 row1 diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/r/rpl_row_inexist_tbl.result index 5f5a4556d76..f1f1aaf0eb9 100644 --- a/mysql-test/r/rpl_row_inexist_tbl.result +++ b/mysql-test/r/rpl_row_inexist_tbl.result @@ -51,4 +51,5 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No drop table t1, t2; diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result index c6b85e7b329..4a80f84d065 100644 --- a/mysql-test/r/rpl_row_log.result +++ b/mysql-test/r/rpl_row_log.result @@ -93,8 +93,8 @@ slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Table_map 1 # table_id: # (test.t2) slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 373 # # master-bin.000002 Yes Yes # 0 0 373 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 373 # # master-bin.000002 Yes Yes # 0 0 373 # None 0 No # No show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/r/rpl_row_log_innodb.result index bc13047f973..18be0d3c20f 100644 --- a/mysql-test/r/rpl_row_log_innodb.result +++ b/mysql-test/r/rpl_row_log_innodb.result @@ -101,8 +101,8 @@ slave-bin.000002 # Table_map 1 # table_id: # (test.t2) slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Xid 1 # COMMIT /* XID */ show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 400 # # master-bin.000002 Yes Yes # 0 0 400 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 400 # # master-bin.000002 Yes Yes # 0 0 400 # None 0 No # No show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/r/rpl_row_reset_slave.result index 57fc95708e5..20bd7acf098 100644 --- a/mysql-test/r/rpl_row_reset_slave.result +++ b/mysql-test/r/rpl_row_reset_slave.result @@ -5,21 +5,21 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # No stop slave; change master to master_user='test'; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No # No reset slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No # No stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/r/rpl_row_tabledefs_2myisam.result index d62650fa142..4bde4b21b69 100644 --- a/mysql-test/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/r/rpl_row_tabledefs_2myisam.result @@ -137,6 +137,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (2); @@ -175,6 +176,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (4); @@ -213,6 +215,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (5); @@ -251,6 +254,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -289,6 +293,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -326,6 +331,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); SELECT * FROM t7 ORDER BY a; diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/r/rpl_row_tabledefs_3innodb.result index 0c3bb734e95..9b2426652a8 100644 --- a/mysql-test/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/r/rpl_row_tabledefs_3innodb.result @@ -137,6 +137,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (2); @@ -175,6 +176,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (4); @@ -213,6 +215,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (5); @@ -251,6 +254,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -289,6 +293,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (6); @@ -326,6 +331,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3); SELECT * FROM t7 ORDER BY a; diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/r/rpl_row_until.result index 8d4b0d6b591..cc699e2c960 100644 --- a/mysql-test/r/rpl_row_until.result +++ b/mysql-test/r/rpl_row_until.result @@ -20,8 +20,8 @@ n 3 4 show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-bin.000001 311 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-bin.000001 311 No # No start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; select * from t1; n @@ -30,22 +30,22 @@ n 3 4 show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-no-such-bin.000001 291 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-no-such-bin.000001 291 No # No start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; select * from t2; n 1 2 show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 586 # Relay slave-relay-bin.000004 728 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 586 # Relay slave-relay-bin.000004 728 No # No start slave; stop slave; start slave until master_log_file='master-bin.000001', master_log_pos=740; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 740 # Master master-bin.000001 740 No # +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 740 # Master master-bin.000001 740 No # No start slave until master_log_file='master-bin', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; From 85f7c6776b0f2da322bacf07b878db3fdd453d83 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 22:32:28 +0200 Subject: [PATCH 480/789] Post-merge patch. mysql-test/t/binlog_stm_mix_innodb_myisam.test: Position change sql/log_event.h: Event number change --- mysql-test/t/binlog_stm_mix_innodb_myisam.test | 2 +- sql/log_event.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test index 72651c13be7..4069cda0406 100644 --- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test @@ -12,7 +12,7 @@ # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) flush logs; ---exec $MYSQL_BINLOG --start-position=555 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output +--exec $MYSQL_BINLOG --start-position=556 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) diff --git a/sql/log_event.h b/sql/log_event.h index 4fe315343f9..500f3533c92 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -490,7 +490,7 @@ enum Log_event_type /* Something out of the ordinary happened on the master */ - INCIDENT_EVENT= 23, + INCIDENT_EVENT= 26, /* Add new events here - right above this comment! From d3ef3c9f2fd4eb0dd907755174dba1bb5b4fac95 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 16:43:00 -0400 Subject: [PATCH 481/789] WL#3629 - Replication of Invocation and Invoked Features This patch changes test to remove Windows-specific limitations and potential rounding errors in the calculation of a UDF. Also corrects a minor merge conflict. mysql-test/include/rpl_udf.inc: WL#3629 - Replication of Invocation and Invoked Features This patch changes test to remove Windows-specific results by replacing the library name in the SELECT from mysql.func to "UDF_LIB" to allow for the differences in platform (.so vs .dll). The patch also changes the function body of myfuncsql_double to a calculation that does not result in potential rounding errors from the test data. mysql-test/r/rpl_udf.result: WL#3629 - Replication of Invocation and Invoked Features This patch changes the result file for the test to match the new expected values for the SELECT from mysql.func and the return of myfuncsql_double. scripts/mysql_system_tables_fix.sql: WL#3629 - Replication of Invocation and Invoked Features This patch corrects a merge error encountered in a previous merge. The column originator should be listed before time_zone in mysql.event. --- mysql-test/include/rpl_udf.inc | 3 +- mysql-test/r/rpl_udf.result | 64 ++++++++++++++--------------- scripts/mysql_system_tables_fix.sql | 2 +- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc index ef20327078e..424bacc4216 100644 --- a/mysql-test/include/rpl_udf.inc +++ b/mysql-test/include/rpl_udf.inc @@ -34,6 +34,7 @@ eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; --replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB --error ER_CANT_FIND_DL_ENTRY eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; +--replace_column 3 UDF_LIB SELECT * FROM mysql.func; --disable_info @@ -105,7 +106,7 @@ DROP TABLE t1; --echo "Running on the master" --enable_info CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i; -CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 0.95; +CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00; SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; --disable_info diff --git a/mysql-test/r/rpl_udf.result b/mysql-test/r/rpl_udf.result index 156876d07de..3a01de1c65c 100644 --- a/mysql-test/r/rpl_udf.result +++ b/mysql-test/r/rpl_udf.result @@ -16,8 +16,8 @@ CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; ERROR HY000: Can't find symbol 'myfunc_nonexist' in library SELECT * FROM mysql.func; name ret dl type -myfunc_double 1 udf_example.dll function -myfunc_int 2 udf_example.dll function +myfunc_double 1 UDF_LIB function +myfunc_int 2 UDF_LIB function affected rows: 2 "Running on the slave" SELECT * FROM mysql.func; @@ -78,17 +78,17 @@ affected rows: 0 "Running on the master" CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i; affected rows: 0 -CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 0.95; +CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00; affected rows: 0 SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 test myfuncsql_int FUNCTION i INT RETURN i affected rows: 2 "Running on the slave" SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 test myfuncsql_int FUNCTION i INT RETURN i affected rows: 2 "Running on the master" @@ -104,18 +104,18 @@ INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00)); affected rows: 1 SELECT * FROM t1 ORDER BY sum; sum price -1 475 -10 5 -100 47 -200 24 +1 1000 +10 10 +100 100 +200 50 affected rows: 4 "Running on the slave" SELECT * FROM t1 ORDER BY sum; sum price -1 475 -10 5 -100 47 -200 24 +1 1000 +10 10 +100 100 +200 50 affected rows: 4 "Running on the master" ALTER FUNCTION myfuncsql_int COMMENT "This was altered."; @@ -124,13 +124,13 @@ ALTER FUNCTION myfuncsql_double COMMENT "This was altered."; affected rows: 0 SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered. test myfuncsql_int FUNCTION i INT RETURN i This was altered. affected rows: 2 "Running on the slave" SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered. test myfuncsql_int FUNCTION i INT RETURN i This was altered. affected rows: 2 SELECT myfuncsql_int(25); @@ -139,7 +139,7 @@ myfuncsql_int(25) affected rows: 1 SELECT myfuncsql_double(75.00); myfuncsql_double(75.00) -71 +150 affected rows: 1 "Running on the master" DROP FUNCTION myfuncsql_double; @@ -168,8 +168,8 @@ CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; ERROR HY000: Can't find symbol 'myfunc_nonexist' in library SELECT * FROM mysql.func; name ret dl type -myfunc_int 2 udf_example.dll function -myfunc_double 1 udf_example.dll function +myfunc_int 2 UDF_LIB function +myfunc_double 1 UDF_LIB function affected rows: 2 "Running on the slave" SELECT * FROM mysql.func; @@ -230,17 +230,17 @@ affected rows: 0 "Running on the master" CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i; affected rows: 0 -CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 0.95; +CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00; affected rows: 0 SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 test myfuncsql_int FUNCTION i INT RETURN i affected rows: 2 "Running on the slave" SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 test myfuncsql_int FUNCTION i INT RETURN i affected rows: 2 "Running on the master" @@ -256,18 +256,18 @@ INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00)); affected rows: 1 SELECT * FROM t1 ORDER BY sum; sum price -1 475 -10 5 -100 47 -200 24 +1 1000 +10 10 +100 100 +200 50 affected rows: 4 "Running on the slave" SELECT * FROM t1 ORDER BY sum; sum price -1 475 -10 5 -100 47 -200 24 +1 1000 +10 10 +100 100 +200 50 affected rows: 4 "Running on the master" ALTER FUNCTION myfuncsql_int COMMENT "This was altered."; @@ -276,13 +276,13 @@ ALTER FUNCTION myfuncsql_double COMMENT "This was altered."; affected rows: 0 SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered. test myfuncsql_int FUNCTION i INT RETURN i This was altered. affected rows: 2 "Running on the slave" SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%'; db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 0.95 This was altered. +test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered. test myfuncsql_int FUNCTION i INT RETURN i This was altered. affected rows: 2 SELECT myfuncsql_int(25); @@ -291,7 +291,7 @@ myfuncsql_int(25) affected rows: 1 SELECT myfuncsql_double(75.00); myfuncsql_double(75.00) -71 +150 affected rows: 1 "Running on the master" DROP FUNCTION myfuncsql_double; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 38c22d8f854..e9816bd21e9 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -481,7 +481,7 @@ ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL; ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 - NOT NULL DEFAULT 'SYSTEM' AFTER comment; + NOT NULL DEFAULT 'SYSTEM' AFTER originator; # # TRIGGER privilege From b5932225d2397a91112ee8855faaff1d8a54413c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Mar 2007 19:55:47 -0400 Subject: [PATCH 482/789] WL#3629 - Replication of Invocation and Invoked Features This patch adds code to the binlog calls for replication of the CREATE, DROP, and UPDATE event commands. An extra gate was added to ensure a query with length 0 is not binlogged. This corrects the problem of events_scheduling and rpl_events failing on some build machines. sql/events.cc: WL#3629 - Replication of Invocation and Invoked Features This patch adds code to the binlog calls for replication of the CREATE, DROP, and UPDATE event commands. An extra gate was added to ensure a query with length 0 is not binlogged. This corrects problems found when the patch for this worklog was pushed. --- sql/events.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/events.cc b/sql/events.cc index 5931c0a95d4..df2f1124f38 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -351,7 +351,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) else /* Binlog the create event. */ { event_queue->create_event(thd, new_element); - if (mysql_bin_log.is_open()) + if (mysql_bin_log.is_open() && (thd->query_length > 0)) { thd->clear_error(); thd->binlog_query(THD::MYSQL_QUERY_TYPE, @@ -426,7 +426,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) { event_queue->update_event(thd, parse_data->dbname, parse_data->name, new_element); - if (mysql_bin_log.is_open()) + if (mysql_bin_log.is_open() && (thd->query_length > 0)) { thd->clear_error(); thd->binlog_query(THD::MYSQL_QUERY_TYPE, @@ -480,7 +480,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) { event_queue->drop_event(thd, dbname, name); /* Binlog the drop event. */ - if (mysql_bin_log.is_open()) + if (mysql_bin_log.is_open() && (thd->query_length > 0)) { thd->clear_error(); thd->binlog_query(THD::MYSQL_QUERY_TYPE, From c4bab45b961de59c367784393313b03169f66e81 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 04:44:49 +0200 Subject: [PATCH 483/789] Post merge fixes of result files. mysql-test/r/binlog_stm_binlog.result: Result change. mysql-test/r/binlog_stm_ctype_ucs.result: Result change. mysql-test/r/binlog_stm_insert_select.result: Result change. mysql-test/r/ctype_cp932_binlog_stm.result: Result change. mysql-test/r/flush_block_commit_notembedded.result: Result change. mysql-test/r/rpl_000015.result: Result change. mysql-test/r/rpl_change_master.result: Result change. mysql-test/r/rpl_deadlock_innodb.result: Result change. mysql-test/r/rpl_flushlog_loop.result: Result change. mysql-test/r/rpl_known_bugs_detection.result: Result change. mysql-test/r/rpl_loaddata.result: Result change. mysql-test/r/rpl_loaddata_s.result: Result change. mysql-test/r/rpl_log_pos.result: Result change. mysql-test/r/rpl_rbr_to_sbr.result: Result change. mysql-test/r/rpl_rotate_logs.result: Result change. mysql-test/r/rpl_row_max_relay_size.result: Result change. mysql-test/r/rpl_server_id1.result: Result change. mysql-test/r/rpl_server_id2.result: Result change. mysql-test/r/rpl_sp.result: Result change. mysql-test/r/rpl_stm_charset.result: Result change. mysql-test/r/rpl_stm_flsh_tbls.result: Result change. mysql-test/r/rpl_stm_log.result: Result change. mysql-test/r/rpl_stm_max_relay_size.result: Result change. mysql-test/r/rpl_stm_multi_query.result: Result change. mysql-test/r/rpl_stm_reset_slave.result: Result change. mysql-test/r/rpl_stm_until.result: Result change. mysql-test/r/rpl_switch_stm_row_mixed.result: Result change. mysql-test/r/rpl_truncate_2myisam.result: Result change. mysql-test/r/rpl_truncate_3innodb.result: Result change. mysql-test/r/rpl_truncate_7ndb.result: Result change. mysql-test/r/user_var-binlog.result: Result change. --- mysql-test/r/binlog_stm_binlog.result | 91 +- mysql-test/r/binlog_stm_ctype_ucs.result | 6 +- mysql-test/r/binlog_stm_insert_select.result | 8 +- mysql-test/r/ctype_cp932_binlog_stm.result | 20 +- .../r/flush_block_commit_notembedded.result | 4 +- mysql-test/r/rpl_000015.result | 4 +- mysql-test/r/rpl_change_master.result | 4 +- mysql-test/r/rpl_deadlock_innodb.result | 4 +- mysql-test/r/rpl_flushlog_loop.result | 4 +- mysql-test/r/rpl_known_bugs_detection.result | 4 +- mysql-test/r/rpl_loaddata.result | 6 +- mysql-test/r/rpl_loaddata_s.result | 2 +- mysql-test/r/rpl_log_pos.result | 20 +- mysql-test/r/rpl_rbr_to_sbr.result | 4 +- mysql-test/r/rpl_rotate_logs.result | 30 +- mysql-test/r/rpl_row_max_relay_size.result | 22 +- mysql-test/r/rpl_server_id1.result | 2 +- mysql-test/r/rpl_server_id2.result | 2 +- mysql-test/r/rpl_sp.result | 2 +- mysql-test/r/rpl_stm_charset.result | 66 +- mysql-test/r/rpl_stm_flsh_tbls.result | 4 +- mysql-test/r/rpl_stm_log.result | 16 +- mysql-test/r/rpl_stm_max_relay_size.result | 22 +- mysql-test/r/rpl_stm_multi_query.result | 18 +- mysql-test/r/rpl_stm_reset_slave.result | 6 +- mysql-test/r/rpl_stm_until.result | 16 +- mysql-test/r/rpl_switch_stm_row_mixed.result | 948 +++++++++--------- mysql-test/r/rpl_truncate_2myisam.result | 66 +- mysql-test/r/rpl_truncate_3innodb.result | 90 +- mysql-test/r/rpl_truncate_7ndb.result | 76 +- mysql-test/r/user_var-binlog.result | 12 +- 31 files changed, 791 insertions(+), 788 deletions(-) diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index 7ec5726b81a..b26cfeded6b 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -2,12 +2,13 @@ create table t1 (a int, b int) engine=innodb; begin; insert into t1 values (1,2); commit; -show binlog events from ; +show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; create table t1 (a int, b int) engine=innodb -master-bin.000001 # Query # # use `test`; BEGIN -master-bin.000001 # Query # # use `test`; insert into t1 values (1,2) -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 4 Format_desc 1 106 Server ver: #, Binlog ver: # +master-bin.000001 106 Query 1 213 use `test`; create table t1 (a int, b int) engine=innodb +master-bin.000001 213 Query 1 281 use `test`; BEGIN +master-bin.000001 281 Query 1 90 use `test`; insert into t1 values (1,2) +master-bin.000001 371 Xid 1 398 COMMIT /* XID */ drop table t1; drop table if exists t1, t2; reset master; @@ -21,14 +22,14 @@ insert t2 values (5); commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb -master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert t1 values (5) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert t2 values (5) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb +master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert t1 values (5) +master-bin.000001 # Xid # # COMMIT /* xid=17 */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert t2 values (5) +master-bin.000001 # Xid # # COMMIT /* xid=20 */ drop table t1,t2; reset master; create table t1 (n int) engine=innodb; @@ -165,17 +166,17 @@ DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) -master-bin.000001 # Intvar 1 # INSERT_ID=127 -master-bin.000001 # Query 1 # use `test`; insert into t1 values(null) -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) -master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1 -master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int) -master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1 -master-bin.000001 # Query 1 # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') -master-bin.000001 # Query 1 # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' -master-bin.000001 # Query 1 # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) +master-bin.000001 # Intvar # # INSERT_ID=127 +master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 +master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) +master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1 +master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') +master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; @@ -184,25 +185,25 @@ insert delayed into t1 values (null); insert delayed into t1 values (300); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) -master-bin.000001 # Intvar 1 # INSERT_ID=127 -master-bin.000001 # Query 1 # use `test`; insert into t1 values(null) -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) -master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1 -master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int) -master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1 -master-bin.000001 # Query 1 # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') -master-bin.000001 # Query 1 # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' -master-bin.000001 # Query 1 # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' -master-bin.000001 # Query 1 # use `test`; drop table t1,t2,t3,tt1 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) +master-bin.000001 # Intvar # # INSERT_ID=127 +master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 +master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) +master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1 +master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') +master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # use `test`; drop table t1,t2,t3,tt1 +master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); 11 == 11 @@ -225,12 +226,12 @@ drop table if exists t3; create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 342 +master-bin.000001 346 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); show master status /* must show new binlog index after rotating */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000002 102 +master-bin.000002 106 drop table t3; diff --git a/mysql-test/r/binlog_stm_ctype_ucs.result b/mysql-test/r/binlog_stm_ctype_ucs.result index 01e58a94fe9..c789c618876 100644 --- a/mysql-test/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/r/binlog_stm_ctype_ucs.result @@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); -show binlog events from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 106 User var 1 145 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci -master-bin.000001 145 Query 1 235 use `test`; insert into t2 values (@v) +master-bin.000001 # User var # # @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci +master-bin.000001 # Query # # use `test`; insert into t2 values (@v) flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/r/binlog_stm_insert_select.result b/mysql-test/r/binlog_stm_insert_select.result index a93a8edf4aa..41ff0c1c728 100644 --- a/mysql-test/r/binlog_stm_insert_select.result +++ b/mysql-test/r/binlog_stm_insert_select.result @@ -6,9 +6,10 @@ insert into t2 values(1),(2); reset master; insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' -show binlog events from ; +show binlog events; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; insert into t1 select * from t2 +master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 200 use `test`; insert into t1 select * from t2 select * from t1; a 1 @@ -19,6 +20,7 @@ insert into t1 values(1),(1); reset master; create table t2(unique(a)) select a from t1; ERROR 23000: Duplicate entry '1' for key 'a' -show binlog events from ; +show binlog events; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 drop table t1; diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index d9d982a77dc..b486d2faaa9 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -6,11 +6,11 @@ CREATE TABLE t1(f1 blob); PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; SET @var1= x'8300'; EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) -master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@'var1') +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob) +master-bin.000001 # User var # # @`var1`=_binary 0x8300 COLLATE binary +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@'var1') SELECT HEX(f1) FROM t1; HEX(f1) 8300 @@ -30,17 +30,17 @@ HEX(s1) HEX(s2) d 466F6F2773206120426172 ED40ED41ED42 47.93 DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 409| +SHOW BINLOG EVENTS FROM 410| Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 409 Query 1 575 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, +master-bin.000001 410 Query 1 576 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, s2 CHAR(50) CHARACTER SET cp932, d DECIMAL(10,2)) -master-bin.000001 575 Query 1 823 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50), +master-bin.000001 576 Query 1 824 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50), IN ins2 CHAR(50) CHARACTER SET cp932, IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 823 Query 1 1042 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) -master-bin.000001 1042 Query 1 1131 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1131 Query 1 1210 use `test`; DROP TABLE t4 +master-bin.000001 824 Query 1 1043 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) +master-bin.000001 1043 Query 1 1132 use `test`; DROP PROCEDURE bug18293 +master-bin.000001 1132 Query 1 1211 use `test`; DROP TABLE t4 diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result index e49e8817967..16fb143ee4c 100644 --- a/mysql-test/r/flush_block_commit_notembedded.result +++ b/mysql-test/r/flush_block_commit_notembedded.result @@ -5,11 +5,11 @@ insert t1 values (1); flush tables with read lock; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 105 +master-bin.000001 106 commit; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 105 +master-bin.000001 106 unlock tables; drop table t1; set autocommit=1; diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/r/rpl_000015.result index dc8f808ca51..13da328e522 100644 --- a/mysql-test/r/rpl_000015.result +++ b/mysql-test/r/rpl_000015.result @@ -1,7 +1,7 @@ reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 105 +master-bin.000001 106 reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -17,7 +17,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 105 # # master-bin.000001 Yes Yes 0 0 105 # None 0 No # +# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # drop table if exists t1; create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result index a9ea380df09..c3909de5ba5 100644 --- a/mysql-test/r/rpl_change_master.result +++ b/mysql-test/r/rpl_change_master.result @@ -13,11 +13,11 @@ insert into t1 values(2); stop slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 190 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # change master to master_user='root'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 190 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # start slave; select * from t1; n diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/r/rpl_deadlock_innodb.result index 73a9c5a67a4..48fdf051d50 100644 --- a/mysql-test/r/rpl_deadlock_innodb.result +++ b/mysql-test/r/rpl_deadlock_innodb.result @@ -80,7 +80,7 @@ Master_SSL_Key Seconds_Behind_Master # stop slave; delete from t3; -change master to master_log_pos=547; +change master to master_log_pos=548; begin; select * from t2 for update; a @@ -136,7 +136,7 @@ set @my_max_relay_log_size= @@global.max_relay_log_size; set global max_relay_log_size=0; stop slave; delete from t3; -change master to master_log_pos=547; +change master to master_log_pos=548; begin; select * from t2 for update; a diff --git a/mysql-test/r/rpl_flushlog_loop.result b/mysql-test/r/rpl_flushlog_loop.result index a600f103069..40eb403f6e7 100644 --- a/mysql-test/r/rpl_flushlog_loop.result +++ b/mysql-test/r/rpl_flushlog_loop.result @@ -24,7 +24,7 @@ Master_User root Master_Port SLAVE_PORT Connect_Retry 60 Master_Log_File slave-bin.000001 -Read_Master_Log_Pos 215 +Read_Master_Log_Pos 216 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File slave-bin.000001 @@ -39,7 +39,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 215 +Exec_Master_Log_Pos 216 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_known_bugs_detection.result b/mysql-test/r/rpl_known_bugs_detection.result index 2d6fffd89a0..9ce6ac25c88 100644 --- a/mysql-test/r/rpl_known_bugs_detection.result +++ b/mysql-test/r/rpl_known_bugs_detection.result @@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table Last_Errno 1105 Last_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10' Skip_Counter 0 -Exec_Master_Log_Pos 245 +Exec_Master_Log_Pos 246 Relay_Log_Space # Until_Condition None Until_Log_File @@ -115,7 +115,7 @@ FROM t2 ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c' Skip_Counter 0 -Exec_Master_Log_Pos 1277 +Exec_Master_Log_Pos 1278 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index 7a6e5740c14..c68d2d9677e 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -28,7 +28,7 @@ day id category name 2003-03-22 2416 a bbbbb show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -slave-bin.000001 1279 +slave-bin.000001 1280 drop table t1; drop table t2; drop table t3; @@ -39,7 +39,7 @@ set global sql_slave_skip_counter=1; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1796 # # master-bin.000001 Yes Yes # 0 0 1796 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1797 # # master-bin.000001 Yes Yes # 0 0 1797 # None 0 No # set sql_log_bin=0; delete from t1; set sql_log_bin=1; @@ -49,7 +49,7 @@ change master to master_user='test'; change master to master_user='root'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1831 # # master-bin.000001 No No # 0 0 1831 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1832 # # master-bin.000001 No No # 0 0 1832 # None 0 No # set global sql_slave_skip_counter=1; start slave; set sql_log_bin=0; diff --git a/mysql-test/r/rpl_loaddata_s.result b/mysql-test/r/rpl_loaddata_s.result index 3f092e3afff..4fc33eee20d 100644 --- a/mysql-test/r/rpl_loaddata_s.result +++ b/mysql-test/r/rpl_loaddata_s.result @@ -10,6 +10,6 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1; select count(*) from test.t1; count(*) 2 -show binlog events from 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info drop table test.t1; diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result index 8a80b5315d4..01ff89741c8 100644 --- a/mysql-test/r/rpl_log_pos.result +++ b/mysql-test/r/rpl_log_pos.result @@ -6,37 +6,37 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 105 +master-bin.000001 106 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes 0 0 105 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # stop slave; -change master to master_log_pos=74; +change master to master_log_pos=75; start slave; stop slave; -change master to master_log_pos=74; +change master to master_log_pos=75; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No No 0 0 74 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No No 0 0 75 # None 0 No # start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No Yes 0 0 74 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No Yes 0 0 75 # None 0 No # stop slave; -change master to master_log_pos=177; +change master to master_log_pos=178; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 105 +master-bin.000001 106 create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); stop slave; -change master to master_log_pos=105; +change master to master_log_pos=106; start slave; select * from t1 ORDER BY n; n diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/r/rpl_rbr_to_sbr.result index d36277bed36..2cb0eafa5b8 100644 --- a/mysql-test/r/rpl_rbr_to_sbr.result +++ b/mysql-test/r/rpl_rbr_to_sbr.result @@ -28,7 +28,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 453 +Read_Master_Log_Pos 454 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 453 +Exec_Master_Log_Pos 454 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 8f0cf29ab34..cea84dba1ef 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -16,7 +16,7 @@ create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 555 # # master-bin.000001 Yes Yes # 0 0 555 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 556 # # master-bin.000001 Yes Yes # 0 0 556 # None 0 No # select * from t1; s Could not break slave @@ -27,9 +27,9 @@ insert into t2 values (34),(67),(123); flush logs; show binary logs; Log_name File_size -master-bin.000001 599 -master-bin.000002 370 -master-bin.000003 105 +master-bin.000001 600 +master-bin.000002 371 +master-bin.000003 106 create table t3 select * from temp_table; select * from t3; a @@ -43,21 +43,21 @@ start slave; purge master logs to 'master-bin.000002'; show master logs; Log_name File_size -master-bin.000002 370 -master-bin.000003 414 +master-bin.000002 371 +master-bin.000003 415 purge binary logs to 'master-bin.000002'; show binary logs; Log_name File_size -master-bin.000002 370 -master-bin.000003 414 +master-bin.000002 371 +master-bin.000003 415 purge master logs before now(); show binary logs; Log_name File_size -master-bin.000003 414 +master-bin.000003 415 insert into t2 values (65); show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 503 # # master-bin.000003 Yes Yes # 0 0 503 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 504 # # master-bin.000003 Yes Yes # 0 0 504 # None 0 No # select * from t2; m 34 @@ -74,18 +74,18 @@ count(*) create table t4 select * from temp_table; show binary logs; Log_name File_size -master-bin.000003 4192 -master-bin.000004 4197 -master-bin.000005 2039 +master-bin.000003 4193 +master-bin.000004 4198 +master-bin.000005 2040 show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000005 2039 +master-bin.000005 2040 select * from t4; a testing temporary tables part 2 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2039 # # master-bin.000005 Yes Yes # 0 0 2039 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2040 # # master-bin.000005 Yes Yes # 0 0 2040 # None 0 No # lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/r/rpl_row_max_relay_size.result b/mysql-test/r/rpl_row_max_relay_size.result index d19ad430c6a..4c0f923c323 100644 --- a/mysql-test/r/rpl_row_max_relay_size.result +++ b/mysql-test/r/rpl_row_max_relay_size.result @@ -30,7 +30,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58667 +Read_Master_Log_Pos 58668 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -45,7 +45,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58667 +Exec_Master_Log_Pos 58668 Relay_Log_Space # Until_Condition None Until_Log_File @@ -73,7 +73,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58667 +Read_Master_Log_Pos 58668 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -88,7 +88,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58667 +Exec_Master_Log_Pos 58668 Relay_Log_Space # Until_Condition None Until_Log_File @@ -116,7 +116,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58667 +Read_Master_Log_Pos 58668 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -131,7 +131,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58667 +Exec_Master_Log_Pos 58668 Relay_Log_Space # Until_Condition None Until_Log_File @@ -197,7 +197,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58753 +Read_Master_Log_Pos 58754 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -212,7 +212,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58753 +Exec_Master_Log_Pos 58754 Relay_Log_Space # Until_Condition None Until_Log_File @@ -236,7 +236,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 58829 +Read_Master_Log_Pos 58830 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -251,7 +251,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 58829 +Exec_Master_Log_Pos 58830 Relay_Log_Space # Until_Condition None Until_Log_File @@ -266,7 +266,7 @@ Seconds_Behind_Master # flush logs; show master status; File master-bin.000002 -Position 105 +Position 106 Binlog_Do_DB Binlog_Ignore_DB set global max_binlog_size= @my_max_binlog_size; diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result index 7091a26f272..3f0c1a79de3 100644 --- a/mysql-test/r/rpl_server_id1.result +++ b/mysql-test/r/rpl_server_id1.result @@ -10,7 +10,7 @@ stop slave; change master to master_port=SLAVE_PORT; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 105 None 0 No NULL + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 106 None 0 No NULL start slave; insert into t1 values (1); show status like "slave_running"; diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result index 3ad15d7ce5b..60550aba98e 100644 --- a/mysql-test/r/rpl_server_id2.result +++ b/mysql-test/r/rpl_server_id2.result @@ -10,7 +10,7 @@ stop slave; change master to master_port=SLAVE_PORT; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 105 None 0 No NULL + 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 106 None 0 No NULL start slave; insert into t1 values (1); select * from t1; diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 9b316abd63c..6dc3be94e32 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -381,7 +381,7 @@ return 0; end| use mysqltest; set @a:= mysqltest2.f1(); -show binlog events in 'master-bin.000001' from 105; +show binlog events in 'master-bin.000001' from 106; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # drop database if exists mysqltest1 master-bin.000001 # Query 1 # create database mysqltest1 diff --git a/mysql-test/r/rpl_stm_charset.result b/mysql-test/r/rpl_stm_charset.result index a0e155b2787..fd9c40843d5 100644 --- a/mysql-test/r/rpl_stm_charset.result +++ b/mysql-test/r/rpl_stm_charset.result @@ -103,40 +103,40 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest2 -master-bin.000001 # Query 1 # drop database if exists mysqltest3 -master-bin.000001 # Query 1 # create database mysqltest2 character set latin2 -master-bin.000001 # Query 1 # create database mysqltest3 -master-bin.000001 # Query 1 # drop database mysqltest3 -master-bin.000001 # Query 1 # create database mysqltest3 -master-bin.000001 # Query 1 # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 # Intvar 1 # INSERT_ID=1 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@character_set_server) -master-bin.000001 # Intvar 1 # INSERT_ID=2 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_server) -master-bin.000001 # Intvar 1 # INSERT_ID=3 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@character_set_client) -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@character_set_connection) -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 -master-bin.000001 # Intvar 1 # INSERT_ID=1 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 # Intvar 1 # INSERT_ID=2 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 # Intvar 1 # INSERT_ID=3 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 -master-bin.000001 # Intvar 1 # INSERT_ID=1 -master-bin.000001 # User var 1 # @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci -master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(collation(@a)) -master-bin.000001 # Query 1 # drop database mysqltest2 -master-bin.000001 # Query 1 # drop database mysqltest3 +master-bin.000001 # Query # # drop database if exists mysqltest2 +master-bin.000001 # Query # # drop database if exists mysqltest3 +master-bin.000001 # Query # # create database mysqltest2 character set latin2 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # drop database mysqltest3 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@character_set_server) +master-bin.000001 # Intvar # # INSERT_ID=2 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_server) +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@character_set_client) +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@character_set_connection) +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 # Intvar # # INSERT_ID=2 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # User var # # @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci +master-bin.000001 # Query # # use `mysqltest2`; insert into t1 (b) values(collation(@a)) +master-bin.000001 # Query # # drop database mysqltest2 +master-bin.000001 # Query # # drop database mysqltest3 set global character_set_server=latin2; set global character_set_server=latin1; set global character_set_server=latin2; diff --git a/mysql-test/r/rpl_stm_flsh_tbls.result b/mysql-test/r/rpl_stm_flsh_tbls.result index fbdbe49f04d..1c6b5615b6e 100644 --- a/mysql-test/r/rpl_stm_flsh_tbls.result +++ b/mysql-test/r/rpl_stm_flsh_tbls.result @@ -12,13 +12,13 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 655 ; +SHOW BINLOG EVENTS FROM 656 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 655 ; +SHOW BINLOG EVENTS FROM 656 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 # Query 1 # use `test`; flush tables diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result index d0026d954f7..8d912dacff3 100644 --- a/mysql-test/r/rpl_stm_log.result +++ b/mysql-test/r/rpl_stm_log.result @@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 -show binlog events from 105 limit 1; +show binlog events from 106 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 105 limit 2; +show binlog events from 106 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Intvar 1 # INSERT_ID=1 -show binlog events from 105 limit 2,1; +show binlog events from 106 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) flush logs; @@ -66,13 +66,13 @@ master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM master-bin.000002 # Query 1 # use `test`; insert into t2 values (1) show binary logs; Log_name File_size -master-bin.000001 1346 -master-bin.000002 391 +master-bin.000001 1347 +master-bin.000002 392 start slave; show binary logs; Log_name File_size -slave-bin.000001 1446 -slave-bin.000002 292 +slave-bin.000001 1447 +slave-bin.000002 293 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -92,7 +92,7 @@ slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1) show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 391 # # master-bin.000002 Yes Yes # 0 0 391 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 392 # # master-bin.000002 Yes Yes # 0 0 392 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/r/rpl_stm_max_relay_size.result index ab0a4cd978d..2509cc08205 100644 --- a/mysql-test/r/rpl_stm_max_relay_size.result +++ b/mysql-test/r/rpl_stm_max_relay_size.result @@ -28,7 +28,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72959 +Read_Master_Log_Pos 72960 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72959 +Exec_Master_Log_Pos 72960 Relay_Log_Space # Until_Condition None Until_Log_File @@ -71,7 +71,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72959 +Read_Master_Log_Pos 72960 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -86,7 +86,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72959 +Exec_Master_Log_Pos 72960 Relay_Log_Space # Until_Condition None Until_Log_File @@ -114,7 +114,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 72959 +Read_Master_Log_Pos 72960 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -129,7 +129,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 72959 +Exec_Master_Log_Pos 72960 Relay_Log_Space # Until_Condition None Until_Log_File @@ -195,7 +195,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 73045 +Read_Master_Log_Pos 73046 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -210,7 +210,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 73045 +Exec_Master_Log_Pos 73046 Relay_Log_Space # Until_Condition None Until_Log_File @@ -234,7 +234,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 73121 +Read_Master_Log_Pos 73122 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -249,7 +249,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 73121 +Exec_Master_Log_Pos 73122 Relay_Log_Space # Until_Condition None Until_Log_File @@ -264,7 +264,7 @@ Seconds_Behind_Master # flush logs; show master status; File master-bin.000002 -Position 105 +Position 106 Binlog_Do_DB Binlog_Ignore_DB set global max_binlog_size= @my_max_binlog_size; diff --git a/mysql-test/r/rpl_stm_multi_query.result b/mysql-test/r/rpl_stm_multi_query.result index 726e2bad697..625c686f383 100644 --- a/mysql-test/r/rpl_stm_multi_query.result +++ b/mysql-test/r/rpl_stm_multi_query.result @@ -19,14 +19,14 @@ n 3 4 5 -show binlog events from 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest -master-bin.000001 # Query 1 # create database mysqltest -master-bin.000001 # Query 1 # use `test`; create table mysqltest.t1 ( n int) -master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(1) -master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(2) -master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(3) -master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(4) -master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(5) +master-bin.000001 # Query # # drop database if exists mysqltest +master-bin.000001 # Query # # create database mysqltest +master-bin.000001 # Query # # use `test`; create table mysqltest.t1 ( n int) +master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(1) +master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(2) +master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(3) +master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(4) +master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(5) drop database mysqltest; diff --git a/mysql-test/r/rpl_stm_reset_slave.result b/mysql-test/r/rpl_stm_reset_slave.result index 4ce942869a8..2b9fdca0911 100644 --- a/mysql-test/r/rpl_stm_reset_slave.result +++ b/mysql-test/r/rpl_stm_reset_slave.result @@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # stop slave; change master to master_user='test'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 No No # 0 0 105 # None 0 No # +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_stm_until.result b/mysql-test/r/rpl_stm_until.result index 81e23da2bd0..63544199f4c 100644 --- a/mysql-test/r/rpl_stm_until.result +++ b/mysql-test/r/rpl_stm_until.result @@ -26,7 +26,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 783 +Read_Master_Log_Pos 784 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 326 +Exec_Master_Log_Pos 327 Relay_Log_Space # Until_Condition Master Until_Log_File master-bin.000001 @@ -67,7 +67,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 783 +Read_Master_Log_Pos 784 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -82,7 +82,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 326 +Exec_Master_Log_Pos 327 Relay_Log_Space # Until_Condition Master Until_Log_File master-no-such-bin.000001 @@ -106,7 +106,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 783 +Read_Master_Log_Pos 784 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -121,7 +121,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 615 +Exec_Master_Log_Pos 616 Relay_Log_Space # Until_Condition Relay Until_Log_File slave-relay-bin.000004 @@ -143,7 +143,7 @@ Master_User root Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 783 +Read_Master_Log_Pos 784 Relay_Log_File slave-relay-bin.000004 Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -158,7 +158,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 783 +Exec_Master_Log_Pos 784 Relay_Log_Space # Until_Condition Master Until_Log_File master-bin.000001 diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/r/rpl_switch_stm_row_mixed.result index b863fbec8df..6d9f1a32980 100644 --- a/mysql-test/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/r/rpl_switch_stm_row_mixed.result @@ -405,84 +405,84 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; -show binlog events from 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest1 -master-bin.000001 # Query 1 # create database mysqltest1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_8_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_9_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_10_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_11_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_13_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_14_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_15_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_16_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_18_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_21_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_24_" -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t2` ( +master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Query # # create database mysqltest1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_" +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` ( `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t3` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` ( `1` varbinary(36) NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t4` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` ( `a` varchar(100) DEFAULT NULL ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t4) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t5) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() begin insert into t1 values("work_25_"); insert into t1 values(concat("for_26_",UUID())); insert into t1 select "yesterday_27_"; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() begin insert into t1 values(concat("emergency_28_",UUID())); insert into t1 values("work_29_"); @@ -491,308 +491,308 @@ set session binlog_format=row; # accepted for stored procs insert into t1 values("more work_31_"); set session binlog_format=mixed; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin set session binlog_format=row; # rejected for stored funcs insert into t1 values("alarm"); return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) begin insert into t1 values(concat("work_250_",x)); insert into t1 select "yesterday_270_"; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Query 1 # use `mysqltest1`; drop function foo3 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Query # # use `mysqltest1`; drop function foo3 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin insert into t1 values("foo3_32_"); call foo(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned begin insert into t2 select foo3(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned begin insert into t2 select UUID(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned begin insert into t2 select x; return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() -master-bin.000001 # Query 1 # use `mysqltest1`; create table t11 (data varchar(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() +master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row begin set NEW.data = concat(NEW.data,UUID()); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t20 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t21 select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t22 select * from t3 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1,t2,t3 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t3 (b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Intvar 1 # INSERT_ID=3 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_44_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') -master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f -master-bin.000001 # Query 1 # use `mysqltest1`; create table t14 (unique (a)) select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; truncate table t2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') +master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; drop function f +master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; truncate table t2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); return 1; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin declare y int; insert into t1 values(null,x); set y = (select count(*) from t2); return y; end -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row begin insert into t2 values(null,"try_55_"); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; alter table t1 modify a int, drop primary key -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_57_") -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t16` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_") +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` ( `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t16 values("try_66_") -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t11 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t12 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t12 (data LONG) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -show binlog events from 105; +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_") +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest1 -master-bin.000001 # Query 1 # create database mysqltest1 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_8_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_9_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_10_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_11_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_13_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_14_") -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("for_15_") -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_16_" -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values("work_18_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_21_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # User var 1 # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select @'string' -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_24_" -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t2` ( +master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Query # # create database mysqltest1 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_8_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_9_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_10_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_11_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_13_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_14_") +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("for_15_") +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_16_" +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values("work_18_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_21_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # User var # # @`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select @'string' +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_" +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` ( `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t3` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` ( `1` varbinary(36) NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t4` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` ( `a` varchar(100) DEFAULT NULL ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t4) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t5) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo() begin insert into t1 values("work_25_"); insert into t1 values(concat("for_26_",UUID())); insert into t1 select "yesterday_27_"; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2() begin insert into t1 values(concat("emergency_28_",UUID())); insert into t1 values("work_29_"); @@ -801,229 +801,229 @@ set session binlog_format=row; # accepted for stored procs insert into t1 values("more work_31_"); set session binlog_format=mixed; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin set session binlog_format=row; # rejected for stored funcs insert into t1 values("alarm"); return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100)) begin insert into t1 values(concat("work_250_",x)); insert into t1 select "yesterday_270_"; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 select "yesterday_270_" -master-bin.000001 # Query 1 # use `mysqltest1`; drop function foo3 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world'))) +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_270_" +master-bin.000001 # Query # # use `mysqltest1`; drop function foo3 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned begin insert into t1 values("foo3_32_"); call foo(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned begin insert into t2 select foo3(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned begin insert into t2 select UUID(); return 100; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned begin insert into t2 select x; return 100; end -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() -master-bin.000001 # Query 1 # use `mysqltest1`; create table t11 (data varchar(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_') +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid() +master-bin.000001 # Query # # use `mysqltest1`; create table t11 (data varchar(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11') +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row begin set NEW.data = concat(NEW.data,UUID()); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t20 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t21 select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t22 select * from t3 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1,t2,t3 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; create table t3 (b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t20 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t21 select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; create table t22 select * from t3 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1,t2,t3 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; create table t3 (b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Intvar 1 # INSERT_ID=3 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_44_") -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') -master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1 -master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 -master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f -master-bin.000001 # Query 1 # use `mysqltest1`; create table t14 (unique (a)) select * from t2 -master-bin.000001 # Query 1 # use `mysqltest1`; truncate table t2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_44_") +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; create table t12 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a)) +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_') +master-bin.000001 # Query # # use `mysqltest1`; create table t13 select * from t1 +master-bin.000001 # Query # # use `mysqltest1`; drop table t1 +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest1`; drop function f +master-bin.000001 # Query # # use `mysqltest1`; create table t14 (unique (a)) select * from t2 +master-bin.000001 # Query # # use `mysqltest1`; truncate table t2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic begin insert into t1 values(null,x); return 1; end -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin insert into t2 values(null,x); return 1; end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t3) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic begin declare y int; insert into t1 values(null,x); set y = (select count(*) from t2); return y; end -master-bin.000001 # Intvar 1 # INSERT_ID=4 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') -master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_') +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_') +master-bin.000001 # Query # # use `mysqltest1`; drop function f2 +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row begin insert into t2 values(null,"try_55_"); end -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; alter table t1 modify a int, drop primary key -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t1 values(null,"try_57_") -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE `t16` ( +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; alter table t1 modify a int, drop primary key +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(null,"try_57_") +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t16` ( `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT '' ) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t16) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; insert into t16 values("try_66_") -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t11 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t11) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') -master-bin.000001 # Query 1 # use `mysqltest1`; DROP TABLE IF EXISTS t12 -master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t12 (data LONG) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t16) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; insert into t16 values("try_66_") +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t11 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t11) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene') +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F drop database mysqltest1; set global binlog_format =@my_binlog_format; diff --git a/mysql-test/r/rpl_truncate_2myisam.result b/mysql-test/r/rpl_truncate_2myisam.result index 23e4630c3c8..7e15ae0ba45 100644 --- a/mysql-test/r/rpl_truncate_2myisam.result +++ b/mysql-test/r/rpl_truncate_2myisam.result @@ -31,11 +31,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Query 1 390 use `test`; TRUNCATE TABLE t1 -master-bin.000001 390 Query 1 466 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Query 1 391 use `test`; TRUNCATE TABLE t1 +master-bin.000001 391 Query 1 467 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -63,11 +63,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Query 1 390 use `test`; TRUNCATE TABLE t1 -master-bin.000001 390 Query 1 466 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Query 1 391 use `test`; TRUNCATE TABLE t1 +master-bin.000001 391 Query 1 467 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -95,12 +95,12 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 213 Table_map 1 253 table_id: # (test.t1) -master-bin.000001 253 Write_rows 1 300 table_id: # flags: STMT_END_F -master-bin.000001 300 Query 1 380 use `test`; TRUNCATE TABLE t1 -master-bin.000001 380 Query 1 456 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 214 Table_map 1 254 table_id: # (test.t1) +master-bin.000001 254 Write_rows 1 301 table_id: # flags: STMT_END_F +master-bin.000001 301 Query 1 381 use `test`; TRUNCATE TABLE t1 +master-bin.000001 381 Query 1 457 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -128,11 +128,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Query 1 387 use `test`; DELETE FROM t1 -master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Query 1 388 use `test`; DELETE FROM t1 +master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -160,11 +160,11 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 213 Query 1 310 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Query 1 387 use `test`; DELETE FROM t1 -master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Query 1 388 use `test`; DELETE FROM t1 +master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -193,10 +193,10 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 213 Table_map 1 253 table_id: # (test.t1) -master-bin.000001 253 Write_rows 1 300 table_id: # flags: STMT_END_F -master-bin.000001 300 Table_map 1 340 table_id: # (test.t1) -master-bin.000001 340 Delete_rows 1 387 table_id: # flags: STMT_END_F -master-bin.000001 387 Query 1 463 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 214 Table_map 1 254 table_id: # (test.t1) +master-bin.000001 254 Write_rows 1 301 table_id: # flags: STMT_END_F +master-bin.000001 301 Table_map 1 341 table_id: # (test.t1) +master-bin.000001 341 Delete_rows 1 388 table_id: # flags: STMT_END_F +master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/rpl_truncate_3innodb.result b/mysql-test/r/rpl_truncate_3innodb.result index c7edd5014c2..46baa018966 100644 --- a/mysql-test/r/rpl_truncate_3innodb.result +++ b/mysql-test/r/rpl_truncate_3innodb.result @@ -31,13 +31,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ -master-bin.000001 337 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 417 Xid 1 444 COMMIT /* xid= */ -master-bin.000001 444 Query 1 520 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ +master-bin.000001 338 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 418 Xid 1 445 COMMIT /* xid= */ +master-bin.000001 445 Query 1 521 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -65,13 +65,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ -master-bin.000001 337 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 417 Xid 1 444 COMMIT /* xid= */ -master-bin.000001 444 Query 1 520 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ +master-bin.000001 338 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 418 Xid 1 445 COMMIT /* xid= */ +master-bin.000001 445 Query 1 521 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -99,14 +99,14 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 213 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 253 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 300 Xid 1 327 COMMIT /* xid= */ -master-bin.000001 327 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 407 Xid 1 434 COMMIT /* xid= */ -master-bin.000001 434 Query 1 510 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 214 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 254 Write_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 301 Xid 1 328 COMMIT /* xid= */ +master-bin.000001 328 Query 1 80 use `test`; TRUNCATE TABLE t1 +master-bin.000001 408 Xid 1 435 COMMIT /* xid= */ +master-bin.000001 435 Query 1 511 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -134,13 +134,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ -master-bin.000001 337 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ -master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ +master-bin.000001 338 Query 1 77 use `test`; DELETE FROM t1 +master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ +master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -168,13 +168,13 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 213 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 310 Xid 1 337 COMMIT /* xid= */ -master-bin.000001 337 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ -master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ +master-bin.000001 338 Query 1 77 use `test`; DELETE FROM t1 +master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ +master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -203,12 +203,12 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 213 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 213 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 253 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 300 Xid 1 327 COMMIT /* xid= */ -master-bin.000001 327 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 367 Delete_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 414 Xid 1 441 COMMIT /* xid= */ -master-bin.000001 441 Query 1 517 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 214 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 254 Write_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 301 Xid 1 328 COMMIT /* xid= */ +master-bin.000001 328 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 368 Delete_rows 1 87 table_id: # flags: STMT_END_F +master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ +master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result index a41b89bfbc5..62ace911e45 100644 --- a/mysql-test/r/rpl_truncate_7ndb.result +++ b/mysql-test/r/rpl_truncate_7ndb.result @@ -29,17 +29,17 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 222 Query 1 286 BEGIN -master-bin.000001 286 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 326 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 384 Write_rows 1 157 table_id: # -master-bin.000001 443 Write_rows 1 195 table_id: # -master-bin.000001 481 Write_rows 1 233 table_id: # flags: STMT_END_F -master-bin.000001 519 Query 1 584 COMMIT -master-bin.000001 584 Query 1 664 use `test`; TRUNCATE TABLE t1 -master-bin.000001 664 Query 1 740 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 223 Query 1 287 BEGIN +master-bin.000001 287 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 385 Write_rows 1 157 table_id: # +master-bin.000001 444 Write_rows 1 195 table_id: # +master-bin.000001 482 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 520 Query 1 585 COMMIT +master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1 +master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1 **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB; INSERT INTO t1 VALUES (1,1), (2,2); @@ -66,30 +66,30 @@ a b DROP TABLE t1; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 222 Query 1 286 BEGIN -master-bin.000001 286 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 326 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 384 Write_rows 1 157 table_id: # -master-bin.000001 443 Write_rows 1 195 table_id: # -master-bin.000001 481 Write_rows 1 233 table_id: # flags: STMT_END_F -master-bin.000001 519 Query 1 584 COMMIT -master-bin.000001 584 Query 1 664 use `test`; TRUNCATE TABLE t1 -master-bin.000001 664 Query 1 740 use `test`; DROP TABLE t1 -master-bin.000001 740 Query 1 857 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB -master-bin.000001 857 Query 1 921 BEGIN -master-bin.000001 921 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 961 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1019 Write_rows 1 157 table_id: # -master-bin.000001 1078 Write_rows 1 195 table_id: # -master-bin.000001 1116 Write_rows 1 233 table_id: # flags: STMT_END_F -master-bin.000001 1154 Query 1 1219 COMMIT -master-bin.000001 1219 Query 1 1283 BEGIN -master-bin.000001 1283 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 1323 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1381 Write_rows 1 157 table_id: # -master-bin.000001 1440 Delete_rows 1 191 table_id: # -master-bin.000001 1474 Delete_rows 1 225 table_id: # flags: STMT_END_F -master-bin.000001 1508 Query 1 1573 COMMIT -master-bin.000001 1573 Query 1 1649 use `test`; DROP TABLE t1 +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 223 Query 1 287 BEGIN +master-bin.000001 287 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 385 Write_rows 1 157 table_id: # +master-bin.000001 444 Write_rows 1 195 table_id: # +master-bin.000001 482 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 520 Query 1 585 COMMIT +master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1 +master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1 +master-bin.000001 741 Query 1 858 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB +master-bin.000001 858 Query 1 922 BEGIN +master-bin.000001 922 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 962 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1020 Write_rows 1 157 table_id: # +master-bin.000001 1079 Write_rows 1 195 table_id: # +master-bin.000001 1117 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 1155 Query 1 1220 COMMIT +master-bin.000001 1220 Query 1 1284 BEGIN +master-bin.000001 1284 Table_map 1 40 table_id: # (test.t1) +master-bin.000001 1324 Table_map 1 98 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1382 Write_rows 1 157 table_id: # +master-bin.000001 1441 Delete_rows 1 191 table_id: # +master-bin.000001 1475 Delete_rows 1 225 table_id: # flags: STMT_END_F +master-bin.000001 1509 Query 1 1574 COMMIT +master-bin.000001 1574 Query 1 1650 use `test`; DROP TABLE t1 diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 901d0718d0d..b76b399c9e2 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -6,13 +6,13 @@ INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; SET @var2=char(ascii('a')); insert into t1 values (@var1),(@var2); -show binlog events from 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # User var 1 # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@`a b`) -master-bin.000001 # User var 1 # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci -master-bin.000001 # User var 1 # @`var2`=_binary 0x61 COLLATE binary -master-bin.000001 # Query 1 # use `test`; insert into t1 values (@var1),(@var2) +master-bin.000001 # User var # # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@`a b`) +master-bin.000001 # User var # # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci +master-bin.000001 # User var # # @`var2`=_binary 0x61 COLLATE binary +master-bin.000001 # Query # # use `test`; insert into t1 values (@var1),(@var2) flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; From d49d3d0b3ac663e08603afe819d814079adc801e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 06:57:58 +0200 Subject: [PATCH 484/789] Add missing \ causing CMakelists.txt etc not to be included in dist --- storage/innobase/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am index d694d1ab811..62c0f8e817c 100644 --- a/storage/innobase/Makefile.am +++ b/storage/innobase/Makefile.am @@ -90,7 +90,7 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr include/ut0list.h include/ut0list.ic \ include/ut0wqueue.h \ pars/make_bison.sh pars/make_flex.sh \ - pars/pars0grm.y pars/pars0lex.l + pars/pars0grm.y pars/pars0lex.l \ CMakeLists.txt plug.in noinst_LIBRARIES = libinnobase.a From a2139d0254dbcc684b2ea52f720bdc8631a4240d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 09:14:11 +0200 Subject: [PATCH 485/789] Post merge fix --- mysys/my_pthread.c | 2 -- sql/mysqld.cc | 3 --- 2 files changed, 5 deletions(-) diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index db01602f4ab..d8182b67442 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -29,8 +29,6 @@ #define SCHED_POLICY SCHED_OTHER #endif -uint thd_lib_detected= 0; - uint thd_lib_detected; #ifndef my_pthread_setprio diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 56bb9423f1a..51feb197713 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -599,9 +599,6 @@ pthread_mutex_t LOCK_server_started; pthread_cond_t COND_server_started; int mysqld_server_started= 0; -#ifndef EMBEDDED_LIBRARY -static uint thr_kill_signal; -#endif File_parser_dummy_hook file_parser_dummy_hook; From 0da1a0cdecd77d98c4e849030a2efa9774c5f536 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 13:00:21 +0500 Subject: [PATCH 486/789] BUG#26138 - REPAIR TABLE with option USE_FRM erases all records in ARCHIVE table ARCHIVE table was truncated by REPAIR TABLE ... USE_FRM statement. The table handler returned its file name extensions in a wrong order. REPAIR TABLE believed it has to use the meta file to create a new table from it. With the fixed order, REPAIR TABLE does now use the data file to create a new table. So REPAIR TABLE ... USE_FRM works well with ARCHIVE engine now. This issue affects 5.0 only, since in 5.1 ARCHIVE engine stores meta information and data in the same file. mysql-test/r/archive.result: A test case for bug#26138. mysql-test/t/archive.test: A test case for bug#26138. sql/examples/ha_example.cc: Added a comment. sql/ha_archive.cc: First element of engine file name extentions array should be meta/index file extention. Second element - data file extention. This is true for engines that have separate meta/index file and data file. Reoder ha_archive_exts elements to meet described above requirement. sql/handler.h: Added a comment. sql/sql_table.cc: Added a comment. --- mysql-test/r/archive.result | 9 +++++++++ mysql-test/t/archive.test | 10 ++++++++++ sql/examples/ha_example.cc | 6 ++++++ sql/ha_archive.cc | 2 +- sql/handler.h | 11 +++++++++++ sql/sql_table.cc | 4 +++- 6 files changed, 40 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index f73a80dde65..d89cecedcdd 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12355,3 +12355,12 @@ auto fld1 companynr fld3 fld4 fld5 4 011403 37 intercepted audiology tinily 4 011403 37 intercepted audiology tinily drop table t1, t2, t4; +create table t1 (i int) engine=archive; +insert into t1 values (1); +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair status OK +select * from t1; +i +1 +drop table t1; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 80533f21311..0ffbfab3d4f 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1364,3 +1364,13 @@ SELECT * from t2; drop table t1, t2, t4; + +# +# BUG#26138 - REPAIR TABLE with option USE_FRM erases all records in ARCHIVE +# table +# +create table t1 (i int) engine=archive; +insert into t1 values (1); +repair table t1 use_frm; +select * from t1; +drop table t1; diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index 19c686ee495..d59ada3b445 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -211,6 +211,12 @@ ha_example::ha_example(TABLE *table_arg) If frm_error() is called then we will use this to to find out what file extentions exist for the storage engine. This is also 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 + and data file), the order of elements is relevant. First element of engine + file name extentions 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. */ static const char *ha_example_exts[] = { NullS diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc index 2ee514f29c9..e2a2211259f 100644 --- a/sql/ha_archive.cc +++ b/sql/ha_archive.cc @@ -503,8 +503,8 @@ int ha_archive::init_archive_writer() We just implement one additional file extension. */ static const char *ha_archive_exts[] = { - ARZ, ARM, + ARZ, NullS }; diff --git a/sql/handler.h b/sql/handler.h index 9e381ca4482..9863d541b5f 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -780,6 +780,17 @@ public: virtual void free_foreign_key_create_info(char* str) {} /* The following can be called without an open handler */ virtual const char *table_type() const =0; + /* + If frm_error() is called then we will use this to find out what file + extentions exist for the storage engine. This is also 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 + and data file), the order of elements is relevant. First element of engine + file name extentions 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. + */ virtual const char **bas_ext() const =0; virtual ulong table_flags(void) const =0; virtual ulong index_flags(uint idx, uint part, bool all_parts) const =0; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c75aff7fab6..fb377971630 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2068,7 +2068,9 @@ 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 + like ISAM or MyISAM. We assume fixed order of engine file name + extentions array. First element of engine file name extentions array + is meta/index file extention. Second element - data file extention. */ if (!ext[0] || !ext[1]) goto end; // No data file From 5a7b2fc76723fe60a9a07079624417c7c88c552f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 10:27:08 +0200 Subject: [PATCH 487/789] - Fixing binary log positions - Eliminating some compiler warnings mysql-test/extra/binlog_tests/blackhole.test: Using include file for SHOW BINLOG EVENTS. mysql-test/extra/binlog_tests/drop_temp_table.test: Using include file for SHOW BINLOG EVENTS. mysql-test/extra/binlog_tests/insert_select-binlog.test: Using include file for SHOW BINLOG EVENTS. mysql-test/extra/rpl_tests/rpl_log.test: Using include file for SHOW BINLOG EVENTS. mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test: Using include file for SHOW BINLOG EVENTS. mysql-test/extra/rpl_tests/rpl_truncate_helper.test: Using include file for SHOW BINLOG EVENTS. mysql-test/include/show_binlog_events.inc: Fixing regex replace to handle XIDs as well. mysql-test/r/binlog_row_binlog.result: Result change mysql-test/r/binlog_row_blackhole.result: Result change mysql-test/r/binlog_row_ctype_ucs.result: Result change mysql-test/r/binlog_row_drop_tmp_tbl.result: Result change mysql-test/r/binlog_row_insert_select.result: Result change mysql-test/r/binlog_row_mix_innodb_myisam.result: Result change mysql-test/r/binlog_stm_binlog.result: Result change mysql-test/r/binlog_stm_blackhole.result: Result change mysql-test/r/binlog_stm_drop_tmp_tbl.result: Result change mysql-test/r/binlog_stm_insert_select.result: Result change mysql-test/r/binlog_stm_mix_innodb_myisam.result: Result change mysql-test/r/ctype_cp932_binlog_row.result: Result change mysql-test/r/rpl_ndb_charset.result: Result change mysql-test/r/rpl_ndb_log.result: Result change mysql-test/r/rpl_ndb_multi.result: Result change mysql-test/r/rpl_row_basic_11bugs.result: Result change mysql-test/r/rpl_row_charset.result: Result change mysql-test/r/rpl_row_create_table.result: Result change mysql-test/r/rpl_row_delayed_ins.result: Result change mysql-test/r/rpl_row_drop.result: Result change mysql-test/r/rpl_row_flsh_tbls.result: Result change mysql-test/r/rpl_row_inexist_tbl.result: Result change mysql-test/r/rpl_row_log.result: Result change mysql-test/r/rpl_row_log_innodb.result: Result change mysql-test/r/rpl_row_reset_slave.result: Result change mysql-test/r/rpl_row_until.result: Result change mysql-test/r/rpl_stm_log.result: Result change mysql-test/r/rpl_truncate_2myisam.result: Result change mysql-test/r/rpl_truncate_3innodb.result: Result change mysql-test/r/rpl_udf.result: Result change mysql-test/t/binlog_row_mix_innodb_myisam.test: Fixing binary log position mysql-test/t/binlog_stm_mix_innodb_myisam.test: Fixing binary log position. sql/log_event.cc: Eliminating compiler warnings. --- mysql-test/extra/binlog_tests/blackhole.test | 11 +- .../extra/binlog_tests/drop_temp_table.test | 5 +- .../binlog_tests/insert_select-binlog.test | 8 +- mysql-test/extra/rpl_tests/rpl_log.test | 10 +- .../extra/rpl_tests/rpl_row_delayed_ins.test | 4 +- .../extra/rpl_tests/rpl_truncate_helper.test | 4 +- mysql-test/include/show_binlog_events.inc | 2 +- mysql-test/r/binlog_row_binlog.result | 98 +++---- mysql-test/r/binlog_row_blackhole.result | 44 ++- mysql-test/r/binlog_row_ctype_ucs.result | 6 +- mysql-test/r/binlog_row_drop_tmp_tbl.result | 5 +- mysql-test/r/binlog_row_insert_select.result | 4 +- .../r/binlog_row_mix_innodb_myisam.result | 256 +++++++++--------- mysql-test/r/binlog_stm_binlog.result | 4 +- mysql-test/r/binlog_stm_blackhole.result | 44 ++- mysql-test/r/binlog_stm_drop_tmp_tbl.result | 13 +- mysql-test/r/binlog_stm_insert_select.result | 8 +- .../r/binlog_stm_mix_innodb_myisam.result | 192 ++++++------- mysql-test/r/ctype_cp932_binlog_row.result | 6 +- mysql-test/r/rpl_ndb_charset.result | 64 ++--- mysql-test/r/rpl_ndb_log.result | 60 ++-- mysql-test/r/rpl_ndb_multi.result | 4 +- mysql-test/r/rpl_row_basic_11bugs.result | 16 +- mysql-test/r/rpl_row_charset.result | 64 ++--- mysql-test/r/rpl_row_create_table.result | 110 ++++---- mysql-test/r/rpl_row_delayed_ins.result | 19 +- mysql-test/r/rpl_row_drop.result | 8 +- mysql-test/r/rpl_row_flsh_tbls.result | 4 +- mysql-test/r/rpl_row_inexist_tbl.result | 2 +- mysql-test/r/rpl_row_log.result | 42 ++- mysql-test/r/rpl_row_log_innodb.result | 46 ++-- mysql-test/r/rpl_row_reset_slave.result | 6 +- mysql-test/r/rpl_row_until.result | 8 +- mysql-test/r/rpl_stm_log.result | 28 +- mysql-test/r/rpl_truncate_2myisam.result | 72 +++-- mysql-test/r/rpl_truncate_3innodb.result | 96 +++---- mysql-test/r/rpl_udf.result | 24 +- .../t/binlog_row_mix_innodb_myisam.test | 2 +- .../t/binlog_stm_mix_innodb_myisam.test | 2 +- sql/log_event.cc | 4 +- 40 files changed, 676 insertions(+), 729 deletions(-) diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test index 05e59838168..80f998359ba 100644 --- a/mysql-test/extra/binlog_tests/blackhole.test +++ b/mysql-test/extra/binlog_tests/blackhole.test @@ -121,11 +121,7 @@ select * from t2; select * from t3; let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; - +source include/show_binlog_events.inc; drop table t1,t2,t3; # @@ -157,10 +153,7 @@ start transaction; insert into t1 values(2); rollback; set autocommit=1; ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; drop table if exists t1; # End of 5.0 tests diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test index 9c8647395bf..87f94eff987 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -23,10 +23,7 @@ connection con2; # To be sure that logging has been done, we use a user lock. select get_lock("a",10); let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; drop database `drop-temp+table-test`; # End of 4.1 tests diff --git a/mysql-test/extra/binlog_tests/insert_select-binlog.test b/mysql-test/extra/binlog_tests/insert_select-binlog.test index 07da4a1907f..b09eebcb996 100644 --- a/mysql-test/extra/binlog_tests/insert_select-binlog.test +++ b/mysql-test/extra/binlog_tests/insert_select-binlog.test @@ -18,9 +18,7 @@ insert into t1 select * from t2; # The above should produce an error, but still be in the binlog; # verify the binlog : let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; select * from t1; drop table t1, t2; @@ -33,9 +31,7 @@ reset master; create table t2(unique(a)) select a from t1; # The above should produce an error, *and* not appear in the binlog let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; drop table t1; # End of 4.1 tests diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test index b6d6cb8f308..932fcdf670b 100644 --- a/mysql-test/extra/rpl_tests/rpl_log.test +++ b/mysql-test/extra/rpl_tests/rpl_log.test @@ -88,10 +88,7 @@ connection master; eval create table t2 (n int)ENGINE=$engine_type; insert into t2 values (1); ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; --replace_result $VERSION VERSION --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ @@ -142,10 +139,7 @@ insert into t1 values (NULL, 1); reset master; set insert_id=5; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; select * from t1; drop table t1; diff --git a/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test index 0e235f8838f..c4e6dbc84c2 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test +++ b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test @@ -15,9 +15,7 @@ SELECT * FROM t1 ORDER BY a; sync_slave_with_master; connection master; ---replace_result $VERSION VERSION ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; +source include/show_binlog_events.inc; sync_slave_with_master; SELECT * FROM t1 ORDER BY a; connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test index 7f1506c4010..64a8de7c6a0 100644 --- a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test +++ b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test @@ -37,6 +37,4 @@ SELECT * FROM t1; connection master; DROP TABLE t1; let $SERVER_VERSION=`select version()`; ---replace_result $SERVER_VERSION SERVER_VERSION ---replace_regex /\/\* xid=[0-9]+ \*\//\/* xid= *\// /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS; +source include/show_binlog_events.inc; diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index 0aad243562b..7377b4a0fed 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -1,5 +1,5 @@ --let $binlog_start=106 --replace_result $binlog_start --replace_column 2 # 4 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --eval show binlog events from $binlog_start diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result index 3db2fde1f1e..6fcaad010d2 100644 --- a/mysql-test/r/binlog_row_binlog.result +++ b/mysql-test/r/binlog_row_binlog.result @@ -8,18 +8,18 @@ commit; begin; insert t2 values (5); commit; -source include/show_binlog_events.inc; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb -master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb +master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ drop table t1,t2; reset master; create table t1 (n int) engine=innodb; @@ -254,58 +254,58 @@ INSERT INTO user SET host='localhost', user='@#@', password=password('Just a tes UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; -source include/show_binlog_events.inc; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) -master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( `a` int(11) DEFAULT NULL ) -master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL ) -master-bin.000001 # Table_map 1 # table_id: # (mysql.user) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysql.user) -master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysql.user) -master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); -source include/show_binlog_events.inc; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) -master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( `a` int(11) DEFAULT NULL ) -master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL ) -master-bin.000001 # Table_map 1 # table_id: # (mysql.user) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysql.user) -master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysql.user) -master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ -master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ +master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); 11 == 11 @@ -328,12 +328,12 @@ drop table if exists t3; create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 342 +master-bin.000001 346 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); show master status /* must show new binlog index after rotating */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000002 102 +master-bin.000002 106 drop table t3; diff --git a/mysql-test/r/binlog_row_blackhole.result b/mysql-test/r/binlog_row_blackhole.result index f370232e2c3..8e90ac4f30b 100644 --- a/mysql-test/r/binlog_row_blackhole.result +++ b/mysql-test/r/binlog_row_blackhole.result @@ -104,23 +104,22 @@ select * from t2; a select * from t3; a -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; drop table t1,t2 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; alter table t1 add b int -master-bin.000001 # Query 1 # use `test`; alter table t1 drop b -master-bin.000001 # Query 1 # use `test`; create table t3 like t1 +master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; alter table t1 add b int +master-bin.000001 # Query # # use `test`; alter table t1 drop b +master-bin.000001 # Query # # use `test`; create table t3 like t1 drop table t1,t2,t3; CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE; DELETE FROM t1 WHERE a=10; @@ -143,12 +142,11 @@ start transaction; insert into t1 values(2); rollback; set autocommit=1; -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; COMMIT +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; COMMIT drop table if exists t1; diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/r/binlog_row_ctype_ucs.result index d1ba431e152..4f4e7bcedd7 100644 --- a/mysql-test/r/binlog_row_ctype_ucs.result +++ b/mysql-test/r/binlog_row_ctype_ucs.result @@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; insert into t2 values (@v); -show binlog events from 106; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 106 Table_map 1 145 table_id: # (test.t2) -master-bin.000001 145 Write_rows 1 235 table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; diff --git a/mysql-test/r/binlog_row_drop_tmp_tbl.result b/mysql-test/r/binlog_row_drop_tmp_tbl.result index 2b09fe069e3..503076d66d9 100644 --- a/mysql-test/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-test/r/binlog_row_drop_tmp_tbl.result @@ -11,8 +11,7 @@ get_lock("a",10) select get_lock("a",10); get_lock("a",10) 1 -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # create database `drop-temp+table-test` +master-bin.000001 # Query # # create database `drop-temp+table-test` drop database `drop-temp+table-test`; diff --git a/mysql-test/r/binlog_row_insert_select.result b/mysql-test/r/binlog_row_insert_select.result index 407adc874fb..cd6ddafc47b 100644 --- a/mysql-test/r/binlog_row_insert_select.result +++ b/mysql-test/r/binlog_row_insert_select.result @@ -6,7 +6,7 @@ insert into t2 values(1),(2); reset master; insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' -source include/show_binlog_events.inc; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -20,6 +20,6 @@ insert into t1 values(1),(1); reset master; create table t2(unique(a)) select a from t1; ERROR 23000: Duplicate entry '1' for key 'a' -source include/show_binlog_events.inc; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info drop table t1; diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/r/binlog_row_mix_innodb_myisam.result index 3c2f9a63f38..6ac942176c7 100644 --- a/mysql-test/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_row_mix_innodb_myisam.result @@ -8,12 +8,12 @@ insert into t2 select * from t1; commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -25,12 +25,12 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; ROLLBACK +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -45,16 +45,16 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; savepoint my_savepoint -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; rollback to savepoint my_savepoint -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -74,18 +74,18 @@ a 7 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; savepoint my_savepoint -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; rollback to savepoint my_savepoint -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -100,12 +100,12 @@ get_lock("a",10) 1 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; ROLLBACK +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -113,11 +113,11 @@ insert into t1 values(9); insert into t2 select * from t1; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F delete from t1; delete from t2; reset master; @@ -126,24 +126,24 @@ begin; insert into t2 select * from t1; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F insert into t1 values(11); commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ alter table t2 engine=INNODB; delete from t1; delete from t2; @@ -154,12 +154,12 @@ insert into t2 select * from t1; commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -181,10 +181,10 @@ rollback to savepoint my_savepoint; commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -202,12 +202,12 @@ a 18 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; alter table t2 engine=MyISAM; @@ -254,28 +254,28 @@ get_lock("lock1",60) 1 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; alter table t2 engine=MyISAM -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; drop table t1,t2 -master-bin.000001 # Query 1 # use `test`; create table t0 (n int) -master-bin.000001 # Table_map 1 # table_id: # (test.t0) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t0) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; create table t2 (n int) engine=innodb +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # use `test`; create table t0 (n int) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb do release_lock("lock1"); drop table t0,t2; set autocommit=0; @@ -357,37 +357,37 @@ a b DROP TABLE t1,t2; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; DROP TABLE if exists t2 -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t2 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; TRUNCATE table t2 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t2) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; DROP TABLE t2 -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; TRUNCATE table t2 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2 +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; TRUNCATE table t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t2 +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; TRUNCATE table t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; create table t1 (a int) engine=innodb; create table t2 (a int) engine=myisam; diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index b26cfeded6b..66fe3e40270 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -26,10 +26,10 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; insert t1 values (5) -master-bin.000001 # Xid # # COMMIT /* xid=17 */ +master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; insert t2 values (5) -master-bin.000001 # Xid # # COMMIT /* xid=20 */ +master-bin.000001 # Xid # # COMMIT /* XID */ drop table t1,t2; reset master; create table t1 (n int) engine=innodb; diff --git a/mysql-test/r/binlog_stm_blackhole.result b/mysql-test/r/binlog_stm_blackhole.result index d382c94fba9..bf2fdfa616b 100644 --- a/mysql-test/r/binlog_stm_blackhole.result +++ b/mysql-test/r/binlog_stm_blackhole.result @@ -104,24 +104,23 @@ select * from t2; a select * from t3; a -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; drop table t1,t2 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole -master-bin.000001 # Query 1 # use `test`; delete from t1 where a=10 -master-bin.000001 # Query 1 # use `test`; update t1 set a=11 where a=15 -master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) -master-bin.000001 # Query 1 # use `test`; insert ignore into t1 values(1) -master-bin.000001 # Query 1 # use `test`; replace into t1 values(100) -master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole -master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 -master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1 -master-bin.000001 # Query 1 # use `test`; alter table t1 add b int -master-bin.000001 # Query 1 # use `test`; alter table t1 drop b -master-bin.000001 # Query 1 # use `test`; create table t3 like t1 -master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t3 -master-bin.000001 # Query 1 # use `test`; replace into t1 select * from t3 +master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole +master-bin.000001 # Query # # use `test`; delete from t1 where a=10 +master-bin.000001 # Query # # use `test`; update t1 set a=11 where a=15 +master-bin.000001 # Query # # use `test`; insert into t1 values(1) +master-bin.000001 # Query # # use `test`; insert ignore into t1 values(1) +master-bin.000001 # Query # # use `test`; replace into t1 values(100) +master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole +master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581 +master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1 +master-bin.000001 # Query # # use `test`; alter table t1 add b int +master-bin.000001 # Query # # use `test`; alter table t1 drop b +master-bin.000001 # Query # # use `test`; create table t3 like t1 +master-bin.000001 # Query # # use `test`; insert into t1 select * from t3 +master-bin.000001 # Query # # use `test`; replace into t1 select * from t3 drop table t1,t2,t3; CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE; DELETE FROM t1 WHERE a=10; @@ -144,11 +143,10 @@ start transaction; insert into t1 values(2); rollback; set autocommit=1; -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) -master-bin.000001 # Query 1 # use `test`; COMMIT +master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(1) +master-bin.000001 # Query # # use `test`; COMMIT drop table if exists t1; diff --git a/mysql-test/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/r/binlog_stm_drop_tmp_tbl.result index 96481341bd6..dc4349dea59 100644 --- a/mysql-test/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-test/r/binlog_stm_drop_tmp_tbl.result @@ -11,12 +11,11 @@ get_lock("a",10) select get_lock("a",10); get_lock("a",10) 1 -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # create database `drop-temp+table-test` -master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn1 (a int) -master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table `table:name` (a int) -master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn2 (a int) -master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1` +master-bin.000001 # Query # # create database `drop-temp+table-test` +master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn1 (a int) +master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table `table:name` (a int) +master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn2 (a int) +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1` drop database `drop-temp+table-test`; diff --git a/mysql-test/r/binlog_stm_insert_select.result b/mysql-test/r/binlog_stm_insert_select.result index 41ff0c1c728..a93a8edf4aa 100644 --- a/mysql-test/r/binlog_stm_insert_select.result +++ b/mysql-test/r/binlog_stm_insert_select.result @@ -6,10 +6,9 @@ insert into t2 values(1),(2); reset master; insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 200 use `test`; insert into t1 select * from t2 +master-bin.000001 # Query # # use `test`; insert into t1 select * from t2 select * from t1; a 1 @@ -20,7 +19,6 @@ insert into t1 values(1),(1); reset master; create table t2(unique(a)) select a from t1; ERROR 23000: Duplicate entry '1' for key 'a' -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 drop table t1; diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/r/binlog_stm_mix_innodb_myisam.result index bf8258faec8..c74fb17d600 100644 --- a/mysql-test/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_stm_mix_innodb_myisam.result @@ -8,10 +8,10 @@ insert into t2 select * from t1; commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(1) +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -23,10 +23,10 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(2) -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query 1 # use `test`; ROLLBACK +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(2) +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -41,13 +41,13 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(3) -master-bin.000001 # Query 1 # use `test`; savepoint my_savepoint -master-bin.000001 # Query 1 # use `test`; insert into t1 values(4) -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query 1 # use `test`; rollback to savepoint my_savepoint -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(3) +master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # use `test`; insert into t1 values(4) +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -67,14 +67,14 @@ a 7 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(5) -master-bin.000001 # Query 1 # use `test`; savepoint my_savepoint -master-bin.000001 # Query 1 # use `test`; insert into t1 values(6) -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query 1 # use `test`; rollback to savepoint my_savepoint -master-bin.000001 # Query 1 # use `test`; insert into t1 values(7) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(5) +master-bin.000001 # Query # # use `test`; savepoint my_savepoint +master-bin.000001 # Query # # use `test`; insert into t1 values(6) +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint +master-bin.000001 # Query # # use `test`; insert into t1 values(7) +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -89,10 +89,10 @@ get_lock("a",10) 1 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(8) -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query 1 # use `test`; ROLLBACK +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(8) +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -100,9 +100,9 @@ insert into t1 values(9); insert into t2 select * from t1; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t1 values(9) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # use `test`; insert into t1 values(9) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 delete from t1; delete from t2; reset master; @@ -111,19 +111,19 @@ begin; insert into t2 select * from t1; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t1 values(10) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # use `test`; insert into t1 values(10) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 insert into t1 values(11); commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; insert into t1 values(10) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(11) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; insert into t1 values(10) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(11) +master-bin.000001 # Xid # # COMMIT /* XID */ alter table t2 engine=INNODB; delete from t1; delete from t2; @@ -134,10 +134,10 @@ insert into t2 select * from t1; commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(12) -master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(12) +master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -159,9 +159,9 @@ rollback to savepoint my_savepoint; commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(14) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(14) +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; reset master; @@ -177,12 +177,12 @@ select a from t1 order by a; a 16 18 -show binlog events from s; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(16) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(18) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(16) +master-bin.000001 # Query # # use `test`; insert into t1 values(18) +master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; alter table t2 engine=MyISAM; @@ -229,29 +229,29 @@ get_lock("lock1",60) 1 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into t1 values(16) -master-bin.000001 # Query 1 # use `test`; insert into t1 values(18) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; delete from t1 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; delete from t2 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; alter table t2 engine=MyISAM -master-bin.000001 # Query 1 # use `test`; insert into t1 values (1) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; insert into t2 values (20) -master-bin.000001 # Query 1 # use `test`; drop table t1,t2 -master-bin.000001 # Query 1 # use `test`; create temporary table ti (a int) engine=innodb -master-bin.000001 # Query 1 # use `test`; insert into ti values(1) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; create temporary table t1 (a int) engine=myisam -master-bin.000001 # Query 1 # use `test`; insert t1 values (1) -master-bin.000001 # Query 1 # use `test`; create table t0 (n int) -master-bin.000001 # Query 1 # use `test`; insert t0 select * from t1 -master-bin.000001 # Query 1 # use `test`; insert into t0 select GET_LOCK("lock1",null) -master-bin.000001 # Query 1 # use `test`; create table t2 (n int) engine=innodb -master-bin.000001 # Query 1 # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti` +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(16) +master-bin.000001 # Query # # use `test`; insert into t1 values(18) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; delete from t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; delete from t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM +master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; insert into t2 values (20) +master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb +master-bin.000001 # Query # # use `test`; insert into ti values(1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engine=myisam +master-bin.000001 # Query # # use `test`; insert t1 values (1) +master-bin.000001 # Query # # use `test`; create table t0 (n int) +master-bin.000001 # Query # # use `test`; insert t0 select * from t1 +master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null) +master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti` do release_lock("lock1"); drop table t0,t2; set autocommit=0; @@ -333,28 +333,28 @@ a b DROP TABLE t1,t2; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (1,1),(1,2) -master-bin.000001 # Query 1 # use `test`; DROP TABLE if exists t2 -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (3,3) -master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t2 -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (4,4) -master-bin.000001 # Query 1 # use `test`; TRUNCATE table t2 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (5,5) -master-bin.000001 # Query 1 # use `test`; DROP TABLE t2 -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (6,6) -master-bin.000001 # Query 1 # use `test`; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (7,7) -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (8,8) -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (9,9) -master-bin.000001 # Query 1 # use `test`; TRUNCATE table t2 -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (10,10) -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; INSERT INTO t2 values (100,100) -master-bin.000001 # Xid 1 # COMMIT /* xid= */ -master-bin.000001 # Query 1 # use `test`; DROP TABLE t1,t2 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (1,1),(1,2) +master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3) +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4) +master-bin.000001 # Query # # use `test`; TRUNCATE table t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5) +master-bin.000001 # Query # # use `test`; DROP TABLE t2 +master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (6,6) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb +master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (7,7) +master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8) +master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (9,9) +master-bin.000001 # Query # # use `test`; TRUNCATE table t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10) +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (100,100) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t1,t2 reset master; create table t1 (a int) engine=innodb; create table t2 (a int) engine=myisam; diff --git a/mysql-test/r/ctype_cp932_binlog_row.result b/mysql-test/r/ctype_cp932_binlog_row.result index 482e7b108f9..39d7727b58a 100644 --- a/mysql-test/r/ctype_cp932_binlog_row.result +++ b/mysql-test/r/ctype_cp932_binlog_row.result @@ -8,9 +8,9 @@ SET @var1= x'8300'; EXECUTE stmt1 USING @var1; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob) -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F SELECT HEX(f1) FROM t1; HEX(f1) 8300 diff --git a/mysql-test/r/rpl_ndb_charset.result b/mysql-test/r/rpl_ndb_charset.result index 41dd5791702..ed9b3cfbfa8 100644 --- a/mysql-test/r/rpl_ndb_charset.result +++ b/mysql-test/r/rpl_ndb_charset.result @@ -109,39 +109,39 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest2 -master-bin.000001 # Query 1 # drop database if exists mysqltest3 -master-bin.000001 # Query 1 # create database mysqltest2 character set latin2 -master-bin.000001 # Query 1 # create database mysqltest3 -master-bin.000001 # Query 1 # drop database mysqltest3 -master-bin.000001 # Query 1 # create database mysqltest3 -master-bin.000001 # Query 1 # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # drop database mysqltest2 -master-bin.000001 # Query 1 # drop database mysqltest3 +master-bin.000001 # Query # # drop database if exists mysqltest2 +master-bin.000001 # Query # # drop database if exists mysqltest3 +master-bin.000001 # Query # # create database mysqltest2 character set latin2 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # drop database mysqltest3 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # drop database mysqltest2 +master-bin.000001 # Query # # drop database mysqltest3 select "--- --global--" as ""; --- --global-- diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result index 8d305e27bed..8d443780039 100644 --- a/mysql-test/r/rpl_ndb_log.result +++ b/mysql-test/r/rpl_ndb_log.result @@ -35,14 +35,14 @@ master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT -show binlog events from 105 limit 1; +show binlog events from 106 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -show binlog events from 105 limit 2; +show binlog events from 106 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # BEGIN -show binlog events from 105 limit 2,1; +show binlog events from 106 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Table_map 1 # table_id: # (test.t1) flush logs; @@ -56,26 +56,25 @@ flush logs; stop slave; create table t2 (n int)ENGINE=NDB; insert into t2 values (1); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # COMMIT -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB -master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # COMMIT -master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=NDB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 @@ -89,13 +88,13 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Query 1 # COMMIT show binary logs; Log_name File_size -master-bin.000001 1774 -master-bin.000002 616 +master-bin.000001 1775 +master-bin.000002 617 start slave; show binary logs; Log_name File_size -slave-bin.000001 1869 -slave-bin.000002 201 +slave-bin.000001 1870 +slave-bin.000002 202 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -129,7 +128,7 @@ slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Query 2 # COMMIT show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 616 # # master-bin.000002 Yes Yes # 0 0 616 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 617 # # master-bin.000002 Yes Yes # 0 0 617 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; @@ -140,11 +139,10 @@ insert into t1 values (NULL, 1); reset master; set insert_id=5; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F select * from t1; a b 1 1 diff --git a/mysql-test/r/rpl_ndb_multi.result b/mysql-test/r/rpl_ndb_multi.result index a42bccbf9a5..760114f3639 100644 --- a/mysql-test/r/rpl_ndb_multi.result +++ b/mysql-test/r/rpl_ndb_multi.result @@ -26,11 +26,11 @@ stop slave; SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) FROM mysql.ndb_binlog_index WHERE epoch = ; @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) -105 master-bin1.000001 +106 master-bin1.000001 CHANGE MASTER TO master_port=, master_log_file = 'master-bin1.000001', -master_log_pos = 105 ; +master_log_pos = 106 ; start slave; INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); DELETE FROM t1 WHERE c3 = 1; diff --git a/mysql-test/r/rpl_row_basic_11bugs.result b/mysql-test/r/rpl_row_basic_11bugs.result index ce0e70138c2..1025b965589 100644 --- a/mysql-test/r/rpl_row_basic_11bugs.result +++ b/mysql-test/r/rpl_row_basic_11bugs.result @@ -24,11 +24,11 @@ SHOW TABLES; Tables_in_test_ignore t2 INSERT INTO t2 VALUES (3,3), (4,4); -SHOW BINLOG EVENTS FROM 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 105 Query 1 198 use `test`; CREATE TABLE t1 (a INT, b INT) -master-bin.000001 198 Table_map 1 238 table_id: # (test.t1) -master-bin.000001 238 Write_rows 1 285 table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F **** On Slave **** SHOW DATABASES; Database @@ -54,10 +54,10 @@ DELETE FROM t1 WHERE a = 0; UPDATE t1 SET a=99 WHERE a = 0; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 191 use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 191 Table_map 1 230 table_id: # (test.t1) -master-bin.000001 230 Write_rows 1 269 table_id: # flags: STMT_END_F +master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 192 Table_map 1 231 table_id: # (test.t1) +master-bin.000001 231 Write_rows 1 270 table_id: # flags: STMT_END_F DROP TABLE t1; ================ Test for BUG#17620 ================ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; diff --git a/mysql-test/r/rpl_row_charset.result b/mysql-test/r/rpl_row_charset.result index 2462dd0b505..e51f3e57d1f 100644 --- a/mysql-test/r/rpl_row_charset.result +++ b/mysql-test/r/rpl_row_charset.result @@ -109,39 +109,39 @@ a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; -show binlog events from 105; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # drop database if exists mysqltest2 -master-bin.000001 # Query 1 # drop database if exists mysqltest3 -master-bin.000001 # Query 1 # create database mysqltest2 character set latin2 -master-bin.000001 # Query 1 # create database mysqltest3 -master-bin.000001 # Query 1 # drop database mysqltest3 -master-bin.000001 # Query 1 # create database mysqltest3 -master-bin.000001 # Query 1 # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1 -master-bin.000001 # Table_map 1 # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # drop database mysqltest2 -master-bin.000001 # Query 1 # drop database mysqltest3 +master-bin.000001 # Query # # drop database if exists mysqltest2 +master-bin.000001 # Query # # drop database if exists mysqltest3 +master-bin.000001 # Query # # create database mysqltest2 character set latin2 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # drop database mysqltest3 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # drop database mysqltest2 +master-bin.000001 # Query # # drop database mysqltest3 select "--- --global--" as ""; --- --global-- diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result index d89afb3e5f3..e76ce5b962d 100644 --- a/mysql-test/r/rpl_row_create_table.result +++ b/mysql-test/r/rpl_row_create_table.result @@ -8,30 +8,30 @@ CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT) ENGINE=Merge; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; -SHOW BINLOG EVENTS FROM 215; +SHOW BINLOG EVENTS FROM 216; Log_name # -Pos 215 +Pos 216 Event_type Query Server_id # -End_log_pos 308 +End_log_pos 309 Info use `test`; CREATE TABLE t1 (a INT, b INT) Log_name # -Pos 308 +Pos 309 Event_type Query Server_id # -End_log_pos 414 +End_log_pos 415 Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge Log_name # -Pos 414 +Pos 415 Event_type Query Server_id # -End_log_pos 520 +End_log_pos 521 Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8 Log_name # -Pos 520 +Pos 521 Event_type Query Server_id # -End_log_pos 639 +End_log_pos 640 Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8 **** On Master **** SHOW CREATE TABLE t1; @@ -127,7 +127,7 @@ NULL 5 10 NULL 6 12 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; ERROR 23000: Duplicate entry '2' for key 'b' -SHOW BINLOG EVENTS FROM 1097; +SHOW BINLOG EVENTS FROM 1098; Log_name Pos Event_type Server_id End_log_pos Info CREATE TABLE t7 (a INT, b INT UNIQUE); INSERT INTO t7 SELECT a,b FROM tt3; @@ -137,11 +137,11 @@ a b 1 2 2 4 3 6 -SHOW BINLOG EVENTS FROM 1097; +SHOW BINLOG EVENTS FROM 1098; Log_name Pos Event_type Server_id End_log_pos Info -# 1097 Query # 1197 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) -# 1197 Table_map # 1237 table_id: # (test.t7) -# 1237 Write_rows # 1293 table_id: # flags: STMT_END_F +# 1098 Query # 1198 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE) +# 1198 Table_map # 1238 table_id: # (test.t7) +# 1238 Write_rows # 1294 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -154,10 +154,10 @@ INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -SHOW BINLOG EVENTS FROM 1293; +SHOW BINLOG EVENTS FROM 1294; Log_name Pos Event_type Server_id End_log_pos Info -# 1293 Table_map # 1333 table_id: # (test.t7) -# 1333 Write_rows # 1389 table_id: # flags: STMT_END_F +# 1294 Table_map # 1334 table_id: # (test.t7) +# 1334 Write_rows # 1390 table_id: # flags: STMT_END_F SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -192,10 +192,10 @@ Create Table CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW BINLOG EVENTS FROM 1389; +SHOW BINLOG EVENTS FROM 1390; Log_name Pos Event_type Server_id End_log_pos Info -# 1389 Query # 1475 use `test`; CREATE TABLE t8 LIKE t4 -# 1475 Query # 1614 use `test`; CREATE TABLE `t9` ( +# 1390 Query # 1476 use `test`; CREATE TABLE t8 LIKE t4 +# 1476 Query # 1615 use `test`; CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) @@ -274,33 +274,33 @@ a 3 SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -# 4 Format_desc # 105 Server ver: #, Binlog ver: # -# 105 Query # 191 use `test`; CREATE TABLE t1 (a INT) -# 191 Table_map # 230 table_id: # (test.t1) -# 230 Write_rows # 274 table_id: # flags: STMT_END_F -# 274 Query # 342 use `test`; BEGIN -# 342 Query # 125 use `test`; CREATE TABLE `t2` ( +# 4 Format_desc # 106 Server ver: #, Binlog ver: # +# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT) +# 192 Table_map # 231 table_id: # (test.t1) +# 231 Write_rows # 275 table_id: # flags: STMT_END_F +# 275 Query # 343 use `test`; BEGIN +# 343 Query # 125 use `test`; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 467 Table_map # 164 table_id: # (test.t2) -# 506 Write_rows # 208 table_id: # flags: STMT_END_F -# 550 Xid # 577 COMMIT /* XID */ -# 577 Query # 645 use `test`; BEGIN -# 645 Query # 125 use `test`; CREATE TABLE `t3` ( +# 468 Table_map # 164 table_id: # (test.t2) +# 507 Write_rows # 208 table_id: # flags: STMT_END_F +# 551 Xid # 578 COMMIT /* XID */ +# 578 Query # 646 use `test`; BEGIN +# 646 Query # 125 use `test`; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 770 Table_map # 164 table_id: # (test.t3) -# 809 Write_rows # 208 table_id: # flags: STMT_END_F -# 853 Xid # 880 COMMIT /* XID */ -# 880 Query # 948 use `test`; BEGIN -# 948 Query # 125 use `test`; CREATE TABLE `t4` ( +# 771 Table_map # 164 table_id: # (test.t3) +# 810 Write_rows # 208 table_id: # flags: STMT_END_F +# 854 Xid # 881 COMMIT /* XID */ +# 881 Query # 949 use `test`; BEGIN +# 949 Query # 125 use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 1073 Table_map # 164 table_id: # (test.t4) -# 1112 Write_rows # 208 table_id: # flags: STMT_END_F -# 1156 Xid # 1183 COMMIT /* XID */ -# 1183 Table_map # 1222 table_id: # (test.t1) -# 1222 Write_rows # 1266 table_id: # flags: STMT_END_F +# 1074 Table_map # 164 table_id: # (test.t4) +# 1113 Write_rows # 208 table_id: # flags: STMT_END_F +# 1157 Xid # 1184 COMMIT /* XID */ +# 1184 Table_map # 1223 table_id: # (test.t1) +# 1223 Write_rows # 1267 table_id: # flags: STMT_END_F SHOW TABLES; Tables_in_test t1 @@ -365,17 +365,17 @@ a 9 SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -# 4 Format_desc # 105 Server ver: #, Binlog ver: # -# 105 Query # 191 use `test`; CREATE TABLE t1 (a INT) -# 191 Table_map # 230 table_id: # (test.t1) -# 230 Write_rows # 274 table_id: # flags: STMT_END_F -# 274 Query # 374 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB -# 374 Query # 442 use `test`; BEGIN -# 442 Table_map # 39 table_id: # (test.t2) -# 481 Write_rows # 83 table_id: # flags: STMT_END_F -# 525 Table_map # 122 table_id: # (test.t2) -# 564 Write_rows # 161 table_id: # flags: STMT_END_F -# 603 Xid # 630 COMMIT /* XID */ +# 4 Format_desc # 106 Server ver: #, Binlog ver: # +# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT) +# 192 Table_map # 231 table_id: # (test.t1) +# 231 Write_rows # 275 table_id: # flags: STMT_END_F +# 275 Query # 375 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB +# 375 Query # 443 use `test`; BEGIN +# 443 Table_map # 39 table_id: # (test.t2) +# 482 Write_rows # 83 table_id: # flags: STMT_END_F +# 526 Table_map # 122 table_id: # (test.t2) +# 565 Write_rows # 161 table_id: # flags: STMT_END_F +# 604 Xid # 631 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a 1 @@ -394,10 +394,10 @@ INSERT INTO t2 SELECT a+2 FROM tt2; ROLLBACK; SELECT * FROM t2 ORDER BY a; a -SHOW BINLOG EVENTS FROM 630; +SHOW BINLOG EVENTS FROM 631; Log_name Pos Event_type Server_id End_log_pos Info -# 630 Query # 80 use `test`; TRUNCATE TABLE t2 -# 710 Xid # 737 COMMIT /* XID */ +# 631 Query # 80 use `test`; TRUNCATE TABLE t2 +# 711 Xid # 738 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a DROP TABLE t1,t2; diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/r/rpl_row_delayed_ins.result index e07a06f42fa..800a39bd567 100644 --- a/mysql-test/r/rpl_row_delayed_ins.result +++ b/mysql-test/r/rpl_row_delayed_ins.result @@ -14,17 +14,16 @@ a 1 2 3 -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 225 use `test`; create table t1(a int not null primary key) engine=myisam -master-bin.000001 225 Table_map 1 264 table_id: # (test.t1) -master-bin.000001 264 Write_rows 1 298 table_id: # flags: STMT_END_F -master-bin.000001 298 Table_map 1 337 table_id: # (test.t1) -master-bin.000001 337 Write_rows 1 371 table_id: # flags: STMT_END_F -master-bin.000001 371 Table_map 1 410 table_id: # (test.t1) -master-bin.000001 410 Write_rows 1 444 table_id: # flags: STMT_END_F -master-bin.000001 444 Query 1 519 use `test`; flush tables +master-bin.000001 # Query # # use `test`; create table t1(a int not null primary key) engine=myisam +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; flush tables SELECT * FROM t1 ORDER BY a; a 1 diff --git a/mysql-test/r/rpl_row_drop.result b/mysql-test/r/rpl_row_drop.result index cdf52ceb9b9..89654ebf165 100644 --- a/mysql-test/r/rpl_row_drop.result +++ b/mysql-test/r/rpl_row_drop.result @@ -43,10 +43,10 @@ t2 DROP TABLE t1,t2; SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 105 Query 1 191 use `test`; CREATE TABLE t1 (a int) -master-bin.000001 191 Query 1 277 use `test`; CREATE TABLE t2 (a int) -master-bin.000001 277 Query 1 381 use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4 +master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a int) +master-bin.000001 192 Query 1 278 use `test`; CREATE TABLE t2 (a int) +master-bin.000001 278 Query 1 382 use `test`; DROP TABLE `t1` /* generated by server */ SHOW TABLES; Tables_in_test t2 diff --git a/mysql-test/r/rpl_row_flsh_tbls.result b/mysql-test/r/rpl_row_flsh_tbls.result index d5b8dc48009..942a6b83bf6 100644 --- a/mysql-test/r/rpl_row_flsh_tbls.result +++ b/mysql-test/r/rpl_row_flsh_tbls.result @@ -12,13 +12,13 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 618 ; +SHOW BINLOG EVENTS FROM 619 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 618 ; +SHOW BINLOG EVENTS FROM 619 ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 # Query 1 # use `test`; flush tables diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/r/rpl_row_inexist_tbl.result index d482f6f5e94..7d0d7504ee7 100644 --- a/mysql-test/r/rpl_row_inexist_tbl.result +++ b/mysql-test/r/rpl_row_inexist_tbl.result @@ -39,7 +39,7 @@ Replicate_Wild_Ignore_Table Last_Errno 1146 Last_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1` Skip_Counter 0 -Exec_Master_Log_Pos 523 +Exec_Master_Log_Pos 524 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result index b1116b9e7c1..5d252d72bd1 100644 --- a/mysql-test/r/rpl_row_log.result +++ b/mysql-test/r/rpl_row_log.result @@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -show binlog events from 105 limit 1; +show binlog events from 106 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -show binlog events from 105 limit 2; +show binlog events from 106 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Table_map 1 # table_id: # (test.t1) -show binlog events from 105 limit 2,1; +show binlog events from 106 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F flush logs; @@ -47,17 +47,16 @@ flush logs; stop slave; create table t2 (n int)ENGINE=MyISAM; insert into t2 values (1); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 @@ -67,13 +66,13 @@ master-bin.000002 # Table_map 1 # table_id: # (test.t2) master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F show binary logs; Log_name File_size -master-bin.000001 1259 -master-bin.000002 376 +master-bin.000001 1260 +master-bin.000002 377 start slave; show binary logs; Log_name File_size -slave-bin.000001 1357 -slave-bin.000002 277 +slave-bin.000001 1358 +slave-bin.000002 278 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -94,7 +93,7 @@ slave-bin.000002 # Table_map 1 # table_id: # (test.t2) slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 376 # # master-bin.000002 Yes Yes # 0 0 376 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 377 # # master-bin.000002 Yes Yes # 0 0 377 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; @@ -105,11 +104,10 @@ insert into t1 values (NULL, 1); reset master; set insert_id=5; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F select * from t1; a b 1 1 diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/r/rpl_row_log_innodb.result index b1adcdd05e8..ff1fabb35cb 100644 --- a/mysql-test/r/rpl_row_log_innodb.result +++ b/mysql-test/r/rpl_row_log_innodb.result @@ -28,14 +28,14 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not nul master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Xid 1 # COMMIT /* XID */ -show binlog events from 105 limit 1; +show binlog events from 106 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -show binlog events from 105 limit 2; +show binlog events from 106 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB master-bin.000001 # Table_map 1 # table_id: # (test.t1) -show binlog events from 105 limit 2,1; +show binlog events from 106 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F flush logs; @@ -49,19 +49,18 @@ flush logs; stop slave; create table t2 (n int)ENGINE=InnoDB; insert into t2 values (1); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* XID */ -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F -master-bin.000001 # Xid 1 # COMMIT /* XID */ -master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 @@ -72,13 +71,13 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Xid 1 # COMMIT /* XID */ show binary logs; Log_name File_size -master-bin.000001 1313 -master-bin.000002 403 +master-bin.000001 1314 +master-bin.000002 404 start slave; show binary logs; Log_name File_size -slave-bin.000001 1411 -slave-bin.000002 304 +slave-bin.000001 1412 +slave-bin.000002 305 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 @@ -102,7 +101,7 @@ slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Xid 1 # COMMIT /* XID */ show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 403 # # master-bin.000002 Yes Yes # 0 0 403 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 404 # # master-bin.000002 Yes Yes # 0 0 404 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log DROP TABLE t1; @@ -113,11 +112,10 @@ insert into t1 values (NULL, 1); reset master; set insert_id=5; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Table_map 1 # table_id: # (test.t1) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F select * from t1; a b 1 1 diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/r/rpl_row_reset_slave.result index a93db7b2c7e..657dad30266 100644 --- a/mysql-test/r/rpl_row_reset_slave.result +++ b/mysql-test/r/rpl_row_reset_slave.result @@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # stop slave; change master to master_user='test'; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 No No # 0 0 105 # None 0 No # +# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # reset slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master @@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # stop slave; reset slave; start slave; diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/r/rpl_row_until.result index 6d0da57baeb..cffcf12a31b 100644 --- a/mysql-test/r/rpl_row_until.result +++ b/mysql-test/r/rpl_row_until.result @@ -21,7 +21,7 @@ n 4 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 # No 0 0 314 # Master master-bin.000001 311 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-bin.000001 311 No # start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; select * from t1; n @@ -31,7 +31,7 @@ n 4 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 # No 0 0 314 # Master master-no-such-bin.000001 291 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-no-such-bin.000001 291 No # start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; select * from t2; n @@ -39,13 +39,13 @@ n 2 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 # No 0 0 589 # Relay slave-relay-bin.000004 728 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 590 # Relay slave-relay-bin.000004 728 No # start slave; stop slave; start slave until master_log_file='master-bin.000001', master_log_pos=740; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 743 # Master master-bin.000001 740 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 744 # Master master-bin.000001 740 No # start slave until master_log_file='master-bin', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result index 8d912dacff3..f69ad8a57c1 100644 --- a/mysql-test/r/rpl_stm_log.result +++ b/mysql-test/r/rpl_stm_log.result @@ -47,17 +47,16 @@ flush logs; stop slave; create table t2 (n int)ENGINE=MyISAM; insert into t2 values (1); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -master-bin.000001 # Intvar 1 # INSERT_ID=1 -master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) -master-bin.000001 # Query 1 # use `test`; drop table t1 -master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 -master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 -master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 +master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +master-bin.000001 # Query # # use `test`; drop table t1 +master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581 +master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 @@ -103,12 +102,11 @@ insert into t1 values (NULL, 1); reset master; set insert_id=5; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); -show binlog events; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Intvar 1 # LAST_INSERT_ID=1 -master-bin.000001 # Intvar 1 # INSERT_ID=5 -master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()) +master-bin.000001 # Intvar # # LAST_INSERT_ID=1 +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()) select * from t1; a b 1 1 diff --git a/mysql-test/r/rpl_truncate_2myisam.result b/mysql-test/r/rpl_truncate_2myisam.result index 7e15ae0ba45..c7ef28ba56b 100644 --- a/mysql-test/r/rpl_truncate_2myisam.result +++ b/mysql-test/r/rpl_truncate_2myisam.result @@ -29,13 +29,12 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Query 1 391 use `test`; TRUNCATE TABLE t1 -master-bin.000001 391 Query 1 467 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -61,13 +60,12 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Query 1 391 use `test`; TRUNCATE TABLE t1 -master-bin.000001 391 Query 1 467 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -93,14 +91,13 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 214 Table_map 1 254 table_id: # (test.t1) -master-bin.000001 254 Write_rows 1 301 table_id: # flags: STMT_END_F -master-bin.000001 301 Query 1 381 use `test`; TRUNCATE TABLE t1 -master-bin.000001 381 Query 1 457 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -126,13 +123,12 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Query 1 388 use `test`; DELETE FROM t1 -master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Query # # use `test`; DELETE FROM t1 +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -158,13 +154,12 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 214 Query 1 311 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Query 1 388 use `test`; DELETE FROM t1 -master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Query # # use `test`; DELETE FROM t1 +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -191,12 +186,11 @@ a b 3 3 **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM -master-bin.000001 214 Table_map 1 254 table_id: # (test.t1) -master-bin.000001 254 Write_rows 1 301 table_id: # flags: STMT_END_F -master-bin.000001 301 Table_map 1 341 table_id: # (test.t1) -master-bin.000001 341 Delete_rows 1 388 table_id: # flags: STMT_END_F -master-bin.000001 388 Query 1 464 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TABLE t1 diff --git a/mysql-test/r/rpl_truncate_3innodb.result b/mysql-test/r/rpl_truncate_3innodb.result index 46baa018966..7ce48c2e983 100644 --- a/mysql-test/r/rpl_truncate_3innodb.result +++ b/mysql-test/r/rpl_truncate_3innodb.result @@ -29,15 +29,14 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ -master-bin.000001 338 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 418 Xid 1 445 COMMIT /* xid= */ -master-bin.000001 445 Query 1 521 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -63,15 +62,14 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ -master-bin.000001 338 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 418 Xid 1 445 COMMIT /* xid= */ -master-bin.000001 445 Query 1 521 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -97,16 +95,15 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 214 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 254 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 301 Xid 1 328 COMMIT /* xid= */ -master-bin.000001 328 Query 1 80 use `test`; TRUNCATE TABLE t1 -master-bin.000001 408 Xid 1 435 COMMIT /* xid= */ -master-bin.000001 435 Query 1 511 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -132,15 +129,14 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ -master-bin.000001 338 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ -master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -166,15 +162,14 @@ SELECT * FROM t1; a b **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 214 Query 1 97 use `test`; INSERT INTO t1 VALUES (1,1), (2,2) -master-bin.000001 311 Xid 1 338 COMMIT /* xid= */ -master-bin.000001 338 Query 1 77 use `test`; DELETE FROM t1 -master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ -master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DELETE FROM t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -201,14 +196,13 @@ a b 3 3 **** On Master **** DROP TABLE t1; -SHOW BINLOG EVENTS; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 -master-bin.000001 106 Query 1 214 use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB -master-bin.000001 214 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 254 Write_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 301 Xid 1 328 COMMIT /* xid= */ -master-bin.000001 328 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 368 Delete_rows 1 87 table_id: # flags: STMT_END_F -master-bin.000001 415 Xid 1 442 COMMIT /* xid= */ -master-bin.000001 442 Query 1 518 use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 diff --git a/mysql-test/r/rpl_udf.result b/mysql-test/r/rpl_udf.result index 156876d07de..678a848fcd9 100644 --- a/mysql-test/r/rpl_udf.result +++ b/mysql-test/r/rpl_udf.result @@ -16,14 +16,14 @@ CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; ERROR HY000: Can't find symbol 'myfunc_nonexist' in library SELECT * FROM mysql.func; name ret dl type -myfunc_double 1 udf_example.dll function -myfunc_int 2 udf_example.dll function +myfunc_double 1 udf_example.so function +myfunc_int 2 udf_example.so function affected rows: 2 "Running on the slave" SELECT * FROM mysql.func; name ret dl type -myfunc_double 1 udf_example.dll function -myfunc_int 2 udf_example.dll function +myfunc_double 1 udf_example.so function +myfunc_int 2 udf_example.so function affected rows: 2 "Running on the master" CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; @@ -106,7 +106,7 @@ SELECT * FROM t1 ORDER BY sum; sum price 1 475 10 5 -100 47 +100 48 200 24 affected rows: 4 "Running on the slave" @@ -114,7 +114,7 @@ SELECT * FROM t1 ORDER BY sum; sum price 1 475 10 5 -100 47 +100 48 200 24 affected rows: 4 "Running on the master" @@ -168,14 +168,14 @@ CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; ERROR HY000: Can't find symbol 'myfunc_nonexist' in library SELECT * FROM mysql.func; name ret dl type -myfunc_int 2 udf_example.dll function -myfunc_double 1 udf_example.dll function +myfunc_int 2 udf_example.so function +myfunc_double 1 udf_example.so function affected rows: 2 "Running on the slave" SELECT * FROM mysql.func; name ret dl type -myfunc_int 2 udf_example.dll function -myfunc_double 1 udf_example.dll function +myfunc_int 2 udf_example.so function +myfunc_double 1 udf_example.so function affected rows: 2 "Running on the master" CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; @@ -258,7 +258,7 @@ SELECT * FROM t1 ORDER BY sum; sum price 1 475 10 5 -100 47 +100 48 200 24 affected rows: 4 "Running on the slave" @@ -266,7 +266,7 @@ SELECT * FROM t1 ORDER BY sum; sum price 1 475 10 5 -100 47 +100 48 200 24 affected rows: 4 "Running on the master" diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/t/binlog_row_mix_innodb_myisam.test index 14aeb1f3428..335a05be146 100644 --- a/mysql-test/t/binlog_row_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_row_mix_innodb_myisam.test @@ -20,7 +20,7 @@ # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) flush logs; ---exec $MYSQL_BINLOG --start-position=519 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output +--exec $MYSQL_BINLOG --start-position=520 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test index 4069cda0406..72651c13be7 100644 --- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test @@ -12,7 +12,7 @@ # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # and does not make slave to stop) flush logs; ---exec $MYSQL_BINLOG --start-position=556 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output +--exec $MYSQL_BINLOG --start-position=555 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) diff --git a/sql/log_event.cc b/sql/log_event.cc index 286d6372354..661eafd976f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7892,8 +7892,8 @@ Incident_log_event::Incident_log_event(const char *buf, uint event_len, m_incident= static_cast(uint2korr(buf + common_header_len)); char const *ptr= buf + common_header_len + post_header_len; char const *const str_end= buf + event_len; - uint8 len; - const char *str; + uint8 len= 0; // Assignment to keep compiler happy + const char *str= NULL; // Assignment to keep compiler happy read_str(&ptr, str_end, &str, &len); m_message.str= const_cast(str); m_message.length= len; From 8a59133c7249903baca6a4338af11cfd74d5f340 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 11:37:21 +0200 Subject: [PATCH 488/789] 5.1.17 not compatible with 5.1.18 because of change in var page reference size --- storage/ndb/src/common/util/version.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/common/util/version.c b/storage/ndb/src/common/util/version.c index b2ebb87c144..f309a3d4ad5 100644 --- a/storage/ndb/src/common/util/version.c +++ b/storage/ndb/src/common/util/version.c @@ -91,7 +91,8 @@ void ndbSetOwnVersion() {} #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { - { MAKE_VERSION(5,1,NDB_VERSION_BUILD), MAKE_VERSION(5,1,0), UG_Range}, + { MAKE_VERSION(5,1,NDB_VERSION_BUILD), MAKE_VERSION(5,1,18), UG_Range}, + { MAKE_VERSION(5,1,17), MAKE_VERSION(5,1,0), UG_Range}, { MAKE_VERSION(5,0,NDB_VERSION_BUILD), MAKE_VERSION(5,0,12), UG_Range}, { MAKE_VERSION(5,0,11), MAKE_VERSION(5,0,2), UG_Range}, { MAKE_VERSION(4,1,NDB_VERSION_BUILD), MAKE_VERSION(4,1,15), UG_Range }, From 03b4cf5147aaa6f5e8d5ba659f9342639598d9b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 14:05:34 +0200 Subject: [PATCH 489/789] Patching tests to make them pass on all platforms. mysql-test/include/rpl_udf.inc: Adding a replace on the slave side as well to make test pass on both Unix and Windows. mysql-test/r/rpl_udf.result: Result change --- mysql-test/include/rpl_udf.inc | 1 + mysql-test/r/rpl_udf.result | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc index 424bacc4216..d9e19cda484 100644 --- a/mysql-test/include/rpl_udf.inc +++ b/mysql-test/include/rpl_udf.inc @@ -45,6 +45,7 @@ sync_with_master; # Check to see that UDF CREATE statements were replicated --echo "Running on the slave" --enable_info +--replace_column 3 UDF_LIB SELECT * FROM mysql.func; --disable_info diff --git a/mysql-test/r/rpl_udf.result b/mysql-test/r/rpl_udf.result index 856e92cee26..6587632bca0 100644 --- a/mysql-test/r/rpl_udf.result +++ b/mysql-test/r/rpl_udf.result @@ -22,8 +22,8 @@ affected rows: 2 "Running on the slave" SELECT * FROM mysql.func; name ret dl type -myfunc_double 1 udf_example.so function -myfunc_int 2 udf_example.so function +myfunc_double 1 UDF_LIB function +myfunc_int 2 UDF_LIB function affected rows: 2 "Running on the master" CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; @@ -174,8 +174,8 @@ affected rows: 2 "Running on the slave" SELECT * FROM mysql.func; name ret dl type -myfunc_int 2 udf_example.so function -myfunc_double 1 udf_example.so function +myfunc_int 2 UDF_LIB function +myfunc_double 1 UDF_LIB function affected rows: 2 "Running on the master" CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; From ccc65d8eb5dbe4bb260e07b261c0c976952d0dac Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 15:29:30 +0200 Subject: [PATCH 490/789] WL#3464 (Add replication event to denote gap in replication): Fixing automerge problem and updating comments referring to exec_event(). mysql-test/r/rpl_incident.result: Result change sql/log_event.cc: Renaming exec_event() to do_apply_event(). sql/log_event.h: Renaming exec_event() to do_apply_event(). sql/rpl_rli.cc: Fixing comments referring to exec_event(), which does not exist any more. sql/sql_class.h: Fixing comments referring to exec_event(), which does not exist any more. --- mysql-test/r/rpl_incident.result | 2 +- sql/log_event.cc | 4 ++-- sql/log_event.h | 2 +- sql/rpl_rli.cc | 6 +++--- sql/sql_class.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/r/rpl_incident.result index 5becaf37068..70086c1e848 100644 --- a/mysql-test/r/rpl_incident.result +++ b/mysql-test/r/rpl_incident.result @@ -47,7 +47,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1583 +Last_Errno 1586 Last_Error The incident LOST_EVENTS occured on the master. Message: Skip_Counter 0 Exec_Master_Log_Pos # diff --git a/sql/log_event.cc b/sql/log_event.cc index 661eafd976f..e3c94b5e1c9 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7956,9 +7956,9 @@ Incident_log_event::print(FILE *file, #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) int -Incident_log_event::exec_event(st_relay_log_info *rli) +Incident_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { - DBUG_ENTER("Incident_log_event::exec_event"); + DBUG_ENTER("Incident_log_event::do_apply_event"); slave_print_msg(ERROR_LEVEL, rli, ER_SLAVE_INCIDENT, ER(ER_SLAVE_INCIDENT), description(), diff --git a/sql/log_event.h b/sql/log_event.h index 500f3533c92..51543291621 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2588,7 +2588,7 @@ public: #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual int exec_event(struct st_relay_log_info *rli); + virtual int do_apply_event(RELAY_LOG_INFO const *rli); #endif virtual bool write_data_header(IO_CACHE *file); diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 16e13f049e3..b0db355154e 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -969,7 +969,7 @@ err: strtol() conversions needed for log names comparison. We don't need to compare them each time this function is called, we only need to do this when current log name changes. If we have UNTIL_MASTER_POS condition we - need to do this only after Rotate_log_event::exec_event() (which is + need to do this only after Rotate_log_event::do_apply_event() (which is rare, so caching gives real benifit), and if we have UNTIL_RELAY_POS condition then we should invalidate cached comarison value after inc_group_relay_log_pos() which called for each group of events (so we @@ -1093,12 +1093,12 @@ void st_relay_log_info::cleanup_context(THD *thd, bool error) DBUG_ASSERT(sql_thd == thd); /* - 1) Instances of Table_map_log_event, if ::exec_event() was called on them, + 1) Instances of Table_map_log_event, if ::do_apply_event() was called on them, may have opened tables, which we cannot be sure have been closed (because maybe the Rows_log_event have not been found or will not be, because slave SQL thread is stopping, or relay log has a missing tail etc). So we close all thread's tables. And so the table mappings have to be cancelled. - 2) Rows_log_event::exec_event() may even have started statements or + 2) Rows_log_event::do_apply_event() may even have started statements or transactions on them, which we need to rollback in case of error. 3) If finding a Format_description_log_event after a BEGIN, we also need to rollback before continuing with the next events. diff --git a/sql/sql_class.h b/sql/sql_class.h index a9915fce4ef..dc282586c86 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1270,7 +1270,7 @@ public: return first_successful_insert_id_in_prev_stmt; } /* - Used by Intvar_log_event::exec_event() and by "SET INSERT_ID=#" + Used by Intvar_log_event::do_apply_event() and by "SET INSERT_ID=#" (mysqlbinlog). We'll soon add a variant which can take many intervals in argument. */ From 62d3063dc18d6251b55911af7d15163ab4adaab1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 15:43:36 +0200 Subject: [PATCH 491/789] Bug#25657 mysql-test-run.pl kill itself under ActiveState perl - Read the pid from pidfile in order to be able to kill the real process instead of the pseudo process. Most platforms will have the same real_pid as pid - Kill using the real pid mysql-test/lib/mtr_process.pl: Kill using the "real_pid" mysql-test/mysql-test-run.pl: Read the pid from pidfile in order to be able to kill the real process instead of the pseudo process. Most platforms will have the same real_pid as pid --- mysql-test/lib/mtr_process.pl | 25 +++++++++++++++---------- mysql-test/mysql-test-run.pl | 17 +++++++++++++---- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 53bf37bcc83..b20c9b65dd5 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -562,7 +562,7 @@ sub mtr_check_stop_servers ($) { # Return if no processes are defined return if ! @$spec; - #mtr_report("mtr_check_stop_servers"); + mtr_verbose("mtr_check_stop_servers"); mtr_ping_with_timeout(\@$spec); @@ -605,7 +605,10 @@ sub mtr_check_stop_servers ($) { { if ( $srv->{'pid'} ) { - $mysqld_pids{$srv->{'pid'}}= 1; + # Add the process pid to list of pids to kill + # if the process has a "real_pid" use it + $mysqld_pids{$srv->{'real_pid'} ? + $srv->{'real_pid'} : $srv->{'pid'}}= 1; } else { @@ -638,13 +641,9 @@ sub mtr_check_stop_servers ($) { # that for true Win32 processes, kill(0,$pid) will not return 1. # ---------------------------------------------------------------------- - start_reap_all(); # Avoid zombies - my @mysqld_pids= keys %mysqld_pids; mtr_kill_processes(\@mysqld_pids); - stop_reap_all(); # Get into control again - # ---------------------------------------------------------------------- # Now, we check if all we can find using kill(0,$pid) are dead, # and just assume the rest are. We cleanup socket and PID files. @@ -654,14 +653,15 @@ sub mtr_check_stop_servers ($) { my $errors= 0; foreach my $srv ( @$spec ) { - if ( $srv->{'pid'} ) + my $pid= $srv->{'real_pid'} ? $srv->{'real_pid'} : $srv->{'pid'}; + if ( $pid ) { - if ( kill(0,$srv->{'pid'}) ) + if ( kill(0, $pid) ) { # FIXME In Cygwin there seem to be some fast reuse # of PIDs, so dying may not be the right thing to do. $errors++; - mtr_warning("can't kill process $srv->{'pid'}"); + mtr_warning("can't kill process $pid"); } else { @@ -682,6 +682,8 @@ sub mtr_check_stop_servers ($) { mtr_warning("couldn't delete $file"); } } + # Reap the child + waitpid($srv->{'pid'},&WNOHANG); $srv->{'pid'}= 0; } } @@ -1063,7 +1065,10 @@ sub sleep_until_file_created ($$$) { { if ( -r $pidfile ) { - return $pid; + # Read real pid from pidfile + my $real_pid= mtr_fromfile($pidfile); + mtr_verbose("pid: $pid, real_pid: $real_pid"); + return $real_pid; } # Check if it died after the fork() was successful diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3166672dd89..70e51c288f4 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2549,10 +2549,16 @@ sub ndbcluster_wait_started($$){ sub mysqld_wait_started($){ my $mysqld= shift; - my $res= sleep_until_file_created($mysqld->{'path_pid'}, - $mysqld->{'start_timeout'}, - $mysqld->{'pid'}); - return $res == 0; + my $pid_from_pidfile= + sleep_until_file_created($mysqld->{'path_pid'}, + $mysqld->{'start_timeout'}, + $mysqld->{'pid'}); + + # On platforms with pseudo threads we need to save + # the real pid of mysqld read from pidfile + $mysqld->{'real_pid'}= $pid_from_pidfile; + + return $pid_from_pidfile == 0; } @@ -4047,6 +4053,7 @@ sub stop_all_servers () { push(@kill_pids,{ pid => $mysqld->{'pid'}, + real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, @@ -4253,6 +4260,7 @@ sub run_testcase_stop_servers($$$) { push(@kill_pids,{ pid => $mysqld->{'pid'}, + real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, @@ -4303,6 +4311,7 @@ sub run_testcase_stop_servers($$$) { push(@kill_pids,{ pid => $mysqld->{'pid'}, + real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, From 86a0ffdd3c068edc63e3bda21d88980699c451dd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 18:13:33 +0400 Subject: [PATCH 492/789] Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. In the NO_AUTO_VALUE_ON_ZERO mode the table->auto_increment_field_not_null variable is used to indicate that a non-NULL value was specified by the user for an auto_increment column. When an INSERT .. ON DUPLICATE updates the auto_increment field this variable is set to true and stays unchanged for the next insert operation. This makes the next inserted row sometimes wrongly have 0 as the value of the auto_increment field. Now the fill_record() function resets the table->auto_increment_field_not_null variable before filling the record. The table->auto_increment_field_not_null variable is also reset by the open_table() function for a case if we missed some auto_increment_field_not_null handling bug. Now the table->auto_increment_field_not_null is reset at the end of the mysql_load() function. Reset the table->auto_increment_field_not_null variable after each write_row() call in the copy_data_between_tables() function. sql/field_conv.cc: Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. A comment is corrected. sql/handler.cc: Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. Now the handler::update_auto_increment() function doesn't reset the table->auto_increment_field_not_null variable as it is done in the fill_record() function. sql/sql_base.cc: Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. Now the fill_record() function resets the table->auto_increment_field_not_null variable before filling the record. The table->auto_increment_field_not_null variable is also reset by the open_table() function for a case if we missed some auto_increment_field_not_null handling bug. sql/sql_insert.cc: Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. Now the the table->auto_increment_field_not_null is reset at the end of the mysql_insert() an in the select_insert class destructor. sql/sql_load.cc: Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. Now the table->auto_increment_field_not_null is reset at the end of the mysql_load() function. sql/sql_table.cc: Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. Reset the table->auto_increment_field_not_null variable after each write_row() call in the copy_data_between_tables() function. sql/table.h: Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. A comment added. mysql-test/r/insert_update.result: Added the test case for the bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. mysql-test/t/insert_update.test: Added the test case for the bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode. --- mysql-test/r/insert_update.result | 78 +++++++++++++++++++++++++++++++ mysql-test/t/insert_update.test | 52 +++++++++++++++++++++ sql/field_conv.cc | 2 +- sql/handler.cc | 6 +-- sql/sql_base.cc | 67 ++++++++++++++++++++++++-- sql/sql_insert.cc | 2 + sql/sql_load.cc | 3 +- sql/sql_table.cc | 4 +- sql/table.h | 5 ++ 9 files changed, 205 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index ef0d8ec239e..fd70fcb9084 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -258,3 +258,81 @@ SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 1 DROP TABLE t1; +SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; +CREATE TABLE `t1` ( +`id` int(11) PRIMARY KEY auto_increment, +`f1` varchar(10) NOT NULL UNIQUE +); +INSERT IGNORE INTO t1 (f1) VALUES ("test1") +ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +INSERT IGNORE INTO t1 (f1) VALUES ("test1") +ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +id f1 +1 test1 +INSERT IGNORE INTO t1 (f1) VALUES ("test2") +ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT * FROM t1; +id f1 +1 test1 +2 test2 +INSERT IGNORE INTO t1 (f1) VALUES ("test2") +ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2 +SELECT * FROM t1; +id f1 +1 test1 +2 test2 +INSERT IGNORE INTO t1 (f1) VALUES ("test3") +ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3 +SELECT * FROM t1; +id f1 +1 test1 +2 test2 +3 test3 +DROP TABLE t1; +CREATE TABLE `t1` ( +`id` int(11) PRIMARY KEY auto_increment, +`f1` varchar(10) NOT NULL UNIQUE +); +INSERT IGNORE INTO t1 (f1) VALUES ("test1") +ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +id f1 +1 test1 +INSERT IGNORE INTO t1 (f1) VALUES ("test1"),("test4") +ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +id f1 +1 test1 +2 test4 +DROP TABLE t1; +CREATE TABLE `t1` ( +`id` int(11) PRIMARY KEY auto_increment, +`f1` varchar(10) NOT NULL UNIQUE, +tim1 timestamp default '2003-01-01 00:00:00' on update current_timestamp +); +INSERT INTO t1 (f1) VALUES ("test1"); +SELECT id, f1 FROM t1; +id f1 +1 test1 +REPLACE INTO t1 VALUES (0,"test1",null); +SELECT id, f1 FROM t1; +id f1 +0 test1 +DROP TABLE t1; +SET SQL_MODE=''; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index b0de66f7fc6..76df4502769 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -195,3 +195,55 @@ SELECT LAST_INSERT_ID(); INSERT t1 (f2) VALUES ('test') ON DUPLICATE KEY UPDATE f1 = LAST_INSERT_ID(f1); SELECT LAST_INSERT_ID(); DROP TABLE t1; + +# +# Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the +# NO_AUTO_VALUE_ON_ZERO mode. +# +SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; +CREATE TABLE `t1` ( + `id` int(11) PRIMARY KEY auto_increment, + `f1` varchar(10) NOT NULL UNIQUE +); +INSERT IGNORE INTO t1 (f1) VALUES ("test1") + ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +INSERT IGNORE INTO t1 (f1) VALUES ("test1") + ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +INSERT IGNORE INTO t1 (f1) VALUES ("test2") + ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT * FROM t1; +INSERT IGNORE INTO t1 (f1) VALUES ("test2") + ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +INSERT IGNORE INTO t1 (f1) VALUES ("test3") + ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE `t1` ( + `id` int(11) PRIMARY KEY auto_increment, + `f1` varchar(10) NOT NULL UNIQUE +); +INSERT IGNORE INTO t1 (f1) VALUES ("test1") + ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +INSERT IGNORE INTO t1 (f1) VALUES ("test1"),("test4") + ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +SELECT LAST_INSERT_ID(); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE `t1` ( + `id` int(11) PRIMARY KEY auto_increment, + `f1` varchar(10) NOT NULL UNIQUE, + tim1 timestamp default '2003-01-01 00:00:00' on update current_timestamp +); +INSERT INTO t1 (f1) VALUES ("test1"); +SELECT id, f1 FROM t1; +REPLACE INTO t1 VALUES (0,"test1",null); +SELECT id, f1 FROM t1; +DROP TABLE t1; +SET SQL_MODE=''; diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 32180f0a93e..429d914db97 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -173,7 +173,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions) if (field == field->table->next_number_field) { field->table->auto_increment_field_not_null= FALSE; - return 0; // field is set in handler.cc + return 0; // field is set in fill_record() } if (current_thd->count_cuted_fields == CHECK_FIELD_WARN) { diff --git a/sql/handler.cc b/sql/handler.cc index 524f47209dc..6cba079e736 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1598,7 +1598,6 @@ int handler::update_auto_increment() ulonglong nr; THD *thd= table->in_use; struct system_variables *variables= &thd->variables; - bool auto_increment_field_not_null; DBUG_ENTER("handler::update_auto_increment"); /* @@ -1606,14 +1605,11 @@ int handler::update_auto_increment() row was not inserted */ thd->prev_insert_id= thd->next_insert_id; - auto_increment_field_not_null= table->auto_increment_field_not_null; - table->auto_increment_field_not_null= FALSE; if ((nr= table->next_number_field->val_int()) != 0 || - auto_increment_field_not_null && + table->auto_increment_field_not_null && thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO) { - /* Clear flag for next row */ /* Mark that we didn't generate a new value **/ auto_increment_column_changed=0; adjust_next_insert_id_after_explicit_value(nr); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 97cb2d00689..1689e5c65c0 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1640,6 +1640,9 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table->used_keys= table->s->keys_for_keyread; table->fulltext_searched= 0; table->file->ft_handler= 0; + /* Catch wrong handling of the auto_increment_field_not_null. */ + DBUG_ASSERT(!table->auto_increment_field_not_null); + table->auto_increment_field_not_null= FALSE; if (table->timestamp_field) table->timestamp_field_type= table->timestamp_field->get_auto_set_type(); table->pos_in_table_list= table_list; @@ -5272,6 +5275,11 @@ err_no_arena: values values to fill with ignore_errors TRUE if we should ignore errors + NOTE + fill_record() may set table->auto_increment_field_not_null and a + caller should make sure that it is reset after their last call to this + function. + RETURN FALSE OK TRUE error occured @@ -5284,27 +5292,52 @@ fill_record(THD * thd, List &fields, List &values, List_iterator_fast f(fields),v(values); Item *value, *fld; Item_field *field; + TABLE *table= 0; DBUG_ENTER("fill_record"); + /* + Reset the table->auto_increment_field_not_null as it is valid for + only one row. + */ + if (fields.elements) + { + /* + On INSERT or UPDATE fields are checked to be from the same table, + thus we safely can take table from the first field. + */ + fld= (Item_field*)f++; + if (!(field= fld->filed_for_view_update())) + { + my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), fld->name); + goto err; + } + table= field->field->table; + table->auto_increment_field_not_null= FALSE; + f.rewind(); + } while ((fld= f++)) { if (!(field= fld->filed_for_view_update())) { my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), fld->name); - DBUG_RETURN(TRUE); + goto err; } value=v++; Field *rfield= field->field; - TABLE *table= rfield->table; + table= rfield->table; if (rfield == table->next_number_field) table->auto_increment_field_not_null= TRUE; if ((value->save_in_field(rfield, 0) < 0) && !ignore_errors) { my_message(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), MYF(0)); - DBUG_RETURN(TRUE); + goto err; } } DBUG_RETURN(thd->net.report_error); +err: + if (table) + table->auto_increment_field_not_null= FALSE; + DBUG_RETURN(TRUE); } @@ -5353,6 +5386,11 @@ fill_record_n_invoke_before_triggers(THD *thd, List &fields, values list of fields ignore_errors TRUE if we should ignore errors + NOTE + fill_record() may set table->auto_increment_field_not_null and a + caller should make sure that it is reset after their last call to this + function. + RETURN FALSE OK TRUE error occured @@ -5363,19 +5401,38 @@ fill_record(THD *thd, Field **ptr, List &values, bool ignore_errors) { List_iterator_fast v(values); Item *value; + TABLE *table= 0; DBUG_ENTER("fill_record"); Field *field; + /* + Reset the table->auto_increment_field_not_null as it is valid for + only one row. + */ + if (*ptr) + { + /* + On INSERT or UPDATE fields are checked to be from the same table, + thus we safely can take table from the first field. + */ + table= (*ptr)->table; + table->auto_increment_field_not_null= FALSE; + } while ((field = *ptr++)) { value=v++; - TABLE *table= field->table; + table= field->table; if (field == table->next_number_field) table->auto_increment_field_not_null= TRUE; if (value->save_in_field(field, 0) == -1) - DBUG_RETURN(TRUE); + goto err; } DBUG_RETURN(thd->net.report_error); + +err: + if (table) + table->auto_increment_field_not_null= FALSE; + DBUG_RETURN(TRUE); } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d9d32d14321..0fa027f89d6 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -757,6 +757,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, table->next_number_field=0; thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->next_insert_id=0; // Reset this if wrongly used + table->auto_increment_field_not_null= FALSE; if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); if (duplic == DUP_REPLACE && @@ -2571,6 +2572,7 @@ select_insert::~select_insert() if (table) { table->next_number_field=0; + table->auto_increment_field_not_null= FALSE; table->file->reset(); } thd->count_cuted_fields= CHECK_FIELD_IGNORE; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 3f67a0c3f5d..7a535381c01 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -493,6 +493,7 @@ err: mysql_unlock_tables(thd, thd->lock); thd->lock=0; } + table->auto_increment_field_not_null= FALSE; thd->abort_on_warning= 0; DBUG_RETURN(error); } @@ -589,8 +590,6 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, { uint length; byte save_chr; - if (field == table->next_number_field) - table->auto_increment_field_not_null= TRUE; if ((length=(uint) (read_info.row_end-pos)) > field->field_length) length=field->field_length; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c75aff7fab6..8b3028f5370 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4058,7 +4058,9 @@ copy_data_between_tables(TABLE *from,TABLE *to, { copy_ptr->do_copy(copy_ptr); } - if ((error=to->file->write_row((byte*) to->record[0]))) + error=to->file->write_row((byte*) to->record[0]); + to->auto_increment_field_not_null= FALSE; + if (error) { if (!ignore || (error != HA_ERR_FOUND_DUPP_KEY && diff --git a/sql/table.h b/sql/table.h index e2bd5ba0a7d..b795fa78e51 100644 --- a/sql/table.h +++ b/sql/table.h @@ -273,6 +273,11 @@ struct st_table { my_bool no_cache; /* To signal that we should reset query_id for tables and cols */ my_bool clear_query_id; + /* + To indicate that a non-null value of the auto_increment field + was provided by the user or retrieved from the current record. + Used only in the MODE_NO_AUTO_VALUE_ON_ZERO mode. + */ my_bool auto_increment_field_not_null; my_bool insert_or_update; /* Can be used by the handler */ my_bool alias_name_used; /* true if table_name is alias */ From a632339f482aa642ecc2b8baaa20eb9c22d5abcf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 16:43:15 +0200 Subject: [PATCH 493/789] Cset exclude: msvensson@shellback.(none)|ChangeSet|20070330134336|02280 mysql-test/lib/mtr_process.pl: Exclude mysql-test/mysql-test-run.pl: Exclude --- mysql-test/lib/mtr_process.pl | 25 ++++++++++--------------- mysql-test/mysql-test-run.pl | 17 ++++------------- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index b20c9b65dd5..53bf37bcc83 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -562,7 +562,7 @@ sub mtr_check_stop_servers ($) { # Return if no processes are defined return if ! @$spec; - mtr_verbose("mtr_check_stop_servers"); + #mtr_report("mtr_check_stop_servers"); mtr_ping_with_timeout(\@$spec); @@ -605,10 +605,7 @@ sub mtr_check_stop_servers ($) { { if ( $srv->{'pid'} ) { - # Add the process pid to list of pids to kill - # if the process has a "real_pid" use it - $mysqld_pids{$srv->{'real_pid'} ? - $srv->{'real_pid'} : $srv->{'pid'}}= 1; + $mysqld_pids{$srv->{'pid'}}= 1; } else { @@ -641,9 +638,13 @@ sub mtr_check_stop_servers ($) { # that for true Win32 processes, kill(0,$pid) will not return 1. # ---------------------------------------------------------------------- + start_reap_all(); # Avoid zombies + my @mysqld_pids= keys %mysqld_pids; mtr_kill_processes(\@mysqld_pids); + stop_reap_all(); # Get into control again + # ---------------------------------------------------------------------- # Now, we check if all we can find using kill(0,$pid) are dead, # and just assume the rest are. We cleanup socket and PID files. @@ -653,15 +654,14 @@ sub mtr_check_stop_servers ($) { my $errors= 0; foreach my $srv ( @$spec ) { - my $pid= $srv->{'real_pid'} ? $srv->{'real_pid'} : $srv->{'pid'}; - if ( $pid ) + if ( $srv->{'pid'} ) { - if ( kill(0, $pid) ) + if ( kill(0,$srv->{'pid'}) ) { # FIXME In Cygwin there seem to be some fast reuse # of PIDs, so dying may not be the right thing to do. $errors++; - mtr_warning("can't kill process $pid"); + mtr_warning("can't kill process $srv->{'pid'}"); } else { @@ -682,8 +682,6 @@ sub mtr_check_stop_servers ($) { mtr_warning("couldn't delete $file"); } } - # Reap the child - waitpid($srv->{'pid'},&WNOHANG); $srv->{'pid'}= 0; } } @@ -1065,10 +1063,7 @@ sub sleep_until_file_created ($$$) { { if ( -r $pidfile ) { - # Read real pid from pidfile - my $real_pid= mtr_fromfile($pidfile); - mtr_verbose("pid: $pid, real_pid: $real_pid"); - return $real_pid; + return $pid; } # Check if it died after the fork() was successful diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 70e51c288f4..3166672dd89 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2549,16 +2549,10 @@ sub ndbcluster_wait_started($$){ sub mysqld_wait_started($){ my $mysqld= shift; - my $pid_from_pidfile= - sleep_until_file_created($mysqld->{'path_pid'}, - $mysqld->{'start_timeout'}, - $mysqld->{'pid'}); - - # On platforms with pseudo threads we need to save - # the real pid of mysqld read from pidfile - $mysqld->{'real_pid'}= $pid_from_pidfile; - - return $pid_from_pidfile == 0; + my $res= sleep_until_file_created($mysqld->{'path_pid'}, + $mysqld->{'start_timeout'}, + $mysqld->{'pid'}); + return $res == 0; } @@ -4053,7 +4047,6 @@ sub stop_all_servers () { push(@kill_pids,{ pid => $mysqld->{'pid'}, - real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, @@ -4260,7 +4253,6 @@ sub run_testcase_stop_servers($$$) { push(@kill_pids,{ pid => $mysqld->{'pid'}, - real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, @@ -4311,7 +4303,6 @@ sub run_testcase_stop_servers($$$) { push(@kill_pids,{ pid => $mysqld->{'pid'}, - real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, From 76678a48e2df70b9ff3ae44e4de9c8c0e9a743e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 15:01:03 +0000 Subject: [PATCH 494/789] BUG#24793 Add SO_KEEPALIVE socket option to avoid cluster nodes keeping dead connections forever. ndb/src/common/transporter/TCP_Transporter.cpp: Add SO_KEEPALIVE socket option --- ndb/src/common/transporter/TCP_Transporter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 91a5fb50c57..897bad8b787 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -155,6 +155,8 @@ TCP_Transporter::initTransporter() { void TCP_Transporter::setSocketOptions(){ + int sockOptKeepAlive = 1; + if (setsockopt(theSocket, SOL_SOCKET, SO_RCVBUF, (char*)&sockOptRcvBufSize, sizeof(sockOptRcvBufSize)) < 0) { #ifdef DEBUG_TRANSPORTER @@ -169,6 +171,11 @@ TCP_Transporter::setSocketOptions(){ #endif }//if + if (setsockopt(theSocket, SOL_SOCKET, SO_KEEPALIVE, + (char*)&sockOptKeepAlive, sizeof(sockOptKeepAlive)) < 0) { + ndbout_c("The setsockopt SO_KEEPALIVE error code = %d", InetErrno); + }//if + //----------------------------------------------- // Set the TCP_NODELAY option so also small packets are sent // as soon as possible From c0b96432fac04e80b021f34a4010c6baded336ea Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 11:08:19 -0400 Subject: [PATCH 495/789] WL#3629 - Replication of Invocation and Invoked Features This patch removes the SLAVESIDE_DISABLED token from the event status clause and adds the ability to mark an event as status = SLAVESIDE_DISABLED by using the syntax DISABLE ON SLAVE instead. The patch also adds tests to rpl_events to check the new syntax. mysql-test/include/rpl_events.inc: WL#3629 - Replication of Invocation and Invoked Features This patch adds tests to check the SQL syntax change from SLAVESIDE_DISABLED to DISABLE ON SLAVE. mysql-test/r/rpl_events.result: WL#3629 - Replication of Invocation and Invoked Features This patch adds the results for the tests to check the SQL syntax change from SLAVESIDE_DISABLED to DISABLE ON SLAVE. sql/lex.h: WL#3629 - Replication of Invocation and Invoked Features This patch removes the SLAVESIDE_DISABLED token. sql/sql_yacc.yy: WL#3629 - Replication of Invocation and Invoked Features This patch removes the SLAVESIDE_DISABLED token from the event status clause and adds the ability to mark an event as status = SLAVESIDE_DISABLED by using the syntax DISABLE ON SLAVE instead. --- mysql-test/include/rpl_events.inc | 18 ++++++++++++++++-- mysql-test/r/rpl_events.result | 30 ++++++++++++++++++++++++++---- sql/lex.h | 1 - sql/sql_yacc.yy | 2 +- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc index b8fac61c383..d94a69ad60d 100644 --- a/mysql-test/include/rpl_events.inc +++ b/mysql-test/include/rpl_events.inc @@ -15,8 +15,7 @@ drop table if exists t1,t2; eval CREATE TABLE `t1` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `c` VARCHAR(50) NOT NULL, - `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE -CURRENT_TIMESTAMP, + `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=$engine_type DEFAULT CHARSET=utf8; @@ -99,6 +98,21 @@ sync_slave_with_master; --echo "in the slave" SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; +# test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status +# on CREATE EVENT + +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND +DO INSERT INTO t1(c) VALUES ('from slave_terminate'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; + +DROP EVENT test.slave_terminate; + +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND +DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; + +DROP EVENT test.slave_terminate; + --echo "in the master" connection master; DROP TABLE t1; diff --git a/mysql-test/r/rpl_events.result b/mysql-test/r/rpl_events.result index 332d8cf1c0c..1233ab1b9d2 100644 --- a/mysql-test/r/rpl_events.result +++ b/mysql-test/r/rpl_events.result @@ -11,8 +11,7 @@ drop table if exists t1,t2; CREATE TABLE `t1` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `c` VARCHAR(50) NOT NULL, -`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE -CURRENT_TIMESTAMP, +`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO t1 (c) VALUES ('manually'); @@ -69,6 +68,18 @@ db name status originator "in the slave" SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND +DO INSERT INTO t1(c) VALUES ('from slave_terminate'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; +db name status originator +test slave_terminate ENABLED 2 +DROP EVENT test.slave_terminate; +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND +DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; +db name status originator +test slave_terminate SLAVESIDE_DISABLED 2 +DROP EVENT test.slave_terminate; "in the master" DROP TABLE t1; set binlog_format=statement; @@ -77,8 +88,7 @@ drop table if exists t1,t2; CREATE TABLE `t1` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `c` VARCHAR(50) NOT NULL, -`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE -CURRENT_TIMESTAMP, +`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO t1 (c) VALUES ('manually'); @@ -135,5 +145,17 @@ db name status originator "in the slave" SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND +DO INSERT INTO t1(c) VALUES ('from slave_terminate'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; +db name status originator +test slave_terminate ENABLED 2 +DROP EVENT test.slave_terminate; +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND +DISABLE ON SLAVE DO INSERT INTO t1(c) VALUES ('from slave_terminate'); +SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; +db name status originator +test slave_terminate SLAVESIDE_DISABLED 2 +DROP EVENT test.slave_terminate; "in the master" DROP TABLE t1; diff --git a/sql/lex.h b/sql/lex.h index 6e0f1c711f2..45155da7692 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -467,7 +467,6 @@ static SYMBOL symbols[] = { { "SIGNED", SYM(SIGNED_SYM)}, { "SIMPLE", SYM(SIMPLE_SYM)}, { "SLAVE", SYM(SLAVE)}, - { "SLAVESIDE_DISABLE", SYM(SLAVESIDE_DISABLE_SYM)}, { "SNAPSHOT", SYM(SNAPSHOT_SYM)}, { "SMALLINT", SYM(SMALLINT)}, { "SOCKET", SYM(SOCKET_SYM)}, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 03123617e33..36b09224796 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1774,7 +1774,7 @@ opt_ev_status: /* empty */ { $$= 0; } Lex->event_parse_data->status= Event_basic::ENABLED; $$= 1; } - | SLAVESIDE_DISABLE_SYM + | DISABLE_SYM ON SLAVE { Lex->event_parse_data->status= Event_basic::SLAVESIDE_DISABLED; $$= 1; From e950594efec94a302f1e33afb099de53f3c2b50e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 12:16:48 -0400 Subject: [PATCH 496/789] This patch includes modification to the rpl_events test to limit the SELECT in the test to only the expected rows. This helps eliminate the possibility of spurious rows causing the test to fail. mysql-test/r/rpl_events.result: This patch modifies the test results to match the new SELECT for test results. --- mysql-test/include/rpl_events.inc | 4 ++-- mysql-test/r/rpl_events.result | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc index d94a69ad60d..04885f31997 100644 --- a/mysql-test/include/rpl_events.inc +++ b/mysql-test/include/rpl_events.inc @@ -34,7 +34,7 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name --echo "in the master" --enable_info --replace_column 3 TIMESTAMP -SELECT * FROM t1; +SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id; --disable_info sync_slave_with_master; @@ -42,7 +42,7 @@ sync_slave_with_master; --echo "in the slave" --enable_info --replace_column 3 TIMESTAMP -SELECT * FROM t1; +SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id; --disable_info SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; diff --git a/mysql-test/r/rpl_events.result b/mysql-test/r/rpl_events.result index 1233ab1b9d2..bff1a814a6d 100644 --- a/mysql-test/r/rpl_events.result +++ b/mysql-test/r/rpl_events.result @@ -21,13 +21,13 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name db name status originator test justonce ENABLED 1 "in the master" -SELECT * FROM t1; +SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id; id c ts 1 manually TIMESTAMP 2 from justonce TIMESTAMP affected rows: 2 "in the slave" -SELECT * FROM t1; +SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id; id c ts 1 manually TIMESTAMP 2 from justonce TIMESTAMP @@ -98,13 +98,13 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name db name status originator test justonce ENABLED 1 "in the master" -SELECT * FROM t1; +SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id; id c ts 1 manually TIMESTAMP 2 from justonce TIMESTAMP affected rows: 2 "in the slave" -SELECT * FROM t1; +SELECT * FROM t1 WHERE c = 'from justonce' OR c = 'manually' ORDER BY id; id c ts 1 manually TIMESTAMP 2 from justonce TIMESTAMP From c3e420cf342eda2a7047d543dc95b8a64b704a6d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Mar 2007 12:25:39 -0400 Subject: [PATCH 497/789] This patch adds IF EXISTS to the drop of start_n_end to avoid a problem on some build machines during testing. mysql-test/t/events_scheduling.test: This patch alters result file to match the DROP IF EXISTS that was changed in the test. --- mysql-test/r/events_scheduling.result | 2 +- mysql-test/t/events_scheduling.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result index d885dc3a048..12f270748a6 100644 --- a/mysql-test/r/events_scheduling.result +++ b/mysql-test/r/events_scheduling.result @@ -69,7 +69,7 @@ OK SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') OK -DROP EVENT start_n_end; +DROP EVENT IF EXISTS events_test.start_n_end; "Already dropped because ended. Therefore an error." DROP EVENT only_one_time; ERROR HY000: Unknown event 'only_one_time' diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index e3b55685e65..f7d4c3c14d6 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -51,7 +51,7 @@ SELECT IF(SUM(a) > 0, 'OK', 'ERROR') FROM table_4; DROP EVENT two_sec; SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; -DROP EVENT start_n_end; +DROP EVENT IF EXISTS events_test.start_n_end; --echo "Already dropped because ended. Therefore an error." --error ER_EVENT_DOES_NOT_EXIST DROP EVENT only_one_time; From 080c0c7ac8df45e6d6eb544e611183d029f4fb63 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 00:29:18 +0400 Subject: [PATCH 498/789] BUG#26624: high mem usage (crash) in range optimizer Pushbuild fixes: - Make MAX_SEL_ARGS smaller (even 16K records_in_range() calls is more than it makes sense to do in typical cases) - Don't call sel_arg->test_use_count() if we've already allocated more than MAX_SEL_ARGs elements. The test will succeed but will take too much time for the test suite (and not provide much value). mysql-test/r/range.result: BUG#26624: high mem usage (crash) in range optimizer Pushbuild fixes: make the test go faster mysql-test/t/range.test: BUG#26624: high mem usage (crash) in range optimizer Pushbuild fixes: make the test go faster --- mysql-test/r/range.result | 147 ++++++++++++++++++++++++++++++++----- mysql-test/t/range.test | 149 +++++++++++++++++++++++++++++++++----- sql/opt_range.cc | 8 +- 3 files changed, 265 insertions(+), 39 deletions(-) diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 15d5f1a0183..4aaa114c0f9 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -710,23 +710,136 @@ index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16) ); insert into t1 (c1) values ('1'),('1'),('1'),('1'); select * from t1 where -c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c11 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c12 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c13 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c14 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c15 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -and c16 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -; +c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC") +and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", +"abcdefg1", "123456781", "qwertyui1", "asddfg1", +"abcdefg2", "123456782", "qwertyui2", "asddfg2", +"abcdefg3", "123456783", "qwertyui3", "asddfg3", +"abcdefg4", "123456784", "qwertyui4", "asddfg4", +"abcdefg5", "123456785", "qwertyui5", "asddfg5", +"abcdefg6", "123456786", "qwertyui6", "asddfg6", +"abcdefg7", "123456787", "qwertyui7", "asddfg7", +"abcdefg8", "123456788", "qwertyui8", "asddfg8", +"abcdefg9", "123456789", "qwertyui9", "asddfg9", +"abcdefgA", "12345678A", "qwertyuiA", "asddfgA", +"abcdefgB", "12345678B", "qwertyuiB", "asddfgB", +"abcdefgC", "12345678C", "qwertyuiC", "asddfgC"); c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 drop table t1; End of 4.1 tests diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 1e4cb91c03f..0dbfde92bd5 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -571,28 +571,139 @@ create table t1 ( c13 char(10), c14 char(10), c15 char(10), c16 char(10), index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16) ); - insert into t1 (c1) values ('1'),('1'),('1'),('1'); # This must run without crash and fast: select * from t1 where - c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c11 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c12 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c13 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c14 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c15 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") - and c16 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh") -; + c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC") + and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", + "abcdefg1", "123456781", "qwertyui1", "asddfg1", + "abcdefg2", "123456782", "qwertyui2", "asddfg2", + "abcdefg3", "123456783", "qwertyui3", "asddfg3", + "abcdefg4", "123456784", "qwertyui4", "asddfg4", + "abcdefg5", "123456785", "qwertyui5", "asddfg5", + "abcdefg6", "123456786", "qwertyui6", "asddfg6", + "abcdefg7", "123456787", "qwertyui7", "asddfg7", + "abcdefg8", "123456788", "qwertyui8", "asddfg8", + "abcdefg9", "123456789", "qwertyui9", "asddfg9", + "abcdefgA", "12345678A", "qwertyuiA", "asddfgA", + "abcdefgB", "12345678B", "qwertyuiB", "asddfgB", + "abcdefgC", "12345678C", "qwertyuiC", "asddfgC"); drop table t1; - --echo End of 4.1 tests diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ca8f31f5775..01b366077b0 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -241,7 +241,7 @@ public: enum leaf_color { BLACK,RED } color; enum Type { IMPOSSIBLE, MAYBE, MAYBE_KEY, KEY_RANGE } type; - enum { MAX_SEL_ARGS = 64000 }; + enum { MAX_SEL_ARGS = 16000 }; SEL_ARG() {} SEL_ARG(SEL_ARG &); @@ -1640,7 +1640,8 @@ tree_and(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) { tree1->type= SEL_TREE::IMPOSSIBLE; #ifdef EXTRA_DEBUG - (*key1)->test_use_count(*key1); + if (param->alloced_sel_args < SEL_ARG::MAX_SEL_ARGS) + (*key1)->test_use_count(*key1); #endif break; } @@ -1677,7 +1678,8 @@ tree_or(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) { result=tree1; // Added to tree1 #ifdef EXTRA_DEBUG - (*key1)->test_use_count(*key1); + if (param->alloced_sel_args < SEL_ARG::MAX_SEL_ARGS) + (*key1)->test_use_count(*key1); #endif } } From f92433ae131d056191cd65753d56bd90c9ca5adc Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 02:57:26 +0400 Subject: [PATCH 499/789] item.cc, insert_update.result: After merge fix. mysql-test/r/insert_update.result: After merge fix. sql/item.cc: After merge fix. --- mysql-test/r/insert_update.result | 2 +- sql/item.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index ce0ec7025de..fed66ed47a7 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -315,7 +315,7 @@ INSERT IGNORE INTO t1 (f1) VALUES ("test1"),("test4") ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() -1 +2 SELECT * FROM t1; id f1 1 test1 diff --git a/sql/item.cc b/sql/item.cc index d4330710bbd..613b72ad05e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4370,7 +4370,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length) field= new Field_blob(max_length, maybe_null, name, collation.collation); break; // Blob handled outside of case case MYSQL_TYPE_GEOMETRY: - return new Field_geom(max_length, maybe_null, name, table, + return new Field_geom(max_length, maybe_null, name, table->s, (Field::geometry_type) ((Item_geometry_func *)this)->get_geometry_type()); } From f07077673cbc2cf38fc0cbb2e5cf068f609457ea Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 09:15:19 +0200 Subject: [PATCH 500/789] Test timeout --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index f229d11a45c..79f5a26574b 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -21,6 +21,7 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when up rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD +rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement From 7887a74491051d67fe0d780e19a62b5f055d07f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 00:23:03 -0700 Subject: [PATCH 501/789] Fixed bug #27154: memory corruption when using row equalities in where conditions. When allocating memory for KEY_FIELD/SARGABLE_PARAM structures the function update_ref_and_keys did not take into account the fact that a single row equality could be replaced by several simple equalities. Fixed by adjusting the counter cond_count accordingly for each subquery when performing substitution of a row equality for simple equalities. mysql-test/r/row.result: Added a test case for bug #27154. mysql-test/t/row.test: Added a test case for bug #27154. --- mysql-test/r/row.result | 13 ++++++++++++ mysql-test/t/row.test | 17 ++++++++++++++++ sql/sql_select.cc | 45 +++++++++++++++++++++++++++-------------- 3 files changed, 60 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 5b5f8b7b954..faf9b11d7c9 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -306,3 +306,16 @@ a b a b c 1 1 1 2 1 1 2 1 2 1 DROP TABLE t1,t2; +CREATE TABLE t1( +a int, b int, c int, d int, e int, f int, g int, h int, +PRIMARY KEY (a,b,c,d,e,f,g) +); +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,99); +SELECT h FROM t1 WHERE (a,b,c,d,e,f,g)=(1,2,3,4,5,6,7); +h +99 +SET @x:= (SELECT h FROM t1 WHERE (a,b,c,d,e,f,g)=(1,2,3,4,5,6,7)); +SELECT @x; +@x +99 +DROP TABLE t1; diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index 63c611e6be6..1d5c7a543ea 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -139,3 +139,20 @@ EXPLAIN EXTENDED SELECT * FROM t1,t2 WHERE t2.a=t1.a AND (t2.b,t2.c)=(2,1); SELECT * FROM t1,t2 WHERE t2.a=t1.a AND (t2.b,t2.c)=(2,1); DROP TABLE t1,t2; + +# +# Bug #27154: crash (memory corruption) when using row equalities +# + +CREATE TABLE t1( + a int, b int, c int, d int, e int, f int, g int, h int, + PRIMARY KEY (a,b,c,d,e,f,g) +); +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,99); + +SELECT h FROM t1 WHERE (a,b,c,d,e,f,g)=(1,2,3,4,5,6,7); + +SET @x:= (SELECT h FROM t1 WHERE (a,b,c,d,e,f,g)=(1,2,3,4,5,6,7)); +SELECT @x; + +DROP TABLE t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 08780efbedb..27e19657935 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6947,6 +6947,7 @@ static bool check_simple_equality(Item *left_item, Item *right_item, SYNOPSIS check_row_equality() + thd thread handle left_row left term of the row equality to be processed right_row right term of the row equality to be processed cond_equal multiple equalities that must hold together with the predicate @@ -6967,7 +6968,7 @@ static bool check_simple_equality(Item *left_item, Item *right_item, FALSE otherwise */ -static bool check_row_equality(Item *left_row, Item_row *right_row, +static bool check_row_equality(THD *thd, Item *left_row, Item_row *right_row, COND_EQUAL *cond_equal, List* eq_list) { uint n= left_row->cols(); @@ -6978,13 +6979,21 @@ static bool check_row_equality(Item *left_row, Item_row *right_row, Item *right_item= right_row->element_index(i); if (left_item->type() == Item::ROW_ITEM && right_item->type() == Item::ROW_ITEM) - is_converted= check_row_equality((Item_row *) left_item, - (Item_row *) right_item, - cond_equal, eq_list); - else + { + is_converted= check_row_equality(thd, + (Item_row *) left_item, + (Item_row *) right_item, + cond_equal, eq_list); + if (!is_converted) + thd->lex->current_select->cond_count++; + } + else + { is_converted= check_simple_equality(left_item, right_item, 0, cond_equal); - - if (!is_converted) + thd->lex->current_select->cond_count++; + } + + if (!is_converted) { Item_func_eq *eq_item; if (!(eq_item= new Item_func_eq(left_item, right_item))) @@ -7003,6 +7012,7 @@ static bool check_row_equality(Item *left_row, Item_row *right_row, SYNOPSIS check_equality() + thd thread handle item predicate to process cond_equal multiple equalities that must hold together with the predicate eq_list results of conversions of row equalities that are not simple @@ -7027,7 +7037,7 @@ static bool check_row_equality(Item *left_row, Item_row *right_row, or, if the procedure fails by a fatal error. */ -static bool check_equality(Item *item, COND_EQUAL *cond_equal, +static bool check_equality(THD *thd, Item *item, COND_EQUAL *cond_equal, List *eq_list) { if (item->type() == Item::FUNC_ITEM && @@ -7038,9 +7048,13 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal, if (left_item->type() == Item::ROW_ITEM && right_item->type() == Item::ROW_ITEM) - return check_row_equality((Item_row *) left_item, + { + thd->lex->current_select->cond_count--; + return check_row_equality(thd, + (Item_row *) left_item, (Item_row *) right_item, cond_equal, eq_list); + } else return check_simple_equality(left_item, right_item, item, cond_equal); } @@ -7053,6 +7067,7 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal, SYNOPSIS build_equal_items_for_cond() + thd thread handle cond condition(expression) where to make replacement inherited path to all inherited multiple equality items @@ -7115,7 +7130,7 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal, pointer to the transformed condition */ -static COND *build_equal_items_for_cond(COND *cond, +static COND *build_equal_items_for_cond(THD *thd, COND *cond, COND_EQUAL *inherited) { Item_equal *item_equal; @@ -7148,7 +7163,7 @@ static COND *build_equal_items_for_cond(COND *cond, structure here because it's restored before each re-execution of any prepared statement/stored procedure. */ - if (check_equality(item, &cond_equal, &eq_list)) + if (check_equality(thd, item, &cond_equal, &eq_list)) li.remove(); } @@ -7183,7 +7198,7 @@ static COND *build_equal_items_for_cond(COND *cond, while ((item= li++)) { Item *new_item; - if ((new_item = build_equal_items_for_cond(item, inherited))!= item) + if ((new_item= build_equal_items_for_cond(thd, item, inherited)) != item) { /* This replacement happens only for standalone equalities */ /* @@ -7213,7 +7228,7 @@ static COND *build_equal_items_for_cond(COND *cond, for WHERE a=b AND c=d AND (b=c OR d=5) b=c is replaced by =(a,b,c,d). */ - if (check_equality(cond, &cond_equal, &eq_list)) + if (check_equality(thd, cond, &cond_equal, &eq_list)) { int n= cond_equal.current_level.elements + eq_list.elements; if (n == 0) @@ -7276,7 +7291,7 @@ static COND *build_equal_items_for_cond(COND *cond, SYNOPSIS build_equal_items() - thd Thread handler + thd thread handle cond condition to build the multiple equalities for inherited path to all inherited multiple equality items join_list list of join tables to which the condition refers to @@ -7337,7 +7352,7 @@ static COND *build_equal_items(THD *thd, COND *cond, if (cond) { - cond= build_equal_items_for_cond(cond, inherited); + cond= build_equal_items_for_cond(thd, cond, inherited); cond->update_used_tables(); if (cond->type() == Item::COND_ITEM && ((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC) From db4c9754415ee72da06a229e7a28f8a718a92c05 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 12:56:03 +0200 Subject: [PATCH 502/789] Avoiding SESSION with debug, since it does not work in valgrind --- mysql-test/r/rpl_incident.result | 4 ++-- mysql-test/t/rpl_incident.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/r/rpl_incident.result index 70086c1e848..1d9d9202f6c 100644 --- a/mysql-test/r/rpl_incident.result +++ b/mysql-test/r/rpl_incident.result @@ -13,9 +13,9 @@ a 2 3 SET @saved = @@debug; -SET SESSION debug="d,incident_database_resync_on_replace"; +SET GLOBAL debug="d,incident_database_resync_on_replace"; REPLACE INTO t1 VALUES (4); -SET SESSION debug=@saved; +SET GLOBAL debug=@saved; SELECT * FROM t1; a 1 diff --git a/mysql-test/t/rpl_incident.test b/mysql-test/t/rpl_incident.test index 9c30d29b6fd..3629848c826 100644 --- a/mysql-test/t/rpl_incident.test +++ b/mysql-test/t/rpl_incident.test @@ -8,12 +8,12 @@ INSERT INTO t1 VALUES (1),(2),(3); SELECT * FROM t1; SET @saved = @@debug; -SET SESSION debug="d,incident_database_resync_on_replace"; +SET GLOBAL debug="d,incident_database_resync_on_replace"; # This will generate an incident log event and store it in the binary # log before the replace statement. REPLACE INTO t1 VALUES (4); -SET SESSION debug=@saved; +SET GLOBAL debug=@saved; --save_master_pos SELECT * FROM t1; From 7705946d3dc4c6a92703fddc1f0133dfeda54dc2 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 13:48:33 +0200 Subject: [PATCH 503/789] GLOBAL DEBUG variable does not work --- mysql-test/r/rpl_incident.result | 3 --- mysql-test/t/rpl_incident-master.opt | 1 + mysql-test/t/rpl_incident.test | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) create mode 100644 mysql-test/t/rpl_incident-master.opt diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/r/rpl_incident.result index 1d9d9202f6c..a9547832ed9 100644 --- a/mysql-test/r/rpl_incident.result +++ b/mysql-test/r/rpl_incident.result @@ -12,10 +12,7 @@ a 1 2 3 -SET @saved = @@debug; -SET GLOBAL debug="d,incident_database_resync_on_replace"; REPLACE INTO t1 VALUES (4); -SET GLOBAL debug=@saved; SELECT * FROM t1; a 1 diff --git a/mysql-test/t/rpl_incident-master.opt b/mysql-test/t/rpl_incident-master.opt new file mode 100644 index 00000000000..912801debc4 --- /dev/null +++ b/mysql-test/t/rpl_incident-master.opt @@ -0,0 +1 @@ +--loose-debug=+d,incident_database_resync_on_replace diff --git a/mysql-test/t/rpl_incident.test b/mysql-test/t/rpl_incident.test index 3629848c826..c52f26317ad 100644 --- a/mysql-test/t/rpl_incident.test +++ b/mysql-test/t/rpl_incident.test @@ -7,13 +7,9 @@ CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3); SELECT * FROM t1; -SET @saved = @@debug; -SET GLOBAL debug="d,incident_database_resync_on_replace"; - # This will generate an incident log event and store it in the binary # log before the replace statement. REPLACE INTO t1 VALUES (4); -SET GLOBAL debug=@saved; --save_master_pos SELECT * FROM t1; From ff979b76ca7c0e74b7fd7e8d9af78235b48d4339 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 15:07:48 +0200 Subject: [PATCH 504/789] Bug#27049 Race condition in test mysqlbinlog.test - Add --local-load option to avoidthat the load data file requested by mysqlbinlog end up in local var/tmp dir and not in system global tmpdir mysql-test/t/mysqlbinlog.test: Add --local-load option to avoidthat the load data file requested by mysqlbinlog end up in local var/tmp dir and not in system global tmpdir --- mysql-test/t/mysqlbinlog.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 97239360507..35f8485a0bd 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -202,6 +202,6 @@ select hex(a) from t1; drop table t1; flush logs; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000009 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000009 --echo End of 5.0 tests From 407389bae4a88eb35359d275bf1c890f0ea84cad Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 17:18:03 +0200 Subject: [PATCH 505/789] Add correct replace --- mysql-test/r/mysqlbinlog.result | 14 +++++++------- mysql-test/t/mysqlbinlog.test | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 217d3e5f64a..a50d131cca8 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -289,23 +289,23 @@ SET @@session.sql_mode=0/*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; create table t1 (a varchar(64) character set utf8)/*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-6-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-6-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=7/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-7-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-7-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=DEFAULT/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-8-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-8-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-9-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-9-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=7/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-a-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=DEFAULT/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-b-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/; SET TIMESTAMP=1000000000/*!*/; drop table t1/*!*/; DELIMITER ; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 35f8485a0bd..a7b3f413f23 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -201,7 +201,7 @@ load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8 select hex(a) from t1; drop table t1; flush logs; ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000009 --echo End of 5.0 tests From 81786abd7f45d8a8ff788ef2e333417cb7ac29e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 20:27:43 +0500 Subject: [PATCH 506/789] After merge fix. --- mysql-test/r/archive.result | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index f90577813f4..59462e848d2 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12666,7 +12666,6 @@ t6 CREATE TABLE `t6` ( KEY `a` (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 DROP TABLE t1, t2, t4, t5, t6; -drop table t1, t2, t4; create table t1 (i int) engine=archive; insert into t1 values (1); repair table t1 use_frm; From 810fdd6c29c037385cfbdce171b11c8e6c330988 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 19:10:25 +0200 Subject: [PATCH 507/789] Fix to rpl_row_create_table test. mysql-test/t/rpl_row_create_table.test: Adding sync to allow slave to complete cleanup drop before resetting storage engine. --- mysql-test/t/rpl_row_create_table.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test index e00494a3a13..d1b26f9e3f4 100644 --- a/mysql-test/t/rpl_row_create_table.test +++ b/mysql-test/t/rpl_row_create_table.test @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; # Set the default storage engine to different values on master and # slave. We need to stop the slave for the server variable to take # effect, since the variable is only read on start-up. -connection slave; +sync_slave_with_master; --disable_query_log set @storage_engine = @@global.storage_engine; STOP SLAVE; From ad4d67b69e3be3909aab08e837038edbd01d694c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Mar 2007 19:49:05 +0200 Subject: [PATCH 508/789] New test case shows valgrind failure (disabling this new test case until the valgrind failure is fixed, reported in bug 27564) mysql-test/t/disabled.def: New test case shows valgrind failre --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 79f5a26574b..fd64becbc00 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -26,6 +26,7 @@ rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after C rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly +rpl_udf : BUG#27564 2007-03-31 lars New test case for rpl of UDF shows valgrind failure synchronization : Bug#24529 Test 'synchronization' fails on Mac pushbuild; Also on Linux 64 bit. # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open From b84e64f7dfc6dc883c8dc4afc20f2fca046e0e7d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 08:36:00 +0200 Subject: [PATCH 509/789] ndb - fix bug in my.cnf config handling put64 for 64-bit variables ndb/src/mgmsrv/InitConfigFileParser.cpp: put64 --- ndb/src/mgmsrv/InitConfigFileParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 264a998a67b..e03c5408837 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -658,7 +658,7 @@ InitConfigFileParser::store_in_properties(Vector& options, if (options[i].var_type == GET_INT) ctx.m_currentSection->put(options[i].name, (Uint32)value_int); else - ctx.m_currentSection->put(options[i].name, value_int); + ctx.m_currentSection->put64(options[i].name, value_int); } } return true; From 22edf82592823203885247e2e7c1bcad280dc19f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 08:39:58 +0200 Subject: [PATCH 510/789] fix atrt mysql_install_db, make sure no extra my.cnf is read --- storage/ndb/test/run-test/files.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage/ndb/test/run-test/files.cpp b/storage/ndb/test/run-test/files.cpp index 231f7c88abc..c6a29350b91 100644 --- a/storage/ndb/test/run-test/files.cpp +++ b/storage/ndb/test/run-test/files.cpp @@ -155,12 +155,13 @@ setup_files(atrt_config& config, int setup, int sshx) const char * val; require(proc.m_options.m_loaded.get("--datadir=", &val)); BaseString tmp; - tmp.assfmt("%s/bin/mysql_install_db --datadir=%s > /dev/null 2>&1", - g_prefix, val); + tmp.assfmt("%s/bin/mysql_install_db --defaults-file=%s/my.cnf --datadir=%s > /dev/null 2>&1", + g_prefix, g_basedir, val); if (system(tmp.c_str()) != 0) { - g_logger.error("Failed to mysql_install_db for %s", - proc.m_proc.m_cwd.c_str()); + g_logger.error("Failed to mysql_install_db for %s, cmd: >%s<", + proc.m_proc.m_cwd.c_str(), + tmp.c_str()); } else { From d71a221d243bab6388d15d6fbb7228d365385e85 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 09:07:15 +0200 Subject: [PATCH 511/789] ndb - bug#27581 make sure not to leave partially initialized pagerage-records ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp: make sure not to leave partially initialized pagerage-records --- ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp b/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp index 0bb7c8a1e41..e227ac8b5bf 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp @@ -453,6 +453,13 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr ptrCheckGuard(parentPageRangePtr, cnoOfPageRangeRec, pageRange); if (parentPageRangePtr.p->currentIndexPos < 3) { ljam(); + + if (c_noOfFreePageRanges < tiprNoLevels) + { + ljam(); + return RNIL; + }//if + /* ---------------------------------------------------------------- */ /* WE HAVE FOUND AN EMPTY ENTRY IN A PAGE RANGE RECORD. */ /* ALLOCATE A NEW PAGE RANGE RECORD, FILL IN THE START RANGE, */ From 05e3c7e0bc0e2697e4589fc01a0e1cbfd8693710 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 09:51:14 +0200 Subject: [PATCH 512/789] Bug#26174 Server Crash:INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in Event - Some variables in I_S.GLOBAL_STATUS were depending on a network connection in order to evaluate. Since no network connection is present during the execution of an event, this caused the server to crash. - The variable function hooks does now verify that the vio- object is valid before attempting to use it. mysql-test/r/information_schema.result: Added test case. mysql-test/t/information_schema.test: Added test case. --- mysql-test/r/information_schema.result | 28 ++++++++++++++ mysql-test/t/information_schema.test | 40 ++++++++++++++++++++ sql/mysqld.cc | 52 +++++++++++++++++--------- sql/set_var.cc | 2 +- 4 files changed, 103 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index e5d6078e863..6c03ace3d27 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1408,4 +1408,32 @@ select user,db from information_schema.processlist; user db user3148 test drop user user3148@localhost; +DROP TABLE IF EXISTS thread_status; +CREATE TABLE thread_status (variable_name VARCHAR(64), +variable_value DECIMAL(22,7)); +CREATE TABLE server_status (variable_name VARCHAR(64), +variable_value DECIMAL(22,7)); +DROP EVENT IF EXISTS log_status; +CREATE EVENT log_status +ON SCHEDULE EVERY 1 SECOND +DO +BEGIN +INSERT INTO thread_status SELECT variable_name, variable_value FROM +information_schema.session_status; +INSERT INTO server_status SELECT variable_name, variable_value FROM +information_schema.global_status; +END$$ +SET GLOBAL event_scheduler=1; +SELECT * FROM thread_status WHERE variable_name LIKE 'SSL%' LIMIT 1,2; +variable_name variable_value +SSL_ACCEPTS 0.0000000 +SSL_CALLBACK_CACHE_HITS 0.0000000 +SELECT variable_name FROM server_status LIMIT 1,2; +variable_name +ABORTED_CONNECTS +BINLOG_CACHE_DISK_USE +DROP EVENT log_status; +DROP TABLE thread_status; +DROP TABLE server_status; +SET GLOBAL event_scheduler=0; End of 5.1 tests. diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 09a588c9195..bd1f4271c94 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1042,5 +1042,45 @@ select user,db from information_schema.processlist; connection default; drop user user3148@localhost; + + +# +# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in Event +# +--disable_warnings +DROP TABLE IF EXISTS thread_status; +CREATE TABLE thread_status (variable_name VARCHAR(64), +variable_value DECIMAL(22,7)); +CREATE TABLE server_status (variable_name VARCHAR(64), +variable_value DECIMAL(22,7)); +DROP EVENT IF EXISTS log_status; +--enable_warnings + +DELIMITER $$; + +CREATE EVENT log_status + ON SCHEDULE EVERY 1 SECOND + DO + BEGIN + INSERT INTO thread_status SELECT variable_name, variable_value FROM +information_schema.session_status; + INSERT INTO server_status SELECT variable_name, variable_value FROM +information_schema.global_status; + END$$ + +DELIMITER ;$$ + +SET GLOBAL event_scheduler=1; +sleep 1; +SELECT * FROM thread_status WHERE variable_name LIKE 'SSL%' LIMIT 1,2; +SELECT variable_name FROM server_status LIMIT 1,2; + + + +DROP EVENT log_status; +DROP TABLE thread_status; +DROP TABLE server_status; +SET GLOBAL event_scheduler=0; + --echo End of 5.1 tests. diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 83b16d9af0a..082a7c6fcbb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3803,6 +3803,8 @@ we force server id to 2, but this MySQL server will not act as a slave."); { if (Events::get_instance()->init()) unireg_abort(1); + } else { + Events::opt_event_scheduler= Events::EVENTS_DISABLED; } /* Signal threads waiting for server to be started */ @@ -6662,12 +6664,20 @@ static int show_ssl_ctx_get_session_cache_mode(THD *thd, SHOW_VAR *var, char *bu return 0; } -/* Functions relying on SSL */ +/* + Functions relying on SSL + Note: In the show_ssl_* functions, we need to check if we have a + valid vio-object since this isn't always true, specifically + when session_status or global_status is requested from + inside an Event. + */ static int show_ssl_get_version(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_CHAR; - var->value= const_cast(thd->net.vio->ssl_arg ? - SSL_get_version((SSL*) thd->net.vio->ssl_arg) : ""); + if( thd->vio_ok() && thd->net.vio->ssl_arg ) + var->value= const_cast(SSL_get_version((SSL*) thd->net.vio->ssl_arg)); + else + var->value= ""; return 0; } @@ -6675,9 +6685,10 @@ static int show_ssl_session_reused(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; var->value= buff; - *((long *)buff)= (long)thd->net.vio->ssl_arg ? - SSL_session_reused((SSL*) thd->net.vio->ssl_arg) : - 0; + if( thd->vio_ok() && thd->net.vio->ssl_arg ) + *((long *)buff)= (long)SSL_session_reused((SSL*) thd->net.vio->ssl_arg); + else + *((long *)buff)= 0; return 0; } @@ -6685,9 +6696,10 @@ static int show_ssl_get_default_timeout(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; var->value= buff; - *((long *)buff)= (long)thd->net.vio->ssl_arg ? - SSL_get_default_timeout((SSL*)thd->net.vio->ssl_arg) : - 0; + if( thd->vio_ok() && thd->net.vio->ssl_arg ) + *((long *)buff)= (long)SSL_get_default_timeout((SSL*)thd->net.vio->ssl_arg); + else + *((long *)buff)= 0; return 0; } @@ -6695,9 +6707,10 @@ static int show_ssl_get_verify_mode(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; var->value= buff; - *((long *)buff)= (long)thd->net.vio->ssl_arg ? - SSL_get_verify_mode((SSL*)thd->net.vio->ssl_arg) : - 0; + if( thd->net.vio && thd->net.vio->ssl_arg ) + *((long *)buff)= (long)SSL_get_verify_mode((SSL*)thd->net.vio->ssl_arg); + else + *((long *)buff)= 0; return 0; } @@ -6705,17 +6718,20 @@ static int show_ssl_get_verify_depth(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; var->value= buff; - *((long *)buff)= (long)thd->net.vio->ssl_arg ? - SSL_get_verify_depth((SSL*)thd->net.vio->ssl_arg) : - 0; + if( thd->vio_ok() && thd->net.vio->ssl_arg ) + *((long *)buff)= (long)SSL_get_verify_depth((SSL*)thd->net.vio->ssl_arg); + else + *((long *)buff)= 0; return 0; } static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_CHAR; - var->value= const_cast(thd->net.vio->ssl_arg ? - SSL_get_cipher((SSL*) thd->net.vio->ssl_arg) : ""); + if( thd->vio_ok() && thd->net.vio->ssl_arg ) + var->value= const_cast(SSL_get_cipher((SSL*) thd->net.vio->ssl_arg)); + else + var->value= ""; return 0; } @@ -6723,7 +6739,7 @@ static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_CHAR; var->value= buff; - if (thd->net.vio->ssl_arg) + if (thd->vio_ok() && thd->net.vio->ssl_arg) { int i; const char *p; diff --git a/sql/set_var.cc b/sql/set_var.cc index e2c90b72feb..91d2a2ec63b 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -4000,7 +4000,7 @@ sys_var_event_scheduler::update(THD *thd, set_var *var) DBUG_ENTER("sys_var_event_scheduler::update"); if (Events::opt_event_scheduler == Events::EVENTS_DISABLED) { - my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--event-scheduler=DISABLED"); + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--event-scheduler=DISABLED or --skip-grant-tables"); DBUG_RETURN(TRUE); } From fde587ebec4ae7d249a9dfba8e73a286accd5c5e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 10:14:45 +0200 Subject: [PATCH 513/789] Bug#27049 Race condition in test mysqlbinlog.test Remove the setting of --local-load parameter for mysqlbinlog and leave that to the testcases to decide what params to use. mysql-test/mysql-test-run.pl: Remove the setting of --local-load parameter for mysqlbinlog and leave that to the testcases to decide what params to use. --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3166672dd89..57bd12f7b05 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1959,7 +1959,7 @@ sub environment_setup () { # ---------------------------------------------------- my $cmdline_mysqlbinlog= mtr_native_path($exe_mysqlbinlog) . - " --no-defaults --local-load=$opt_tmpdir"; + "--no-defaults"; if (!$opt_extern && $mysql_version_id >= 50000 ) { $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir"; From 5bf24b2b8643414eb0ab32c723a1f04b026689db Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 10:17:29 +0200 Subject: [PATCH 514/789] Fix spelling error --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 57bd12f7b05..451bcc45347 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1959,7 +1959,7 @@ sub environment_setup () { # ---------------------------------------------------- my $cmdline_mysqlbinlog= mtr_native_path($exe_mysqlbinlog) . - "--no-defaults"; + " --no-defaults"; if (!$opt_extern && $mysql_version_id >= 50000 ) { $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir"; From 0bb2f43d2e06e8cf3df1068daed20cd8817188f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 10:39:23 +0200 Subject: [PATCH 515/789] Cset exclude: tsmith@siva.hindu.god|ChangeSet|20070328212513|13373 myisam/mi_open.c: Exclude mysql-test/r/create.result: Exclude mysql-test/t/create.test: Exclude sql/table.cc: Exclude --- myisam/mi_open.c | 2 +- mysql-test/r/create.result | 517 ------------------------------------- mysql-test/t/create.test | 212 +-------------- sql/table.cc | 13 +- 4 files changed, 3 insertions(+), 741 deletions(-) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 12d31616128..b007eb63e63 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -219,7 +219,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) key_parts+=fulltext_keys*FT_SEGS; if (share->base.max_key_length > MI_MAX_KEY_BUFF || keys > MI_MAX_KEY || - key_parts > MI_MAX_KEY * MI_MAX_KEY_SEG) + key_parts >= MI_MAX_KEY * MI_MAX_KEY_SEG) { DBUG_PRINT("error",("Wrong key info: Max_key_length: %d keys: %d key_parts: %d", share->base.max_key_length, keys, key_parts)); my_errno=HA_ERR_UNSUPPORTED; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index a8a5b62bc81..aa25c55f394 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -701,520 +701,3 @@ t2 CREATE TABLE `t2` ( drop table t1, t2; create table t1(a set("a,b","c,d") not null); ERROR HY000: Illegal set 'a,b' value found during parsing -create table t1 ( -c1 char(10), c2 char(10), c3 char(10), c4 char(10), -c5 char(10), c6 char(10), c7 char(10), c8 char(10), -c9 char(10), c10 char(10), c11 char(10), c12 char(10), -c13 char(10), c14 char(10), c15 char(10), c16 char(10), -key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) -); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, - KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -flush tables; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, - KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1; -create table t1 ( -c1 char(10), c2 char(10), c3 char(10), c4 char(10), -c5 char(10), c6 char(10), c7 char(10), c8 char(10), -c9 char(10), c10 char(10), c11 char(10), c12 char(10), -c13 char(10), c14 char(10), c15 char(10), c16 char(10) -); -alter table t1 -add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, - KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -flush tables; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, - KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a004_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a005_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a006_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a007_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a008_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a009_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a010_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a011_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a012_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a013_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a014_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a015_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a016_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a017_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a018_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a019_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a020_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a021_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a022_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a023_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a024_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a025_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a026_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a027_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a028_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a029_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a030_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a031_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a032_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a033_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a034_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a035_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a036_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a037_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a038_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a039_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a040_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a041_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a042_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a043_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a044_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a045_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a046_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a047_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a048_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a049_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a050_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a051_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a052_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a053_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a054_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a055_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a056_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a057_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a058_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a059_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a060_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a061_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -alter table t1 add key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); -ERROR 42000: Too many keys specified; max 64 keys allowed -drop table t1; -create table t1 ( -c1 char(10), c2 char(10), c3 char(10), c4 char(10), -c5 char(10), c6 char(10), c7 char(10), c8 char(10), -c9 char(10), c10 char(10), c11 char(10), c12 char(10), -c13 char(10), c14 char(10), c15 char(10), c16 char(10), -c17 char(10) -); -alter table t1 add key i1 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`, `c17`); -ERROR 42000: Too many key parts specified; max 16 parts allowed -alter table t1 add key a001_long_123456789_123456789_123456789_123456789_123456789_12345 (`c1`); -ERROR 42000: Identifier name 'a001_long_123456789_123456789_123456789_123456789_123456789_12345' is too long -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` char(10) default NULL, - `c2` char(10) default NULL, - `c3` char(10) default NULL, - `c4` char(10) default NULL, - `c5` char(10) default NULL, - `c6` char(10) default NULL, - `c7` char(10) default NULL, - `c8` char(10) default NULL, - `c9` char(10) default NULL, - `c10` char(10) default NULL, - `c11` char(10) default NULL, - `c12` char(10) default NULL, - `c13` char(10) default NULL, - `c14` char(10) default NULL, - `c15` char(10) default NULL, - `c16` char(10) default NULL, - `c17` char(10) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1; -End of 4.1 tests diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a3458298ff9..57b16a13c01 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -609,214 +609,4 @@ drop table t1, t2; --error 1105 create table t1(a set("a,b","c,d") not null); - -# -# Bug #26642: create index corrupts table definition in .frm -# -# Problem with creating keys with maximum key-parts and maximum name length -# This test is made for a mysql server supporting names up to 64 bytes -# and a maximum of 16 key segements per Key -# - -create table t1 ( -c1 char(10), c2 char(10), c3 char(10), c4 char(10), -c5 char(10), c6 char(10), c7 char(10), c8 char(10), -c9 char(10), c10 char(10), c11 char(10), c12 char(10), -c13 char(10), c14 char(10), c15 char(10), c16 char(10), - -key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`) -); - -# Check that the table is not corrupted -show create table t1; -flush tables; -show create table t1; - -# Repeat test using ALTER to add indexes - -drop table t1; -create table t1 ( -c1 char(10), c2 char(10), c3 char(10), c4 char(10), -c5 char(10), c6 char(10), c7 char(10), c8 char(10), -c9 char(10), c10 char(10), c11 char(10), c12 char(10), -c13 char(10), c14 char(10), c15 char(10), c16 char(10) -); - -alter table t1 - -add key a001_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a002_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a003_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a004_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a005_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a006_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a007_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a008_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a009_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -add key a010_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a011_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a012_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a013_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a014_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a015_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a016_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a017_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a018_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a019_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -add key a020_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a021_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a022_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a023_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a024_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a025_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a026_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a027_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a028_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a029_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -add key a030_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a031_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a032_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a033_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a034_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a035_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a036_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a037_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a038_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a039_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -add key a040_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a041_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a042_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a043_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a044_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a045_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a046_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a047_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a048_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a049_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -add key a050_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a051_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a052_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a053_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a054_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a055_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a056_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a057_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a058_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a059_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), - -add key a060_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a061_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a062_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a063_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`), -add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); - -show create table t1; -flush tables; -show create table t1; - -# Test the server limits; if any of these pass, all above tests need -# to be rewritten to hit the limit -# -# Ensure limit is really 64 keys ---error 1069 -alter table t1 add key a065_long_123456789_123456789_123456789_123456789_123456789_1234 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`); - -drop table t1; - -# Ensure limit is really 16 key parts per key - -create table t1 ( -c1 char(10), c2 char(10), c3 char(10), c4 char(10), -c5 char(10), c6 char(10), c7 char(10), c8 char(10), -c9 char(10), c10 char(10), c11 char(10), c12 char(10), -c13 char(10), c14 char(10), c15 char(10), c16 char(10), -c17 char(10) -); - -# Get error for max key parts ---error 1070 -alter table t1 add key i1 (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`, `c17`); - -# Get error for max key-name length ---error 1059 -alter table t1 add key a001_long_123456789_123456789_123456789_123456789_123456789_12345 (`c1`); - -show create table t1; - -drop table t1; - ---echo End of 4.1 tests +# End of 4.1 tests diff --git a/sql/table.cc b/sql/table.cc index f4f3fcf81dc..a85da8395e7 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1283,18 +1283,7 @@ File create_frm(register my_string name, const char *db, const char *table, fileinfo[3]= (uchar) ha_checktype(create_info->db_type); fileinfo[4]=1; int2store(fileinfo+6,IO_SIZE); /* Next block starts here */ - /* - For each key (see unireg.cc::pack_keys()): - 8 bytes for the key header - 9 bytes for each key-part (MAX_REF_PARTS) - NAME_LEN bytes for the name - 1 byte for the NAMES_SEP_CHAR (before the name) - For all keys: - 6 bytes for the header - 1 byte for the NAMES_SEP_CHAR (after the last name) - 9 extra bytes (padding for safety? alignment?) - */ - key_length= keys * (8 + MAX_REF_PARTS * 9 + NAME_LEN + 1) + 16; + key_length=keys*(7+NAME_LEN+MAX_REF_PARTS*9)+16; length=(ulong) next_io_size((ulong) (IO_SIZE+key_length+reclength)); int4store(fileinfo+10,length); if (key_length > 0xffff) key_length=0xffff; From d03c7d2d28fe86d88c30f8799b78cf966e5a3ab7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 15:01:19 +0500 Subject: [PATCH 516/789] Bug#27069 set with identical elements are created added the check for unique elements count in SET mysql-test/r/type_set.result: test result mysql-test/t/type_set.test: test case sql/field.cc: removed the check for elements count in SET sql/sql_table.cc: added the check for unique elements count in SET --- mysql-test/r/type_set.result | 19 +++++++++++++++++++ mysql-test/t/type_set.test | 17 +++++++++++++++++ sql/field.cc | 5 ----- sql/sql_table.cc | 16 +++++++++++++--- 4 files changed, 49 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index fdda4aca25c..03de20baef2 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -66,3 +66,22 @@ ss ue ue DROP TABLE t1; +create table t1(f1 +set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17', +'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33', +'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49', +'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','128')); +ERROR HY000: Too many strings for column f1 and SET +create table t1(f1 +set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17', +'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33', +'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49', +'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1')); +Warnings: +Note 1291 Column 'f1' has duplicated value '1' in SET +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1') default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index 56df3328246..b1c816f3371 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -39,3 +39,20 @@ SELECT c FROM t1 ORDER BY concat(c); DROP TABLE t1; # End of 4.1 tests + +# +# Bug#27069 set with identical elements are created +# +--error 1097 +create table t1(f1 +set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17', +'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33', +'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49', +'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','128')); +create table t1(f1 +set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17', +'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33', +'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49', +'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1')); +show create table t1; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 152c1bdc364..24cec4e1c74 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8676,11 +8676,6 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type, break; case FIELD_TYPE_SET: { - if (fld_interval_list->elements > sizeof(longlong)*8) - { - my_error(ER_TOO_BIG_SET, MYF(0), fld_name); /* purecov: inspected */ - DBUG_RETURN(TRUE); - } pack_length= get_set_pack_length(fld_interval_list->elements); List_iterator it(*fld_interval_list); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8b3028f5370..a71579fb74f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -407,6 +407,7 @@ static int sort_keys(KEY *a, KEY *b) set_or_name "SET" or "ENUM" string for warning message name name of the checked column typelib list of values for the column + dup_val_count returns count of duplicate elements DESCRIPTION This function prints an warning for each value in list @@ -418,11 +419,12 @@ static int sort_keys(KEY *a, KEY *b) void check_duplicates_in_interval(const char *set_or_name, const char *name, TYPELIB *typelib, - CHARSET_INFO *cs) + CHARSET_INFO *cs, unsigned int *dup_val_count) { TYPELIB tmp= *typelib; const char **cur_value= typelib->type_names; unsigned int *cur_length= typelib->type_lengths; + *dup_val_count= 0; for ( ; tmp.count > 1; cur_value++, cur_length++) { @@ -435,6 +437,7 @@ void check_duplicates_in_interval(const char *set_or_name, ER_DUPLICATED_VALUE_IN_TYPE, ER(ER_DUPLICATED_VALUE_IN_TYPE), name,*cur_value,set_or_name); + (*dup_val_count)++; } } } @@ -498,6 +501,7 @@ int prepare_create_field(create_field *sql_field, int *timestamps, int *timestamps_with_niladic, uint table_flags) { + unsigned int dup_val_count; DBUG_ENTER("prepare_field"); /* @@ -573,7 +577,7 @@ int prepare_create_field(create_field *sql_field, sql_field->unireg_check=Field::INTERVAL_FIELD; check_duplicates_in_interval("ENUM",sql_field->field_name, sql_field->interval, - sql_field->charset); + sql_field->charset, &dup_val_count); break; case FIELD_TYPE_SET: sql_field->pack_flag=pack_length_to_packflag(sql_field->pack_length) | @@ -583,7 +587,13 @@ int prepare_create_field(create_field *sql_field, sql_field->unireg_check=Field::BIT_FIELD; check_duplicates_in_interval("SET",sql_field->field_name, sql_field->interval, - sql_field->charset); + sql_field->charset, &dup_val_count); + /* Check that count of unique members is not more then 64 */ + if (sql_field->interval->count - dup_val_count > sizeof(longlong)*8) + { + my_error(ER_TOO_BIG_SET, MYF(0), sql_field->field_name); + DBUG_RETURN(1); + } break; case FIELD_TYPE_DATE: // Rest of string types case FIELD_TYPE_NEWDATE: From 8033d64e136cb9519d527c59062dc3d0f17adcac Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 13:12:59 +0200 Subject: [PATCH 517/789] Bug#21611 Slave can't connect when master-ssl-cipher specified - Change check for return value of 'SSL_CTX_set_cipher_list' in order to handle 0 as error setting cipher. - Thanks to Dan Lukes for finding the problem! mysql-test/r/openssl_1.result: Update result mysql-test/t/openssl_1.test: Add test for setting ssl-cipher to be used vio/viosslfactories.c: Change error handling of SSL_CTX_set_cipher_list to detect 0 as an error --- mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++ mysql-test/r/openssl_1.result | 3 +++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++ mysql-test/t/openssl_1.test | 8 ++++++ vio/viosslfactories.c | 9 +++++-- 5 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 34d8e3ab768..a80ef4fc4bb 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -51,3 +51,6 @@ SSL error: Unable to get private key from '' mysqltest: Could not open connection 'default': 2026 SSL connection error SSL error: Unable to get certificate from '' mysqltest: Could not open connection 'default': 2026 SSL connection error +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 8772b8157e3..c98c19afaad 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -97,3 +97,11 @@ drop table t1; --exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 +# +# BUG#21611 Slave can't connect when master-ssl-cipher specified +# - Apparently selecting a cipher doesn't work at all +# - Usa a cipher that both yaSSL and OpenSSL supports +# +--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--exec $MYSQL_TEST --ssl-cipher=DHE-RSA-AES256-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 + diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 55d3792365f..40879da24ba 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -249,8 +249,13 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_RETURN(0); } - /* Set the ciphers that can be used */ - if (cipher && SSL_CTX_set_cipher_list(ssl_fd->ssl_context, cipher)) + /* + Set the ciphers that can be used + NOTE: SSL_CTX_set_cipher_list will return 0 if + none of the provided ciphers could be selected + */ + if (cipher && + SSL_CTX_set_cipher_list(ssl_fd->ssl_context, cipher) == 0) { DBUG_PRINT("error", ("failed to set ciphers to use")); report_errors(); From f75f2912b6299afbc88f344b1d5f2c7fe097e25a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 13:57:32 +0200 Subject: [PATCH 518/789] After merge fix --- mysql-test/r/rpl_incident.result | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/r/rpl_incident.result index a9547832ed9..aea35c5f477 100644 --- a/mysql-test/r/rpl_incident.result +++ b/mysql-test/r/rpl_incident.result @@ -59,6 +59,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; SELECT * FROM t1; @@ -101,5 +102,6 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No DROP TABLE t1; DROP TABLE t1; From c1020aa4c67d48e061065f60400127d04a0adb30 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 14:03:33 +0200 Subject: [PATCH 519/789] Type cast of constant string (empty) to keep compiler happy. --- sql/mysqld.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3ab3b024643..7121ab6db78 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6742,7 +6742,7 @@ static int show_ssl_get_version(THD *thd, SHOW_VAR *var, char *buff) if( thd->vio_ok() && thd->net.vio->ssl_arg ) var->value= const_cast(SSL_get_version((SSL*) thd->net.vio->ssl_arg)); else - var->value= ""; + var->value= (char *)""; return 0; } @@ -6796,7 +6796,7 @@ static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, char *buff) if( thd->vio_ok() && thd->net.vio->ssl_arg ) var->value= const_cast(SSL_get_cipher((SSL*) thd->net.vio->ssl_arg)); else - var->value= ""; + var->value= (char *)""; return 0; } From 3c763afc9c39420f9a2f14c51fe20ddf745f7976 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 17:26:39 +0500 Subject: [PATCH 520/789] BUG#25729 - boolean full text search is confused by NULLs produced by LEFT JOIN Fixed that in certain situations MATCH ... AGAINST returns false hits for NULLs produced by LEFT JOIN when there is no fulltext index available. mysql-test/r/fulltext_left_join.result: A test case for BUG#25729. mysql-test/t/fulltext_left_join.test: A test case for BUG#25729. sql/item_func.cc: concat_ws(NULL) returns empty string instead of NULL. There is not much sense to calculate relevance for empty strings, thus return 0 immediately if we got NULL or empty string from concat_ws. sql/item_func.h: Item_func_match::concat renamed to concat_ws. --- mysql-test/r/fulltext_left_join.result | 7 +++++++ mysql-test/t/fulltext_left_join.test | 11 +++++++++++ sql/item_func.cc | 8 ++++---- sql/item_func.h | 8 ++++---- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/fulltext_left_join.result b/mysql-test/r/fulltext_left_join.result index fdf11c14cc4..ea4cacf2fab 100644 --- a/mysql-test/r/fulltext_left_join.result +++ b/mysql-test/r/fulltext_left_join.result @@ -90,3 +90,10 @@ id link name relevance 1 1 string 0 2 0 string 0 DROP TABLE t1,t2; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT, c TEXT, KEY(b)); +INSERT INTO t1 VALUES(1); +INSERT INTO t2(b,c) VALUES(2,'castle'),(3,'castle'); +SELECT * FROM t1 LEFT JOIN t2 ON a=b WHERE MATCH(c) AGAINST('+castle' IN BOOLEAN MODE); +a b c +DROP TABLE t1, t2; diff --git a/mysql-test/t/fulltext_left_join.test b/mysql-test/t/fulltext_left_join.test index 5942ce119ee..8c13ae5cad9 100644 --- a/mysql-test/t/fulltext_left_join.test +++ b/mysql-test/t/fulltext_left_join.test @@ -87,3 +87,14 @@ SELECT t1.*, MATCH(t1.name) AGAINST('string') AS relevance DROP TABLE t1,t2; # End of 4.1 tests + +# +# BUG#25729 - boolean full text search is confused by NULLs produced by LEFT +# JOIN +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT, c TEXT, KEY(b)); +INSERT INTO t1 VALUES(1); +INSERT INTO t2(b,c) VALUES(2,'castle'),(3,'castle'); +SELECT * FROM t1 LEFT JOIN t2 ON a=b WHERE MATCH(c) AGAINST('+castle' IN BOOLEAN MODE); +DROP TABLE t1, t2; diff --git a/sql/item_func.cc b/sql/item_func.cc index 32cc90b96d6..34122631fe3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4597,14 +4597,14 @@ void Item_func_match::init_search(bool no_order) fields.push_back(new Item_string(" ",1, cmp_collation.collation)); for (uint i=1; i < arg_count; i++) fields.push_back(args[i]); - concat=new Item_func_concat_ws(fields); + concat_ws=new Item_func_concat_ws(fields); /* Above function used only to get value and do not need fix_fields for it: Item_string - basic constant fields - fix_fields() was already called for this arguments Item_func_concat_ws - do not need fix_fields() to produce value */ - concat->quick_fix_field(); + concat_ws->quick_fix_field(); } if (master) @@ -4819,8 +4819,8 @@ double Item_func_match::val_real() if (key == NO_SUCH_KEY) { - String *a= concat->val_str(&value); - if ((null_value= (a == 0))) + String *a= concat_ws->val_str(&value); + if ((null_value= (a == 0)) || !a->length()) DBUG_RETURN(0); DBUG_RETURN(ft_handler->please->find_relevance(ft_handler, (byte *)a->ptr(), a->length())); diff --git a/sql/item_func.h b/sql/item_func.h index 68591f9c6f5..3f87d210431 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1308,12 +1308,12 @@ public: FT_INFO *ft_handler; TABLE *table; Item_func_match *master; // for master-slave optimization - Item *concat; // Item_func_concat_ws - String value; // value of concat + Item *concat_ws; // Item_func_concat_ws + String value; // value of concat_ws String search_value; // key_item()'s value converted to cmp_collation Item_func_match(List &a, uint b): Item_real_func(a), key(0), flags(b), - join_key(0), ft_handler(0), table(0), master(0), concat(0) { } + join_key(0), ft_handler(0), table(0), master(0), concat_ws(0) { } void cleanup() { DBUG_ENTER("Item_func_match"); @@ -1321,7 +1321,7 @@ public: if (!master && ft_handler) ft_handler->please->close_search(ft_handler); ft_handler= 0; - concat= 0; + concat_ws= 0; DBUG_VOID_RETURN; } enum Functype functype() const { return FT_FUNC; } From 6bcf19c80a4457aba977926ce4f386a2773630d6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 15:19:06 +0200 Subject: [PATCH 521/789] build fix for bug#27049 --- mysql-test/t/mysqlbinlog.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 9a27c4cbdb2..ef314bced71 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -205,7 +205,7 @@ select hex(a) from t1; drop table t1; flush logs; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000010 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000010 --echo End of 5.0 tests From 30cb61d0572bf055df2e14dc8ad9015def21af01 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 15:20:46 +0200 Subject: [PATCH 522/789] BUG#27489 build fix scripts/make_binary_distribution.sh: BUG#27489 make_binary_distribution doesn't copy all files --- scripts/make_binary_distribution.sh | 43 +++++++++++++++++++---------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index eab3af29ad1..9101f7f0948 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -54,6 +54,21 @@ for arg do esac done +# Avoid too long command lines for cp (bug#27489) +MCP() { + for i + do + last=$i + done + for i + do + if test "x$i" != "x$last" + then + cp -p $i $last + fi + done +} + # Remove vendor from $system system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` @@ -253,25 +268,25 @@ copyfileto $BASE/mysql-test \ mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf -$CP mysql-test/lib/*.pl $BASE/mysql-test/lib -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/include/*.test $BASE/mysql-test/include -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ +MCP mysql-test/lib/*.pl $BASE/mysql-test/lib +MCP mysql-test/t/*.def $BASE/mysql-test/t +MCP mysql-test/include/*.inc $BASE/mysql-test/include +MCP mysql-test/include/*.test $BASE/mysql-test/include +MCP mysql-test/t/*.def $BASE/mysql-test/t +MCP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data -$CP mysql-test/t/*.test $BASE/mysql-test/t -$CP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t -$CP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t -$CP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t -$CP mysql-test/r/*.result $BASE/mysql-test/r -$CP mysql-test/r/*.require $BASE/mysql-test/r -$CP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests -$CP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests +MCP mysql-test/t/*.test $BASE/mysql-test/t +MCP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t +MCP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t +MCP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t +MCP mysql-test/r/*.result $BASE/mysql-test/r +MCP mysql-test/r/*.require $BASE/mysql-test/r +MCP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests +MCP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* From 5c0bbbe8ea17a8f5772415be548163027276d213 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 15:36:59 +0200 Subject: [PATCH 523/789] BUG#25303 log_state fails sql/set_var.cc: BUG#25303 opt_slow_log is really a my_bool --- sql/set_var.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index fef6fccfd06..a0869fb2984 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -875,7 +875,7 @@ SHOW_VAR init_vars[]= { #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_slow_queries", (char*) &opt_slow_log, SHOW_MY_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}, From 08c186490259c4c32001b1e0526fe8564df7458c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 18:08:11 +0200 Subject: [PATCH 524/789] fix previous mysqlbinlog test case fix mysql-test/r/mysqlbinlog.result: adjust to change in test file mysql-test/t/mysqlbinlog.test: substitute correct directory --- mysql-test/r/mysqlbinlog.result | 14 +++++++------- mysql-test/t/mysqlbinlog.test | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 5a7dcca2420..57961698034 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -290,23 +290,23 @@ SET @@session.sql_mode=0/*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; create table t1 (a varchar(64) character set utf8)/*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-6-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-6-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=7/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-7-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-7-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=DEFAULT/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-8-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-8-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-9-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-9-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=7/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-a-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=DEFAULT/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-b-0' INTO table t1/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1/*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/; SET TIMESTAMP=1000000000/*!*/; drop table t1/*!*/; DELIMITER ; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index ef314bced71..630e56ccfd1 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -204,7 +204,7 @@ load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8 select hex(a) from t1; drop table t1; flush logs; ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000010 --echo End of 5.0 tests From f9315b16b14f662b4d89fffcc39a3b84e6c56b51 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 18:21:05 +0200 Subject: [PATCH 525/789] BUG#27560: Memory usage of mysqld grows while doing nothing The query-cache watch thread was continually allocating new thread entries on the THD MEM_ROOT, not freed until server exit. Fixed by using a simple array, auto-expanded as necessary. sql/ha_ndbcluster.cc: Use a fixed array (auto-expanded as necessary) for temporary copy of open shares, don't keep pushing list entries on the THD mem root. --- sql/ha_ndbcluster.cc | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 71ab1e24f4d..927dc3a75b2 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6677,7 +6677,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) DBUG_RETURN(NULL); } - List util_open_tables; + uint share_list_size= 0; + NDB_SHARE **share_list= NULL; set_timespec(abstime, 0); for (;;) { @@ -6704,7 +6705,22 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) /* Lock mutex and fill list with pointers to all open tables */ NDB_SHARE *share; pthread_mutex_lock(&ndbcluster_mutex); - for (uint i= 0; i < ndbcluster_open_tables.records; i++) + uint i, record_count= ndbcluster_open_tables.records; + if (share_list_size < record_count) + { + NDB_SHARE ** new_share_list= new NDB_SHARE * [record_count]; + if (!new_share_list) + { + sql_print_warning("ndb util thread: malloc failure, " + "query cache not maintained properly"); + pthread_mutex_unlock(&ndbcluster_mutex); + goto next; // At least do not crash + } + delete [] share_list; + share_list_size= record_count; + share_list= new_share_list; + } + for (i= 0; i < record_count; i++) { share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i); share->use_count++; /* Make sure the table can't be closed */ @@ -6713,14 +6729,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) i, share->table_name, share->use_count)); /* Store pointer to table */ - util_open_tables.push_back(share); + share_list[i]= share; } pthread_mutex_unlock(&ndbcluster_mutex); - /* Iterate through the open files list */ - List_iterator_fast it(util_open_tables); - while ((share= it++)) + /* Iterate through the open files list */ + for (i= 0; i < record_count; i++) { + share= share_list[i]; /* Split tab- and dbname */ char buf[FN_REFLEN]; char *tabname, *db; @@ -6767,10 +6783,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) /* Decrease the use count and possibly free share */ free_share(share); } - - /* Clear the list of open tables */ - util_open_tables.empty(); - +next: /* Calculate new time to wake up */ int secs= 0; int msecs= ndb_cache_check_time; @@ -6793,6 +6806,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) } } + if (share_list) + delete [] share_list; thd->cleanup(); delete thd; delete ndb; From 3fa924900d27c468c1525db7e02725557d66d83c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 18:49:52 +0200 Subject: [PATCH 526/789] corrected previos manual merge --- sql/ha_ndbcluster.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 81396bb325f..40de7b0409f 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -8415,6 +8415,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) struct timespec abstime; List util_open_tables; Thd_ndb *thd_ndb; + uint share_list_size= 0; + NDB_SHARE **share_list= NULL; my_thread_init(); DBUG_ENTER("ndb_util_thread"); @@ -8499,8 +8501,6 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ndbcluster_find_all_files(thd); #endif - uint share_list_size= 0; - NDB_SHARE **share_list= NULL; set_timespec(abstime, 0); for (;;) { From 329204631d3c1ef4a92ccbd392d7581ddc66ff5a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 21:26:27 +0200 Subject: [PATCH 527/789] correction of manual merge --- sql/ha_ndbcluster.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 40de7b0409f..6e857c5f06b 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -8537,7 +8537,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) /* Lock mutex and fill list with pointers to all open tables */ NDB_SHARE *share; pthread_mutex_lock(&ndbcluster_mutex); - uint i, record_count= ndbcluster_open_tables.records; + uint i, open_count, record_count= ndbcluster_open_tables.records; if (share_list_size < record_count) { NDB_SHARE ** new_share_list= new NDB_SHARE * [record_count]; @@ -8552,7 +8552,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) share_list_size= record_count; share_list= new_share_list; } - for (i= 0; i < record_count; i++) + for (i= 0, open_count= 0; i < record_count; i++) { share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i); #ifdef HAVE_NDB_BINLOG @@ -8567,12 +8567,12 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) i, share->table_name, share->use_count)); /* Store pointer to table */ - share_list[i]= share; + share_list[open_count++]= share; } pthread_mutex_unlock(&ndbcluster_mutex); /* Iterate through the open files list */ - for (i= 0; i < record_count; i++) + for (i= 0; i < open_count; i++) { share= share_list[i]; #ifdef HAVE_NDB_BINLOG From f7417a299eddf6212996c357f79b2715af98567b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 16:21:12 -0400 Subject: [PATCH 528/789] Minor test cleanup. mysql-test/t/mysqldump.test: Fix for failing Windows test. --- mysql-test/t/mysqldump.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index ca85320b35f..126412057ab 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -918,7 +918,7 @@ port=1234 EOF --exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 --exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1 ---remov_file $MYSQLTEST_VARDIR/tmp/tmp.cnf +--remove_file $MYSQLTEST_VARDIR/tmp/tmp.cnf --echo # --echo # Test of fix to BUG 12597 @@ -1480,10 +1480,10 @@ create function f2() returns int return f1(); create view v3 as select bug23491_original.f1(); # Backup. ---exec $MYSQL_DUMP --skip-comments -uroot --opt --routines bug23491_original > $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql; +--exec $MYSQL_DUMP --skip-comments -uroot --opt --routines bug23491_original > $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql # Restore. ---exec $MYSQL bug23491_restore < $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql; +--exec $MYSQL bug23491_restore < $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql # Verify use bug23491_restore; From 57986e7377fc81baa182e764efd67699a3815036 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 22:58:25 +0200 Subject: [PATCH 529/789] Look for "testname.warnings" file produced by mysqltest, could find problems like misspelled -- commands --- mysql-test/lib/mtr_report.pl | 9 +++++++ mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 2a90344c110..d47f9051763 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -295,6 +295,15 @@ sub mtr_report_stats ($) { } } } + + # Look for warnings produced by mysqltest in testname.warnings + foreach my $test_warning_file + ( glob("$::glob_mysql_test_dir/r/*.warnings") ) + { + $found_problems= 1; + print WARN "Check myqltest warnings in $test_warning_file\n"; + } + if ( $found_problems ) { mtr_warning("Got errors/warnings while running tests, please examine", diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests From 4c6696019c31a5eeee6384d2f44a86e953a91014 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 07:20:55 +0200 Subject: [PATCH 530/789] Bug #26783 replication status unknown after cluster or mysqld failure - update the ndb_apply_status table with binlog info BitKeeper/etc/ignore: Added client/rpl_constants.h to the ignore list mysql-test/r/rpl_ndb_stm_innodb.result: New BitKeeper file ``mysql-test/r/rpl_ndb_stm_innodb.result'' mysql-test/t/rpl_ndb_stm_innodb-master.opt: New BitKeeper file ``mysql-test/t/rpl_ndb_stm_innodb-master.opt'' mysql-test/t/rpl_ndb_stm_innodb.test: New BitKeeper file ``mysql-test/t/rpl_ndb_stm_innodb.test'' --- .bzrignore | 1 + mysql-test/r/rpl_ndb_stm_innodb.result | 37 +++++++++++++ mysql-test/t/rpl_ndb_stm_innodb-master.opt | 1 + mysql-test/t/rpl_ndb_stm_innodb.test | 62 +++++++++++++++++++++ sql/ha_ndbcluster.cc | 64 +++++++++++++++++++++- sql/ha_ndbcluster.h | 6 ++ sql/ha_ndbcluster_binlog.cc | 4 +- sql/ha_ndbcluster_binlog.h | 2 + 8 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 mysql-test/r/rpl_ndb_stm_innodb.result create mode 100644 mysql-test/t/rpl_ndb_stm_innodb-master.opt create mode 100644 mysql-test/t/rpl_ndb_stm_innodb.test diff --git a/.bzrignore b/.bzrignore index c04ce91b355..55f55faa0e6 100644 --- a/.bzrignore +++ b/.bzrignore @@ -2956,3 +2956,4 @@ win/vs71cache.txt win/vs8cache.txt zlib/*.ds? zlib/*.vcproj +client/rpl_constants.h diff --git a/mysql-test/r/rpl_ndb_stm_innodb.result b/mysql-test/r/rpl_ndb_stm_innodb.result new file mode 100644 index 00000000000..9ed54a11c1c --- /dev/null +++ b/mysql-test/r/rpl_ndb_stm_innodb.result @@ -0,0 +1,37 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1 (a int key, b int) engine innodb; +create table t2 (a int key, b int) engine innodb; +alter table t1 engine ndb; +alter table t2 engine ndb; +insert into t1 values (1,2); +select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status; +@start_pos:=start_pos @end_pos:=end_pos + +show binlog events from limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 Query 1 # use `test`; insert into t1 values (1,2) +show binlog events from limit 1,1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Xid 1 445 COMMIT /* XID */ +begin; +insert into t1 values (2,3); +insert into t2 values (3,4); +commit; +select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status; +@start_pos:=start_pos @end_pos:=end_pos + +show binlog events from limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 Query 1 # use `test`; BEGIN +show binlog events from limit 1,2; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; insert into t1 values (2,3) +master-bin.000001 # Query # # use `test`; insert into t2 values (3,4) +show binlog events from limit 3,1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Xid 1 COMMIT /* XID */ diff --git a/mysql-test/t/rpl_ndb_stm_innodb-master.opt b/mysql-test/t/rpl_ndb_stm_innodb-master.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_ndb_stm_innodb-master.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_ndb_stm_innodb.test b/mysql-test/t/rpl_ndb_stm_innodb.test new file mode 100644 index 00000000000..b92fbbcfce6 --- /dev/null +++ b/mysql-test/t/rpl_ndb_stm_innodb.test @@ -0,0 +1,62 @@ +--source include/have_ndb.inc +--source include/have_innodb.inc +--source include/have_binlog_format_mixed_or_statement.inc +--source include/master-slave.inc + +--connection master +create table t1 (a int key, b int) engine innodb; +create table t2 (a int key, b int) engine innodb; + +--sync_slave_with_master +--connection slave +alter table t1 engine ndb; +alter table t2 engine ndb; + +# check binlog position without begin +--connection master +insert into t1 values (1,2); + +--sync_slave_with_master +--connection slave +--replace_column 1 2 +select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status; +--let $start_pos = `select @start_pos` +--let $end_pos = `select @end_pos` + +--connection master +# here is actually a bug, since there is no begin statement, the +# query is autocommitted, and end_pos shows end of the insert and not +# end of the commit +--replace_result $start_pos +--replace_column 5 # +--eval show binlog events from $start_pos limit 1 +--replace_result $start_pos $end_pos +--replace_column 2 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ +--eval show binlog events from $start_pos limit 1,1 + +# check binlog position with begin +--connection master +begin; +insert into t1 values (2,3); +insert into t2 values (3,4); +commit; + +--sync_slave_with_master +--connection slave +--replace_column 1 2 +select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status; +--let $start_pos = `select @start_pos` +--let $end_pos = `select @end_pos` + +--connection master +--replace_result $start_pos +--replace_column 5 # +--eval show binlog events from $start_pos limit 1 +--replace_result $start_pos +--replace_column 2 # 4 # 5 # +--eval show binlog events from $start_pos limit 1,2 +--replace_result $start_pos $end_pos +--replace_column 2 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ +--eval show binlog events from $start_pos limit 3,1 diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 353dd806448..416cd18d924 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4123,6 +4123,58 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd, - refresh list of the indexes for the table if needed (if altered) */ +#ifdef HAVE_NDB_BINLOG +extern MASTER_INFO *active_mi; +static int ndbcluster_update_apply_status(THD *thd, int do_update) +{ + Thd_ndb *thd_ndb= get_thd_ndb(thd); + Ndb *ndb= thd_ndb->ndb; + NDBDICT *dict= ndb->getDictionary(); + const NDBTAB *ndbtab; + NdbTransaction *trans= thd_ndb->all ? thd_ndb->all : thd_ndb->stmt; + ndb->setDatabaseName(NDB_REP_DB); + Ndb_table_guard ndbtab_g(dict, NDB_APPLY_TABLE); + if (!(ndbtab= ndbtab_g.get_table())) + { + return -1; + } + NdbOperation *op= 0; + int r= 0; + r|= (op= trans->getNdbOperation(ndbtab)) == 0; + DBUG_ASSERT(r == 0); + if (do_update) + r|= op->updateTuple(); + else + r|= op->writeTuple(); + DBUG_ASSERT(r == 0); + // server_id + r|= op->equal(0u, (Uint64)thd->server_id); + DBUG_ASSERT(r == 0); + if (!do_update) + { + // epoch + r|= op->setValue(1u, (Uint64)0); + DBUG_ASSERT(r == 0); + } + // log_name + char tmp_buf[FN_REFLEN]; + ndb_pack_varchar(ndbtab->getColumn(2u), tmp_buf, + active_mi->rli.group_master_log_name, + strlen(active_mi->rli.group_master_log_name)); + r|= op->setValue(2u, tmp_buf); + DBUG_ASSERT(r == 0); + // start_pos + r|= op->setValue(3u, (Uint64)active_mi->rli.group_master_log_pos); + DBUG_ASSERT(r == 0); + // end_pos + r|= op->setValue(4u, (Uint64)active_mi->rli.group_master_log_pos + + ((Uint64)active_mi->rli.future_event_relay_log_pos - + (Uint64)active_mi->rli.group_relay_log_pos)); + DBUG_ASSERT(r == 0); + return 0; +} +#endif /* HAVE_NDB_BINLOG */ + int ha_ndbcluster::external_lock(THD *thd, int lock_type) { int error=0; @@ -4173,6 +4225,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) thd_ndb->init_open_tables(); thd_ndb->stmt= trans; thd_ndb->query_state&= NDB_QUERY_NORMAL; + thd_ndb->trans_options= 0; trans_register_ha(thd, FALSE, ndbcluster_hton); } else @@ -4189,6 +4242,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) thd_ndb->init_open_tables(); thd_ndb->all= trans; thd_ndb->query_state&= NDB_QUERY_NORMAL; + thd_ndb->trans_options= 0; trans_register_ha(thd, TRUE, ndbcluster_hton); /* @@ -4229,7 +4283,10 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) // Start of transaction m_rows_changed= 0; m_ops_pending= 0; - +#ifdef HAVE_NDB_BINLOG + if (m_share == ndb_apply_status_share && thd->slave_thread) + thd_ndb->trans_options|= TNTO_INJECTED_APPLY_STATUS; +#endif // TODO remove double pointers... m_thd_ndb_share= thd_ndb->get_open_table(thd, m_table); m_table_info= &m_thd_ndb_share->stat; @@ -4372,6 +4429,11 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all) "stmt" : "all")); DBUG_ASSERT(ndb && trans); +#ifdef HAVE_NDB_BINLOG + if (thd->slave_thread) + ndbcluster_update_apply_status(thd, thd_ndb->trans_options & TNTO_INJECTED_APPLY_STATUS); +#endif /* HAVE_NDB_BINLOG */ + if (execute_commit(thd,trans) != 0) { const NdbError err= trans->getNdbError(); diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 6cc0e423f2f..98f6efe15d8 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -593,6 +593,11 @@ enum THD_NDB_OPTIONS TNO_NO_LOG_SCHEMA_OP= 1 << 0 }; +enum THD_NDB_TRANS_OPTIONS +{ + TNTO_INJECTED_APPLY_STATUS= 1 << 0 +}; + struct Ndb_local_table_statistics { int no_uncommitted_rows_count; ulong last_count; @@ -620,6 +625,7 @@ class Thd_ndb NdbTransaction *stmt; int error; uint32 options; + uint32 trans_options; List changed_tables; uint query_state; HASH open_tables; diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 8b51ac68e66..060bc0beff4 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -953,8 +953,8 @@ static void ndbcluster_get_schema(NDB_SHARE *share, /* helper function to pack a ndb varchar */ -static char *ndb_pack_varchar(const NDBCOL *col, char *buf, - const char *str, int sz) +char *ndb_pack_varchar(const NDBCOL *col, char *buf, + const char *str, int sz) { switch (col->getArrayType()) { diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h index 00fc689f061..7864cf3c0aa 100644 --- a/sql/ha_ndbcluster_binlog.h +++ b/sql/ha_ndbcluster_binlog.h @@ -181,6 +181,8 @@ int ndbcluster_find_all_files(THD *thd); void ndb_unpack_record(TABLE *table, NdbValue *value, MY_BITMAP *defined, byte *buf); +char *ndb_pack_varchar(const NDBCOL *col, char *buf, + const char *str, int sz); NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, From efaf8c748cc1c6ee33f9265fa2f5818f8d5a0682 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 08:04:25 +0200 Subject: [PATCH 531/789] Work around for bug#27606 --- mysql-test/r/rpl_ignore_table.result | 2 +- mysql-test/t/rpl_ignore_table.test | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/r/rpl_ignore_table.result index 80cff7c9a1e..9b9146be5a6 100644 --- a/mysql-test/r/rpl_ignore_table.result +++ b/mysql-test/r/rpl_ignore_table.result @@ -119,8 +119,8 @@ drop table t1, t4, mysqltest2.t2; drop database mysqltest2; delete from mysql.user where user like "mysqltest%"; delete from mysql.db where user like "mysqltest%"; -delete from mysql.tables_priv where user like "mysqltest%"; delete from mysql.columns_priv where user like "mysqltest%"; +delete from mysql.tables_priv where user like "mysqltest%"; DROP TABLE IF EXISTS t5; CREATE TABLE t5 ( word varchar(50) collate utf8_unicode_ci NOT NULL default '' diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/t/rpl_ignore_table.test index 72fd7f1db72..f678e0a7cc1 100644 --- a/mysql-test/t/rpl_ignore_table.test +++ b/mysql-test/t/rpl_ignore_table.test @@ -124,10 +124,16 @@ drop table t1, t4, mysqltest2.t2; drop database mysqltest2; delete from mysql.user where user like "mysqltest%"; delete from mysql.db where user like "mysqltest%"; -delete from mysql.tables_priv where user like "mysqltest%"; +# +# BUG 27606 causes failure to replicate this statement +# move it to slave instead +#delete from mysql.tables_priv where user like "mysqltest%"; delete from mysql.columns_priv where user like "mysqltest%"; sync_slave_with_master; +#BUG27606 +delete from mysql.tables_priv where user like "mysqltest%"; + connection master; # From e4f490c163643d1c137f5fd73531d40efedcd0f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 09:30:05 +0200 Subject: [PATCH 532/789] remove unused List --- sql/ha_ndbcluster.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 6e857c5f06b..367187cbd9c 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -8413,7 +8413,6 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) { THD *thd; /* needs to be first for thread_stack */ struct timespec abstime; - List util_open_tables; Thd_ndb *thd_ndb; uint share_list_size= 0; NDB_SHARE **share_list= NULL; From 52f82d52117fa7f76e1fd7204b8eaa1f757acd0b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 09:53:15 +0200 Subject: [PATCH 533/789] Bug #26783 replication status unknown after cluster or mysqld failure - correction, wrong datatype used --- sql/ha_ndbcluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 6866111a48f..713b041bf07 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4148,7 +4148,7 @@ static int ndbcluster_update_apply_status(THD *thd, int do_update) r|= op->writeTuple(); DBUG_ASSERT(r == 0); // server_id - r|= op->equal(0u, (Uint64)thd->server_id); + r|= op->equal(0u, (Uint32)thd->server_id); DBUG_ASSERT(r == 0); if (!do_update) { From e10f4df4147cf684f09435a969971ce6f97132f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 16:40:16 +0800 Subject: [PATCH 534/789] Bug#25875, Newly created table through CREATE TABLE .. LIKE has no ndb_dd attributes sql/sql_table.cc: add something to get possible tablespace info from src table in mysql_create_like_table() at sql/sql_table.cc --- sql/sql_table.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0697fdd79b4..ab833ebe6b9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4611,6 +4611,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, #ifdef WITH_PARTITION_STORAGE_ENGINE char tmp_path[FN_REFLEN]; #endif + char ts_name[FN_LEN]; TABLE_LIST src_tables_list, dst_tables_list; DBUG_ENTER("mysql_create_like_table"); @@ -4691,6 +4692,18 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, if (simple_open_n_lock_tables(thd, &src_tables_list)) DBUG_RETURN(TRUE); + /* + For bug#25875, Newly created table through CREATE TABLE .. LIKE + has no ndb_dd attributes; + Add something to get possible tablespace info from src table, + it can get valid tablespace name only for disk-base ndb table + */ + if ((src_tables_list.table->file->get_tablespace_name(thd, ts_name, FN_LEN))) + { + create_info->tablespace= ts_name; + create_info->storage_media= HA_SM_DISK; + } + /* Validate the destination table From 6e5ca12b6a6f6404246f398456371a81a228070e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 14:24:35 +0500 Subject: [PATCH 535/789] Bug#27327 information_schema status views, variable_value conversion Type of 'Slave_running' status variable is changed to bool mysql-test/r/compress.result: test result mysql-test/r/rpl_packet.result: test result mysql-test/t/compress.test: test case mysql-test/t/rpl_packet.test: test case sql/mysqld.cc: Type of 'Slave_running' status variable is changed to bool --- mysql-test/r/compress.result | 3 +++ mysql-test/r/rpl_packet.result | 6 ++++++ mysql-test/t/compress.test | 1 + mysql-test/t/rpl_packet.test | 2 ++ sql/mysqld.cc | 7 ++++--- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result index 0aebc817146..11b15ed7675 100644 --- a/mysql-test/r/compress.result +++ b/mysql-test/r/compress.result @@ -1,6 +1,9 @@ SHOW STATUS LIKE 'Compression'; Variable_name Value Compression ON +select * from information_schema.session_status where variable_name= 'COMPRESSION'; +VARIABLE_NAME VARIABLE_VALUE +COMPRESSION 1.0000000 drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/r/rpl_packet.result index 894bc81b08d..8f4a16341b6 100644 --- a/mysql-test/r/rpl_packet.result +++ b/mysql-test/r/rpl_packet.result @@ -14,6 +14,12 @@ INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */; count(*) 1 +SHOW STATUS LIKE 'Slave_running'; +Variable_name Value +Slave_running ON +select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING'; +VARIABLE_NAME VARIABLE_VALUE +SLAVE_RUNNING 1.0000000 drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; SET @@global.max_allowed_packet=4096; SET @@global.net_buffer_length=4096; diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test index 3f1892b5dec..cd40aef002c 100644 --- a/mysql-test/t/compress.test +++ b/mysql-test/t/compress.test @@ -10,6 +10,7 @@ connect (comp_con,localhost,root,,,,,COMPRESS); # Check compression turned on SHOW STATUS LIKE 'Compression'; +select * from information_schema.session_status where variable_name= 'COMPRESSION'; # Source select test case -- source include/common-tests.inc diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/t/rpl_packet.test index db6f475dc94..466f5d75a0a 100644 --- a/mysql-test/t/rpl_packet.test +++ b/mysql-test/t/rpl_packet.test @@ -29,6 +29,8 @@ connection slave; sync_with_master; eval select count(*) from `$db`.`t1` /* must be 1 */; +SHOW STATUS LIKE 'Slave_running'; +select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING'; connection master; eval drop database $db; save_master_pos; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5031496158b..cfbf01a6622 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6513,10 +6513,11 @@ static int show_rpl_status(THD *thd, SHOW_VAR *var, char *buff) static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff) { - var->type= SHOW_CHAR; + var->type= SHOW_MY_BOOL; pthread_mutex_lock(&LOCK_active_mi); - var->value= const_cast((active_mi && active_mi->slave_running && - active_mi->rli.slave_running) ? "ON" : "OFF"); + var->value= buff; + *((my_bool *)buff)= (my_bool) (active_mi && active_mi->slave_running && + active_mi->rli.slave_running); pthread_mutex_unlock(&LOCK_active_mi); return 0; } From 48b3529cbedd97d40edddb34431fef11415e937d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 11:36:33 +0200 Subject: [PATCH 536/789] Cleanup tables created by test cases mysql-test/r/crash_commit_before.result: Cleanup mysql-test/r/rpl_ignore_table.result: Cleanup mysql-test/r/rpl_packet.result: Cleanup mysql-test/r/rpl_ssl.result: Cleanup mysql-test/t/crash_commit_before.test: Cleanup mysql-test/t/rpl_ignore_table.test: Cleanup mysql-test/t/rpl_packet.test: Cleanup mysql-test/t/rpl_ssl.test: Cleanup --- mysql-test/r/crash_commit_before.result | 1 + mysql-test/r/rpl_ignore_table.result | 1 + mysql-test/r/rpl_packet.result | 2 ++ mysql-test/r/rpl_ssl.result | 2 ++ mysql-test/t/crash_commit_before.test | 3 +++ mysql-test/t/rpl_ignore_table.test | 3 +++ mysql-test/t/rpl_packet.test | 6 ++++++ mysql-test/t/rpl_ssl.test | 6 ++++++ 8 files changed, 24 insertions(+) diff --git a/mysql-test/r/crash_commit_before.result b/mysql-test/r/crash_commit_before.result index 8eba584c539..34fb3284bae 100644 --- a/mysql-test/r/crash_commit_before.result +++ b/mysql-test/r/crash_commit_before.result @@ -11,3 +11,4 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t1; a +DROP TABLE t1; diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/r/rpl_ignore_table.result index 9b9146be5a6..e7200b31212 100644 --- a/mysql-test/r/rpl_ignore_table.result +++ b/mysql-test/r/rpl_ignore_table.result @@ -121,6 +121,7 @@ delete from mysql.user where user like "mysqltest%"; delete from mysql.db where user like "mysqltest%"; delete from mysql.columns_priv where user like "mysqltest%"; delete from mysql.tables_priv where user like "mysqltest%"; +delete from mysql.tables_priv where user like "mysqltest%"; DROP TABLE IF EXISTS t5; CREATE TABLE t5 ( word varchar(50) collate utf8_unicode_ci NOT NULL default '' diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/r/rpl_packet.result index 894bc81b08d..a1ec39ece30 100644 --- a/mysql-test/r/rpl_packet.result +++ b/mysql-test/r/rpl_packet.result @@ -24,3 +24,5 @@ INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SHOW STATUS LIKE 'Slave_running'; Variable_name Value Slave_running OFF +drop table t1; +drop table t1; diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result index f68b639b12d..50e2db35165 100644 --- a/mysql-test/r/rpl_ssl.result +++ b/mysql-test/r/rpl_ssl.result @@ -93,3 +93,5 @@ Master_SSL_Cipher Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No +drop user replssl@localhost; +drop table t1; diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test index 5a91cd7a7ad..4e212d81e66 100644 --- a/mysql-test/t/crash_commit_before.test +++ b/mysql-test/t/crash_commit_before.test @@ -30,3 +30,6 @@ COMMIT; SHOW CREATE TABLE t1; SELECT * FROM t1; + + +DROP TABLE t1; diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/t/rpl_ignore_table.test index f678e0a7cc1..fd4ae64165a 100644 --- a/mysql-test/t/rpl_ignore_table.test +++ b/mysql-test/t/rpl_ignore_table.test @@ -136,6 +136,9 @@ delete from mysql.tables_priv where user like "mysqltest%"; connection master; +#BUG27606 +delete from mysql.tables_priv where user like "mysqltest%"; + # # bug#22877 replication character sets get out of sync # using replicate-wild-ignore-table diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/t/rpl_packet.test index db6f475dc94..a1e933e2e88 100644 --- a/mysql-test/t/rpl_packet.test +++ b/mysql-test/t/rpl_packet.test @@ -68,5 +68,11 @@ connection slave; sleep 2; SHOW STATUS LIKE 'Slave_running'; +# cleanup +connection master; +drop table t1; +connection slave; +drop table t1; + # End of tests diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test index 9f25f71525a..5b5f12c91df 100644 --- a/mysql-test/t/rpl_ssl.test +++ b/mysql-test/t/rpl_ssl.test @@ -58,3 +58,9 @@ sync_slave_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # query_vertical show slave status; + +connection master; +drop user replssl@localhost; +drop table t1; +sync_slave_with_master; + From 5203ea6ccb349aae5e53e3f0247256a9fc60208e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 18:44:29 +0800 Subject: [PATCH 537/789] BUG#18676 when cluster storage engine is down, misleading error message on create table with 4009. mysql-test/r/ndb_autodiscover.result: changes ndbd error code to mysqld error code when no cluster connection sql/ha_ndbcluster.cc: map 4009 error code to mysql not connected error sql/handler.cc: define return codes to ha_table_exists_in_engine to something useful NOTE: in 5.1 this should call a handlerton method, not horrible ifdef ndb stuff sql/sql_table.cc: clearly define what happens on create table if exits/not exists/not connected to engine --- mysql-test/r/ndb_autodiscover.result | 2 +- sql/ha_ndbcluster.cc | 11 +++++------ sql/handler.cc | 8 ++++---- sql/sql_table.cc | 25 +++++++++++++++++++------ 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 6d1b7eb152d..01ea884a8ba 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -382,7 +382,7 @@ create table t1 (a int primary key) engine=ndb; select * from t1; a select * from t1; -ERROR HY000: Can't lock file (errno: 4009) +ERROR HY000: Can't lock file (errno: 157) use test; drop database test_only_ndb_tables; CREATE TABLE t9 ( diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7a9c7d0d021..ead7343db88 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -203,6 +203,8 @@ static const err_code_mapping err_map[]= { 284, HA_ERR_TABLE_DEF_CHANGED, 0 }, + {4009, HA_ERR_NO_CONNECTION, 1 }, + { 0, 1, 0 }, { -1, -1, 1 } @@ -5042,14 +5044,11 @@ int ndbcluster_table_exists_in_engine(THD* thd, const char *db, const char *name dict->invalidateTable(name); if (!(tab= dict->getTable(name))) { - const NdbError err= dict->getNdbError(); - if (err.code == 709) - DBUG_RETURN(0); - ERR_RETURN(err); + ERR_RETURN(dict->getNdbError()); } DBUG_PRINT("info", ("Found table %s", tab->getName())); - DBUG_RETURN(1); + DBUG_RETURN(HA_ERR_TABLE_EXIST); } @@ -5234,7 +5233,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, DBUG_PRINT("info", ("%s existed on disk", name)); // The .ndb file exists on disk, but it's not in list of tables in ndb // Verify that handler agrees table is gone. - if (ndbcluster_table_exists_in_engine(thd, db, file_name) == 0) + if (ndbcluster_table_exists_in_engine(thd, db, file_name) == HA_ERR_NO_SUCH_TABLE) { DBUG_PRINT("info", ("NDB says %s does not exists", file_name)); it.remove(); diff --git a/sql/handler.cc b/sql/handler.cc index 5a27e470d70..62f765f0d22 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2442,14 +2442,14 @@ ha_find_files(THD *thd,const char *db,const char *path, Ask handler if the table exists in engine RETURN - 0 Table does not exist - 1 Table exists - # Error code + HA_ERR_NO_SUCH_TABLE Table does not exist + HA_ERR_TABLE_EXIST Table exists + # Error code */ int ha_table_exists_in_engine(THD* thd, const char* db, const char* name) { - int error= 0; + int error= HA_ERR_NO_SUCH_TABLE; DBUG_ENTER("ha_table_exists_in_engine"); DBUG_PRINT("enter", ("db: %s, name: %s", db, name)); #ifdef HAVE_NDBCLUSTER_DB diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 512d990347f..1ad1cb6426b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1696,6 +1696,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, alias); DBUG_RETURN(FALSE); } + DBUG_PRINT("info",("1")); my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias); DBUG_RETURN(TRUE); } @@ -1706,6 +1707,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, { if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS) goto warn; + DBUG_PRINT("info",("2")); my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name); goto end; } @@ -1724,14 +1726,25 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name, { bool create_if_not_exists = create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS; - if (ha_table_exists_in_engine(thd, db, table_name)) + int retcode = ha_table_exists_in_engine(thd, db, table_name); + DBUG_PRINT("info", ("exists_in_engine: %u",retcode)); + switch (retcode) { - DBUG_PRINT("info", ("Table with same name already existed in handler")); + case HA_ERR_NO_SUCH_TABLE: + /* Normal case, no table exists. we can go and create it */ + break; + case HA_ERR_TABLE_EXIST: + DBUG_PRINT("info", ("Table existed in handler")); - if (create_if_not_exists) - goto warn; - my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name); - goto end; + if (create_if_not_exists) + goto warn; + my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name); + goto end; + break; + default: + DBUG_PRINT("info", ("error: %u from storage engine", retcode)); + my_error(retcode, MYF(0),table_name); + goto end; } } From e0f91f2262f05a5e8b031b9c09c73211999073e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 12:57:18 +0200 Subject: [PATCH 538/789] Bug #17095 Cluster RBR in circle does not terminate - add any value to ndb - use it to update correct server id in binlog thread sql/ha_ndbcluster.cc: ndb: use "any value" to set correct server_id sql/ha_ndbcluster_binlog.cc: ndb: use "any value" to set correct server_id storage/ndb/include/kernel/AttributeHeader.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/include/kernel/signaldata/SumaImpl.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/include/ndbapi/NdbDictionary.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/include/ndbapi/NdbEventOperation.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/include/ndbapi/NdbOperation.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/kernel/blocks/suma/Suma.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/ndbapi/NdbEventOperation.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/ndbapi/NdbOperationDefine.cpp: add any_value as psudo column, updatable from ndbapi storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: add any_value as psudo column, updatable from ndbapi --- sql/ha_ndbcluster.cc | 13 +++++++++ sql/ha_ndbcluster_binlog.cc | 15 +++++++---- .../ndb/include/kernel/AttributeHeader.hpp | 3 ++- .../include/kernel/signaldata/FireTrigOrd.hpp | 17 +++++++++++- .../include/kernel/signaldata/SumaImpl.hpp | 5 +++- storage/ndb/include/ndbapi/NdbDictionary.hpp | 1 + .../ndb/include/ndbapi/NdbEventOperation.hpp | 7 +++++ storage/ndb/include/ndbapi/NdbOperation.hpp | 3 +++ storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 1 + .../src/kernel/blocks/dbtup/DbtupAbort.cpp | 1 + .../kernel/blocks/dbtup/DbtupExecQuery.cpp | 12 +++++++-- .../ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 1 + .../src/kernel/blocks/dbtup/DbtupRoutines.cpp | 21 +++++++++++++++ .../blocks/dbtup/DbtupStoredProcDef.cpp | 2 ++ .../src/kernel/blocks/dbtup/DbtupTrigger.cpp | 3 ++- storage/ndb/src/kernel/blocks/suma/Suma.cpp | 17 +++++++----- storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 6 +++++ storage/ndb/src/ndbapi/NdbEventOperation.cpp | 6 +++++ .../ndb/src/ndbapi/NdbEventOperationImpl.cpp | 6 +++++ .../ndb/src/ndbapi/NdbEventOperationImpl.hpp | 1 + storage/ndb/src/ndbapi/NdbOperationDefine.cpp | 27 +++++++++++++++++++ .../ndb/src/ndbapi/ndb_cluster_connection.cpp | 4 +++ 22 files changed, 155 insertions(+), 17 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 713b041bf07..25d68968b55 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2712,6 +2712,9 @@ int ha_ndbcluster::write_row(byte *record) op->setValue(no_fields, part_func_value); } + if (thd->slave_thread) + op->setAnyValue(thd->server_id); + m_rows_changed++; /* @@ -2992,6 +2995,10 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) no_fields++; op->setValue(no_fields, part_func_value); } + + if (thd->slave_thread) + op->setAnyValue(thd->server_id); + // Execute update operation if (!cursor && execute_no_commit(this,trans,FALSE) != 0) { no_uncommitted_rows_execute_failure(); @@ -3047,6 +3054,9 @@ int ha_ndbcluster::delete_row(const byte *record) no_uncommitted_rows_update(-1); + if (thd->slave_thread) + ((NdbOperation *)trans->getLastDefinedOperation())->setAnyValue(thd->server_id); + if (!m_primary_key_update) // If deleting from cursor, NoCommit will be handled in next_result DBUG_RETURN(0); @@ -3076,6 +3086,9 @@ int ha_ndbcluster::delete_row(const byte *record) if ((error= set_primary_key_from_record(op, record))) DBUG_RETURN(error); } + + if (thd->slave_thread) + op->setAnyValue(thd->server_id); } // Execute delete operation diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 074e71671c7..e5b4cffa7fb 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -3189,8 +3189,12 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp, NDB_SHARE *share= (NDB_SHARE*) pOp->getCustomData(); if (share == ndb_apply_status_share) return 0; - TABLE *table= share->table; + uint originating_server_id= pOp->getAnyValue(); + if (originating_server_id == 0) + originating_server_id= ::server_id; + + TABLE *table= share->table; DBUG_ASSERT(trans.good()); DBUG_ASSERT(table != 0); @@ -3235,7 +3239,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp, DBUG_ASSERT(ret == 0); } ndb_unpack_record(table, share->ndb_value[0], &b, table->record[0]); - IF_DBUG(int ret=) trans.write_row(::server_id, + IF_DBUG(int ret=) trans.write_row(originating_server_id, injector::transaction::table(table, TRUE), &b, n_fields, table->record[0]); @@ -3275,7 +3279,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp, } ndb_unpack_record(table, share->ndb_value[n], &b, table->record[n]); DBUG_EXECUTE("info", print_records(table, table->record[n]);); - IF_DBUG(int ret =) trans.delete_row(::server_id, + IF_DBUG(int ret =) trans.delete_row(originating_server_id, injector::transaction::table(table, TRUE), &b, n_fields, table->record[n]); @@ -3305,7 +3309,8 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp, since table has a primary key, we can do a write using only after values */ - trans.write_row(::server_id, injector::transaction::table(table, TRUE), + trans.write_row(originating_server_id, + injector::transaction::table(table, TRUE), &b, n_fields, table->record[0]);// after values } else @@ -3325,7 +3330,7 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp, } ndb_unpack_record(table, share->ndb_value[1], &b, table->record[1]); DBUG_EXECUTE("info", print_records(table, table->record[1]);); - IF_DBUG(int ret =) trans.update_row(::server_id, + IF_DBUG(int ret =) trans.update_row(originating_server_id, injector::transaction::table(table, TRUE), &b, n_fields, diff --git a/storage/ndb/include/kernel/AttributeHeader.hpp b/storage/ndb/include/kernel/AttributeHeader.hpp index ad2ca582914..2d013b31156 100644 --- a/storage/ndb/include/kernel/AttributeHeader.hpp +++ b/storage/ndb/include/kernel/AttributeHeader.hpp @@ -45,7 +45,8 @@ public: STATIC_CONST( ROWID = 0xFFF6 ); STATIC_CONST( ROW_GCI = 0xFFF5 ); STATIC_CONST( FRAGMENT_VARSIZED_MEMORY = 0xFFF4 ); - + STATIC_CONST( ANY_VALUE = 0xFFF3 ); + // NOTE: in 5.1 ctors and init take size in bytes /** Initialize AttributeHeader at location aHeaderPtr */ diff --git a/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp b/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp index 52e52e73c36..d33f8be3650 100644 --- a/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp +++ b/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp @@ -53,7 +53,7 @@ class FireTrigOrd { public: STATIC_CONST( SignalLength = 8 ); STATIC_CONST( SignalWithGCILength = 9 ); - STATIC_CONST( SignalWithHashValueLength = 10 ); + STATIC_CONST( SignalLengthSuma = 11 ); private: Uint32 m_connectionPtr; @@ -66,6 +66,7 @@ private: Uint32 fragId; Uint32 m_gci; Uint32 m_hashValue; + Uint32 m_any_value; // Public methods public: Uint32 getConnectionPtr() const; @@ -86,6 +87,8 @@ public: void setGCI(Uint32); Uint32 getHashValue() const; void setHashValue(Uint32); + Uint32 getAnyValue() const; + void setAnyValue(Uint32); }; inline @@ -196,5 +199,17 @@ void FireTrigOrd::setHashValue(Uint32 flag) m_hashValue = flag; } +inline +Uint32 FireTrigOrd::getAnyValue() const +{ + return m_any_value; +} + +inline +void FireTrigOrd::setAnyValue(Uint32 any_value) +{ + m_any_value = any_value; +} + #endif diff --git a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp index 077ea8e879c..2ed9d8cddc6 100644 --- a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp +++ b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -303,7 +303,10 @@ struct SubTableData { Uint32 tableId; Uint32 requestInfo; Uint32 logType; - Uint32 changeMask; + union { + Uint32 changeMask; + Uint32 anyValue; + }; Uint32 totalLen; static void setOperation(Uint32& ri, Uint32 val) { diff --git a/storage/ndb/include/ndbapi/NdbDictionary.hpp b/storage/ndb/include/ndbapi/NdbDictionary.hpp index 0a012f867f2..b1bdec6cace 100644 --- a/storage/ndb/include/ndbapi/NdbDictionary.hpp +++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp @@ -534,6 +534,7 @@ public: static const Column * RECORDS_IN_RANGE; static const Column * ROWID; static const Column * ROW_GCI; + static const Column * ANY_VALUE; int getSizeInBytes() const; #endif diff --git a/storage/ndb/include/ndbapi/NdbEventOperation.hpp b/storage/ndb/include/ndbapi/NdbEventOperation.hpp index d56b79dc2e6..437088d2893 100644 --- a/storage/ndb/include/ndbapi/NdbEventOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbEventOperation.hpp @@ -202,6 +202,13 @@ public: */ Uint64 getGCI() const; + /** + * Retrieve the AnyValue of the latest retrieved event + * + * @return AnyValue + */ + Uint32 getAnyValue() const; + /** * Retrieve the complete GCI in the cluster (not necessarily * associated with an event) diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp index 380926c6a41..61ea71e7021 100644 --- a/storage/ndb/include/ndbapi/NdbOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbOperation.hpp @@ -413,6 +413,9 @@ public: int setValue(const char* anAttrName, Uint64 aValue); int setValue(const char* anAttrName, float aValue); int setValue(const char* anAttrName, double aValue); +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + int setAnyValue(Uint32 aValue); +#endif #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED int setValue(Uint32 anAttrId, const char* aValue, Uint32 len); diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 3380131a01e..f7757ad2ca7 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -753,6 +753,7 @@ struct Operationrec { union { Uint32 firstAttrinbufrec; //Used until copyAttrinfo }; + Uint32 m_any_value; union { Uint32 lastAttrinbufrec; //Used until copyAttrinfo Uint32 nextPool; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp index ea2c69b5751..563c113ca3d 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp @@ -35,6 +35,7 @@ void Dbtup::freeAllAttrBuffers(Operationrec* const regOperPtr) }//if regOperPtr->firstAttrinbufrec = RNIL; regOperPtr->lastAttrinbufrec = RNIL; + regOperPtr->m_any_value = 0; }//Dbtup::freeAllAttrBuffers() void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf) diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index d7476f5f69d..cc501f8d366 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -102,6 +102,7 @@ void Dbtup::copyAttrinfo(Operationrec * regOperPtr, regOperPtr->storedProcedureId= RNIL; regOperPtr->firstAttrinbufrec= RNIL; regOperPtr->lastAttrinbufrec= RNIL; + regOperPtr->m_any_value= 0; } void Dbtup::handleATTRINFOforTUPKEYREQ(Signal* signal, @@ -811,6 +812,7 @@ void Dbtup::execTUPKEYREQ(Signal* signal) else if(Roptype == ZDELETE) { jam(); + req_struct.log_size= 0; if (handleDeleteReq(signal, regOperPtr, regFragPtr, regTabPtr, &req_struct, @@ -829,7 +831,6 @@ void Dbtup::execTUPKEYREQ(Signal* signal) regOperPtr, regTabPtr); set_change_mask_state(regOperPtr, DELETE_CHANGES); - req_struct.log_size= 0; sendTUPKEYCONF(signal, &req_struct, regOperPtr); return; } @@ -1536,7 +1537,14 @@ int Dbtup::handleDeleteReq(Signal* signal, if (setup_read(req_struct, regOperPtr, regFragPtr, regTabPtr, disk)) { - return handleReadReq(signal, regOperPtr, regTabPtr, req_struct); + Uint32 RlogSize; + int ret= handleReadReq(signal, regOperPtr, regTabPtr, req_struct); + if (ret == 0 && (RlogSize= req_struct->log_size)) + { + jam(); + sendLogAttrinfo(signal, RlogSize, regOperPtr); + } + return ret; } error: diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index a3e21a2a203..ef242da2a43 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -680,6 +680,7 @@ void Dbtup::execTUPSEIZEREQ(Signal* signal) new (regOperPtr.p) Operationrec(); regOperPtr.p->firstAttrinbufrec = RNIL; regOperPtr.p->lastAttrinbufrec = RNIL; + regOperPtr.p->m_any_value = 0; regOperPtr.p->op_struct.op_type = ZREAD; regOperPtr.p->op_struct.in_active_list = false; set_trans_state(regOperPtr.p, TRANS_DISCONNECTED); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index 6e932f8a058..0a028ad512f 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -221,6 +221,18 @@ int Dbtup::readAttributes(KeyReqStruct *req_struct, return -1; } } else if(attributeId & AttributeHeader::PSEUDO) { + if (attributeId == AttributeHeader::ANY_VALUE) + { + jam(); + Uint32 RlogSize = req_struct->log_size; + operPtr.p->m_any_value = inBuffer[inBufIndex]; + * (clogMemBuffer + RlogSize) = inBuffer[inBufIndex - 1]; + * (clogMemBuffer + RlogSize + 1) = inBuffer[inBufIndex]; + inBufIndex++; + req_struct->out_buf_index = tmpAttrBufIndex; + req_struct->log_size = RlogSize + 2; + continue; + } jam(); Uint32 sz= read_pseudo(attributeId, req_struct, @@ -781,6 +793,15 @@ int Dbtup::updateAttributes(KeyReqStruct *req_struct, inBufIndex += 1 + sz; req_struct->in_buf_index = inBufIndex; } + else if(attributeId == AttributeHeader::ANY_VALUE) + { + jam(); + Uint32 sz= ahIn.getDataSize(); + ndbrequire(sz == 1); + regOperPtr->m_any_value = * (inBuffer + inBufIndex + 1); + inBufIndex += 1 + sz; + req_struct->in_buf_index = inBufIndex; + } else { jam(); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp index c1ccf5952da..12d5f8aba38 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp @@ -203,6 +203,7 @@ bool Dbtup::storedProcedureAttrInfo(Signal* signal, storedPtr.p->storedLinkLast = regOperPtr->lastAttrinbufrec; regOperPtr->firstAttrinbufrec = RNIL; regOperPtr->lastAttrinbufrec = RNIL; + regOperPtr->m_any_value = 0; set_trans_state(regOperPtr, TRANS_IDLE); signal->theData[0] = regOperPtr->userpointer; signal->theData[1] = storedPtr.i; @@ -220,6 +221,7 @@ void Dbtup::storedSeizeAttrinbufrecErrorLab(Signal* signal, storedPtr.p->storedLinkFirst = regOperPtr->firstAttrinbufrec; regOperPtr->firstAttrinbufrec = RNIL; regOperPtr->lastAttrinbufrec = RNIL; + regOperPtr->m_any_value = 0; set_trans_state(regOperPtr, TRANS_ERROR_WAIT_STORED_PROCREQ); signal->theData[0] = regOperPtr->userpointer; signal->theData[1] = ZSTORED_SEIZE_ATTRINBUFREC_ERROR; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp index 0c6a1491543..0d54f9c821b 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp @@ -1048,10 +1048,11 @@ void Dbtup::sendFireTrigOrd(Signal* signal, // send to backup directly for now fireTrigOrd->setGCI(req_struct->gci); fireTrigOrd->setHashValue(req_struct->hash_value); + fireTrigOrd->m_any_value = regOperPtr->m_any_value; EXECUTE_DIRECT(trigPtr->m_receiverBlock, GSN_FIRE_TRIG_ORD, signal, - FireTrigOrd::SignalWithHashValueLength); + FireTrigOrd::SignalLengthSuma); break; case (TriggerType::SUBSCRIPTION): jam(); diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index 4715e9fa2b4..6de0a00d844 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -3469,6 +3469,7 @@ Suma::execFIRE_TRIG_ORD(Signal* signal) const Uint32 hashValue = trg->getHashValue(); const Uint32 gci = trg->getGCI(); const Uint32 event = trg->getTriggerEvent(); + const Uint32 any_value = trg->getAnyValue(); TablePtr tabPtr; tabPtr.i = trigId & 0xFFFF; @@ -3509,7 +3510,7 @@ Suma::execFIRE_TRIG_ORD(Signal* signal) data->requestInfo = 0; SubTableData::setOperation(data->requestInfo, event); data->logType = 0; - data->changeMask = 0; + data->anyValue = any_value; data->totalLen = ptrLen; { @@ -3527,13 +3528,15 @@ Suma::execFIRE_TRIG_ORD(Signal* signal) } else { + const uint buffer_header_sz = 4; Uint32* dst; - Uint32 sz = f_trigBufferSize + b_trigBufferSize + 3; + Uint32 sz = f_trigBufferSize + b_trigBufferSize + buffer_header_sz; if((dst = get_buffer_ptr(signal, bucket, gci, sz))) { * dst++ = tableId; * dst++ = tabPtr.p->m_schemaVersion; * dst++ = (event << 16) | f_trigBufferSize; + * dst++ = any_value; memcpy(dst, f_buffer, f_trigBufferSize << 2); dst += f_trigBufferSize; memcpy(dst, b_buffer, b_trigBufferSize << 2); @@ -5029,18 +5032,20 @@ Suma::resend_bucket(Signal* signal, Uint32 buck, Uint32 min_gci, } else { + const uint buffer_header_sz = 4; g_cnt++; Uint32 table = * src++ ; Uint32 schemaVersion = * src++; Uint32 event = * src >> 16; Uint32 sz_1 = (* src ++) & 0xFFFF; - - ndbassert(sz - 3 >= sz_1); + Uint32 any_value = * src++; + + ndbassert(sz - buffer_header_sz >= sz_1); LinearSectionPtr ptr[3]; const Uint32 nptr= reformat(signal, ptr, src, sz_1, - src + sz_1, sz - 3 - sz_1); + src + sz_1, sz - buffer_header_sz - sz_1); Uint32 ptrLen= 0; for(Uint32 i =0; i < nptr; i++) ptrLen+= ptr[i].sz; @@ -5058,7 +5063,7 @@ Suma::resend_bucket(Signal* signal, Uint32 buck, Uint32 min_gci, data->requestInfo = 0; SubTableData::setOperation(data->requestInfo, event); data->logType = 0; - data->changeMask = 0; + data->anyValue = any_value; data->totalLen = ptrLen; { diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 2bd59c6e06f..180747bfb9b 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -378,6 +378,11 @@ NdbColumnImpl::create_pseudo(const char * name){ col->m_impl.m_attrSize = 8; col->m_impl.m_arraySize = 1; col->m_impl.m_nullable = true; + } else if(!strcmp(name, "NDB$ANY_VALUE")){ + col->setType(NdbDictionary::Column::Unsigned); + col->m_impl.m_attrId = AttributeHeader::ANY_VALUE; + col->m_impl.m_attrSize = 4; + col->m_impl.m_arraySize = 1; } else { abort(); } @@ -5100,3 +5105,4 @@ const NdbDictionary::Column * NdbDictionary::Column::DISK_REF = 0; const NdbDictionary::Column * NdbDictionary::Column::RECORDS_IN_RANGE = 0; const NdbDictionary::Column * NdbDictionary::Column::ROWID = 0; const NdbDictionary::Column * NdbDictionary::Column::ROW_GCI = 0; +const NdbDictionary::Column * NdbDictionary::Column::ANY_VALUE = 0; diff --git a/storage/ndb/src/ndbapi/NdbEventOperation.cpp b/storage/ndb/src/ndbapi/NdbEventOperation.cpp index 4d8e6a6aea5..5c6ed562dcc 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperation.cpp @@ -122,6 +122,12 @@ NdbEventOperation::getGCI() const return m_impl.getGCI(); } +Uint32 +NdbEventOperation::getAnyValue() const +{ + return m_impl.getAnyValue(); +} + Uint64 NdbEventOperation::getLatestGCI() const { diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp index b694b466530..c7221b88132 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -683,6 +683,12 @@ NdbEventOperationImpl::getGCI() return m_data_item->sdata->gci; } +Uint32 +NdbEventOperationImpl::getAnyValue() const +{ + return m_data_item->sdata->anyValue; +} + Uint64 NdbEventOperationImpl::getLatestGCI() { diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp index 6d58688fa88..3d71146588d 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp @@ -366,6 +366,7 @@ public: const bool tableFragmentationChanged() const; const bool tableRangeListChanged() const; Uint64 getGCI(); + Uint32 getAnyValue() const; Uint64 getLatestGCI(); bool execSUB_TABLE_DATA(NdbApiSignal * signal, LinearSectionPtr ptr[3]); diff --git a/storage/ndb/src/ndbapi/NdbOperationDefine.cpp b/storage/ndb/src/ndbapi/NdbOperationDefine.cpp index b5019cf7386..f818564642b 100644 --- a/storage/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/storage/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -571,6 +571,33 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, DBUG_RETURN(0); }//NdbOperation::setValue() + +int +NdbOperation::setAnyValue(Uint32 any_value) +{ + const NdbColumnImpl* impl = + &NdbColumnImpl::getImpl(* NdbDictionary::Column::ANY_VALUE); + OperationType tOpType = theOperationType; + OperationStatus tStatus = theStatus; + + switch(tOpType){ + case DeleteRequest:{ + Uint32 ah; + AttributeHeader::init(&ah, AttributeHeader::ANY_VALUE, 4); + if (insertATTRINFO(ah) != -1 && insertATTRINFO(any_value) != -1 ) + { + return 0; + } + } + default: + return setValue(impl, (const char *)&any_value); + } + + setErrorCodeAbort(4000); + return -1; +} + + NdbBlob* NdbOperation::getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* tAttrInfo) { diff --git a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp index a6c7c917ee2..964037017f1 100644 --- a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -328,6 +328,8 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * NdbColumnImpl::create_pseudo("NDB$ROWID"); NdbDictionary::Column::ROW_GCI= NdbColumnImpl::create_pseudo("NDB$ROW_GCI"); + NdbDictionary::Column::ANY_VALUE= + NdbColumnImpl::create_pseudo("NDB$ANY_VALUE"); } NdbMutex_Unlock(g_ndb_connection_mutex); @@ -382,6 +384,7 @@ Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl() delete NdbDictionary::Column::RECORDS_IN_RANGE; delete NdbDictionary::Column::ROWID; delete NdbDictionary::Column::ROW_GCI; + delete NdbDictionary::Column::ANY_VALUE; NdbDictionary::Column::FRAGMENT= 0; NdbDictionary::Column::FRAGMENT_FIXED_MEMORY= 0; NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY= 0; @@ -393,6 +396,7 @@ Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl() NdbDictionary::Column::RECORDS_IN_RANGE= 0; NdbDictionary::Column::ROWID= 0; NdbDictionary::Column::ROW_GCI= 0; + NdbDictionary::Column::ANY_VALUE= 0; } NdbMutex_Unlock(g_ndb_connection_mutex); From 7e08016a91dc8d24110a73b5286f947718a9379e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 15:11:34 +0400 Subject: [PATCH 539/789] Fix for BUG#27337: Privileges are not properly restored. The problem was that THD::db_access variable was not restored after database switch in stored-routine-execution code. The fix is to restore THD::db_access in this case. Unfortunately, this fix requires additional changes, because in prepare_schema_table(), called on the parsing stage, we checked privileges. That was wrong according to our design, but this flaw haven't struck so far, because it was masked. All privilege checkings must be done on the execution stage in order to be compatible with prepared statements and stored routines. So, this patch also contains patch for prepare_schema_table(), which moves the checkings to the execution phase. mysql-test/r/grant.result: Updated result file. mysql-test/t/grant.test: Added test case for BUG#27337. sql/mysql_priv.h: Added function declaration. sql/sql_db.cc: Fix for BUG#27337 -- set THD::db_access even if we're called from stored-routine-execution code. sql/sql_parse.cc: Split prepare_schema_table() into two functions: - prepare_schema_table(), which is called from the parser (parsing stage); - check_show_access(), which is called on the execution stage. sql/sql_show.cc: Ignore schema_select_lex member if its table is NULL. --- mysql-test/r/grant.result | 75 +++++++++++++++++ mysql-test/t/grant.test | 144 ++++++++++++++++++++++++++++++++ sql/mysql_priv.h | 2 + sql/sql_db.cc | 43 +++++----- sql/sql_parse.cc | 167 +++++++++++++++++++++++++++----------- sql/sql_show.cc | 2 +- 6 files changed, 362 insertions(+), 71 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 73d5bf94264..ae550649951 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1019,4 +1019,79 @@ DROP DATABASE mysqltest2; DROP DATABASE mysqltest3; DROP DATABASE mysqltest4; DROP USER mysqltest_1@localhost; +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; +GRANT ALL PRIVILEGES ON mysqltest1.* TO mysqltest_1@localhost; +GRANT SELECT ON mysqltest2.* TO mysqltest_1@localhost; +CREATE PROCEDURE mysqltest1.p1() SQL SECURITY INVOKER +SELECT 1; + +---> connection: bug27337_con1 +CREATE TABLE t1(c INT); +ERROR 42000: CREATE command denied to user 'mysqltest_1'@'localhost' for table 't1' +CALL mysqltest1.p1(); +1 +1 +CREATE TABLE t1(c INT); +ERROR 42000: CREATE command denied to user 'mysqltest_1'@'localhost' for table 't1' + +---> connection: bug27337_con2 +CREATE TABLE t1(c INT); +ERROR 42000: CREATE command denied to user 'mysqltest_1'@'localhost' for table 't1' +SHOW TABLES; +Tables_in_mysqltest2 + +---> connection: default +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; +DROP USER mysqltest_1@localhost; +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; +CREATE TABLE mysqltest1.t1(c INT); +CREATE TABLE mysqltest2.t2(c INT); +GRANT SELECT ON mysqltest1.t1 TO mysqltest_1@localhost; +GRANT SELECT ON mysqltest2.t2 TO mysqltest_2@localhost; + +---> connection: bug27337_con1 +SHOW TABLES FROM mysqltest1; +Tables_in_mysqltest1 +t1 +PREPARE stmt1 FROM 'SHOW TABLES FROM mysqltest1'; +EXECUTE stmt1; +Tables_in_mysqltest1 +t1 + +---> connection: bug27337_con2 +SHOW COLUMNS FROM mysqltest2.t2; +Field Type Null Key Default Extra +c int(11) YES NULL +PREPARE stmt2 FROM 'SHOW COLUMNS FROM mysqltest2.t2'; +EXECUTE stmt2; +Field Type Null Key Default Extra +c int(11) YES NULL + +---> connection: default +REVOKE SELECT ON mysqltest1.t1 FROM mysqltest_1@localhost; +REVOKE SELECT ON mysqltest2.t2 FROM mysqltest_2@localhost; + +---> connection: bug27337_con1 +SHOW TABLES FROM mysqltest1; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest1' +EXECUTE stmt1; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest1' + +---> connection: bug27337_con2 +SHOW COLUMNS FROM mysqltest2.t2; +ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2' +EXECUTE stmt2; +ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2' + +---> connection: default +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; +DROP USER mysqltest_1@localhost; End of 5.0 tests diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 92ed69d3f4b..623bd4363cb 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -958,4 +958,148 @@ DROP DATABASE mysqltest4; DROP USER mysqltest_1@localhost; +# +# BUG#27337: Privileges are not restored properly. +# +# Actually, the patch for this bugs fixes two problems. So, here are two test +# cases. + +# Test case 1: privileges are not restored properly after calling a stored +# routine defined with SQL SECURITY INVOKER clause. + +# Prepare. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +--enable_warnings + +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; + +GRANT ALL PRIVILEGES ON mysqltest1.* TO mysqltest_1@localhost; +GRANT SELECT ON mysqltest2.* TO mysqltest_1@localhost; + +CREATE PROCEDURE mysqltest1.p1() SQL SECURITY INVOKER + SELECT 1; + +# Test. + +--connect (bug27337_con1,localhost,mysqltest_1,,mysqltest2) +--echo +--echo ---> connection: bug27337_con1 + +--error ER_TABLEACCESS_DENIED_ERROR +CREATE TABLE t1(c INT); + +CALL mysqltest1.p1(); + +--error ER_TABLEACCESS_DENIED_ERROR +CREATE TABLE t1(c INT); + +--disconnect bug27337_con1 + +--connect (bug27337_con2,localhost,mysqltest_1,,mysqltest2) +--echo +--echo ---> connection: bug27337_con2 + +--error ER_TABLEACCESS_DENIED_ERROR +CREATE TABLE t1(c INT); + +SHOW TABLES; + +# Cleanup. + +--connection default +--echo +--echo ---> connection: default + +--disconnect bug27337_con2 + +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; + +DROP USER mysqltest_1@localhost; + +# Test case 2: priveleges are not checked properly for prepared statements. + +# Prepare. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; +--enable_warnings + +CREATE DATABASE mysqltest1; +CREATE DATABASE mysqltest2; + +CREATE TABLE mysqltest1.t1(c INT); +CREATE TABLE mysqltest2.t2(c INT); + +GRANT SELECT ON mysqltest1.t1 TO mysqltest_1@localhost; +GRANT SELECT ON mysqltest2.t2 TO mysqltest_2@localhost; + +# Test. + +--connect (bug27337_con1,localhost,mysqltest_1,,mysqltest1) +--echo +--echo ---> connection: bug27337_con1 + +SHOW TABLES FROM mysqltest1; + +PREPARE stmt1 FROM 'SHOW TABLES FROM mysqltest1'; + +EXECUTE stmt1; + +--connect (bug27337_con2,localhost,mysqltest_2,,mysqltest2) +--echo +--echo ---> connection: bug27337_con2 + +SHOW COLUMNS FROM mysqltest2.t2; + +PREPARE stmt2 FROM 'SHOW COLUMNS FROM mysqltest2.t2'; + +EXECUTE stmt2; + +--connection default +--echo +--echo ---> connection: default + +REVOKE SELECT ON mysqltest1.t1 FROM mysqltest_1@localhost; +REVOKE SELECT ON mysqltest2.t2 FROM mysqltest_2@localhost; + +--connection bug27337_con1 +--echo +--echo ---> connection: bug27337_con1 + +--error ER_DBACCESS_DENIED_ERROR +SHOW TABLES FROM mysqltest1; + +--error ER_DBACCESS_DENIED_ERROR +EXECUTE stmt1; + +--connection bug27337_con2 +--echo +--echo ---> connection: bug27337_con2 + +--error ER_TABLEACCESS_DENIED_ERROR +SHOW COLUMNS FROM mysqltest2.t2; + +--error ER_TABLEACCESS_DENIED_ERROR +EXECUTE stmt2; + +# Cleanup. + +--connection default +--echo +--echo ---> connection: default + +--disconnect bug27337_con2 + +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; + +DROP USER mysqltest_1@localhost; + + --echo End of 5.0 tests diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5e37cd8987f..629ffb93b97 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -955,6 +955,8 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond); int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond); bool get_schema_tables_result(JOIN *join, enum enum_schema_table_state executed_place); +enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table); + #define is_schema_db(X) \ !my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, (X)) diff --git a/sql/sql_db.cc b/sql/sql_db.cc index d7aecb78363..963457cc896 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1308,30 +1308,27 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) DBUG_PRINT("info",("Use database: %s", new_db_file_name.str)); #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!force_switch) /* FIXME: this is BUG#27337. */ - { - db_access= - test_all_bits(sctx->master_access, DB_ACLS) ? - DB_ACLS : - acl_get(sctx->host, - sctx->ip, - sctx->priv_user, - new_db_file_name.str, - FALSE) | sctx->master_access; + db_access= + test_all_bits(sctx->master_access, DB_ACLS) ? + DB_ACLS : + acl_get(sctx->host, + sctx->ip, + sctx->priv_user, + new_db_file_name.str, + FALSE) | sctx->master_access; - if (!force_switch && - !(db_access & DB_ACLS) && - (!grant_option || check_grant_db(thd, new_db_file_name.str))) - { - my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - sctx->priv_user, - sctx->priv_host, - new_db_file_name.str); - mysql_log.write(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), - sctx->priv_user, sctx->priv_host, new_db_file_name.str); - my_free(new_db_file_name.str, MYF(0)); - DBUG_RETURN(TRUE); - } + if (!force_switch && + !(db_access & DB_ACLS) && + (!grant_option || check_grant_db(thd, new_db_file_name.str))) + { + my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), + sctx->priv_user, + sctx->priv_host, + new_db_file_name.str); + mysql_log.write(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), + sctx->priv_user, sctx->priv_host, new_db_file_name.str); + my_free(new_db_file_name.str, MYF(0)); + DBUG_RETURN(TRUE); } #endif diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index cbf9e374dac..ac75e6ea2fa 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2237,7 +2237,8 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, enum enum_schema_tables schema_table_idx) { DBUG_ENTER("prepare_schema_table"); - SELECT_LEX *sel= 0; + SELECT_LEX *schema_select_lex= NULL; + switch (schema_table_idx) { case SCH_SCHEMATA: #if defined(DONT_ALLOW_SHOW_COMMANDS) @@ -2245,11 +2246,9 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, ER(ER_NOT_ALLOWED_COMMAND), MYF(0)); /* purecov: inspected */ DBUG_RETURN(1); #else - if ((specialflag & SPECIAL_SKIP_SHOW_DB) && - check_global_access(thd, SHOW_DB_ACL)) - DBUG_RETURN(1); break; #endif + case SCH_TABLE_NAMES: case SCH_TABLES: case SCH_VIEWS: @@ -2259,32 +2258,25 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, ER(ER_NOT_ALLOWED_COMMAND), MYF(0)); /* purecov: inspected */ DBUG_RETURN(1); #else + if (lex->select_lex.db == NULL && + thd->copy_db_to(&lex->select_lex.db, NULL)) { - char *db; - if (lex->select_lex.db == NULL && - thd->copy_db_to(&lex->select_lex.db, 0)) - { - DBUG_RETURN(1); - } - db= lex->select_lex.db; - remove_escape(db); // Fix escaped '_' - if (check_db_name(db)) - { - my_error(ER_WRONG_DB_NAME, MYF(0), db); - DBUG_RETURN(1); - } - if (check_access(thd, SELECT_ACL, db, &thd->col_access, 0, 0, - is_schema_db(db))) - DBUG_RETURN(1); /* purecov: inspected */ - if (!thd->col_access && check_grant_db(thd,db)) - { - my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->security_ctx->priv_user, thd->security_ctx->priv_host, - db); - DBUG_RETURN(1); - } - break; + DBUG_RETURN(1); } + + schema_select_lex= new SELECT_LEX(); + schema_select_lex->db= lex->select_lex.db; + schema_select_lex->table_list.first= NULL; + remove_escape(schema_select_lex->db); // Fix escaped '_' + + if (check_db_name(schema_select_lex->db)) + { + my_error(ER_WRONG_DB_NAME, MYF(0), schema_select_lex->db); + DBUG_RETURN(1); + } + + + break; #endif case SCH_COLUMNS: case SCH_STATISTICS: @@ -2293,28 +2285,23 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, ER(ER_NOT_ALLOWED_COMMAND), MYF(0)); /* purecov: inspected */ DBUG_RETURN(1); #else - if (table_ident) { + DBUG_ASSERT(table_ident); + TABLE_LIST **query_tables_last= lex->query_tables_last; - sel= new SELECT_LEX(); + schema_select_lex= new SELECT_LEX(); /* 'parent_lex' is used in init_query() so it must be before it. */ - sel->parent_lex= lex; - sel->init_query(); - if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ, - (List *) 0, (List *) 0)) + schema_select_lex->parent_lex= lex; + schema_select_lex->init_query(); + if (!schema_select_lex->add_table_to_list(thd, table_ident, 0, 0, TL_READ, + (List *) 0, (List *) 0)) DBUG_RETURN(1); lex->query_tables_last= query_tables_last; - TABLE_LIST *table_list= (TABLE_LIST*) sel->table_list.first; - char *db= table_list->db; - remove_escape(db); // Fix escaped '_' - remove_escape(table_list->table_name); - if (check_access(thd,SELECT_ACL | EXTRA_ACL,db, - &table_list->grant.privilege, 0, 0, - test(table_list->schema_table))) - DBUG_RETURN(1); /* purecov: inspected */ - if (grant_option && check_grant(thd, SELECT_ACL, table_list, 2, - UINT_MAX, 0)) - DBUG_RETURN(1); + + TABLE_LIST *dst_table= (TABLE_LIST*) schema_select_lex->table_list.first; + remove_escape(dst_table->db); // Fix escaped '_' + remove_escape(dst_table->table_name); + break; } #endif @@ -2341,7 +2328,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, DBUG_RETURN(1); } TABLE_LIST *table_list= (TABLE_LIST*) select_lex->table_list.first; - table_list->schema_select_lex= sel; + table_list->schema_select_lex= schema_select_lex; table_list->schema_table_reformed= 1; statistic_increment(thd->status_var.com_stat[lex->orig_sql_command], &LOCK_status); @@ -5390,6 +5377,83 @@ bool check_global_access(THD *thd, ulong want_access) } +static bool check_show_access(THD *thd, TABLE_LIST *table) +{ + switch (get_schema_table_idx(table->schema_table)) + { + case SCH_SCHEMATA: + return (specialflag & SPECIAL_SKIP_SHOW_DB) && + check_global_access(thd, SHOW_DB_ACL); + + case SCH_TABLE_NAMES: + case SCH_TABLES: + case SCH_VIEWS: + case SCH_TRIGGERS: + { + const char *dst_db_name= table->schema_select_lex->db; + + DBUG_ASSERT(dst_db_name); + + if (check_access(thd, SELECT_ACL, dst_db_name, + &thd->col_access, FALSE, FALSE, + is_schema_db(dst_db_name))) + { + return TRUE; + } + + if (!thd->col_access && check_grant_db(thd, dst_db_name)) + { + my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), + thd->security_ctx->priv_user, + thd->security_ctx->priv_host, + dst_db_name); + return TRUE; + } + + return FALSE; + } + + case SCH_COLUMNS: + case SCH_STATISTICS: + { + TABLE_LIST *dst_table= + (TABLE_LIST *) table->schema_select_lex->table_list.first; + + DBUG_ASSERT(dst_table); + + if (check_access(thd, SELECT_ACL | EXTRA_ACL, + dst_table->db, + &dst_table->grant.privilege, + FALSE, FALSE, + test(dst_table->schema_table))) + { + return FALSE; + } + + return grant_option && + check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE); + } + + case SCH_OPEN_TABLES: + case SCH_VARIABLES: + case SCH_STATUS: + case SCH_PROCEDURES: + case SCH_CHARSETS: + case SCH_COLLATIONS: + case SCH_COLLATION_CHARACTER_SET_APPLICABILITY: + case SCH_USER_PRIVILEGES: + case SCH_SCHEMA_PRIVILEGES: + case SCH_TABLE_PRIVILEGES: + case SCH_COLUMN_PRIVILEGES: + case SCH_TABLE_CONSTRAINTS: + case SCH_KEY_COLUMN_USAGE: + break; + } + + return FALSE; +} + + /* Check the privilege for all used tables. @@ -5450,7 +5514,16 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, Remove SHOW_VIEW_ACL, because it will be checked during making view */ tables->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL); - if (tables->derived || tables->schema_table || + + if (tables->schema_table_reformed) + { + if (check_show_access(thd, tables)) + goto deny; + + continue; + } + + if (tables->derived || (tables->table && (int)tables->table->s->tmp_table) || my_tz_check_n_skip_implicit_tables(&tables, thd->lex->time_zone_tables_used)) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index cf0cb9ba8d2..fa78db50532 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2148,7 +2148,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) */ thd->reset_n_backup_open_tables_state(&open_tables_state_backup); - if (lsel) + if (lsel && lsel->table_list.first) { TABLE_LIST *show_table_list= (TABLE_LIST*) lsel->table_list.first; bool res; From fe074a726fae715912a94630ac5301c60e868e98 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 16:13:27 +0500 Subject: [PATCH 540/789] Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte client/mysqldump.c: fixed typo include/mysql_com.h: added new constants SYSTEM_CHARSET_MBMAXLEN, NAME_CHAR_LEN, USERNAME_CHAR_LENGTH increased NAME_LEN, USERNAME_LENGTH mysql-test/r/create.result: result fix mysql-test/r/grant.result: result fix mysql-test/r/mysql.result: result fix mysql-test/r/sp.result: result fix mysql-test/t/create.test: test case mysql-test/t/grant.test: test case sql/events.cc: NAME_LEN is replaced with NAME_CHAR_LEN sql/item_strfunc.h: fixed calculation of max_length sql/mysql_priv.h: check_string_length function is replaced with check_string_byte_length added new function check_string_char_length sql/sp.cc: NAME_LEN is replaced with NAME_CHAR_LEN sql/sp_head.cc: NAME_LEN is replaced with NAME_CHAR_LEN sql/sp_head.h: changed parameter of 'check_routine_name' function sql/sql_class.cc: NAME_LEN is replaced with NAME_CHAR_LEN sql/share/errmsg.txt: increased argument lengths according to new constants sql/sql_parse.cc: removed unnecessary checks added function 'check_string_char_length' sql/sql_plugin.cc: check that name is not longer than NAME_CHAR_LEN symbols sql/sql_show.cc: NAME_LEN is replaced with NAME_CHAR_LEN sql/sql_table.cc: check that key name is not longer than NAME_LEN symbols sql/sql_udf.cc: check that udf name is not longer than NAME_CHAR_LEN symbols sql/sql_yacc.yy: check that user name is not longer than USERNAME_CHAR_LENGTH symbols sql/table.cc: check that db or table or column name is not longer than NAME_LEN symbols storage/innobase/handler/ha_innodb.cc: removed unnecessary multiplication tests/mysql_client_test.c: NAME_LEN is replaced with NAME_CHAR_LEN --- client/mysqldump.c | 2 +- include/mysql_com.h | 8 +- mysql-test/r/create.result | 99 +- mysql-test/r/grant.result | 9 + mysql-test/r/mysql.result | 2 +- mysql-test/r/sp.result | 2 +- mysql-test/t/create.test | 88 + mysql-test/t/grant.test | 12 + sql/events.cc | 2 +- sql/item_strfunc.h | 4 +- sql/mysql_priv.h | 11 +- sql/share/errmsg.txt | 3584 ++++++++++++------------- sql/sp.cc | 22 +- sql/sp_head.cc | 21 +- sql/sp_head.h | 2 +- sql/sql_class.cc | 11 +- sql/sql_parse.cc | 96 +- sql/sql_plugin.cc | 3 +- sql/sql_show.cc | 194 +- sql/sql_table.cc | 11 +- sql/sql_udf.cc | 9 +- sql/sql_yacc.yy | 25 +- sql/table.cc | 21 +- storage/innobase/handler/ha_innodb.cc | 4 +- tests/mysql_client_test.c | 10 +- 25 files changed, 2255 insertions(+), 1997 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index c86a2fc385f..408f055cf4a 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -3454,7 +3454,7 @@ static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root) static int dump_selected_tables(char *db, char **table_names, int tables) { - char table_buff[NAME_LEN*+3]; + char table_buff[NAME_LEN*2+3]; DYNAMIC_STRING lock_tables_query; MEM_ROOT root; char **dump_tables, **pos, **end; diff --git a/include/mysql_com.h b/include/mysql_com.h index e2ab9601f5f..2223dbad6ab 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -20,9 +20,13 @@ #ifndef _mysql_com_h #define _mysql_com_h -#define NAME_LEN 64 /* Field/table name length */ #define HOSTNAME_LENGTH 60 -#define USERNAME_LENGTH 16 +#define SYSTEM_CHARSET_MBMAXLEN 3 +#define NAME_CHAR_LEN 64 /* Field/table name length */ +#define USERNAME_CHAR_LENGTH 16 +#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) +#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) + #define SERVER_VERSION_LENGTH 60 #define SQLSTATE_LENGTH 5 diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 53892b219eb..717201f384a 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -827,7 +827,7 @@ ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a; -ERROR 42000: Unknown database 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +ERROR 42000: Unknown database 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' create database mysqltest; @@ -838,3 +838,100 @@ USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +set names utf8; +create database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +use имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +select database(); +database() +имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45 +create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 +( +имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 int, +index имÑ_индекÑа_в_кодировке_утф8_длиной_больше_чем_48 (имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45) +); +create view имÑ_вью_кодировке_утф8_длиной_больше_чем_42 as +select имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 +from имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +select * from имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 +select SCHEMA_NAME from information_schema.schemata +where schema_name='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +SCHEMA_NAME +имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45 +select TABLE_NAME from information_schema.tables where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +TABLE_NAME +имÑ_вью_кодировке_утф8_длиной_больше_чем_42 +имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 +select COLUMN_NAME from information_schema.columns where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +COLUMN_NAME +имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 +имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 +select INDEX_NAME from information_schema.statistics where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +INDEX_NAME +имÑ_индекÑа_в_кодировке_утф8_длиной_больше_чем_48 +select TABLE_NAME from information_schema.views where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +TABLE_NAME +имÑ_вью_кодировке_утф8_длиной_больше_чем_42 +show create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +Table Create Table +имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 CREATE TABLE `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48` ( + `имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` int(11) DEFAULT NULL, + KEY `имÑ_индекÑа_в_кодировке_утф8_длиной_больше_чем_48` (`имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create view имÑ_вью_кодировке_утф8_длиной_больше_чем_42; +View Create View +имÑ_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имÑ_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` AS `имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` from `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48` +create event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48 on schedule every 2 year do select 1; +select EVENT_NAME from information_schema.events +where event_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +EVENT_NAME +имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48 +drop event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48; +create event +очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66 +on schedule every 2 year do select 1; +ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long +create trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49 +before insert on имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1; +select TRIGGER_NAME from information_schema.triggers where +trigger_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +TRIGGER_NAME +имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49 +drop trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49; +create trigger +очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66 +before insert on имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1; +ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long +drop trigger очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66; +ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long +create procedure имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50() +begin +end; +select ROUTINE_NAME from information_schema.routines where +routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +ROUTINE_NAME +имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50 +drop procedure имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50; +create procedure очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66() +begin +end; +ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long +create function имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49() +returns int +return 0; +select ROUTINE_NAME from information_schema.routines where +routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +ROUTINE_NAME +имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49 +drop function имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49; +create function очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66() +returns int +return 0; +ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long +drop database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +set names default; +use test; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 5d97e540976..2ac5953c456 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1060,3 +1060,12 @@ DROP USER bug23556@localhost; GRANT PROCESS ON * TO user@localhost; ERROR 3D000: No database selected End of 5.0 tests +set names utf8; +grant select on test.* to юзер_юзер@localhost; +user() +юзер_юзер@localhost +revoke all on test.* from юзер_юзер@localhost; +drop user юзер_юзер@localhost; +grant select on test.* to очень_длинный_юзер@localhost; +ERROR HY000: String 'очень_длинный_юзер' is too long for user name (should be no longer than 16) +set names default; diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index e83bbe97eaa..61d04deef51 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -167,7 +167,7 @@ ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errn The commands reported in the bug report ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno) Too long dbname -ERROR 1049 (42000) at line 1: Unknown database 'test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +ERROR 1102 (42000) at line 1: Incorrect database name 'test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' Too long hostname ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyrils_superlonghostnameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno) 1 diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 4abbb35bd6a..733cc40b296 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5398,7 +5398,7 @@ drop database if exists това_е_дълго_име_за_база_данни_ create database това_е_дълго_име_за_база_данни_нали| INSERT INTO mysql.proc VALUES ('това_е_дълго_име_за_база_данни_нали','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','PROCEDURE','това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго','SQL','CONTAINS_SQL','NO','DEFINER','','','bad_body','root@localhost',now(), now(),'','')| call това_е_дълго_име_за_база_данни_нали.това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго()| -ERROR HY000: Failed to load routine това_е_дълго_име_за_база_данни_нали.. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) +ERROR HY000: Failed to load routine това_е_дълго_име_за_база_данни_нали.това_е_процедура_Ñ_доÑта_дълго_име_нали_и_още_по_дълго. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) drop database това_е_дълго_име_за_база_данни_нали| CREATE TABLE t3 ( Member_ID varchar(15) NOT NULL, diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index ffdcee06488..83553e314a7 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -734,3 +734,91 @@ drop database mysqltest; USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; --error 1102 SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; + +# +# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte +# +set names utf8; + +create database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +use имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +select database(); +create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 +( + имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 int, + index имÑ_индекÑа_в_кодировке_утф8_длиной_больше_чем_48 (имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45) +); + +create view имÑ_вью_кодировке_утф8_длиной_больше_чем_42 as +select имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 +from имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; + +# database, table, field, key, view +select * from имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; + +select SCHEMA_NAME from information_schema.schemata +where schema_name='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; + +select TABLE_NAME from information_schema.tables where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; + +select COLUMN_NAME from information_schema.columns where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; + +select INDEX_NAME from information_schema.statistics where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; + +select TABLE_NAME from information_schema.views where +table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; + +show create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +show create view имÑ_вью_кодировке_утф8_длиной_больше_чем_42; + +# procedure, function, event, trigger + +create event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48 on schedule every 2 year do select 1; +select EVENT_NAME from information_schema.events +where event_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +drop event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48; +--error 1059 +create event +очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66 +on schedule every 2 year do select 1; + +create trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49 +before insert on имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1; +select TRIGGER_NAME from information_schema.triggers where +trigger_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +drop trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49; +--error 1059 +create trigger +очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66 +before insert on имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1; +--error 1059 +drop trigger очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66; + +create procedure имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50() +begin +end; +select ROUTINE_NAME from information_schema.routines where +routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +drop procedure имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50; +--error 1059 +create procedure очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66() +begin +end; + +create function имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49() + returns int +return 0; +select ROUTINE_NAME from information_schema.routines where +routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +drop function имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49; +--error 1059 +create function очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66() + returns int +return 0; + +drop database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +set names default; +use test; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 9417ac687d4..0008c37646c 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -986,3 +986,15 @@ disconnect con1; connection default; --echo End of 5.0 tests + +# +# Bug#21432: Database/Table name limited to 64 bytes, not chars, problems with multi-byte +# +set names utf8; +grant select on test.* to юзер_юзер@localhost; +--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()" +revoke all on test.* from юзер_юзер@localhost; +drop user юзер_юзер@localhost; +--error 1573 +grant select on test.* to очень_длинный_юзер@localhost; +set names default; diff --git a/sql/events.cc b/sql/events.cc index df2f1124f38..66e2a264dbd 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -568,7 +568,7 @@ Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) if (et->get_create_event(thd, &show_str)) goto err; - field_list.push_back(new Item_empty_string("Event", NAME_LEN)); + field_list.push_back(new Item_empty_string("Event", NAME_CHAR_LEN)); sql_mode_str= sys_var_thd_sql_mode::symbolic_mode_representation(thd, et->sql_mode, diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 628b51a70d7..1bf8dfbfe7e 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -426,8 +426,8 @@ public: bool fix_fields(THD *thd, Item **ref); void fix_length_and_dec() { - max_length= ((USERNAME_LENGTH + HOSTNAME_LENGTH + 1) * - system_charset_info->mbmaxlen); + max_length= (USERNAME_LENGTH + + (HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN); } const char *func_name() const { return "user"; } const char *fully_qualified_func_name() const { return "user()"; } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 2bc8c2071d2..7607a004e7a 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -366,7 +366,7 @@ MY_LOCALE *my_locale_by_number(uint number); Maximum length of time zone name that we support (Time zone name is char(64) in db). mysqlbinlog needs it. */ -#define MAX_TIME_ZONE_NAME_LENGTH 72 +#define MAX_TIME_ZONE_NAME_LENGTH (NAME_LEN + 8) /* The rest of the file is included in the server only */ #ifndef MYSQL_CLIENT @@ -622,8 +622,11 @@ void get_default_definer(THD *thd, LEX_USER *definer); LEX_USER *create_default_definer(THD *thd); LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name); LEX_USER *get_current_user(THD *thd, LEX_USER *user); -bool check_string_length(LEX_STRING *str, - const char *err_msg, uint max_length); +bool check_string_byte_length(LEX_STRING *str, const char *err_msg, + uint max_byte_length); +bool check_string_char_length(LEX_STRING *str, const char *err_msg, + uint max_char_length, CHARSET_INFO *cs, + bool no_error); enum enum_mysql_completiontype { ROLLBACK_RELEASE=-2, ROLLBACK=1, ROLLBACK_AND_CHAIN=7, @@ -1164,7 +1167,7 @@ void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table); /* sql_base.cc */ #define TMP_TABLE_KEY_EXTRA 8 void set_item_name(Item *item,char *pos,uint length); -bool add_field_to_list(THD *thd, char *field_name, enum enum_field_types type, +bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum enum_field_types type, char *length, char *decimal, uint type_modifier, Item *default_value, Item *on_update_value, diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index a42f94760ab..6393307c156 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -100,155 +100,155 @@ ER_CANT_CREATE_TABLE swe "Kan inte skapa tabellen '%-.200s' (Felkod: %d)" ukr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÔÁÂÌÉÃÀ '%-.200s' (ÐÏÍÉÌËÁ: %d)" ER_CANT_CREATE_DB - cze "Nemohu vytvo-Bøit databázi '%-.64s' (chybový kód: %d)" - dan "Kan ikke oprette databasen '%-.64s' (Fejlkode: %d)" - nla "Kan database '%-.64s' niet aanmaken (Errcode: %d)" - eng "Can't create database '%-.64s' (errno: %d)" - jps "'%-.64s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ (errno: %d)", - est "Ei suuda luua andmebaasi '%-.64s' (veakood: %d)" - fre "Ne peut créer la base '%-.64s' (Erreur %d)" - ger "Kann Datenbank '%-.64s' nicht erzeugen (Fehler: %d)" - greek "Áäýíáôç ç äçìéïõñãßá ôçò âÜóçò äåäïìÝíùí '%-.64s' (êùäéêüò ëÜèïõò: %d)" - hun "Az '%-.64s' adatbazis nem hozhato letre (hibakod: %d)" - ita "Impossibile creare il database '%-.64s' (errno: %d)" - jpn "'%-.64s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ºî¤ì¤Þ¤»¤ó (errno: %d)" - kor "µ¥ÀÌŸº£À̽º '%-.64s'¸¦ ¸¸µéÁö ¸øÇß½À´Ï´Ù.. (¿¡·¯¹øÈ£: %d)" - nor "Kan ikke opprette databasen '%-.64s' (Feilkode: %d)" - norwegian-ny "Kan ikkje opprette databasen '%-.64s' (Feilkode: %d)" - pol "Nie mo¿na stworzyæ bazy danych '%-.64s' (Kod b³êdu: %d)" - por "Não pode criar o banco de dados '%-.64s' (erro no. %d)" - rum "Nu pot sa creez baza de date '%-.64s' (Eroare: %d)" - rus "îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.64s' (ÏÛÉÂËÁ: %d)" - serbian "Ne mogu da kreiram bazu '%-.64s' (errno: %d)" - slo "Nemô¾em vytvori» databázu '%-.64s' (chybový kód: %d)" - spa "No puedo crear base de datos '%-.64s' (Error: %d)" - swe "Kan inte skapa databasen '%-.64s' (Felkod: %d)" - ukr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ '%-.64s' (ÐÏÍÉÌËÁ: %d)" + cze "Nemohu vytvo-Bøit databázi '%-.192s' (chybový kód: %d)" + dan "Kan ikke oprette databasen '%-.192s' (Fejlkode: %d)" + nla "Kan database '%-.192s' niet aanmaken (Errcode: %d)" + eng "Can't create database '%-.192s' (errno: %d)" + jps "'%-.192s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ (errno: %d)", + est "Ei suuda luua andmebaasi '%-.192s' (veakood: %d)" + fre "Ne peut créer la base '%-.192s' (Erreur %d)" + ger "Kann Datenbank '%-.192s' nicht erzeugen (Fehler: %d)" + greek "Áäýíáôç ç äçìéïõñãßá ôçò âÜóçò äåäïìÝíùí '%-.192s' (êùäéêüò ëÜèïõò: %d)" + hun "Az '%-.192s' adatbazis nem hozhato letre (hibakod: %d)" + ita "Impossibile creare il database '%-.192s' (errno: %d)" + jpn "'%-.192s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ºî¤ì¤Þ¤»¤ó (errno: %d)" + kor "µ¥ÀÌŸº£À̽º '%-.192s'¸¦ ¸¸µéÁö ¸øÇß½À´Ï´Ù.. (¿¡·¯¹øÈ£: %d)" + nor "Kan ikke opprette databasen '%-.192s' (Feilkode: %d)" + norwegian-ny "Kan ikkje opprette databasen '%-.192s' (Feilkode: %d)" + pol "Nie mo¿na stworzyæ bazy danych '%-.192s' (Kod b³êdu: %d)" + por "Não pode criar o banco de dados '%-.192s' (erro no. %d)" + rum "Nu pot sa creez baza de date '%-.192s' (Eroare: %d)" + rus "îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.192s' (ÏÛÉÂËÁ: %d)" + serbian "Ne mogu da kreiram bazu '%-.192s' (errno: %d)" + slo "Nemô¾em vytvori» databázu '%-.192s' (chybový kód: %d)" + spa "No puedo crear base de datos '%-.192s' (Error: %d)" + swe "Kan inte skapa databasen '%-.192s' (Felkod: %d)" + ukr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ '%-.192s' (ÐÏÍÉÌËÁ: %d)" ER_DB_CREATE_EXISTS - cze "Nemohu vytvo-Bøit databázi '%-.64s'; databáze ji¾ existuje" - dan "Kan ikke oprette databasen '%-.64s'; databasen eksisterer" - nla "Kan database '%-.64s' niet aanmaken; database bestaat reeds" - eng "Can't create database '%-.64s'; database exists" - jps "'%-.64s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ.Šù‚É‚»‚̃f[ƒ^ƒx[ƒX‚ª‘¶Ý‚µ‚Ü‚·", - est "Ei suuda luua andmebaasi '%-.64s': andmebaas juba eksisteerib" - fre "Ne peut créer la base '%-.64s'; elle existe déjà" - ger "Kann Datenbank '%-.64s' nicht erzeugen. Datenbank existiert bereits" - greek "Áäýíáôç ç äçìéïõñãßá ôçò âÜóçò äåäïìÝíùí '%-.64s'; Ç âÜóç äåäïìÝíùí õðÜñ÷åé Þäç" - hun "Az '%-.64s' adatbazis nem hozhato letre Az adatbazis mar letezik" - ita "Impossibile creare il database '%-.64s'; il database esiste" - jpn "'%-.64s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ºî¤ì¤Þ¤»¤ó.´û¤Ë¤½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Â¸ºß¤·¤Þ¤¹" - kor "µ¥ÀÌŸº£À̽º '%-.64s'¸¦ ¸¸µéÁö ¸øÇß½À´Ï´Ù.. µ¥ÀÌŸº£À̽º°¡ Á¸ÀçÇÔ" - nor "Kan ikke opprette databasen '%-.64s'; databasen eksisterer" - norwegian-ny "Kan ikkje opprette databasen '%-.64s'; databasen eksisterer" - pol "Nie mo¿na stworzyæ bazy danych '%-.64s'; baza danych ju¿ istnieje" - por "Não pode criar o banco de dados '%-.64s'; este banco de dados já existe" - rum "Nu pot sa creez baza de date '%-.64s'; baza de date exista deja" - rus "îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.64s'. âÁÚÁ ÄÁÎÎÙÈ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ" - serbian "Ne mogu da kreiram bazu '%-.64s'; baza veæ postoji." - slo "Nemô¾em vytvori» databázu '%-.64s'; databáza existuje" - spa "No puedo crear base de datos '%-.64s'; la base de datos ya existe" - swe "Databasen '%-.64s' existerar redan" - ukr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ '%-.64s'. âÁÚÁ ÄÁÎÎÉÈ ¦ÓÎÕ¤" + cze "Nemohu vytvo-Bøit databázi '%-.192s'; databáze ji¾ existuje" + dan "Kan ikke oprette databasen '%-.192s'; databasen eksisterer" + nla "Kan database '%-.192s' niet aanmaken; database bestaat reeds" + eng "Can't create database '%-.192s'; database exists" + jps "'%-.192s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ.Šù‚É‚»‚̃f[ƒ^ƒx[ƒX‚ª‘¶Ý‚µ‚Ü‚·", + est "Ei suuda luua andmebaasi '%-.192s': andmebaas juba eksisteerib" + fre "Ne peut créer la base '%-.192s'; elle existe déjà" + ger "Kann Datenbank '%-.192s' nicht erzeugen. Datenbank existiert bereits" + greek "Áäýíáôç ç äçìéïõñãßá ôçò âÜóçò äåäïìÝíùí '%-.192s'; Ç âÜóç äåäïìÝíùí õðÜñ÷åé Þäç" + hun "Az '%-.192s' adatbazis nem hozhato letre Az adatbazis mar letezik" + ita "Impossibile creare il database '%-.192s'; il database esiste" + jpn "'%-.192s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ºî¤ì¤Þ¤»¤ó.´û¤Ë¤½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Â¸ºß¤·¤Þ¤¹" + kor "µ¥ÀÌŸº£À̽º '%-.192s'¸¦ ¸¸µéÁö ¸øÇß½À´Ï´Ù.. µ¥ÀÌŸº£À̽º°¡ Á¸ÀçÇÔ" + nor "Kan ikke opprette databasen '%-.192s'; databasen eksisterer" + norwegian-ny "Kan ikkje opprette databasen '%-.192s'; databasen eksisterer" + pol "Nie mo¿na stworzyæ bazy danych '%-.192s'; baza danych ju¿ istnieje" + por "Não pode criar o banco de dados '%-.192s'; este banco de dados já existe" + rum "Nu pot sa creez baza de date '%-.192s'; baza de date exista deja" + rus "îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.192s'. âÁÚÁ ÄÁÎÎÙÈ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ" + serbian "Ne mogu da kreiram bazu '%-.192s'; baza veæ postoji." + slo "Nemô¾em vytvori» databázu '%-.192s'; databáza existuje" + spa "No puedo crear base de datos '%-.192s'; la base de datos ya existe" + swe "Databasen '%-.192s' existerar redan" + ukr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ '%-.192s'. âÁÚÁ ÄÁÎÎÉÈ ¦ÓÎÕ¤" ER_DB_DROP_EXISTS - cze "Nemohu zru-B¹it databázi '%-.64s', databáze neexistuje" - dan "Kan ikke slette (droppe) '%-.64s'; databasen eksisterer ikke" - nla "Kan database '%-.64s' niet verwijderen; database bestaat niet" - eng "Can't drop database '%-.64s'; database doesn't exist" - jps "'%-.64s' ƒf[ƒ^ƒx[ƒX‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ. ‚»‚̃f[ƒ^ƒx[ƒX‚ª‚È‚¢‚̂ł·.", - est "Ei suuda kustutada andmebaasi '%-.64s': andmebaasi ei eksisteeri" - fre "Ne peut effacer la base '%-.64s'; elle n'existe pas" - ger "Kann Datenbank '%-.64s' nicht löschen; Datenbank nicht vorhanden" - greek "Áäýíáôç ç äéáãñáöÞ ôçò âÜóçò äåäïìÝíùí '%-.64s'. Ç âÜóç äåäïìÝíùí äåí õðÜñ÷åé" - hun "A(z) '%-.64s' adatbazis nem szuntetheto meg. Az adatbazis nem letezik" - ita "Impossibile cancellare '%-.64s'; il database non esiste" - jpn "'%-.64s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÇË´þ¤Ç¤­¤Þ¤»¤ó. ¤½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤Ê¤¤¤Î¤Ç¤¹." - kor "µ¥ÀÌŸº£À̽º '%-.64s'¸¦ Á¦°ÅÇÏÁö ¸øÇß½À´Ï´Ù. µ¥ÀÌŸº£À̽º°¡ Á¸ÀçÇÏÁö ¾ÊÀ½ " - nor "Kan ikke fjerne (drop) '%-.64s'; databasen eksisterer ikke" - norwegian-ny "Kan ikkje fjerne (drop) '%-.64s'; databasen eksisterer ikkje" - pol "Nie mo¿na usun?æ bazy danych '%-.64s'; baza danych nie istnieje" - por "Não pode eliminar o banco de dados '%-.64s'; este banco de dados não existe" - rum "Nu pot sa drop baza de date '%-.64s'; baza da date este inexistenta" - rus "îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.64s'. ôÁËÏÊ ÂÁÚÙ ÄÁÎÎÙÈ ÎÅÔ" - serbian "Ne mogu da izbrišem bazu '%-.64s'; baza ne postoji." - slo "Nemô¾em zmaza» databázu '%-.64s'; databáza neexistuje" - spa "No puedo eliminar base de datos '%-.64s'; la base de datos no existe" - swe "Kan inte radera databasen '%-.64s'; databasen finns inte" - ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ '%-.64s'. âÁÚÁ ÄÁÎÎÉÈ ÎÅ ¦ÓÎÕ¤" + cze "Nemohu zru-B¹it databázi '%-.192s', databáze neexistuje" + dan "Kan ikke slette (droppe) '%-.192s'; databasen eksisterer ikke" + nla "Kan database '%-.192s' niet verwijderen; database bestaat niet" + eng "Can't drop database '%-.192s'; database doesn't exist" + jps "'%-.192s' ƒf[ƒ^ƒx[ƒX‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ. ‚»‚̃f[ƒ^ƒx[ƒX‚ª‚È‚¢‚̂ł·.", + est "Ei suuda kustutada andmebaasi '%-.192s': andmebaasi ei eksisteeri" + fre "Ne peut effacer la base '%-.192s'; elle n'existe pas" + ger "Kann Datenbank '%-.192s' nicht löschen; Datenbank nicht vorhanden" + greek "Áäýíáôç ç äéáãñáöÞ ôçò âÜóçò äåäïìÝíùí '%-.192s'. Ç âÜóç äåäïìÝíùí äåí õðÜñ÷åé" + hun "A(z) '%-.192s' adatbazis nem szuntetheto meg. Az adatbazis nem letezik" + ita "Impossibile cancellare '%-.192s'; il database non esiste" + jpn "'%-.192s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÇË´þ¤Ç¤­¤Þ¤»¤ó. ¤½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤Ê¤¤¤Î¤Ç¤¹." + kor "µ¥ÀÌŸº£À̽º '%-.192s'¸¦ Á¦°ÅÇÏÁö ¸øÇß½À´Ï´Ù. µ¥ÀÌŸº£À̽º°¡ Á¸ÀçÇÏÁö ¾ÊÀ½ " + nor "Kan ikke fjerne (drop) '%-.192s'; databasen eksisterer ikke" + norwegian-ny "Kan ikkje fjerne (drop) '%-.192s'; databasen eksisterer ikkje" + pol "Nie mo¿na usun?æ bazy danych '%-.192s'; baza danych nie istnieje" + por "Não pode eliminar o banco de dados '%-.192s'; este banco de dados não existe" + rum "Nu pot sa drop baza de date '%-.192s'; baza da date este inexistenta" + rus "îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.192s'. ôÁËÏÊ ÂÁÚÙ ÄÁÎÎÙÈ ÎÅÔ" + serbian "Ne mogu da izbrišem bazu '%-.192s'; baza ne postoji." + slo "Nemô¾em zmaza» databázu '%-.192s'; databáza neexistuje" + spa "No puedo eliminar base de datos '%-.192s'; la base de datos no existe" + swe "Kan inte radera databasen '%-.192s'; databasen finns inte" + ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ '%-.192s'. âÁÚÁ ÄÁÎÎÉÈ ÎÅ ¦ÓÎÕ¤" ER_DB_DROP_DELETE - cze "Chyba p-Bøi ru¹ení databáze (nemohu vymazat '%-.64s', chyba %d)" - dan "Fejl ved sletning (drop) af databasen (kan ikke slette '%-.64s', Fejlkode %d)" - nla "Fout bij verwijderen database (kan '%-.64s' niet verwijderen, Errcode: %d)" - eng "Error dropping database (can't delete '%-.64s', errno: %d)" - jps "ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.64s' ‚ð휂ł«‚Ü‚¹‚ñ, errno: %d)", - est "Viga andmebaasi kustutamisel (ei suuda kustutada faili '%-.64s', veakood: %d)" - fre "Ne peut effacer la base '%-.64s' (erreur %d)" - ger "Fehler beim Löschen der Datenbank ('%-.64s' kann nicht gelöscht werden, Fehler: %d)" - greek "ÐáñïõóéÜóôçêå ðñüâëçìá êáôÜ ôç äéáãñáöÞ ôçò âÜóçò äåäïìÝíùí (áäýíáôç ç äéáãñáöÞ '%-.64s', êùäéêüò ëÜèïõò: %d)" - hun "Adatbazis megszuntetesi hiba ('%-.64s' nem torolheto, hibakod: %d)" - ita "Errore durante la cancellazione del database (impossibile cancellare '%-.64s', errno: %d)" - jpn "¥Ç¡¼¥¿¥Ù¡¼¥¹ÇË´þ¥¨¥é¡¼ ('%-.64s' ¤òºï½ü¤Ç¤­¤Þ¤»¤ó, errno: %d)" - kor "µ¥ÀÌŸº£À̽º Á¦°Å ¿¡·¯('%-.64s'¸¦ »èÁ¦ÇÒ ¼ö ¾øÀ¾´Ï´Ù, ¿¡·¯¹øÈ£: %d)" - nor "Feil ved fjerning (drop) av databasen (kan ikke slette '%-.64s', feil %d)" - norwegian-ny "Feil ved fjerning (drop) av databasen (kan ikkje slette '%-.64s', feil %d)" - pol "B³?d podczas usuwania bazy danych (nie mo¿na usun?æ '%-.64s', b³?d %d)" - por "Erro ao eliminar banco de dados (não pode eliminar '%-.64s' - erro no. %d)" - rum "Eroare dropuind baza de date (nu pot sa sterg '%-.64s', Eroare: %d)" - rus "ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ ÂÁÚÙ ÄÁÎÎÙÈ (ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ '%-.64s', ÏÛÉÂËÁ: %d)" - serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem '%-.64s', errno: %d)" - slo "Chyba pri mazaní databázy (nemô¾em zmaza» '%-.64s', chybový kód: %d)" - spa "Error eliminando la base de datos(no puedo borrar '%-.64s', error %d)" - swe "Fel vid radering av databasen (Kan inte radera '%-.64s'. Felkod: %d)" - ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ (îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ '%-.64s', ÐÏÍÉÌËÁ: %d)" + cze "Chyba p-Bøi ru¹ení databáze (nemohu vymazat '%-.192s', chyba %d)" + dan "Fejl ved sletning (drop) af databasen (kan ikke slette '%-.192s', Fejlkode %d)" + nla "Fout bij verwijderen database (kan '%-.192s' niet verwijderen, Errcode: %d)" + eng "Error dropping database (can't delete '%-.192s', errno: %d)" + jps "ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.192s' ‚ð휂ł«‚Ü‚¹‚ñ, errno: %d)", + est "Viga andmebaasi kustutamisel (ei suuda kustutada faili '%-.192s', veakood: %d)" + fre "Ne peut effacer la base '%-.192s' (erreur %d)" + ger "Fehler beim Löschen der Datenbank ('%-.192s' kann nicht gelöscht werden, Fehler: %d)" + greek "ÐáñïõóéÜóôçêå ðñüâëçìá êáôÜ ôç äéáãñáöÞ ôçò âÜóçò äåäïìÝíùí (áäýíáôç ç äéáãñáöÞ '%-.192s', êùäéêüò ëÜèïõò: %d)" + hun "Adatbazis megszuntetesi hiba ('%-.192s' nem torolheto, hibakod: %d)" + ita "Errore durante la cancellazione del database (impossibile cancellare '%-.192s', errno: %d)" + jpn "¥Ç¡¼¥¿¥Ù¡¼¥¹ÇË´þ¥¨¥é¡¼ ('%-.192s' ¤òºï½ü¤Ç¤­¤Þ¤»¤ó, errno: %d)" + kor "µ¥ÀÌŸº£À̽º Á¦°Å ¿¡·¯('%-.192s'¸¦ »èÁ¦ÇÒ ¼ö ¾øÀ¾´Ï´Ù, ¿¡·¯¹øÈ£: %d)" + nor "Feil ved fjerning (drop) av databasen (kan ikke slette '%-.192s', feil %d)" + norwegian-ny "Feil ved fjerning (drop) av databasen (kan ikkje slette '%-.192s', feil %d)" + pol "B³?d podczas usuwania bazy danych (nie mo¿na usun?æ '%-.192s', b³?d %d)" + por "Erro ao eliminar banco de dados (não pode eliminar '%-.192s' - erro no. %d)" + rum "Eroare dropuind baza de date (nu pot sa sterg '%-.192s', Eroare: %d)" + rus "ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ ÂÁÚÙ ÄÁÎÎÙÈ (ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ '%-.192s', ÏÛÉÂËÁ: %d)" + serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem '%-.192s', errno: %d)" + slo "Chyba pri mazaní databázy (nemô¾em zmaza» '%-.192s', chybový kód: %d)" + spa "Error eliminando la base de datos(no puedo borrar '%-.192s', error %d)" + swe "Fel vid radering av databasen (Kan inte radera '%-.192s'. Felkod: %d)" + ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ (îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ '%-.192s', ÐÏÍÉÌËÁ: %d)" ER_DB_DROP_RMDIR - cze "Chyba p-Bøi ru¹ení databáze (nemohu vymazat adresáø '%-.64s', chyba %d)" - dan "Fejl ved sletting af database (kan ikke slette folderen '%-.64s', Fejlkode %d)" - nla "Fout bij verwijderen database (kan rmdir '%-.64s' niet uitvoeren, Errcode: %d)" - eng "Error dropping database (can't rmdir '%-.64s', errno: %d)" - jps "ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.64s' ‚ð rmdir ‚Å‚«‚Ü‚¹‚ñ, errno: %d)", - est "Viga andmebaasi kustutamisel (ei suuda kustutada kataloogi '%-.64s', veakood: %d)" - fre "Erreur en effaçant la base (rmdir '%-.64s', erreur %d)" - ger "Fehler beim Löschen der Datenbank (Verzeichnis '%-.64s' kann nicht gelöscht werden, Fehler: %d)" - greek "ÐáñïõóéÜóôçêå ðñüâëçìá êáôÜ ôç äéáãñáöÞ ôçò âÜóçò äåäïìÝíùí (áäýíáôç ç äéáãñáöÞ ôïõ öáêÝëëïõ '%-.64s', êùäéêüò ëÜèïõò: %d)" - hun "Adatbazis megszuntetesi hiba ('%-.64s' nem szuntetheto meg, hibakod: %d)" - ita "Errore durante la cancellazione del database (impossibile rmdir '%-.64s', errno: %d)" - jpn "¥Ç¡¼¥¿¥Ù¡¼¥¹ÇË´þ¥¨¥é¡¼ ('%-.64s' ¤ò rmdir ¤Ç¤­¤Þ¤»¤ó, errno: %d)" - kor "µ¥ÀÌŸº£À̽º Á¦°Å ¿¡·¯(rmdir '%-.64s'¸¦ ÇÒ ¼ö ¾øÀ¾´Ï´Ù, ¿¡·¯¹øÈ£: %d)" - nor "Feil ved sletting av database (kan ikke slette katalogen '%-.64s', feil %d)" - norwegian-ny "Feil ved sletting av database (kan ikkje slette katalogen '%-.64s', feil %d)" - pol "B³?d podczas usuwania bazy danych (nie mo¿na wykonaæ rmdir '%-.64s', b³?d %d)" - por "Erro ao eliminar banco de dados (não pode remover diretório '%-.64s' - erro no. %d)" - rum "Eroare dropuind baza de date (nu pot sa rmdir '%-.64s', Eroare: %d)" - rus "îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÂÁÚÕ ÄÁÎÎÙÈ (ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ËÁÔÁÌÏÇ '%-.64s', ÏÛÉÂËÁ: %d)" - serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem direktorijum '%-.64s', errno: %d)" - slo "Chyba pri mazaní databázy (nemô¾em vymaza» adresár '%-.64s', chybový kód: %d)" - spa "Error eliminando la base de datos (No puedo borrar directorio '%-.64s', error %d)" - swe "Fel vid radering av databasen (Kan inte radera biblioteket '%-.64s'. Felkod: %d)" - ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ (îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÔÅËÕ '%-.64s', ÐÏÍÉÌËÁ: %d)" + cze "Chyba p-Bøi ru¹ení databáze (nemohu vymazat adresáø '%-.192s', chyba %d)" + dan "Fejl ved sletting af database (kan ikke slette folderen '%-.192s', Fejlkode %d)" + nla "Fout bij verwijderen database (kan rmdir '%-.192s' niet uitvoeren, Errcode: %d)" + eng "Error dropping database (can't rmdir '%-.192s', errno: %d)" + jps "ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.192s' ‚ð rmdir ‚Å‚«‚Ü‚¹‚ñ, errno: %d)", + est "Viga andmebaasi kustutamisel (ei suuda kustutada kataloogi '%-.192s', veakood: %d)" + fre "Erreur en effaçant la base (rmdir '%-.192s', erreur %d)" + ger "Fehler beim Löschen der Datenbank (Verzeichnis '%-.192s' kann nicht gelöscht werden, Fehler: %d)" + greek "ÐáñïõóéÜóôçêå ðñüâëçìá êáôÜ ôç äéáãñáöÞ ôçò âÜóçò äåäïìÝíùí (áäýíáôç ç äéáãñáöÞ ôïõ öáêÝëëïõ '%-.192s', êùäéêüò ëÜèïõò: %d)" + hun "Adatbazis megszuntetesi hiba ('%-.192s' nem szuntetheto meg, hibakod: %d)" + ita "Errore durante la cancellazione del database (impossibile rmdir '%-.192s', errno: %d)" + jpn "¥Ç¡¼¥¿¥Ù¡¼¥¹ÇË´þ¥¨¥é¡¼ ('%-.192s' ¤ò rmdir ¤Ç¤­¤Þ¤»¤ó, errno: %d)" + kor "µ¥ÀÌŸº£À̽º Á¦°Å ¿¡·¯(rmdir '%-.192s'¸¦ ÇÒ ¼ö ¾øÀ¾´Ï´Ù, ¿¡·¯¹øÈ£: %d)" + nor "Feil ved sletting av database (kan ikke slette katalogen '%-.192s', feil %d)" + norwegian-ny "Feil ved sletting av database (kan ikkje slette katalogen '%-.192s', feil %d)" + pol "B³?d podczas usuwania bazy danych (nie mo¿na wykonaæ rmdir '%-.192s', b³?d %d)" + por "Erro ao eliminar banco de dados (não pode remover diretório '%-.192s' - erro no. %d)" + rum "Eroare dropuind baza de date (nu pot sa rmdir '%-.192s', Eroare: %d)" + rus "îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÂÁÚÕ ÄÁÎÎÙÈ (ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ËÁÔÁÌÏÇ '%-.192s', ÏÛÉÂËÁ: %d)" + serbian "Ne mogu da izbrišem bazu (ne mogu da izbrišem direktorijum '%-.192s', errno: %d)" + slo "Chyba pri mazaní databázy (nemô¾em vymaza» adresár '%-.192s', chybový kód: %d)" + spa "Error eliminando la base de datos (No puedo borrar directorio '%-.192s', error %d)" + swe "Fel vid radering av databasen (Kan inte radera biblioteket '%-.192s'. Felkod: %d)" + ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÂÁÚÕ ÄÁÎÎÉÈ (îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÔÅËÕ '%-.192s', ÐÏÍÉÌËÁ: %d)" ER_CANT_DELETE_FILE - cze "Chyba p-Bøi výmazu '%-.64s' (chybový kód: %d)" - dan "Fejl ved sletning af '%-.64s' (Fejlkode: %d)" - nla "Fout bij het verwijderen van '%-.64s' (Errcode: %d)" - eng "Error on delete of '%-.64s' (errno: %d)" - jps "'%-.64s' ‚Ì휂ªƒGƒ‰[ (errno: %d)", - est "Viga '%-.64s' kustutamisel (veakood: %d)" - fre "Erreur en effaçant '%-.64s' (Errcode: %d)" - ger "Fehler beim Löschen von '%-.64s' (Fehler: %d)" - greek "ÐáñïõóéÜóôçêå ðñüâëçìá êáôÜ ôç äéáãñáöÞ '%-.64s' (êùäéêüò ëÜèïõò: %d)" - hun "Torlesi hiba: '%-.64s' (hibakod: %d)" - ita "Errore durante la cancellazione di '%-.64s' (errno: %d)" - jpn "'%-.64s' ¤Îºï½ü¤¬¥¨¥é¡¼ (errno: %d)" - kor "'%-.64s' »èÁ¦ Áß ¿¡·¯ (¿¡·¯¹øÈ£: %d)" - nor "Feil ved sletting av '%-.64s' (Feilkode: %d)" - norwegian-ny "Feil ved sletting av '%-.64s' (Feilkode: %d)" - pol "B³?d podczas usuwania '%-.64s' (Kod b³êdu: %d)" - por "Erro na remoção de '%-.64s' (erro no. %d)" - rum "Eroare incercind sa delete '%-.64s' (Eroare: %d)" - rus "ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ '%-.64s' (ÏÛÉÂËÁ: %d)" - serbian "Greška pri brisanju '%-.64s' (errno: %d)" - slo "Chyba pri mazaní '%-.64s' (chybový kód: %d)" - spa "Error en el borrado de '%-.64s' (Error: %d)" - swe "Kan inte radera filen '%-.64s' (Felkod: %d)" - ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ '%-.64s' (ÐÏÍÉÌËÁ: %d)" + cze "Chyba p-Bøi výmazu '%-.192s' (chybový kód: %d)" + dan "Fejl ved sletning af '%-.192s' (Fejlkode: %d)" + nla "Fout bij het verwijderen van '%-.192s' (Errcode: %d)" + eng "Error on delete of '%-.192s' (errno: %d)" + jps "'%-.192s' ‚Ì휂ªƒGƒ‰[ (errno: %d)", + est "Viga '%-.192s' kustutamisel (veakood: %d)" + fre "Erreur en effaçant '%-.192s' (Errcode: %d)" + ger "Fehler beim Löschen von '%-.192s' (Fehler: %d)" + greek "ÐáñïõóéÜóôçêå ðñüâëçìá êáôÜ ôç äéáãñáöÞ '%-.192s' (êùäéêüò ëÜèïõò: %d)" + hun "Torlesi hiba: '%-.192s' (hibakod: %d)" + ita "Errore durante la cancellazione di '%-.192s' (errno: %d)" + jpn "'%-.192s' ¤Îºï½ü¤¬¥¨¥é¡¼ (errno: %d)" + kor "'%-.192s' »èÁ¦ Áß ¿¡·¯ (¿¡·¯¹øÈ£: %d)" + nor "Feil ved sletting av '%-.192s' (Feilkode: %d)" + norwegian-ny "Feil ved sletting av '%-.192s' (Feilkode: %d)" + pol "B³?d podczas usuwania '%-.192s' (Kod b³êdu: %d)" + por "Erro na remoção de '%-.192s' (erro no. %d)" + rum "Eroare incercind sa delete '%-.192s' (Eroare: %d)" + rus "ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ '%-.192s' (ÏÛÉÂËÁ: %d)" + serbian "Greška pri brisanju '%-.192s' (errno: %d)" + slo "Chyba pri mazaní '%-.192s' (chybový kód: %d)" + spa "Error en el borrado de '%-.192s' (Error: %d)" + swe "Kan inte radera filen '%-.192s' (Felkod: %d)" + ukr "îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ '%-.192s' (ÐÏÍÉÌËÁ: %d)" ER_CANT_FIND_SYSTEM_REC cze "Nemohu -Bèíst záznam v systémové tabulce" dan "Kan ikke læse posten i systemfolderen" @@ -400,78 +400,78 @@ ER_FILE_NOT_FOUND swe "Hittar inte filen '%-.200s' (Felkod: %d)" ukr "îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÆÁÊÌ: '%-.200s' (ÐÏÍÉÌËÁ: %d)" ER_CANT_READ_DIR - cze "Nemohu -Bèíst adresáø '%-.64s' (chybový kód: %d)" - dan "Kan ikke læse folder '%-.64s' (Fejlkode: %d)" - nla "Kan de directory niet lezen van '%-.64s' (Errcode: %d)" - eng "Can't read dir of '%-.64s' (errno: %d)" - jps "'%-.64s' ƒfƒBƒŒƒNƒgƒŠ‚ª“ǂ߂܂¹‚ñ.(errno: %d)", - est "Ei suuda lugeda kataloogi '%-.64s' (veakood: %d)" - fre "Ne peut lire le répertoire de '%-.64s' (Errcode: %d)" - ger "Verzeichnis von '%-.64s' nicht lesbar (Fehler: %d)" - greek "Äåí åßíáé äõíáôü íá äéáâáóôåß ï öÜêåëëïò ôïõ '%-.64s' (êùäéêüò ëÜèïõò: %d)" - hun "A(z) '%-.64s' konyvtar nem olvashato. (hibakod: %d)" - ita "Impossibile leggere la directory di '%-.64s' (errno: %d)" - jpn "'%-.64s' ¥Ç¥£¥ì¥¯¥È¥ê¤¬ÆÉ¤á¤Þ¤»¤ó.(errno: %d)" - kor "'%-.64s'µð·ºÅ丮¸¦ ÀÐÁö ¸øÇß½À´Ï´Ù. (¿¡·¯¹øÈ£: %d)" - nor "Kan ikke lese katalogen '%-.64s' (Feilkode: %d)" - norwegian-ny "Kan ikkje lese katalogen '%-.64s' (Feilkode: %d)" - pol "Nie mo¿na odczytaæ katalogu '%-.64s' (Kod b³êdu: %d)" - por "Não pode ler o diretório de '%-.64s' (erro no. %d)" - rum "Nu pot sa citesc directorul '%-.64s' (Eroare: %d)" - rus "îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ËÁÔÁÌÏÇ '%-.64s' (ÏÛÉÂËÁ: %d)" - serbian "Ne mogu da proèitam direktorijum '%-.64s' (errno: %d)" - slo "Nemô¾em èíta» adresár '%-.64s' (chybový kód: %d)" - spa "No puedo leer el directorio de '%-.64s' (Error: %d)" - swe "Kan inte läsa från bibliotek '%-.64s' (Felkod: %d)" - ukr "îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ ÔÅËÕ '%-.64s' (ÐÏÍÉÌËÁ: %d)" + cze "Nemohu -Bèíst adresáø '%-.192s' (chybový kód: %d)" + dan "Kan ikke læse folder '%-.192s' (Fejlkode: %d)" + nla "Kan de directory niet lezen van '%-.192s' (Errcode: %d)" + eng "Can't read dir of '%-.192s' (errno: %d)" + jps "'%-.192s' ƒfƒBƒŒƒNƒgƒŠ‚ª“ǂ߂܂¹‚ñ.(errno: %d)", + est "Ei suuda lugeda kataloogi '%-.192s' (veakood: %d)" + fre "Ne peut lire le répertoire de '%-.192s' (Errcode: %d)" + ger "Verzeichnis von '%-.192s' nicht lesbar (Fehler: %d)" + greek "Äåí åßíáé äõíáôü íá äéáâáóôåß ï öÜêåëëïò ôïõ '%-.192s' (êùäéêüò ëÜèïõò: %d)" + hun "A(z) '%-.192s' konyvtar nem olvashato. (hibakod: %d)" + ita "Impossibile leggere la directory di '%-.192s' (errno: %d)" + jpn "'%-.192s' ¥Ç¥£¥ì¥¯¥È¥ê¤¬ÆÉ¤á¤Þ¤»¤ó.(errno: %d)" + kor "'%-.192s'µð·ºÅ丮¸¦ ÀÐÁö ¸øÇß½À´Ï´Ù. (¿¡·¯¹øÈ£: %d)" + nor "Kan ikke lese katalogen '%-.192s' (Feilkode: %d)" + norwegian-ny "Kan ikkje lese katalogen '%-.192s' (Feilkode: %d)" + pol "Nie mo¿na odczytaæ katalogu '%-.192s' (Kod b³êdu: %d)" + por "Não pode ler o diretório de '%-.192s' (erro no. %d)" + rum "Nu pot sa citesc directorul '%-.192s' (Eroare: %d)" + rus "îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ËÁÔÁÌÏÇ '%-.192s' (ÏÛÉÂËÁ: %d)" + serbian "Ne mogu da proèitam direktorijum '%-.192s' (errno: %d)" + slo "Nemô¾em èíta» adresár '%-.192s' (chybový kód: %d)" + spa "No puedo leer el directorio de '%-.192s' (Error: %d)" + swe "Kan inte läsa från bibliotek '%-.192s' (Felkod: %d)" + ukr "îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ ÔÅËÕ '%-.192s' (ÐÏÍÉÌËÁ: %d)" ER_CANT_SET_WD - cze "Nemohu zm-Bìnit adresáø na '%-.64s' (chybový kód: %d)" - dan "Kan ikke skifte folder til '%-.64s' (Fejlkode: %d)" - nla "Kan de directory niet veranderen naar '%-.64s' (Errcode: %d)" - eng "Can't change dir to '%-.64s' (errno: %d)" - jps "'%-.64s' ƒfƒBƒŒƒNƒgƒŠ‚É chdir ‚Å‚«‚Ü‚¹‚ñ.(errno: %d)", - est "Ei suuda siseneda kataloogi '%-.64s' (veakood: %d)" - fre "Ne peut changer le répertoire pour '%-.64s' (Errcode: %d)" - ger "Kann nicht in das Verzeichnis '%-.64s' wechseln (Fehler: %d)" - greek "Áäýíáôç ç áëëáãÞ ôïõ ôñÝ÷ïíôïò êáôáëüãïõ óå '%-.64s' (êùäéêüò ëÜèïõò: %d)" - hun "Konyvtarvaltas nem lehetseges a(z) '%-.64s'-ba. (hibakod: %d)" - ita "Impossibile cambiare la directory in '%-.64s' (errno: %d)" - jpn "'%-.64s' ¥Ç¥£¥ì¥¯¥È¥ê¤Ë chdir ¤Ç¤­¤Þ¤»¤ó.(errno: %d)" - kor "'%-.64s'µð·ºÅ丮·Î À̵¿ÇÒ ¼ö ¾ø¾ú½À´Ï´Ù. (¿¡·¯¹øÈ£: %d)" - nor "Kan ikke skifte katalog til '%-.64s' (Feilkode: %d)" - norwegian-ny "Kan ikkje skifte katalog til '%-.64s' (Feilkode: %d)" - pol "Nie mo¿na zmieniæ katalogu na '%-.64s' (Kod b³êdu: %d)" - por "Não pode mudar para o diretório '%-.64s' (erro no. %d)" - rum "Nu pot sa schimb directorul '%-.64s' (Eroare: %d)" - rus "îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÊÔÉ × ËÁÔÁÌÏÇ '%-.64s' (ÏÛÉÂËÁ: %d)" - serbian "Ne mogu da promenim direktorijum na '%-.64s' (errno: %d)" - slo "Nemô¾em vojs» do adresára '%-.64s' (chybový kód: %d)" - spa "No puedo cambiar al directorio de '%-.64s' (Error: %d)" - swe "Kan inte byta till '%-.64s' (Felkod: %d)" - ukr "îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ Õ ÔÅËÕ '%-.64s' (ÐÏÍÉÌËÁ: %d)" + cze "Nemohu zm-Bìnit adresáø na '%-.192s' (chybový kód: %d)" + dan "Kan ikke skifte folder til '%-.192s' (Fejlkode: %d)" + nla "Kan de directory niet veranderen naar '%-.192s' (Errcode: %d)" + eng "Can't change dir to '%-.192s' (errno: %d)" + jps "'%-.192s' ƒfƒBƒŒƒNƒgƒŠ‚É chdir ‚Å‚«‚Ü‚¹‚ñ.(errno: %d)", + est "Ei suuda siseneda kataloogi '%-.192s' (veakood: %d)" + fre "Ne peut changer le répertoire pour '%-.192s' (Errcode: %d)" + ger "Kann nicht in das Verzeichnis '%-.192s' wechseln (Fehler: %d)" + greek "Áäýíáôç ç áëëáãÞ ôïõ ôñÝ÷ïíôïò êáôáëüãïõ óå '%-.192s' (êùäéêüò ëÜèïõò: %d)" + hun "Konyvtarvaltas nem lehetseges a(z) '%-.192s'-ba. (hibakod: %d)" + ita "Impossibile cambiare la directory in '%-.192s' (errno: %d)" + jpn "'%-.192s' ¥Ç¥£¥ì¥¯¥È¥ê¤Ë chdir ¤Ç¤­¤Þ¤»¤ó.(errno: %d)" + kor "'%-.192s'µð·ºÅ丮·Î À̵¿ÇÒ ¼ö ¾ø¾ú½À´Ï´Ù. (¿¡·¯¹øÈ£: %d)" + nor "Kan ikke skifte katalog til '%-.192s' (Feilkode: %d)" + norwegian-ny "Kan ikkje skifte katalog til '%-.192s' (Feilkode: %d)" + pol "Nie mo¿na zmieniæ katalogu na '%-.192s' (Kod b³êdu: %d)" + por "Não pode mudar para o diretório '%-.192s' (erro no. %d)" + rum "Nu pot sa schimb directorul '%-.192s' (Eroare: %d)" + rus "îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÊÔÉ × ËÁÔÁÌÏÇ '%-.192s' (ÏÛÉÂËÁ: %d)" + serbian "Ne mogu da promenim direktorijum na '%-.192s' (errno: %d)" + slo "Nemô¾em vojs» do adresára '%-.192s' (chybový kód: %d)" + spa "No puedo cambiar al directorio de '%-.192s' (Error: %d)" + swe "Kan inte byta till '%-.192s' (Felkod: %d)" + ukr "îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ Õ ÔÅËÕ '%-.192s' (ÐÏÍÉÌËÁ: %d)" ER_CHECKREAD - cze "Z-Báznam byl zmìnìn od posledního ètení v tabulce '%-.64s'" - dan "Posten er ændret siden sidste læsning '%-.64s'" - nla "Record is veranderd sinds de laatste lees activiteit in de tabel '%-.64s'" - eng "Record has changed since last read in table '%-.64s'" - est "Kirje tabelis '%-.64s' on muutunud viimasest lugemisest saadik" - fre "Enregistrement modifié depuis sa dernière lecture dans la table '%-.64s'" - ger "Datensatz hat sich seit dem letzten Zugriff auf Tabelle '%-.64s' geändert" - greek "Ç åããñáöÞ Ý÷åé áëëÜîåé áðü ôçí ôåëåõôáßá öïñÜ ðïõ áíáóýñèçêå áðü ôïí ðßíáêá '%-.64s'" - hun "A(z) '%-.64s' tablaban talalhato rekord megvaltozott az utolso olvasas ota" - ita "Il record e` cambiato dall'ultima lettura della tabella '%-.64s'" - kor "Å×À̺í '%-.64s'¿¡¼­ ¸¶Áö¸·À¸·Î ÀÐÀº ÈÄ Record°¡ º¯°æµÇ¾ú½À´Ï´Ù." - nor "Posten har blitt endret siden den ble lest '%-.64s'" - norwegian-ny "Posten har vorte endra sidan den sist vart lesen '%-.64s'" - pol "Rekord zosta³ zmieniony od ostaniego odczytania z tabeli '%-.64s'" - por "Registro alterado desde a última leitura da tabela '%-.64s'" - rum "Cimpul a fost schimbat de la ultima citire a tabelei '%-.64s'" - rus "úÁÐÉÓØ ÉÚÍÅÎÉÌÁÓØ Ó ÍÏÍÅÎÔÁ ÐÏÓÌÅÄÎÅÊ ×ÙÂÏÒËÉ × ÔÁÂÌÉÃÅ '%-.64s'" - serbian "Slog je promenjen od zadnjeg èitanja tabele '%-.64s'" - slo "Záznam bol zmenený od posledného èítania v tabuµke '%-.64s'" - spa "El registro ha cambiado desde la ultima lectura de la tabla '%-.64s'" - swe "Posten har förändrats sedan den lästes i register '%-.64s'" - ukr "úÁÐÉÓ ÂÕÌÏ ÚͦÎÅÎÏ Ú ÞÁÓÕ ÏÓÔÁÎÎØÏÇÏ ÞÉÔÁÎÎÑ Ú ÔÁÂÌÉæ '%-.64s'" + cze "Z-Báznam byl zmìnìn od posledního ètení v tabulce '%-.192s'" + dan "Posten er ændret siden sidste læsning '%-.192s'" + nla "Record is veranderd sinds de laatste lees activiteit in de tabel '%-.192s'" + eng "Record has changed since last read in table '%-.192s'" + est "Kirje tabelis '%-.192s' on muutunud viimasest lugemisest saadik" + fre "Enregistrement modifié depuis sa dernière lecture dans la table '%-.192s'" + ger "Datensatz hat sich seit dem letzten Zugriff auf Tabelle '%-.192s' geändert" + greek "Ç åããñáöÞ Ý÷åé áëëÜîåé áðü ôçí ôåëåõôáßá öïñÜ ðïõ áíáóýñèçêå áðü ôïí ðßíáêá '%-.192s'" + hun "A(z) '%-.192s' tablaban talalhato rekord megvaltozott az utolso olvasas ota" + ita "Il record e` cambiato dall'ultima lettura della tabella '%-.192s'" + kor "Å×À̺í '%-.192s'¿¡¼­ ¸¶Áö¸·À¸·Î ÀÐÀº ÈÄ Record°¡ º¯°æµÇ¾ú½À´Ï´Ù." + nor "Posten har blitt endret siden den ble lest '%-.192s'" + norwegian-ny "Posten har vorte endra sidan den sist vart lesen '%-.192s'" + pol "Rekord zosta³ zmieniony od ostaniego odczytania z tabeli '%-.192s'" + por "Registro alterado desde a última leitura da tabela '%-.192s'" + rum "Cimpul a fost schimbat de la ultima citire a tabelei '%-.192s'" + rus "úÁÐÉÓØ ÉÚÍÅÎÉÌÁÓØ Ó ÍÏÍÅÎÔÁ ÐÏÓÌÅÄÎÅÊ ×ÙÂÏÒËÉ × ÔÁÂÌÉÃÅ '%-.192s'" + serbian "Slog je promenjen od zadnjeg èitanja tabele '%-.192s'" + slo "Záznam bol zmenený od posledného èítania v tabuµke '%-.192s'" + spa "El registro ha cambiado desde la ultima lectura de la tabla '%-.192s'" + swe "Posten har förändrats sedan den lästes i register '%-.192s'" + ukr "úÁÐÉÓ ÂÕÌÏ ÚͦÎÅÎÏ Ú ÞÁÓÕ ÏÓÔÁÎÎØÏÇÏ ÞÉÔÁÎÎÑ Ú ÔÁÂÌÉæ '%-.192s'" ER_DISK_FULL cze "Disk je pln-Bý (%s), èekám na uvolnìní nìjakého místa ..." dan "Ikke mere diskplads (%s). Venter på at få frigjort plads..." @@ -498,53 +498,53 @@ ER_DISK_FULL swe "Disken är full (%s). Väntar tills det finns ledigt utrymme..." ukr "äÉÓË ÚÁÐÏ×ÎÅÎÉÊ (%s). ÷ÉÞÉËÕÀ, ÄÏËÉ Ú×¦ÌØÎÉÔØÓÑ ÔÒÏÈÉ Í¦ÓÃÑ..." ER_DUP_KEY 23000 - cze "Nemohu zapsat, zdvojen-Bý klíè v tabulce '%-.64s'" - dan "Kan ikke skrive, flere ens nøgler i tabellen '%-.64s'" - nla "Kan niet schrijven, dubbele zoeksleutel in tabel '%-.64s'" - eng "Can't write; duplicate key in table '%-.64s'" - jps "table '%-.64s' ‚É key ‚ªd•¡‚µ‚Ä‚¢‚Ä‘‚«‚±‚߂܂¹‚ñ", - est "Ei saa kirjutada, korduv võti tabelis '%-.64s'" - fre "Ecriture impossible, doublon dans une clé de la table '%-.64s'" - ger "Kann nicht speichern, Grund: doppelter Schlüssel in Tabelle '%-.64s'" - greek "Äåí åßíáé äõíáôÞ ç êáôá÷þñçóç, ç ôéìÞ õðÜñ÷åé Þäç óôïí ðßíáêá '%-.64s'" - hun "Irasi hiba, duplikalt kulcs a '%-.64s' tablaban." - ita "Scrittura impossibile: chiave duplicata nella tabella '%-.64s'" - jpn "table '%-.64s' ¤Ë key ¤¬½ÅÊ£¤·¤Æ¤¤¤Æ½ñ¤­¤³¤á¤Þ¤»¤ó" - kor "±â·ÏÇÒ ¼ö ¾øÀ¾´Ï´Ù., Å×À̺í '%-.64s'¿¡¼­ Áߺ¹ Ű" - nor "Kan ikke skrive, flere like nøkler i tabellen '%-.64s'" - norwegian-ny "Kan ikkje skrive, flere like nyklar i tabellen '%-.64s'" - pol "Nie mo¿na zapisaæ, powtórzone klucze w tabeli '%-.64s'" - por "Não pode gravar. Chave duplicada na tabela '%-.64s'" - rum "Nu pot sa scriu (can't write), cheie duplicata in tabela '%-.64s'" - rus "îÅ×ÏÚÍÏÖÎÏ ÐÒÏÉÚ×ÅÓÔÉ ÚÁÐÉÓØ, ÄÕÂÌÉÒÕÀÝÉÊÓÑ ËÌÀÞ × ÔÁÂÌÉÃÅ '%-.64s'" - serbian "Ne mogu da pišem pošto postoji duplirani kljuè u tabeli '%-.64s'" - slo "Nemô¾em zapísa», duplikát kµúèa v tabuµke '%-.64s'" - spa "No puedo escribir, clave duplicada en la tabla '%-.64s'" - swe "Kan inte skriva, dubbel söknyckel i register '%-.64s'" - ukr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ, ÄÕÂÌÀÀÞÉÊÓÑ ËÌÀÞ × ÔÁÂÌÉæ '%-.64s'" + cze "Nemohu zapsat, zdvojen-Bý klíè v tabulce '%-.192s'" + dan "Kan ikke skrive, flere ens nøgler i tabellen '%-.192s'" + nla "Kan niet schrijven, dubbele zoeksleutel in tabel '%-.192s'" + eng "Can't write; duplicate key in table '%-.192s'" + jps "table '%-.192s' ‚É key ‚ªd•¡‚µ‚Ä‚¢‚Ä‘‚«‚±‚߂܂¹‚ñ", + est "Ei saa kirjutada, korduv võti tabelis '%-.192s'" + fre "Ecriture impossible, doublon dans une clé de la table '%-.192s'" + ger "Kann nicht speichern, Grund: doppelter Schlüssel in Tabelle '%-.192s'" + greek "Äåí åßíáé äõíáôÞ ç êáôá÷þñçóç, ç ôéìÞ õðÜñ÷åé Þäç óôïí ðßíáêá '%-.192s'" + hun "Irasi hiba, duplikalt kulcs a '%-.192s' tablaban." + ita "Scrittura impossibile: chiave duplicata nella tabella '%-.192s'" + jpn "table '%-.192s' ¤Ë key ¤¬½ÅÊ£¤·¤Æ¤¤¤Æ½ñ¤­¤³¤á¤Þ¤»¤ó" + kor "±â·ÏÇÒ ¼ö ¾øÀ¾´Ï´Ù., Å×À̺í '%-.192s'¿¡¼­ Áߺ¹ Ű" + nor "Kan ikke skrive, flere like nøkler i tabellen '%-.192s'" + norwegian-ny "Kan ikkje skrive, flere like nyklar i tabellen '%-.192s'" + pol "Nie mo¿na zapisaæ, powtórzone klucze w tabeli '%-.192s'" + por "Não pode gravar. Chave duplicada na tabela '%-.192s'" + rum "Nu pot sa scriu (can't write), cheie duplicata in tabela '%-.192s'" + rus "îÅ×ÏÚÍÏÖÎÏ ÐÒÏÉÚ×ÅÓÔÉ ÚÁÐÉÓØ, ÄÕÂÌÉÒÕÀÝÉÊÓÑ ËÌÀÞ × ÔÁÂÌÉÃÅ '%-.192s'" + serbian "Ne mogu da pišem pošto postoji duplirani kljuè u tabeli '%-.192s'" + slo "Nemô¾em zapísa», duplikát kµúèa v tabuµke '%-.192s'" + spa "No puedo escribir, clave duplicada en la tabla '%-.192s'" + swe "Kan inte skriva, dubbel söknyckel i register '%-.192s'" + ukr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ, ÄÕÂÌÀÀÞÉÊÓÑ ËÌÀÞ × ÔÁÂÌÉæ '%-.192s'" ER_ERROR_ON_CLOSE - cze "Chyba p-Bøi zavírání '%-.64s' (chybový kód: %d)" - dan "Fejl ved lukning af '%-.64s' (Fejlkode: %d)" - nla "Fout bij het sluiten van '%-.64s' (Errcode: %d)" - eng "Error on close of '%-.64s' (errno: %d)" - est "Viga faili '%-.64s' sulgemisel (veakood: %d)" - fre "Erreur a la fermeture de '%-.64s' (Errcode: %d)" - ger "Fehler beim Schließen von '%-.64s' (Fehler: %d)" - greek "ÐáñïõóéÜóôçêå ðñüâëçìá êëåßíïíôáò ôï '%-.64s' (êùäéêüò ëÜèïõò: %d)" - hun "Hiba a(z) '%-.64s' zarasakor. (hibakod: %d)" - ita "Errore durante la chiusura di '%-.64s' (errno: %d)" - kor "'%-.64s'´Ý´Â Áß ¿¡·¯ (¿¡·¯¹øÈ£: %d)" - nor "Feil ved lukking av '%-.64s' (Feilkode: %d)" - norwegian-ny "Feil ved lukking av '%-.64s' (Feilkode: %d)" - pol "B³?d podczas zamykania '%-.64s' (Kod b³êdu: %d)" - por "Erro ao fechar '%-.64s' (erro no. %d)" - rum "Eroare inchizind '%-.64s' (errno: %d)" - rus "ïÛÉÂËÁ ÐÒÉ ÚÁËÒÙÔÉÉ '%-.64s' (ÏÛÉÂËÁ: %d)" - serbian "Greška pri zatvaranju '%-.64s' (errno: %d)" - slo "Chyba pri zatváraní '%-.64s' (chybový kód: %d)" - spa "Error en el cierre de '%-.64s' (Error: %d)" - swe "Fick fel vid stängning av '%-.64s' (Felkod: %d)" - ukr "îÅ ÍÏÖÕ ÚÁËÒÉÔÉ '%-.64s' (ÐÏÍÉÌËÁ: %d)" + cze "Chyba p-Bøi zavírání '%-.192s' (chybový kód: %d)" + dan "Fejl ved lukning af '%-.192s' (Fejlkode: %d)" + nla "Fout bij het sluiten van '%-.192s' (Errcode: %d)" + eng "Error on close of '%-.192s' (errno: %d)" + est "Viga faili '%-.192s' sulgemisel (veakood: %d)" + fre "Erreur a la fermeture de '%-.192s' (Errcode: %d)" + ger "Fehler beim Schließen von '%-.192s' (Fehler: %d)" + greek "ÐáñïõóéÜóôçêå ðñüâëçìá êëåßíïíôáò ôï '%-.192s' (êùäéêüò ëÜèïõò: %d)" + hun "Hiba a(z) '%-.192s' zarasakor. (hibakod: %d)" + ita "Errore durante la chiusura di '%-.192s' (errno: %d)" + kor "'%-.192s'´Ý´Â Áß ¿¡·¯ (¿¡·¯¹øÈ£: %d)" + nor "Feil ved lukking av '%-.192s' (Feilkode: %d)" + norwegian-ny "Feil ved lukking av '%-.192s' (Feilkode: %d)" + pol "B³?d podczas zamykania '%-.192s' (Kod b³êdu: %d)" + por "Erro ao fechar '%-.192s' (erro no. %d)" + rum "Eroare inchizind '%-.192s' (errno: %d)" + rus "ïÛÉÂËÁ ÐÒÉ ÚÁËÒÙÔÉÉ '%-.192s' (ÏÛÉÂËÁ: %d)" + serbian "Greška pri zatvaranju '%-.192s' (errno: %d)" + slo "Chyba pri zatváraní '%-.192s' (chybový kód: %d)" + spa "Error en el cierre de '%-.192s' (Error: %d)" + swe "Fick fel vid stängning av '%-.192s' (Felkod: %d)" + ukr "îÅ ÍÏÖÕ ÚÁËÒÉÔÉ '%-.192s' (ÐÏÍÉÌËÁ: %d)" ER_ERROR_ON_READ cze "Chyba p-Bøi ètení souboru '%-.200s' (chybový kód: %d)" dan "Fejl ved læsning af '%-.200s' (Fejlkode: %d)" @@ -621,30 +621,30 @@ ER_ERROR_ON_WRITE swe "Fick fel vid skrivning till '%-.200s' (Felkod %d)" ukr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ ÆÁÊÌ '%-.200s' (ÐÏÍÉÌËÁ: %d)" ER_FILE_USED - cze "'%-.64s' je zam-Bèen proti zmìnám" - dan "'%-.64s' er låst mod opdateringer" - nla "'%-.64s' is geblokeerd tegen veranderingen" - eng "'%-.64s' is locked against change" - jps "'%-.64s' ‚̓ƒbƒN‚³‚ê‚Ä‚¢‚Ü‚·", - est "'%-.64s' on lukustatud muudatuste vastu" - fre "'%-.64s' est verrouillé contre les modifications" - ger "'%-.64s' ist für Änderungen gesperrt" - greek "'%-.64s' äåí åðéôñÝðïíôáé áëëáãÝò" - hun "'%-.64s' a valtoztatas ellen zarolva" - ita "'%-.64s' e` soggetto a lock contro i cambiamenti" - jpn "'%-.64s' ¤Ï¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹" - kor "'%-.64s'°¡ º¯°æÇÒ ¼ö ¾øµµ·Ï Àá°ÜÀÖÀ¾´Ï´Ù." - nor "'%-.64s' er låst mot oppdateringer" - norwegian-ny "'%-.64s' er låst mot oppdateringar" - pol "'%-.64s' jest zablokowany na wypadek zmian" - por "'%-.64s' está com travamento contra alterações" - rum "'%-.64s' este blocat pentry schimbari (loccked against change)" - rus "'%-.64s' ÚÁÂÌÏËÉÒÏ×ÁÎ ÄÌÑ ÉÚÍÅÎÅÎÉÊ" - serbian "'%-.64s' je zakljuèan za upis" - slo "'%-.64s' je zamknutý proti zmenám" - spa "'%-.64s' esta bloqueado contra cambios" - swe "'%-.64s' är låst mot användning" - ukr "'%-.64s' ÚÁÂÌÏËÏ×ÁÎÉÊ ÎÁ ×ÎÅÓÅÎÎÑ ÚͦÎ" + cze "'%-.192s' je zam-Bèen proti zmìnám" + dan "'%-.192s' er låst mod opdateringer" + nla "'%-.192s' is geblokeerd tegen veranderingen" + eng "'%-.192s' is locked against change" + jps "'%-.192s' ‚̓ƒbƒN‚³‚ê‚Ä‚¢‚Ü‚·", + est "'%-.192s' on lukustatud muudatuste vastu" + fre "'%-.192s' est verrouillé contre les modifications" + ger "'%-.192s' ist für Änderungen gesperrt" + greek "'%-.192s' äåí åðéôñÝðïíôáé áëëáãÝò" + hun "'%-.192s' a valtoztatas ellen zarolva" + ita "'%-.192s' e` soggetto a lock contro i cambiamenti" + jpn "'%-.192s' ¤Ï¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹" + kor "'%-.192s'°¡ º¯°æÇÒ ¼ö ¾øµµ·Ï Àá°ÜÀÖÀ¾´Ï´Ù." + nor "'%-.192s' er låst mot oppdateringer" + norwegian-ny "'%-.192s' er låst mot oppdateringar" + pol "'%-.192s' jest zablokowany na wypadek zmian" + por "'%-.192s' está com travamento contra alterações" + rum "'%-.192s' este blocat pentry schimbari (loccked against change)" + rus "'%-.192s' ÚÁÂÌÏËÉÒÏ×ÁÎ ÄÌÑ ÉÚÍÅÎÅÎÉÊ" + serbian "'%-.192s' je zakljuèan za upis" + slo "'%-.192s' je zamknutý proti zmenám" + spa "'%-.192s' esta bloqueado contra cambios" + swe "'%-.192s' är låst mot användning" + ukr "'%-.192s' ÚÁÂÌÏËÏ×ÁÎÉÊ ÎÁ ×ÎÅÓÅÎÎÑ ÚͦÎ" ER_FILSORT_ABORT cze "T-Bøídìní pøeru¹eno" dan "Sortering afbrudt" @@ -671,30 +671,30 @@ ER_FILSORT_ABORT swe "Sorteringen avbruten" ukr "óÏÒÔÕ×ÁÎÎÑ ÐÅÒÅÒ×ÁÎÏ" ER_FORM_NOT_FOUND - cze "Pohled '%-.64s' pro '%-.64s' neexistuje" - dan "View '%-.64s' eksisterer ikke for '%-.64s'" - nla "View '%-.64s' bestaat niet voor '%-.64s'" - eng "View '%-.64s' doesn't exist for '%-.64s'" - jps "View '%-.64s' ‚ª '%-.64s' ‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", - est "Vaade '%-.64s' ei eksisteeri '%-.64s' jaoks" - fre "La vue (View) '%-.64s' n'existe pas pour '%-.64s'" - ger "View '%-.64s' existiert für '%-.64s' nicht" - greek "Ôï View '%-.64s' äåí õðÜñ÷åé ãéá '%-.64s'" - hun "A(z) '%-.64s' nezet nem letezik a(z) '%-.64s'-hoz" - ita "La view '%-.64s' non esiste per '%-.64s'" - jpn "View '%-.64s' ¤¬ '%-.64s' ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" - kor "ºä '%-.64s'°¡ '%-.64s'¿¡¼­´Â Á¸ÀçÇÏÁö ¾ÊÀ¾´Ï´Ù." - nor "View '%-.64s' eksisterer ikke for '%-.64s'" - norwegian-ny "View '%-.64s' eksisterar ikkje for '%-.64s'" - pol "Widok '%-.64s' nie istnieje dla '%-.64s'" - por "Visão '%-.64s' não existe para '%-.64s'" - rum "View '%-.64s' nu exista pentru '%-.64s'" - rus "ðÒÅÄÓÔÁ×ÌÅÎÉÅ '%-.64s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ ÄÌÑ '%-.64s'" - serbian "View '%-.64s' ne postoji za '%-.64s'" - slo "Pohµad '%-.64s' neexistuje pre '%-.64s'" - spa "La vista '%-.64s' no existe para '%-.64s'" - swe "Formulär '%-.64s' finns inte i '%-.64s'" - ukr "÷ÉÇÌÑÄ '%-.64s' ÎÅ ¦ÓÎÕ¤ ÄÌÑ '%-.64s'" + cze "Pohled '%-.192s' pro '%-.192s' neexistuje" + dan "View '%-.192s' eksisterer ikke for '%-.192s'" + nla "View '%-.192s' bestaat niet voor '%-.192s'" + eng "View '%-.192s' doesn't exist for '%-.192s'" + jps "View '%-.192s' ‚ª '%-.192s' ‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", + est "Vaade '%-.192s' ei eksisteeri '%-.192s' jaoks" + fre "La vue (View) '%-.192s' n'existe pas pour '%-.192s'" + ger "View '%-.192s' existiert für '%-.192s' nicht" + greek "Ôï View '%-.192s' äåí õðÜñ÷åé ãéá '%-.192s'" + hun "A(z) '%-.192s' nezet nem letezik a(z) '%-.192s'-hoz" + ita "La view '%-.192s' non esiste per '%-.192s'" + jpn "View '%-.192s' ¤¬ '%-.192s' ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + kor "ºä '%-.192s'°¡ '%-.192s'¿¡¼­´Â Á¸ÀçÇÏÁö ¾ÊÀ¾´Ï´Ù." + nor "View '%-.192s' eksisterer ikke for '%-.192s'" + norwegian-ny "View '%-.192s' eksisterar ikkje for '%-.192s'" + pol "Widok '%-.192s' nie istnieje dla '%-.192s'" + por "Visão '%-.192s' não existe para '%-.192s'" + rum "View '%-.192s' nu exista pentru '%-.192s'" + rus "ðÒÅÄÓÔÁ×ÌÅÎÉÅ '%-.192s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ ÄÌÑ '%-.192s'" + serbian "View '%-.192s' ne postoji za '%-.192s'" + slo "Pohµad '%-.192s' neexistuje pre '%-.192s'" + spa "La vista '%-.192s' no existe para '%-.192s'" + swe "Formulär '%-.192s' finns inte i '%-.192s'" + ukr "÷ÉÇÌÑÄ '%-.192s' ÎÅ ¦ÓÎÕ¤ ÄÌÑ '%-.192s'" ER_GET_ERRNO cze "Obsluha tabulky vr-Bátila chybu %d" dan "Modtog fejl %d fra tabel håndteringen" @@ -720,54 +720,54 @@ ER_GET_ERRNO swe "Fick felkod %d från databashanteraren" ukr "ïÔÒÉÍÁÎÏ ÐÏÍÉÌËÕ %d ×¦Ä ÄÅÓËÒÉÐÔÏÒÁ ÔÁÂÌÉæ" ER_ILLEGAL_HA - cze "Obsluha tabulky '%-.64s' nem-Bá tento parametr" - dan "Denne mulighed eksisterer ikke for tabeltypen '%-.64s'" - nla "Tabel handler voor '%-.64s' heeft deze optie niet" - eng "Table storage engine for '%-.64s' doesn't have this option" - est "Tabeli '%-.64s' handler ei toeta antud operatsiooni" - fre "Le handler de la table '%-.64s' n'a pas cette option" - ger "Diese Option gibt es nicht (Speicher-Engine für '%-.64s')" - greek "Ï ÷åéñéóôÞò ðßíáêá (table handler) ãéá '%-.64s' äåí äéáèÝôåé áõôÞ ôçí åðéëïãÞ" - hun "A(z) '%-.64s' tablakezelonek nincs ilyen opcioja" - ita "Il gestore delle tabelle per '%-.64s' non ha questa opzione" - jpn "Table handler for '%-.64s' doesn't have this option" - kor "'%-.64s'ÀÇ Å×À̺í handler´Â ÀÌ·¯ÇÑ ¿É¼ÇÀ» Á¦°øÇÏÁö ¾ÊÀ¾´Ï´Ù." - nor "Tabell håndtereren for '%-.64s' har ikke denne muligheten" - norwegian-ny "Tabell håndteraren for '%-.64s' har ikkje denne moglegheita" - pol "Obs³uga tabeli '%-.64s' nie posiada tej opcji" - por "Manipulador de tabela para '%-.64s' não tem esta opção" - rum "Handlerul tabelei pentru '%-.64s' nu are aceasta optiune" - rus "ïÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ '%-.64s' ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÜÔÕ ×ÏÚÍÏÖÎÏÓÔØ" - serbian "Handler tabela za '%-.64s' nema ovu opciju" - slo "Obsluha tabuµky '%-.64s' nemá tento parameter" - spa "El manejador de la tabla de '%-.64s' no tiene esta opcion" - swe "Tabellhanteraren for tabell '%-.64s' stödjer ej detta" - ukr "äÅÓËÒÉÐÔÏÒ ÔÁÂÌÉæ '%-.64s' ÎÅ ÍÁ¤ 椧 ×ÌÁÓÔÉ×ÏÓÔ¦" + cze "Obsluha tabulky '%-.192s' nem-Bá tento parametr" + dan "Denne mulighed eksisterer ikke for tabeltypen '%-.192s'" + nla "Tabel handler voor '%-.192s' heeft deze optie niet" + eng "Table storage engine for '%-.192s' doesn't have this option" + est "Tabeli '%-.192s' handler ei toeta antud operatsiooni" + fre "Le handler de la table '%-.192s' n'a pas cette option" + ger "Diese Option gibt es nicht (Speicher-Engine für '%-.192s')" + greek "Ï ÷åéñéóôÞò ðßíáêá (table handler) ãéá '%-.192s' äåí äéáèÝôåé áõôÞ ôçí åðéëïãÞ" + hun "A(z) '%-.192s' tablakezelonek nincs ilyen opcioja" + ita "Il gestore delle tabelle per '%-.192s' non ha questa opzione" + jpn "Table handler for '%-.192s' doesn't have this option" + kor "'%-.192s'ÀÇ Å×À̺í handler´Â ÀÌ·¯ÇÑ ¿É¼ÇÀ» Á¦°øÇÏÁö ¾ÊÀ¾´Ï´Ù." + nor "Tabell håndtereren for '%-.192s' har ikke denne muligheten" + norwegian-ny "Tabell håndteraren for '%-.192s' har ikkje denne moglegheita" + pol "Obs³uga tabeli '%-.192s' nie posiada tej opcji" + por "Manipulador de tabela para '%-.192s' não tem esta opção" + rum "Handlerul tabelei pentru '%-.192s' nu are aceasta optiune" + rus "ïÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ '%-.192s' ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÜÔÕ ×ÏÚÍÏÖÎÏÓÔØ" + serbian "Handler tabela za '%-.192s' nema ovu opciju" + slo "Obsluha tabuµky '%-.192s' nemá tento parameter" + spa "El manejador de la tabla de '%-.192s' no tiene esta opcion" + swe "Tabellhanteraren for tabell '%-.192s' stödjer ej detta" + ukr "äÅÓËÒÉÐÔÏÒ ÔÁÂÌÉæ '%-.192s' ÎÅ ÍÁ¤ 椧 ×ÌÁÓÔÉ×ÏÓÔ¦" ER_KEY_NOT_FOUND - cze "Nemohu naj-Bít záznam v '%-.64s'" - dan "Kan ikke finde posten i '%-.64s'" - nla "Kan record niet vinden in '%-.64s'" - eng "Can't find record in '%-.64s'" - jps "'%-.64s'‚̂Ȃ©‚ɃŒƒR[ƒh‚ªŒ©•t‚©‚è‚Ü‚¹‚ñ", - est "Ei suuda leida kirjet '%-.64s'-s" - fre "Ne peut trouver l'enregistrement dans '%-.64s'" - ger "Kann Datensatz in '%-.64s' nicht finden" - greek "Áäýíáôç ç áíåýñåóç åããñáöÞò óôï '%-.64s'" - hun "Nem talalhato a rekord '%-.64s'-ben" - ita "Impossibile trovare il record in '%-.64s'" - jpn "'%-.64s'¤Î¤Ê¤«¤Ë¥ì¥³¡¼¥É¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó" - kor "'%-.64s'¿¡¼­ ·¹Äڵ带 ãÀ» ¼ö ¾øÀ¾´Ï´Ù." - nor "Kan ikke finne posten i '%-.64s'" - norwegian-ny "Kan ikkje finne posten i '%-.64s'" - pol "Nie mo¿na znale¥æ rekordu w '%-.64s'" - por "Não pode encontrar registro em '%-.64s'" - rum "Nu pot sa gasesc recordul in '%-.64s'" - rus "îÅ×ÏÚÍÏÖÎÏ ÎÁÊÔÉ ÚÁÐÉÓØ × '%-.64s'" - serbian "Ne mogu da pronaðem slog u '%-.64s'" - slo "Nemô¾em nájs» záznam v '%-.64s'" - spa "No puedo encontrar el registro en '%-.64s'" - swe "Hittar inte posten '%-.64s'" - ukr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ Õ '%-.64s'" + cze "Nemohu naj-Bít záznam v '%-.192s'" + dan "Kan ikke finde posten i '%-.192s'" + nla "Kan record niet vinden in '%-.192s'" + eng "Can't find record in '%-.192s'" + jps "'%-.192s'‚̂Ȃ©‚ɃŒƒR[ƒh‚ªŒ©•t‚©‚è‚Ü‚¹‚ñ", + est "Ei suuda leida kirjet '%-.192s'-s" + fre "Ne peut trouver l'enregistrement dans '%-.192s'" + ger "Kann Datensatz in '%-.192s' nicht finden" + greek "Áäýíáôç ç áíåýñåóç åããñáöÞò óôï '%-.192s'" + hun "Nem talalhato a rekord '%-.192s'-ben" + ita "Impossibile trovare il record in '%-.192s'" + jpn "'%-.192s'¤Î¤Ê¤«¤Ë¥ì¥³¡¼¥É¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó" + kor "'%-.192s'¿¡¼­ ·¹Äڵ带 ãÀ» ¼ö ¾øÀ¾´Ï´Ù." + nor "Kan ikke finne posten i '%-.192s'" + norwegian-ny "Kan ikkje finne posten i '%-.192s'" + pol "Nie mo¿na znale¥æ rekordu w '%-.192s'" + por "Não pode encontrar registro em '%-.192s'" + rum "Nu pot sa gasesc recordul in '%-.192s'" + rus "îÅ×ÏÚÍÏÖÎÏ ÎÁÊÔÉ ÚÁÐÉÓØ × '%-.192s'" + serbian "Ne mogu da pronaðem slog u '%-.192s'" + slo "Nemô¾em nájs» záznam v '%-.192s'" + spa "No puedo encontrar el registro en '%-.192s'" + swe "Hittar inte posten '%-.192s'" + ukr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ Õ '%-.192s'" ER_NOT_FORM_FILE cze "Nespr-Bávná informace v souboru '%-.200s'" dan "Forkert indhold i: '%-.200s'" @@ -819,55 +819,55 @@ ER_NOT_KEYFILE swe "Fatalt fel vid hantering av register '%-.200s'; kör en reparation" ukr "èÉÂÎÉÊ ÆÁÊÌ ËÌÀÞÅÊ ÄÌÑ ÔÁÂÌÉæ: '%-.200s'; óÐÒÏÂÕÊÔÅ ÊÏÇÏ ×¦ÄÎÏ×ÉÔÉ" ER_OLD_KEYFILE - cze "Star-Bý klíèový soubor pro '%-.64s'; opravte ho." - dan "Gammel indeksfil for tabellen '%-.64s'; reparer den" - nla "Oude zoeksleutel file voor tabel '%-.64s'; repareer het!" - eng "Old key file for table '%-.64s'; repair it!" - jps "'%-.64s' ƒe[ƒuƒ‹‚͌¢Œ`Ž®‚Ì key file ‚̂悤‚Å‚·; C•œ‚ð‚µ‚Ä‚­‚¾‚³‚¢", - est "Tabeli '%-.64s' võtmefail on aegunud; paranda see!" - fre "Vieux fichier d'index pour la table '%-.64s'; réparez le!" - ger "Alte Index-Datei für Tabelle '%-.64s'. Bitte reparieren" - greek "Ðáëáéü áñ÷åßï ôáîéíüìéóçò (key file) ãéá ôïí ðßíáêá '%-.64s'; Ðáñáêáëþ, äéïñèþóôå ôï!" - hun "Regi kulcsfile a '%-.64s'tablahoz; probalja kijavitani!" - ita "File chiave vecchio per la tabella '%-.64s'; riparalo!" - jpn "'%-.64s' ¥Æ¡¼¥Ö¥ë¤Ï¸Å¤¤·Á¼°¤Î key file ¤Î¤è¤¦¤Ç¤¹; ½¤Éü¤ò¤·¤Æ¤¯¤À¤µ¤¤" - kor "'%-.64s' Å×À̺íÀÇ ÀÌÀü¹öÁ¯ÀÇ Å° Á¸Àç. ¼öÁ¤ÇϽÿÀ!" - nor "Gammel nøkkelfil for tabellen '%-.64s'; reparer den!" - norwegian-ny "Gammel nykkelfil for tabellen '%-.64s'; reparer den!" - pol "Plik kluczy dla tabeli '%-.64s' jest starego typu; napraw go!" - por "Arquivo de índice desatualizado para tabela '%-.64s'; repare-o!" - rum "Cheia fisierului e veche pentru tabela '%-.64s'; repar-o!" - rus "óÔÁÒÙÊ ÉÎÄÅËÓÎÙÊ ÆÁÊÌ ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'; ÏÔÒÅÍÏÎÔÉÒÕÊÔÅ ÅÇÏ!" - serbian "Zastareo key file za tabelu '%-.64s'; ispravite ga" - slo "Starý kµúèový súbor pre '%-.64s'; opravte ho!" - spa "Clave de archivo antigua para la tabla '%-.64s'; reparelo!" - swe "Gammal nyckelfil '%-.64s'; reparera registret" - ukr "óÔÁÒÉÊ ÆÁÊÌ ËÌÀÞÅÊ ÄÌÑ ÔÁÂÌÉæ '%-.64s'; ÷¦ÄÎÏ×¦ÔØ ÊÏÇÏ!" + cze "Star-Bý klíèový soubor pro '%-.192s'; opravte ho." + dan "Gammel indeksfil for tabellen '%-.192s'; reparer den" + nla "Oude zoeksleutel file voor tabel '%-.192s'; repareer het!" + eng "Old key file for table '%-.192s'; repair it!" + jps "'%-.192s' ƒe[ƒuƒ‹‚͌¢Œ`Ž®‚Ì key file ‚̂悤‚Å‚·; C•œ‚ð‚µ‚Ä‚­‚¾‚³‚¢", + est "Tabeli '%-.192s' võtmefail on aegunud; paranda see!" + fre "Vieux fichier d'index pour la table '%-.192s'; réparez le!" + ger "Alte Index-Datei für Tabelle '%-.192s'. Bitte reparieren" + greek "Ðáëáéü áñ÷åßï ôáîéíüìéóçò (key file) ãéá ôïí ðßíáêá '%-.192s'; Ðáñáêáëþ, äéïñèþóôå ôï!" + hun "Regi kulcsfile a '%-.192s'tablahoz; probalja kijavitani!" + ita "File chiave vecchio per la tabella '%-.192s'; riparalo!" + jpn "'%-.192s' ¥Æ¡¼¥Ö¥ë¤Ï¸Å¤¤·Á¼°¤Î key file ¤Î¤è¤¦¤Ç¤¹; ½¤Éü¤ò¤·¤Æ¤¯¤À¤µ¤¤" + kor "'%-.192s' Å×À̺íÀÇ ÀÌÀü¹öÁ¯ÀÇ Å° Á¸Àç. ¼öÁ¤ÇϽÿÀ!" + nor "Gammel nøkkelfil for tabellen '%-.192s'; reparer den!" + norwegian-ny "Gammel nykkelfil for tabellen '%-.192s'; reparer den!" + pol "Plik kluczy dla tabeli '%-.192s' jest starego typu; napraw go!" + por "Arquivo de índice desatualizado para tabela '%-.192s'; repare-o!" + rum "Cheia fisierului e veche pentru tabela '%-.192s'; repar-o!" + rus "óÔÁÒÙÊ ÉÎÄÅËÓÎÙÊ ÆÁÊÌ ÄÌÑ ÔÁÂÌÉÃÙ '%-.192s'; ÏÔÒÅÍÏÎÔÉÒÕÊÔÅ ÅÇÏ!" + serbian "Zastareo key file za tabelu '%-.192s'; ispravite ga" + slo "Starý kµúèový súbor pre '%-.192s'; opravte ho!" + spa "Clave de archivo antigua para la tabla '%-.192s'; reparelo!" + swe "Gammal nyckelfil '%-.192s'; reparera registret" + ukr "óÔÁÒÉÊ ÆÁÊÌ ËÌÀÞÅÊ ÄÌÑ ÔÁÂÌÉæ '%-.192s'; ÷¦ÄÎÏ×¦ÔØ ÊÏÇÏ!" ER_OPEN_AS_READONLY - cze "'%-.64s' je jen pro -Bètení" - dan "'%-.64s' er skrivebeskyttet" - nla "'%-.64s' is alleen leesbaar" - eng "Table '%-.64s' is read only" - jps "'%-.64s' ‚͓ǂݞ‚Ýê—p‚Å‚·", - est "Tabel '%-.64s' on ainult lugemiseks" - fre "'%-.64s' est en lecture seulement" - ger "Tabelle '%-.64s' ist nur lesbar" - greek "'%-.64s' åðéôñÝðåôáé ìüíï ç áíÜãíùóç" - hun "'%-.64s' irasvedett" - ita "'%-.64s' e` di sola lettura" - jpn "'%-.64s' ¤ÏÆÉ¤ß¹þ¤ßÀìÍѤǤ¹" - kor "Å×À̺í '%-.64s'´Â ÀбâÀü¿ë ÀÔ´Ï´Ù." - nor "'%-.64s' er skrivebeskyttet" - norwegian-ny "'%-.64s' er skrivetryggja" - pol "'%-.64s' jest tylko do odczytu" - por "Tabela '%-.64s' é somente para leitura" - rum "Tabela '%-.64s' e read-only" - rus "ôÁÂÌÉÃÁ '%-.64s' ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ" - serbian "Tabelu '%-.64s' je dozvoljeno samo èitati" - slo "'%-.64s' is èíta» only" - spa "'%-.64s' es de solo lectura" - swe "'%-.64s' är skyddad mot förändring" - ukr "ôÁÂÌÉÃÑ '%-.64s' Ô¦ÌØËÉ ÄÌÑ ÞÉÔÁÎÎÑ" + cze "'%-.192s' je jen pro -Bètení" + dan "'%-.192s' er skrivebeskyttet" + nla "'%-.192s' is alleen leesbaar" + eng "Table '%-.192s' is read only" + jps "'%-.192s' ‚͓ǂݞ‚Ýê—p‚Å‚·", + est "Tabel '%-.192s' on ainult lugemiseks" + fre "'%-.192s' est en lecture seulement" + ger "Tabelle '%-.192s' ist nur lesbar" + greek "'%-.192s' åðéôñÝðåôáé ìüíï ç áíÜãíùóç" + hun "'%-.192s' irasvedett" + ita "'%-.192s' e` di sola lettura" + jpn "'%-.192s' ¤ÏÆÉ¤ß¹þ¤ßÀìÍѤǤ¹" + kor "Å×À̺í '%-.192s'´Â ÀбâÀü¿ë ÀÔ´Ï´Ù." + nor "'%-.192s' er skrivebeskyttet" + norwegian-ny "'%-.192s' er skrivetryggja" + pol "'%-.192s' jest tylko do odczytu" + por "Tabela '%-.192s' é somente para leitura" + rum "Tabela '%-.192s' e read-only" + rus "ôÁÂÌÉÃÁ '%-.192s' ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ" + serbian "Tabelu '%-.192s' je dozvoljeno samo èitati" + slo "'%-.192s' is èíta» only" + spa "'%-.192s' es de solo lectura" + swe "'%-.192s' är skyddad mot förändring" + ukr "ôÁÂÌÉÃÑ '%-.192s' Ô¦ÌØËÉ ÄÌÑ ÞÉÔÁÎÎÑ" ER_OUTOFMEMORY HY001 S1001 cze "M-Bálo pamìti. Pøestartujte daemona a zkuste znovu (je potøeba %d bytù)" dan "Ikke mere hukommelse. Genstart serveren og prøv igen (mangler %d bytes)" @@ -919,30 +919,30 @@ ER_OUT_OF_SORTMEMORY HY001 S1001 swe "Sorteringsbufferten räcker inte till. Kontrollera startparametrarna" ukr "âÒÁË ÐÁÍ'ÑÔ¦ ÄÌÑ ÓÏÒÔÕ×ÁÎÎÑ. ôÒÅÂÁ ÚÂ¦ÌØÛÉÔÉ ÒÏÚÍ¦Ò ÂÕÆÅÒÁ ÓÏÒÔÕ×ÁÎÎÑ Õ ÓÅÒ×ÅÒÁ" ER_UNEXPECTED_EOF - cze "Neo-Bèekávaný konec souboru pøi ètení '%-.64s' (chybový kód: %d)" - dan "Uventet afslutning på fil (eof) ved læsning af filen '%-.64s' (Fejlkode: %d)" - nla "Onverwachte eof gevonden tijdens het lezen van file '%-.64s' (Errcode: %d)" - eng "Unexpected EOF found when reading file '%-.64s' (errno: %d)" - jps "'%-.64s' ƒtƒ@ƒCƒ‹‚ð“ǂݞ‚Ý’†‚É EOF ‚ª—\Šú‚¹‚ÊŠ‚ÅŒ»‚ê‚Ü‚µ‚½. (errno: %d)", - est "Ootamatu faililõpumärgend faili '%-.64s' lugemisel (veakood: %d)" - fre "Fin de fichier inattendue en lisant '%-.64s' (Errcode: %d)" - ger "Unerwartetes Ende beim Lesen der Datei '%-.64s' (Fehler: %d)" - greek "ÊáôÜ ôç äéÜñêåéá ôçò áíÜãíùóçò, âñÝèçêå áðñïóäüêçôá ôï ôÝëïò ôïõ áñ÷åßïõ '%-.64s' (êùäéêüò ëÜèïõò: %d)" - hun "Varatlan filevege-jel a '%-.64s'olvasasakor. (hibakod: %d)" - ita "Fine del file inaspettata durante la lettura del file '%-.64s' (errno: %d)" - jpn "'%-.64s' ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ßÃæ¤Ë EOF ¤¬Í½´ü¤»¤Ì½ê¤Ç¸½¤ì¤Þ¤·¤¿. (errno: %d)" - kor "'%-.64s' È­ÀÏÀ» Àд µµÁß À߸øµÈ eofÀ» ¹ß°ß (¿¡·¯¹øÈ£: %d)" - nor "Uventet slutt på fil (eof) ved lesing av filen '%-.64s' (Feilkode: %d)" - norwegian-ny "Uventa slutt på fil (eof) ved lesing av fila '%-.64s' (Feilkode: %d)" - pol "Nieoczekiwany 'eof' napotkany podczas czytania z pliku '%-.64s' (Kod b³êdu: %d)" - por "Encontrado fim de arquivo inesperado ao ler arquivo '%-.64s' (erro no. %d)" - rum "Sfirsit de fisier neasteptat in citirea fisierului '%-.64s' (errno: %d)" - rus "îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ '%-.64s' (ÏÛÉÂËÁ: %d)" - serbian "Neoèekivani kraj pri èitanju file-a '%-.64s' (errno: %d)" - slo "Neoèakávaný koniec súboru pri èítaní '%-.64s' (chybový kód: %d)" - spa "Inesperado fin de ficheroU mientras leiamos el archivo '%-.64s' (Error: %d)" - swe "Oväntat filslut vid läsning från '%-.64s' (Felkod: %d)" - ukr "èÉÂÎÉÊ Ë¦ÎÅÃØ ÆÁÊÌÕ '%-.64s' (ÐÏÍÉÌËÁ: %d)" + cze "Neo-Bèekávaný konec souboru pøi ètení '%-.192s' (chybový kód: %d)" + dan "Uventet afslutning på fil (eof) ved læsning af filen '%-.192s' (Fejlkode: %d)" + nla "Onverwachte eof gevonden tijdens het lezen van file '%-.192s' (Errcode: %d)" + eng "Unexpected EOF found when reading file '%-.192s' (errno: %d)" + jps "'%-.192s' ƒtƒ@ƒCƒ‹‚ð“ǂݞ‚Ý’†‚É EOF ‚ª—\Šú‚¹‚ÊŠ‚ÅŒ»‚ê‚Ü‚µ‚½. (errno: %d)", + est "Ootamatu faililõpumärgend faili '%-.192s' lugemisel (veakood: %d)" + fre "Fin de fichier inattendue en lisant '%-.192s' (Errcode: %d)" + ger "Unerwartetes Ende beim Lesen der Datei '%-.192s' (Fehler: %d)" + greek "ÊáôÜ ôç äéÜñêåéá ôçò áíÜãíùóçò, âñÝèçêå áðñïóäüêçôá ôï ôÝëïò ôïõ áñ÷åßïõ '%-.192s' (êùäéêüò ëÜèïõò: %d)" + hun "Varatlan filevege-jel a '%-.192s'olvasasakor. (hibakod: %d)" + ita "Fine del file inaspettata durante la lettura del file '%-.192s' (errno: %d)" + jpn "'%-.192s' ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ßÃæ¤Ë EOF ¤¬Í½´ü¤»¤Ì½ê¤Ç¸½¤ì¤Þ¤·¤¿. (errno: %d)" + kor "'%-.192s' È­ÀÏÀ» Àд µµÁß À߸øµÈ eofÀ» ¹ß°ß (¿¡·¯¹øÈ£: %d)" + nor "Uventet slutt på fil (eof) ved lesing av filen '%-.192s' (Feilkode: %d)" + norwegian-ny "Uventa slutt på fil (eof) ved lesing av fila '%-.192s' (Feilkode: %d)" + pol "Nieoczekiwany 'eof' napotkany podczas czytania z pliku '%-.192s' (Kod b³êdu: %d)" + por "Encontrado fim de arquivo inesperado ao ler arquivo '%-.192s' (erro no. %d)" + rum "Sfirsit de fisier neasteptat in citirea fisierului '%-.192s' (errno: %d)" + rus "îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ '%-.192s' (ÏÛÉÂËÁ: %d)" + serbian "Neoèekivani kraj pri èitanju file-a '%-.192s' (errno: %d)" + slo "Neoèakávaný koniec súboru pri èítaní '%-.192s' (chybový kód: %d)" + spa "Inesperado fin de ficheroU mientras leiamos el archivo '%-.192s' (Error: %d)" + swe "Oväntat filslut vid läsning från '%-.192s' (Felkod: %d)" + ukr "èÉÂÎÉÊ Ë¦ÎÅÃØ ÆÁÊÌÕ '%-.192s' (ÐÏÍÉÌËÁ: %d)" ER_CON_COUNT_ERROR 08004 cze "P-Bøíli¹ mnoho spojení" dan "For mange forbindelser (connections)" @@ -1041,53 +1041,53 @@ ER_HANDSHAKE_ERROR 08S01 swe "Fel vid initiering av kommunikationen med klienten" ukr "îÅצÒÎÁ ÕÓÔÁÎÏ×ËÁ Ú×'ÑÚËÕ" ER_DBACCESS_DENIED_ERROR 42000 - cze "P-Bøístup pro u¾ivatele '%-.32s'@'%-.64s' k databázi '%-.64s' není povolen" - dan "Adgang nægtet bruger: '%-.32s'@'%-.64s' til databasen '%-.64s'" - nla "Toegang geweigerd voor gebruiker: '%-.32s'@'%-.64s' naar database '%-.64s'" - eng "Access denied for user '%-.32s'@'%-.64s' to database '%-.64s'" - jps "ƒ†[ƒU[ '%-.32s'@'%-.64s' ‚Ì '%-.64s' ƒf[ƒ^ƒx[ƒX‚ւ̃AƒNƒZƒX‚ð‹‘”Û‚µ‚Ü‚·", - est "Ligipääs keelatud kasutajale '%-.32s'@'%-.64s' andmebaasile '%-.64s'" - fre "Accès refusé pour l'utilisateur: '%-.32s'@'@%-.64s'. Base '%-.64s'" - ger "Benutzer '%-.32s'@'%-.64s' hat keine Zugriffsberechtigung für Datenbank '%-.64s'" - greek "Äåí åðéôÝñåôáé ç ðñüóâáóç óôï ÷ñÞóôç: '%-.32s'@'%-.64s' óôç âÜóç äåäïìÝíùí '%-.64s'" - hun "A(z) '%-.32s'@'%-.64s' felhasznalo szamara tiltott eleres az '%-.64s' adabazishoz." - ita "Accesso non consentito per l'utente: '%-.32s'@'%-.64s' al database '%-.64s'" - jpn "¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s' ¤Î '%-.64s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤òµñÈݤ·¤Þ¤¹" - kor "'%-.32s'@'%-.64s' »ç¿ëÀÚ´Â '%-.64s' µ¥ÀÌŸº£À̽º¿¡ Á¢±ÙÀÌ °ÅºÎ µÇ¾ú½À´Ï´Ù." - nor "Tilgang nektet for bruker: '%-.32s'@'%-.64s' til databasen '%-.64s' nektet" - norwegian-ny "Tilgang ikkje tillate for brukar: '%-.32s'@'%-.64s' til databasen '%-.64s' nekta" - por "Acesso negado para o usuário '%-.32s'@'%-.64s' ao banco de dados '%-.64s'" - rum "Acces interzis pentru utilizatorul: '%-.32s'@'%-.64s' la baza de date '%-.64s'" - rus "äÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s'@'%-.64s' ÄÏÓÔÕÐ Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.64s' ÚÁËÒÙÔ" - serbian "Pristup je zabranjen korisniku '%-.32s'@'%-.64s' za bazu '%-.64s'" - slo "Zakázaný prístup pre u¾ívateµa: '%-.32s'@'%-.64s' k databázi '%-.64s'" - spa "Acceso negado para usuario: '%-.32s'@'%-.64s' para la base de datos '%-.64s'" - swe "Användare '%-.32s'@'%-.64s' är ej berättigad att använda databasen %-.64s" - ukr "äÏÓÔÕÐ ÚÁÂÏÒÏÎÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ: '%-.32s'@'%-.64s' ÄÏ ÂÁÚÉ ÄÁÎÎÉÈ '%-.64s'" + cze "P-Bøístup pro u¾ivatele '%-.48s'@'%-.64s' k databázi '%-.192s' není povolen" + dan "Adgang nægtet bruger: '%-.48s'@'%-.64s' til databasen '%-.192s'" + nla "Toegang geweigerd voor gebruiker: '%-.48s'@'%-.64s' naar database '%-.192s'" + eng "Access denied for user '%-.48s'@'%-.64s' to database '%-.192s'" + jps "ƒ†[ƒU[ '%-.48s'@'%-.64s' ‚Ì '%-.192s' ƒf[ƒ^ƒx[ƒX‚ւ̃AƒNƒZƒX‚ð‹‘”Û‚µ‚Ü‚·", + est "Ligipääs keelatud kasutajale '%-.48s'@'%-.64s' andmebaasile '%-.192s'" + fre "Accès refusé pour l'utilisateur: '%-.48s'@'@%-.64s'. Base '%-.192s'" + ger "Benutzer '%-.48s'@'%-.64s' hat keine Zugriffsberechtigung für Datenbank '%-.192s'" + greek "Äåí åðéôÝñåôáé ç ðñüóâáóç óôï ÷ñÞóôç: '%-.48s'@'%-.64s' óôç âÜóç äåäïìÝíùí '%-.192s'" + hun "A(z) '%-.48s'@'%-.64s' felhasznalo szamara tiltott eleres az '%-.192s' adabazishoz." + ita "Accesso non consentito per l'utente: '%-.48s'@'%-.64s' al database '%-.192s'" + jpn "¥æ¡¼¥¶¡¼ '%-.48s'@'%-.64s' ¤Î '%-.192s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤òµñÈݤ·¤Þ¤¹" + kor "'%-.48s'@'%-.64s' »ç¿ëÀÚ´Â '%-.192s' µ¥ÀÌŸº£À̽º¿¡ Á¢±ÙÀÌ °ÅºÎ µÇ¾ú½À´Ï´Ù." + nor "Tilgang nektet for bruker: '%-.48s'@'%-.64s' til databasen '%-.192s' nektet" + norwegian-ny "Tilgang ikkje tillate for brukar: '%-.48s'@'%-.64s' til databasen '%-.192s' nekta" + por "Acesso negado para o usuário '%-.48s'@'%-.64s' ao banco de dados '%-.192s'" + rum "Acces interzis pentru utilizatorul: '%-.48s'@'%-.64s' la baza de date '%-.192s'" + rus "äÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.48s'@'%-.64s' ÄÏÓÔÕÐ Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.192s' ÚÁËÒÙÔ" + serbian "Pristup je zabranjen korisniku '%-.48s'@'%-.64s' za bazu '%-.192s'" + slo "Zakázaný prístup pre u¾ívateµa: '%-.48s'@'%-.64s' k databázi '%-.192s'" + spa "Acceso negado para usuario: '%-.48s'@'%-.64s' para la base de datos '%-.192s'" + swe "Användare '%-.48s'@'%-.64s' är ej berättigad att använda databasen %-.192s" + ukr "äÏÓÔÕÐ ÚÁÂÏÒÏÎÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ: '%-.48s'@'%-.64s' ÄÏ ÂÁÚÉ ÄÁÎÎÉÈ '%-.192s'" ER_ACCESS_DENIED_ERROR 28000 - cze "P-Bøístup pro u¾ivatele '%-.32s'@'%-.64s' (s heslem %s)" - dan "Adgang nægtet bruger: '%-.32s'@'%-.64s' (Bruger adgangskode: %s)" - nla "Toegang geweigerd voor gebruiker: '%-.32s'@'%-.64s' (Wachtwoord gebruikt: %s)" - eng "Access denied for user '%-.32s'@'%-.64s' (using password: %s)" - jps "ƒ†[ƒU[ '%-.32s'@'%-.64s' ‚ð‹‘”Û‚µ‚Ü‚·.uUsing password: %s)", - est "Ligipääs keelatud kasutajale '%-.32s'@'%-.64s' (kasutab parooli: %s)" - fre "Accès refusé pour l'utilisateur: '%-.32s'@'@%-.64s' (mot de passe: %s)" - ger "Benutzer '%-.32s'@'%-.64s' hat keine Zugriffsberechtigung (verwendetes Passwort: %s)" - greek "Äåí åðéôÝñåôáé ç ðñüóâáóç óôï ÷ñÞóôç: '%-.32s'@'%-.64s' (÷ñÞóç password: %s)" - hun "A(z) '%-.32s'@'%-.64s' felhasznalo szamara tiltott eleres. (Hasznalja a jelszot: %s)" - ita "Accesso non consentito per l'utente: '%-.32s'@'%-.64s' (Password: %s)" - jpn "¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s' ¤òµñÈݤ·¤Þ¤¹.uUsing password: %s)" - kor "'%-.32s'@'%-.64s' »ç¿ëÀÚ´Â Á¢±ÙÀÌ °ÅºÎ µÇ¾ú½À´Ï´Ù. (using password: %s)" - nor "Tilgang nektet for bruker: '%-.32s'@'%-.64s' (Bruker passord: %s)" - norwegian-ny "Tilgang ikke tillate for brukar: '%-.32s'@'%-.64s' (Brukar passord: %s)" - por "Acesso negado para o usuário '%-.32s'@'%-.64s' (senha usada: %s)" - rum "Acces interzis pentru utilizatorul: '%-.32s'@'%-.64s' (Folosind parola: %s)" - rus "äÏÓÔÕÐ ÚÁËÒÙÔ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s'@'%-.64s' (ÂÙÌ ÉÓÐÏÌØÚÏ×ÁÎ ÐÁÒÏÌØ: %s)" - serbian "Pristup je zabranjen korisniku '%-.32s'@'%-.64s' (koristi lozinku: '%s')" - slo "Zakázaný prístup pre u¾ívateµa: '%-.32s'@'%-.64s' (pou¾itie hesla: %s)" - spa "Acceso negado para usuario: '%-.32s'@'%-.64s' (Usando clave: %s)" - swe "Användare '%-.32s'@'%-.64s' är ej berättigad att logga in (Använder lösen: %s)" - ukr "äÏÓÔÕÐ ÚÁÂÏÒÏÎÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ: '%-.32s'@'%-.64s' (÷ÉËÏÒÉÓÔÁÎÏ ÐÁÒÏÌØ: %s)" + cze "P-Bøístup pro u¾ivatele '%-.48s'@'%-.64s' (s heslem %s)" + dan "Adgang nægtet bruger: '%-.48s'@'%-.64s' (Bruger adgangskode: %s)" + nla "Toegang geweigerd voor gebruiker: '%-.48s'@'%-.64s' (Wachtwoord gebruikt: %s)" + eng "Access denied for user '%-.48s'@'%-.64s' (using password: %s)" + jps "ƒ†[ƒU[ '%-.48s'@'%-.64s' ‚ð‹‘”Û‚µ‚Ü‚·.uUsing password: %s)", + est "Ligipääs keelatud kasutajale '%-.48s'@'%-.64s' (kasutab parooli: %s)" + fre "Accès refusé pour l'utilisateur: '%-.48s'@'@%-.64s' (mot de passe: %s)" + ger "Benutzer '%-.48s'@'%-.64s' hat keine Zugriffsberechtigung (verwendetes Passwort: %s)" + greek "Äåí åðéôÝñåôáé ç ðñüóâáóç óôï ÷ñÞóôç: '%-.48s'@'%-.64s' (÷ñÞóç password: %s)" + hun "A(z) '%-.48s'@'%-.64s' felhasznalo szamara tiltott eleres. (Hasznalja a jelszot: %s)" + ita "Accesso non consentito per l'utente: '%-.48s'@'%-.64s' (Password: %s)" + jpn "¥æ¡¼¥¶¡¼ '%-.48s'@'%-.64s' ¤òµñÈݤ·¤Þ¤¹.uUsing password: %s)" + kor "'%-.48s'@'%-.64s' »ç¿ëÀÚ´Â Á¢±ÙÀÌ °ÅºÎ µÇ¾ú½À´Ï´Ù. (using password: %s)" + nor "Tilgang nektet for bruker: '%-.48s'@'%-.64s' (Bruker passord: %s)" + norwegian-ny "Tilgang ikke tillate for brukar: '%-.48s'@'%-.64s' (Brukar passord: %s)" + por "Acesso negado para o usuário '%-.48s'@'%-.64s' (senha usada: %s)" + rum "Acces interzis pentru utilizatorul: '%-.48s'@'%-.64s' (Folosind parola: %s)" + rus "äÏÓÔÕÐ ÚÁËÒÙÔ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.48s'@'%-.64s' (ÂÙÌ ÉÓÐÏÌØÚÏ×ÁÎ ÐÁÒÏÌØ: %s)" + serbian "Pristup je zabranjen korisniku '%-.48s'@'%-.64s' (koristi lozinku: '%s')" + slo "Zakázaný prístup pre u¾ívateµa: '%-.48s'@'%-.64s' (pou¾itie hesla: %s)" + spa "Acceso negado para usuario: '%-.48s'@'%-.64s' (Usando clave: %s)" + swe "Användare '%-.48s'@'%-.64s' är ej berättigad att logga in (Använder lösen: %s)" + ukr "äÏÓÔÕÐ ÚÁÂÏÒÏÎÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ: '%-.48s'@'%-.64s' (÷ÉËÏÒÉÓÔÁÎÏ ÐÁÒÏÌØ: %s)" ER_NO_DB_ERROR 3D000 cze "Nebyla vybr-Bána ¾ádná databáze" dan "Ingen database valgt" @@ -1139,80 +1139,80 @@ ER_UNKNOWN_COM_ERROR 08S01 swe "Okänt commando" ukr "îÅצÄÏÍÁ ËÏÍÁÎÄÁ" ER_BAD_NULL_ERROR 23000 - cze "Sloupec '%-.64s' nem-Bù¾e být null" - dan "Kolonne '%-.64s' kan ikke være NULL" - nla "Kolom '%-.64s' kan niet null zijn" - eng "Column '%-.64s' cannot be null" - jps "Column '%-.64s' ‚Í null ‚ɂ͂ł«‚È‚¢‚̂ł·", - est "Tulp '%-.64s' ei saa omada nullväärtust" - fre "Le champ '%-.64s' ne peut être vide (null)" - ger "Feld '%-.64s' darf nicht NULL sein" - greek "Ôï ðåäßï '%-.64s' äåí ìðïñåß íá åßíáé êåíü (null)" - hun "A(z) '%-.64s' oszlop erteke nem lehet nulla" - ita "La colonna '%-.64s' non puo` essere nulla" - jpn "Column '%-.64s' ¤Ï null ¤Ë¤Ï¤Ç¤­¤Ê¤¤¤Î¤Ç¤¹" - kor "Ä®·³ '%-.64s'´Â ³Î(Null)ÀÌ µÇ¸é ¾ÈµË´Ï´Ù. " - nor "Kolonne '%-.64s' kan ikke vere null" - norwegian-ny "Kolonne '%-.64s' kan ikkje vere null" - pol "Kolumna '%-.64s' nie mo¿e byæ null" - por "Coluna '%-.64s' não pode ser vazia" - rum "Coloana '%-.64s' nu poate sa fie null" - rus "óÔÏÌÂÅà '%-.64s' ÎÅ ÍÏÖÅÔ ÐÒÉÎÉÍÁÔØ ×ÅÌÉÞÉÎÕ NULL" - serbian "Kolona '%-.64s' ne može biti NULL" - slo "Pole '%-.64s' nemô¾e by» null" - spa "La columna '%-.64s' no puede ser nula" - swe "Kolumn '%-.64s' får inte vara NULL" - ukr "óÔÏ×ÂÅÃØ '%-.64s' ÎÅ ÍÏÖÅ ÂÕÔÉ ÎÕÌØÏ×ÉÍ" + cze "Sloupec '%-.192s' nem-Bù¾e být null" + dan "Kolonne '%-.192s' kan ikke være NULL" + nla "Kolom '%-.192s' kan niet null zijn" + eng "Column '%-.192s' cannot be null" + jps "Column '%-.192s' ‚Í null ‚ɂ͂ł«‚È‚¢‚̂ł·", + est "Tulp '%-.192s' ei saa omada nullväärtust" + fre "Le champ '%-.192s' ne peut être vide (null)" + ger "Feld '%-.192s' darf nicht NULL sein" + greek "Ôï ðåäßï '%-.192s' äåí ìðïñåß íá åßíáé êåíü (null)" + hun "A(z) '%-.192s' oszlop erteke nem lehet nulla" + ita "La colonna '%-.192s' non puo` essere nulla" + jpn "Column '%-.192s' ¤Ï null ¤Ë¤Ï¤Ç¤­¤Ê¤¤¤Î¤Ç¤¹" + kor "Ä®·³ '%-.192s'´Â ³Î(Null)ÀÌ µÇ¸é ¾ÈµË´Ï´Ù. " + nor "Kolonne '%-.192s' kan ikke vere null" + norwegian-ny "Kolonne '%-.192s' kan ikkje vere null" + pol "Kolumna '%-.192s' nie mo¿e byæ null" + por "Coluna '%-.192s' não pode ser vazia" + rum "Coloana '%-.192s' nu poate sa fie null" + rus "óÔÏÌÂÅà '%-.192s' ÎÅ ÍÏÖÅÔ ÐÒÉÎÉÍÁÔØ ×ÅÌÉÞÉÎÕ NULL" + serbian "Kolona '%-.192s' ne može biti NULL" + slo "Pole '%-.192s' nemô¾e by» null" + spa "La columna '%-.192s' no puede ser nula" + swe "Kolumn '%-.192s' får inte vara NULL" + ukr "óÔÏ×ÂÅÃØ '%-.192s' ÎÅ ÍÏÖÅ ÂÕÔÉ ÎÕÌØÏ×ÉÍ" ER_BAD_DB_ERROR 42000 - cze "Nezn-Bámá databáze '%-.64s'" - dan "Ukendt database '%-.64s'" - nla "Onbekende database '%-.64s'" - eng "Unknown database '%-.64s'" - jps "'%-.64s' ‚È‚ñ‚ăf[ƒ^ƒx[ƒX‚Í’m‚è‚Ü‚¹‚ñ.", - est "Tundmatu andmebaas '%-.64s'" - fre "Base '%-.64s' inconnue" - ger "Unbekannte Datenbank '%-.64s'" - greek "Áãíùóôç âÜóç äåäïìÝíùí '%-.64s'" - hun "Ervenytelen adatbazis: '%-.64s'" - ita "Database '%-.64s' sconosciuto" - jpn "'%-.64s' ¤Ê¤ó¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏÃΤê¤Þ¤»¤ó." - kor "µ¥ÀÌŸº£À̽º '%-.64s'´Â ¾Ë¼ö ¾øÀ½" - nor "Ukjent database '%-.64s'" - norwegian-ny "Ukjent database '%-.64s'" - pol "Nieznana baza danych '%-.64s'" - por "Banco de dados '%-.64s' desconhecido" - rum "Baza de data invalida '%-.64s'" - rus "îÅÉÚ×ÅÓÔÎÁÑ ÂÁÚÁ ÄÁÎÎÙÈ '%-.64s'" - serbian "Nepoznata baza '%-.64s'" - slo "Neznáma databáza '%-.64s'" - spa "Base de datos desconocida '%-.64s'" - swe "Okänd databas: '%-.64s'" - ukr "îÅצÄÏÍÁ ÂÁÚÁ ÄÁÎÎÉÈ '%-.64s'" + cze "Nezn-Bámá databáze '%-.192s'" + dan "Ukendt database '%-.192s'" + nla "Onbekende database '%-.192s'" + eng "Unknown database '%-.192s'" + jps "'%-.192s' ‚È‚ñ‚ăf[ƒ^ƒx[ƒX‚Í’m‚è‚Ü‚¹‚ñ.", + est "Tundmatu andmebaas '%-.192s'" + fre "Base '%-.192s' inconnue" + ger "Unbekannte Datenbank '%-.192s'" + greek "Áãíùóôç âÜóç äåäïìÝíùí '%-.192s'" + hun "Ervenytelen adatbazis: '%-.192s'" + ita "Database '%-.192s' sconosciuto" + jpn "'%-.192s' ¤Ê¤ó¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏÃΤê¤Þ¤»¤ó." + kor "µ¥ÀÌŸº£À̽º '%-.192s'´Â ¾Ë¼ö ¾øÀ½" + nor "Ukjent database '%-.192s'" + norwegian-ny "Ukjent database '%-.192s'" + pol "Nieznana baza danych '%-.192s'" + por "Banco de dados '%-.192s' desconhecido" + rum "Baza de data invalida '%-.192s'" + rus "îÅÉÚ×ÅÓÔÎÁÑ ÂÁÚÁ ÄÁÎÎÙÈ '%-.192s'" + serbian "Nepoznata baza '%-.192s'" + slo "Neznáma databáza '%-.192s'" + spa "Base de datos desconocida '%-.192s'" + swe "Okänd databas: '%-.192s'" + ukr "îÅצÄÏÍÁ ÂÁÚÁ ÄÁÎÎÉÈ '%-.192s'" ER_TABLE_EXISTS_ERROR 42S01 - cze "Tabulka '%-.64s' ji-B¾ existuje" - dan "Tabellen '%-.64s' findes allerede" - nla "Tabel '%-.64s' bestaat al" - eng "Table '%-.64s' already exists" - jps "Table '%-.64s' ‚ÍŠù‚É‚ ‚è‚Ü‚·", - est "Tabel '%-.64s' juba eksisteerib" - fre "La table '%-.64s' existe déjà" - ger "Tabelle '%-.64s' bereits vorhanden" - greek "Ï ðßíáêáò '%-.64s' õðÜñ÷åé Þäç" - hun "A(z) '%-.64s' tabla mar letezik" - ita "La tabella '%-.64s' esiste gia`" - jpn "Table '%-.64s' ¤Ï´û¤Ë¤¢¤ê¤Þ¤¹" - kor "Å×À̺í '%-.64s'´Â ÀÌ¹Ì Á¸ÀçÇÔ" - nor "Tabellen '%-.64s' eksisterer allerede" - norwegian-ny "Tabellen '%-.64s' eksisterar allereide" - pol "Tabela '%-.64s' ju¿ istnieje" - por "Tabela '%-.64s' já existe" - rum "Tabela '%-.64s' exista deja" - rus "ôÁÂÌÉÃÁ '%-.64s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ" - serbian "Tabela '%-.64s' veæ postoji" - slo "Tabuµka '%-.64s' u¾ existuje" - spa "La tabla '%-.64s' ya existe" - swe "Tabellen '%-.64s' finns redan" - ukr "ôÁÂÌÉÃÑ '%-.64s' ×ÖÅ ¦ÓÎÕ¤" + cze "Tabulka '%-.192s' ji-B¾ existuje" + dan "Tabellen '%-.192s' findes allerede" + nla "Tabel '%-.192s' bestaat al" + eng "Table '%-.192s' already exists" + jps "Table '%-.192s' ‚ÍŠù‚É‚ ‚è‚Ü‚·", + est "Tabel '%-.192s' juba eksisteerib" + fre "La table '%-.192s' existe déjà" + ger "Tabelle '%-.192s' bereits vorhanden" + greek "Ï ðßíáêáò '%-.192s' õðÜñ÷åé Þäç" + hun "A(z) '%-.192s' tabla mar letezik" + ita "La tabella '%-.192s' esiste gia`" + jpn "Table '%-.192s' ¤Ï´û¤Ë¤¢¤ê¤Þ¤¹" + kor "Å×À̺í '%-.192s'´Â ÀÌ¹Ì Á¸ÀçÇÔ" + nor "Tabellen '%-.192s' eksisterer allerede" + norwegian-ny "Tabellen '%-.192s' eksisterar allereide" + pol "Tabela '%-.192s' ju¿ istnieje" + por "Tabela '%-.192s' já existe" + rum "Tabela '%-.192s' exista deja" + rus "ôÁÂÌÉÃÁ '%-.192s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ" + serbian "Tabela '%-.192s' veæ postoji" + slo "Tabuµka '%-.192s' u¾ existuje" + spa "La tabla '%-.192s' ya existe" + swe "Tabellen '%-.192s' finns redan" + ukr "ôÁÂÌÉÃÑ '%-.192s' ×ÖÅ ¦ÓÎÕ¤" ER_BAD_TABLE_ERROR 42S02 cze "Nezn-Bámá tabulka '%-.100s'" dan "Ukendt tabel '%-.100s'" @@ -1239,29 +1239,29 @@ ER_BAD_TABLE_ERROR 42S02 swe "Okänd tabell '%-.100s'" ukr "îÅצÄÏÍÁ ÔÁÂÌÉÃÑ '%-.100s'" ER_NON_UNIQ_ERROR 23000 - cze "Sloupec '%-.64s' v %-.64s nen-Bí zcela jasný" - dan "Felt: '%-.64s' i tabel %-.64s er ikke entydigt" - nla "Kolom: '%-.64s' in %-.64s is niet eenduidig" - eng "Column '%-.64s' in %-.64s is ambiguous" - est "Väli '%-.64s' %-.64s-s ei ole ühene" - fre "Champ: '%-.64s' dans %-.64s est ambigu" - ger "Feld '%-.64s' in %-.64s ist nicht eindeutig" - greek "Ôï ðåäßï: '%-.64s' óå %-.64s äåí Ý÷åé êáèïñéóôåß" - hun "A(z) '%-.64s' oszlop %-.64s-ben ketertelmu" - ita "Colonna: '%-.64s' di %-.64s e` ambigua" - jpn "Column: '%-.64s' in %-.64s is ambiguous" - kor "Ä®·³: '%-.64s' in '%-.64s' ÀÌ ¸ðÈ£ÇÔ" - nor "Felt: '%-.64s' i tabell %-.64s er ikke entydig" - norwegian-ny "Kolonne: '%-.64s' i tabell %-.64s er ikkje eintydig" - pol "Kolumna: '%-.64s' w %-.64s jest dwuznaczna" - por "Coluna '%-.64s' em '%-.64s' é ambígua" - rum "Coloana: '%-.64s' in %-.64s este ambigua" - rus "óÔÏÌÂÅà '%-.64s' × %-.64s ÚÁÄÁÎ ÎÅÏÄÎÏÚÎÁÞÎÏ" - serbian "Kolona '%-.64s' u %-.64s nije jedinstvena u kontekstu" - slo "Pole: '%-.64s' v %-.64s je nejasné" - spa "La columna: '%-.64s' en %-.64s es ambigua" - swe "Kolumn '%-.64s' i %-.64s är inte unik" - ukr "óÔÏ×ÂÅÃØ '%-.64s' Õ %-.64s ×ÉÚÎÁÞÅÎÉÊ ÎÅÏÄÎÏÚÎÁÞÎÏ" + cze "Sloupec '%-.192s' v %-.192s nen-Bí zcela jasný" + dan "Felt: '%-.192s' i tabel %-.192s er ikke entydigt" + nla "Kolom: '%-.192s' in %-.192s is niet eenduidig" + eng "Column '%-.192s' in %-.192s is ambiguous" + est "Väli '%-.192s' %-.192s-s ei ole ühene" + fre "Champ: '%-.192s' dans %-.192s est ambigu" + ger "Feld '%-.192s' in %-.192s ist nicht eindeutig" + greek "Ôï ðåäßï: '%-.192s' óå %-.192s äåí Ý÷åé êáèïñéóôåß" + hun "A(z) '%-.192s' oszlop %-.192s-ben ketertelmu" + ita "Colonna: '%-.192s' di %-.192s e` ambigua" + jpn "Column: '%-.192s' in %-.192s is ambiguous" + kor "Ä®·³: '%-.192s' in '%-.192s' ÀÌ ¸ðÈ£ÇÔ" + nor "Felt: '%-.192s' i tabell %-.192s er ikke entydig" + norwegian-ny "Kolonne: '%-.192s' i tabell %-.192s er ikkje eintydig" + pol "Kolumna: '%-.192s' w %-.192s jest dwuznaczna" + por "Coluna '%-.192s' em '%-.192s' é ambígua" + rum "Coloana: '%-.192s' in %-.192s este ambigua" + rus "óÔÏÌÂÅà '%-.192s' × %-.192s ÚÁÄÁÎ ÎÅÏÄÎÏÚÎÁÞÎÏ" + serbian "Kolona '%-.192s' u %-.192s nije jedinstvena u kontekstu" + slo "Pole: '%-.192s' v %-.192s je nejasné" + spa "La columna: '%-.192s' en %-.192s es ambigua" + swe "Kolumn '%-.192s' i %-.192s är inte unik" + ukr "óÔÏ×ÂÅÃØ '%-.192s' Õ %-.192s ×ÉÚÎÁÞÅÎÉÊ ÎÅÏÄÎÏÚÎÁÞÎÏ" ER_SERVER_SHUTDOWN 08S01 cze "Prob-Bíhá ukonèování práce serveru" dan "Database nedlukning er i gang" @@ -1288,77 +1288,77 @@ ER_SERVER_SHUTDOWN 08S01 swe "Servern går nu ned" ukr "úÁ×ÅÒÛÕ¤ÔØÓÑ ÒÁÂÏÔÁ ÓÅÒ×ÅÒÁ" ER_BAD_FIELD_ERROR 42S22 S0022 - cze "Nezn-Bámý sloupec '%-.64s' v %-.64s" - dan "Ukendt kolonne '%-.64s' i tabel %-.64s" - nla "Onbekende kolom '%-.64s' in %-.64s" - eng "Unknown column '%-.64s' in '%-.64s'" - jps "'%-.64s' column ‚Í '%-.64s' ‚ɂ͂ ‚è‚Ü‚¹‚ñ.", - est "Tundmatu tulp '%-.64s' '%-.64s'-s" - fre "Champ '%-.64s' inconnu dans %-.64s" - ger "Unbekanntes Tabellenfeld '%-.64s' in %-.64s" - greek "Áãíùóôï ðåäßï '%-.64s' óå '%-.64s'" - hun "A(z) '%-.64s' oszlop ervenytelen '%-.64s'-ben" - ita "Colonna sconosciuta '%-.64s' in '%-.64s'" - jpn "'%-.64s' column ¤Ï '%-.64s' ¤Ë¤Ï¤¢¤ê¤Þ¤»¤ó." - kor "Unknown Ä®·³ '%-.64s' in '%-.64s'" - nor "Ukjent kolonne '%-.64s' i tabell %-.64s" - norwegian-ny "Ukjent felt '%-.64s' i tabell %-.64s" - pol "Nieznana kolumna '%-.64s' w %-.64s" - por "Coluna '%-.64s' desconhecida em '%-.64s'" - rum "Coloana invalida '%-.64s' in '%-.64s'" - rus "îÅÉÚ×ÅÓÔÎÙÊ ÓÔÏÌÂÅà '%-.64s' × '%-.64s'" - serbian "Nepoznata kolona '%-.64s' u '%-.64s'" - slo "Neznáme pole '%-.64s' v '%-.64s'" - spa "La columna '%-.64s' en %-.64s es desconocida" - swe "Okänd kolumn '%-.64s' i %-.64s" - ukr "îÅצÄÏÍÉÊ ÓÔÏ×ÂÅÃØ '%-.64s' Õ '%-.64s'" + cze "Nezn-Bámý sloupec '%-.192s' v %-.192s" + dan "Ukendt kolonne '%-.192s' i tabel %-.192s" + nla "Onbekende kolom '%-.192s' in %-.192s" + eng "Unknown column '%-.192s' in '%-.192s'" + jps "'%-.192s' column ‚Í '%-.192s' ‚ɂ͂ ‚è‚Ü‚¹‚ñ.", + est "Tundmatu tulp '%-.192s' '%-.192s'-s" + fre "Champ '%-.192s' inconnu dans %-.192s" + ger "Unbekanntes Tabellenfeld '%-.192s' in %-.192s" + greek "Áãíùóôï ðåäßï '%-.192s' óå '%-.192s'" + hun "A(z) '%-.192s' oszlop ervenytelen '%-.192s'-ben" + ita "Colonna sconosciuta '%-.192s' in '%-.192s'" + jpn "'%-.192s' column ¤Ï '%-.192s' ¤Ë¤Ï¤¢¤ê¤Þ¤»¤ó." + kor "Unknown Ä®·³ '%-.192s' in '%-.192s'" + nor "Ukjent kolonne '%-.192s' i tabell %-.192s" + norwegian-ny "Ukjent felt '%-.192s' i tabell %-.192s" + pol "Nieznana kolumna '%-.192s' w %-.192s" + por "Coluna '%-.192s' desconhecida em '%-.192s'" + rum "Coloana invalida '%-.192s' in '%-.192s'" + rus "îÅÉÚ×ÅÓÔÎÙÊ ÓÔÏÌÂÅà '%-.192s' × '%-.192s'" + serbian "Nepoznata kolona '%-.192s' u '%-.192s'" + slo "Neznáme pole '%-.192s' v '%-.192s'" + spa "La columna '%-.192s' en %-.192s es desconocida" + swe "Okänd kolumn '%-.192s' i %-.192s" + ukr "îÅצÄÏÍÉÊ ÓÔÏ×ÂÅÃØ '%-.192s' Õ '%-.192s'" ER_WRONG_FIELD_WITH_GROUP 42000 S1009 - cze "Pou-B¾ité '%-.64s' nebylo v group by" - dan "Brugte '%-.64s' som ikke var i group by" - nla "Opdracht gebruikt '%-.64s' dat niet in de GROUP BY voorkomt" - eng "'%-.64s' isn't in GROUP BY" - jps "'%-.64s' isn't in GROUP BY", - est "'%-.64s' puudub GROUP BY klauslis" - fre "'%-.64s' n'est pas dans 'group by'" - ger "'%-.64s' ist nicht in GROUP BY vorhanden" - greek "×ñçóéìïðïéÞèçêå '%-.64s' ðïõ äåí õðÞñ÷å óôï group by" - hun "Used '%-.64s' with wasn't in group by" - ita "Usato '%-.64s' che non e` nel GROUP BY" - kor "'%-.64s'Àº GROUP BY¼Ó¿¡ ¾øÀ½" - nor "Brukte '%-.64s' som ikke var i group by" - norwegian-ny "Brukte '%-.64s' som ikkje var i group by" - pol "U¿yto '%-.64s' bez umieszczenia w group by" - por "'%-.64s' não está em 'GROUP BY'" - rum "'%-.64s' nu exista in clauza GROUP BY" - rus "'%-.64s' ÎÅ ÐÒÉÓÕÔÓÔ×ÕÅÔ × GROUP BY" - serbian "Entitet '%-.64s' nije naveden u komandi 'GROUP BY'" - slo "Pou¾ité '%-.64s' nebolo v 'group by'" - spa "Usado '%-.64s' el cual no esta group by" - swe "'%-.64s' finns inte i GROUP BY" - ukr "'%-.64s' ÎÅ ¤ Õ GROUP BY" + cze "Pou-B¾ité '%-.192s' nebylo v group by" + dan "Brugte '%-.192s' som ikke var i group by" + nla "Opdracht gebruikt '%-.192s' dat niet in de GROUP BY voorkomt" + eng "'%-.192s' isn't in GROUP BY" + jps "'%-.192s' isn't in GROUP BY", + est "'%-.192s' puudub GROUP BY klauslis" + fre "'%-.192s' n'est pas dans 'group by'" + ger "'%-.192s' ist nicht in GROUP BY vorhanden" + greek "×ñçóéìïðïéÞèçêå '%-.192s' ðïõ äåí õðÞñ÷å óôï group by" + hun "Used '%-.192s' with wasn't in group by" + ita "Usato '%-.192s' che non e` nel GROUP BY" + kor "'%-.192s'Àº GROUP BY¼Ó¿¡ ¾øÀ½" + nor "Brukte '%-.192s' som ikke var i group by" + norwegian-ny "Brukte '%-.192s' som ikkje var i group by" + pol "U¿yto '%-.192s' bez umieszczenia w group by" + por "'%-.192s' não está em 'GROUP BY'" + rum "'%-.192s' nu exista in clauza GROUP BY" + rus "'%-.192s' ÎÅ ÐÒÉÓÕÔÓÔ×ÕÅÔ × GROUP BY" + serbian "Entitet '%-.192s' nije naveden u komandi 'GROUP BY'" + slo "Pou¾ité '%-.192s' nebolo v 'group by'" + spa "Usado '%-.192s' el cual no esta group by" + swe "'%-.192s' finns inte i GROUP BY" + ukr "'%-.192s' ÎÅ ¤ Õ GROUP BY" ER_WRONG_GROUP_FIELD 42000 S1009 - cze "Nemohu pou-B¾ít group na '%-.64s'" - dan "Kan ikke gruppere på '%-.64s'" - nla "Kan '%-.64s' niet groeperen" - eng "Can't group on '%-.64s'" - est "Ei saa grupeerida '%-.64s' järgi" - fre "Ne peut regrouper '%-.64s'" - ger "Gruppierung über '%-.64s' nicht möglich" - greek "Áäýíáôç ç ïìáäïðïßçóç (group on) '%-.64s'" - hun "A group nem hasznalhato: '%-.64s'" - ita "Impossibile raggruppare per '%-.64s'" - kor "'%-.64s'¸¦ ±×·ìÇÒ ¼ö ¾øÀ½" - nor "Kan ikke gruppere på '%-.64s'" - norwegian-ny "Kan ikkje gruppere på '%-.64s'" - pol "Nie mo¿na grupowaæ po '%-.64s'" - por "Não pode agrupar em '%-.64s'" - rum "Nu pot sa grupez pe (group on) '%-.64s'" - rus "îÅ×ÏÚÍÏÖÎÏ ÐÒÏÉÚ×ÅÓÔÉ ÇÒÕÐÐÉÒÏ×ËÕ ÐÏ '%-.64s'" - serbian "Ne mogu da grupišem po '%-.64s'" - slo "Nemô¾em pou¾i» 'group' na '%-.64s'" - spa "No puedo agrupar por '%-.64s'" - swe "Kan inte använda GROUP BY med '%-.64s'" - ukr "îÅ ÍÏÖÕ ÇÒÕÐÕ×ÁÔÉ ÐÏ '%-.64s'" + cze "Nemohu pou-B¾ít group na '%-.192s'" + dan "Kan ikke gruppere på '%-.192s'" + nla "Kan '%-.192s' niet groeperen" + eng "Can't group on '%-.192s'" + est "Ei saa grupeerida '%-.192s' järgi" + fre "Ne peut regrouper '%-.192s'" + ger "Gruppierung über '%-.192s' nicht möglich" + greek "Áäýíáôç ç ïìáäïðïßçóç (group on) '%-.192s'" + hun "A group nem hasznalhato: '%-.192s'" + ita "Impossibile raggruppare per '%-.192s'" + kor "'%-.192s'¸¦ ±×·ìÇÒ ¼ö ¾øÀ½" + nor "Kan ikke gruppere på '%-.192s'" + norwegian-ny "Kan ikkje gruppere på '%-.192s'" + pol "Nie mo¿na grupowaæ po '%-.192s'" + por "Não pode agrupar em '%-.192s'" + rum "Nu pot sa grupez pe (group on) '%-.192s'" + rus "îÅ×ÏÚÍÏÖÎÏ ÐÒÏÉÚ×ÅÓÔÉ ÇÒÕÐÐÉÒÏ×ËÕ ÐÏ '%-.192s'" + serbian "Ne mogu da grupišem po '%-.192s'" + slo "Nemô¾em pou¾i» 'group' na '%-.192s'" + spa "No puedo agrupar por '%-.192s'" + swe "Kan inte använda GROUP BY med '%-.192s'" + ukr "îÅ ÍÏÖÕ ÇÒÕÐÕ×ÁÔÉ ÐÏ '%-.192s'" ER_WRONG_SUM_SELECT 42000 S1009 cze "P-Bøíkaz obsahuje zároveò funkci sum a sloupce" dan "Udtrykket har summer (sum) funktioner og kolonner i samme udtryk" @@ -1429,103 +1429,103 @@ ER_TOO_LONG_IDENT 42000 S1009 swe "Kolumnnamn '%-.100s' är för långt" ukr "¶Í'Ñ ¦ÄÅÎÔÉÆ¦ËÁÔÏÒÁ '%-.100s' ÚÁÄÏ×ÇÅ" ER_DUP_FIELDNAME 42S21 S1009 - cze "Zdvojen-Bé jméno sloupce '%-.64s'" - dan "Feltnavnet '%-.64s' findes allerede" - nla "Dubbele kolom naam '%-.64s'" - eng "Duplicate column name '%-.64s'" - jps "'%-.64s' ‚Æ‚¢‚¤ column –¼‚Íd•¡‚µ‚Ă܂·", - est "Kattuv tulba nimi '%-.64s'" - fre "Nom du champ '%-.64s' déjà utilisé" - ger "Doppelter Spaltenname: '%-.64s'" - greek "ÅðáíÜëçøç column name '%-.64s'" - hun "Duplikalt oszlopazonosito: '%-.64s'" - ita "Nome colonna duplicato '%-.64s'" - jpn "'%-.64s' ¤È¤¤¤¦ column ̾¤Ï½ÅÊ£¤·¤Æ¤Þ¤¹" - kor "Áߺ¹µÈ Ä®·³ À̸§: '%-.64s'" - nor "Feltnavnet '%-.64s' eksisterte fra før" - norwegian-ny "Feltnamnet '%-.64s' eksisterte frå før" - pol "Powtórzona nazwa kolumny '%-.64s'" - por "Nome da coluna '%-.64s' duplicado" - rum "Numele coloanei '%-.64s' e duplicat" - rus "äÕÂÌÉÒÕÀÝÅÅÓÑ ÉÍÑ ÓÔÏÌÂÃÁ '%-.64s'" - serbian "Duplirano ime kolone '%-.64s'" - slo "Opakované meno poµa '%-.64s'" - spa "Nombre de columna duplicado '%-.64s'" - swe "Kolumnnamn '%-.64s finns flera gånger" - ukr "äÕÂÌÀÀÞÅ ¦Í'Ñ ÓÔÏ×ÂÃÑ '%-.64s'" + cze "Zdvojen-Bé jméno sloupce '%-.192s'" + dan "Feltnavnet '%-.192s' findes allerede" + nla "Dubbele kolom naam '%-.192s'" + eng "Duplicate column name '%-.192s'" + jps "'%-.192s' ‚Æ‚¢‚¤ column –¼‚Íd•¡‚µ‚Ă܂·", + est "Kattuv tulba nimi '%-.192s'" + fre "Nom du champ '%-.192s' déjà utilisé" + ger "Doppelter Spaltenname: '%-.192s'" + greek "ÅðáíÜëçøç column name '%-.192s'" + hun "Duplikalt oszlopazonosito: '%-.192s'" + ita "Nome colonna duplicato '%-.192s'" + jpn "'%-.192s' ¤È¤¤¤¦ column ̾¤Ï½ÅÊ£¤·¤Æ¤Þ¤¹" + kor "Áߺ¹µÈ Ä®·³ À̸§: '%-.192s'" + nor "Feltnavnet '%-.192s' eksisterte fra før" + norwegian-ny "Feltnamnet '%-.192s' eksisterte frå før" + pol "Powtórzona nazwa kolumny '%-.192s'" + por "Nome da coluna '%-.192s' duplicado" + rum "Numele coloanei '%-.192s' e duplicat" + rus "äÕÂÌÉÒÕÀÝÅÅÓÑ ÉÍÑ ÓÔÏÌÂÃÁ '%-.192s'" + serbian "Duplirano ime kolone '%-.192s'" + slo "Opakované meno poµa '%-.192s'" + spa "Nombre de columna duplicado '%-.192s'" + swe "Kolumnnamn '%-.192s finns flera gånger" + ukr "äÕÂÌÀÀÞÅ ¦Í'Ñ ÓÔÏ×ÂÃÑ '%-.192s'" ER_DUP_KEYNAME 42000 S1009 - cze "Zdvojen-Bé jméno klíèe '%-.64s'" - dan "Indeksnavnet '%-.64s' findes allerede" - nla "Dubbele zoeksleutel naam '%-.64s'" - eng "Duplicate key name '%-.64s'" - jps "'%-.64s' ‚Æ‚¢‚¤ key ‚Ì–¼‘O‚Íd•¡‚µ‚Ä‚¢‚Ü‚·", - est "Kattuv võtme nimi '%-.64s'" - fre "Nom de clef '%-.64s' déjà utilisé" - ger "Doppelter Name für Schlüssel vorhanden: '%-.64s'" - greek "ÅðáíÜëçøç key name '%-.64s'" - hun "Duplikalt kulcsazonosito: '%-.64s'" - ita "Nome chiave duplicato '%-.64s'" - jpn "'%-.64s' ¤È¤¤¤¦ key ¤Î̾Á°¤Ï½ÅÊ£¤·¤Æ¤¤¤Þ¤¹" - kor "Áߺ¹µÈ Ű À̸§ : '%-.64s'" - nor "Nøkkelnavnet '%-.64s' eksisterte fra før" - norwegian-ny "Nøkkelnamnet '%-.64s' eksisterte frå før" - pol "Powtórzony nazwa klucza '%-.64s'" - por "Nome da chave '%-.64s' duplicado" - rum "Numele cheiei '%-.64s' e duplicat" - rus "äÕÂÌÉÒÕÀÝÅÅÓÑ ÉÍÑ ËÌÀÞÁ '%-.64s'" - serbian "Duplirano ime kljuèa '%-.64s'" - slo "Opakované meno kµúèa '%-.64s'" - spa "Nombre de clave duplicado '%-.64s'" - swe "Nyckelnamn '%-.64s' finns flera gånger" - ukr "äÕÂÌÀÀÞÅ ¦Í'Ñ ËÌÀÞÁ '%-.64s'" + cze "Zdvojen-Bé jméno klíèe '%-.192s'" + dan "Indeksnavnet '%-.192s' findes allerede" + nla "Dubbele zoeksleutel naam '%-.192s'" + eng "Duplicate key name '%-.192s'" + jps "'%-.192s' ‚Æ‚¢‚¤ key ‚Ì–¼‘O‚Íd•¡‚µ‚Ä‚¢‚Ü‚·", + est "Kattuv võtme nimi '%-.192s'" + fre "Nom de clef '%-.192s' déjà utilisé" + ger "Doppelter Name für Schlüssel vorhanden: '%-.192s'" + greek "ÅðáíÜëçøç key name '%-.192s'" + hun "Duplikalt kulcsazonosito: '%-.192s'" + ita "Nome chiave duplicato '%-.192s'" + jpn "'%-.192s' ¤È¤¤¤¦ key ¤Î̾Á°¤Ï½ÅÊ£¤·¤Æ¤¤¤Þ¤¹" + kor "Áߺ¹µÈ Ű À̸§ : '%-.192s'" + nor "Nøkkelnavnet '%-.192s' eksisterte fra før" + norwegian-ny "Nøkkelnamnet '%-.192s' eksisterte frå før" + pol "Powtórzony nazwa klucza '%-.192s'" + por "Nome da chave '%-.192s' duplicado" + rum "Numele cheiei '%-.192s' e duplicat" + rus "äÕÂÌÉÒÕÀÝÅÅÓÑ ÉÍÑ ËÌÀÞÁ '%-.192s'" + serbian "Duplirano ime kljuèa '%-.192s'" + slo "Opakované meno kµúèa '%-.192s'" + spa "Nombre de clave duplicado '%-.192s'" + swe "Nyckelnamn '%-.192s' finns flera gånger" + ukr "äÕÂÌÀÀÞÅ ¦Í'Ñ ËÌÀÞÁ '%-.192s'" ER_DUP_ENTRY 23000 S1009 - cze "Zdvojen-Bý klíè '%-.64s' (èíslo klíèe %d)" - dan "Ens værdier '%-.64s' for indeks %d" - nla "Dubbele ingang '%-.64s' voor zoeksleutel %d" - eng "Duplicate entry '%-.64s' for key %d" - jps "'%-.64s' ‚Í key %d ‚É‚¨‚¢‚Äd•¡‚µ‚Ä‚¢‚Ü‚·", - est "Kattuv väärtus '%-.64s' võtmele %d" - fre "Duplicata du champ '%-.64s' pour la clef %d" - ger "Doppelter Eintrag '%-.64s' für Schlüssel %d" - greek "ÄéðëÞ åããñáöÞ '%-.64s' ãéá ôï êëåéäß %d" - hun "Duplikalt bejegyzes '%-.64s' a %d kulcs szerint." - ita "Valore duplicato '%-.64s' per la chiave %d" - jpn "'%-.64s' ¤Ï key %d ¤Ë¤ª¤¤¤Æ½ÅÊ£¤·¤Æ¤¤¤Þ¤¹" - kor "Áߺ¹µÈ ÀÔ·Â °ª '%-.64s': key %d" - nor "Like verdier '%-.64s' for nøkkel %d" - norwegian-ny "Like verdiar '%-.64s' for nykkel %d" - pol "Powtórzone wyst?pienie '%-.64s' dla klucza %d" - por "Entrada '%-.64s' duplicada para a chave %d" - rum "Cimpul '%-.64s' e duplicat pentru cheia %d" - rus "äÕÂÌÉÒÕÀÝÁÑÓÑ ÚÁÐÉÓØ '%-.64s' ÐÏ ËÌÀÞÕ %d" - serbian "Dupliran unos '%-.64s' za kljuè '%d'" - slo "Opakovaný kµúè '%-.64s' (èíslo kµúèa %d)" - spa "Entrada duplicada '%-.64s' para la clave %d" - swe "Dubbel nyckel '%-.64s' för nyckel %d" - ukr "äÕÂÌÀÀÞÉÊ ÚÁÐÉÓ '%-.64s' ÄÌÑ ËÌÀÞÁ %d" + cze "Zdvojen-Bý klíè '%-.192s' (èíslo klíèe %d)" + dan "Ens værdier '%-.192s' for indeks %d" + nla "Dubbele ingang '%-.192s' voor zoeksleutel %d" + eng "Duplicate entry '%-.192s' for key %d" + jps "'%-.192s' ‚Í key %d ‚É‚¨‚¢‚Äd•¡‚µ‚Ä‚¢‚Ü‚·", + est "Kattuv väärtus '%-.192s' võtmele %d" + fre "Duplicata du champ '%-.192s' pour la clef %d" + ger "Doppelter Eintrag '%-.192s' für Schlüssel %d" + greek "ÄéðëÞ åããñáöÞ '%-.192s' ãéá ôï êëåéäß %d" + hun "Duplikalt bejegyzes '%-.192s' a %d kulcs szerint." + ita "Valore duplicato '%-.192s' per la chiave %d" + jpn "'%-.192s' ¤Ï key %d ¤Ë¤ª¤¤¤Æ½ÅÊ£¤·¤Æ¤¤¤Þ¤¹" + kor "Áߺ¹µÈ ÀÔ·Â °ª '%-.192s': key %d" + nor "Like verdier '%-.192s' for nøkkel %d" + norwegian-ny "Like verdiar '%-.192s' for nykkel %d" + pol "Powtórzone wyst?pienie '%-.192s' dla klucza %d" + por "Entrada '%-.192s' duplicada para a chave %d" + rum "Cimpul '%-.192s' e duplicat pentru cheia %d" + rus "äÕÂÌÉÒÕÀÝÁÑÓÑ ÚÁÐÉÓØ '%-.192s' ÐÏ ËÌÀÞÕ %d" + serbian "Dupliran unos '%-.192s' za kljuè '%d'" + slo "Opakovaný kµúè '%-.192s' (èíslo kµúèa %d)" + spa "Entrada duplicada '%-.192s' para la clave %d" + swe "Dubbel nyckel '%-.192s' för nyckel %d" + ukr "äÕÂÌÀÀÞÉÊ ÚÁÐÉÓ '%-.192s' ÄÌÑ ËÌÀÞÁ %d" ER_WRONG_FIELD_SPEC 42000 S1009 - cze "Chybn-Bá specifikace sloupce '%-.64s'" - dan "Forkert kolonnespecifikaton for felt '%-.64s'" - nla "Verkeerde kolom specificatie voor kolom '%-.64s'" - eng "Incorrect column specifier for column '%-.64s'" - est "Vigane tulba kirjeldus tulbale '%-.64s'" - fre "Mauvais paramètre de champ pour le champ '%-.64s'" - ger "Falsche Spezifikation für Feld '%-.64s'" - greek "ÅóöáëìÝíï column specifier ãéá ôï ðåäßï '%-.64s'" - hun "Rossz oszlopazonosito: '%-.64s'" - ita "Specifica errata per la colonna '%-.64s'" - kor "Ä®·³ '%-.64s'ÀÇ ºÎÁ¤È®ÇÑ Ä®·³ Á¤ÀÇÀÚ" - nor "Feil kolonne spesifikator for felt '%-.64s'" - norwegian-ny "Feil kolonne spesifikator for kolonne '%-.64s'" - pol "B³êdna specyfikacja kolumny dla kolumny '%-.64s'" - por "Especificador de coluna incorreto para a coluna '%-.64s'" - rum "Specificandul coloanei '%-.64s' este incorect" - rus "îÅËÏÒÒÅËÔÎÙÊ ÏÐÒÅÄÅÌÉÔÅÌØ ÓÔÏÌÂÃÁ ÄÌÑ ÓÔÏÌÂÃÁ '%-.64s'" - serbian "Pogrešan naziv kolone za kolonu '%-.64s'" - slo "Chyba v ¹pecifikácii poµa '%-.64s'" - spa "Especificador de columna erroneo para la columna '%-.64s'" - swe "Felaktigt kolumntyp för kolumn '%-.64s'" - ukr "îÅצÒÎÉÊ ÓÐÅÃÉÆ¦ËÁÔÏÒ ÓÔÏ×ÂÃÑ '%-.64s'" + cze "Chybn-Bá specifikace sloupce '%-.192s'" + dan "Forkert kolonnespecifikaton for felt '%-.192s'" + nla "Verkeerde kolom specificatie voor kolom '%-.192s'" + eng "Incorrect column specifier for column '%-.192s'" + est "Vigane tulba kirjeldus tulbale '%-.192s'" + fre "Mauvais paramètre de champ pour le champ '%-.192s'" + ger "Falsche Spezifikation für Feld '%-.192s'" + greek "ÅóöáëìÝíï column specifier ãéá ôï ðåäßï '%-.192s'" + hun "Rossz oszlopazonosito: '%-.192s'" + ita "Specifica errata per la colonna '%-.192s'" + kor "Ä®·³ '%-.192s'ÀÇ ºÎÁ¤È®ÇÑ Ä®·³ Á¤ÀÇÀÚ" + nor "Feil kolonne spesifikator for felt '%-.192s'" + norwegian-ny "Feil kolonne spesifikator for kolonne '%-.192s'" + pol "B³êdna specyfikacja kolumny dla kolumny '%-.192s'" + por "Especificador de coluna incorreto para a coluna '%-.192s'" + rum "Specificandul coloanei '%-.192s' este incorect" + rus "îÅËÏÒÒÅËÔÎÙÊ ÏÐÒÅÄÅÌÉÔÅÌØ ÓÔÏÌÂÃÁ ÄÌÑ ÓÔÏÌÂÃÁ '%-.192s'" + serbian "Pogrešan naziv kolone za kolonu '%-.192s'" + slo "Chyba v ¹pecifikácii poµa '%-.192s'" + spa "Especificador de columna erroneo para la columna '%-.192s'" + swe "Felaktigt kolumntyp för kolumn '%-.192s'" + ukr "îÅצÒÎÉÊ ÓÐÅÃÉÆ¦ËÁÔÏÒ ÓÔÏ×ÂÃÑ '%-.192s'" ER_PARSE_ERROR 42000 s1009 cze "%s bl-Bízko '%-.80s' na øádku %d" dan "%s nær '%-.80s' på linje %d" @@ -1577,53 +1577,53 @@ ER_EMPTY_QUERY 42000 swe "Frågan var tom" ukr "ðÕÓÔÉÊ ÚÁÐÉÔ" ER_NONUNIQ_TABLE 42000 S1009 - cze "Nejednozna-Bèná tabulka/alias: '%-.64s'" - dan "Tabellen/aliaset: '%-.64s' er ikke unikt" - nla "Niet unieke waarde tabel/alias: '%-.64s'" - eng "Not unique table/alias: '%-.64s'" - jps "'%-.64s' ‚͈êˆÓ‚Ì table/alias –¼‚ł͂ ‚è‚Ü‚¹‚ñ", - est "Ei ole unikaalne tabel/alias '%-.64s'" - fre "Table/alias: '%-.64s' non unique" - ger "Tabellenname/Alias '%-.64s' nicht eindeutig" - greek "Áäýíáôç ç áíåýñåóç unique table/alias: '%-.64s'" - hun "Nem egyedi tabla/alias: '%-.64s'" - ita "Tabella/alias non unico: '%-.64s'" - jpn "'%-.64s' ¤Ï°ì°Õ¤Î table/alias ̾¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" - kor "Unique ÇÏÁö ¾ÊÀº Å×À̺í/alias: '%-.64s'" - nor "Ikke unikt tabell/alias: '%-.64s'" - norwegian-ny "Ikkje unikt tabell/alias: '%-.64s'" - pol "Tabela/alias nie s? unikalne: '%-.64s'" - por "Tabela/alias '%-.64s' não única" - rum "Tabela/alias: '%-.64s' nu este unic" - rus "ðÏ×ÔÏÒÑÀÝÁÑÓÑ ÔÁÂÌÉÃÁ/ÐÓÅ×ÄÏÎÉÍ '%-.64s'" - serbian "Tabela ili alias nisu bili jedinstveni: '%-.64s'" - slo "Nie jednoznaèná tabuµka/alias: '%-.64s'" - spa "Tabla/alias: '%-.64s' es no unica" - swe "Icke unikt tabell/alias: '%-.64s'" - ukr "îÅÕΦËÁÌØÎÁ ÔÁÂÌÉÃÑ/ÐÓÅ×ÄÏΦÍ: '%-.64s'" + cze "Nejednozna-Bèná tabulka/alias: '%-.192s'" + dan "Tabellen/aliaset: '%-.192s' er ikke unikt" + nla "Niet unieke waarde tabel/alias: '%-.192s'" + eng "Not unique table/alias: '%-.192s'" + jps "'%-.192s' ‚͈êˆÓ‚Ì table/alias –¼‚ł͂ ‚è‚Ü‚¹‚ñ", + est "Ei ole unikaalne tabel/alias '%-.192s'" + fre "Table/alias: '%-.192s' non unique" + ger "Tabellenname/Alias '%-.192s' nicht eindeutig" + greek "Áäýíáôç ç áíåýñåóç unique table/alias: '%-.192s'" + hun "Nem egyedi tabla/alias: '%-.192s'" + ita "Tabella/alias non unico: '%-.192s'" + jpn "'%-.192s' ¤Ï°ì°Õ¤Î table/alias ̾¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + kor "Unique ÇÏÁö ¾ÊÀº Å×À̺í/alias: '%-.192s'" + nor "Ikke unikt tabell/alias: '%-.192s'" + norwegian-ny "Ikkje unikt tabell/alias: '%-.192s'" + pol "Tabela/alias nie s? unikalne: '%-.192s'" + por "Tabela/alias '%-.192s' não única" + rum "Tabela/alias: '%-.192s' nu este unic" + rus "ðÏ×ÔÏÒÑÀÝÁÑÓÑ ÔÁÂÌÉÃÁ/ÐÓÅ×ÄÏÎÉÍ '%-.192s'" + serbian "Tabela ili alias nisu bili jedinstveni: '%-.192s'" + slo "Nie jednoznaèná tabuµka/alias: '%-.192s'" + spa "Tabla/alias: '%-.192s' es no unica" + swe "Icke unikt tabell/alias: '%-.192s'" + ukr "îÅÕΦËÁÌØÎÁ ÔÁÂÌÉÃÑ/ÐÓÅ×ÄÏΦÍ: '%-.192s'" ER_INVALID_DEFAULT 42000 S1009 - cze "Chybn-Bá defaultní hodnota pro '%-.64s'" - dan "Ugyldig standardværdi for '%-.64s'" - nla "Foutieve standaard waarde voor '%-.64s'" - eng "Invalid default value for '%-.64s'" - est "Vigane vaikeväärtus '%-.64s' jaoks" - fre "Valeur par défaut invalide pour '%-.64s'" - ger "Fehlerhafter Vorgabewert (DEFAULT) für '%-.64s'" - greek "ÅóöáëìÝíç ðñïêáèïñéóìÝíç ôéìÞ (default value) ãéá '%-.64s'" - hun "Ervenytelen ertek: '%-.64s'" - ita "Valore di default non valido per '%-.64s'" - kor "'%-.64s'ÀÇ À¯È¿ÇÏÁö ¸øÇÑ µðÆúÆ® °ªÀ» »ç¿ëÇϼ̽À´Ï´Ù." - nor "Ugyldig standardverdi for '%-.64s'" - norwegian-ny "Ugyldig standardverdi for '%-.64s'" - pol "Niew³a?ciwa warto?æ domy?lna dla '%-.64s'" - por "Valor padrão (default) inválido para '%-.64s'" - rum "Valoarea de default este invalida pentru '%-.64s'" - rus "îÅËÏÒÒÅËÔÎÏÅ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ '%-.64s'" - serbian "Loša default vrednost za '%-.64s'" - slo "Chybná implicitná hodnota pre '%-.64s'" - spa "Valor por defecto invalido para '%-.64s'" - swe "Ogiltigt DEFAULT värde för '%-.64s'" - ukr "îÅצÒÎÅ ÚÎÁÞÅÎÎÑ ÐÏ ÚÁÍÏ×ÞÕ×ÁÎÎÀ ÄÌÑ '%-.64s'" + cze "Chybn-Bá defaultní hodnota pro '%-.192s'" + dan "Ugyldig standardværdi for '%-.192s'" + nla "Foutieve standaard waarde voor '%-.192s'" + eng "Invalid default value for '%-.192s'" + est "Vigane vaikeväärtus '%-.192s' jaoks" + fre "Valeur par défaut invalide pour '%-.192s'" + ger "Fehlerhafter Vorgabewert (DEFAULT) für '%-.192s'" + greek "ÅóöáëìÝíç ðñïêáèïñéóìÝíç ôéìÞ (default value) ãéá '%-.192s'" + hun "Ervenytelen ertek: '%-.192s'" + ita "Valore di default non valido per '%-.192s'" + kor "'%-.192s'ÀÇ À¯È¿ÇÏÁö ¸øÇÑ µðÆúÆ® °ªÀ» »ç¿ëÇϼ̽À´Ï´Ù." + nor "Ugyldig standardverdi for '%-.192s'" + norwegian-ny "Ugyldig standardverdi for '%-.192s'" + pol "Niew³a?ciwa warto?æ domy?lna dla '%-.192s'" + por "Valor padrão (default) inválido para '%-.192s'" + rum "Valoarea de default este invalida pentru '%-.192s'" + rus "îÅËÏÒÒÅËÔÎÏÅ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ '%-.192s'" + serbian "Loša default vrednost za '%-.192s'" + slo "Chybná implicitná hodnota pre '%-.192s'" + spa "Valor por defecto invalido para '%-.192s'" + swe "Ogiltigt DEFAULT värde för '%-.192s'" + ukr "îÅצÒÎÅ ÚÎÁÞÅÎÎÑ ÐÏ ÚÁÍÏ×ÞÕ×ÁÎÎÀ ÄÌÑ '%-.192s'" ER_MULTIPLE_PRI_KEY 42000 S1009 cze "Definov-Báno více primárních klíèù" dan "Flere primærnøgler specificeret" @@ -1723,78 +1723,78 @@ ER_TOO_LONG_KEY 42000 S1009 swe "För lång nyckel. Högsta tillåtna nyckellängd är %d" ukr "úÁÚÎÁÞÅÎÉÊ ËÌÀÞ ÚÁÄÏ×ÇÉÊ. îÁÊÂ¦ÌØÛÁ ÄÏ×ÖÉÎÁ ËÌÀÞÁ %d ÂÁÊÔ¦×" ER_KEY_COLUMN_DOES_NOT_EXITS 42000 S1009 - cze "Kl-Bíèový sloupec '%-.64s' v tabulce neexistuje" - dan "Nøglefeltet '%-.64s' eksisterer ikke i tabellen" - nla "Zoeksleutel kolom '%-.64s' bestaat niet in tabel" - eng "Key column '%-.64s' doesn't exist in table" - jps "Key column '%-.64s' ‚ªƒe[ƒuƒ‹‚É‚ ‚è‚Ü‚¹‚ñ.", - est "Võtme tulp '%-.64s' puudub tabelis" - fre "La clé '%-.64s' n'existe pas dans la table" - ger "In der Tabelle gibt es kein Schlüsselfeld '%-.64s'" - greek "Ôï ðåäßï êëåéäß '%-.64s' äåí õðÜñ÷åé óôïí ðßíáêá" - hun "A(z) '%-.64s'kulcsoszlop nem letezik a tablaban" - ita "La colonna chiave '%-.64s' non esiste nella tabella" - jpn "Key column '%-.64s' ¤¬¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ê¤Þ¤»¤ó." - kor "Key Ä®·³ '%-.64s'´Â Å×ÀÌºí¿¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù." - nor "Nøkkel felt '%-.64s' eksiterer ikke i tabellen" - norwegian-ny "Nykkel kolonne '%-.64s' eksiterar ikkje i tabellen" - pol "Kolumna '%-.64s' zdefiniowana w kluczu nie istnieje w tabeli" - por "Coluna chave '%-.64s' não existe na tabela" - rum "Coloana cheie '%-.64s' nu exista in tabela" - rus "ëÌÀÞÅ×ÏÊ ÓÔÏÌÂÅà '%-.64s' × ÔÁÂÌÉÃÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ" - serbian "Kljuèna kolona '%-.64s' ne postoji u tabeli" - slo "Kµúèový ståpec '%-.64s' v tabuµke neexistuje" - spa "La columna clave '%-.64s' no existe en la tabla" - swe "Nyckelkolumn '%-.64s' finns inte" - ukr "ëÌÀÞÏ×ÉÊ ÓÔÏ×ÂÅÃØ '%-.64s' ÎÅ ¦ÓÎÕ¤ Õ ÔÁÂÌÉæ" + cze "Kl-Bíèový sloupec '%-.192s' v tabulce neexistuje" + dan "Nøglefeltet '%-.192s' eksisterer ikke i tabellen" + nla "Zoeksleutel kolom '%-.192s' bestaat niet in tabel" + eng "Key column '%-.192s' doesn't exist in table" + jps "Key column '%-.192s' ‚ªƒe[ƒuƒ‹‚É‚ ‚è‚Ü‚¹‚ñ.", + est "Võtme tulp '%-.192s' puudub tabelis" + fre "La clé '%-.192s' n'existe pas dans la table" + ger "In der Tabelle gibt es kein Schlüsselfeld '%-.192s'" + greek "Ôï ðåäßï êëåéäß '%-.192s' äåí õðÜñ÷åé óôïí ðßíáêá" + hun "A(z) '%-.192s'kulcsoszlop nem letezik a tablaban" + ita "La colonna chiave '%-.192s' non esiste nella tabella" + jpn "Key column '%-.192s' ¤¬¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ê¤Þ¤»¤ó." + kor "Key Ä®·³ '%-.192s'´Â Å×ÀÌºí¿¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù." + nor "Nøkkel felt '%-.192s' eksiterer ikke i tabellen" + norwegian-ny "Nykkel kolonne '%-.192s' eksiterar ikkje i tabellen" + pol "Kolumna '%-.192s' zdefiniowana w kluczu nie istnieje w tabeli" + por "Coluna chave '%-.192s' não existe na tabela" + rum "Coloana cheie '%-.192s' nu exista in tabela" + rus "ëÌÀÞÅ×ÏÊ ÓÔÏÌÂÅà '%-.192s' × ÔÁÂÌÉÃÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ" + serbian "Kljuèna kolona '%-.192s' ne postoji u tabeli" + slo "Kµúèový ståpec '%-.192s' v tabuµke neexistuje" + spa "La columna clave '%-.192s' no existe en la tabla" + swe "Nyckelkolumn '%-.192s' finns inte" + ukr "ëÌÀÞÏ×ÉÊ ÓÔÏ×ÂÅÃØ '%-.192s' ÎÅ ¦ÓÎÕ¤ Õ ÔÁÂÌÉæ" ER_BLOB_USED_AS_KEY 42000 S1009 - cze "Blob sloupec '%-.64s' nem-Bù¾e být pou¾it jako klíè" - dan "BLOB feltet '%-.64s' kan ikke bruges ved specifikation af indeks" - nla "BLOB kolom '%-.64s' kan niet gebruikt worden bij zoeksleutel specificatie" - eng "BLOB column '%-.64s' can't be used in key specification with the used table type" - est "BLOB-tüüpi tulpa '%-.64s' ei saa kasutada võtmena" - fre "Champ BLOB '%-.64s' ne peut être utilisé dans une clé" - ger "BLOB-Feld '%-.64s' kann beim verwendeten Tabellentyp nicht als Schlüssel verwendet werden" - greek "Ðåäßï ôýðïõ Blob '%-.64s' äåí ìðïñåß íá ÷ñçóéìïðïéçèåß óôïí ïñéóìü åíüò êëåéäéïý (key specification)" - hun "Blob objektum '%-.64s' nem hasznalhato kulcskent" - ita "La colonna BLOB '%-.64s' non puo` essere usata nella specifica della chiave" - kor "BLOB Ä®·³ '%-.64s'´Â Ű Á¤ÀÇ¿¡¼­ »ç¿ëµÉ ¼ö ¾ø½À´Ï´Ù." - nor "Blob felt '%-.64s' kan ikke brukes ved spesifikasjon av nøkler" - norwegian-ny "Blob kolonne '%-.64s' kan ikkje brukast ved spesifikasjon av nyklar" - pol "Kolumna typu Blob '%-.64s' nie mo¿e byæ u¿yta w specyfikacji klucza" - por "Coluna BLOB '%-.64s' não pode ser utilizada na especificação de chave para o tipo de tabela usado" - rum "Coloana de tip BLOB '%-.64s' nu poate fi folosita in specificarea cheii cu tipul de tabla folosit" - rus "óÔÏÌÂÅà ÔÉÐÁ BLOB '%-.64s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÓÐÏÌØÚÏ×ÁÎ ËÁË ÚÎÁÞÅÎÉÅ ËÌÀÞÁ × ÔÁÂÌÉÃÅ ÔÁËÏÇÏ ÔÉÐÁ" - serbian "BLOB kolona '%-.64s' ne može biti upotrebljena za navoðenje kljuèa sa tipom tabele koji se trenutno koristi" - slo "Blob pole '%-.64s' nemô¾e by» pou¾ité ako kµúè" - spa "La columna Blob '%-.64s' no puede ser usada en una declaracion de clave" - swe "En BLOB '%-.64s' kan inte vara nyckel med den använda tabelltypen" - ukr "BLOB ÓÔÏ×ÂÅÃØ '%-.64s' ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÉÊ Õ ×ÉÚÎÁÞÅÎΦ ËÌÀÞÁ × ÃØÏÍÕ ÔÉЦ ÔÁÂÌÉæ" + cze "Blob sloupec '%-.192s' nem-Bù¾e být pou¾it jako klíè" + dan "BLOB feltet '%-.192s' kan ikke bruges ved specifikation af indeks" + nla "BLOB kolom '%-.192s' kan niet gebruikt worden bij zoeksleutel specificatie" + eng "BLOB column '%-.192s' can't be used in key specification with the used table type" + est "BLOB-tüüpi tulpa '%-.192s' ei saa kasutada võtmena" + fre "Champ BLOB '%-.192s' ne peut être utilisé dans une clé" + ger "BLOB-Feld '%-.192s' kann beim verwendeten Tabellentyp nicht als Schlüssel verwendet werden" + greek "Ðåäßï ôýðïõ Blob '%-.192s' äåí ìðïñåß íá ÷ñçóéìïðïéçèåß óôïí ïñéóìü åíüò êëåéäéïý (key specification)" + hun "Blob objektum '%-.192s' nem hasznalhato kulcskent" + ita "La colonna BLOB '%-.192s' non puo` essere usata nella specifica della chiave" + kor "BLOB Ä®·³ '%-.192s'´Â Ű Á¤ÀÇ¿¡¼­ »ç¿ëµÉ ¼ö ¾ø½À´Ï´Ù." + nor "Blob felt '%-.192s' kan ikke brukes ved spesifikasjon av nøkler" + norwegian-ny "Blob kolonne '%-.192s' kan ikkje brukast ved spesifikasjon av nyklar" + pol "Kolumna typu Blob '%-.192s' nie mo¿e byæ u¿yta w specyfikacji klucza" + por "Coluna BLOB '%-.192s' não pode ser utilizada na especificação de chave para o tipo de tabela usado" + rum "Coloana de tip BLOB '%-.192s' nu poate fi folosita in specificarea cheii cu tipul de tabla folosit" + rus "óÔÏÌÂÅà ÔÉÐÁ BLOB '%-.192s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÓÐÏÌØÚÏ×ÁÎ ËÁË ÚÎÁÞÅÎÉÅ ËÌÀÞÁ × ÔÁÂÌÉÃÅ ÔÁËÏÇÏ ÔÉÐÁ" + serbian "BLOB kolona '%-.192s' ne može biti upotrebljena za navoðenje kljuèa sa tipom tabele koji se trenutno koristi" + slo "Blob pole '%-.192s' nemô¾e by» pou¾ité ako kµúè" + spa "La columna Blob '%-.192s' no puede ser usada en una declaracion de clave" + swe "En BLOB '%-.192s' kan inte vara nyckel med den använda tabelltypen" + ukr "BLOB ÓÔÏ×ÂÅÃØ '%-.192s' ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÉÊ Õ ×ÉÚÎÁÞÅÎΦ ËÌÀÞÁ × ÃØÏÍÕ ÔÉЦ ÔÁÂÌÉæ" ER_TOO_BIG_FIELDLENGTH 42000 S1009 - cze "P-Bøíli¹ velká délka sloupce '%-.64s' (nejvíce %d). Pou¾ijte BLOB" - dan "For stor feltlængde for kolonne '%-.64s' (maks = %d). Brug BLOB i stedet" - nla "Te grote kolomlengte voor '%-.64s' (max = %d). Maak hiervoor gebruik van het type BLOB" - eng "Column length too big for column '%-.64s' (max = %d); use BLOB or TEXT instead" - jps "column '%-.64s' ‚Í,Šm•Û‚·‚é column ‚̑傫‚³‚ª‘½‚·‚¬‚Ü‚·. (Å‘å %d ‚Ü‚Å). BLOB ‚ð‚©‚í‚è‚ÉŽg—p‚µ‚Ä‚­‚¾‚³‚¢.", - est "Tulba '%-.64s' pikkus on liiga pikk (maksimaalne pikkus: %d). Kasuta BLOB väljatüüpi" - fre "Champ '%-.64s' trop long (max = %d). Utilisez un BLOB" - ger "Feldlänge für Feld '%-.64s' zu groß (maximal %d). BLOB- oder TEXT-Spaltentyp verwenden!" - greek "Ðïëý ìåãÜëï ìÞêïò ãéá ôï ðåäßï '%-.64s' (max = %d). Ðáñáêáëþ ÷ñçóéìïðïéåßóôå ôïí ôýðï BLOB" - hun "A(z) '%-.64s' oszlop tul hosszu. (maximum = %d). Hasznaljon BLOB tipust inkabb." - ita "La colonna '%-.64s' e` troppo grande (max=%d). Utilizza un BLOB." - jpn "column '%-.64s' ¤Ï,³ÎÊݤ¹¤ë column ¤ÎÂ礭¤µ¤¬Â¿¤¹¤®¤Þ¤¹. (ºÇÂç %d ¤Þ¤Ç). BLOB ¤ò¤«¤ï¤ê¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤." - kor "Ä®·³ '%-.64s'ÀÇ Ä®·³ ±æÀ̰¡ ³Ê¹« ±é´Ï´Ù (ÃÖ´ë = %d). ´ë½Å¿¡ BLOB¸¦ »ç¿ëÇϼ¼¿ä." - nor "For stor nøkkellengde for kolonne '%-.64s' (maks = %d). Bruk BLOB istedenfor" - norwegian-ny "For stor nykkellengde for felt '%-.64s' (maks = %d). Bruk BLOB istadenfor" - pol "Zbyt du¿a d³ugo?æ kolumny '%-.64s' (maks. = %d). W zamian u¿yj typu BLOB" - por "Comprimento da coluna '%-.64s' grande demais (max = %d); use BLOB em seu lugar" - rum "Lungimea coloanei '%-.64s' este prea lunga (maximum = %d). Foloseste BLOB mai bine" - rus "óÌÉÛËÏÍ ÂÏÌØÛÁÑ ÄÌÉÎÁ ÓÔÏÌÂÃÁ '%-.64s' (ÍÁËÓÉÍÕÍ = %d). éÓÐÏÌØÚÕÊÔÅ ÔÉÐ BLOB ÉÌÉ TEXT ×ÍÅÓÔÏ ÔÅËÕÝÅÇÏ" - serbian "Previše podataka za kolonu '%-.64s' (maksimum je %d). Upotrebite BLOB polje" - slo "Príli¹ veµká då¾ka pre pole '%-.64s' (maximum = %d). Pou¾ite BLOB" - spa "Longitud de columna demasiado grande para la columna '%-.64s' (maximo = %d).Usar BLOB en su lugar" - swe "För stor kolumnlängd angiven för '%-.64s' (max= %d). Använd en BLOB instället" - ukr "úÁÄÏ×ÇÁ ÄÏ×ÖÉÎÁ ÓÔÏ×ÂÃÑ '%-.64s' (max = %d). ÷ÉËÏÒÉÓÔÁÊÔÅ ÔÉÐ BLOB" + cze "P-Bøíli¹ velká délka sloupce '%-.192s' (nejvíce %d). Pou¾ijte BLOB" + dan "For stor feltlængde for kolonne '%-.192s' (maks = %d). Brug BLOB i stedet" + nla "Te grote kolomlengte voor '%-.192s' (max = %d). Maak hiervoor gebruik van het type BLOB" + eng "Column length too big for column '%-.192s' (max = %d); use BLOB or TEXT instead" + jps "column '%-.192s' ‚Í,Šm•Û‚·‚é column ‚̑傫‚³‚ª‘½‚·‚¬‚Ü‚·. (Å‘å %d ‚Ü‚Å). BLOB ‚ð‚©‚í‚è‚ÉŽg—p‚µ‚Ä‚­‚¾‚³‚¢.", + est "Tulba '%-.192s' pikkus on liiga pikk (maksimaalne pikkus: %d). Kasuta BLOB väljatüüpi" + fre "Champ '%-.192s' trop long (max = %d). Utilisez un BLOB" + ger "Feldlänge für Feld '%-.192s' zu groß (maximal %d). BLOB- oder TEXT-Spaltentyp verwenden!" + greek "Ðïëý ìåãÜëï ìÞêïò ãéá ôï ðåäßï '%-.192s' (max = %d). Ðáñáêáëþ ÷ñçóéìïðïéåßóôå ôïí ôýðï BLOB" + hun "A(z) '%-.192s' oszlop tul hosszu. (maximum = %d). Hasznaljon BLOB tipust inkabb." + ita "La colonna '%-.192s' e` troppo grande (max=%d). Utilizza un BLOB." + jpn "column '%-.192s' ¤Ï,³ÎÊݤ¹¤ë column ¤ÎÂ礭¤µ¤¬Â¿¤¹¤®¤Þ¤¹. (ºÇÂç %d ¤Þ¤Ç). BLOB ¤ò¤«¤ï¤ê¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤." + kor "Ä®·³ '%-.192s'ÀÇ Ä®·³ ±æÀ̰¡ ³Ê¹« ±é´Ï´Ù (ÃÖ´ë = %d). ´ë½Å¿¡ BLOB¸¦ »ç¿ëÇϼ¼¿ä." + nor "For stor nøkkellengde for kolonne '%-.192s' (maks = %d). Bruk BLOB istedenfor" + norwegian-ny "For stor nykkellengde for felt '%-.192s' (maks = %d). Bruk BLOB istadenfor" + pol "Zbyt du¿a d³ugo?æ kolumny '%-.192s' (maks. = %d). W zamian u¿yj typu BLOB" + por "Comprimento da coluna '%-.192s' grande demais (max = %d); use BLOB em seu lugar" + rum "Lungimea coloanei '%-.192s' este prea lunga (maximum = %d). Foloseste BLOB mai bine" + rus "óÌÉÛËÏÍ ÂÏÌØÛÁÑ ÄÌÉÎÁ ÓÔÏÌÂÃÁ '%-.192s' (ÍÁËÓÉÍÕÍ = %d). éÓÐÏÌØÚÕÊÔÅ ÔÉÐ BLOB ÉÌÉ TEXT ×ÍÅÓÔÏ ÔÅËÕÝÅÇÏ" + serbian "Previše podataka za kolonu '%-.192s' (maksimum je %d). Upotrebite BLOB polje" + slo "Príli¹ veµká då¾ka pre pole '%-.192s' (maximum = %d). Pou¾ite BLOB" + spa "Longitud de columna demasiado grande para la columna '%-.192s' (maximo = %d).Usar BLOB en su lugar" + swe "För stor kolumnlängd angiven för '%-.192s' (max= %d). Använd en BLOB instället" + ukr "úÁÄÏ×ÇÁ ÄÏ×ÖÉÎÁ ÓÔÏ×ÂÃÑ '%-.192s' (max = %d). ÷ÉËÏÒÉÓÔÁÊÔÅ ÔÉÐ BLOB" ER_WRONG_AUTO_KEY 42000 S1009 cze "M-Bù¾ete mít pouze jedno AUTO pole a to musí být definováno jako klíè" dan "Der kan kun specificeres eet AUTO_INCREMENT-felt, og det skal være indekseret" @@ -1919,30 +1919,30 @@ ER_SHUTDOWN_COMPLETE swe "%s: Avslutning klar\n" ukr "%s: òÏÂÏÔÕ ÚÁ×ÅÒÛÅÎÏ\n" ER_FORCING_CLOSE 08S01 - cze "%s: n-Básilné uzavøení threadu %ld u¾ivatele '%-.32s'\n" - dan "%s: Forceret nedlukning af tråd: %ld bruger: '%-.32s'\n" - nla "%s: Afsluiten afgedwongen van thread %ld gebruiker: '%-.32s'\n" - eng "%s: Forcing close of thread %ld user: '%-.32s'\n" - jps "%s: ƒXƒŒƒbƒh %ld ‹­§I—¹ user: '%-.32s'\n", - est "%s: Sulgen jõuga lõime %ld kasutaja: '%-.32s'\n" - fre "%s: Arrêt forcé de la tâche (thread) %ld utilisateur: '%-.32s'\n" - ger "%s: Thread %ld zwangsweise beendet. Benutzer: '%-.32s'\n" - greek "%s: Ôï thread èá êëåßóåé %ld user: '%-.32s'\n" - hun "%s: A(z) %ld thread kenyszeritett zarasa. Felhasznalo: '%-.32s'\n" - ita "%s: Forzata la chiusura del thread %ld utente: '%-.32s'\n" - jpn "%s: ¥¹¥ì¥Ã¥É %ld ¶¯À©½ªÎ» user: '%-.32s'\n" - kor "%s: thread %ldÀÇ °­Á¦ Á¾·á user: '%-.32s'\n" - nor "%s: Påtvinget avslutning av tråd %ld bruker: '%-.32s'\n" - norwegian-ny "%s: Påtvinga avslutning av tråd %ld brukar: '%-.32s'\n" - pol "%s: Wymuszenie zamkniêcia w?tku %ld u¿ytkownik: '%-.32s'\n" - por "%s: Forçando finalização da 'thread' %ld - usuário '%-.32s'\n" - rum "%s: Terminare fortata a thread-ului %ld utilizatorului: '%-.32s'\n" - rus "%s: ðÒÉÎÕÄÉÔÅÌØÎÏ ÚÁËÒÙ×ÁÅÍ ÐÏÔÏË %ld ÐÏÌØÚÏ×ÁÔÅÌÑ: '%-.32s'\n" - serbian "%s: Usiljeno gašenje thread-a %ld koji pripada korisniku: '%-.32s'\n" - slo "%s: násilné ukonèenie vlákna %ld u¾ívateµa '%-.32s'\n" - spa "%s: Forzando a cerrar el thread %ld usuario: '%-.32s'\n" - swe "%s: Stänger av tråd %ld; användare: '%-.32s'\n" - ukr "%s: ðÒÉÓËÏÒÀÀ ÚÁËÒÉÔÔÑ Ç¦ÌËÉ %ld ËÏÒÉÓÔÕ×ÁÞÁ: '%-.32s'\n" + cze "%s: n-Básilné uzavøení threadu %ld u¾ivatele '%-.48s'\n" + dan "%s: Forceret nedlukning af tråd: %ld bruger: '%-.48s'\n" + nla "%s: Afsluiten afgedwongen van thread %ld gebruiker: '%-.48s'\n" + eng "%s: Forcing close of thread %ld user: '%-.48s'\n" + jps "%s: ƒXƒŒƒbƒh %ld ‹­§I—¹ user: '%-.48s'\n", + est "%s: Sulgen jõuga lõime %ld kasutaja: '%-.48s'\n" + fre "%s: Arrêt forcé de la tâche (thread) %ld utilisateur: '%-.48s'\n" + ger "%s: Thread %ld zwangsweise beendet. Benutzer: '%-.48s'\n" + greek "%s: Ôï thread èá êëåßóåé %ld user: '%-.48s'\n" + hun "%s: A(z) %ld thread kenyszeritett zarasa. Felhasznalo: '%-.48s'\n" + ita "%s: Forzata la chiusura del thread %ld utente: '%-.48s'\n" + jpn "%s: ¥¹¥ì¥Ã¥É %ld ¶¯À©½ªÎ» user: '%-.48s'\n" + kor "%s: thread %ldÀÇ °­Á¦ Á¾·á user: '%-.48s'\n" + nor "%s: Påtvinget avslutning av tråd %ld bruker: '%-.48s'\n" + norwegian-ny "%s: Påtvinga avslutning av tråd %ld brukar: '%-.48s'\n" + pol "%s: Wymuszenie zamkniêcia w?tku %ld u¿ytkownik: '%-.48s'\n" + por "%s: Forçando finalização da 'thread' %ld - usuário '%-.48s'\n" + rum "%s: Terminare fortata a thread-ului %ld utilizatorului: '%-.48s'\n" + rus "%s: ðÒÉÎÕÄÉÔÅÌØÎÏ ÚÁËÒÙ×ÁÅÍ ÐÏÔÏË %ld ÐÏÌØÚÏ×ÁÔÅÌÑ: '%-.48s'\n" + serbian "%s: Usiljeno gašenje thread-a %ld koji pripada korisniku: '%-.48s'\n" + slo "%s: násilné ukonèenie vlákna %ld u¾ívateµa '%-.48s'\n" + spa "%s: Forzando a cerrar el thread %ld usuario: '%-.48s'\n" + swe "%s: Stänger av tråd %ld; användare: '%-.48s'\n" + ukr "%s: ðÒÉÓËÏÒÀÀ ÚÁËÒÉÔÔÑ Ç¦ÌËÉ %ld ËÏÒÉÓÔÕ×ÁÞÁ: '%-.48s'\n" ER_IPSOCK_ERROR 08S01 cze "Nemohu vytvo-Bøit IP socket" dan "Kan ikke oprette IP socket" @@ -1969,30 +1969,30 @@ ER_IPSOCK_ERROR 08S01 swe "Kan inte skapa IP-socket" ukr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ IP ÒÏÚ'¤Í" ER_NO_SUCH_INDEX 42S12 S1009 - cze "Tabulka '%-.64s' nem-Bá index odpovídající CREATE INDEX. Vytvoøte tabulku znovu" - dan "Tabellen '%-.64s' har ikke den nøgle, som blev brugt i CREATE INDEX. Genopret tabellen" - nla "Tabel '%-.64s' heeft geen INDEX zoals deze gemaakt worden met CREATE INDEX. Maak de tabel opnieuw" - eng "Table '%-.64s' has no index like the one used in CREATE INDEX; recreate the table" - jps "Table '%-.64s' ‚Í‚»‚̂悤‚È index ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ(CREATE INDEX ŽÀsŽž‚ÉŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ). ƒe[ƒuƒ‹‚ðì‚è’¼‚µ‚Ä‚­‚¾‚³‚¢", - est "Tabelil '%-.64s' puuduvad võtmed. Loo tabel uuesti" - fre "La table '%-.64s' n'a pas d'index comme celle utilisée dans CREATE INDEX. Recréez la table" - ger "Tabelle '%-.64s' besitzt keinen wie den in CREATE INDEX verwendeten Index. Tabelle neu anlegen" - greek "Ï ðßíáêáò '%-.64s' äåí Ý÷åé åõñåôÞñéï (index) óáí áõôü ðïõ ÷ñçóéìïðïéåßôå óôçí CREATE INDEX. Ðáñáêáëþ, îáíáäçìéïõñãÞóôå ôïí ðßíáêá" - hun "A(z) '%-.64s' tablahoz nincs meg a CREATE INDEX altal hasznalt index. Alakitsa at a tablat" - ita "La tabella '%-.64s' non ha nessun indice come quello specificatato dalla CREATE INDEX. Ricrea la tabella" - jpn "Table '%-.64s' ¤Ï¤½¤Î¤è¤¦¤Ê index ¤ò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó(CREATE INDEX ¼Â¹Ô»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó). ¥Æ¡¼¥Ö¥ë¤òºî¤êľ¤·¤Æ¤¯¤À¤µ¤¤" - kor "Å×À̺í '%-.64s'´Â À妽º¸¦ ¸¸µéÁö ¾Ê¾Ò½À´Ï´Ù. alter Å×À̺í¸í·ÉÀ» ÀÌ¿ëÇÏ¿© Å×À̺íÀ» ¼öÁ¤Çϼ¼¿ä..." - nor "Tabellen '%-.64s' har ingen index som den som er brukt i CREATE INDEX. Gjenopprett tabellen" - norwegian-ny "Tabellen '%-.64s' har ingen index som den som er brukt i CREATE INDEX. Oprett tabellen på nytt" - pol "Tabela '%-.64s' nie ma indeksu takiego jak w CREATE INDEX. Stwórz tabelê" - por "Tabela '%-.64s' não possui um índice como o usado em CREATE INDEX. Recrie a tabela" - rum "Tabela '%-.64s' nu are un index ca acela folosit in CREATE INDEX. Re-creeaza tabela" - rus "÷ ÔÁÂÌÉÃÅ '%-.64s' ÎÅÔ ÔÁËÏÇÏ ÉÎÄÅËÓÁ, ËÁË × CREATE INDEX. óÏÚÄÁÊÔÅ ÔÁÂÌÉÃÕ ÚÁÎÏ×Ï" - serbian "Tabela '%-.64s' nema isti indeks kao onaj upotrebljen pri komandi 'CREATE INDEX'. Napravite tabelu ponovo" - slo "Tabuµka '%-.64s' nemá index zodpovedajúci CREATE INDEX. Vytvorte tabulku znova" - spa "La tabla '%-.64s' no tiene indice como el usado en CREATE INDEX. Crea de nuevo la tabla" - swe "Tabellen '%-.64s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellen" - ukr "ôÁÂÌÉÃÑ '%-.64s' ÍÁ¤ ¦ÎÄÅËÓ, ÝÏ ÎÅ ÓЦ×ÐÁÄÁ¤ Ú ×ËÁÚÁÎÎÉÍ Õ CREATE INDEX. óÔ×ÏÒ¦ÔØ ÔÁÂÌÉÃÀ ÚÎÏ×Õ" + cze "Tabulka '%-.192s' nem-Bá index odpovídající CREATE INDEX. Vytvoøte tabulku znovu" + dan "Tabellen '%-.192s' har ikke den nøgle, som blev brugt i CREATE INDEX. Genopret tabellen" + nla "Tabel '%-.192s' heeft geen INDEX zoals deze gemaakt worden met CREATE INDEX. Maak de tabel opnieuw" + eng "Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table" + jps "Table '%-.192s' ‚Í‚»‚̂悤‚È index ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ(CREATE INDEX ŽÀsŽž‚ÉŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ). ƒe[ƒuƒ‹‚ðì‚è’¼‚µ‚Ä‚­‚¾‚³‚¢", + est "Tabelil '%-.192s' puuduvad võtmed. Loo tabel uuesti" + fre "La table '%-.192s' n'a pas d'index comme celle utilisée dans CREATE INDEX. Recréez la table" + ger "Tabelle '%-.192s' besitzt keinen wie den in CREATE INDEX verwendeten Index. Tabelle neu anlegen" + greek "Ï ðßíáêáò '%-.192s' äåí Ý÷åé åõñåôÞñéï (index) óáí áõôü ðïõ ÷ñçóéìïðïéåßôå óôçí CREATE INDEX. Ðáñáêáëþ, îáíáäçìéïõñãÞóôå ôïí ðßíáêá" + hun "A(z) '%-.192s' tablahoz nincs meg a CREATE INDEX altal hasznalt index. Alakitsa at a tablat" + ita "La tabella '%-.192s' non ha nessun indice come quello specificatato dalla CREATE INDEX. Ricrea la tabella" + jpn "Table '%-.192s' ¤Ï¤½¤Î¤è¤¦¤Ê index ¤ò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó(CREATE INDEX ¼Â¹Ô»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó). ¥Æ¡¼¥Ö¥ë¤òºî¤êľ¤·¤Æ¤¯¤À¤µ¤¤" + kor "Å×À̺í '%-.192s'´Â À妽º¸¦ ¸¸µéÁö ¾Ê¾Ò½À´Ï´Ù. alter Å×À̺í¸í·ÉÀ» ÀÌ¿ëÇÏ¿© Å×À̺íÀ» ¼öÁ¤Çϼ¼¿ä..." + nor "Tabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Gjenopprett tabellen" + norwegian-ny "Tabellen '%-.192s' har ingen index som den som er brukt i CREATE INDEX. Oprett tabellen på nytt" + pol "Tabela '%-.192s' nie ma indeksu takiego jak w CREATE INDEX. Stwórz tabelê" + por "Tabela '%-.192s' não possui um índice como o usado em CREATE INDEX. Recrie a tabela" + rum "Tabela '%-.192s' nu are un index ca acela folosit in CREATE INDEX. Re-creeaza tabela" + rus "÷ ÔÁÂÌÉÃÅ '%-.192s' ÎÅÔ ÔÁËÏÇÏ ÉÎÄÅËÓÁ, ËÁË × CREATE INDEX. óÏÚÄÁÊÔÅ ÔÁÂÌÉÃÕ ÚÁÎÏ×Ï" + serbian "Tabela '%-.192s' nema isti indeks kao onaj upotrebljen pri komandi 'CREATE INDEX'. Napravite tabelu ponovo" + slo "Tabuµka '%-.192s' nemá index zodpovedajúci CREATE INDEX. Vytvorte tabulku znova" + spa "La tabla '%-.192s' no tiene indice como el usado en CREATE INDEX. Crea de nuevo la tabla" + swe "Tabellen '%-.192s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellen" + ukr "ôÁÂÌÉÃÑ '%-.192s' ÍÁ¤ ¦ÎÄÅËÓ, ÝÏ ÎÅ ÓЦ×ÐÁÄÁ¤ Ú ×ËÁÚÁÎÎÉÍ Õ CREATE INDEX. óÔ×ÏÒ¦ÔØ ÔÁÂÌÉÃÀ ÚÎÏ×Õ" ER_WRONG_FIELD_TERMINATORS 42000 S1009 cze "Argument separ-Bátoru polo¾ek nebyl oèekáván. Pøeètìte si manuál" dan "Felt adskiller er ikke som forventet, se dokumentationen" @@ -2190,30 +2190,30 @@ ER_CANT_REMOVE_ALL_FIELDS 42000 swe "Man kan inte radera alla fält med ALTER TABLE. Använd DROP TABLE istället" ukr "îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ×Ó¦ ÓÔÏ×Âæ ÚÁ ÄÏÐÏÍÏÇÏÀ ALTER TABLE. äÌÑ ÃØÏÇÏ ÓËÏÒÉÓÔÁÊÔÅÓÑ DROP TABLE" ER_CANT_DROP_FIELD_OR_KEY 42000 - cze "Nemohu zru-B¹it '%-.64s' (provést DROP). Zkontrolujte, zda neexistují záznamy/klíèe" - dan "Kan ikke udføre DROP '%-.64s'. Undersøg om feltet/nøglen eksisterer." - nla "Kan '%-.64s' niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat." - eng "Can't DROP '%-.64s'; check that column/key exists" - jps "'%-.64s' ‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½; check that column/key exists", - est "Ei suuda kustutada '%-.64s'. Kontrolli kas tulp/võti eksisteerib" - fre "Ne peut effacer (DROP) '%-.64s'. Vérifiez s'il existe" - ger "Kann '%-.64s' nicht löschen. Existiert die Spalte oder der Schlüssel?" - greek "Áäýíáôç ç äéáãñáöÞ (DROP) '%-.64s'. Ðáñáêáëþ åëÝãîôå áí ôï ðåäßï/êëåéäß õðÜñ÷åé" - hun "A DROP '%-.64s' nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e" - ita "Impossibile cancellare '%-.64s'. Controllare che il campo chiave esista" - jpn "'%-.64s' ¤òÇË´þ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿; check that column/key exists" - kor "'%-.64s'¸¦ DROPÇÒ ¼ö ¾ø½À´Ï´Ù. Ä®·³À̳ª ۰¡ Á¸ÀçÇÏ´ÂÁö äũÇϼ¼¿ä." - nor "Kan ikke DROP '%-.64s'. Undersøk om felt/nøkkel eksisterer." - norwegian-ny "Kan ikkje DROP '%-.64s'. Undersøk om felt/nøkkel eksisterar." - pol "Nie mo¿na wykonaæ operacji DROP '%-.64s'. Sprawd¥, czy to pole/klucz istnieje" - por "Não se pode fazer DROP '%-.64s'. Confira se esta coluna/chave existe" - rum "Nu pot sa DROP '%-.64s'. Verifica daca coloana/cheia exista" - rus "îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ (DROP) '%-.64s'. õÂÅÄÉÔÅÓØ ÞÔÏ ÓÔÏÌÂÅÃ/ËÌÀÞ ÄÅÊÓÔ×ÉÔÅÌØÎÏ ÓÕÝÅÓÔ×ÕÅÔ" - serbian "Ne mogu da izvršim komandu drop 'DROP' na '%-.64s'. Proverite da li ta kolona (odnosno kljuè) postoji" - slo "Nemô¾em zru¹i» (DROP) '%-.64s'. Skontrolujte, èi neexistujú záznamy/kµúèe" - spa "No puedo ELIMINAR '%-.64s'. compuebe que el campo/clave existe" - swe "Kan inte ta bort '%-.64s'. Kontrollera att fältet/nyckel finns" - ukr "îÅ ÍÏÖÕ DROP '%-.64s'. ðÅÒÅצÒÔÅ, ÞÉ ÃÅÊ ÓÔÏ×ÂÅÃØ/ËÌÀÞ ¦ÓÎÕ¤" + cze "Nemohu zru-B¹it '%-.192s' (provést DROP). Zkontrolujte, zda neexistují záznamy/klíèe" + dan "Kan ikke udføre DROP '%-.192s'. Undersøg om feltet/nøglen eksisterer." + nla "Kan '%-.192s' niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat." + eng "Can't DROP '%-.192s'; check that column/key exists" + jps "'%-.192s' ‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½; check that column/key exists", + est "Ei suuda kustutada '%-.192s'. Kontrolli kas tulp/võti eksisteerib" + fre "Ne peut effacer (DROP) '%-.192s'. Vérifiez s'il existe" + ger "Kann '%-.192s' nicht löschen. Existiert die Spalte oder der Schlüssel?" + greek "Áäýíáôç ç äéáãñáöÞ (DROP) '%-.192s'. Ðáñáêáëþ åëÝãîôå áí ôï ðåäßï/êëåéäß õðÜñ÷åé" + hun "A DROP '%-.192s' nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e" + ita "Impossibile cancellare '%-.192s'. Controllare che il campo chiave esista" + jpn "'%-.192s' ¤òÇË´þ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿; check that column/key exists" + kor "'%-.192s'¸¦ DROPÇÒ ¼ö ¾ø½À´Ï´Ù. Ä®·³À̳ª ۰¡ Á¸ÀçÇÏ´ÂÁö äũÇϼ¼¿ä." + nor "Kan ikke DROP '%-.192s'. Undersøk om felt/nøkkel eksisterer." + norwegian-ny "Kan ikkje DROP '%-.192s'. Undersøk om felt/nøkkel eksisterar." + pol "Nie mo¿na wykonaæ operacji DROP '%-.192s'. Sprawd¥, czy to pole/klucz istnieje" + por "Não se pode fazer DROP '%-.192s'. Confira se esta coluna/chave existe" + rum "Nu pot sa DROP '%-.192s'. Verifica daca coloana/cheia exista" + rus "îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ (DROP) '%-.192s'. õÂÅÄÉÔÅÓØ ÞÔÏ ÓÔÏÌÂÅÃ/ËÌÀÞ ÄÅÊÓÔ×ÉÔÅÌØÎÏ ÓÕÝÅÓÔ×ÕÅÔ" + serbian "Ne mogu da izvršim komandu drop 'DROP' na '%-.192s'. Proverite da li ta kolona (odnosno kljuè) postoji" + slo "Nemô¾em zru¹i» (DROP) '%-.192s'. Skontrolujte, èi neexistujú záznamy/kµúèe" + spa "No puedo ELIMINAR '%-.192s'. compuebe que el campo/clave existe" + swe "Kan inte ta bort '%-.192s'. Kontrollera att fältet/nyckel finns" + ukr "îÅ ÍÏÖÕ DROP '%-.192s'. ðÅÒÅצÒÔÅ, ÞÉ ÃÅÊ ÓÔÏ×ÂÅÃØ/ËÌÀÞ ¦ÓÎÕ¤" ER_INSERT_INFO cze "Z-Báznamù: %ld Zdvojených: %ld Varování: %ld" dan "Poster: %ld Ens: %ld Advarsler: %ld" @@ -2240,11 +2240,11 @@ ER_INSERT_INFO swe "Rader: %ld Dubletter: %ld Varningar: %ld" ukr "úÁÐÉÓ¦×: %ld äÕÂ̦ËÁÔ¦×: %ld úÁÓÔÅÒÅÖÅÎØ: %ld" ER_UPDATE_TABLE_USED - eng "You can't specify target table '%-.64s' for update in FROM clause" - ger "Die Verwendung der zu aktualisierenden Zieltabelle '%-.64s' ist in der FROM-Klausel nicht zulässig." - rus "îÅ ÄÏÐÕÓËÁÅÔÓÑ ÕËÁÚÁÎÉÅ ÔÁÂÌÉÃÙ '%-.64s' × ÓÐÉÓËÅ ÔÁÂÌÉà FROM ÄÌÑ ×ÎÅÓÅÎÉÑ × ÎÅÅ ÉÚÍÅÎÅÎÉÊ" - swe "INSERT-table '%-.64s' får inte finnas i FROM tabell-listan" - ukr "ôÁÂÌÉÃÑ '%-.64s' ÝÏ ÚͦÎÀ¤ÔØÓÑ ÎÅ ÄÏÚ×ÏÌÅÎÁ Õ ÐÅÒÅ̦ËÕ ÔÁÂÌÉÃØ FROM" + eng "You can't specify target table '%-.192s' for update in FROM clause" + ger "Die Verwendung der zu aktualisierenden Zieltabelle '%-.192s' ist in der FROM-Klausel nicht zulässig." + rus "îÅ ÄÏÐÕÓËÁÅÔÓÑ ÕËÁÚÁÎÉÅ ÔÁÂÌÉÃÙ '%-.192s' × ÓÐÉÓËÅ ÔÁÂÌÉà FROM ÄÌÑ ×ÎÅÓÅÎÉÑ × ÎÅÅ ÉÚÍÅÎÅÎÉÊ" + swe "INSERT-table '%-.192s' får inte finnas i FROM tabell-listan" + ukr "ôÁÂÌÉÃÑ '%-.192s' ÝÏ ÚͦÎÀ¤ÔØÓÑ ÎÅ ÄÏÚ×ÏÌÅÎÁ Õ ÐÅÒÅ̦ËÕ ÔÁÂÌÉÃØ FROM" ER_NO_SUCH_THREAD cze "Nezn-Bámá identifikace threadu: %lu" dan "Ukendt tråd id: %lu" @@ -2319,28 +2319,28 @@ ER_NO_TABLES_USED swe "Inga tabeller angivna" ukr "îÅ ×ÉËÏÒÉÓÔÁÎÏ ÔÁÂÌÉÃØ" ER_TOO_BIG_SET - cze "P-Bøíli¹ mnoho øetìzcù pro sloupec %-.64s a SET" - dan "For mange tekststrenge til specifikationen af SET i kolonne %-.64s" - nla "Teveel strings voor kolom %-.64s en SET" - eng "Too many strings for column %-.64s and SET" - est "Liiga palju string tulbale %-.64s tüübile SET" - fre "Trop de chaînes dans la colonne %-.64s avec SET" - ger "Zu viele Strings für Feld %-.64s und SET angegeben" - greek "ÐÜñá ðïëëÜ strings ãéá ôï ðåäßï %-.64s êáé SET" - hun "Tul sok karakter: %-.64s es SET" - ita "Troppe stringhe per la colonna %-.64s e la SET" - kor "Ä®·³ %-.64s¿Í SET¿¡¼­ ½ºÆ®¸µÀÌ ³Ê¹« ¸¹½À´Ï´Ù." - nor "For mange tekststrenger kolonne %-.64s og SET" - norwegian-ny "For mange tekststrengar felt %-.64s og SET" - pol "Zbyt wiele ³añcuchów dla kolumny %-.64s i polecenia SET" - por "'Strings' demais para coluna '%-.64s' e SET" - rum "Prea multe siruri pentru coloana %-.64s si SET" - rus "óÌÉÛËÏÍ ÍÎÏÇÏ ÚÎÁÞÅÎÉÊ ÄÌÑ ÓÔÏÌÂÃÁ %-.64s × SET" - serbian "Previše string-ova za kolonu '%-.64s' i komandu 'SET'" - slo "Príli¹ mnoho re»azcov pre pole %-.64s a SET" - spa "Muchas strings para columna %-.64s y SET" - swe "För många alternativ till kolumn %-.64s för SET" - ukr "úÁÂÁÇÁÔÏ ÓÔÒÏË ÄÌÑ ÓÔÏ×ÂÃÑ %-.64s ÔÁ SET" + cze "P-Bøíli¹ mnoho øetìzcù pro sloupec %-.192s a SET" + dan "For mange tekststrenge til specifikationen af SET i kolonne %-.192s" + nla "Teveel strings voor kolom %-.192s en SET" + eng "Too many strings for column %-.192s and SET" + est "Liiga palju string tulbale %-.192s tüübile SET" + fre "Trop de chaînes dans la colonne %-.192s avec SET" + ger "Zu viele Strings für Feld %-.192s und SET angegeben" + greek "ÐÜñá ðïëëÜ strings ãéá ôï ðåäßï %-.192s êáé SET" + hun "Tul sok karakter: %-.192s es SET" + ita "Troppe stringhe per la colonna %-.192s e la SET" + kor "Ä®·³ %-.192s¿Í SET¿¡¼­ ½ºÆ®¸µÀÌ ³Ê¹« ¸¹½À´Ï´Ù." + nor "For mange tekststrenger kolonne %-.192s og SET" + norwegian-ny "For mange tekststrengar felt %-.192s og SET" + pol "Zbyt wiele ³añcuchów dla kolumny %-.192s i polecenia SET" + por "'Strings' demais para coluna '%-.192s' e SET" + rum "Prea multe siruri pentru coloana %-.192s si SET" + rus "óÌÉÛËÏÍ ÍÎÏÇÏ ÚÎÁÞÅÎÉÊ ÄÌÑ ÓÔÏÌÂÃÁ %-.192s × SET" + serbian "Previše string-ova za kolonu '%-.192s' i komandu 'SET'" + slo "Príli¹ mnoho re»azcov pre pole %-.192s a SET" + spa "Muchas strings para columna %-.192s y SET" + swe "För många alternativ till kolumn %-.192s för SET" + ukr "úÁÂÁÇÁÔÏ ÓÔÒÏË ÄÌÑ ÓÔÏ×ÂÃÑ %-.192s ÔÁ SET" ER_NO_UNIQUE_LOGFILE cze "Nemohu vytvo-Bøit jednoznaèné jméno logovacího souboru %-.200s.(1-999)\n" dan "Kan ikke lave unikt log-filnavn %-.200s.(1-999)\n" @@ -2365,79 +2365,79 @@ ER_NO_UNIQUE_LOGFILE swe "Kan inte generera ett unikt filnamn %-.200s.(1-999)\n" ukr "îÅ ÍÏÖÕ ÚÇÅÎÅÒÕ×ÁÔÉ ÕΦËÁÌØÎÅ ¦Í'Ñ log-ÆÁÊÌÕ %-.200s.(1-999)\n" ER_TABLE_NOT_LOCKED_FOR_WRITE - cze "Tabulka '%-.64s' byla zam-Bèena s READ a nemù¾e být zmìnìna" - dan "Tabellen '%-.64s' var låst med READ lås og kan ikke opdateres" - nla "Tabel '%-.64s' was gelocked met een lock om te lezen. Derhalve kunnen geen wijzigingen worden opgeslagen." - eng "Table '%-.64s' was locked with a READ lock and can't be updated" - jps "Table '%-.64s' ‚Í READ lock ‚ɂȂÁ‚Ä‚¢‚ÄAXV‚͂ł«‚Ü‚¹‚ñ", - est "Tabel '%-.64s' on lukustatud READ lukuga ning ei ole muudetav" - fre "Table '%-.64s' verrouillée lecture (READ): modification impossible" - ger "Tabelle '%-.64s' ist mit Lesesperre versehen und kann nicht aktualisiert werden" - greek "Ï ðßíáêáò '%-.64s' Ý÷åé êëåéäùèåß ìå READ lock êáé äåí åðéôñÝðïíôáé áëëáãÝò" - hun "A(z) '%-.64s' tabla zarolva lett (READ lock) es nem lehet frissiteni" - ita "La tabella '%-.64s' e` soggetta a lock in lettura e non puo` essere aggiornata" - jpn "Table '%-.64s' ¤Ï READ lock ¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢¹¹¿·¤Ï¤Ç¤­¤Þ¤»¤ó" - kor "Å×À̺í '%-.64s'´Â READ ¶ôÀÌ Àá°ÜÀ־ °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." - nor "Tabellen '%-.64s' var låst med READ lås og kan ikke oppdateres" - norwegian-ny "Tabellen '%-.64s' var låst med READ lås og kan ikkje oppdaterast" - pol "Tabela '%-.64s' zosta³a zablokowana przez READ i nie mo¿e zostaæ zaktualizowana" - por "Tabela '%-.64s' foi travada com trava de leitura e não pode ser atualizada" - rum "Tabela '%-.64s' a fost locked cu un READ lock si nu poate fi actualizata" - rus "ôÁÂÌÉÃÁ '%-.64s' ÚÁÂÌÏËÉÒÏ×ÁÎÁ ÕÒÏ×ÎÅÍ READ lock É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ" - serbian "Tabela '%-.64s' je zakljuèana READ lock-om; iz nje se može samo èitati ali u nju se ne može pisati" - slo "Tabuµka '%-.64s' bola zamknutá s READ a nemô¾e by» zmenená" - spa "Tabla '%-.64s' fue trabada con un READ lock y no puede ser actualizada" - swe "Tabell '%-.64s' kan inte uppdateras emedan den är låst för läsning" - ukr "ôÁÂÌÉÃÀ '%-.64s' ÚÁÂÌÏËÏ×ÁÎÏ Ô¦ÌØËÉ ÄÌÑ ÞÉÔÁÎÎÑ, ÔÏÍÕ §§ ÎÅ ÍÏÖÎÁ ÏÎÏ×ÉÔÉ" + cze "Tabulka '%-.192s' byla zam-Bèena s READ a nemù¾e být zmìnìna" + dan "Tabellen '%-.192s' var låst med READ lås og kan ikke opdateres" + nla "Tabel '%-.192s' was gelocked met een lock om te lezen. Derhalve kunnen geen wijzigingen worden opgeslagen." + eng "Table '%-.192s' was locked with a READ lock and can't be updated" + jps "Table '%-.192s' ‚Í READ lock ‚ɂȂÁ‚Ä‚¢‚ÄAXV‚͂ł«‚Ü‚¹‚ñ", + est "Tabel '%-.192s' on lukustatud READ lukuga ning ei ole muudetav" + fre "Table '%-.192s' verrouillée lecture (READ): modification impossible" + ger "Tabelle '%-.192s' ist mit Lesesperre versehen und kann nicht aktualisiert werden" + greek "Ï ðßíáêáò '%-.192s' Ý÷åé êëåéäùèåß ìå READ lock êáé äåí åðéôñÝðïíôáé áëëáãÝò" + hun "A(z) '%-.192s' tabla zarolva lett (READ lock) es nem lehet frissiteni" + ita "La tabella '%-.192s' e` soggetta a lock in lettura e non puo` essere aggiornata" + jpn "Table '%-.192s' ¤Ï READ lock ¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢¹¹¿·¤Ï¤Ç¤­¤Þ¤»¤ó" + kor "Å×À̺í '%-.192s'´Â READ ¶ôÀÌ Àá°ÜÀ־ °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." + nor "Tabellen '%-.192s' var låst med READ lås og kan ikke oppdateres" + norwegian-ny "Tabellen '%-.192s' var låst med READ lås og kan ikkje oppdaterast" + pol "Tabela '%-.192s' zosta³a zablokowana przez READ i nie mo¿e zostaæ zaktualizowana" + por "Tabela '%-.192s' foi travada com trava de leitura e não pode ser atualizada" + rum "Tabela '%-.192s' a fost locked cu un READ lock si nu poate fi actualizata" + rus "ôÁÂÌÉÃÁ '%-.192s' ÚÁÂÌÏËÉÒÏ×ÁÎÁ ÕÒÏ×ÎÅÍ READ lock É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ" + serbian "Tabela '%-.192s' je zakljuèana READ lock-om; iz nje se može samo èitati ali u nju se ne može pisati" + slo "Tabuµka '%-.192s' bola zamknutá s READ a nemô¾e by» zmenená" + spa "Tabla '%-.192s' fue trabada con un READ lock y no puede ser actualizada" + swe "Tabell '%-.192s' kan inte uppdateras emedan den är låst för läsning" + ukr "ôÁÂÌÉÃÀ '%-.192s' ÚÁÂÌÏËÏ×ÁÎÏ Ô¦ÌØËÉ ÄÌÑ ÞÉÔÁÎÎÑ, ÔÏÍÕ §§ ÎÅ ÍÏÖÎÁ ÏÎÏ×ÉÔÉ" ER_TABLE_NOT_LOCKED - cze "Tabulka '%-.64s' nebyla zam-Bèena s LOCK TABLES" - dan "Tabellen '%-.64s' var ikke låst med LOCK TABLES" - nla "Tabel '%-.64s' was niet gelocked met LOCK TABLES" - eng "Table '%-.64s' was not locked with LOCK TABLES" - jps "Table '%-.64s' ‚Í LOCK TABLES ‚É‚æ‚Á‚ăƒbƒN‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", - est "Tabel '%-.64s' ei ole lukustatud käsuga LOCK TABLES" - fre "Table '%-.64s' non verrouillée: utilisez LOCK TABLES" - ger "Tabelle '%-.64s' wurde nicht mit LOCK TABLES gesperrt" - greek "Ï ðßíáêáò '%-.64s' äåí Ý÷åé êëåéäùèåß ìå LOCK TABLES" - hun "A(z) '%-.64s' tabla nincs zarolva a LOCK TABLES-szel" - ita "Non e` stato impostato il lock per la tabella '%-.64s' con LOCK TABLES" - jpn "Table '%-.64s' ¤Ï LOCK TABLES ¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" - kor "Å×À̺í '%-.64s'´Â LOCK TABLES ¸í·ÉÀ¸·Î Àá±âÁö ¾Ê¾Ò½À´Ï´Ù." - nor "Tabellen '%-.64s' var ikke låst med LOCK TABLES" - norwegian-ny "Tabellen '%-.64s' var ikkje låst med LOCK TABLES" - pol "Tabela '%-.64s' nie zosta³a zablokowana poleceniem LOCK TABLES" - por "Tabela '%-.64s' não foi travada com LOCK TABLES" - rum "Tabela '%-.64s' nu a fost locked cu LOCK TABLES" - rus "ôÁÂÌÉÃÁ '%-.64s' ÎÅ ÂÙÌÁ ÚÁÂÌÏËÉÒÏ×ÁÎÁ Ó ÐÏÍÏÝØÀ LOCK TABLES" - serbian "Tabela '%-.64s' nije bila zakljuèana komandom 'LOCK TABLES'" - slo "Tabuµka '%-.64s' nebola zamknutá s LOCK TABLES" - spa "Tabla '%-.64s' no fue trabada con LOCK TABLES" - swe "Tabell '%-.64s' är inte låst med LOCK TABLES" - ukr "ôÁÂÌÉÃÀ '%-.64s' ÎÅ ÂÕÌÏ ÂÌÏËÏ×ÁÎÏ Ú LOCK TABLES" + cze "Tabulka '%-.192s' nebyla zam-Bèena s LOCK TABLES" + dan "Tabellen '%-.192s' var ikke låst med LOCK TABLES" + nla "Tabel '%-.192s' was niet gelocked met LOCK TABLES" + eng "Table '%-.192s' was not locked with LOCK TABLES" + jps "Table '%-.192s' ‚Í LOCK TABLES ‚É‚æ‚Á‚ăƒbƒN‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", + est "Tabel '%-.192s' ei ole lukustatud käsuga LOCK TABLES" + fre "Table '%-.192s' non verrouillée: utilisez LOCK TABLES" + ger "Tabelle '%-.192s' wurde nicht mit LOCK TABLES gesperrt" + greek "Ï ðßíáêáò '%-.192s' äåí Ý÷åé êëåéäùèåß ìå LOCK TABLES" + hun "A(z) '%-.192s' tabla nincs zarolva a LOCK TABLES-szel" + ita "Non e` stato impostato il lock per la tabella '%-.192s' con LOCK TABLES" + jpn "Table '%-.192s' ¤Ï LOCK TABLES ¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + kor "Å×À̺í '%-.192s'´Â LOCK TABLES ¸í·ÉÀ¸·Î Àá±âÁö ¾Ê¾Ò½À´Ï´Ù." + nor "Tabellen '%-.192s' var ikke låst med LOCK TABLES" + norwegian-ny "Tabellen '%-.192s' var ikkje låst med LOCK TABLES" + pol "Tabela '%-.192s' nie zosta³a zablokowana poleceniem LOCK TABLES" + por "Tabela '%-.192s' não foi travada com LOCK TABLES" + rum "Tabela '%-.192s' nu a fost locked cu LOCK TABLES" + rus "ôÁÂÌÉÃÁ '%-.192s' ÎÅ ÂÙÌÁ ÚÁÂÌÏËÉÒÏ×ÁÎÁ Ó ÐÏÍÏÝØÀ LOCK TABLES" + serbian "Tabela '%-.192s' nije bila zakljuèana komandom 'LOCK TABLES'" + slo "Tabuµka '%-.192s' nebola zamknutá s LOCK TABLES" + spa "Tabla '%-.192s' no fue trabada con LOCK TABLES" + swe "Tabell '%-.192s' är inte låst med LOCK TABLES" + ukr "ôÁÂÌÉÃÀ '%-.192s' ÎÅ ÂÕÌÏ ÂÌÏËÏ×ÁÎÏ Ú LOCK TABLES" ER_BLOB_CANT_HAVE_DEFAULT 42000 - cze "Blob polo-B¾ka '%-.64s' nemù¾e mít defaultní hodnotu" - dan "BLOB feltet '%-.64s' kan ikke have en standard værdi" - nla "Blob veld '%-.64s' can geen standaardwaarde bevatten" - eng "BLOB/TEXT column '%-.64s' can't have a default value" - est "BLOB-tüüpi tulp '%-.64s' ei saa omada vaikeväärtust" - fre "BLOB '%-.64s' ne peut avoir de valeur par défaut" - ger "BLOB/TEXT-Feld '%-.64s' darf keinen Vorgabewert (DEFAULT) haben" - greek "Ôá Blob ðåäßá '%-.64s' äåí ìðïñïýí íá Ý÷ïõí ðñïêáèïñéóìÝíåò ôéìÝò (default value)" - hun "A(z) '%-.64s' blob objektumnak nem lehet alapertelmezett erteke" - ita "Il campo BLOB '%-.64s' non puo` avere un valore di default" - jpn "BLOB column '%-.64s' can't have a default value" - kor "BLOB Ä®·³ '%-.64s' ´Â µðÆúÆ® °ªÀ» °¡Áú ¼ö ¾ø½À´Ï´Ù." - nor "Blob feltet '%-.64s' kan ikke ha en standard verdi" - norwegian-ny "Blob feltet '%-.64s' kan ikkje ha ein standard verdi" - pol "Pole typu blob '%-.64s' nie mo¿e mieæ domy?lnej warto?ci" - por "Coluna BLOB '%-.64s' não pode ter um valor padrão (default)" - rum "Coloana BLOB '%-.64s' nu poate avea o valoare default" - rus "îÅ×ÏÚÍÏÖÎÏ ÕËÁÚÙ×ÁÔØ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ ÓÔÏÌÂÃÁ BLOB '%-.64s'" - serbian "BLOB kolona '%-.64s' ne može imati default vrednost" - slo "Pole BLOB '%-.64s' nemô¾e ma» implicitnú hodnotu" - spa "Campo Blob '%-.64s' no puede tener valores patron" - swe "BLOB fält '%-.64s' kan inte ha ett DEFAULT-värde" - ukr "óÔÏ×ÂÅÃØ BLOB '%-.64s' ÎÅ ÍÏÖÅ ÍÁÔÉ ÚÎÁÞÅÎÎÑ ÐÏ ÚÁÍÏ×ÞÕ×ÁÎÎÀ" + cze "Blob polo-B¾ka '%-.192s' nemù¾e mít defaultní hodnotu" + dan "BLOB feltet '%-.192s' kan ikke have en standard værdi" + nla "Blob veld '%-.192s' can geen standaardwaarde bevatten" + eng "BLOB/TEXT column '%-.192s' can't have a default value" + est "BLOB-tüüpi tulp '%-.192s' ei saa omada vaikeväärtust" + fre "BLOB '%-.192s' ne peut avoir de valeur par défaut" + ger "BLOB/TEXT-Feld '%-.192s' darf keinen Vorgabewert (DEFAULT) haben" + greek "Ôá Blob ðåäßá '%-.192s' äåí ìðïñïýí íá Ý÷ïõí ðñïêáèïñéóìÝíåò ôéìÝò (default value)" + hun "A(z) '%-.192s' blob objektumnak nem lehet alapertelmezett erteke" + ita "Il campo BLOB '%-.192s' non puo` avere un valore di default" + jpn "BLOB column '%-.192s' can't have a default value" + kor "BLOB Ä®·³ '%-.192s' ´Â µðÆúÆ® °ªÀ» °¡Áú ¼ö ¾ø½À´Ï´Ù." + nor "Blob feltet '%-.192s' kan ikke ha en standard verdi" + norwegian-ny "Blob feltet '%-.192s' kan ikkje ha ein standard verdi" + pol "Pole typu blob '%-.192s' nie mo¿e mieæ domy?lnej warto?ci" + por "Coluna BLOB '%-.192s' não pode ter um valor padrão (default)" + rum "Coloana BLOB '%-.192s' nu poate avea o valoare default" + rus "îÅ×ÏÚÍÏÖÎÏ ÕËÁÚÙ×ÁÔØ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ ÓÔÏÌÂÃÁ BLOB '%-.192s'" + serbian "BLOB kolona '%-.192s' ne može imati default vrednost" + slo "Pole BLOB '%-.192s' nemô¾e ma» implicitnú hodnotu" + spa "Campo Blob '%-.192s' no puede tener valores patron" + swe "BLOB fält '%-.192s' kan inte ha ett DEFAULT-värde" + ukr "óÔÏ×ÂÅÃØ BLOB '%-.192s' ÎÅ ÍÏÖÅ ÍÁÔÉ ÚÎÁÞÅÎÎÑ ÐÏ ÚÁÍÏ×ÞÕ×ÁÎÎÀ" ER_WRONG_DB_NAME 42000 cze "Nep-Bøípustné jméno databáze '%-.100s'" dan "Ugyldigt database navn '%-.100s'" @@ -2534,121 +2534,121 @@ ER_UNKNOWN_ERROR swe "Oidentifierat fel" ukr "îÅצÄÏÍÁ ÐÏÍÉÌËÁ" ER_UNKNOWN_PROCEDURE 42000 - cze "Nezn-Bámá procedura %-.64s" - dan "Ukendt procedure %-.64s" - nla "Onbekende procedure %-.64s" - eng "Unknown procedure '%-.64s'" - est "Tundmatu protseduur '%-.64s'" - fre "Procédure %-.64s inconnue" - ger "Unbekannte Prozedur '%-.64s'" - greek "Áãíùóôç äéáäéêáóßá '%-.64s'" - hun "Ismeretlen eljaras: '%-.64s'" - ita "Procedura '%-.64s' sconosciuta" - kor "¾Ë¼ö ¾ø´Â ¼öÇ๮ : '%-.64s'" - nor "Ukjent prosedyre %-.64s" - norwegian-ny "Ukjend prosedyre %-.64s" - pol "Unkown procedure %-.64s" - por "'Procedure' '%-.64s' desconhecida" - rum "Procedura unknown '%-.64s'" - rus "îÅÉÚ×ÅÓÔÎÁÑ ÐÒÏÃÅÄÕÒÁ '%-.64s'" - serbian "Nepoznata procedura '%-.64s'" - slo "Neznámá procedúra '%-.64s'" - spa "Procedimiento desconocido %-.64s" - swe "Okänd procedur: %-.64s" - ukr "îÅצÄÏÍÁ ÐÒÏÃÅÄÕÒÁ '%-.64s'" + cze "Nezn-Bámá procedura %-.192s" + dan "Ukendt procedure %-.192s" + nla "Onbekende procedure %-.192s" + eng "Unknown procedure '%-.192s'" + est "Tundmatu protseduur '%-.192s'" + fre "Procédure %-.192s inconnue" + ger "Unbekannte Prozedur '%-.192s'" + greek "Áãíùóôç äéáäéêáóßá '%-.192s'" + hun "Ismeretlen eljaras: '%-.192s'" + ita "Procedura '%-.192s' sconosciuta" + kor "¾Ë¼ö ¾ø´Â ¼öÇ๮ : '%-.192s'" + nor "Ukjent prosedyre %-.192s" + norwegian-ny "Ukjend prosedyre %-.192s" + pol "Unkown procedure %-.192s" + por "'Procedure' '%-.192s' desconhecida" + rum "Procedura unknown '%-.192s'" + rus "îÅÉÚ×ÅÓÔÎÁÑ ÐÒÏÃÅÄÕÒÁ '%-.192s'" + serbian "Nepoznata procedura '%-.192s'" + slo "Neznámá procedúra '%-.192s'" + spa "Procedimiento desconocido %-.192s" + swe "Okänd procedur: %-.192s" + ukr "îÅצÄÏÍÁ ÐÒÏÃÅÄÕÒÁ '%-.192s'" ER_WRONG_PARAMCOUNT_TO_PROCEDURE 42000 - cze "Chybn-Bý poèet parametrù procedury %-.64s" - dan "Forkert antal parametre til proceduren %-.64s" - nla "Foutief aantal parameters doorgegeven aan procedure %-.64s" - eng "Incorrect parameter count to procedure '%-.64s'" - est "Vale parameetrite hulk protseduurile '%-.64s'" - fre "Mauvais nombre de paramètres pour la procedure %-.64s" - ger "Falsche Parameterzahl für Prozedur '%-.64s'" - greek "ËÜèïò áñéèìüò ðáñáìÝôñùí óôç äéáäéêáóßá '%-.64s'" - hun "Rossz parameter a(z) '%-.64s'eljaras szamitasanal" - ita "Numero di parametri errato per la procedura '%-.64s'" - kor "'%-.64s' ¼öÇ๮¿¡ ´ëÇÑ ºÎÁ¤È®ÇÑ ÆÄ¶ó¸ÞÅÍ" - nor "Feil parameter antall til prosedyren %-.64s" - norwegian-ny "Feil parameter tal til prosedyra %-.64s" - pol "Incorrect parameter count to procedure %-.64s" - por "Número de parâmetros incorreto para a 'procedure' '%-.64s'" - rum "Procedura '%-.64s' are un numar incorect de parametri" - rus "îÅËÏÒÒÅËÔÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÁÒÁÍÅÔÒÏ× ÄÌÑ ÐÒÏÃÅÄÕÒÙ '%-.64s'" - serbian "Pogrešan broj parametara za proceduru '%-.64s'" - slo "Chybný poèet parametrov procedúry '%-.64s'" - spa "Equivocado parametro count para procedimiento %-.64s" - swe "Felaktigt antal parametrar till procedur %-.64s" - ukr "èÉÂÎÁ Ë¦ÌØË¦ÓÔØ ÐÁÒÁÍÅÔÒ¦× ÐÒÏÃÅÄÕÒÉ '%-.64s'" + cze "Chybn-Bý poèet parametrù procedury %-.192s" + dan "Forkert antal parametre til proceduren %-.192s" + nla "Foutief aantal parameters doorgegeven aan procedure %-.192s" + eng "Incorrect parameter count to procedure '%-.192s'" + est "Vale parameetrite hulk protseduurile '%-.192s'" + fre "Mauvais nombre de paramètres pour la procedure %-.192s" + ger "Falsche Parameterzahl für Prozedur '%-.192s'" + greek "ËÜèïò áñéèìüò ðáñáìÝôñùí óôç äéáäéêáóßá '%-.192s'" + hun "Rossz parameter a(z) '%-.192s'eljaras szamitasanal" + ita "Numero di parametri errato per la procedura '%-.192s'" + kor "'%-.192s' ¼öÇ๮¿¡ ´ëÇÑ ºÎÁ¤È®ÇÑ ÆÄ¶ó¸ÞÅÍ" + nor "Feil parameter antall til prosedyren %-.192s" + norwegian-ny "Feil parameter tal til prosedyra %-.192s" + pol "Incorrect parameter count to procedure %-.192s" + por "Número de parâmetros incorreto para a 'procedure' '%-.192s'" + rum "Procedura '%-.192s' are un numar incorect de parametri" + rus "îÅËÏÒÒÅËÔÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÁÒÁÍÅÔÒÏ× ÄÌÑ ÐÒÏÃÅÄÕÒÙ '%-.192s'" + serbian "Pogrešan broj parametara za proceduru '%-.192s'" + slo "Chybný poèet parametrov procedúry '%-.192s'" + spa "Equivocado parametro count para procedimiento %-.192s" + swe "Felaktigt antal parametrar till procedur %-.192s" + ukr "èÉÂÎÁ Ë¦ÌØË¦ÓÔØ ÐÁÒÁÍÅÔÒ¦× ÐÒÏÃÅÄÕÒÉ '%-.192s'" ER_WRONG_PARAMETERS_TO_PROCEDURE - cze "Chybn-Bé parametry procedury %-.64s" - dan "Forkert(e) parametre til proceduren %-.64s" - nla "Foutieve parameters voor procedure %-.64s" - eng "Incorrect parameters to procedure '%-.64s'" - est "Vigased parameetrid protseduurile '%-.64s'" - fre "Paramètre erroné pour la procedure %-.64s" - ger "Falsche Parameter für Prozedur '%-.64s'" - greek "ËÜèïò ðáñÜìåôñïé óôçí äéáäéêáóßá '%-.64s'" - hun "Rossz parameter a(z) '%-.64s' eljarasban" - ita "Parametri errati per la procedura '%-.64s'" - kor "'%-.64s' ¼öÇ๮¿¡ ´ëÇÑ ºÎÁ¤È®ÇÑ ÆÄ¶ó¸ÞÅÍ" - nor "Feil parametre til prosedyren %-.64s" - norwegian-ny "Feil parameter til prosedyra %-.64s" - pol "Incorrect parameters to procedure %-.64s" - por "Parâmetros incorretos para a 'procedure' '%-.64s'" - rum "Procedura '%-.64s' are parametrii incorecti" - rus "îÅËÏÒÒÅËÔÎÙÅ ÐÁÒÁÍÅÔÒÙ ÄÌÑ ÐÒÏÃÅÄÕÒÙ '%-.64s'" - serbian "Pogrešni parametri prosleðeni proceduri '%-.64s'" - slo "Chybné parametre procedúry '%-.64s'" - spa "Equivocados parametros para procedimiento %-.64s" - swe "Felaktiga parametrar till procedur %-.64s" - ukr "èÉÂÎÉÊ ÐÁÒÁÍÅÔÅÒ ÐÒÏÃÅÄÕÒÉ '%-.64s'" + cze "Chybn-Bé parametry procedury %-.192s" + dan "Forkert(e) parametre til proceduren %-.192s" + nla "Foutieve parameters voor procedure %-.192s" + eng "Incorrect parameters to procedure '%-.192s'" + est "Vigased parameetrid protseduurile '%-.192s'" + fre "Paramètre erroné pour la procedure %-.192s" + ger "Falsche Parameter für Prozedur '%-.192s'" + greek "ËÜèïò ðáñÜìåôñïé óôçí äéáäéêáóßá '%-.192s'" + hun "Rossz parameter a(z) '%-.192s' eljarasban" + ita "Parametri errati per la procedura '%-.192s'" + kor "'%-.192s' ¼öÇ๮¿¡ ´ëÇÑ ºÎÁ¤È®ÇÑ ÆÄ¶ó¸ÞÅÍ" + nor "Feil parametre til prosedyren %-.192s" + norwegian-ny "Feil parameter til prosedyra %-.192s" + pol "Incorrect parameters to procedure %-.192s" + por "Parâmetros incorretos para a 'procedure' '%-.192s'" + rum "Procedura '%-.192s' are parametrii incorecti" + rus "îÅËÏÒÒÅËÔÎÙÅ ÐÁÒÁÍÅÔÒÙ ÄÌÑ ÐÒÏÃÅÄÕÒÙ '%-.192s'" + serbian "Pogrešni parametri prosleðeni proceduri '%-.192s'" + slo "Chybné parametre procedúry '%-.192s'" + spa "Equivocados parametros para procedimiento %-.192s" + swe "Felaktiga parametrar till procedur %-.192s" + ukr "èÉÂÎÉÊ ÐÁÒÁÍÅÔÅÒ ÐÒÏÃÅÄÕÒÉ '%-.192s'" ER_UNKNOWN_TABLE 42S02 - cze "Nezn-Bámá tabulka '%-.64s' v %-.32s" - dan "Ukendt tabel '%-.64s' i %-.32s" - nla "Onbekende tabel '%-.64s' in %-.32s" - eng "Unknown table '%-.64s' in %-.32s" - est "Tundmatu tabel '%-.64s' %-.32s-s" - fre "Table inconnue '%-.64s' dans %-.32s" - ger "Unbekannte Tabelle '%-.64s' in '%-.32s'" - greek "Áãíùóôïò ðßíáêáò '%-.64s' óå %-.32s" - hun "Ismeretlen tabla: '%-.64s' %-.32s-ban" - ita "Tabella '%-.64s' sconosciuta in %-.32s" - jpn "Unknown table '%-.64s' in %-.32s" - kor "¾Ë¼ö ¾ø´Â Å×À̺í '%-.64s' (µ¥ÀÌŸº£À̽º %-.32s)" - nor "Ukjent tabell '%-.64s' i %-.32s" - norwegian-ny "Ukjend tabell '%-.64s' i %-.32s" - pol "Unknown table '%-.64s' in %-.32s" - por "Tabela '%-.64s' desconhecida em '%-.32s'" - rum "Tabla '%-.64s' invalida in %-.32s" - rus "îÅÉÚ×ÅÓÔÎÁÑ ÔÁÂÌÉÃÁ '%-.64s' × %-.32s" - serbian "Nepoznata tabela '%-.64s' u '%-.32s'" - slo "Neznáma tabuµka '%-.64s' v %-.32s" - spa "Tabla desconocida '%-.64s' in %-.32s" - swe "Okänd tabell '%-.64s' i '%-.32s'" - ukr "îÅצÄÏÍÁ ÔÁÂÌÉÃÑ '%-.64s' Õ %-.32s" + cze "Nezn-Bámá tabulka '%-.192s' v %-.32s" + dan "Ukendt tabel '%-.192s' i %-.32s" + nla "Onbekende tabel '%-.192s' in %-.32s" + eng "Unknown table '%-.192s' in %-.32s" + est "Tundmatu tabel '%-.192s' %-.32s-s" + fre "Table inconnue '%-.192s' dans %-.32s" + ger "Unbekannte Tabelle '%-.192s' in '%-.32s'" + greek "Áãíùóôïò ðßíáêáò '%-.192s' óå %-.32s" + hun "Ismeretlen tabla: '%-.192s' %-.32s-ban" + ita "Tabella '%-.192s' sconosciuta in %-.32s" + jpn "Unknown table '%-.192s' in %-.32s" + kor "¾Ë¼ö ¾ø´Â Å×À̺í '%-.192s' (µ¥ÀÌŸº£À̽º %-.32s)" + nor "Ukjent tabell '%-.192s' i %-.32s" + norwegian-ny "Ukjend tabell '%-.192s' i %-.32s" + pol "Unknown table '%-.192s' in %-.32s" + por "Tabela '%-.192s' desconhecida em '%-.32s'" + rum "Tabla '%-.192s' invalida in %-.32s" + rus "îÅÉÚ×ÅÓÔÎÁÑ ÔÁÂÌÉÃÁ '%-.192s' × %-.32s" + serbian "Nepoznata tabela '%-.192s' u '%-.32s'" + slo "Neznáma tabuµka '%-.192s' v %-.32s" + spa "Tabla desconocida '%-.192s' in %-.32s" + swe "Okänd tabell '%-.192s' i '%-.32s'" + ukr "îÅצÄÏÍÁ ÔÁÂÌÉÃÑ '%-.192s' Õ %-.32s" ER_FIELD_SPECIFIED_TWICE 42000 - cze "Polo-B¾ka '%-.64s' je zadána dvakrát" - dan "Feltet '%-.64s' er anvendt to gange" - nla "Veld '%-.64s' is dubbel gespecificeerd" - eng "Column '%-.64s' specified twice" - est "Tulp '%-.64s' on määratletud topelt" - fre "Champ '%-.64s' spécifié deux fois" - ger "Feld '%-.64s' wurde zweimal angegeben" - greek "Ôï ðåäßï '%-.64s' Ý÷åé ïñéóèåß äýï öïñÝò" - hun "A(z) '%-.64s' mezot ketszer definialta" - ita "Campo '%-.64s' specificato 2 volte" - kor "Ä®·³ '%-.64s'´Â µÎ¹ø Á¤ÀǵǾî ÀÖÀ¾´Ï´Ù." - nor "Feltet '%-.64s' er spesifisert to ganger" - norwegian-ny "Feltet '%-.64s' er spesifisert to gangar" - pol "Field '%-.64s' specified twice" - por "Coluna '%-.64s' especificada duas vezes" - rum "Coloana '%-.64s' specificata de doua ori" - rus "óÔÏÌÂÅà '%-.64s' ÕËÁÚÁÎ Ä×ÁÖÄÙ" - serbian "Kolona '%-.64s' je navedena dva puta" - slo "Pole '%-.64s' je zadané dvakrát" - spa "Campo '%-.64s' especificado dos veces" - swe "Fält '%-.64s' är redan använt" - ukr "óÔÏ×ÂÅÃØ '%-.64s' ÚÁÚÎÁÞÅÎÏ Äצަ" + cze "Polo-B¾ka '%-.192s' je zadána dvakrát" + dan "Feltet '%-.192s' er anvendt to gange" + nla "Veld '%-.192s' is dubbel gespecificeerd" + eng "Column '%-.192s' specified twice" + est "Tulp '%-.192s' on määratletud topelt" + fre "Champ '%-.192s' spécifié deux fois" + ger "Feld '%-.192s' wurde zweimal angegeben" + greek "Ôï ðåäßï '%-.192s' Ý÷åé ïñéóèåß äýï öïñÝò" + hun "A(z) '%-.192s' mezot ketszer definialta" + ita "Campo '%-.192s' specificato 2 volte" + kor "Ä®·³ '%-.192s'´Â µÎ¹ø Á¤ÀǵǾî ÀÖÀ¾´Ï´Ù." + nor "Feltet '%-.192s' er spesifisert to ganger" + norwegian-ny "Feltet '%-.192s' er spesifisert to gangar" + pol "Field '%-.192s' specified twice" + por "Coluna '%-.192s' especificada duas vezes" + rum "Coloana '%-.192s' specificata de doua ori" + rus "óÔÏÌÂÅà '%-.192s' ÕËÁÚÁÎ Ä×ÁÖÄÙ" + serbian "Kolona '%-.192s' je navedena dva puta" + slo "Pole '%-.192s' je zadané dvakrát" + spa "Campo '%-.192s' especificado dos veces" + swe "Fält '%-.192s' är redan använt" + ukr "óÔÏ×ÂÅÃØ '%-.192s' ÚÁÚÎÁÞÅÎÏ Äצަ" ER_INVALID_GROUP_FUNC_USE cze "Nespr-Bávné pou¾ití funkce group" dan "Forkert brug af grupperings-funktion" @@ -2670,28 +2670,28 @@ ER_INVALID_GROUP_FUNC_USE swe "Felaktig användning av SQL grupp function" ukr "èÉÂÎÅ ×ÉËÏÒÉÓÔÁÎÎÑ ÆÕÎËæ§ ÇÒÕÐÕ×ÁÎÎÑ" ER_UNSUPPORTED_EXTENSION 42000 - cze "Tabulka '%-.64s' pou-B¾ívá roz¹íøení, které v této verzi MySQL není" - dan "Tabellen '%-.64s' bruger et filtypenavn som ikke findes i denne MySQL version" - nla "Tabel '%-.64s' gebruikt een extensie, die niet in deze MySQL-versie voorkomt." - eng "Table '%-.64s' uses an extension that doesn't exist in this MySQL version" - est "Tabel '%-.64s' kasutab laiendust, mis ei eksisteeri antud MySQL versioonis" - fre "Table '%-.64s' : utilise une extension invalide pour cette version de MySQL" - ger "Tabelle '%-.64s' verwendet eine Erweiterung, die in dieser MySQL-Version nicht verfügbar ist" - greek "Ï ðßíáêò '%-.64s' ÷ñçóéìïðïéåß êÜðïéï extension ðïõ äåí õðÜñ÷åé óôçí Ýêäïóç áõôÞ ôçò MySQL" - hun "A(z) '%-.64s' tabla olyan bovitest hasznal, amely nem letezik ebben a MySQL versioban." - ita "La tabella '%-.64s' usa un'estensione che non esiste in questa versione di MySQL" - kor "Å×À̺í '%-.64s'´Â È®Àå¸í·ÉÀ» ÀÌ¿ëÇÏÁö¸¸ ÇöÀçÀÇ MySQL ¹öÁ¯¿¡¼­´Â Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù." - nor "Table '%-.64s' uses a extension that doesn't exist in this MySQL version" - norwegian-ny "Table '%-.64s' uses a extension that doesn't exist in this MySQL version" - pol "Table '%-.64s' uses a extension that doesn't exist in this MySQL version" - por "Tabela '%-.64s' usa uma extensão que não existe nesta versão do MySQL" - rum "Tabela '%-.64s' foloseste o extensire inexistenta in versiunea curenta de MySQL" - rus "÷ ÔÁÂÌÉÃÅ '%-.64s' ÉÓÐÏÌØÚÕÀÔÓÑ ×ÏÚÍÏÖÎÏÓÔÉ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÍÙÅ × ÜÔÏÊ ×ÅÒÓÉÉ MySQL" - serbian "Tabela '%-.64s' koristi ekstenziju koje ne postoji u ovoj verziji MySQL-a" - slo "Tabuµka '%-.64s' pou¾íva roz¹írenie, ktoré v tejto verzii MySQL nie je" - spa "Tabla '%-.64s' usa una extensión que no existe en esta MySQL versión" - swe "Tabell '%-.64s' har en extension som inte finns i denna version av MySQL" - ukr "ôÁÂÌÉÃÑ '%-.64s' ×ÉËÏÒÉÓÔÏ×Õ¤ ÒÏÚÛÉÒÅÎÎÑ, ÝÏ ÎÅ ¦ÓÎÕ¤ Õ Ã¦Ê ×ÅÒÓ¦§ MySQL" + cze "Tabulka '%-.192s' pou-B¾ívá roz¹íøení, které v této verzi MySQL není" + dan "Tabellen '%-.192s' bruger et filtypenavn som ikke findes i denne MySQL version" + nla "Tabel '%-.192s' gebruikt een extensie, die niet in deze MySQL-versie voorkomt." + eng "Table '%-.192s' uses an extension that doesn't exist in this MySQL version" + est "Tabel '%-.192s' kasutab laiendust, mis ei eksisteeri antud MySQL versioonis" + fre "Table '%-.192s' : utilise une extension invalide pour cette version de MySQL" + ger "Tabelle '%-.192s' verwendet eine Erweiterung, die in dieser MySQL-Version nicht verfügbar ist" + greek "Ï ðßíáêò '%-.192s' ÷ñçóéìïðïéåß êÜðïéï extension ðïõ äåí õðÜñ÷åé óôçí Ýêäïóç áõôÞ ôçò MySQL" + hun "A(z) '%-.192s' tabla olyan bovitest hasznal, amely nem letezik ebben a MySQL versioban." + ita "La tabella '%-.192s' usa un'estensione che non esiste in questa versione di MySQL" + kor "Å×À̺í '%-.192s'´Â È®Àå¸í·ÉÀ» ÀÌ¿ëÇÏÁö¸¸ ÇöÀçÀÇ MySQL ¹öÁ¯¿¡¼­´Â Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù." + nor "Table '%-.192s' uses a extension that doesn't exist in this MySQL version" + norwegian-ny "Table '%-.192s' uses a extension that doesn't exist in this MySQL version" + pol "Table '%-.192s' uses a extension that doesn't exist in this MySQL version" + por "Tabela '%-.192s' usa uma extensão que não existe nesta versão do MySQL" + rum "Tabela '%-.192s' foloseste o extensire inexistenta in versiunea curenta de MySQL" + rus "÷ ÔÁÂÌÉÃÅ '%-.192s' ÉÓÐÏÌØÚÕÀÔÓÑ ×ÏÚÍÏÖÎÏÓÔÉ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÍÙÅ × ÜÔÏÊ ×ÅÒÓÉÉ MySQL" + serbian "Tabela '%-.192s' koristi ekstenziju koje ne postoji u ovoj verziji MySQL-a" + slo "Tabuµka '%-.192s' pou¾íva roz¹írenie, ktoré v tejto verzii MySQL nie je" + spa "Tabla '%-.192s' usa una extensión que no existe en esta MySQL versión" + swe "Tabell '%-.192s' har en extension som inte finns i denna version av MySQL" + ukr "ôÁÂÌÉÃÑ '%-.192s' ×ÉËÏÒÉÓÔÏ×Õ¤ ÒÏÚÛÉÒÅÎÎÑ, ÝÏ ÎÅ ¦ÓÎÕ¤ Õ Ã¦Ê ×ÅÒÓ¦§ MySQL" ER_TABLE_MUST_HAVE_COLUMNS 42000 cze "Tabulka mus-Bí mít alespoò jeden sloupec" dan "En tabel skal have mindst een kolonne" @@ -2715,27 +2715,27 @@ ER_TABLE_MUST_HAVE_COLUMNS 42000 swe "Tabeller måste ha minst 1 kolumn" ukr "ôÁÂÌÉÃÑ ÐÏ×ÉÎÎÁ ÍÁÔÉ ÈÏÞÁ ÏÄÉÎ ÓÔÏ×ÂÅÃØ" ER_RECORD_FILE_FULL - cze "Tabulka '%-.64s' je pln-Bá" - dan "Tabellen '%-.64s' er fuld" - nla "De tabel '%-.64s' is vol" - eng "The table '%-.64s' is full" - jps "table '%-.64s' ‚Í‚¢‚Á‚Ï‚¢‚Å‚·", - est "Tabel '%-.64s' on täis" - fre "La table '%-.64s' est pleine" - ger "Tabelle '%-.64s' ist voll" - greek "Ï ðßíáêáò '%-.64s' åßíáé ãåìÜôïò" - hun "A '%-.64s' tabla megtelt" - ita "La tabella '%-.64s' e` piena" - jpn "table '%-.64s' ¤Ï¤¤¤Ã¤Ñ¤¤¤Ç¤¹" - kor "Å×À̺í '%-.64s'°¡ full³µ½À´Ï´Ù. " - por "Tabela '%-.64s' está cheia" - rum "Tabela '%-.64s' e plina" - rus "ôÁÂÌÉÃÁ '%-.64s' ÐÅÒÅÐÏÌÎÅÎÁ" - serbian "Tabela '%-.64s' je popunjena do kraja" - slo "Tabuµka '%-.64s' je plná" - spa "La tabla '%-.64s' está llena" - swe "Tabellen '%-.64s' är full" - ukr "ôÁÂÌÉÃÑ '%-.64s' ÚÁÐÏ×ÎÅÎÁ" + cze "Tabulka '%-.192s' je pln-Bá" + dan "Tabellen '%-.192s' er fuld" + nla "De tabel '%-.192s' is vol" + eng "The table '%-.192s' is full" + jps "table '%-.192s' ‚Í‚¢‚Á‚Ï‚¢‚Å‚·", + est "Tabel '%-.192s' on täis" + fre "La table '%-.192s' est pleine" + ger "Tabelle '%-.192s' ist voll" + greek "Ï ðßíáêáò '%-.192s' åßíáé ãåìÜôïò" + hun "A '%-.192s' tabla megtelt" + ita "La tabella '%-.192s' e` piena" + jpn "table '%-.192s' ¤Ï¤¤¤Ã¤Ñ¤¤¤Ç¤¹" + kor "Å×À̺í '%-.192s'°¡ full³µ½À´Ï´Ù. " + por "Tabela '%-.192s' está cheia" + rum "Tabela '%-.192s' e plina" + rus "ôÁÂÌÉÃÁ '%-.192s' ÐÅÒÅÐÏÌÎÅÎÁ" + serbian "Tabela '%-.192s' je popunjena do kraja" + slo "Tabuµka '%-.192s' je plná" + spa "La tabla '%-.192s' está llena" + swe "Tabellen '%-.192s' är full" + ukr "ôÁÂÌÉÃÑ '%-.192s' ÚÁÐÏ×ÎÅÎÁ" ER_UNKNOWN_CHARACTER_SET 42000 cze "Nezn-Bámá znaková sada: '%-.64s'" dan "Ukendt tegnsæt: '%-.64s'" @@ -2865,52 +2865,52 @@ ER_WRONG_OUTER_JOIN 42000 swe "Felaktigt referens i OUTER JOIN. Kontrollera ON-uttrycket" ukr "ðÅÒÅÈÒÅÓÎÁ ÚÁÌÅÖΦÓÔØ Õ OUTER JOIN. ðÅÒÅצÒÔÅ ÕÍÏ×Õ ON" ER_NULL_COLUMN_IN_INDEX 42000 - eng "Table handler doesn't support NULL in given index. Please change column '%-.64s' to be NOT NULL or use another handler" - swe "Tabell hanteraren kan inte indexera NULL kolumner för den givna index typen. Ändra '%-.64s' till NOT NULL eller använd en annan hanterare" + eng "Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler" + swe "Tabell hanteraren kan inte indexera NULL kolumner för den givna index typen. Ändra '%-.192s' till NOT NULL eller använd en annan hanterare" ER_CANT_FIND_UDF - cze "Nemohu na-Bèíst funkci '%-.64s'" - dan "Kan ikke læse funktionen '%-.64s'" - nla "Kan functie '%-.64s' niet laden" - eng "Can't load function '%-.64s'" - jps "function '%-.64s' ‚ð ƒ[ƒh‚Å‚«‚Ü‚¹‚ñ", - est "Ei suuda avada funktsiooni '%-.64s'" - fre "Imposible de charger la fonction '%-.64s'" - ger "Kann Funktion '%-.64s' nicht laden" - greek "Äåí åßíáé äõíáôÞ ç äéáäéêáóßá load ãéá ôç óõíÜñôçóç '%-.64s'" - hun "A(z) '%-.64s' fuggveny nem toltheto be" - ita "Impossibile caricare la funzione '%-.64s'" - jpn "function '%-.64s' ¤ò ¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó" - kor "'%-.64s' ÇÔ¼ö¸¦ ·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù." - por "Não pode carregar a função '%-.64s'" - rum "Nu pot incarca functia '%-.64s'" - rus "îÅ×ÏÚÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ ÆÕÎËÃÉÀ '%-.64s'" - serbian "Ne mogu da uèitam funkciju '%-.64s'" - slo "Nemô¾em naèíta» funkciu '%-.64s'" - spa "No puedo cargar función '%-.64s'" - swe "Kan inte ladda funktionen '%-.64s'" - ukr "îÅ ÍÏÖÕ ÚÁ×ÁÎÔÁÖÉÔÉ ÆÕÎËæÀ '%-.64s'" + cze "Nemohu na-Bèíst funkci '%-.192s'" + dan "Kan ikke læse funktionen '%-.192s'" + nla "Kan functie '%-.192s' niet laden" + eng "Can't load function '%-.192s'" + jps "function '%-.192s' ‚ð ƒ[ƒh‚Å‚«‚Ü‚¹‚ñ", + est "Ei suuda avada funktsiooni '%-.192s'" + fre "Imposible de charger la fonction '%-.192s'" + ger "Kann Funktion '%-.192s' nicht laden" + greek "Äåí åßíáé äõíáôÞ ç äéáäéêáóßá load ãéá ôç óõíÜñôçóç '%-.192s'" + hun "A(z) '%-.192s' fuggveny nem toltheto be" + ita "Impossibile caricare la funzione '%-.192s'" + jpn "function '%-.192s' ¤ò ¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó" + kor "'%-.192s' ÇÔ¼ö¸¦ ·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù." + por "Não pode carregar a função '%-.192s'" + rum "Nu pot incarca functia '%-.192s'" + rus "îÅ×ÏÚÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ ÆÕÎËÃÉÀ '%-.192s'" + serbian "Ne mogu da uèitam funkciju '%-.192s'" + slo "Nemô¾em naèíta» funkciu '%-.192s'" + spa "No puedo cargar función '%-.192s'" + swe "Kan inte ladda funktionen '%-.192s'" + ukr "îÅ ÍÏÖÕ ÚÁ×ÁÎÔÁÖÉÔÉ ÆÕÎËæÀ '%-.192s'" ER_CANT_INITIALIZE_UDF - cze "Nemohu inicializovat funkci '%-.64s'; %-.80s" - dan "Kan ikke starte funktionen '%-.64s'; %-.80s" - nla "Kan functie '%-.64s' niet initialiseren; %-.80s" - eng "Can't initialize function '%-.64s'; %-.80s" - jps "function '%-.64s' ‚ð‰Šú‰»‚Å‚«‚Ü‚¹‚ñ; %-.80s", - est "Ei suuda algväärtustada funktsiooni '%-.64s'; %-.80s" - fre "Impossible d'initialiser la fonction '%-.64s'; %-.80s" - ger "Kann Funktion '%-.64s' nicht initialisieren: %-.80s" - greek "Äåí åßíáé äõíáôÞ ç Ýíáñîç ôçò óõíÜñôçóçò '%-.64s'; %-.80s" - hun "A(z) '%-.64s' fuggveny nem inicializalhato; %-.80s" - ita "Impossibile inizializzare la funzione '%-.64s'; %-.80s" - jpn "function '%-.64s' ¤ò½é´ü²½¤Ç¤­¤Þ¤»¤ó; %-.80s" - kor "'%-.64s' ÇÔ¼ö¸¦ ÃʱâÈ­ ÇÏÁö ¸øÇß½À´Ï´Ù.; %-.80s" - por "Não pode inicializar a função '%-.64s' - '%-.80s'" - rum "Nu pot initializa functia '%-.64s'; %-.80s" - rus "îÅ×ÏÚÍÏÖÎÏ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÆÕÎËÃÉÀ '%-.64s'; %-.80s" - serbian "Ne mogu da inicijalizujem funkciju '%-.64s'; %-.80s" - slo "Nemô¾em inicializova» funkciu '%-.64s'; %-.80s" - spa "No puedo inicializar función '%-.64s'; %-.80s" - swe "Kan inte initialisera funktionen '%-.64s'; '%-.80s'" - ukr "îÅ ÍÏÖÕ ¦Î¦Ã¦Á̦ÚÕ×ÁÔÉ ÆÕÎËæÀ '%-.64s'; %-.80s" + cze "Nemohu inicializovat funkci '%-.192s'; %-.80s" + dan "Kan ikke starte funktionen '%-.192s'; %-.80s" + nla "Kan functie '%-.192s' niet initialiseren; %-.80s" + eng "Can't initialize function '%-.192s'; %-.80s" + jps "function '%-.192s' ‚ð‰Šú‰»‚Å‚«‚Ü‚¹‚ñ; %-.80s", + est "Ei suuda algväärtustada funktsiooni '%-.192s'; %-.80s" + fre "Impossible d'initialiser la fonction '%-.192s'; %-.80s" + ger "Kann Funktion '%-.192s' nicht initialisieren: %-.80s" + greek "Äåí åßíáé äõíáôÞ ç Ýíáñîç ôçò óõíÜñôçóçò '%-.192s'; %-.80s" + hun "A(z) '%-.192s' fuggveny nem inicializalhato; %-.80s" + ita "Impossibile inizializzare la funzione '%-.192s'; %-.80s" + jpn "function '%-.192s' ¤ò½é´ü²½¤Ç¤­¤Þ¤»¤ó; %-.80s" + kor "'%-.192s' ÇÔ¼ö¸¦ ÃʱâÈ­ ÇÏÁö ¸øÇß½À´Ï´Ù.; %-.80s" + por "Não pode inicializar a função '%-.192s' - '%-.80s'" + rum "Nu pot initializa functia '%-.192s'; %-.80s" + rus "îÅ×ÏÚÍÏÖÎÏ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÆÕÎËÃÉÀ '%-.192s'; %-.80s" + serbian "Ne mogu da inicijalizujem funkciju '%-.192s'; %-.80s" + slo "Nemô¾em inicializova» funkciu '%-.192s'; %-.80s" + spa "No puedo inicializar función '%-.192s'; %-.80s" + swe "Kan inte initialisera funktionen '%-.192s'; '%-.80s'" + ukr "îÅ ÍÏÖÕ ¦Î¦Ã¦Á̦ÚÕ×ÁÔÉ ÆÕÎËæÀ '%-.192s'; %-.80s" ER_UDF_NO_PATHS cze "Pro sd-Bílenou knihovnu nejsou povoleny cesty" dan "Angivelse af sti ikke tilladt for delt bibliotek" @@ -2934,52 +2934,52 @@ ER_UDF_NO_PATHS swe "Man får inte ange sökväg för dynamiska bibliotek" ukr "îÅ ÄÏÚ×ÏÌÅÎÏ ×ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ ÐÕÔ¦ ÄÌÑ ÒÏÚĦÌÀ×ÁÎÉÈ Â¦Â̦ÏÔÅË" ER_UDF_EXISTS - cze "Funkce '%-.64s' ji-B¾ existuje" - dan "Funktionen '%-.64s' findes allerede" - nla "Functie '%-.64s' bestaat reeds" - eng "Function '%-.64s' already exists" - jps "Function '%-.64s' ‚ÍŠù‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚·", - est "Funktsioon '%-.64s' juba eksisteerib" - fre "La fonction '%-.64s' existe déjà" - ger "Funktion '%-.64s' existiert schon" - greek "Ç óõíÜñôçóç '%-.64s' õðÜñ÷åé Þäç" - hun "A '%-.64s' fuggveny mar letezik" - ita "La funzione '%-.64s' esiste gia`" - jpn "Function '%-.64s' ¤Ï´û¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹" - kor "'%-.64s' ÇÔ¼ö´Â ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù." - por "Função '%-.64s' já existe" - rum "Functia '%-.64s' exista deja" - rus "æÕÎËÃÉÑ '%-.64s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ" - serbian "Funkcija '%-.64s' veæ postoji" - slo "Funkcia '%-.64s' u¾ existuje" - spa "Función '%-.64s' ya existe" - swe "Funktionen '%-.64s' finns redan" - ukr "æÕÎËÃ¦Ñ '%-.64s' ×ÖÅ ¦ÓÎÕ¤" + cze "Funkce '%-.192s' ji-B¾ existuje" + dan "Funktionen '%-.192s' findes allerede" + nla "Functie '%-.192s' bestaat reeds" + eng "Function '%-.192s' already exists" + jps "Function '%-.192s' ‚ÍŠù‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚·", + est "Funktsioon '%-.192s' juba eksisteerib" + fre "La fonction '%-.192s' existe déjà" + ger "Funktion '%-.192s' existiert schon" + greek "Ç óõíÜñôçóç '%-.192s' õðÜñ÷åé Þäç" + hun "A '%-.192s' fuggveny mar letezik" + ita "La funzione '%-.192s' esiste gia`" + jpn "Function '%-.192s' ¤Ï´û¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹" + kor "'%-.192s' ÇÔ¼ö´Â ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù." + por "Função '%-.192s' já existe" + rum "Functia '%-.192s' exista deja" + rus "æÕÎËÃÉÑ '%-.192s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ" + serbian "Funkcija '%-.192s' veæ postoji" + slo "Funkcia '%-.192s' u¾ existuje" + spa "Función '%-.192s' ya existe" + swe "Funktionen '%-.192s' finns redan" + ukr "æÕÎËÃ¦Ñ '%-.192s' ×ÖÅ ¦ÓÎÕ¤" ER_CANT_OPEN_LIBRARY - cze "Nemohu otev-Bøít sdílenou knihovnu '%-.64s' (errno: %d %-.128s)" - dan "Kan ikke åbne delt bibliotek '%-.64s' (errno: %d %-.128s)" - nla "Kan shared library '%-.64s' niet openen (Errcode: %d %-.128s)" - eng "Can't open shared library '%-.64s' (errno: %d %-.128s)" - jps "shared library '%-.64s' ‚ðŠJ‚­Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d %-.128s)", - est "Ei suuda avada jagatud teeki '%-.64s' (veakood: %d %-.128s)" - fre "Impossible d'ouvrir la bibliothèque partagée '%-.64s' (errno: %d %-.128s)" - ger "Kann Shared Library '%-.64s' nicht öffnen (Fehler: %d %-.128s)" - greek "Äåí åßíáé äõíáôÞ ç áíÜãíùóç ôçò shared library '%-.64s' (êùäéêüò ëÜèïõò: %d %-.128s)" - hun "A(z) '%-.64s' megosztott konyvtar nem hasznalhato (hibakod: %d %-.128s)" - ita "Impossibile aprire la libreria condivisa '%-.64s' (errno: %d %-.128s)" - jpn "shared library '%-.64s' ¤ò³«¤¯»ö¤¬¤Ç¤­¤Þ¤»¤ó (errno: %d %-.128s)" - kor "'%-.64s' °øÀ¯ ¶óÀ̹ö·¯¸®¸¦ ¿­¼ö ¾ø½À´Ï´Ù.(¿¡·¯¹øÈ£: %d %-.128s)" - nor "Can't open shared library '%-.64s' (errno: %d %-.128s)" - norwegian-ny "Can't open shared library '%-.64s' (errno: %d %-.128s)" - pol "Can't open shared library '%-.64s' (errno: %d %-.128s)" - por "Não pode abrir biblioteca compartilhada '%-.64s' (erro no. %d '%-.128s')" - rum "Nu pot deschide libraria shared '%-.64s' (Eroare: %d %-.128s)" - rus "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÉÎÁÍÉÞÅÓËÕÀ ÂÉÂÌÉÏÔÅËÕ '%-.64s' (ÏÛÉÂËÁ: %d %-.128s)" - serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.64s' (errno: %d %-.128s)" - slo "Nemô¾em otvori» zdieµanú kni¾nicu '%-.64s' (chybový kód: %d %-.128s)" - spa "No puedo abrir libraria conjugada '%-.64s' (errno: %d %-.128s)" - swe "Kan inte öppna det dynamiska biblioteket '%-.64s' (Felkod: %d %-.128s)" - ukr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÒÏÚĦÌÀ×ÁÎÕ Â¦Â̦ÏÔÅËÕ '%-.64s' (ÐÏÍÉÌËÁ: %d %-.128s)" + cze "Nemohu otev-Bøít sdílenou knihovnu '%-.192s' (errno: %d %-.128s)" + dan "Kan ikke åbne delt bibliotek '%-.192s' (errno: %d %-.128s)" + nla "Kan shared library '%-.192s' niet openen (Errcode: %d %-.128s)" + eng "Can't open shared library '%-.192s' (errno: %d %-.128s)" + jps "shared library '%-.192s' ‚ðŠJ‚­Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d %-.128s)", + est "Ei suuda avada jagatud teeki '%-.192s' (veakood: %d %-.128s)" + fre "Impossible d'ouvrir la bibliothèque partagée '%-.192s' (errno: %d %-.128s)" + ger "Kann Shared Library '%-.192s' nicht öffnen (Fehler: %d %-.128s)" + greek "Äåí åßíáé äõíáôÞ ç áíÜãíùóç ôçò shared library '%-.192s' (êùäéêüò ëÜèïõò: %d %-.128s)" + hun "A(z) '%-.192s' megosztott konyvtar nem hasznalhato (hibakod: %d %-.128s)" + ita "Impossibile aprire la libreria condivisa '%-.192s' (errno: %d %-.128s)" + jpn "shared library '%-.192s' ¤ò³«¤¯»ö¤¬¤Ç¤­¤Þ¤»¤ó (errno: %d %-.128s)" + kor "'%-.192s' °øÀ¯ ¶óÀ̹ö·¯¸®¸¦ ¿­¼ö ¾ø½À´Ï´Ù.(¿¡·¯¹øÈ£: %d %-.128s)" + nor "Can't open shared library '%-.192s' (errno: %d %-.128s)" + norwegian-ny "Can't open shared library '%-.192s' (errno: %d %-.128s)" + pol "Can't open shared library '%-.192s' (errno: %d %-.128s)" + por "Não pode abrir biblioteca compartilhada '%-.192s' (erro no. %d '%-.128s')" + rum "Nu pot deschide libraria shared '%-.192s' (Eroare: %d %-.128s)" + rus "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÉÎÁÍÉÞÅÓËÕÀ ÂÉÂÌÉÏÔÅËÕ '%-.192s' (ÏÛÉÂËÁ: %d %-.128s)" + serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.192s' (errno: %d %-.128s)" + slo "Nemô¾em otvori» zdieµanú kni¾nicu '%-.192s' (chybový kód: %d %-.128s)" + spa "No puedo abrir libraria conjugada '%-.192s' (errno: %d %-.128s)" + swe "Kan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d %-.128s)" + ukr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÒÏÚĦÌÀ×ÁÎÕ Â¦Â̦ÏÔÅËÕ '%-.192s' (ÐÏÍÉÌËÁ: %d %-.128s)" ER_CANT_FIND_DL_ENTRY cze "Nemohu naj-Bít funkci '%-.128s' v knihovnì" dan "Kan ikke finde funktionen '%-.128s' i bibliotek" @@ -3003,27 +3003,27 @@ ER_CANT_FIND_DL_ENTRY swe "Hittar inte funktionen '%-.128s' in det dynamiska biblioteket" ukr "îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÆÕÎËæÀ '%-.128s' Õ Â¦Â̦ÏÔÅæ" ER_FUNCTION_NOT_DEFINED - cze "Funkce '%-.64s' nen-Bí definována" - dan "Funktionen '%-.64s' er ikke defineret" - nla "Functie '%-.64s' is niet gedefinieerd" - eng "Function '%-.64s' is not defined" - jps "Function '%-.64s' ‚Í’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", - est "Funktsioon '%-.64s' ei ole defineeritud" - fre "La fonction '%-.64s' n'est pas définie" - ger "Funktion '%-.64s' ist nicht definiert" - greek "Ç óõíÜñôçóç '%-.64s' äåí Ý÷åé ïñéóèåß" - hun "A '%-.64s' fuggveny nem definialt" - ita "La funzione '%-.64s' non e` definita" - jpn "Function '%-.64s' ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" - kor "'%-.64s' ÇÔ¼ö°¡ Á¤ÀǵǾî ÀÖÁö ¾Ê½À´Ï´Ù." - por "Função '%-.64s' não está definida" - rum "Functia '%-.64s' nu e definita" - rus "æÕÎËÃÉÑ '%-.64s' ÎÅ ÏÐÒÅÄÅÌÅÎÁ" - serbian "Funkcija '%-.64s' nije definisana" - slo "Funkcia '%-.64s' nie je definovaná" - spa "Función '%-.64s' no está definida" - swe "Funktionen '%-.64s' är inte definierad" - ukr "æÕÎËæÀ '%-.64s' ÎÅ ×ÉÚÎÁÞÅÎÏ" + cze "Funkce '%-.192s' nen-Bí definována" + dan "Funktionen '%-.192s' er ikke defineret" + nla "Functie '%-.192s' is niet gedefinieerd" + eng "Function '%-.192s' is not defined" + jps "Function '%-.192s' ‚Í’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", + est "Funktsioon '%-.192s' ei ole defineeritud" + fre "La fonction '%-.192s' n'est pas définie" + ger "Funktion '%-.192s' ist nicht definiert" + greek "Ç óõíÜñôçóç '%-.192s' äåí Ý÷åé ïñéóèåß" + hun "A '%-.192s' fuggveny nem definialt" + ita "La funzione '%-.192s' non e` definita" + jpn "Function '%-.192s' ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + kor "'%-.192s' ÇÔ¼ö°¡ Á¤ÀǵǾî ÀÖÁö ¾Ê½À´Ï´Ù." + por "Função '%-.192s' não está definida" + rum "Functia '%-.192s' nu e definita" + rus "æÕÎËÃÉÑ '%-.192s' ÎÅ ÏÐÒÅÄÅÌÅÎÁ" + serbian "Funkcija '%-.192s' nije definisana" + slo "Funkcia '%-.192s' nie je definovaná" + spa "Función '%-.192s' no está definida" + swe "Funktionen '%-.192s' är inte definierad" + ukr "æÕÎËæÀ '%-.192s' ÎÅ ×ÉÚÎÁÞÅÎÏ" ER_HOST_IS_BLOCKED cze "Stroj '%-.64s' je zablokov-Bán kvùli mnoha chybám pøi pøipojování. Odblokujete pou¾itím 'mysqladmin flush-hosts'" dan "Værten '%-.64s' er blokeret på grund af mange fejlforespørgsler. Lås op med 'mysqladmin flush-hosts'" @@ -3188,27 +3188,27 @@ ER_WRONG_VALUE_COUNT_ON_ROW 21S01 swe "Antalet kolumner motsvarar inte antalet värden på rad: %ld" ukr "ë¦ÌØË¦ÓÔØ ÓÔÏ×ÂÃ¦× ÎÅ ÓЦ×ÐÁÄÁ¤ Ú Ë¦ÌØË¦ÓÔÀ ÚÎÁÞÅÎØ Õ ÓÔÒÏæ %ld" ER_CANT_REOPEN_TABLE - cze "Nemohu znovuotev-Bøít tabulku: '%-.64s" - dan "Kan ikke genåbne tabel '%-.64s" - nla "Kan tabel niet opnieuw openen: '%-.64s" - eng "Can't reopen table: '%-.64s'" - est "Ei suuda taasavada tabelit '%-.64s'" - fre "Impossible de réouvrir la table: '%-.64s" - ger "Kann Tabelle'%-.64s' nicht erneut öffnen" - hun "Nem lehet ujra-megnyitni a tablat: '%-.64s" - ita "Impossibile riaprire la tabella: '%-.64s'" - kor "Å×À̺íÀ» ´Ù½Ã ¿­¼ö ¾ø±º¿ä: '%-.64s" - nor "Can't reopen table: '%-.64s" - norwegian-ny "Can't reopen table: '%-.64s" - pol "Can't reopen table: '%-.64s" - por "Não pode reabrir a tabela '%-.64s" - rum "Nu pot redeschide tabela: '%-.64s'" - rus "îÅ×ÏÚÍÏÖÎÏ ÚÁÎÏ×Ï ÏÔËÒÙÔØ ÔÁÂÌÉÃÕ '%-.64s'" - serbian "Ne mogu da ponovo otvorim tabelu '%-.64s'" - slo "Can't reopen table: '%-.64s" - spa "No puedo reabrir tabla: '%-.64s" - swe "Kunde inte stänga och öppna tabell '%-.64s" - ukr "îÅ ÍÏÖÕ ÐÅÒÅצÄËÒÉÔÉ ÔÁÂÌÉÃÀ: '%-.64s'" + cze "Nemohu znovuotev-Bøít tabulku: '%-.192s" + dan "Kan ikke genåbne tabel '%-.192s" + nla "Kan tabel niet opnieuw openen: '%-.192s" + eng "Can't reopen table: '%-.192s'" + est "Ei suuda taasavada tabelit '%-.192s'" + fre "Impossible de réouvrir la table: '%-.192s" + ger "Kann Tabelle'%-.192s' nicht erneut öffnen" + hun "Nem lehet ujra-megnyitni a tablat: '%-.192s" + ita "Impossibile riaprire la tabella: '%-.192s'" + kor "Å×À̺íÀ» ´Ù½Ã ¿­¼ö ¾ø±º¿ä: '%-.192s" + nor "Can't reopen table: '%-.192s" + norwegian-ny "Can't reopen table: '%-.192s" + pol "Can't reopen table: '%-.192s" + por "Não pode reabrir a tabela '%-.192s" + rum "Nu pot redeschide tabela: '%-.192s'" + rus "îÅ×ÏÚÍÏÖÎÏ ÚÁÎÏ×Ï ÏÔËÒÙÔØ ÔÁÂÌÉÃÕ '%-.192s'" + serbian "Ne mogu da ponovo otvorim tabelu '%-.192s'" + slo "Can't reopen table: '%-.192s" + spa "No puedo reabrir tabla: '%-.192s" + swe "Kunde inte stänga och öppna tabell '%-.192s" + ukr "îÅ ÍÏÖÕ ÐÅÒÅצÄËÒÉÔÉ ÔÁÂÌÉÃÀ: '%-.192s'" ER_INVALID_USE_OF_NULL 22004 cze "Neplatn-Bé u¾ití hodnoty NULL" dan "Forkert brug af nulværdi (NULL)" @@ -3266,65 +3266,65 @@ ER_MIX_OF_GROUP_FUNC_AND_FIELDS 42000 swe "Man får ha både GROUP-kolumner (MIN(),MAX(),COUNT()...) och fält i en fråga om man inte har en GROUP BY-del" ukr "úͦÛÕ×ÁÎÎÑ GROUP ÓÔÏ×ÂÃ¦× (MIN(),MAX(),COUNT()...) Ú ÎÅ GROUP ÓÔÏ×ÂÃÑÍÉ ¤ ÚÁÂÏÒÏÎÅÎÉÍ, ÑËÝÏ ÎÅ ÍÁ¤ GROUP BY" ER_NONEXISTING_GRANT 42000 - cze "Neexistuje odpov-Bídající grant pro u¾ivatele '%-.32s' na stroji '%-.64s'" - dan "Denne tilladelse findes ikke for brugeren '%-.32s' på vært '%-.64s'" - nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.32s' op host '%-.64s'" - eng "There is no such grant defined for user '%-.32s' on host '%-.64s'" - jps "ƒ†[ƒU[ '%-.32s' (ƒzƒXƒg '%-.64s' ‚̃†[ƒU[) ‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", - est "Sellist õigust ei ole defineeritud kasutajale '%-.32s' masinast '%-.64s'" - fre "Un tel droit n'est pas défini pour l'utilisateur '%-.32s' sur l'hôte '%-.64s'" - ger "Für Benutzer '%-.32s' auf Host '%-.64s' gibt es keine solche Berechtigung" - hun "A '%-.32s' felhasznalonak nincs ilyen joga a '%-.64s' host-on" - ita "GRANT non definita per l'utente '%-.32s' dalla macchina '%-.64s'" - jpn "¥æ¡¼¥¶¡¼ '%-.32s' (¥Û¥¹¥È '%-.64s' ¤Î¥æ¡¼¥¶¡¼) ¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" - kor "»ç¿ëÀÚ '%-.32s' (È£½ºÆ® '%-.64s')¸¦ À§ÇÏ¿© Á¤ÀÇµÈ ±×·± ½ÂÀÎÀº ¾ø½À´Ï´Ù." - por "Não existe tal permissão (grant) definida para o usuário '%-.32s' no 'host' '%-.64s'" - rum "Nu exista un astfel de grant definit pentru utilzatorul '%-.32s' de pe host-ul '%-.64s'" - rus "ôÁËÉÅ ÐÒÁ×Á ÎÅ ÏÐÒÅÄÅÌÅÎÙ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' ÎÁ ÈÏÓÔÅ '%-.64s'" - serbian "Ne postoji odobrenje za pristup korisniku '%-.32s' na host-u '%-.64s'" - spa "No existe permiso definido para usuario '%-.32s' en el servidor '%-.64s'" - swe "Det finns inget privilegium definierat för användare '%-.32s' på '%-.64s'" - ukr "ðÏ×ÎÏ×ÁÖÅÎØ ÎÅ ×ÉÚÎÁÞÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ '%-.32s' Ú ÈÏÓÔÕ '%-.64s'" + cze "Neexistuje odpov-Bídající grant pro u¾ivatele '%-.48s' na stroji '%-.64s'" + dan "Denne tilladelse findes ikke for brugeren '%-.48s' på vært '%-.64s'" + nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s'" + eng "There is no such grant defined for user '%-.48s' on host '%-.64s'" + jps "ƒ†[ƒU[ '%-.48s' (ƒzƒXƒg '%-.64s' ‚̃†[ƒU[) ‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", + est "Sellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s'" + fre "Un tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s'" + ger "Für Benutzer '%-.48s' auf Host '%-.64s' gibt es keine solche Berechtigung" + hun "A '%-.48s' felhasznalonak nincs ilyen joga a '%-.64s' host-on" + ita "GRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s'" + jpn "¥æ¡¼¥¶¡¼ '%-.48s' (¥Û¥¹¥È '%-.64s' ¤Î¥æ¡¼¥¶¡¼) ¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + kor "»ç¿ëÀÚ '%-.48s' (È£½ºÆ® '%-.64s')¸¦ À§ÇÏ¿© Á¤ÀÇµÈ ±×·± ½ÂÀÎÀº ¾ø½À´Ï´Ù." + por "Não existe tal permissão (grant) definida para o usuário '%-.48s' no 'host' '%-.64s'" + rum "Nu exista un astfel de grant definit pentru utilzatorul '%-.48s' de pe host-ul '%-.64s'" + rus "ôÁËÉÅ ÐÒÁ×Á ÎÅ ÏÐÒÅÄÅÌÅÎÙ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.48s' ÎÁ ÈÏÓÔÅ '%-.64s'" + serbian "Ne postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s'" + spa "No existe permiso definido para usuario '%-.48s' en el servidor '%-.64s'" + swe "Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s'" + ukr "ðÏ×ÎÏ×ÁÖÅÎØ ÎÅ ×ÉÚÎÁÞÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ '%-.48s' Ú ÈÏÓÔÕ '%-.64s'" ER_TABLEACCESS_DENIED_ERROR 42000 - cze "%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.32s'@'%-.64s' pro tabulku '%-.64s'" - dan "%-.16s-kommandoen er ikke tilladt for brugeren '%-.32s'@'%-.64s' for tabellen '%-.64s'" - nla "%-.16s commando geweigerd voor gebruiker: '%-.32s'@'%-.64s' voor tabel '%-.64s'" - eng "%-.16s command denied to user '%-.32s'@'%-.64s' for table '%-.64s'" - jps "ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.32s'@'%-.64s' ,ƒe[ƒuƒ‹ '%-.64s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", - est "%-.16s käsk ei ole lubatud kasutajale '%-.32s'@'%-.64s' tabelis '%-.64s'" - fre "La commande '%-.16s' est interdite à l'utilisateur: '%-.32s'@'@%-.64s' sur la table '%-.64s'" - ger "%-.16s Befehl nicht erlaubt für Benutzer '%-.32s'@'%-.64s' auf Tabelle '%-.64s'" - hun "%-.16s parancs a '%-.32s'@'%-.64s' felhasznalo szamara nem engedelyezett a '%-.64s' tablaban" - ita "Comando %-.16s negato per l'utente: '%-.32s'@'%-.64s' sulla tabella '%-.64s'" - jpn "¥³¥Þ¥ó¥É %-.16s ¤Ï ¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s' ,¥Æ¡¼¥Ö¥ë '%-.64s' ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" - kor "'%-.16s' ¸í·ÉÀº ´ÙÀ½ »ç¿ëÀÚ¿¡°Ô °ÅºÎµÇ¾ú½À´Ï´Ù. : '%-.32s'@'%-.64s' for Å×À̺í '%-.64s'" - por "Comando '%-.16s' negado para o usuário '%-.32s'@'%-.64s' na tabela '%-.64s'" - rum "Comanda %-.16s interzisa utilizatorului: '%-.32s'@'%-.64s' pentru tabela '%-.64s'" - rus "ëÏÍÁÎÄÁ %-.16s ÚÁÐÒÅÝÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ '%-.32s'@'%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'" - serbian "%-.16s komanda zabranjena za korisnika '%-.32s'@'%-.64s' za tabelu '%-.64s'" - spa "%-.16s comando negado para usuario: '%-.32s'@'%-.64s' para tabla '%-.64s'" - swe "%-.16s ej tillåtet för '%-.32s'@'%-.64s' för tabell '%-.64s'" - ukr "%-.16s ËÏÍÁÎÄÁ ÚÁÂÏÒÏÎÅÎÁ ËÏÒÉÓÔÕ×ÁÞÕ: '%-.32s'@'%-.64s' Õ ÔÁÂÌÉæ '%-.64s'" + cze "%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.48s'@'%-.64s' pro tabulku '%-.192s'" + dan "%-.16s-kommandoen er ikke tilladt for brugeren '%-.48s'@'%-.64s' for tabellen '%-.192s'" + nla "%-.16s commando geweigerd voor gebruiker: '%-.48s'@'%-.64s' voor tabel '%-.192s'" + eng "%-.16s command denied to user '%-.48s'@'%-.64s' for table '%-.192s'" + jps "ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.48s'@'%-.64s' ,ƒe[ƒuƒ‹ '%-.192s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", + est "%-.16s käsk ei ole lubatud kasutajale '%-.48s'@'%-.64s' tabelis '%-.192s'" + fre "La commande '%-.16s' est interdite à l'utilisateur: '%-.48s'@'@%-.64s' sur la table '%-.192s'" + ger "%-.16s Befehl nicht erlaubt für Benutzer '%-.48s'@'%-.64s' auf Tabelle '%-.192s'" + hun "%-.16s parancs a '%-.48s'@'%-.64s' felhasznalo szamara nem engedelyezett a '%-.192s' tablaban" + ita "Comando %-.16s negato per l'utente: '%-.48s'@'%-.64s' sulla tabella '%-.192s'" + jpn "¥³¥Þ¥ó¥É %-.16s ¤Ï ¥æ¡¼¥¶¡¼ '%-.48s'@'%-.64s' ,¥Æ¡¼¥Ö¥ë '%-.192s' ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + kor "'%-.16s' ¸í·ÉÀº ´ÙÀ½ »ç¿ëÀÚ¿¡°Ô °ÅºÎµÇ¾ú½À´Ï´Ù. : '%-.48s'@'%-.64s' for Å×À̺í '%-.192s'" + por "Comando '%-.16s' negado para o usuário '%-.48s'@'%-.64s' na tabela '%-.192s'" + rum "Comanda %-.16s interzisa utilizatorului: '%-.48s'@'%-.64s' pentru tabela '%-.192s'" + rus "ëÏÍÁÎÄÁ %-.16s ÚÁÐÒÅÝÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ '%-.48s'@'%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.192s'" + serbian "%-.16s komanda zabranjena za korisnika '%-.48s'@'%-.64s' za tabelu '%-.192s'" + spa "%-.16s comando negado para usuario: '%-.48s'@'%-.64s' para tabla '%-.192s'" + swe "%-.16s ej tillåtet för '%-.48s'@'%-.64s' för tabell '%-.192s'" + ukr "%-.16s ËÏÍÁÎÄÁ ÚÁÂÏÒÏÎÅÎÁ ËÏÒÉÓÔÕ×ÁÞÕ: '%-.48s'@'%-.64s' Õ ÔÁÂÌÉæ '%-.192s'" ER_COLUMNACCESS_DENIED_ERROR 42000 - cze "%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.32s'@'%-.64s' pro sloupec '%-.64s' v tabulce '%-.64s'" - dan "%-.16s-kommandoen er ikke tilladt for brugeren '%-.32s'@'%-.64s' for kolonne '%-.64s' in tabellen '%-.64s'" - nla "%-.16s commando geweigerd voor gebruiker: '%-.32s'@'%-.64s' voor kolom '%-.64s' in tabel '%-.64s'" - eng "%-.16s command denied to user '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'" - jps "ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.32s'@'%-.64s'\n ƒJƒ‰ƒ€ '%-.64s' ƒe[ƒuƒ‹ '%-.64s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", - est "%-.16s käsk ei ole lubatud kasutajale '%-.32s'@'%-.64s' tulbale '%-.64s' tabelis '%-.64s'" - fre "La commande '%-.16s' est interdite à l'utilisateur: '%-.32s'@'@%-.64s' sur la colonne '%-.64s' de la table '%-.64s'" - ger "%-.16s Befehl nicht erlaubt für Benutzer '%-.32s'@'%-.64s' und Feld '%-.64s' in Tabelle '%-.64s'" - hun "%-.16s parancs a '%-.32s'@'%-.64s' felhasznalo szamara nem engedelyezett a '%-.64s' mezo eseten a '%-.64s' tablaban" - ita "Comando %-.16s negato per l'utente: '%-.32s'@'%-.64s' sulla colonna '%-.64s' della tabella '%-.64s'" - jpn "¥³¥Þ¥ó¥É %-.16s ¤Ï ¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s'\n ¥«¥é¥à '%-.64s' ¥Æ¡¼¥Ö¥ë '%-.64s' ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" - kor "'%-.16s' ¸í·ÉÀº ´ÙÀ½ »ç¿ëÀÚ¿¡°Ô °ÅºÎµÇ¾ú½À´Ï´Ù. : '%-.32s'@'%-.64s' for Ä®·³ '%-.64s' in Å×À̺í '%-.64s'" - por "Comando '%-.16s' negado para o usuário '%-.32s'@'%-.64s' na coluna '%-.64s', na tabela '%-.64s'" - rum "Comanda %-.16s interzisa utilizatorului: '%-.32s'@'%-.64s' pentru coloana '%-.64s' in tabela '%-.64s'" - rus "ëÏÍÁÎÄÁ %-.16s ÚÁÐÒÅÝÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ '%-.32s'@'%-.64s' ÄÌÑ ÓÔÏÌÂÃÁ '%-.64s' × ÔÁÂÌÉÃÅ '%-.64s'" - serbian "%-.16s komanda zabranjena za korisnika '%-.32s'@'%-.64s' za kolonu '%-.64s' iz tabele '%-.64s'" - spa "%-.16s comando negado para usuario: '%-.32s'@'%-.64s' para columna '%-.64s' en la tabla '%-.64s'" - swe "%-.16s ej tillåtet för '%-.32s'@'%-.64s' för kolumn '%-.64s' i tabell '%-.64s'" - ukr "%-.16s ËÏÍÁÎÄÁ ÚÁÂÏÒÏÎÅÎÁ ËÏÒÉÓÔÕ×ÁÞÕ: '%-.32s'@'%-.64s' ÄÌÑ ÓÔÏ×ÂÃÑ '%-.64s' Õ ÔÁÂÌÉæ '%-.64s'" + cze "%-.16s p-Bøíkaz nepøístupný pro u¾ivatele: '%-.48s'@'%-.64s' pro sloupec '%-.192s' v tabulce '%-.192s'" + dan "%-.16s-kommandoen er ikke tilladt for brugeren '%-.48s'@'%-.64s' for kolonne '%-.192s' in tabellen '%-.192s'" + nla "%-.16s commando geweigerd voor gebruiker: '%-.48s'@'%-.64s' voor kolom '%-.192s' in tabel '%-.192s'" + eng "%-.16s command denied to user '%-.48s'@'%-.64s' for column '%-.192s' in table '%-.192s'" + jps "ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.48s'@'%-.64s'\n ƒJƒ‰ƒ€ '%-.192s' ƒe[ƒuƒ‹ '%-.192s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", + est "%-.16s käsk ei ole lubatud kasutajale '%-.48s'@'%-.64s' tulbale '%-.192s' tabelis '%-.192s'" + fre "La commande '%-.16s' est interdite à l'utilisateur: '%-.48s'@'@%-.64s' sur la colonne '%-.192s' de la table '%-.192s'" + ger "%-.16s Befehl nicht erlaubt für Benutzer '%-.48s'@'%-.64s' und Feld '%-.192s' in Tabelle '%-.192s'" + hun "%-.16s parancs a '%-.48s'@'%-.64s' felhasznalo szamara nem engedelyezett a '%-.192s' mezo eseten a '%-.192s' tablaban" + ita "Comando %-.16s negato per l'utente: '%-.48s'@'%-.64s' sulla colonna '%-.192s' della tabella '%-.192s'" + jpn "¥³¥Þ¥ó¥É %-.16s ¤Ï ¥æ¡¼¥¶¡¼ '%-.48s'@'%-.64s'\n ¥«¥é¥à '%-.192s' ¥Æ¡¼¥Ö¥ë '%-.192s' ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + kor "'%-.16s' ¸í·ÉÀº ´ÙÀ½ »ç¿ëÀÚ¿¡°Ô °ÅºÎµÇ¾ú½À´Ï´Ù. : '%-.48s'@'%-.64s' for Ä®·³ '%-.192s' in Å×À̺í '%-.192s'" + por "Comando '%-.16s' negado para o usuário '%-.48s'@'%-.64s' na coluna '%-.192s', na tabela '%-.192s'" + rum "Comanda %-.16s interzisa utilizatorului: '%-.48s'@'%-.64s' pentru coloana '%-.192s' in tabela '%-.192s'" + rus "ëÏÍÁÎÄÁ %-.16s ÚÁÐÒÅÝÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ '%-.48s'@'%-.64s' ÄÌÑ ÓÔÏÌÂÃÁ '%-.192s' × ÔÁÂÌÉÃÅ '%-.192s'" + serbian "%-.16s komanda zabranjena za korisnika '%-.48s'@'%-.64s' za kolonu '%-.192s' iz tabele '%-.192s'" + spa "%-.16s comando negado para usuario: '%-.48s'@'%-.64s' para columna '%-.192s' en la tabla '%-.192s'" + swe "%-.16s ej tillåtet för '%-.48s'@'%-.64s' för kolumn '%-.192s' i tabell '%-.192s'" + ukr "%-.16s ËÏÍÁÎÄÁ ÚÁÂÏÒÏÎÅÎÁ ËÏÒÉÓÔÕ×ÁÞÕ: '%-.48s'@'%-.64s' ÄÌÑ ÓÔÏ×ÂÃÑ '%-.192s' Õ ÔÁÂÌÉæ '%-.192s'" ER_ILLEGAL_GRANT_FOR_TABLE 42000 cze "Neplatn-Bý pøíkaz GRANT/REVOKE. Prosím, pøeètìte si v manuálu, jaká privilegia je mo¾né pou¾ít." dan "Forkert GRANT/REVOKE kommando. Se i brugervejledningen hvilke privilegier der kan specificeres." @@ -3368,46 +3368,46 @@ ER_GRANT_WRONG_HOST_OR_USER 42000 swe "Felaktigt maskinnamn eller användarnamn använt med GRANT" ukr "áÒÇÕÍÅÎÔ host ÁÂÏ user ÄÌÑ GRANT ÚÁÄÏ×ÇÉÊ" ER_NO_SUCH_TABLE 42S02 - cze "Tabulka '%-.64s.%-.64s' neexistuje" - dan "Tabellen '%-.64s.%-.64s' eksisterer ikke" - nla "Tabel '%-.64s.%-.64s' bestaat niet" - eng "Table '%-.64s.%-.64s' doesn't exist" - est "Tabelit '%-.64s.%-.64s' ei eksisteeri" - fre "La table '%-.64s.%-.64s' n'existe pas" - ger "Tabelle '%-.64s.%-.64s' existiert nicht" - hun "A '%-.64s.%-.64s' tabla nem letezik" - ita "La tabella '%-.64s.%-.64s' non esiste" - jpn "Table '%-.64s.%-.64s' doesn't exist" - kor "Å×À̺í '%-.64s.%-.64s' ´Â Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù." - nor "Table '%-.64s.%-.64s' doesn't exist" - norwegian-ny "Table '%-.64s.%-.64s' doesn't exist" - pol "Table '%-.64s.%-.64s' doesn't exist" - por "Tabela '%-.64s.%-.64s' não existe" - rum "Tabela '%-.64s.%-.64s' nu exista" - rus "ôÁÂÌÉÃÁ '%-.64s.%-.64s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ" - serbian "Tabela '%-.64s.%-.64s' ne postoji" - slo "Table '%-.64s.%-.64s' doesn't exist" - spa "Tabla '%-.64s.%-.64s' no existe" - swe "Det finns ingen tabell som heter '%-.64s.%-.64s'" - ukr "ôÁÂÌÉÃÑ '%-.64s.%-.64s' ÎÅ ¦ÓÎÕ¤" + cze "Tabulka '%-.192s.%-.192s' neexistuje" + dan "Tabellen '%-.192s.%-.192s' eksisterer ikke" + nla "Tabel '%-.192s.%-.192s' bestaat niet" + eng "Table '%-.192s.%-.192s' doesn't exist" + est "Tabelit '%-.192s.%-.192s' ei eksisteeri" + fre "La table '%-.192s.%-.192s' n'existe pas" + ger "Tabelle '%-.192s.%-.192s' existiert nicht" + hun "A '%-.192s.%-.192s' tabla nem letezik" + ita "La tabella '%-.192s.%-.192s' non esiste" + jpn "Table '%-.192s.%-.192s' doesn't exist" + kor "Å×À̺í '%-.192s.%-.192s' ´Â Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù." + nor "Table '%-.192s.%-.192s' doesn't exist" + norwegian-ny "Table '%-.192s.%-.192s' doesn't exist" + pol "Table '%-.192s.%-.192s' doesn't exist" + por "Tabela '%-.192s.%-.192s' não existe" + rum "Tabela '%-.192s.%-.192s' nu exista" + rus "ôÁÂÌÉÃÁ '%-.192s.%-.192s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ" + serbian "Tabela '%-.192s.%-.192s' ne postoji" + slo "Table '%-.192s.%-.192s' doesn't exist" + spa "Tabla '%-.192s.%-.192s' no existe" + swe "Det finns ingen tabell som heter '%-.192s.%-.192s'" + ukr "ôÁÂÌÉÃÑ '%-.192s.%-.192s' ÎÅ ¦ÓÎÕ¤" ER_NONEXISTING_TABLE_GRANT 42000 - cze "Neexistuje odpov-Bídající grant pro u¾ivatele '%-.32s' na stroji '%-.64s' pro tabulku '%-.64s'" - dan "Denne tilladelse eksisterer ikke for brugeren '%-.32s' på vært '%-.64s' for tabellen '%-.64s'" - nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.32s' op host '%-.64s' op tabel '%-.64s'" - eng "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'" - est "Sellist õigust ei ole defineeritud kasutajale '%-.32s' masinast '%-.64s' tabelile '%-.64s'" - fre "Un tel droit n'est pas défini pour l'utilisateur '%-.32s' sur l'hôte '%-.64s' sur la table '%-.64s'" - ger "Eine solche Berechtigung ist für User '%-.32s' auf Host '%-.64s' an Tabelle '%-.64s' nicht definiert" - hun "A '%-.32s' felhasznalo szamara a '%-.64s' host '%-.64s' tablajaban ez a parancs nem engedelyezett" - ita "GRANT non definita per l'utente '%-.32s' dalla macchina '%-.64s' sulla tabella '%-.64s'" - kor "»ç¿ëÀÚ '%-.32s'(È£½ºÆ® '%-.64s')´Â Å×À̺í '%-.64s'¸¦ »ç¿ëÇϱâ À§ÇÏ¿© Á¤ÀÇµÈ ½ÂÀÎÀº ¾ø½À´Ï´Ù. " - por "Não existe tal permissão (grant) definido para o usuário '%-.32s' no 'host' '%-.64s', na tabela '%-.64s'" - rum "Nu exista un astfel de privilegiu (grant) definit pentru utilizatorul '%-.32s' de pe host-ul '%-.64s' pentru tabela '%-.64s'" - rus "ôÁËÉÅ ÐÒÁ×Á ÎÅ ÏÐÒÅÄÅÌÅÎÙ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' ÎÁ ËÏÍÐØÀÔÅÒÅ '%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'" - serbian "Ne postoji odobrenje za pristup korisniku '%-.32s' na host-u '%-.64s' tabeli '%-.64s'" - spa "No existe tal permiso definido para usuario '%-.32s' en el servidor '%-.64s' en la tabla '%-.64s'" - swe "Det finns inget privilegium definierat för användare '%-.32s' på '%-.64s' för tabell '%-.64s'" - ukr "ðÏ×ÎÏ×ÁÖÅÎØ ÎÅ ×ÉÚÎÁÞÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ '%-.32s' Ú ÈÏÓÔÕ '%-.64s' ÄÌÑ ÔÁÂÌÉæ '%-.64s'" + cze "Neexistuje odpov-Bídající grant pro u¾ivatele '%-.48s' na stroji '%-.64s' pro tabulku '%-.192s'" + dan "Denne tilladelse eksisterer ikke for brugeren '%-.48s' på vært '%-.64s' for tabellen '%-.192s'" + nla "Deze toegang (GRANT) is niet toegekend voor gebruiker '%-.48s' op host '%-.64s' op tabel '%-.192s'" + eng "There is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'" + est "Sellist õigust ei ole defineeritud kasutajale '%-.48s' masinast '%-.64s' tabelile '%-.192s'" + fre "Un tel droit n'est pas défini pour l'utilisateur '%-.48s' sur l'hôte '%-.64s' sur la table '%-.192s'" + ger "Eine solche Berechtigung ist für User '%-.48s' auf Host '%-.64s' an Tabelle '%-.192s' nicht definiert" + hun "A '%-.48s' felhasznalo szamara a '%-.64s' host '%-.192s' tablajaban ez a parancs nem engedelyezett" + ita "GRANT non definita per l'utente '%-.48s' dalla macchina '%-.64s' sulla tabella '%-.192s'" + kor "»ç¿ëÀÚ '%-.48s'(È£½ºÆ® '%-.64s')´Â Å×À̺í '%-.192s'¸¦ »ç¿ëÇϱâ À§ÇÏ¿© Á¤ÀÇµÈ ½ÂÀÎÀº ¾ø½À´Ï´Ù. " + por "Não existe tal permissão (grant) definido para o usuário '%-.48s' no 'host' '%-.64s', na tabela '%-.192s'" + rum "Nu exista un astfel de privilegiu (grant) definit pentru utilizatorul '%-.48s' de pe host-ul '%-.64s' pentru tabela '%-.192s'" + rus "ôÁËÉÅ ÐÒÁ×Á ÎÅ ÏÐÒÅÄÅÌÅÎÙ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.48s' ÎÁ ËÏÍÐØÀÔÅÒÅ '%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.192s'" + serbian "Ne postoji odobrenje za pristup korisniku '%-.48s' na host-u '%-.64s' tabeli '%-.192s'" + spa "No existe tal permiso definido para usuario '%-.48s' en el servidor '%-.64s' en la tabla '%-.192s'" + swe "Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s' för tabell '%-.192s'" + ukr "ðÏ×ÎÏ×ÁÖÅÎØ ÎÅ ×ÉÚÎÁÞÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ '%-.48s' Ú ÈÏÓÔÕ '%-.64s' ÄÌÑ ÔÁÂÌÉæ '%-.192s'" ER_NOT_ALLOWED_COMMAND 42000 cze "Pou-B¾itý pøíkaz není v této verzi MySQL povolen" dan "Den brugte kommando er ikke tilladt med denne udgave af MySQL" @@ -3451,23 +3451,23 @@ ER_SYNTAX_ERROR 42000 swe "Du har något fel i din syntax" ukr "õ ×ÁÓ ÐÏÍÉÌËÁ Õ ÓÉÎÔÁËÓÉÓ¦ SQL" ER_DELAYED_CANT_CHANGE_LOCK - cze "Zpo-B¾dìný insert threadu nebyl schopen získat po¾adovaný zámek pro tabulku %-.64s" - dan "Forsinket indsættelse tråden (delayed insert thread) kunne ikke opnå lås på tabellen %-.64s" - nla "'Delayed insert' thread kon de aangevraagde 'lock' niet krijgen voor tabel %-.64s" - eng "Delayed insert thread couldn't get requested lock for table %-.64s" - est "INSERT DELAYED lõim ei suutnud saada soovitud lukku tabelile %-.64s" - fre "La tâche 'delayed insert' n'a pas pu obtenir le verrou démandé sur la table %-.64s" - ger "Verzögerter (DELAYED) Einfüge-Thread konnte die angeforderte Sperre für Tabelle '%-.64s' nicht erhalten" - hun "A kesleltetett beillesztes (delayed insert) thread nem kapott zatolast a %-.64s tablahoz" - ita "Il thread di inserimento ritardato non riesce ad ottenere il lock per la tabella %-.64s" - kor "Áö¿¬µÈ insert ¾²·¹µå°¡ Å×À̺í %-.64sÀÇ ¿ä±¸µÈ ¶ôÅ·À» ó¸®ÇÒ ¼ö ¾ø¾ú½À´Ï´Ù." - por "'Thread' de inserção retardada (atrasada) pois não conseguiu obter a trava solicitada para tabela '%-.64s'" - rum "Thread-ul pentru inserarea aminata nu a putut obtine lacatul (lock) pentru tabela %-.64s" - rus "ðÏÔÏË, ÏÂÓÌÕÖÉ×ÁÀÝÉÊ ÏÔÌÏÖÅÎÎÕÀ ×ÓÔÁ×ËÕ (delayed insert), ÎÅ ÓÍÏÇ ÐÏÌÕÞÉÔØ ÚÁÐÒÁÛÉ×ÁÅÍÕÀ ÂÌÏËÉÒÏ×ËÕ ÎÁ ÔÁÂÌÉÃÕ %-.64s" - serbian "Prolongirani 'INSERT' thread nije mogao da dobije traženo zakljuèavanje tabele '%-.64s'" - spa "Thread de inserción retarda no pudiendo bloquear para la tabla %-.64s" - swe "DELAYED INSERT-tråden kunde inte låsa tabell '%-.64s'" - ukr "ç¦ÌËÁ ÄÌÑ INSERT DELAYED ÎÅ ÍÏÖÅ ÏÔÒÉÍÁÔÉ ÂÌÏËÕ×ÁÎÎÑ ÄÌÑ ÔÁÂÌÉæ %-.64s" + cze "Zpo-B¾dìný insert threadu nebyl schopen získat po¾adovaný zámek pro tabulku %-.192s" + dan "Forsinket indsættelse tråden (delayed insert thread) kunne ikke opnå lås på tabellen %-.192s" + nla "'Delayed insert' thread kon de aangevraagde 'lock' niet krijgen voor tabel %-.192s" + eng "Delayed insert thread couldn't get requested lock for table %-.192s" + est "INSERT DELAYED lõim ei suutnud saada soovitud lukku tabelile %-.192s" + fre "La tâche 'delayed insert' n'a pas pu obtenir le verrou démandé sur la table %-.192s" + ger "Verzögerter (DELAYED) Einfüge-Thread konnte die angeforderte Sperre für Tabelle '%-.192s' nicht erhalten" + hun "A kesleltetett beillesztes (delayed insert) thread nem kapott zatolast a %-.192s tablahoz" + ita "Il thread di inserimento ritardato non riesce ad ottenere il lock per la tabella %-.192s" + kor "Áö¿¬µÈ insert ¾²·¹µå°¡ Å×À̺í %-.192sÀÇ ¿ä±¸µÈ ¶ôÅ·À» ó¸®ÇÒ ¼ö ¾ø¾ú½À´Ï´Ù." + por "'Thread' de inserção retardada (atrasada) pois não conseguiu obter a trava solicitada para tabela '%-.192s'" + rum "Thread-ul pentru inserarea aminata nu a putut obtine lacatul (lock) pentru tabela %-.192s" + rus "ðÏÔÏË, ÏÂÓÌÕÖÉ×ÁÀÝÉÊ ÏÔÌÏÖÅÎÎÕÀ ×ÓÔÁ×ËÕ (delayed insert), ÎÅ ÓÍÏÇ ÐÏÌÕÞÉÔØ ÚÁÐÒÁÛÉ×ÁÅÍÕÀ ÂÌÏËÉÒÏ×ËÕ ÎÁ ÔÁÂÌÉÃÕ %-.192s" + serbian "Prolongirani 'INSERT' thread nije mogao da dobije traženo zakljuèavanje tabele '%-.192s'" + spa "Thread de inserción retarda no pudiendo bloquear para la tabla %-.192s" + swe "DELAYED INSERT-tråden kunde inte låsa tabell '%-.192s'" + ukr "ç¦ÌËÁ ÄÌÑ INSERT DELAYED ÎÅ ÍÏÖÅ ÏÔÒÉÍÁÔÉ ÂÌÏËÕ×ÁÎÎÑ ÄÌÑ ÔÁÂÌÉæ %-.192s" ER_TOO_MANY_DELAYED_THREADS cze "P-Bøíli¹ mnoho zpo¾dìných threadù" dan "For mange slettede tråde (threads) i brug" @@ -3487,28 +3487,28 @@ ER_TOO_MANY_DELAYED_THREADS swe "Det finns redan 'max_delayed_threads' trådar i använding" ukr "úÁÂÁÇÁÔÏ ÚÁÔÒÉÍÁÎÉÈ Ç¦ÌÏË ×ÉËÏÒÉÓÔÏ×Õ¤ÔØÓÑ" ER_ABORTING_CONNECTION 08S01 - cze "Zru-B¹eno spojení %ld do databáze: '%-.64s' u¾ivatel: '%-.32s' (%-.64s)" - dan "Afbrudt forbindelse %ld til database: '%-.64s' bruger: '%-.32s' (%-.64s)" - nla "Afgebroken verbinding %ld naar db: '%-.64s' gebruiker: '%-.32s' (%-.64s)" - eng "Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)" - est "Ühendus katkestatud %ld andmebaasile: '%-.64s' kasutajale: '%-.32s' (%-.64s)" - fre "Connection %ld avortée vers la bd: '%-.64s' utilisateur: '%-.32s' (%-.64s)" - ger "Abbruch der Verbindung %ld zur Datenbank '%-.64s'. Benutzer: '%-.32s' (%-.64s)" - hun "Megszakitott kapcsolat %ld db: '%-.64s' adatbazishoz, felhasznalo: '%-.32s' (%-.64s)" - ita "Interrotta la connessione %ld al db: '%-.64s' utente: '%-.32s' (%-.64s)" - jpn "Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)" - kor "µ¥ÀÌŸº£À̽º Á¢¼ÓÀ» À§ÇÑ ¿¬°á %ld°¡ Áß´ÜµÊ : '%-.64s' »ç¿ëÀÚ: '%-.32s' (%-.64s)" - nor "Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)" - norwegian-ny "Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)" - pol "Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)" - por "Conexão %ld abortou para o banco de dados '%-.64s' - usuário '%-.32s' (%-.64s)" - rum "Conectie terminata %ld la baza de date: '%-.64s' utilizator: '%-.32s' (%-.64s)" - rus "ðÒÅÒ×ÁÎÏ ÓÏÅÄÉÎÅÎÉÅ %ld Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.64s' ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' (%-.64s)" - serbian "Prekinuta konekcija broj %ld ka bazi: '%-.64s' korisnik je bio: '%-.32s' (%-.64s)" - slo "Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)" - spa "Conexión abortada %ld para db: '%-.64s' usuario: '%-.32s' (%-.64s)" - swe "Avbröt länken för tråd %ld till db '%-.64s', användare '%-.32s' (%-.64s)" - ukr "ðÅÒÅÒ×ÁÎÏ Ú'¤ÄÎÁÎÎÑ %ld ÄÏ ÂÁÚÉ ÄÁÎÎÉÈ: '%-.64s' ËÏÒÉÓÔÕ×ÁÞÁ: '%-.32s' (%-.64s)" + cze "Zru-B¹eno spojení %ld do databáze: '%-.192s' u¾ivatel: '%-.48s' (%-.64s)" + dan "Afbrudt forbindelse %ld til database: '%-.192s' bruger: '%-.48s' (%-.64s)" + nla "Afgebroken verbinding %ld naar db: '%-.192s' gebruiker: '%-.48s' (%-.64s)" + eng "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)" + est "Ühendus katkestatud %ld andmebaasile: '%-.192s' kasutajale: '%-.48s' (%-.64s)" + fre "Connection %ld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' (%-.64s)" + ger "Abbruch der Verbindung %ld zur Datenbank '%-.192s'. Benutzer: '%-.48s' (%-.64s)" + hun "Megszakitott kapcsolat %ld db: '%-.192s' adatbazishoz, felhasznalo: '%-.48s' (%-.64s)" + ita "Interrotta la connessione %ld al db: '%-.192s' utente: '%-.48s' (%-.64s)" + jpn "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)" + kor "µ¥ÀÌŸº£À̽º Á¢¼ÓÀ» À§ÇÑ ¿¬°á %ld°¡ Áß´ÜµÊ : '%-.192s' »ç¿ëÀÚ: '%-.48s' (%-.64s)" + nor "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)" + norwegian-ny "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)" + pol "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)" + por "Conexão %ld abortou para o banco de dados '%-.192s' - usuário '%-.48s' (%-.64s)" + rum "Conectie terminata %ld la baza de date: '%-.192s' utilizator: '%-.48s' (%-.64s)" + rus "ðÒÅÒ×ÁÎÏ ÓÏÅÄÉÎÅÎÉÅ %ld Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.192s' ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.48s' (%-.64s)" + serbian "Prekinuta konekcija broj %ld ka bazi: '%-.192s' korisnik je bio: '%-.48s' (%-.64s)" + slo "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)" + spa "Conexión abortada %ld para db: '%-.192s' usuario: '%-.48s' (%-.64s)" + swe "Avbröt länken för tråd %ld till db '%-.192s', användare '%-.48s' (%-.64s)" + ukr "ðÅÒÅÒ×ÁÎÏ Ú'¤ÄÎÁÎÎÑ %ld ÄÏ ÂÁÚÉ ÄÁÎÎÉÈ: '%-.192s' ËÏÒÉÓÔÕ×ÁÞÁ: '%-.48s' (%-.64s)" ER_NET_PACKET_TOO_LARGE 08S01 cze "Zji-B¹tìn pøíchozí packet del¹í ne¾ 'max_allowed_packet'" dan "Modtog en datapakke som var større end 'max_allowed_packet'" @@ -3723,29 +3723,29 @@ ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 42000 swe "Den använda tabelltypen kan inte hantera AUTO_INCREMENT-kolumner" ukr "÷ÉËÏÒÉÓÔÁÎÉÊ ÔÉÐ ÔÁÂÌÉæ ΊЦÄÔÒÉÍÕ¤ AUTO_INCREMENT ÓÔÏ×Âæ" ER_DELAYED_INSERT_TABLE_LOCKED - cze "INSERT DELAYED nen-Bí mo¾no s tabulkou '%-.64s' pou¾ít, proto¾e je zamèená pomocí LOCK TABLES" - dan "INSERT DELAYED kan ikke bruges med tabellen '%-.64s', fordi tabellen er låst med LOCK TABLES" - nla "INSERT DELAYED kan niet worden gebruikt bij table '%-.64s', vanwege een 'lock met LOCK TABLES" - eng "INSERT DELAYED can't be used with table '%-.64s' because it is locked with LOCK TABLES" - est "INSERT DELAYED ei saa kasutada tabeli '%-.64s' peal, kuna see on lukustatud LOCK TABLES käsuga" - fre "INSERT DELAYED ne peut être utilisé avec la table '%-.64s', car elle est verrouée avec LOCK TABLES" - ger "INSERT DELAYED kann für Tabelle '%-.64s' nicht verwendet werden, da sie mit LOCK TABLES gesperrt ist" - greek "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES" - hun "Az INSERT DELAYED nem hasznalhato a '%-.64s' tablahoz, mert a tabla zarolt (LOCK TABLES)" - ita "L'inserimento ritardato (INSERT DELAYED) non puo` essere usato con la tabella '%-.64s', perche` soggetta a lock da 'LOCK TABLES'" - jpn "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES" - kor "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES" - nor "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES" - norwegian-ny "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES" - pol "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES" - por "INSERT DELAYED não pode ser usado com a tabela '%-.64s', porque ela está travada com LOCK TABLES" - rum "INSERT DELAYED nu poate fi folosit cu tabela '%-.64s', deoarece este locked folosing LOCK TABLES" - rus "îÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ INSERT DELAYED ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s', ÐÏÔÏÍÕ ÞÔÏ ÏÎÁ ÚÁÂÌÏËÉÒÏ×ÁÎÁ Ó ÐÏÍÏÝØÀ LOCK TABLES" - serbian "Komanda 'INSERT DELAYED' ne može biti iskorištena u tabeli '%-.64s', zbog toga što je zakljuèana komandom 'LOCK TABLES'" - slo "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES" - spa "INSERT DELAYED no puede ser usado con tablas '%-.64s', porque esta bloqueada con LOCK TABLES" - swe "INSERT DELAYED kan inte användas med tabell '%-.64s', emedan den är låst med LOCK TABLES" - ukr "INSERT DELAYED ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÏ Ú ÔÁÂÌÉÃÅÀ '%-.64s', ÔÏÍÕ ÝÏ §§ ÚÁÂÌÏËÏ×ÁÎÏ Ú LOCK TABLES" + cze "INSERT DELAYED nen-Bí mo¾no s tabulkou '%-.192s' pou¾ít, proto¾e je zamèená pomocí LOCK TABLES" + dan "INSERT DELAYED kan ikke bruges med tabellen '%-.192s', fordi tabellen er låst med LOCK TABLES" + nla "INSERT DELAYED kan niet worden gebruikt bij table '%-.192s', vanwege een 'lock met LOCK TABLES" + eng "INSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLES" + est "INSERT DELAYED ei saa kasutada tabeli '%-.192s' peal, kuna see on lukustatud LOCK TABLES käsuga" + fre "INSERT DELAYED ne peut être utilisé avec la table '%-.192s', car elle est verrouée avec LOCK TABLES" + ger "INSERT DELAYED kann für Tabelle '%-.192s' nicht verwendet werden, da sie mit LOCK TABLES gesperrt ist" + greek "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES" + hun "Az INSERT DELAYED nem hasznalhato a '%-.192s' tablahoz, mert a tabla zarolt (LOCK TABLES)" + ita "L'inserimento ritardato (INSERT DELAYED) non puo` essere usato con la tabella '%-.192s', perche` soggetta a lock da 'LOCK TABLES'" + jpn "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES" + kor "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES" + nor "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES" + norwegian-ny "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES" + pol "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES" + por "INSERT DELAYED não pode ser usado com a tabela '%-.192s', porque ela está travada com LOCK TABLES" + rum "INSERT DELAYED nu poate fi folosit cu tabela '%-.192s', deoarece este locked folosing LOCK TABLES" + rus "îÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ INSERT DELAYED ÄÌÑ ÔÁÂÌÉÃÙ '%-.192s', ÐÏÔÏÍÕ ÞÔÏ ÏÎÁ ÚÁÂÌÏËÉÒÏ×ÁÎÁ Ó ÐÏÍÏÝØÀ LOCK TABLES" + serbian "Komanda 'INSERT DELAYED' ne može biti iskorištena u tabeli '%-.192s', zbog toga što je zakljuèana komandom 'LOCK TABLES'" + slo "INSERT DELAYED can't be used with table '%-.192s', because it is locked with LOCK TABLES" + spa "INSERT DELAYED no puede ser usado con tablas '%-.192s', porque esta bloqueada con LOCK TABLES" + swe "INSERT DELAYED kan inte användas med tabell '%-.192s', emedan den är låst med LOCK TABLES" + ukr "INSERT DELAYED ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÏ Ú ÔÁÂÌÉÃÅÀ '%-.192s', ÔÏÍÕ ÝÏ §§ ÚÁÂÌÏËÏ×ÁÎÏ Ú LOCK TABLES" ER_WRONG_COLUMN_NAME 42000 cze "Nespr-Bávné jméno sloupce '%-.100s'" dan "Forkert kolonnenavn '%-.100s'" @@ -3764,29 +3764,29 @@ ER_WRONG_COLUMN_NAME 42000 swe "Felaktigt kolumnnamn '%-.100s'" ukr "îÅצÒÎÅ ¦Í'Ñ ÓÔÏ×ÂÃÑ '%-.100s'" ER_WRONG_KEY_COLUMN 42000 - cze "Handler pou-B¾ité tabulky neumí indexovat sloupce '%-.64s'" - dan "Den brugte tabeltype kan ikke indeksere kolonnen '%-.64s'" - nla "De gebruikte tabel 'handler' kan kolom '%-.64s' niet indexeren" - eng "The used storage engine can't index column '%-.64s'" - est "Tabelihandler ei oska indekseerida tulpa '%-.64s'" - fre "Le handler de la table ne peut indexé la colonne '%-.64s'" - ger "Die verwendete Speicher-Engine kann die Spalte '%-.64s' nicht indizieren" - greek "The used table handler can't index column '%-.64s'" - hun "A hasznalt tablakezelo nem tudja a '%-.64s' mezot indexelni" - ita "Il gestore delle tabelle non puo` indicizzare la colonna '%-.64s'" - jpn "The used table handler can't index column '%-.64s'" - kor "The used table handler can't index column '%-.64s'" - nor "The used table handler can't index column '%-.64s'" - norwegian-ny "The used table handler can't index column '%-.64s'" - pol "The used table handler can't index column '%-.64s'" - por "O manipulador de tabela usado não pode indexar a coluna '%-.64s'" - rum "Handler-ul tabelei folosite nu poate indexa coloana '%-.64s'" - rus "éÓÐÏÌØÚÏ×ÁÎÎÙÊ ÏÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ ÎÅ ÍÏÖÅÔ ÐÒÏÉÎÄÅËÓÉÒÏ×ÁÔØ ÓÔÏÌÂÅà '%-.64s'" - serbian "Handler tabele ne može da indeksira kolonu '%-.64s'" - slo "The used table handler can't index column '%-.64s'" - spa "El manipulador de tabla usado no puede indexar columna '%-.64s'" - swe "Den använda tabelltypen kan inte indexera kolumn '%-.64s'" - ukr "÷ÉËÏÒÉÓÔÁÎÉÊ ×ËÁÚ¦×ÎÉË ÔÁÂÌÉæ ÎÅ ÍÏÖÅ ¦ÎÄÅËÓÕ×ÁÔÉ ÓÔÏ×ÂÅÃØ '%-.64s'" + cze "Handler pou-B¾ité tabulky neumí indexovat sloupce '%-.192s'" + dan "Den brugte tabeltype kan ikke indeksere kolonnen '%-.192s'" + nla "De gebruikte tabel 'handler' kan kolom '%-.192s' niet indexeren" + eng "The used storage engine can't index column '%-.192s'" + est "Tabelihandler ei oska indekseerida tulpa '%-.192s'" + fre "Le handler de la table ne peut indexé la colonne '%-.192s'" + ger "Die verwendete Speicher-Engine kann die Spalte '%-.192s' nicht indizieren" + greek "The used table handler can't index column '%-.192s'" + hun "A hasznalt tablakezelo nem tudja a '%-.192s' mezot indexelni" + ita "Il gestore delle tabelle non puo` indicizzare la colonna '%-.192s'" + jpn "The used table handler can't index column '%-.192s'" + kor "The used table handler can't index column '%-.192s'" + nor "The used table handler can't index column '%-.192s'" + norwegian-ny "The used table handler can't index column '%-.192s'" + pol "The used table handler can't index column '%-.192s'" + por "O manipulador de tabela usado não pode indexar a coluna '%-.192s'" + rum "Handler-ul tabelei folosite nu poate indexa coloana '%-.192s'" + rus "éÓÐÏÌØÚÏ×ÁÎÎÙÊ ÏÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ ÎÅ ÍÏÖÅÔ ÐÒÏÉÎÄÅËÓÉÒÏ×ÁÔØ ÓÔÏÌÂÅà '%-.192s'" + serbian "Handler tabele ne može da indeksira kolonu '%-.192s'" + slo "The used table handler can't index column '%-.192s'" + spa "El manipulador de tabla usado no puede indexar columna '%-.192s'" + swe "Den använda tabelltypen kan inte indexera kolumn '%-.192s'" + ukr "÷ÉËÏÒÉÓÔÁÎÉÊ ×ËÁÚ¦×ÎÉË ÔÁÂÌÉæ ÎÅ ÍÏÖÅ ¦ÎÄÅËÓÕ×ÁÔÉ ÓÔÏ×ÂÅÃØ '%-.192s'" ER_WRONG_MRG_TABLE cze "V-B¹echny tabulky v MERGE tabulce nejsou definovány stejnì" dan "Tabellerne i MERGE er ikke defineret ens" @@ -3811,46 +3811,46 @@ ER_WRONG_MRG_TABLE swe "Tabellerna i MERGE-tabellen är inte identiskt definierade" ukr "ôÁÂÌÉæ Õ MERGE TABLE ÍÁÀÔØ Ò¦ÚÎÕ ÓÔÒÕËÔÕÒÕ" ER_DUP_UNIQUE 23000 - cze "Kv-Bùli unique constraintu nemozu zapsat do tabulky '%-.64s'" - dan "Kan ikke skrive til tabellen '%-.64s' fordi det vil bryde CONSTRAINT regler" - nla "Kan niet opslaan naar table '%-.64s' vanwege 'unique' beperking" - eng "Can't write, because of unique constraint, to table '%-.64s'" - est "Ei suuda kirjutada tabelisse '%-.64s', kuna see rikub ühesuse kitsendust" - fre "Écriture impossible à cause d'un index UNIQUE sur la table '%-.64s'" - ger "Schreiben in Tabelle '%-.64s' nicht möglich wegen einer Eindeutigkeitsbeschränkung (unique constraint)" - hun "A '%-.64s' nem irhato, az egyedi mezok miatt" - ita "Impossibile scrivere nella tabella '%-.64s' per limitazione di unicita`" - por "Não pode gravar, devido à restrição UNIQUE, na tabela '%-.64s'" - rum "Nu pot scrie pe hard-drive, din cauza constraintului unic (unique constraint) pentru tabela '%-.64s'" - rus "îÅ×ÏÚÍÏÖÎÏ ÚÁÐÉÓÁÔØ × ÔÁÂÌÉÃÕ '%-.64s' ÉÚ-ÚÁ ÏÇÒÁÎÉÞÅÎÉÊ ÕÎÉËÁÌØÎÏÇÏ ËÌÀÞÁ" - serbian "Zbog provere jedinstvenosti ne mogu da upišem podatke u tabelu '%-.64s'" - spa "No puedo escribir, debido al único constraint, para tabla '%-.64s'" - swe "Kan inte skriva till tabell '%-.64s'; UNIQUE-test" - ukr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ ÄÏ ÔÁÂÌÉæ '%-.64s', Ú ÐÒÉÞÉÎÉ ×ÉÍÏÇ ÕΦËÁÌØÎÏÓÔ¦" + cze "Kv-Bùli unique constraintu nemozu zapsat do tabulky '%-.192s'" + dan "Kan ikke skrive til tabellen '%-.192s' fordi det vil bryde CONSTRAINT regler" + nla "Kan niet opslaan naar table '%-.192s' vanwege 'unique' beperking" + eng "Can't write, because of unique constraint, to table '%-.192s'" + est "Ei suuda kirjutada tabelisse '%-.192s', kuna see rikub ühesuse kitsendust" + fre "Écriture impossible à cause d'un index UNIQUE sur la table '%-.192s'" + ger "Schreiben in Tabelle '%-.192s' nicht möglich wegen einer Eindeutigkeitsbeschränkung (unique constraint)" + hun "A '%-.192s' nem irhato, az egyedi mezok miatt" + ita "Impossibile scrivere nella tabella '%-.192s' per limitazione di unicita`" + por "Não pode gravar, devido à restrição UNIQUE, na tabela '%-.192s'" + rum "Nu pot scrie pe hard-drive, din cauza constraintului unic (unique constraint) pentru tabela '%-.192s'" + rus "îÅ×ÏÚÍÏÖÎÏ ÚÁÐÉÓÁÔØ × ÔÁÂÌÉÃÕ '%-.192s' ÉÚ-ÚÁ ÏÇÒÁÎÉÞÅÎÉÊ ÕÎÉËÁÌØÎÏÇÏ ËÌÀÞÁ" + serbian "Zbog provere jedinstvenosti ne mogu da upišem podatke u tabelu '%-.192s'" + spa "No puedo escribir, debido al único constraint, para tabla '%-.192s'" + swe "Kan inte skriva till tabell '%-.192s'; UNIQUE-test" + ukr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ ÄÏ ÔÁÂÌÉæ '%-.192s', Ú ÐÒÉÞÉÎÉ ×ÉÍÏÇ ÕΦËÁÌØÎÏÓÔ¦" ER_BLOB_KEY_WITHOUT_LENGTH 42000 - cze "BLOB sloupec '%-.64s' je pou-B¾it ve specifikaci klíèe bez délky" - dan "BLOB kolonnen '%-.64s' brugt i nøglespecifikation uden nøglelængde" - nla "BLOB kolom '%-.64s' gebruikt in zoeksleutel specificatie zonder zoeksleutel lengte" - eng "BLOB/TEXT column '%-.64s' used in key specification without a key length" - est "BLOB-tüüpi tulp '%-.64s' on kasutusel võtmes ilma pikkust määratlemata" - fre "La colonne '%-.64s' de type BLOB est utilisée dans une définition d'index sans longueur d'index" - ger "BLOB- oder TEXT-Spalte '%-.64s' wird in der Schlüsseldefinition ohne Schlüssellängenangabe verwendet" - greek "BLOB column '%-.64s' used in key specification without a key length" - hun "BLOB mezo '%-.64s' hasznalt a mezo specifikacioban, a mezohossz megadasa nelkul" - ita "La colonna '%-.64s' di tipo BLOB e` usata in una chiave senza specificarne la lunghezza" - jpn "BLOB column '%-.64s' used in key specification without a key length" - kor "BLOB column '%-.64s' used in key specification without a key length" - nor "BLOB column '%-.64s' used in key specification without a key length" - norwegian-ny "BLOB column '%-.64s' used in key specification without a key length" - pol "BLOB column '%-.64s' used in key specification without a key length" - por "Coluna BLOB '%-.64s' usada na especificação de chave sem o comprimento da chave" - rum "Coloana BLOB '%-.64s' este folosita in specificarea unei chei fara ca o lungime de cheie sa fie folosita" - rus "óÔÏÌÂÅà ÔÉÐÁ BLOB '%-.64s' ÂÙÌ ÕËÁÚÁÎ × ÏÐÒÅÄÅÌÅÎÉÉ ËÌÀÞÁ ÂÅÚ ÕËÁÚÁÎÉÑ ÄÌÉÎÙ ËÌÀÞÁ" - serbian "BLOB kolona '%-.64s' je upotrebljena u specifikaciji kljuèa bez navoðenja dužine kljuèa" - slo "BLOB column '%-.64s' used in key specification without a key length" - spa "Columna BLOB column '%-.64s' usada en especificación de clave sin tamaño de la clave" - swe "Du har inte angett någon nyckellängd för BLOB '%-.64s'" - ukr "óÔÏ×ÂÅÃØ BLOB '%-.64s' ×ÉËÏÒÉÓÔÁÎÏ Õ ×ÉÚÎÁÞÅÎΦ ËÌÀÞÁ ÂÅÚ ×ËÁÚÁÎÎÑ ÄÏ×ÖÉÎÉ ËÌÀÞÁ" + cze "BLOB sloupec '%-.192s' je pou-B¾it ve specifikaci klíèe bez délky" + dan "BLOB kolonnen '%-.192s' brugt i nøglespecifikation uden nøglelængde" + nla "BLOB kolom '%-.192s' gebruikt in zoeksleutel specificatie zonder zoeksleutel lengte" + eng "BLOB/TEXT column '%-.192s' used in key specification without a key length" + est "BLOB-tüüpi tulp '%-.192s' on kasutusel võtmes ilma pikkust määratlemata" + fre "La colonne '%-.192s' de type BLOB est utilisée dans une définition d'index sans longueur d'index" + ger "BLOB- oder TEXT-Spalte '%-.192s' wird in der Schlüsseldefinition ohne Schlüssellängenangabe verwendet" + greek "BLOB column '%-.192s' used in key specification without a key length" + hun "BLOB mezo '%-.192s' hasznalt a mezo specifikacioban, a mezohossz megadasa nelkul" + ita "La colonna '%-.192s' di tipo BLOB e` usata in una chiave senza specificarne la lunghezza" + jpn "BLOB column '%-.192s' used in key specification without a key length" + kor "BLOB column '%-.192s' used in key specification without a key length" + nor "BLOB column '%-.192s' used in key specification without a key length" + norwegian-ny "BLOB column '%-.192s' used in key specification without a key length" + pol "BLOB column '%-.192s' used in key specification without a key length" + por "Coluna BLOB '%-.192s' usada na especificação de chave sem o comprimento da chave" + rum "Coloana BLOB '%-.192s' este folosita in specificarea unei chei fara ca o lungime de cheie sa fie folosita" + rus "óÔÏÌÂÅà ÔÉÐÁ BLOB '%-.192s' ÂÙÌ ÕËÁÚÁÎ × ÏÐÒÅÄÅÌÅÎÉÉ ËÌÀÞÁ ÂÅÚ ÕËÁÚÁÎÉÑ ÄÌÉÎÙ ËÌÀÞÁ" + serbian "BLOB kolona '%-.192s' je upotrebljena u specifikaciji kljuèa bez navoðenja dužine kljuèa" + slo "BLOB column '%-.192s' used in key specification without a key length" + spa "Columna BLOB column '%-.192s' usada en especificación de clave sin tamaño de la clave" + swe "Du har inte angett någon nyckellängd för BLOB '%-.192s'" + ukr "óÔÏ×ÂÅÃØ BLOB '%-.192s' ×ÉËÏÒÉÓÔÁÎÏ Õ ×ÉÚÎÁÞÅÎΦ ËÌÀÞÁ ÂÅÚ ×ËÁÚÁÎÎÑ ÄÏ×ÖÉÎÉ ËÌÀÞÁ" ER_PRIMARY_CANT_HAVE_NULL 42000 cze "V-B¹echny èásti primárního klíèe musejí být NOT NULL; pokud potøebujete NULL, pou¾ijte UNIQUE" dan "Alle dele af en PRIMARY KEY skal være NOT NULL; Hvis du skal bruge NULL i nøglen, brug UNIQUE istedet" @@ -3936,21 +3936,21 @@ ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE swe "Du använder 'säker uppdateringsmod' och försökte uppdatera en tabell utan en WHERE-sats som använder sig av en nyckel" ukr "÷É Õ ÒÅÖÉͦ ÂÅÚÐÅÞÎÏÇÏ ÏÎÏ×ÌÅÎÎÑ ÔÁ ÎÁÍÁÇÁ¤ÔÅÓØ ÏÎÏ×ÉÔÉ ÔÁÂÌÉÃÀ ÂÅÚ ÏÐÅÒÁÔÏÒÁ WHERE, ÝÏ ×ÉËÏÒÉÓÔÏ×Õ¤ KEY ÓÔÏ×ÂÅÃØ" ER_KEY_DOES_NOT_EXITS 42000 S1009 - cze "Kl-Bíè '%-.64s' v tabulce '%-.64s' neexistuje" - dan "Nøglen '%-.64s' eksisterer ikke i tabellen '%-.64s'" - nla "Zoeksleutel '%-.64s' bestaat niet in tabel '%-.64s'" - eng "Key '%-.64s' doesn't exist in table '%-.64s'" - est "Võti '%-.64s' ei eksisteeri tabelis '%-.64s'" - fre "L'index '%-.64s' n'existe pas sur la table '%-.64s'" - ger "Schlüssel '%-.64s' existiert in der Tabelle '%-.64s' nicht" - hun "A '%-.64s' kulcs nem letezik a '%-.64s' tablaban" - ita "La chiave '%-.64s' non esiste nella tabella '%-.64s'" - por "Chave '%-.64s' não existe na tabela '%-.64s'" - rus "ëÌÀÞ '%-.64s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ × ÔÁÂÌÉÃÅ '%-.64s'" - serbian "Kljuè '%-.64s' ne postoji u tabeli '%-.64s'" - spa "Clave '%-.64s' no existe en la tabla '%-.64s'" - swe "Nyckel '%-.64s' finns inte in tabell '%-.64s'" - ukr "ëÌÀÞ '%-.64s' ÎÅ ¦ÓÎÕ¤ × ÔÁÂÌÉæ '%-.64s'" + cze "Kl-Bíè '%-.192s' v tabulce '%-.192s' neexistuje" + dan "Nøglen '%-.192s' eksisterer ikke i tabellen '%-.192s'" + nla "Zoeksleutel '%-.192s' bestaat niet in tabel '%-.192s'" + eng "Key '%-.192s' doesn't exist in table '%-.192s'" + est "Võti '%-.192s' ei eksisteeri tabelis '%-.192s'" + fre "L'index '%-.192s' n'existe pas sur la table '%-.192s'" + ger "Schlüssel '%-.192s' existiert in der Tabelle '%-.192s' nicht" + hun "A '%-.192s' kulcs nem letezik a '%-.192s' tablaban" + ita "La chiave '%-.192s' non esiste nella tabella '%-.192s'" + por "Chave '%-.192s' não existe na tabela '%-.192s'" + rus "ëÌÀÞ '%-.192s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ × ÔÁÂÌÉÃÅ '%-.192s'" + serbian "Kljuè '%-.192s' ne postoji u tabeli '%-.192s'" + spa "Clave '%-.192s' no existe en la tabla '%-.192s'" + swe "Nyckel '%-.192s' finns inte in tabell '%-.192s'" + ukr "ëÌÀÞ '%-.192s' ÎÅ ¦ÓÎÕ¤ × ÔÁÂÌÉæ '%-.192s'" ER_CHECK_NO_SUCH_TABLE 42000 cze "Nemohu otev-Bøít tabulku" dan "Kan ikke åbne tabellen" @@ -4072,20 +4072,20 @@ ER_ERROR_DURING_CHECKPOINT swe "Fick fel %d vid CHECKPOINT" ukr "ïÔÒÉÍÁÎÏ ÐÏÍÉÌËÕ %d Ð¦Ä ÞÁÓ CHECKPOINT" ER_NEW_ABORTING_CONNECTION 08S01 - cze "Spojen-Bí %ld do databáze: '%-.64s' u¾ivatel: '%-.32s' stroj: '%-.64s' (%-.64s) bylo pøeru¹eno" - dan "Afbrød forbindelsen %ld til databasen '%-.64s' bruger: '%-.32s' vært: '%-.64s' (%-.64s)" - nla "Afgebroken verbinding %ld naar db: '%-.64s' gebruiker: '%-.32s' host: '%-.64s' (%-.64s)" - eng "Aborted connection %ld to db: '%-.64s' user: '%-.32s' host: '%-.64s' (%-.64s)" - est "Ühendus katkestatud %ld andmebaas: '%-.64s' kasutaja: '%-.32s' masin: '%-.64s' (%-.64s)" - fre "Connection %ld avortée vers la bd: '%-.64s' utilisateur: '%-.32s' hôte: '%-.64s' (%-.64s)" - ger "Abbruch der Verbindung %ld zur Datenbank '%-.64s'. Benutzer: '%-.32s', Host: '%-.64s' (%-.64s)" - ita "Interrotta la connessione %ld al db: ''%-.64s' utente: '%-.32s' host: '%-.64s' (%-.64s)" - por "Conexão %ld abortada para banco de dados '%-.64s' - usuário '%-.32s' - 'host' '%-.64s' ('%-.64s')" - rus "ðÒÅÒ×ÁÎÏ ÓÏÅÄÉÎÅÎÉÅ %ld Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.64s' ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' Ó ÈÏÓÔÁ '%-.64s' (%-.64s)" - serbian "Prekinuta konekcija broj %ld ka bazi: '%-.64s' korisnik je bio: '%-.32s' a host: '%-.64s' (%-.64s)" - spa "Abortada conexión %ld para db: '%-.64s' usuario: '%-.32s' servidor: '%-.64s' (%-.64s)" - swe "Avbröt länken för tråd %ld till db '%-.64s', användare '%-.32s', host '%-.64s' (%-.64s)" - ukr "ðÅÒÅÒ×ÁÎÏ Ú'¤ÄÎÁÎÎÑ %ld ÄÏ ÂÁÚÉ ÄÁÎÎÉÈ: '%-.64s' ËÏÒÉÓÔÕ×ÁÞ: '%-.32s' ÈÏÓÔ: '%-.64s' (%-.64s)" + cze "Spojen-Bí %ld do databáze: '%-.192s' u¾ivatel: '%-.48s' stroj: '%-.64s' (%-.64s) bylo pøeru¹eno" + dan "Afbrød forbindelsen %ld til databasen '%-.192s' bruger: '%-.48s' vært: '%-.64s' (%-.64s)" + nla "Afgebroken verbinding %ld naar db: '%-.192s' gebruiker: '%-.48s' host: '%-.64s' (%-.64s)" + eng "Aborted connection %ld to db: '%-.192s' user: '%-.48s' host: '%-.64s' (%-.64s)" + est "Ühendus katkestatud %ld andmebaas: '%-.192s' kasutaja: '%-.48s' masin: '%-.64s' (%-.64s)" + fre "Connection %ld avortée vers la bd: '%-.192s' utilisateur: '%-.48s' hôte: '%-.64s' (%-.64s)" + ger "Abbruch der Verbindung %ld zur Datenbank '%-.192s'. Benutzer: '%-.48s', Host: '%-.64s' (%-.64s)" + ita "Interrotta la connessione %ld al db: ''%-.192s' utente: '%-.48s' host: '%-.64s' (%-.64s)" + por "Conexão %ld abortada para banco de dados '%-.192s' - usuário '%-.48s' - 'host' '%-.64s' ('%-.64s')" + rus "ðÒÅÒ×ÁÎÏ ÓÏÅÄÉÎÅÎÉÅ %ld Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.192s' ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.48s' Ó ÈÏÓÔÁ '%-.64s' (%-.64s)" + serbian "Prekinuta konekcija broj %ld ka bazi: '%-.192s' korisnik je bio: '%-.48s' a host: '%-.64s' (%-.64s)" + spa "Abortada conexión %ld para db: '%-.192s' usuario: '%-.48s' servidor: '%-.64s' (%-.64s)" + swe "Avbröt länken för tråd %ld till db '%-.192s', användare '%-.48s', host '%-.64s' (%-.64s)" + ukr "ðÅÒÅÒ×ÁÎÏ Ú'¤ÄÎÁÎÎÑ %ld ÄÏ ÂÁÚÉ ÄÁÎÎÉÈ: '%-.192s' ËÏÒÉÓÔÕ×ÁÞ: '%-.48s' ÈÏÓÔ: '%-.64s' (%-.64s)" ER_DUMP_NOT_IMPLEMENTED cze "Handler tabulky nepodporuje bin-Bární dump" dan "Denne tabeltype unserstøtter ikke binært tabeldump" @@ -4110,20 +4110,20 @@ ER_FLUSH_MASTER_BINLOG_CLOSED serbian "Binarni log file zatvoren, ne mogu da izvršim komandu 'RESET MASTER'" ukr "òÅÐ̦ËÁæÊÎÉÊ ÌÏÇ ÚÁËÒÉÔÏ, ÎÅ ÍÏÖÕ ×ÉËÏÎÁÔÉ RESET MASTER" ER_INDEX_REBUILD - cze "P-Bøebudování indexu dumpnuté tabulky '%-.64s' nebylo úspì¹né" - dan "Kunne ikke genopbygge indekset for den dumpede tabel '%-.64s'" - nla "Gefaald tijdens heropbouw index van gedumpte tabel '%-.64s'" - eng "Failed rebuilding the index of dumped table '%-.64s'" - fre "La reconstruction de l'index de la table copiée '%-.64s' a échoué" - ger "Neuerstellung des Index der Dump-Tabelle '%-.64s' fehlgeschlagen" - greek "Failed rebuilding the index of dumped table '%-.64s'" - hun "Failed rebuilding the index of dumped table '%-.64s'" - ita "Fallita la ricostruzione dell'indice della tabella copiata '%-.64s'" - por "Falhou na reconstrução do índice da tabela 'dumped' '%-.64s'" - rus "ïÛÉÂËÁ ÐÅÒÅÓÔÒÏÊËÉ ÉÎÄÅËÓÁ ÓÏÈÒÁÎÅÎÎÏÊ ÔÁÂÌÉÃÙ '%-.64s'" - serbian "Izgradnja indeksa dump-ovane tabele '%-.64s' nije uspela" - spa "Falla reconstruyendo el indice de la tabla dumped '%-.64s'" - ukr "îÅ×ÄÁÌŠצÄÎÏ×ÌÅÎÎÑ ¦ÎÄÅËÓÁ ÐÅÒÅÄÁÎϧ ÔÁÂÌÉæ '%-.64s'" + cze "P-Bøebudování indexu dumpnuté tabulky '%-.192s' nebylo úspì¹né" + dan "Kunne ikke genopbygge indekset for den dumpede tabel '%-.192s'" + nla "Gefaald tijdens heropbouw index van gedumpte tabel '%-.192s'" + eng "Failed rebuilding the index of dumped table '%-.192s'" + fre "La reconstruction de l'index de la table copiée '%-.192s' a échoué" + ger "Neuerstellung des Index der Dump-Tabelle '%-.192s' fehlgeschlagen" + greek "Failed rebuilding the index of dumped table '%-.192s'" + hun "Failed rebuilding the index of dumped table '%-.192s'" + ita "Fallita la ricostruzione dell'indice della tabella copiata '%-.192s'" + por "Falhou na reconstrução do índice da tabela 'dumped' '%-.192s'" + rus "ïÛÉÂËÁ ÐÅÒÅÓÔÒÏÊËÉ ÉÎÄÅËÓÁ ÓÏÈÒÁÎÅÎÎÏÊ ÔÁÂÌÉÃÙ '%-.192s'" + serbian "Izgradnja indeksa dump-ovane tabele '%-.192s' nije uspela" + spa "Falla reconstruyendo el indice de la tabla dumped '%-.192s'" + ukr "îÅ×ÄÁÌŠצÄÎÏ×ÌÅÎÎÑ ¦ÎÄÅËÓÁ ÐÅÒÅÄÁÎϧ ÔÁÂÌÉæ '%-.192s'" ER_MASTER cze "Chyba masteru: '%-.64s'" dan "Fejl fra master: '%-.64s'" @@ -4212,35 +4212,35 @@ ER_UNKNOWN_SYSTEM_VARIABLE swe "Okänd systemvariabel: '%-.64s'" ukr "îÅצÄÏÍÁ ÓÉÓÔÅÍÎÁ ÚͦÎÎÁ '%-.64s'" ER_CRASHED_ON_USAGE - cze "Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a mìla by být opravena" - dan "Tabellen '%-.64s' er markeret med fejl og bør repareres" - nla "Tabel '%-.64s' staat als gecrashed gemarkeerd en dient te worden gerepareerd" - eng "Table '%-.64s' is marked as crashed and should be repaired" - est "Tabel '%-.64s' on märgitud vigaseks ja tuleb parandada" - fre "La table '%-.64s' est marquée 'crashed' et devrait être réparée" - ger "Tabelle '%-.64s' ist als defekt markiert und sollte repariert werden" - ita "La tabella '%-.64s' e` segnalata come corrotta e deve essere riparata" - por "Tabela '%-.64s' está marcada como danificada e deve ser reparada" - rus "ôÁÂÌÉÃÁ '%-.64s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÄÏÌÖÎÁ ÐÒÏÊÔÉ ÐÒÏ×ÅÒËÕ É ÒÅÍÏÎÔ" - serbian "Tabela '%-.64s' je markirana kao ošteæena i trebala bi biti popravljena" - spa "Tabla '%-.64s' está marcada como crashed y debe ser reparada" - swe "Tabell '%-.64s' är trasig och bör repareras med REPAIR TABLE" - ukr "ôÁÂÌÉÃÀ '%-.64s' ÍÁÒËÏ×ÁÎÏ ÑË Ú¦ÐÓÏ×ÁÎÕ ÔÁ §§ ÐÏÔÒ¦ÂÎÏ ×¦ÄÎÏ×ÉÔÉ" + cze "Tabulka '%-.192s' je ozna-Bèena jako poru¹ená a mìla by být opravena" + dan "Tabellen '%-.192s' er markeret med fejl og bør repareres" + nla "Tabel '%-.192s' staat als gecrashed gemarkeerd en dient te worden gerepareerd" + eng "Table '%-.192s' is marked as crashed and should be repaired" + est "Tabel '%-.192s' on märgitud vigaseks ja tuleb parandada" + fre "La table '%-.192s' est marquée 'crashed' et devrait être réparée" + ger "Tabelle '%-.192s' ist als defekt markiert und sollte repariert werden" + ita "La tabella '%-.192s' e` segnalata come corrotta e deve essere riparata" + por "Tabela '%-.192s' está marcada como danificada e deve ser reparada" + rus "ôÁÂÌÉÃÁ '%-.192s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÄÏÌÖÎÁ ÐÒÏÊÔÉ ÐÒÏ×ÅÒËÕ É ÒÅÍÏÎÔ" + serbian "Tabela '%-.192s' je markirana kao ošteæena i trebala bi biti popravljena" + spa "Tabla '%-.192s' está marcada como crashed y debe ser reparada" + swe "Tabell '%-.192s' är trasig och bör repareras med REPAIR TABLE" + ukr "ôÁÂÌÉÃÀ '%-.192s' ÍÁÒËÏ×ÁÎÏ ÑË Ú¦ÐÓÏ×ÁÎÕ ÔÁ §§ ÐÏÔÒ¦ÂÎÏ ×¦ÄÎÏ×ÉÔÉ" ER_CRASHED_ON_REPAIR - cze "Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a poslední (automatická?) oprava se nezdaøila" - dan "Tabellen '%-.64s' er markeret med fejl og sidste (automatiske?) REPAIR fejlede" - nla "Tabel '%-.64s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukte" - eng "Table '%-.64s' is marked as crashed and last (automatic?) repair failed" - est "Tabel '%-.64s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus" - fre "La table '%-.64s' est marquée 'crashed' et le dernier 'repair' a échoué" - ger "Tabelle '%-.64s' ist als defekt markiert und der letzte (automatische?) Reparaturversuch schlug fehl" - ita "La tabella '%-.64s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallita" - por "Tabela '%-.64s' está marcada como danificada e a última reparação (automática?) falhou" - rus "ôÁÂÌÉÃÁ '%-.64s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÐÏÓÌÅÄÎÉÊ (Á×ÔÏÍÁÔÉÞÅÓËÉÊ?) ÒÅÍÏÎÔ ÎÅ ÂÙÌ ÕÓÐÅÛÎÙÍ" - serbian "Tabela '%-.64s' je markirana kao ošteæena, a zadnja (automatska?) popravka je bila neuspela" - spa "Tabla '%-.64s' está marcada como crashed y la última reparación (automactica?) falló" - swe "Tabell '%-.64s' är trasig och senast (automatiska?) reparation misslyckades" - ukr "ôÁÂÌÉÃÀ '%-.64s' ÍÁÒËÏ×ÁÎÏ ÑË Ú¦ÐÓÏ×ÁÎÕ ÔÁ ÏÓÔÁÎΤ (Á×ÔÏÍÁÔÉÞÎÅ?) צÄÎÏ×ÌÅÎÎÑ ÎÅ ×ÄÁÌÏÓÑ" + cze "Tabulka '%-.192s' je ozna-Bèena jako poru¹ená a poslední (automatická?) oprava se nezdaøila" + dan "Tabellen '%-.192s' er markeret med fejl og sidste (automatiske?) REPAIR fejlede" + nla "Tabel '%-.192s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukte" + eng "Table '%-.192s' is marked as crashed and last (automatic?) repair failed" + est "Tabel '%-.192s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus" + fre "La table '%-.192s' est marquée 'crashed' et le dernier 'repair' a échoué" + ger "Tabelle '%-.192s' ist als defekt markiert und der letzte (automatische?) Reparaturversuch schlug fehl" + ita "La tabella '%-.192s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallita" + por "Tabela '%-.192s' está marcada como danificada e a última reparação (automática?) falhou" + rus "ôÁÂÌÉÃÁ '%-.192s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÐÏÓÌÅÄÎÉÊ (Á×ÔÏÍÁÔÉÞÅÓËÉÊ?) ÒÅÍÏÎÔ ÎÅ ÂÙÌ ÕÓÐÅÛÎÙÍ" + serbian "Tabela '%-.192s' je markirana kao ošteæena, a zadnja (automatska?) popravka je bila neuspela" + spa "Tabla '%-.192s' está marcada como crashed y la última reparación (automactica?) falló" + swe "Tabell '%-.192s' är trasig och senast (automatiska?) reparation misslyckades" + ukr "ôÁÂÌÉÃÀ '%-.192s' ÍÁÒËÏ×ÁÎÏ ÑË Ú¦ÐÓÏ×ÁÎÕ ÔÁ ÏÓÔÁÎΤ (Á×ÔÏÍÁÔÉÞÎÅ?) צÄÎÏ×ÌÅÎÎÑ ÎÅ ×ÄÁÌÏÓÑ" ER_WARNING_NOT_COMPLETE_ROLLBACK dan "Advarsel: Visse data i tabeller der ikke understøtter transaktioner kunne ikke tilbagestilles" nla "Waarschuwing: Roll back mislukt voor sommige buiten transacties gewijzigde tabellen" @@ -4438,18 +4438,18 @@ ER_WRONG_ARGUMENTS swe "Felaktiga argument till %s" ukr "èÉÂÎÉÊ ÁÒÇÕÍÅÎÔ ÄÌÑ %s" ER_NO_PERMISSION_TO_CREATE_USER 42000 - nla "'%-.32s'@'%-.64s' mag geen nieuwe gebruikers creeren" - eng "'%-.32s'@'%-.64s' is not allowed to create new users" - est "Kasutajal '%-.32s'@'%-.64s' ei ole lubatud luua uusi kasutajaid" - fre "'%-.32s'@'%-.64s' n'est pas autorisé à créer de nouveaux utilisateurs" - ger "'%-.32s'@'%-.64s' ist nicht berechtigt, neue Benutzer hinzuzufügen" - ita "A '%-.32s'@'%-.64s' non e' permesso creare nuovi utenti" - por "Não é permitido a '%-.32s'@'%-.64s' criar novos usuários" - rus "'%-.32s'@'%-.64s' ÎÅ ÒÁÚÒÅÛÁÅÔÓÑ ÓÏÚÄÁ×ÁÔØ ÎÏ×ÙÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ" - serbian "Korisniku '%-.32s'@'%-.64s' nije dozvoljeno da kreira nove korisnike" - spa "'%-.32s`@`%-.64s` no es permitido para crear nuevos usuarios" - swe "'%-.32s'@'%-.64s' har inte rättighet att skapa nya användare" - ukr "ëÏÒÉÓÔÕ×ÁÞÕ '%-.32s'@'%-.64s' ÎÅ ÄÏÚ×ÏÌÅÎÏ ÓÔ×ÏÒÀ×ÁÔÉ ÎÏ×ÉÈ ËÏÒÉÓÔÕ×ÁÞ¦×" + nla "'%-.48s'@'%-.64s' mag geen nieuwe gebruikers creeren" + eng "'%-.48s'@'%-.64s' is not allowed to create new users" + est "Kasutajal '%-.48s'@'%-.64s' ei ole lubatud luua uusi kasutajaid" + fre "'%-.48s'@'%-.64s' n'est pas autorisé à créer de nouveaux utilisateurs" + ger "'%-.48s'@'%-.64s' ist nicht berechtigt, neue Benutzer hinzuzufügen" + ita "A '%-.48s'@'%-.64s' non e' permesso creare nuovi utenti" + por "Não é permitido a '%-.48s'@'%-.64s' criar novos usuários" + rus "'%-.48s'@'%-.64s' ÎÅ ÒÁÚÒÅÛÁÅÔÓÑ ÓÏÚÄÁ×ÁÔØ ÎÏ×ÙÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ" + serbian "Korisniku '%-.48s'@'%-.64s' nije dozvoljeno da kreira nove korisnike" + spa "'%-.48s`@`%-.64s` no es permitido para crear nuevos usuarios" + swe "'%-.48s'@'%-.64s' har inte rättighet att skapa nya användare" + ukr "ëÏÒÉÓÔÕ×ÁÞÕ '%-.48s'@'%-.64s' ÎÅ ÄÏÚ×ÏÌÅÎÏ ÓÔ×ÏÒÀ×ÁÔÉ ÎÏ×ÉÈ ËÏÒÉÓÔÕ×ÁÞ¦×" ER_UNION_TABLES_IN_DIFFERENT_DIR nla "Incorrecte tabel definitie; alle MERGE tabellen moeten tot dezelfde database behoren" eng "Incorrect table definition; all MERGE tables must be in the same database" @@ -4715,19 +4715,19 @@ ER_SLAVE_IGNORED_TABLE spa "Slave SQL thread ignorado el query debido a las reglas de replicación-*-tabla" swe "Slav SQL tråden ignorerade frågan pga en replicate-*-table regel" ER_INCORRECT_GLOBAL_LOCAL_VAR - eng "Variable '%-.64s' is a %s variable" - serbian "Incorrect foreign key definition for '%-.64s': %s" - ger "Variable '%-.64s' ist eine %s-Variable" - nla "Variabele '%-.64s' is geen %s variabele" - spa "Variable '%-.64s' es una %s variable" - swe "Variabel '%-.64s' är av typ %s" + eng "Variable '%-.192s' is a %s variable" + serbian "Incorrect foreign key definition for '%-.192s': %s" + ger "Variable '%-.192s' ist eine %s-Variable" + nla "Variabele '%-.192s' is geen %s variabele" + spa "Variable '%-.192s' es una %s variable" + swe "Variabel '%-.192s' är av typ %s" ER_WRONG_FK_DEF 42000 - eng "Incorrect foreign key definition for '%-.64s': %s" - ger "Falsche Fremdschlüssel-Definition für '%-.64s': %s" - nla "Incorrecte foreign key definitie voor '%-.64s': %s" - por "Definição errada da chave estrangeira para '%-.64s': %s" - spa "Equivocada definición de llave extranjera para '%-.64s': %s" - swe "Felaktig FOREIGN KEY-definition för '%-.64s': %s" + eng "Incorrect foreign key definition for '%-.192s': %s" + ger "Falsche Fremdschlüssel-Definition für '%-.192s': %s" + nla "Incorrecte foreign key definitie voor '%-.192s': %s" + por "Definição errada da chave estrangeira para '%-.192s': %s" + spa "Equivocada definición de llave extranjera para '%-.192s': %s" + swe "Felaktig FOREIGN KEY-definition för '%-.192s': %s" ER_KEY_REF_DO_NOT_MATCH_TABLE_REF eng "Key reference and table reference don't match" ger "Schlüssel- und Tabellenverweis passen nicht zusammen" @@ -4811,12 +4811,12 @@ ER_SELECT_REDUCED 01000 swe "Select %u reducerades vid optimiering" ukr "Select %u was ÓËÁÓÏ×ÁÎÏ ÐÒÉ ÏÐÔÉÍiÚÁÃii" ER_TABLENAME_NOT_ALLOWED_HERE 42000 - eng "Table '%-.64s' from one of the SELECTs cannot be used in %-.32s" - ger "Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde, kann nicht in %-.32s verwendet werden" - nla "Tabel '%-.64s' uit een van de SELECTS kan niet in %-.32s gebruikt worden" - por "Tabela '%-.64s' de um dos SELECTs não pode ser usada em %-.32s" - spa "Tabla '%-.64s' de uno de los SELECT no puede ser usada en %-.32s" - swe "Tabell '%-.64s' från en SELECT kan inte användas i %-.32s" + eng "Table '%-.192s' from one of the SELECTs cannot be used in %-.32s" + ger "Tabelle '%-.192s', die in einem der SELECT-Befehle verwendet wurde, kann nicht in %-.32s verwendet werden" + nla "Tabel '%-.192s' uit een van de SELECTS kan niet in %-.32s gebruikt worden" + por "Tabela '%-.192s' de um dos SELECTs não pode ser usada em %-.32s" + spa "Tabla '%-.192s' de uno de los SELECT no puede ser usada en %-.32s" + swe "Tabell '%-.192s' från en SELECT kan inte användas i %-.32s" ER_NOT_SUPPORTED_AUTH_MODE 08004 eng "Client does not support authentication protocol requested by server; consider upgrading MySQL client" ger "Client unterstützt das vom Server erwartete Authentifizierungsprotokoll nicht. Bitte aktualisieren Sie Ihren MySQL-Client" @@ -4959,12 +4959,12 @@ ER_SERVER_IS_IN_SECURE_AUTH_MODE rus "óÅÒ×ÅÒ ÚÁÐÕÝÅÎ × ÒÅÖÉÍÅ --secure-auth (ÂÅÚÏÐÁÓÎÏÊ Á×ÔÏÒÉÚÁÃÉÉ), ÎÏ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%s'@'%s' ÐÁÒÏÌØ ÓÏÈÒÁÎ£Î × ÓÔÁÒÏÍ ÆÏÒÍÁÔÅ; ÎÅÏÂÈÏÄÉÍÏ ÏÂÎÏ×ÉÔØ ÆÏÒÍÁÔ ÐÁÒÏÌÑ" spa "Servidor está rodando en modo --secure-auth, pero '%s'@'%s' tiene clave en el antiguo formato; por favor cambie la clave para el nuevo formato" ER_WARN_FIELD_RESOLVED - eng "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d" - ger "Feld oder Verweis '%-.64s%s%-.64s%s%-.64s' im SELECT-Befehl Nr. %d wurde im SELECT-Befehl Nr. %d aufgelöst" - por "Campo ou referência '%-.64s%s%-.64s%s%-.64s' de SELECT #%d foi resolvido em SELECT #%d" - rus "ðÏÌÅ ÉÌÉ ÓÓÙÌËÁ '%-.64s%s%-.64s%s%-.64s' ÉÚ SELECTÁ #%d ÂÙÌÁ ÎÁÊÄÅÎÁ × SELECTÅ #%d" - spa "Campo o referencia '%-.64s%s%-.64s%s%-.64s' de SELECT #%d fue resolvido en SELECT #%d" - ukr "óÔÏ×ÂÅÃØ ÁÂÏ ÐÏÓÉÌÁÎÎÑ '%-.64s%s%-.64s%s%-.64s' ¦Ú SELECTÕ #%d ÂÕÌÏ ÚÎÁÊÄÅÎÅ Õ SELECT¦ #%d" + eng "Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d" + ger "Feld oder Verweis '%-.192s%s%-.192s%s%-.192s' im SELECT-Befehl Nr. %d wurde im SELECT-Befehl Nr. %d aufgelöst" + por "Campo ou referência '%-.192s%s%-.192s%s%-.192s' de SELECT #%d foi resolvido em SELECT #%d" + rus "ðÏÌÅ ÉÌÉ ÓÓÙÌËÁ '%-.192s%s%-.192s%s%-.192s' ÉÚ SELECTÁ #%d ÂÙÌÁ ÎÁÊÄÅÎÁ × SELECTÅ #%d" + spa "Campo o referencia '%-.192s%s%-.192s%s%-.192s' de SELECT #%d fue resolvido en SELECT #%d" + ukr "óÔÏ×ÂÅÃØ ÁÂÏ ÐÏÓÉÌÁÎÎÑ '%-.192s%s%-.192s%s%-.192s' ¦Ú SELECTÕ #%d ÂÕÌÏ ÚÎÁÊÄÅÎÅ Õ SELECT¦ #%d" ER_BAD_SLAVE_UNTIL_COND eng "Incorrect parameter or combination of parameters for START SLAVE UNTIL" ger "Falscher Parameter oder falsche Kombination von Parametern für START SLAVE UNTIL" @@ -5001,11 +5001,11 @@ ER_WARN_QC_RESIZE swe "Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu" ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu, ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" ER_BAD_FT_COLUMN - eng "Column '%-.64s' cannot be part of FULLTEXT index" - ger "Feld '%-.64s' kann nicht Teil eines FULLTEXT-Index sein" - por "Coluna '%-.64s' não pode ser parte de índice FULLTEXT" - spa "Columna '%-.64s' no puede ser parte de FULLTEXT index" - swe "Kolumn '%-.64s' kan inte vara del av ett FULLTEXT index" + eng "Column '%-.192s' cannot be part of FULLTEXT index" + ger "Feld '%-.192s' kann nicht Teil eines FULLTEXT-Index sein" + por "Coluna '%-.192s' não pode ser parte de índice FULLTEXT" + spa "Columna '%-.192s' no puede ser parte de FULLTEXT index" + swe "Kolumn '%-.192s' kan inte vara del av ett FULLTEXT index" ER_UNKNOWN_KEY_CACHE eng "Unknown key cache '%-.100s'" ger "Unbekannter Schlüssel-Cache '%-.100s'" @@ -5063,10 +5063,10 @@ ER_TOO_MUCH_AUTO_TIMESTAMP_COLS por "Incorreta definição de tabela; Pode ter somente uma coluna TIMESTAMP com CURRENT_TIMESTAMP em DEFAULT ou ON UPDATE cláusula" spa "Incorrecta definición de tabla; Solamente debe haber una columna TIMESTAMP con CURRENT_TIMESTAMP en DEFAULT o ON UPDATE cláusula" ER_INVALID_ON_UPDATE - eng "Invalid ON UPDATE clause for '%-.64s' column" - ger "Ungültige ON-UPDATE-Klausel für Spalte '%-.64s'" - por "Inválida cláusula ON UPDATE para campo '%-.64s'" - spa "Inválido ON UPDATE cláusula para campo '%-.64s'" + eng "Invalid ON UPDATE clause for '%-.192s' column" + ger "Ungültige ON-UPDATE-Klausel für Spalte '%-.192s'" + por "Inválida cláusula ON UPDATE para campo '%-.192s'" + spa "Inválido ON UPDATE cláusula para campo '%-.192s'" ER_UNSUPPORTED_PS eng "This command is not supported in the prepared statement protocol yet" ger "Dieser Befehl wird im Protokoll für vorbereitete Anweisungen noch nicht unterstützt" @@ -5209,50 +5209,50 @@ ER_SP_CASE_NOT_FOUND 20000 eng "Case not found for CASE statement" ger "Fall für CASE-Anweisung nicht gefunden" ER_FPARSER_TOO_BIG_FILE - eng "Configuration file '%-.64s' is too big" - ger "Konfigurationsdatei '%-.64s' ist zu groß" - rus "óÌÉÛËÏÍ ÂÏÌØÛÏÊ ËÏÎÆÉÇÕÒÁÃÉÏÎÎÙÊ ÆÁÊÌ '%-.64s'" - ukr "úÁÎÁÄÔÏ ×ÅÌÉËÉÊ ËÏÎÆ¦ÇÕÒÁæÊÎÉÊ ÆÁÊÌ '%-.64s'" + eng "Configuration file '%-.192s' is too big" + ger "Konfigurationsdatei '%-.192s' ist zu groß" + rus "óÌÉÛËÏÍ ÂÏÌØÛÏÊ ËÏÎÆÉÇÕÒÁÃÉÏÎÎÙÊ ÆÁÊÌ '%-.192s'" + ukr "úÁÎÁÄÔÏ ×ÅÌÉËÉÊ ËÏÎÆ¦ÇÕÒÁæÊÎÉÊ ÆÁÊÌ '%-.192s'" ER_FPARSER_BAD_HEADER - eng "Malformed file type header in file '%-.64s'" - ger "Nicht wohlgeformter Dateityp-Header in Datei '%-.64s'" - rus "îÅ×ÅÒÎÙÊ ÚÁÇÏÌÏ×ÏË ÔÉÐÁ ÆÁÊÌÁ '%-.64s'" - ukr "îÅצÒÎÉÊ ÚÁÇÏÌÏ×ÏË ÔÉÐÕ Õ ÆÁÊ̦ '%-.64s'" + eng "Malformed file type header in file '%-.192s'" + ger "Nicht wohlgeformter Dateityp-Header in Datei '%-.192s'" + rus "îÅ×ÅÒÎÙÊ ÚÁÇÏÌÏ×ÏË ÔÉÐÁ ÆÁÊÌÁ '%-.192s'" + ukr "îÅצÒÎÉÊ ÚÁÇÏÌÏ×ÏË ÔÉÐÕ Õ ÆÁÊ̦ '%-.192s'" ER_FPARSER_EOF_IN_COMMENT eng "Unexpected end of file while parsing comment '%-.200s'" ger "Unerwartetes Dateiende beim Parsen des Kommentars '%-.200s'" rus "îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ × ËÏÍÅÎÔÁÒÉÉ '%-.200s'" ukr "îÅÓÐÏĦ×ÁÎÎÉÊ Ë¦ÎÅÃØ ÆÁÊÌÕ Õ ËÏÍÅÎÔÁÒ¦ '%-.200s'" ER_FPARSER_ERROR_IN_PARAMETER - eng "Error while parsing parameter '%-.64s' (line: '%-.64s')" - ger "Fehler beim Parsen des Parameters '%-.64s' (Zeile: '%-.64s')" - rus "ïÛÉÂËÁ ÐÒÉ ÒÁÓÐÏÚÎÁ×ÁÎÉÉ ÐÁÒÁÍÅÔÒÁ '%-.64s' (ÓÔÒÏËÁ: '%-.64s')" - ukr "ðÏÍÉÌËÁ × ÒÏÓЦÚÎÁ×ÁÎΦ ÐÁÒÁÍÅÔÒÕ '%-.64s' (ÒÑÄÏË: '%-.64s')" + eng "Error while parsing parameter '%-.192s' (line: '%-.192s')" + ger "Fehler beim Parsen des Parameters '%-.192s' (Zeile: '%-.192s')" + rus "ïÛÉÂËÁ ÐÒÉ ÒÁÓÐÏÚÎÁ×ÁÎÉÉ ÐÁÒÁÍÅÔÒÁ '%-.192s' (ÓÔÒÏËÁ: '%-.192s')" + ukr "ðÏÍÉÌËÁ × ÒÏÓЦÚÎÁ×ÁÎΦ ÐÁÒÁÍÅÔÒÕ '%-.192s' (ÒÑÄÏË: '%-.192s')" ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER - eng "Unexpected end of file while skipping unknown parameter '%-.64s'" - ger "Unerwartetes Dateiende beim Überspringen des unbekannten Parameters '%-.64s'" - rus "îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ ÐÒÉ ÐÒÏÐÕÓËÅ ÎÅÉÚ×ÅÓÔÎÏÇÏ ÐÁÒÁÍÅÔÒÁ '%-.64s'" - ukr "îÅÓÐÏĦ×ÁÎÎÉÊ Ë¦ÎÅÃØ ÆÁÊÌÕ Õ ÓÐÒϦ ÐÒÏÍÉÎÕÔÉ ÎÅצÄÏÍÉÊ ÐÁÒÁÍÅÔÒ '%-.64s'" + eng "Unexpected end of file while skipping unknown parameter '%-.192s'" + ger "Unerwartetes Dateiende beim Überspringen des unbekannten Parameters '%-.192s'" + rus "îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ ÐÒÉ ÐÒÏÐÕÓËÅ ÎÅÉÚ×ÅÓÔÎÏÇÏ ÐÁÒÁÍÅÔÒÁ '%-.192s'" + ukr "îÅÓÐÏĦ×ÁÎÎÉÊ Ë¦ÎÅÃØ ÆÁÊÌÕ Õ ÓÐÒϦ ÐÒÏÍÉÎÕÔÉ ÎÅצÄÏÍÉÊ ÐÁÒÁÍÅÔÒ '%-.192s'" ER_VIEW_NO_EXPLAIN eng "EXPLAIN/SHOW can not be issued; lacking privileges for underlying table" ger "EXPLAIN/SHOW kann nicht verlangt werden. Rechte für zugrunde liegende Tabelle fehlen" rus "EXPLAIN/SHOW ÎÅ ÍÏÖÅÔ ÂÙÔØ ×ÙÐÏÌÎÅÎÎÏ; ÎÅÄÏÓÔÁÔÏÞÎÏ ÐÒÁ× ÎÁ ÔÁËÂÌÉÃÙ ÚÁÐÒÏÓÁ" ukr "EXPLAIN/SHOW ÎÅ ÍÏÖÅ ÂÕÔÉ ×¦ËÏÎÁÎÏ; ÎÅÍÁ¤ ÐÒÁ× ÎÁ ÔÉÂÌÉæ ÚÁÐÉÔÕ" ER_FRM_UNKNOWN_TYPE - eng "File '%-.64s' has unknown type '%-.64s' in its header" - ger "Datei '%-.64s' hat unbekannten Typ '%-.64s' im Header" - rus "æÁÊÌ '%-.64s' ÓÏÄÅÒÖÉÔ ÎÅÉÚ×ÅÓÔÎÙÊ ÔÉÐ '%-.64s' × ÚÁÇÏÌÏ×ËÅ" - ukr "æÁÊÌ '%-.64s' ÍÁ¤ ÎÅצÄÏÍÉÊ ÔÉÐ '%-.64s' Õ ÚÁÇÏÌÏ×ËÕ" + eng "File '%-.192s' has unknown type '%-.64s' in its header" + ger "Datei '%-.192s' hat unbekannten Typ '%-.64s' im Header" + rus "æÁÊÌ '%-.192s' ÓÏÄÅÒÖÉÔ ÎÅÉÚ×ÅÓÔÎÙÊ ÔÉÐ '%-.64s' × ÚÁÇÏÌÏ×ËÅ" + ukr "æÁÊÌ '%-.192s' ÍÁ¤ ÎÅצÄÏÍÉÊ ÔÉÐ '%-.64s' Õ ÚÁÇÏÌÏ×ËÕ" ER_WRONG_OBJECT - eng "'%-.64s.%-.64s' is not %s" - ger "'%-.64s.%-.64s' ist nicht %s" - rus "'%-.64s.%-.64s' - ÎÅ %s" - ukr "'%-.64s.%-.64s' ÎÅ ¤ %s" + eng "'%-.192s.%-.192s' is not %s" + ger "'%-.192s.%-.192s' ist nicht %s" + rus "'%-.192s.%-.192s' - ÎÅ %s" + ukr "'%-.192s.%-.192s' ÎÅ ¤ %s" ER_NONUPDATEABLE_COLUMN - eng "Column '%-.64s' is not updatable" - ger "Feld '%-.64s' ist nicht aktualisierbar" - rus "óÔÏÌÂÅà '%-.64s' ÎÅ ÏÂÎÏ×ÌÑÅÍÙÊ" - ukr "óÔÏ×ÂÅÃØ '%-.64s' ÎÅ ÍÏÖÅ ÂÕÔÉ ÚÍÉÎÅÎÉÊ" + eng "Column '%-.192s' is not updatable" + ger "Feld '%-.192s' ist nicht aktualisierbar" + rus "óÔÏÌÂÅà '%-.192s' ÎÅ ÏÂÎÏ×ÌÑÅÍÙÊ" + ukr "óÔÏ×ÂÅÃØ '%-.192s' ÎÅ ÍÏÖÅ ÂÕÔÉ ÚÍÉÎÅÎÉÊ" ER_VIEW_SELECT_DERIVED eng "View's SELECT contains a subquery in the FROM clause" ger "SELECT der View enthält eine Subquery in der FROM-Klausel" @@ -5269,10 +5269,10 @@ ER_VIEW_SELECT_VARIABLE rus "View SELECT ÓÏÄÅÒÖÉÔ ÐÅÒÅÍÅÎÎÕÀ ÉÌÉ ÐÁÒÁÍÅÔÒ" ukr "View SELECT ÍÁ¤ ÚÍÉÎÎÕ ÁÂÏ ÐÁÒÁÍÅÔÅÒ" ER_VIEW_SELECT_TMPTABLE - eng "View's SELECT refers to a temporary table '%-.64s'" - ger "SELECT der View verweist auf eine temporäre Tabelle '%-.64s'" - rus "View SELECT ÓÏÄÅÒÖÉÔ ÓÓÙÌËÕ ÎÁ ×ÒÅÍÅÎÎÕÀ ÔÁÂÌÉÃÕ '%-.64s'" - ukr "View SELECT ×ÉËÏÒÉÓÔÏ×Õ¤ ÔÉÍÞÁÓÏ×Õ ÔÁÂÌÉÃÀ '%-.64s'" + eng "View's SELECT refers to a temporary table '%-.192s'" + ger "SELECT der View verweist auf eine temporäre Tabelle '%-.192s'" + rus "View SELECT ÓÏÄÅÒÖÉÔ ÓÓÙÌËÕ ÎÁ ×ÒÅÍÅÎÎÕÀ ÔÁÂÌÉÃÕ '%-.192s'" + ukr "View SELECT ×ÉËÏÒÉÓÔÏ×Õ¤ ÔÉÍÞÁÓÏ×Õ ÔÁÂÌÉÃÀ '%-.192s'" ER_VIEW_WRONG_LIST eng "View's SELECT and view's field list have different column counts" ger "SELECT- und Feldliste der Views haben unterschiedliche Anzahlen von Spalten" @@ -5289,7 +5289,7 @@ ER_WARN_VIEW_WITHOUT_KEY rus "ïÂÎÏ×ÌÑÅÍÙÊ view ÎÅ ÓÏÄÅÒÖÉÔ ËÌÀÞÁ ÉÓÐÏÌØÚÏ×ÁÎÎÙÈ(ÏÊ) × ÎÅÍ ÔÁÂÌÉÃ(Ù)" ukr "View, ÝÏ ÏÎÏ×ÌÀÅÔØÓÑ, ΊͦÓÔÉÔØ ÐÏ×ÎÏÇÏ ËÌÀÞÁ ÔÁÂÌÉæ(Ø), ÝÏ ×ÉËÏÒ¦ÓÔÁÎÁ × ÎØÀÏÍÕ" ER_VIEW_INVALID - eng "View '%-.64s.%-.64s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them" + eng "View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them" ER_SP_NO_DROP_SP eng "Can't drop or alter a %s from within another stored routine" ger "Kann eine %s nicht von innerhalb einer anderen gespeicherten Routine löschen oder ändern" @@ -5303,8 +5303,8 @@ ER_TRG_DOES_NOT_EXIST eng "Trigger does not exist" ger "Trigger existiert nicht" ER_TRG_ON_VIEW_OR_TEMP_TABLE - eng "Trigger's '%-.64s' is view or temporary table" - ger "'%-.64s' des Triggers ist View oder temporäre Tabelle" + eng "Trigger's '%-.192s' is view or temporary table" + ger "'%-.192s' des Triggers ist View oder temporäre Tabelle" ER_TRG_CANT_CHANGE_ROW eng "Updating of %s row is not allowed in %strigger" ger "Aktualisieren einer %s-Zeile ist in einem %s-Trigger nicht erlaubt" @@ -5312,30 +5312,30 @@ ER_TRG_NO_SUCH_ROW_IN_TRG eng "There is no %s row in %s trigger" ger "Es gibt keine %s-Zeile im %s-Trigger" ER_NO_DEFAULT_FOR_FIELD - eng "Field '%-.64s' doesn't have a default value" - ger "Feld '%-.64s' hat keinen Vorgabewert" + eng "Field '%-.192s' doesn't have a default value" + ger "Feld '%-.192s' hat keinen Vorgabewert" ER_DIVISION_BY_ZERO 22012 eng "Division by 0" ger "Division durch 0" ER_TRUNCATED_WRONG_VALUE_FOR_FIELD - eng "Incorrect %-.32s value: '%-.128s' for column '%.64s' at row %ld" - ger "Falscher %-.32s-Wert: '%-.128s' für Feld '%.64s' in Zeile %ld" + eng "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %ld" + ger "Falscher %-.32s-Wert: '%-.128s' für Feld '%.192s' in Zeile %ld" ER_ILLEGAL_VALUE_FOR_TYPE 22007 - eng "Illegal %s '%-.64s' value found during parsing" - ger "Nicht zulässiger %s-Wert '%-.64s' beim Parsen gefunden" + eng "Illegal %s '%-.192s' value found during parsing" + ger "Nicht zulässiger %s-Wert '%-.192s' beim Parsen gefunden" ER_VIEW_NONUPD_CHECK - eng "CHECK OPTION on non-updatable view '%-.64s.%-.64s'" - ger "CHECK OPTION auf nicht-aktualisierbarem View '%-.64s.%-.64s'" - rus "CHECK OPTION ÄÌÑ ÎÅÏÂÎÏ×ÌÑÅÍÏÇÏ VIEW '%-.64s.%-.64s'" - ukr "CHECK OPTION ÄÌÑ VIEW '%-.64s.%-.64s' ÝÏ ÎÅ ÍÏÖÅ ÂÕÔÉ ÏÎÏ×ÌÅÎÎÉÍ" + eng "CHECK OPTION on non-updatable view '%-.192s.%-.192s'" + ger "CHECK OPTION auf nicht-aktualisierbarem View '%-.192s.%-.192s'" + rus "CHECK OPTION ÄÌÑ ÎÅÏÂÎÏ×ÌÑÅÍÏÇÏ VIEW '%-.192s.%-.192s'" + ukr "CHECK OPTION ÄÌÑ VIEW '%-.192s.%-.192s' ÝÏ ÎÅ ÍÏÖÅ ÂÕÔÉ ÏÎÏ×ÌÅÎÎÉÍ" ER_VIEW_CHECK_FAILED - eng "CHECK OPTION failed '%-.64s.%-.64s'" - ger "CHECK OPTION fehlgeschlagen: '%-.64s.%-.64s'" - rus "ÐÒÏ×ÅÒËÁ CHECK OPTION ÄÌÑ VIEW '%-.64s.%-.64s' ÐÒÏ×ÁÌÉÌÁÓØ" - ukr "ðÅÒÅצÒËÁ CHECK OPTION ÄÌÑ VIEW '%-.64s.%-.64s' ÎÅ ÐÒÏÊÛÌÁ" + eng "CHECK OPTION failed '%-.192s.%-.192s'" + ger "CHECK OPTION fehlgeschlagen: '%-.192s.%-.192s'" + rus "ÐÒÏ×ÅÒËÁ CHECK OPTION ÄÌÑ VIEW '%-.192s.%-.192s' ÐÒÏ×ÁÌÉÌÁÓØ" + ukr "ðÅÒÅצÒËÁ CHECK OPTION ÄÌÑ VIEW '%-.192s.%-.192s' ÎÅ ÐÒÏÊÛÌÁ" ER_PROCACCESS_DENIED_ERROR 42000 - eng "%-.16s command denied to user '%-.32s'@'%-.64s' for routine '%-.64s'" - ger "Befehl %-.16s nicht zulässig für Benutzer '%-.32s'@'%-.64s' in Routine '%-.64s'" + eng "%-.16s command denied to user '%-.48s'@'%-.64s' for routine '%-.192s'" + ger "Befehl %-.16s nicht zulässig für Benutzer '%-.48s'@'%-.64s' in Routine '%-.192s'" ER_RELAY_LOG_FAIL eng "Failed purging old relay logs: %s" ger "Bereinigen alter Relais-Logs fehlgeschlagen: %s" @@ -5397,28 +5397,28 @@ ER_PS_MANY_PARAM eng "Prepared statement contains too many placeholders" ger "Vorbereitete Anweisung enthält zu viele Platzhalter" ER_KEY_PART_0 - eng "Key part '%-.64s' length cannot be 0" - ger "Länge des Schlüsselteils '%-.64s' kann nicht 0 sein" + eng "Key part '%-.192s' length cannot be 0" + ger "Länge des Schlüsselteils '%-.192s' kann nicht 0 sein" ER_VIEW_CHECKSUM eng "View text checksum failed" ger "View-Text-Prüfsumme fehlgeschlagen" rus "ðÒÏ×ÅÒËÁ ËÏÎÔÒÏÌØÎÏÊ ÓÕÍÍÙ ÔÅËÓÔÁ VIEW ÐÒÏ×ÁÌÉÌÁÓØ" ukr "ðÅÒÅצÒËÁ ËÏÎÔÒÏÌØÎϧ ÓÕÍÉ ÔÅËÓÔÕ VIEW ÎÅ ÐÒÏÊÛÌÁ" ER_VIEW_MULTIUPDATE - eng "Can not modify more than one base table through a join view '%-.64s.%-.64s'" - ger "Kann nicht mehr als eine Basistabelle über Join-View '%-.64s.%-.64s' ändern" - rus "îÅÌØÚÑ ÉÚÍÅÎÉÔØ ÂÏÌØÛÅ ÞÅÍ ÏÄÎÕ ÂÁÚÏ×ÕÀ ÔÁÂÌÉÃÕ ÉÓÐÏÌØÚÕÑ ÍÎÏÇÏÔÁÂÌÉÞÎÙÊ VIEW '%-.64s.%-.64s'" - ukr "îÅÍÏÖÌÉ×Ï ÏÎÏ×ÉÔÉ Â¦ÌØÛ ÎÉÖ ÏÄÎÕ ÂÁÚÏ×Õ ÔÁÂÌÉÃÀ ×ÙËÏÒÉÓÔÏ×ÕÀÞÉ VIEW '%-.64s.%-.64s', ÝÏ Í¦ÓÔ¦ÔØ ÄÅË¦ÌØËÁ ÔÁÂÌÉÃØ" + eng "Can not modify more than one base table through a join view '%-.192s.%-.192s'" + ger "Kann nicht mehr als eine Basistabelle über Join-View '%-.192s.%-.192s' ändern" + rus "îÅÌØÚÑ ÉÚÍÅÎÉÔØ ÂÏÌØÛÅ ÞÅÍ ÏÄÎÕ ÂÁÚÏ×ÕÀ ÔÁÂÌÉÃÕ ÉÓÐÏÌØÚÕÑ ÍÎÏÇÏÔÁÂÌÉÞÎÙÊ VIEW '%-.192s.%-.192s'" + ukr "îÅÍÏÖÌÉ×Ï ÏÎÏ×ÉÔÉ Â¦ÌØÛ ÎÉÖ ÏÄÎÕ ÂÁÚÏ×Õ ÔÁÂÌÉÃÀ ×ÙËÏÒÉÓÔÏ×ÕÀÞÉ VIEW '%-.192s.%-.192s', ÝÏ Í¦ÓÔ¦ÔØ ÄÅË¦ÌØËÁ ÔÁÂÌÉÃØ" ER_VIEW_NO_INSERT_FIELD_LIST - eng "Can not insert into join view '%-.64s.%-.64s' without fields list" - ger "Kann nicht ohne Feldliste in Join-View '%-.64s.%-.64s' einfügen" - rus "îÅÌØÚÑ ×ÓÔÁ×ÌÑÔØ ÚÁÐÉÓÉ × ÍÎÏÇÏÔÁÂÌÉÞÎÙÊ VIEW '%-.64s.%-.64s' ÂÅÚ ÓÐÉÓËÁ ÐÏÌÅÊ" - ukr "îÅÍÏÖÌÉ×Ï ÕÓÔÁ×ÉÔÉ ÒÑÄËÉ Õ VIEW '%-.64s.%-.64s', ÝÏ Í¦ÓÔÉÔØ ÄÅË¦ÌØËÁ ÔÁÂÌÉÃØ, ÂÅÚ ÓÐÉÓËÕ ÓÔÏ×Âæ×" + eng "Can not insert into join view '%-.192s.%-.192s' without fields list" + ger "Kann nicht ohne Feldliste in Join-View '%-.192s.%-.192s' einfügen" + rus "îÅÌØÚÑ ×ÓÔÁ×ÌÑÔØ ÚÁÐÉÓÉ × ÍÎÏÇÏÔÁÂÌÉÞÎÙÊ VIEW '%-.192s.%-.192s' ÂÅÚ ÓÐÉÓËÁ ÐÏÌÅÊ" + ukr "îÅÍÏÖÌÉ×Ï ÕÓÔÁ×ÉÔÉ ÒÑÄËÉ Õ VIEW '%-.192s.%-.192s', ÝÏ Í¦ÓÔÉÔØ ÄÅË¦ÌØËÁ ÔÁÂÌÉÃØ, ÂÅÚ ÓÐÉÓËÕ ÓÔÏ×Âæ×" ER_VIEW_DELETE_MERGE_VIEW - eng "Can not delete from join view '%-.64s.%-.64s'" - ger "Kann nicht aus Join-View '%-.64s.%-.64s' löschen" - rus "îÅÌØÚÑ ÕÄÁÌÑÔØ ÉÚ ÍÎÏÇÏÔÁÂÌÉÞÎÏÇÏ VIEW '%-.64s.%-.64s'" - ukr "îÅÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÑÄËÉ Õ VIEW '%-.64s.%-.64s', ÝÏ Í¦ÓÔÉÔØ ÄÅË¦ÌØËÁ ÔÁÂÌÉÃØ" + eng "Can not delete from join view '%-.192s.%-.192s'" + ger "Kann nicht aus Join-View '%-.192s.%-.192s' löschen" + rus "îÅÌØÚÑ ÕÄÁÌÑÔØ ÉÚ ÍÎÏÇÏÔÁÂÌÉÞÎÏÇÏ VIEW '%-.192s.%-.192s'" + ukr "îÅÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÑÄËÉ Õ VIEW '%-.192s.%-.192s', ÝÏ Í¦ÓÔÉÔØ ÄÅË¦ÌØËÁ ÔÁÂÌÉÃØ" ER_CANNOT_USER eng "Operation %s failed for %.256s" ger "Operation %s schlug fehl für %.256s" @@ -5443,8 +5443,8 @@ ER_XA_RBROLLBACK XA100 eng "XA_RBROLLBACK: Transaction branch was rolled back" ger "XA_RBROLLBACK: Transaktionszweig wurde zurückgerollt" ER_NONEXISTING_PROC_GRANT 42000 - eng "There is no such grant defined for user '%-.32s' on host '%-.64s' on routine '%-.64s'" - ger "Es gibt diese Berechtigung für Benutzer '%-.32s' auf Host '%-.64s' für Routine '%-.64s' nicht" + eng "There is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'" + ger "Es gibt diese Berechtigung für Benutzer '%-.48s' auf Host '%-.64s' für Routine '%-.192s' nicht" ER_PROC_AUTO_GRANT_FAIL eng "Failed to grant EXECUTE and ALTER ROUTINE privileges" ger "Gewährung von EXECUTE- und ALTER-ROUTINE-Rechten fehlgeschlagen" @@ -5503,20 +5503,20 @@ ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG eng "Explicit or implicit commit is not allowed in stored function or trigger." ger "Explizites oder implizites Commit ist in gespeicherten Funktionen und in Triggern nicht erlaubt" ER_NO_DEFAULT_FOR_VIEW_FIELD - eng "Field of view '%-.64s.%-.64s' underlying table doesn't have a default value" - ger "Ein Feld der dem View '%-.64s.%-.64s' zugrundeliegenden Tabelle hat keinen Vorgabewert" + eng "Field of view '%-.192s.%-.192s' underlying table doesn't have a default value" + ger "Ein Feld der dem View '%-.192s.%-.192s' zugrundeliegenden Tabelle hat keinen Vorgabewert" ER_SP_NO_RECURSION eng "Recursive stored functions and triggers are not allowed." ger "Rekursive gespeicherte Routinen und Triggers sind nicht erlaubt" ER_TOO_BIG_SCALE 42000 S1009 - eng "Too big scale %d specified for column '%-.64s'. Maximum is %d." - ger "Zu großer Skalierungsfaktor %d für Feld '%-.64s' angegeben. Maximum ist %d" + eng "Too big scale %d specified for column '%-.192s'. Maximum is %d." + ger "Zu großer Skalierungsfaktor %d für Feld '%-.192s' angegeben. Maximum ist %d" ER_TOO_BIG_PRECISION 42000 S1009 - eng "Too big precision %d specified for column '%-.64s'. Maximum is %d." - ger "Zu große Genauigkeit %d für Feld '%-.64s' angegeben. Maximum ist %d" + eng "Too big precision %d specified for column '%-.192s'. Maximum is %d." + ger "Zu große Genauigkeit %d für Feld '%-.192s' angegeben. Maximum ist %d" ER_M_BIGGER_THAN_D 42000 S1009 - eng "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.64s')." - ger "Für FLOAT(M,D), DOUBLE(M,D) oder DECIMAL(M,D) muss M >= D sein (Feld '%-.64s')" + eng "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')." + ger "Für FLOAT(M,D), DOUBLE(M,D) oder DECIMAL(M,D) muss M >= D sein (Feld '%-.192s')" ER_WRONG_LOCK_OF_SYSTEM_TABLE eng "You can't combine write-locking of system tables with other tables or lock types" ER_CONNECT_TO_FOREIGN_DATA_SOURCE @@ -5550,8 +5550,8 @@ ER_WARN_CANT_DROP_DEFAULT_KEYCACHE eng "Cannot drop default keycache" ger "Der vorgabemäßige Schlüssel-Cache kann nicht gelöscht werden" ER_TOO_BIG_DISPLAYWIDTH 42000 S1009 - eng "Display width out of range for column '%-.64s' (max = %d)" - ger "Anzeigebreite außerhalb des zulässigen Bereichs für Spalte '%-.64s' (Maximum: %d)" + eng "Display width out of range for column '%-.192s' (max = %d)" + ger "Anzeigebreite außerhalb des zulässigen Bereichs für Spalte '%-.192s' (Maximum: %d)" ER_XAER_DUPID XAE08 eng "XAER_DUPID: The XID already exists" ger "XAER_DUPID: Die XID existiert bereits" @@ -5559,11 +5559,11 @@ ER_DATETIME_FUNCTION_OVERFLOW 22008 eng "Datetime function: %-.32s field overflow" ger "Datetime-Funktion: %-.32s Feldüberlauf" ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG - eng "Can't update table '%-.64s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger." - ger "Kann Tabelle '%-.64s' in gespeicherter Funktion oder Trigger nicht aktualisieren, weil sie bereits von der Anweisung verwendet wird, die diese gespeicherte Funktion oder den Trigger aufrief" + eng "Can't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger." + ger "Kann Tabelle '%-.192s' in gespeicherter Funktion oder Trigger nicht aktualisieren, weil sie bereits von der Anweisung verwendet wird, die diese gespeicherte Funktion oder den Trigger aufrief" ER_VIEW_PREVENT_UPDATE - eng "The definition of table '%-.64s' prevents operation %.64s on table '%-.64s'." - ger "Die Definition der Tabelle '%-.64s' verhindert die Operation %.64s auf Tabelle '%-.64s'" + eng "The definition of table '%-.192s' prevents operation %.192s on table '%-.192s'." + ger "Die Definition der Tabelle '%-.192s' verhindert die Operation %.192s auf Tabelle '%-.192s'" ER_PS_NO_RECURSION eng "The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner" ger "Die vorbereitete Anweisung enthält einen Aufruf einer gespeicherten Routine, die auf eben dieselbe Anweisung verweist. Es ist nicht erlaubt, eine vorbereitete Anweisung in solch rekursiver Weise auszuführen" @@ -5574,17 +5574,17 @@ ER_MALFORMED_DEFINER eng "Definer is not fully qualified" ger "Definierer des View ist nicht vollständig spezifiziert" ER_VIEW_FRM_NO_USER - eng "View '%-.64s'.'%-.64s' has no definer information (old table format). Current user is used as definer. Please recreate the view!" - ger "View '%-.64s'.'%-.64s' hat keine Definierer-Information (altes Tabellenformat). Der aktuelle Benutzer wird als Definierer verwendet. Bitte erstellen Sie den View neu" + eng "View '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!" + ger "View '%-.192s'.'%-.192s' hat keine Definierer-Information (altes Tabellenformat). Der aktuelle Benutzer wird als Definierer verwendet. Bitte erstellen Sie den View neu" ER_VIEW_OTHER_USER - eng "You need the SUPER privilege for creation view with '%-.64s'@'%-.64s' definer" - ger "Sie brauchen die SUPER-Berechtigung, um einen View mit dem Definierer '%-.64s'@'%-.64s' zu erzeugen" + eng "You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definer" + ger "Sie brauchen die SUPER-Berechtigung, um einen View mit dem Definierer '%-.192s'@'%-.192s' zu erzeugen" ER_NO_SUCH_USER eng "There is no '%-.64s'@'%-.64s' registered" ger "'%-.64s'@'%-.64s' ist nicht registriert" ER_FORBID_SCHEMA_CHANGE - eng "Changing schema from '%-.64s' to '%-.64s' is not allowed." - ger "Wechsel des Schemas von '%-.64s' auf '%-.64s' ist nicht erlaubt" + eng "Changing schema from '%-.192s' to '%-.192s' is not allowed." + ger "Wechsel des Schemas von '%-.192s' auf '%-.192s' ist nicht erlaubt" ER_ROW_IS_REFERENCED_2 23000 eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)" ger "Kann Eltern-Zeile nicht löschen oder aktualisieren: eine Fremdschlüsselbedingung schlägt fehl (%.192s)" @@ -5595,22 +5595,22 @@ ER_SP_BAD_VAR_SHADOW 42000 eng "Variable '%-.64s' must be quoted with `...`, or renamed" ger "Variable '%-.64s' muss mit `...` geschützt oder aber umbenannt werden" ER_TRG_NO_DEFINER - eng "No definer attribute for trigger '%-.64s'.'%-.64s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger." - ger "Kein Definierer-Attribut für Trigger '%-.64s'.'%-.64s'. Der Trigger wird mit der Autorisierung des Aufrufers aktiviert, der möglicherweise keine zureichenden Berechtigungen hat. Bitte legen Sie den Trigger neu an." + eng "No definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger." + ger "Kein Definierer-Attribut für Trigger '%-.192s'.'%-.192s'. Der Trigger wird mit der Autorisierung des Aufrufers aktiviert, der möglicherweise keine zureichenden Berechtigungen hat. Bitte legen Sie den Trigger neu an." ER_OLD_FILE_FORMAT - eng "'%-.64s' has an old format, you should re-create the '%s' object(s)" - ger "'%-.64s' hat altes Format, Sie sollten die '%s'-Objekt(e) neu erzeugen" + eng "'%-.192s' has an old format, you should re-create the '%s' object(s)" + ger "'%-.192s' hat altes Format, Sie sollten die '%s'-Objekt(e) neu erzeugen" ER_SP_RECURSION_LIMIT - eng "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.64s" - ger "Rekursionsgrenze %d (durch Variable max_sp_recursion_depth gegeben) wurde für Routine %.64s überschritten" + eng "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192s" + ger "Rekursionsgrenze %d (durch Variable max_sp_recursion_depth gegeben) wurde für Routine %.192s überschritten" ER_SP_PROC_TABLE_CORRUPT - eng "Failed to load routine %-.64s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)" - ger "Routine %-.64s konnte nicht geladen werden. Die Tabelle mysql.proc fehlt, ist beschädigt, oder enthält fehlerhaften Daten (interner Code: %d)" + eng "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)" + ger "Routine %-.192s konnte nicht geladen werden. Die Tabelle mysql.proc fehlt, ist beschädigt, oder enthält fehlerhaften Daten (interner Code: %d)" ER_FOREIGN_SERVER_EXISTS eng "The foreign server, %s, you are trying to create already exists." ER_SP_WRONG_NAME 42000 - eng "Incorrect routine name '%-.64s'" - ger "Ungültiger Routinenname '%-.64s'" + eng "Incorrect routine name '%-.192s'" + ger "Ungültiger Routinenname '%-.192s'" ER_TABLE_NEEDS_UPGRADE eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!" ger "Tabellenaktualisierung erforderlich. Bitte zum Reparieren \"REPAIR TABLE `%-.32s`\" eingeben!" @@ -5621,11 +5621,11 @@ ER_MAX_PREPARED_STMT_COUNT_REACHED 42000 eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)" ger "Kann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %lu)" ER_VIEW_RECURSIVE - eng "`%-.64s`.`%-.64s` contains view recursion" - ger "`%-.64s`.`%-.64s` enthält View-Rekursion" + eng "`%-.192s`.`%-.192s` contains view recursion" + ger "`%-.192s`.`%-.192s` enthält View-Rekursion" ER_NON_GROUPING_FIELD_USED 42000 - eng "non-grouping field '%-.64s' is used in %-.64s clause" - ger "In der %-.64s-Klausel wird das die Nicht-Gruppierungsspalte '%-.64s' verwendet" + eng "non-grouping field '%-.192s' is used in %-.64s clause" + ger "In der %-.192s-Klausel wird das die Nicht-Gruppierungsspalte '%-.64s' verwendet" ER_TABLE_CANT_HANDLE_SPKEYS eng "The used table type doesn't support SPATIAL indexes" ger "Der verwendete Tabellentyp unterstützt keine SPATIAL-Indizes" @@ -5681,9 +5681,9 @@ ER_INCONSISTENT_PARTITION_INFO_ERROR ger "Die Partitionierungsinformationen in der frm-Datei stimmen nicht mit dem überein, was in die frm-Datei geschrieben werden kann" swe "Partitioneringsinformationen i frm-filen är inte konsistent med vad som kan skrivas i frm-filen" ER_PARTITION_FUNC_NOT_ALLOWED_ERROR - eng "The %-.64s function returns the wrong type" - ger "Die %-.64s-Funktion gibt einen falschen Typ zurück" - swe "%-.64s-funktionen returnerar felaktig typ" + eng "The %-.192s function returns the wrong type" + ger "Die %-.192s-Funktion gibt einen falschen Typ zurück" + swe "%-.192s-funktionen returnerar felaktig typ" ER_PARTITIONS_MUST_BE_DEFINED_ERROR eng "For %-.64s partitions each partition must be defined" ger "Für %-.64s-Partitionen muss jede Partition definiert sein" @@ -5729,7 +5729,7 @@ ER_BLOB_FIELD_IN_PART_FUNC_ERROR ger "In der Partitionierungsfunktion sind BLOB-Spalten nicht erlaubt" swe "Ett BLOB-fält är inte tillåtet i partitioneringsfunktioner" ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF - eng "A %-.64s must include all columns in the table's partitioning function" + eng "A %-.192s must include all columns in the table's partitioning function" ER_NO_PARTS_ERROR eng "Number of %-.64s = 0 is not an allowed value" ger "Eine Anzahl von %-.64s = 0 ist kein erlaubter Wert" @@ -5783,9 +5783,9 @@ ER_REORG_PARTITION_NOT_EXIST ger "Es wurde versucht, mehr Partitionen als vorhanden zu reorganisieren" swe "Fler partitioner att reorganisera än det finns partitioner" ER_SAME_NAME_PARTITION - eng "Duplicate partition name %-.64s" - ger "Doppelter Partitionsname: %-.64s" - swe "Duplicerat partitionsnamn %-.64s" + eng "Duplicate partition name %-.192s" + ger "Doppelter Partitionsname: %-.192s" + swe "Duplicerat partitionsnamn %-.192s" ER_NO_BINLOG_ERROR eng "It is not allowed to shut off binlog on this command" ger "Es es nicht erlaubt, bei diesem Befehl binlog abzuschalten" @@ -5810,8 +5810,8 @@ ER_LIMITED_PART_RANGE ger "Der Handler %-.64s unterstützt in VALUES nur 32-Bit-Integers" swe "%-.64s stödjer endast 32 bitar i integers i VALUES" ER_PLUGIN_IS_NOT_LOADED - eng "Plugin '%-.64s' is not loaded" - ger "Plugin '%-.64s' ist nicht geladen" + eng "Plugin '%-.192s' is not loaded" + ger "Plugin '%-.192s' ist nicht geladen" ER_WRONG_VALUE eng "Incorrect %-.32s value: '%-.128s'" ger "Falscher %-.32s-Wert: '%-.128s'" @@ -5852,17 +5852,17 @@ ER_FOREIGN_SERVER_DOESNT_EXIST eng "The foreign server name you are trying to reference does not exist. Data source error: %-.64s" ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s" ER_EVENT_ALREADY_EXISTS - eng "Event '%-.64s' already exists" - ger "Event '%-.64s' existiert bereits" + eng "Event '%-.192s' already exists" + ger "Event '%-.192s' existiert bereits" ER_EVENT_STORE_FAILED eng "Failed to store event %s. Error code %d from storage engine." ger "Speichern von Event %s fehlgeschlagen. Fehlercode der Speicher-Engine: %d" ER_EVENT_DOES_NOT_EXIST - eng "Unknown event '%-.64s'" - ger "Unbekanntes Event '%-.64s'" + eng "Unknown event '%-.192s'" + ger "Unbekanntes Event '%-.192s'" ER_EVENT_CANT_ALTER - eng "Failed to alter event '%-.64s'" - ger "Ändern des Events '%-.64s' fehlgeschlagen" + eng "Failed to alter event '%-.192s'" + ger "Ändern des Events '%-.192s' fehlgeschlagen" ER_EVENT_DROP_FAILED eng "Failed to drop %s" ger "Löschen von %s fehlgeschlagen" @@ -5899,8 +5899,8 @@ ER_EVENT_DATA_TOO_LONG eng "Data for column '%s' too long" ger "Daten der Spalte '%s' zu lang" ER_DROP_INDEX_FK - eng "Cannot drop index '%-.64s': needed in a foreign key constraint" - ger "Kann Index '%-.64s' nicht löschen: wird für einen Fremdschlüssel benötigt" + eng "Cannot drop index '%-.192s': needed in a foreign key constraint" + ger "Kann Index '%-.192s' nicht löschen: wird für einen Fremdschlüssel benötigt" ER_WARN_DEPRECATED_SYNTAX eng "The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead" ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt. Bitte benutzen Sie statt dessen %s" @@ -5911,8 +5911,8 @@ ER_CANT_READ_LOCK_LOG_TABLE eng "You can't use usual read lock with log tables. Try READ LOCAL instead" ger "Log-Tabellen können nicht mit normalen Lesesperren gesperrt werden. Verwenden Sie statt dessen READ LOCAL" ER_FOREIGN_DUPLICATE_KEY 23000 S1009 - eng "Upholding foreign key constraints for table '%.64s', entry '%-.64s', key %d would lead to a duplicate entry" - ger "Aufrechterhalten der Fremdschlüssel-Constraints für Tabelle '%.64s', Eintrag '%-.64s', Schlüssel %d würde zu einem doppelten Eintrag führen" + eng "Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry" + ger "Aufrechterhalten der Fremdschlüssel-Constraints für Tabelle '%.192s', Eintrag '%-.192s', Schlüssel %d würde zu einem doppelten Eintrag führen" ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use scripts/mysql_fix_privilege_tables" ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie scripts/mysql_fix_privilege_tables, um den Fehler zu beheben" @@ -5954,8 +5954,8 @@ ER_CANT_CHANGE_TX_ISOLATION 25001 eng "Transaction isolation level can't be changed while a transaction is in progress" ger "Transaktionsisolationsebene kann während einer laufenden Transaktion nicht geändert werden" ER_DUP_ENTRY_AUTOINCREMENT_CASE - eng "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.64s' for key '%-.64s'" - ger "ALTER TABLE führt zur Neusequenzierung von auto_increment, wodurch der doppelte Eintrag '%-.64s' für Schlüssel '%-.64s' auftritt" + eng "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192s' for key '%-.192s'" + ger "ALTER TABLE führt zur Neusequenzierung von auto_increment, wodurch der doppelte Eintrag '%-.192s' für Schlüssel '%-.192s' auftritt" ER_EVENT_MODIFY_QUEUE_ERROR eng "Internal scheduler error %d" ger "Interner Scheduler-Fehler %d" @@ -6012,42 +6012,42 @@ ER_CANT_RENAME_LOG_TABLE eng "Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'" ger "Kann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen beim Umbenennen zu/von einer Logtabelle zwei Tabellen angegeben werden: die Logtabelle zu einer Archivtabelle und eine weitere Tabelle zurück zu '%s'" ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 42000 - eng "Incorrect parameter count in the call to native function '%-.64s'" - ger "Falsche Anzahl von Parametern beim Aufruf der nativen Funktion '%-.64s'" + eng "Incorrect parameter count in the call to native function '%-.192s'" + ger "Falsche Anzahl von Parametern beim Aufruf der nativen Funktion '%-.192s'" ER_WRONG_PARAMETERS_TO_NATIVE_FCT 42000 - eng "Incorrect parameters in the call to native function '%-.64s'" - ger "Falscher Parameter beim Aufruf der nativen Funktion '%-.64s'" + eng "Incorrect parameters in the call to native function '%-.192s'" + ger "Falscher Parameter beim Aufruf der nativen Funktion '%-.192s'" ER_WRONG_PARAMETERS_TO_STORED_FCT 42000 - eng "Incorrect parameters in the call to stored function '%-.64s'" - ger "Falsche Parameter beim Aufruf der gespeicherten Funktion '%-.64s'" + eng "Incorrect parameters in the call to stored function '%-.192s'" + ger "Falsche Parameter beim Aufruf der gespeicherten Funktion '%-.192s'" ER_NATIVE_FCT_NAME_COLLISION - eng "This function '%-.64s' has the same name as a native function" - ger "Die Funktion '%-.64s' hat denselben Namen wie eine native Funktion" + eng "This function '%-.192s' has the same name as a native function" + ger "Die Funktion '%-.192s' hat denselben Namen wie eine native Funktion" ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009 - cze "Zvojen-Bý klíè '%-.64s' (èíslo klíèe '%-.64s')" - dan "Ens værdier '%-.64s' for indeks '%-.64s'" - nla "Dubbele ingang '%-.64s' voor zoeksleutel '%-.64s'" - eng "Duplicate entry '%-.64s' for key '%-.64s'" - jps "'%-.64s' ‚Í key '%-.64s' ‚É‚¨‚¢‚Äd•¡‚µ‚Ä‚¢‚Ü‚·", - est "Kattuv väärtus '%-.64s' võtmele '%-.64s'" - fre "Duplicata du champ '%-.64s' pour la clef '%-.64s'" - ger "Doppelter Eintrag '%-.64s' für Schlüssel '%-.64s'" - greek "ÄéðëÞ åããñáöÞ '%-.64s' ãéá ôï êëåéäß '%-.64s'" - hun "Duplikalt bejegyzes '%-.64s' a '%-.64s' kulcs szerint." - ita "Valore duplicato '%-.64s' per la chiave '%-.64s'" - jpn "'%-.64s' ¤Ï key '%-.64s' ¤Ë¤ª¤¤¤Æ½ÅÊ£¤·¤Æ¤¤¤Þ¤¹" - kor "Áߺ¹µÈ ÀÔ·Â °ª '%-.64s': key '%-.64s'" - nor "Like verdier '%-.64s' for nøkkel '%-.64s'" - norwegian-ny "Like verdiar '%-.64s' for nykkel '%-.64s'" - pol "Powtórzone wyst?pienie '%-.64s' dla klucza '%-.64s'" - por "Entrada '%-.64s' duplicada para a chave '%-.64s'" - rum "Cimpul '%-.64s' e duplicat pentru cheia '%-.64s'" - rus "äÕÂÌÉÒÕÀÝÁÑÓÑ ÚÁÐÉÓØ '%-.64s' ÐÏ ËÌÀÞÕ '%-.64s'" - serbian "Dupliran unos '%-.64s' za kljuè '%-.64s'" - slo "Opakovaný kµúè '%-.64s' (èíslo kµúèa '%-.64s')" - spa "Entrada duplicada '%-.64s' para la clave '%-.64s'" - swe "Dubbel nyckel '%-.64s' för nyckel '%-.64s'" - ukr "äÕÂÌÀÀÞÉÊ ÚÁÐÉÓ '%-.64s' ÄÌÑ ËÌÀÞÁ '%-.64s'" + cze "Zvojen-Bý klíè '%-.64s' (èíslo klíèe '%-.192s')" + dan "Ens værdier '%-.64s' for indeks '%-.192s'" + nla "Dubbele ingang '%-.64s' voor zoeksleutel '%-.192s'" + eng "Duplicate entry '%-.64s' for key '%-.192s'" + jps "'%-.64s' ‚Í key '%-.192s' ‚É‚¨‚¢‚Äd•¡‚µ‚Ä‚¢‚Ü‚·", + est "Kattuv väärtus '%-.64s' võtmele '%-.192s'" + fre "Duplicata du champ '%-.64s' pour la clef '%-.192s'" + ger "Doppelter Eintrag '%-.64s' für Schlüssel '%-.192s'" + greek "ÄéðëÞ åããñáöÞ '%-.64s' ãéá ôï êëåéäß '%-.192s'" + hun "Duplikalt bejegyzes '%-.64s' a '%-.192s' kulcs szerint." + ita "Valore duplicato '%-.64s' per la chiave '%-.192s'" + jpn "'%-.64s' ¤Ï key '%-.192s' ¤Ë¤ª¤¤¤Æ½ÅÊ£¤·¤Æ¤¤¤Þ¤¹" + kor "Áߺ¹µÈ ÀÔ·Â °ª '%-.64s': key '%-.192s'" + nor "Like verdier '%-.64s' for nøkkel '%-.192s'" + norwegian-ny "Like verdiar '%-.64s' for nykkel '%-.192s'" + pol "Powtórzone wyst?pienie '%-.64s' dla klucza '%-.192s'" + por "Entrada '%-.64s' duplicada para a chave '%-.192s'" + rum "Cimpul '%-.64s' e duplicat pentru cheia '%-.192s'" + rus "äÕÂÌÉÒÕÀÝÁÑÓÑ ÚÁÐÉÓØ '%-.64s' ÐÏ ËÌÀÞÕ '%-.192s'" + serbian "Dupliran unos '%-.64s' za kljuè '%-.192s'" + slo "Opakovaný kµúè '%-.64s' (èíslo kµúèa '%-.192s')" + spa "Entrada duplicada '%-.64s' para la clave '%-.192s'" + swe "Dubbel nyckel '%-.64s' för nyckel '%-.192s'" + ukr "äÕÂÌÀÀÞÉÊ ÚÁÐÉÓ '%-.64s' ÄÌÑ ËÌÀÞÁ '%-.192s'" ER_BINLOG_PURGE_EMFILE eng "Too many files opened, please execute the command again" ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus" diff --git a/sql/sp.cc b/sql/sp.cc index c1a9aac0c24..44d7807f23c 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -682,15 +682,15 @@ struct st_used_field static struct st_used_field init_fields[]= { - { "Db", NAME_LEN, MYSQL_TYPE_STRING, 0}, - { "Name", NAME_LEN, MYSQL_TYPE_STRING, 0}, - { "Type", 9, MYSQL_TYPE_STRING, 0}, - { "Definer", 77, MYSQL_TYPE_STRING, 0}, - { "Modified", 0, MYSQL_TYPE_TIMESTAMP, 0}, - { "Created", 0, MYSQL_TYPE_TIMESTAMP, 0}, - { "Security_type", 1, MYSQL_TYPE_STRING, 0}, - { "Comment", NAME_LEN, MYSQL_TYPE_STRING, 0}, - { 0, 0, MYSQL_TYPE_STRING, 0} + { "Db", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0}, + { "Name", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0}, + { "Type", 9, MYSQL_TYPE_STRING, 0}, + { "Definer", 77, MYSQL_TYPE_STRING, 0}, + { "Modified", 0, MYSQL_TYPE_TIMESTAMP, 0}, + { "Created", 0, MYSQL_TYPE_TIMESTAMP, 0}, + { "Security_type", 1, MYSQL_TYPE_STRING, 0}, + { "Comment", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0}, + { 0, 0, MYSQL_TYPE_STRING, 0} }; @@ -1598,10 +1598,8 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, rest of the server checks agains NAME_LEN bytes and not chars. Hence, the overrun happens only if the name is in length > 32 and uses multibyte (cyrillic, greek, etc.) - - !! Change 3 with SYSTEM_CHARSET_MBMAXLEN when it's defined. */ - char n[NAME_LEN*3*2+2]; + char n[NAME_LEN*2+2]; /* m_qname.str is not always \0 terminated */ memcpy(n, name.m_qname.str, name.m_qname.length); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index f5e32847fb0..cb4a50eefe8 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -408,9 +408,22 @@ sp_name::init_qname(THD *thd) */ bool -check_routine_name(LEX_STRING ident) +check_routine_name(LEX_STRING *ident) { - return (!ident.str || !ident.str[0] || ident.str[ident.length-1] == ' '); + if (!ident || !ident->str || !ident->str[0] || + ident->str[ident->length-1] == ' ') + { + my_error(ER_SP_WRONG_NAME, MYF(0), ident->str); + return TRUE; + } + if (check_string_char_length(ident, "", NAME_CHAR_LEN, + system_charset_info, 1)) + { + my_error(ER_TOO_LONG_IDENT, MYF(0), ident->str); + return TRUE; + } + + return FALSE; } /* ------------------------------------------------------------------ */ @@ -2121,7 +2134,7 @@ sp_head::show_create_procedure(THD *thd) sys_var_thd_sql_mode::symbolic_mode_representation(thd, m_sql_mode, &sql_mode_len); - field_list.push_back(new Item_empty_string("Procedure", NAME_LEN)); + field_list.push_back(new Item_empty_string("Procedure", NAME_CHAR_LEN)); field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); // 1024 is for not to confuse old clients Item_empty_string *definition= @@ -2192,7 +2205,7 @@ sp_head::show_create_function(THD *thd) sys_var_thd_sql_mode::symbolic_mode_representation(thd, m_sql_mode, &sql_mode_len); - field_list.push_back(new Item_empty_string("Function",NAME_LEN)); + field_list.push_back(new Item_empty_string("Function",NAME_CHAR_LEN)); field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); Item_empty_string *definition= new Item_empty_string("Create Function", max(buffer.length(),1024)); diff --git a/sql/sp_head.h b/sql/sp_head.h index 19dc2dac476..5e38bbebd4c 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -95,7 +95,7 @@ public: bool -check_routine_name(LEX_STRING name); +check_routine_name(LEX_STRING *ident); class sp_head :private Query_arena { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index cc38d63c9f9..0abda16ea6a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -898,7 +898,7 @@ int THD::send_explain_fields(select_result *result) CHARSET_INFO *cs= system_charset_info; field_list.push_back(new Item_return_int("id",3, MYSQL_TYPE_LONGLONG)); field_list.push_back(new Item_empty_string("select_type", 19, cs)); - field_list.push_back(item= new Item_empty_string("table", NAME_LEN, cs)); + field_list.push_back(item= new Item_empty_string("table", NAME_CHAR_LEN, cs)); item->maybe_null= 1; if (lex->describe & DESCRIBE_PARTITIONS) { @@ -911,15 +911,16 @@ int THD::send_explain_fields(select_result *result) field_list.push_back(item= new Item_empty_string("type", 10, cs)); item->maybe_null= 1; field_list.push_back(item=new Item_empty_string("possible_keys", - NAME_LEN*MAX_KEY, cs)); + NAME_CHAR_LEN*MAX_KEY, cs)); item->maybe_null=1; - field_list.push_back(item=new Item_empty_string("key", NAME_LEN, cs)); + field_list.push_back(item=new Item_empty_string("key", NAME_CHAR_LEN, cs)); item->maybe_null=1; field_list.push_back(item=new Item_empty_string("key_len", - NAME_LEN*MAX_KEY)); + NAME_CHAR_LEN*MAX_KEY)); item->maybe_null=1; field_list.push_back(item=new Item_empty_string("ref", - NAME_LEN*MAX_REF_PARTS, cs)); + NAME_CHAR_LEN*MAX_REF_PARTS, + cs)); item->maybe_null=1; field_list.push_back(item= new Item_return_int("rows", 10, MYSQL_TYPE_LONGLONG)); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 17f1c73dbcb..783b1b43759 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3218,12 +3218,6 @@ end_with_restore_list: is_schema_db(lex->spname->m_db.str))) break; - if (lex->spname->m_name.length > NAME_LEN) - { - my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str); - /* this jumps to the end of the function and skips own messaging */ - goto error; - } if (lex->sql_command == SQLCOM_SHOW_CREATE_EVENT) res= Events::get_instance()->show_create_event(thd, lex->spname->m_db, @@ -3996,11 +3990,6 @@ create_sp_error: } case SQLCOM_SHOW_CREATE_PROC: { - if (lex->spname->m_name.length > NAME_LEN) - { - my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str); - goto error; - } if (sp_show_create_procedure(thd, lex->spname) != SP_OK) { /* We don't distinguish between errors for now */ my_error(ER_SP_DOES_NOT_EXIST, MYF(0), @@ -4011,11 +4000,6 @@ create_sp_error: } case SQLCOM_SHOW_CREATE_FUNC: { - if (lex->spname->m_name.length > NAME_LEN) - { - my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str); - goto error; - } if (sp_show_create_function(thd, lex->spname) != SP_OK) { /* We don't distinguish between errors for now */ my_error(ER_SP_DOES_NOT_EXIST, MYF(0), @@ -4044,11 +4028,6 @@ create_sp_error: { sp_head *sp; - if (lex->spname->m_name.length > NAME_LEN) - { - my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str); - goto error; - } if (lex->sql_command == SQLCOM_SHOW_PROC_CODE) sp= sp_find_routine(thd, TYPE_ENUM_PROCEDURE, lex->spname, &thd->sp_proc_cache, FALSE); @@ -5332,7 +5311,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) ** Return 0 if ok ******************************************************************************/ -bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, +bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type, char *length, char *decimals, uint type_modifier, Item *default_value, Item *on_update_value, @@ -5345,14 +5324,15 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, LEX *lex= thd->lex; DBUG_ENTER("add_field_to_list"); - if (strlen(field_name) > NAME_LEN) + if (check_string_char_length(field_name, "", NAME_CHAR_LEN, + system_charset_info, 1)) { - my_error(ER_TOO_LONG_IDENT, MYF(0), field_name); /* purecov: inspected */ + my_error(ER_TOO_LONG_IDENT, MYF(0), field_name->str); /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */ } if (type_modifier & PRI_KEY_FLAG) { - lex->col_list.push_back(new key_part_spec(field_name,0)); + lex->col_list.push_back(new key_part_spec(field_name->str, 0)); lex->key_list.push_back(new Key(Key::PRIMARY, NullS, &default_key_create_info, 0, lex->col_list)); @@ -5360,7 +5340,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, } if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG)) { - lex->col_list.push_back(new key_part_spec(field_name,0)); + lex->col_list.push_back(new key_part_spec(field_name->str, 0)); lex->key_list.push_back(new Key(Key::UNIQUE, NullS, &default_key_create_info, 0, lex->col_list)); @@ -5380,7 +5360,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, !(((Item_func*)default_value)->functype() == Item_func::NOW_FUNC && type == MYSQL_TYPE_TIMESTAMP)) { - my_error(ER_INVALID_DEFAULT, MYF(0), field_name); + my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str); DBUG_RETURN(1); } else if (default_value->type() == Item::NULL_ITEM) @@ -5389,20 +5369,20 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, if ((type_modifier & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) == NOT_NULL_FLAG) { - my_error(ER_INVALID_DEFAULT, MYF(0), field_name); + my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str); DBUG_RETURN(1); } } else if (type_modifier & AUTO_INCREMENT_FLAG) { - my_error(ER_INVALID_DEFAULT, MYF(0), field_name); + my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str); DBUG_RETURN(1); } } if (on_update_value && type != MYSQL_TYPE_TIMESTAMP) { - my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name); + my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name->str); DBUG_RETURN(1); } @@ -5418,7 +5398,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, } if (!(new_field= new create_field()) || - new_field->init(thd, field_name, type, length, decimals, type_modifier, + new_field->init(thd, field_name->str, type, length, decimals, type_modifier, default_value, on_update_value, comment, change, interval_list, cs, uint_geom_type)) DBUG_RETURN(1); @@ -6970,26 +6950,62 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user) /* - Check that length of a string does not exceed some limit. + Check that byte length of a string does not exceed some limit. SYNOPSIS - check_string_length() - str string to be checked - err_msg error message to be displayed if the string is too long - max_length max length + check_string_byte_length() + str string to be checked + err_msg error message to be displayed if the string is too long + max_byte_length max length in bytes RETURN FALSE the passed string is not longer than max_length TRUE the passed string is longer than max_length + + NOTE + The function is not used in existing code but can be useful later? */ -bool check_string_length(LEX_STRING *str, const char *err_msg, - uint max_length) +bool check_string_byte_length(LEX_STRING *str, const char *err_msg, + uint max_byte_length) { - if (str->length <= max_length) + if (str->length <= max_byte_length) return FALSE; - my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_length); + my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_byte_length); return TRUE; } + + +/* + Check that char length of a string does not exceed some limit. + + SYNOPSIS + check_string_char_length() + str string to be checked + err_msg error message to be displayed if the string is too long + max_char_length max length in symbols + cs string charset + + RETURN + FALSE the passed string is not longer than max_char_length + TRUE the passed string is longer than max_char_length +*/ + + +bool check_string_char_length(LEX_STRING *str, const char *err_msg, + uint max_char_length, CHARSET_INFO *cs, + bool no_error) +{ + int well_formed_error; + uint res= cs->cset->well_formed_len(cs, str->str, str->str + str->length, + max_char_length, &well_formed_error); + + if (!well_formed_error && str->length == res) + return FALSE; + + if (!no_error) + my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_char_length); + return TRUE; +} diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 70bc9ef23d5..46fb1568df6 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -162,7 +162,8 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report) plugin directory are used (to make this even remotely secure). */ if (my_strchr(files_charset_info, dl->str, dl->str + dl->length, FN_LIBCHAR) || - dl->length > NAME_LEN || + check_string_char_length((LEX_STRING *) dl, "", NAME_CHAR_LEN, + system_charset_info, 1) || plugin_dir_len + dl->length + 1 >= FN_REFLEN) { if (report & REPORT_TO_USER) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 445890adedb..9e02bc34f99 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -362,7 +362,7 @@ bool mysqld_show_privileges(THD *thd) field_list.push_back(new Item_empty_string("Privilege",10)); field_list.push_back(new Item_empty_string("Context",15)); - field_list.push_back(new Item_empty_string("Comment",NAME_LEN)); + field_list.push_back(new Item_empty_string("Comment",NAME_CHAR_LEN)); if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) @@ -438,8 +438,8 @@ bool mysqld_show_column_types(THD *thd) field_list.push_back(new Item_empty_string("Zerofill",4)); field_list.push_back(new Item_empty_string("Searchable",4)); field_list.push_back(new Item_empty_string("Case_Sensitive",4)); - field_list.push_back(new Item_empty_string("Default",NAME_LEN)); - field_list.push_back(new Item_empty_string("Comment",NAME_LEN)); + field_list.push_back(new Item_empty_string("Default",NAME_CHAR_LEN)); + field_list.push_back(new Item_empty_string("Comment",NAME_CHAR_LEN)); if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) @@ -521,7 +521,7 @@ find_files(THD *thd, List *files, const char *db, for (i=0 ; i < (uint) dirp->number_off_files ; i++) { - char uname[NAME_LEN*3+1]; /* Unencoded name */ + char uname[NAME_LEN + 1]; /* Unencoded name */ file=dirp->dir_entry+i; if (dir) { /* Return databases */ @@ -651,13 +651,13 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) List field_list; if (table_list->view) { - field_list.push_back(new Item_empty_string("View",NAME_LEN)); + field_list.push_back(new Item_empty_string("View",NAME_CHAR_LEN)); field_list.push_back(new Item_empty_string("Create View", max(buffer.length(),1024))); } else { - field_list.push_back(new Item_empty_string("Table",NAME_LEN)); + field_list.push_back(new Item_empty_string("Table",NAME_CHAR_LEN)); // 1024 is for not to confuse old clients field_list.push_back(new Item_empty_string("Create Table", max(buffer.length(),1024))); @@ -731,7 +731,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname, load_db_opt_by_name(thd, dbname, &create); } List field_list; - field_list.push_back(new Item_empty_string("Database",NAME_LEN)); + field_list.push_back(new Item_empty_string("Database",NAME_CHAR_LEN)); field_list.push_back(new Item_empty_string("Create Database",1024)); if (protocol->send_fields(&field_list, @@ -1626,7 +1626,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) field_list.push_back(new Item_int("Id", 0, MY_INT32_NUM_DECIMAL_DIGITS)); field_list.push_back(new Item_empty_string("User",16)); field_list.push_back(new Item_empty_string("Host",LIST_PROCESS_HOST_LEN)); - field_list.push_back(field=new Item_empty_string("db",NAME_LEN)); + field_list.push_back(field=new Item_empty_string("db",NAME_CHAR_LEN)); field->maybe_null=1; field_list.push_back(new Item_empty_string("Command",16)); field_list.push_back(new Item_return_int("Time",7, MYSQL_TYPE_LONG)); @@ -5341,7 +5341,7 @@ int fill_schema_session_variables(THD *thd, TABLE_LIST *tables, COND *cond) ST_FIELD_INFO schema_fields_info[]= { {"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"SCHEMA_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"}, + {"SCHEMA_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"}, {"DEFAULT_CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0}, {"DEFAULT_COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0}, {"SQL_PATH", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, @@ -5352,10 +5352,10 @@ ST_FIELD_INFO schema_fields_info[]= ST_FIELD_INFO tables_fields_info[]= { {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, - {"TABLE_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"ENGINE", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Engine"}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, + {"TABLE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"ENGINE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Engine"}, {"VERSION", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, "Version"}, {"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format"}, {"TABLE_ROWS", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, "Rows"}, @@ -5384,13 +5384,13 @@ ST_FIELD_INFO tables_fields_info[]= ST_FIELD_INFO columns_fields_info[]= { {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Field"}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Field"}, {"ORDINAL_POSITION", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 0, 0}, {"COLUMN_DEFAULT", MAX_FIELD_VARCHARLENGTH, MYSQL_TYPE_STRING, 0, 1, "Default"}, {"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"}, - {"DATA_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"DATA_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"CHARACTER_MAXIMUM_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, 0}, {"CHARACTER_OCTET_LENGTH", MY_INT64_NUM_DECIMAL_DIGITS , MYSQL_TYPE_LONG, 0, 1, 0}, @@ -5443,9 +5443,9 @@ ST_FIELD_INFO engines_fields_info[]= ST_FIELD_INFO events_fields_info[]= { - {"EVENT_CATALOG", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"EVENT_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Db"}, - {"EVENT_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, + {"EVENT_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"EVENT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db"}, + {"EVENT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer"}, {"TIME_ZONE", 64, MYSQL_TYPE_STRING, 0, 0, "Time zone"}, {"EVENT_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0}, @@ -5462,7 +5462,7 @@ ST_FIELD_INFO events_fields_info[]= {"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0}, {"LAST_ALTERED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0}, {"LAST_EXECUTED", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, 0}, - {"EVENT_COMMENT", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"EVENT_COMMENT", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"ORIGINATOR", 10, MYSQL_TYPE_LONG, 0, 0, "Originator"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5479,25 +5479,25 @@ ST_FIELD_INFO coll_charset_app_fields_info[]= ST_FIELD_INFO proc_fields_info[]= { - {"SPECIFIC_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"SPECIFIC_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"ROUTINE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"ROUTINE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Db"}, - {"ROUTINE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, + {"ROUTINE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Db"}, + {"ROUTINE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, {"ROUTINE_TYPE", 9, MYSQL_TYPE_STRING, 0, 0, "Type"}, - {"DTD_IDENTIFIER", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"DTD_IDENTIFIER", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"ROUTINE_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0}, {"ROUTINE_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 1, 0}, - {"EXTERNAL_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"EXTERNAL_LANGUAGE", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"EXTERNAL_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"EXTERNAL_LANGUAGE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"PARAMETER_STYLE", 8, MYSQL_TYPE_STRING, 0, 0, 0}, {"IS_DETERMINISTIC", 3, MYSQL_TYPE_STRING, 0, 0, 0}, - {"SQL_DATA_ACCESS", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"SQL_PATH", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"SQL_DATA_ACCESS", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"SQL_PATH", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"SECURITY_TYPE", 7, MYSQL_TYPE_STRING, 0, 0, "Security_type"}, {"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, "Created"}, {"LAST_ALTERED", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, "Modified"}, {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0}, - {"ROUTINE_COMMENT", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Comment"}, + {"ROUTINE_COMMENT", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Comment"}, {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5506,13 +5506,13 @@ ST_FIELD_INFO proc_fields_info[]= ST_FIELD_INFO stat_fields_info[]= { {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"}, {"NON_UNIQUE", 1, MYSQL_TYPE_LONG, 0, 0, "Non_unique"}, - {"INDEX_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"INDEX_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Key_name"}, + {"INDEX_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"INDEX_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Key_name"}, {"SEQ_IN_INDEX", 2, MYSQL_TYPE_LONG, 0, 0, "Seq_in_index"}, - {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Column_name"}, + {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Column_name"}, {"COLLATION", 1, MYSQL_TYPE_STRING, 0, 1, "Collation"}, {"CARDINALITY", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 1, "Cardinality"}, {"SUB_PART", 3, MYSQL_TYPE_LONG, 0, 1, "Sub_part"}, @@ -5527,8 +5527,8 @@ ST_FIELD_INFO stat_fields_info[]= ST_FIELD_INFO view_fields_info[]= { {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"VIEW_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0}, {"CHECK_OPTION", 8, MYSQL_TYPE_STRING, 0, 0, 0}, {"IS_UPDATABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0}, @@ -5542,7 +5542,7 @@ ST_FIELD_INFO user_privileges_fields_info[]= { {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0}, {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"PRIVILEGE_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5552,8 +5552,8 @@ ST_FIELD_INFO schema_privileges_fields_info[]= { {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0}, {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"PRIVILEGE_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5563,9 +5563,9 @@ ST_FIELD_INFO table_privileges_fields_info[]= { {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0}, {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"PRIVILEGE_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5575,10 +5575,10 @@ ST_FIELD_INFO column_privileges_fields_info[]= { {"GRANTEE", 81, MYSQL_TYPE_STRING, 0, 0, 0}, {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"PRIVILEGE_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"PRIVILEGE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"IS_GRANTABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5587,11 +5587,11 @@ ST_FIELD_INFO column_privileges_fields_info[]= ST_FIELD_INFO table_constraints_fields_info[]= { {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"CONSTRAINT_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"CONSTRAINT_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"CONSTRAINT_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"CONSTRAINT_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5599,17 +5599,17 @@ ST_FIELD_INFO table_constraints_fields_info[]= ST_FIELD_INFO key_column_usage_fields_info[]= { {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"CONSTRAINT_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"CONSTRAINT_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"ORDINAL_POSITION", 10 ,MYSQL_TYPE_LONG, 0, 0, 0}, {"POSITION_IN_UNIQUE_CONSTRAINT", 10 ,MYSQL_TYPE_LONG, 0, 1, 0}, - {"REFERENCED_TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"REFERENCED_TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"REFERENCED_COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"REFERENCED_TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"REFERENCED_TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"REFERENCED_COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5617,17 +5617,17 @@ ST_FIELD_INFO key_column_usage_fields_info[]= ST_FIELD_INFO table_names_fields_info[]= { {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Tables_in_"}, - {"TABLE_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_type"}, + {"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Tables_in_"}, + {"TABLE_TYPE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_type"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; ST_FIELD_INFO open_tables_fields_info[]= { - {"Database", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"}, - {"Table",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"}, + {"Database", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"}, + {"Table",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"}, {"In_use", 1, MYSQL_TYPE_LONG, 0, 0, "In_use"}, {"Name_locked", 4, MYSQL_TYPE_LONG, 0, 0, "Name_locked"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} @@ -5637,19 +5637,19 @@ ST_FIELD_INFO open_tables_fields_info[]= ST_FIELD_INFO triggers_fields_info[]= { {"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TRIGGER_SCHEMA",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TRIGGER_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Trigger"}, + {"TRIGGER_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TRIGGER_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Trigger"}, {"EVENT_MANIPULATION", 6, MYSQL_TYPE_STRING, 0, 0, "Event"}, {"EVENT_OBJECT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"EVENT_OBJECT_SCHEMA",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"EVENT_OBJECT_TABLE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"}, + {"EVENT_OBJECT_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"EVENT_OBJECT_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"}, {"ACTION_ORDER", 4, MYSQL_TYPE_LONG, 0, 0, 0}, {"ACTION_CONDITION", 65535, MYSQL_TYPE_STRING, 0, 1, 0}, {"ACTION_STATEMENT", 65535, MYSQL_TYPE_STRING, 0, 0, "Statement"}, {"ACTION_ORIENTATION", 9, MYSQL_TYPE_STRING, 0, 0, 0}, {"ACTION_TIMING", 6, MYSQL_TYPE_STRING, 0, 0, "Timing"}, - {"ACTION_REFERENCE_OLD_TABLE", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"ACTION_REFERENCE_NEW_TABLE", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"ACTION_REFERENCE_OLD_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"ACTION_REFERENCE_NEW_TABLE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"ACTION_REFERENCE_OLD_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Created"}, @@ -5662,10 +5662,10 @@ ST_FIELD_INFO triggers_fields_info[]= ST_FIELD_INFO partitions_fields_info[]= { {"TABLE_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"PARTITION_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"SUBPARTITION_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"TABLE_SCHEMA",NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"PARTITION_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"SUBPARTITION_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"PARTITION_ORDINAL_POSITION", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, {"SUBPARTITION_ORDINAL_POSITION", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, {"PARTITION_METHOD", 12, MYSQL_TYPE_STRING, 0, 1, 0}, @@ -5685,7 +5685,7 @@ ST_FIELD_INFO partitions_fields_info[]= {"CHECKSUM", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, {"PARTITION_COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, 0}, {"NODEGROUP", 12 , MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLESPACE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"TABLESPACE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -5719,7 +5719,7 @@ ST_FIELD_INFO processlist_fields_info[]= {"ID", 4, MYSQL_TYPE_LONG, 0, 0, "Id"}, {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User"}, {"HOST", LIST_PROCESS_HOST_LEN, MYSQL_TYPE_STRING, 0, 0, "Host"}, - {"DB", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Db"}, + {"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db"}, {"COMMAND", 16, MYSQL_TYPE_STRING, 0, 0, "Command"}, {"TIME", 7, MYSQL_TYPE_LONG, 0, 0, "Time"}, {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State"}, @@ -5730,14 +5730,14 @@ ST_FIELD_INFO processlist_fields_info[]= ST_FIELD_INFO plugin_fields_info[]= { - {"PLUGIN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, + {"PLUGIN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name"}, {"PLUGIN_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0}, {"PLUGIN_STATUS", 10, MYSQL_TYPE_STRING, 0, 0, "Status"}, {"PLUGIN_TYPE", 80, MYSQL_TYPE_STRING, 0, 0, "Type"}, {"PLUGIN_TYPE_VERSION", 20, MYSQL_TYPE_STRING, 0, 0, 0}, - {"PLUGIN_LIBRARY", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Library"}, + {"PLUGIN_LIBRARY", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Library"}, {"PLUGIN_LIBRARY_VERSION", 20, MYSQL_TYPE_STRING, 0, 1, 0}, - {"PLUGIN_AUTHOR", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"PLUGIN_AUTHOR", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"PLUGIN_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0}, {"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 1, "License"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} @@ -5746,16 +5746,16 @@ ST_FIELD_INFO plugin_fields_info[]= ST_FIELD_INFO files_fields_info[]= { {"FILE_ID", 4, MYSQL_TYPE_LONG, 0, 0, 0}, - {"FILE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"FILE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"FILE_TYPE", 20, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLESPACE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_CATALOG", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"LOGFILE_GROUP_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"TABLESPACE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"TABLE_CATALOG", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"TABLE_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"LOGFILE_GROUP_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"LOGFILE_GROUP_NUMBER", 4, MYSQL_TYPE_LONG, 0, 1, 0}, - {"ENGINE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"FULLTEXT_KEYS", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, + {"ENGINE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"FULLTEXT_KEYS", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0}, {"DELETED_ROWS", 4, MYSQL_TYPE_LONG, 0, 1, 0}, {"UPDATE_COUNT", 4, MYSQL_TYPE_LONG, 0, 1, 0}, {"FREE_EXTENTS", 4, MYSQL_TYPE_LONG, 0, 1, 0}, @@ -5799,16 +5799,16 @@ void init_fill_schema_files_row(TABLE* table) ST_FIELD_INFO referential_constraints_fields_info[]= { {"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"CONSTRAINT_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"CONSTRAINT_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"UNIQUE_CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0}, - {"UNIQUE_CONSTRAINT_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"UNIQUE_CONSTRAINT_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"MATCH_OPTION", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"UPDATE_RULE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"DELETE_RULE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, - {"REFERENCED_TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"UNIQUE_CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"UNIQUE_CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"MATCH_OPTION", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"UPDATE_RULE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"DELETE_RULE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, + {"REFERENCED_TABLE_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3eb47ebae6e..a753cc9e8e0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2541,6 +2541,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, { DBUG_PRINT("info", ("key name: '%s' type: %d", key->name ? key->name : "(none)" , key->type)); + LEX_STRING key_name_str; if (key->type == Key::FOREIGN_KEY) { fk_key_count++; @@ -2562,7 +2563,10 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, my_error(ER_TOO_MANY_KEY_PARTS,MYF(0),tmp); DBUG_RETURN(-1); } - if (key->name && strlen(key->name) > NAME_LEN) + key_name_str.str= (char*) key->name; + key_name_str.length= key->name ? strlen(key->name) : 0; + if (check_string_char_length(&key_name_str, "", NAME_CHAR_LEN, + system_charset_info, 1)) { my_error(ER_TOO_LONG_IDENT, MYF(0), key->name); DBUG_RETURN(-1); @@ -4049,7 +4053,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (end_active_trans(thd)) DBUG_RETURN(1); - field_list.push_back(item = new Item_empty_string("Table", NAME_LEN*2)); + field_list.push_back(item = new Item_empty_string("Table", NAME_CHAR_LEN*2)); item->maybe_null = 1; field_list.push_back(item = new Item_empty_string("Op", 10)); item->maybe_null = 1; @@ -4631,7 +4635,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, /* Validate the source table */ - if (table_ident->table.length > NAME_LEN || + if (check_string_char_length(&table_ident->table, "", NAME_CHAR_LEN, + system_charset_info, 1) || (table_ident->table.length && check_table_name(src_table,table_ident->table.length))) { diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index da5c1b0bc66..fd7ba698a93 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -169,8 +169,10 @@ void udf_init() This is done to ensure that only approved dll from the system directories are used (to make this even remotely secure). */ - if (my_strchr(files_charset_info, dl_name, dl_name + strlen(dl_name), FN_LIBCHAR) || - strlen(name.str) > NAME_LEN) + if (my_strchr(files_charset_info, dl_name, + dl_name + strlen(dl_name), FN_LIBCHAR) || + check_string_char_length(&name, "", NAME_CHAR_LEN, + system_charset_info, 1)) { sql_print_error("Invalid row in mysql.func table for function '%.64s'", name.str); @@ -397,7 +399,8 @@ int mysql_create_function(THD *thd,udf_func *udf) my_message(ER_UDF_NO_PATHS, ER(ER_UDF_NO_PATHS), MYF(0)); DBUG_RETURN(1); } - if (udf->name.length > NAME_LEN) + if (check_string_char_length(&udf->name, "", NAME_CHAR_LEN, + system_charset_info, 1)) { my_error(ER_TOO_LONG_IDENT, MYF(0), udf->name); DBUG_RETURN(1); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 36b09224796..f011899e5cc 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1926,9 +1926,8 @@ sp_name: my_error(ER_WRONG_DB_NAME, MYF(0), $1.str); MYSQL_YYABORT; } - if (check_routine_name($3)) + if (check_routine_name(&$3)) { - my_error(ER_SP_WRONG_NAME, MYF(0), $3.str); MYSQL_YYABORT; } $$= new sp_name($1, $3); @@ -1938,9 +1937,8 @@ sp_name: { THD *thd= YYTHD; LEX_STRING db; - if (check_routine_name($1)) + if (check_routine_name(&$1)) { - my_error(ER_SP_WRONG_NAME, MYF(0), $1.str); MYSQL_YYABORT; } if (thd->copy_db_to(&db.str, &db.length)) @@ -4535,8 +4533,7 @@ field_spec: type opt_attribute { LEX *lex=Lex; - if (add_field_to_list(lex->thd, $1.str, - (enum enum_field_types) $3, + if (add_field_to_list(lex->thd, &$1, (enum enum_field_types) $3, lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, &lex->comment, @@ -5492,7 +5489,7 @@ alter_list_item: type opt_attribute { LEX *lex=Lex; - if (add_field_to_list(lex->thd,$3.str, + if (add_field_to_list(lex->thd,&$3, (enum enum_field_types) $5, lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, @@ -9717,8 +9714,9 @@ user: $$->host.str= (char *) "%"; $$->host.length= 1; - if (check_string_length(&$$->user, - ER(ER_USERNAME), USERNAME_LENGTH)) + if (check_string_char_length(&$$->user, ER(ER_USERNAME), + USERNAME_CHAR_LENGTH, + system_charset_info, 0)) MYSQL_YYABORT; } | ident_or_text '@' ident_or_text @@ -9728,10 +9726,11 @@ user: MYSQL_YYABORT; $$->user = $1; $$->host=$3; - if (check_string_length(&$$->user, - ER(ER_USERNAME), USERNAME_LENGTH) || - check_string_length(&$$->host, - ER(ER_HOSTNAME), HOSTNAME_LENGTH)) + if (check_string_char_length(&$$->user, ER(ER_USERNAME), + USERNAME_CHAR_LENGTH, + system_charset_info, 0) || + check_string_byte_length(&$$->host, ER(ER_HOSTNAME), + HOSTNAME_LENGTH)) MYSQL_YYABORT; } | CURRENT_USER optional_braces diff --git a/sql/table.cc b/sql/table.cc index 4123473cf1e..d1c9836d15c 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2329,8 +2329,9 @@ uint calculate_key_len(TABLE *table, uint key, const byte *buf, bool check_db_name(LEX_STRING *org_name) { char *name= org_name->str; + uint name_length= org_name->length; - if (!org_name->length || org_name->length > NAME_LEN) + if (!name_length || name_length > NAME_LEN) return 1; if (lower_case_table_names && name != any_db) @@ -2339,6 +2340,7 @@ bool check_db_name(LEX_STRING *org_name) #if defined(USE_MB) && defined(USE_MB_IDENT) if (use_mb(system_charset_info)) { + name_length= 0; bool last_char_is_space= TRUE; char *end= name + org_name->length; while (name < end) @@ -2349,12 +2351,14 @@ bool check_db_name(LEX_STRING *org_name) if (!len) len= 1; name+= len; + name_length++; } - return last_char_is_space; + return (last_char_is_space || name_length > NAME_CHAR_LEN); } else #endif - return org_name->str[org_name->length - 1] != ' '; /* purecov: inspected */ + return ((org_name->str[org_name->length - 1] != ' ') || + (name_length > NAME_CHAR_LEN)); /* purecov: inspected */ } @@ -2367,6 +2371,7 @@ bool check_db_name(LEX_STRING *org_name) bool check_table_name(const char *name, uint length) { + uint name_length= 0; // name length in symbols const char *end= name+length; if (!length || length > NAME_LEN) return 1; @@ -2387,14 +2392,16 @@ bool check_table_name(const char *name, uint length) if (len) { name += len; + name_length++; continue; } } #endif name++; + name_length++; } #if defined(USE_MB) && defined(USE_MB_IDENT) - return last_char_is_space; + return (last_char_is_space || name_length > NAME_CHAR_LEN) ; #else return 0; #endif @@ -2403,7 +2410,7 @@ bool check_table_name(const char *name, uint length) bool check_column_name(const char *name) { - const char *start= name; + uint name_length= 0; // name length in symbols bool last_char_is_space= TRUE; while (*name) @@ -2417,6 +2424,7 @@ bool check_column_name(const char *name) if (len) { name += len; + name_length++; continue; } } @@ -2426,9 +2434,10 @@ bool check_column_name(const char *name) if (*name == NAMES_SEP_CHAR) return 1; name++; + name_length++; } /* Error if empty or too long column name */ - return last_char_is_space || (uint) (name - start) > NAME_LEN; + return last_char_is_space || (uint) name_length > NAME_CHAR_LEN; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index e9309f4f8b8..ca3e24223b5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5922,8 +5922,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List *f_key_list) FOREIGN_KEY_INFO f_key_info; LEX_STRING *name= 0; uint ulen; - char uname[NAME_LEN*3+1]; /* Unencoded name */ - char db_name[NAME_LEN*3+1]; + char uname[NAME_LEN+1]; /* Unencoded name */ + char db_name[NAME_LEN+1]; const char *tmp_buff; tmp_buff= foreign->id; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index b12d5fa1db0..6b0092e3880 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -7811,16 +7811,16 @@ static void test_explain_bug() "", "", "", 19, 0); verify_prepare_field(result, 2, "table", "", MYSQL_TYPE_VAR_STRING, - "", "", "", NAME_LEN, 0); + "", "", "", NAME_CHAR_LEN, 0); verify_prepare_field(result, 3, "type", "", MYSQL_TYPE_VAR_STRING, "", "", "", 10, 0); verify_prepare_field(result, 4, "possible_keys", "", MYSQL_TYPE_VAR_STRING, - "", "", "", NAME_LEN*MAX_KEY, 0); + "", "", "", NAME_CHAR_LEN*MAX_KEY, 0); verify_prepare_field(result, 5, "key", "", MYSQL_TYPE_VAR_STRING, - "", "", "", NAME_LEN, 0); + "", "", "", NAME_CHAR_LEN, 0); if (mysql_get_server_version(mysql) <= 50000) { @@ -7830,11 +7830,11 @@ static void test_explain_bug() else { verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_VAR_STRING, "", - "", "", NAME_LEN*MAX_KEY, 0); + "", "", NAME_CHAR_LEN*MAX_KEY, 0); } verify_prepare_field(result, 7, "ref", "", MYSQL_TYPE_VAR_STRING, - "", "", "", NAME_LEN*16, 0); + "", "", "", NAME_CHAR_LEN*16, 0); verify_prepare_field(result, 8, "rows", "", MYSQL_TYPE_LONGLONG, "", "", "", 10, 0); From b9bba4f4b41834f4a919b780eee961c766d9a0dc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 13:36:58 +0200 Subject: [PATCH 541/789] Replace not portable "--system rm" with --remove_file --- mysql-test/t/sp.test | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index d49f36fd6d7..fbca496eaf2 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -706,9 +706,11 @@ begin insert into test.t1 values (concat(x, "2"), y+2); end| ---system rm -f $MYSQLTEST_VARDIR/tmp/spout +# Remove spout file if it exists +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/tmp/spout call into_outfile("ofile", 1)| ---system rm -f $MYSQLTEST_VARDIR/tmp/spout +--remove_file $MYSQLTEST_VARDIR/tmp/spout delete from t1| drop procedure into_outfile| @@ -723,9 +725,11 @@ begin insert into test.t1 values (concat(x, "2"), y+2); end| ---system rm -f $MYSQLTEST_VARDIR/tmp/spdump +# Remove spdump file if it exists +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/tmp/spdump call into_dumpfile("dfile", 1)| ---system rm -f $MYSQLTEST_VARDIR/tmp/spdump +--remove_file $MYSQLTEST_VARDIR/tmp/spdump delete from t1| drop procedure into_dumpfile| From e5a81746de94d77e18d2b70a7410348dd6fc7624 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 14:31:46 +0200 Subject: [PATCH 542/789] Bug #21494 Master Cluster MySQLD is point of failure that can lead to mismatch slave data - insert gap event on cluster connect --- sql/ha_ndbcluster_binlog.cc | 8 ++++++++ sql/rpl_injector.cc | 2 +- sql/rpl_injector.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index e5b4cffa7fb..d1c2ad15894 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -3589,6 +3589,14 @@ restart: /* Main NDB Injector loop */ + { + /* + Always insert a GAP event as we cannot know what has happened in the cluster + while not being connected. + */ + LEX_STRING const msg= { C_STRING_WITH_LEN("Cluster connect") }; + inj->record_incident(thd, INCIDENT_LOST_EVENTS, msg); + } { thd->proc_info= "Waiting for ndbcluster to start"; diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index b22b052a105..b66f0b1c7c1 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -198,7 +198,7 @@ int injector::record_incident(THD *thd, Incident incident) return 0; } -int injector::record_incident(THD *thd, Incident incident, LEX_STRING message) +int injector::record_incident(THD *thd, Incident incident, LEX_STRING const message) { Incident_log_event ev(thd, incident, message); if (int error= mysql_bin_log.write(&ev)) diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h index eabf374857a..9c444ee20b3 100644 --- a/sql/rpl_injector.h +++ b/sql/rpl_injector.h @@ -324,7 +324,7 @@ public: void new_trans(THD *, transaction *); int record_incident(THD*, Incident incident); - int record_incident(THD*, Incident incident, LEX_STRING message); + int record_incident(THD*, Incident incident, LEX_STRING const message); private: explicit injector(); From c2cde303009cce9a86ea94883a6662e296138376 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 14:49:57 +0200 Subject: [PATCH 543/789] Bug #21494 Master Cluster MySQLD is point of failure that can lead to mismatch slave data - insert gap event on cluster connect --- mysql-test/r/ndb_binlog_discover.result | 17 +++++++++++------ mysql-test/t/ndb_binlog_discover.test | 3 +++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ndb_binlog_discover.result b/mysql-test/r/ndb_binlog_discover.result index 4806047a016..cf6875c5624 100644 --- a/mysql-test/r/ndb_binlog_discover.result +++ b/mysql-test/r/ndb_binlog_discover.result @@ -3,10 +3,15 @@ create table t1 (a int key) engine=ndb; reset master; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Incident # # #1 (LOST_EVENTS) +master-bin.000001 # Rotate # # master-bin.000002;pos=4 +PURGE MASTER LOGS TO 'master-bin.000002'; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Table_map # # table_id: # (test.t1) +master-bin.000002 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000002 # Write_rows # # table_id: # +master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Query # # COMMIT drop table t1; diff --git a/mysql-test/t/ndb_binlog_discover.test b/mysql-test/t/ndb_binlog_discover.test index 88126cc1c23..7cd817f81b9 100644 --- a/mysql-test/t/ndb_binlog_discover.test +++ b/mysql-test/t/ndb_binlog_discover.test @@ -29,5 +29,8 @@ while ($mysql_errno) } --enable_query_log +--source include/show_binlog_events.inc +PURGE MASTER LOGS TO 'master-bin.000002'; + --source include/show_binlog_events.inc drop table t1; From 780212301367ada0b9166bf5bfdcaa2ccdb141b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 16:13:23 +0200 Subject: [PATCH 544/789] Remove the cleanup of table t1 until problem with lock is fixed --- mysql-test/r/rpl_packet.result | 2 -- mysql-test/t/rpl_packet.test | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/r/rpl_packet.result index a1ec39ece30..894bc81b08d 100644 --- a/mysql-test/r/rpl_packet.result +++ b/mysql-test/r/rpl_packet.result @@ -24,5 +24,3 @@ INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SHOW STATUS LIKE 'Slave_running'; Variable_name Value Slave_running OFF -drop table t1; -drop table t1; diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/t/rpl_packet.test index a1e933e2e88..83fe75363a5 100644 --- a/mysql-test/t/rpl_packet.test +++ b/mysql-test/t/rpl_packet.test @@ -69,10 +69,10 @@ sleep 2; SHOW STATUS LIKE 'Slave_running'; # cleanup -connection master; -drop table t1; -connection slave; -drop table t1; +#connection master; +#drop table t1; +#connection slave; +#drop table t1; # End of tests From 5152132b47318438eb5773238c05630e2b206469 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 19:40:55 +0500 Subject: [PATCH 545/789] Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte additional fix sql/mysql_priv.h: additional fix --- sql/mysql_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 7607a004e7a..c1d2caf9371 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -366,7 +366,7 @@ MY_LOCALE *my_locale_by_number(uint number); Maximum length of time zone name that we support (Time zone name is char(64) in db). mysqlbinlog needs it. */ -#define MAX_TIME_ZONE_NAME_LENGTH (NAME_LEN + 8) +#define MAX_TIME_ZONE_NAME_LENGTH (NAME_LEN + 1) /* The rest of the file is included in the server only */ #ifndef MYSQL_CLIENT From 7bf304a6bd85c6fdfdf2c6ff8c4a7a2d0ce3c681 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 18:00:57 +0300 Subject: [PATCH 546/789] Bug #27513: test case added to make sure this crash bug doesn't reappear. mysql-test/r/errors.result: Bug #27513: test case mysql-test/t/errors.test: Bug #27513: test case --- mysql-test/r/errors.result | 18 ++++++++++++++++++ mysql-test/t/errors.test | 11 +++++++++++ 2 files changed, 29 insertions(+) diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 0c84f24a2e4..0b12853ab80 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -28,3 +28,21 @@ ERROR 42000: Display width out of range for column 'a' (max = 255) set sql_mode='traditional'; create table t1 (a varchar(66000)); ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead +CREATE TABLE t1 (a INT); +SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); +a +Warnings: +Error 1365 Division by 0 +INSERT INTO t1 VALUES(1); +SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); +a +1 +Warnings: +Error 1365 Division by 0 +INSERT INTO t1 VALUES(2),(3); +SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); +a +1 +Warnings: +Error 1365 Division by 0 +DROP TABLE t1; diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index f5647a293e8..6ddef2a8c08 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -41,4 +41,15 @@ set sql_mode='traditional'; --error 1074 create table t1 (a varchar(66000)); +# +# Bug #27513: mysql 5.0.x + NULL pointer DoS +# +CREATE TABLE t1 (a INT); +SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); +INSERT INTO t1 VALUES(1); +SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); +INSERT INTO t1 VALUES(2),(3); +SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); +DROP TABLE t1; + # End of 5.0 tests From 502e5c9355ccf106462b4857490bdd2d71500db0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 17:36:05 +0200 Subject: [PATCH 547/789] Bug#17095 Cluster RBR in circle does not terminate - set correct server id --- mysql-test/r/rpl_ndb_log.result | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/r/rpl_ndb_log.result index 8d443780039..03b7fd89875 100644 --- a/mysql-test/r/rpl_ndb_log.result +++ b/mysql-test/r/rpl_ndb_log.result @@ -99,33 +99,33 @@ show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB -slave-bin.000001 # Query 2 # BEGIN +slave-bin.000001 # Query 1 # BEGIN slave-bin.000001 # Table_map 2 # table_id: # (test.t1) slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status) slave-bin.000001 # Write_rows 2 # table_id: # -slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F -slave-bin.000001 # Query 2 # COMMIT +slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 1 # COMMIT slave-bin.000001 # Query 1 # use `test`; drop table t1 slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB -slave-bin.000001 # Query 2 # BEGIN +slave-bin.000001 # Query 1 # BEGIN slave-bin.000001 # Table_map 2 # table_id: # (test.t1) slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status) slave-bin.000001 # Write_rows 2 # table_id: # -slave-bin.000001 # Write_rows 2 # table_id: # -slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F -slave-bin.000001 # Query 2 # COMMIT +slave-bin.000001 # Write_rows 1 # table_id: # +slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 1 # COMMIT slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 show binlog events in 'slave-bin.000002' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB -slave-bin.000002 # Query 2 # BEGIN +slave-bin.000002 # Query 1 # BEGIN slave-bin.000002 # Table_map 2 # table_id: # (test.t2) slave-bin.000002 # Table_map 2 # table_id: # (mysql.ndb_apply_status) slave-bin.000002 # Write_rows 2 # table_id: # -slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 2 # COMMIT +slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F +slave-bin.000002 # Query 1 # COMMIT show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 617 # # master-bin.000002 Yes Yes # 0 0 617 # None 0 No # From 8845cbb8b6e497fd063d8f4ca68c82b0e69f49bc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 18:04:24 +0200 Subject: [PATCH 548/789] no Max rpms anymore, but a debug binary support-files/mysql.spec.sh: remove Max rpms and add a debug server --- support-files/mysql.spec.sh | 179 +++++++++++++----------------------- 1 file changed, 64 insertions(+), 115 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index ce1335e1bc4..61682428046 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -14,7 +14,7 @@ # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston # MA 02110-1301 USA. -%define mysql_version @VERSION@ +%define mysql_version @VERSION@ # use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x) # to enable static linking (off by default) @@ -32,10 +32,10 @@ %define release 0.glibc23 %endif %define license GPL -%define mysqld_user mysql -%define mysqld_group mysql -%define server_suffix -standard -%define mysqldatadir /var/lib/mysql +%define mysqld_user mysql +%define mysqld_group mysql +%define server_suffix -community +%define mysqldatadir /var/lib/mysql # We don't package all files installed into the build root by intention - # See BUG#998 for details. @@ -99,7 +99,7 @@ Summary: MySQL: a very fast and reliable SQL database server Group: Applications/Databases Requires: coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd /sbin/chkconfig Provides: msqlormysql mysql-server mysql MySQL -Obsoletes: MySQL mysql mysql-server +Obsoletes: MySQL mysql mysql-server mysql-Max %description server The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, @@ -120,7 +120,7 @@ This package includes the MySQL server binary (incl. InnoDB) as well as related utilities to run and administrate a MySQL server. If you want to access and work with the database, you have to install -package "MySQL-client" as well! +the package "MySQL-client" as well! %package client Summary: MySQL - Client @@ -141,8 +141,6 @@ Group: Applications/Databases This package contains the ndbcluster storage engine. It is necessary to have this package installed on all computers that should store ndbcluster table data. -Note that this storage engine can only be used in conjunction -with the MySQL Max server. %{see_base} @@ -211,29 +209,6 @@ Obsoletes: mysql-shared This package contains the shared libraries (*.so*) which certain languages and applications need to dynamically load and use MySQL. -%package Max -Summary: MySQL - server with extended functionality -Group: Applications/Databases -Provides: mysql-Max -Obsoletes: mysql-Max -Requires: MySQL-server >= @MYSQL_BASE_VERSION@ - -%description Max -Optional MySQL server binary that supports additional features like: - - - Berkeley DB Storage Engine - - Ndbcluster Storage Engine interface - - Archive Storage Engine - - CSV Storage Engine - - Example Storage Engine - - Federated Storage Engine - - User Defined Functions (UDFs). - -To activate this binary, just install this package in addition to -the standard MySQL package. - -Please note that this is a dynamically linked binary! - #%package embedded #Requires: %{name}-devel #Summary: MySQL - embedded library @@ -323,9 +298,6 @@ mkdir -p $RBR%{_libdir}/mysql PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin} export PATH -# Build the Max binary (includes BDB and UDFs and therefore -# cannot be linked statically against the patched glibc) - # Use gcc for C and C++ code (to avoid a dependency on libstdc++ and # including exceptions into the code if [ -z "$CXX" -a -z "$CC" ] @@ -334,81 +306,48 @@ then export CXX="gcc" fi -BuildMySQL "--enable-shared \ - --with-extra-charsets=all \ - --with-berkeley-db \ - --with-innodb \ - --with-ndbcluster \ - --with-archive-storage-engine \ - --with-csv-storage-engine \ - --with-example-storage-engine \ - --with-blackhole-storage-engine \ - --with-federated-storage-engine \ - --with-big-tables \ - --with-comment=\"MySQL Community Edition - Experimental (GPL)\" \ - --with-server-suffix='-max'" - -# We might want to save the config log file -if test -n "$MYSQL_MAXCONFLOG_DEST" -then - cp -fp config.log "$MYSQL_MAXCONFLOG_DEST" -fi - -( cd mysql-test - MTR_BUILD_THREAD=auto - export MTR_BUILD_THREAD - perl ./mysql-test-run.pl --force --report-features - perl ./mysql-test-run.pl --force --ps-protocol - true ) - -# Save mysqld-max -./libtool --mode=execute cp sql/mysqld sql/mysqld-max -./libtool --mode=execute nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym - -# Save the perror binary so it supports the NDB error codes (BUG#13740) -./libtool --mode=execute cp extra/perror extra/perror.ndb - -# Install the ndb binaries -(cd ndb; make install DESTDIR=$RBR) - -# Include libgcc.a in the devel subpackage (BUG 4921) -if expr "$CC" : ".*gcc.*" > /dev/null ; -then - libgcc=`$CC $CFLAGS --print-libgcc-file` - if [ -f $libgcc ] - then - %define have_libgcc 1 - install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a - fi -fi - -# Save libraries -(cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*) -(cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*) -(cd ndb/src/.libs; tar rf $RBR/shared-libs.tar *.so*) - -# Now clean up -make clean - # # Only link statically on our i386 build host (which has a specially # patched static glibc installed) - ia64 and x86_64 run glibc-2.3 (unpatched) # so don't link statically there # -BuildMySQL "--disable-shared \ +for servertype in '--with-debug=full' ' ' +do + BuildMySQL "\ %if %{STATIC_BUILD} + --disable-shared \ --with-mysqld-ldflags='-all-static' \ --with-client-ldflags='-all-static' \ $USE_OTHER_LIBC_DIR \ %else + --enable-shared \ --with-zlib-dir=bundled \ %endif --with-extra-charsets=complex \ - --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ + --with-comment=\"MySQL Community Edition (GPL)\" \ --with-server-suffix='%{server_suffix}' \ --with-archive-storage-engine \ --with-innodb \ - --with-big-tables" + --with-ndbcluster \ + --with-csv-storage-engine \ + --with-example-storage-engine \ + --with-blackhole-storage-engine \ + --with-federated-storage-engine \ + --with-big-tables $servertype" + if test "$servertype" != ' ' + then + # if this is not the regular build, we save the server binary + ./libtool --mode=execute cp sql/mysqld sql/mysqld-debug + ./libtool --mode=execute nm --numeric-sort sql/mysqld-debug > sql/mysqld-debug.sym + echo "# debug" + ( cd mysql-test + MTR_BUILD_THREAD=auto + export MTR_BUILD_THREAD + perl ./mysql-test-run.pl --force --report-features + true ) + make clean + fi +done ./libtool --mode=execute nm --numeric-sort sql/mysqld > sql/mysqld.sym @@ -418,6 +357,7 @@ then cp -fp config.log "$MYSQL_CONFLOG_DEST" fi +echo "# standard" ( cd mysql-test MTR_BUILD_THREAD=auto export MTR_BUILD_THREAD @@ -438,22 +378,33 @@ install -d $RBR%{_libdir} install -d $RBR%{_mandir} install -d $RBR%{_sbindir} - # Install all binaries stripped make install-strip DESTDIR=$RBR benchdir_root=%{_datadir} +# Install the ndb binaries +(cd ndb; make install DESTDIR=$RBR) + +# Install the saved debug server +install -s -m 755 $MBD/sql/mysqld-debug $RBR%{_sbindir}/mysqld-debug + # Install shared libraries (Disable for architectures that don't support it) -(cd $RBR%{_libdir}; tar xf $RBR/shared-libs.tar; rm -f $RBR/shared-libs.tar) +# (cd $RBR%{_libdir}; tar xf $RBR/shared-libs.tar; rm -f $RBR/shared-libs.tar) -# install saved mysqld-max -install -s -m 755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max - -# install saved perror binary with NDB support (BUG#13740) -install -s -m 755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror +# Include libgcc.a in the devel subpackage (BUG 4921) +if expr "$CC" : ".*gcc.*" > /dev/null ; +then + libgcc=`$CC $CFLAGS --print-libgcc-file` + if [ -f $libgcc ] + then + %define have_libgcc 1 + install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a + fi +fi # install symbol files ( for stack trace resolution) -install -m 644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym +# install -m 644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym install -m 644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym +install -m 644 $MBD/sql/mysqld-debug.sym $RBR%{_libdir}/mysql/mysqld-debug.sym # Install logrotate and autostart install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql @@ -539,19 +490,12 @@ chmod -R og-rw $mysql_datadir/mysql # Allow safe_mysqld to start mysqld and print a message before we exit sleep 2 - %post ndb-storage mysql_clusterdir=/var/lib/mysql-cluster # Create cluster directory if needed if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi - -%post Max -# Restart mysqld, to use the new binary. -echo "Restarting mysqld." -%{_sysconfdir}/init.d/mysql restart > /dev/null 2>&1 - %preun server if test $1 = 0 then @@ -644,6 +588,7 @@ fi %attr(755, root, root) %{_bindir}/safe_mysqld %attr(755, root, root) %{_sbindir}/mysqld +%attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/mysqlmanager %attr(755, root, root) %{_sbindir}/rcmysql %attr(644, root, root) %{_libdir}/mysql/mysqld.sym @@ -772,11 +717,6 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/mysql-stress-test.pl.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1* -%files Max -%defattr(-, root, root, 0755) -%attr(755, root, root) %{_sbindir}/mysqld-max -%attr(644, root, root) %{_libdir}/mysql/mysqld-max.sym - #%files embedded #%defattr(-, root, root, 0755) # %attr(644, root, root) %{_libdir}/mysql/libmysqld.a @@ -784,7 +724,16 @@ fi # The spec file changelog only includes changes made to the spec file # itself - note that they must be ordered by date (important when # merging BK trees) -%changelog +%changelog +* Wed Mar 21 2007 Daniel Fischer + +- Add debug server. + +* Mon Mar 19 2007 Daniel Fischer + +- Remove Max RPMs; the server RPMs contain a mysqld compiled with all + features that previously only were built into Max. + * Fri Mar 02 2007 Joerg Bruehe - Add several man pages for NDB which are now created. From 85613003c71ee9ce9f7520eeac000e82b65d5638 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 18:39:11 +0200 Subject: [PATCH 549/789] Bug#25337 Cannot build with OpenSSL support sql/Makefile.am: Put the openssl_includes directives on same line as something else to avoid a "blank line" --- sql/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/Makefile.am b/sql/Makefile.am index a85eb012f1d..a84475f3295 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -21,8 +21,7 @@ MYSQLBASEdir= $(prefix) MYSQLLIBdir= $(pkglibdir) INCLUDES = @ZLIB_INCLUDES@ \ -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/regex -I$(srcdir) \ - $(openssl_includes) + -I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes) WRAPLIBS= @WRAPLIBS@ SUBDIRS = share libexec_PROGRAMS = mysqld From 65e5af7b7f8838c224d466ed0cd50440bc146ebc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 21:33:56 +0400 Subject: [PATCH 550/789] Fix a race that breaks the valgrind build. mysql-test/r/information_schema.result: Fix a race (updated result file) mysql-test/t/information_schema.test: Fix a race in a test. --- mysql-test/r/information_schema.result | 3 ++- mysql-test/t/information_schema.test | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 6c03ace3d27..ac280f301d8 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1415,7 +1415,8 @@ CREATE TABLE server_status (variable_name VARCHAR(64), variable_value DECIMAL(22,7)); DROP EVENT IF EXISTS log_status; CREATE EVENT log_status -ON SCHEDULE EVERY 1 SECOND +ON SCHEDULE AT NOW() +ON COMPLETION PRESERVE DO BEGIN INSERT INTO thread_status SELECT variable_name, variable_value FROM diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index bd1f4271c94..96a11b3061e 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1059,7 +1059,8 @@ DROP EVENT IF EXISTS log_status; DELIMITER $$; CREATE EVENT log_status - ON SCHEDULE EVERY 1 SECOND + ON SCHEDULE AT NOW() + ON COMPLETION PRESERVE DO BEGIN INSERT INTO thread_status SELECT variable_name, variable_value FROM @@ -1071,12 +1072,12 @@ information_schema.global_status; DELIMITER ;$$ SET GLOBAL event_scheduler=1; -sleep 1; +let $wait_condition=select count(variable_name) != 0 from server_status; +let $wait_timeout=30; +--source include/wait_condition.inc SELECT * FROM thread_status WHERE variable_name LIKE 'SSL%' LIMIT 1,2; SELECT variable_name FROM server_status LIMIT 1,2; - - DROP EVENT log_status; DROP TABLE thread_status; DROP TABLE server_status; From 73fb1aed614d77539debaa0c2f4445d09b6af010 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 15:05:33 -0500 Subject: [PATCH 551/789] Bug #20376 Doesn't auto-detect data dir This changeset fixes the problem where mysql, when run as a service, can't "detect" it's own data directory. sql/mysqld.cc: When running on Windows we check to see if we have a hard path in my_progname. If not, then we use GetModuleFilename to get the full path for the executing module. This allows the program to determine where it's at when running as a service. --- sql/mysqld.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5031496158b..04d4c3e76e1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7333,6 +7333,18 @@ static void mysql_init_variables(void) /* Allow Win32 and NetWare users to move MySQL anywhere */ { char prg_dev[LIBLEN]; +#if defined __WIN__ + char executing_path_name[LIBLEN]; + if (!test_if_hard_path(my_progname)) + { + // we don't want to use GetModuleFileName inside of my_path since + // my_path is a generic path dereferencing function and here we care + // only about the executing binary. + GetModuleFileName(NULL, executing_path_name, sizeof(executing_path_name)); + my_path(prg_dev, executing_path_name, NULL); + } + else +#endif my_path(prg_dev,my_progname,"mysql/bin"); strcat(prg_dev,"/../"); // Remove 'bin' to get base dir cleanup_dirname(mysql_home,prg_dev); From 0ee34b1ca25aa757f373857513d51d58fd7aea80 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 14:32:16 -0700 Subject: [PATCH 552/789] Fixed bug #27532: wrong results with ORDER/GROUP BY queries containing IN/BETWEEN predicates in sorting expressions. Wrong results may occur when the select list contains an expression with IN/BETWEEN predicate that differs from a sorting expression by an additional NOT only. Added the method Item_func_opt_neg::eq to compare correctly expressions containing [NOT] IN/BETWEEN. The eq method inherited from the Item_func returns TRUE when comparing 'a IN (1,2)' with 'a NOT IN (1,2)' that is not, of course, correct. mysql-test/r/order_by.result: Added a test case for bug #27532. mysql-test/t/order_by.test: Added a test case for bug #27532. sql/item_cmpfunc.cc: Fixed bug #27532. Added the method Item_func_opt_neg::eq to compare correctly expressions containing [NOT] IN/BETWEEN. The eq method inherited from the Item_func returns TRUE when comparing 'a IN (1,2)' with 'a NOT IN (1,2)' that is not, of course, correct. sql/item_cmpfunc.h: Added the method Item_func_opt_neg::eq to compare correctly expressions containing [NOT] IN/BETWEEN. The eq method inherited from the Item_func returns TRUE when comparing 'a IN (1,2)' with 'a NOT IN (1,2)' that is not, of course, correct. --- mysql-test/r/order_by.result | 59 ++++++++++++++++++++++++++++++++++++ mysql-test/t/order_by.test | 29 ++++++++++++++++++ sql/item_cmpfunc.cc | 20 ++++++++++++ sql/item_cmpfunc.h | 1 + 4 files changed, 109 insertions(+) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index f5601ba0e43..2d6a4a922bc 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -879,3 +879,62 @@ ERROR 23000: Column 'val' in order clause is ambiguous SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1; ERROR 23000: Column 'val' in order clause is ambiguous DROP TABLE t1; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (3), (2), (4), (1); +SELECT a, IF(a IN (2,3), a, a+10) FROM t1 +ORDER BY IF(a IN (2,3), a, a+10); +a IF(a IN (2,3), a, a+10) +2 2 +3 3 +1 11 +4 14 +SELECT a, IF(a NOT IN (2,3), a, a+10) FROM t1 +ORDER BY IF(a NOT IN (2,3), a, a+10); +a IF(a NOT IN (2,3), a, a+10) +1 1 +4 4 +2 12 +3 13 +SELECT a, IF(a IN (2,3), a, a+10) FROM t1 +ORDER BY IF(a NOT IN (2,3), a, a+10); +a IF(a IN (2,3), a, a+10) +1 11 +4 14 +2 2 +3 3 +SELECT a, IF(a BETWEEN 2 AND 3, a, a+10) FROM t1 +ORDER BY IF(a BETWEEN 2 AND 3, a, a+10); +a IF(a BETWEEN 2 AND 3, a, a+10) +2 2 +3 3 +1 11 +4 14 +SELECT a, IF(a NOT BETWEEN 2 AND 3, a, a+10) FROM t1 +ORDER BY IF(a NOT BETWEEN 2 AND 3, a, a+10); +a IF(a NOT BETWEEN 2 AND 3, a, a+10) +1 1 +4 4 +2 12 +3 13 +SELECT a, IF(a BETWEEN 2 AND 3, a, a+10) FROM t1 +ORDER BY IF(a NOT BETWEEN 2 AND 3, a, a+10); +a IF(a BETWEEN 2 AND 3, a, a+10) +1 11 +4 14 +2 2 +3 3 +SELECT IF(a IN (1,2), a, '') as x1, IF(a NOT IN (1,2), a, '') as x2 +FROM t1 GROUP BY x1, x2; +x1 x2 + 3 + 4 +1 +2 +SELECT IF(a IN (1,2), a, '') as x1, IF(a NOT IN (1,2), a, '') as x2 +FROM t1 GROUP BY x1, IF(a NOT IN (1,2), a, ''); +x1 x2 + 3 + 4 +1 +2 +DROP TABLE t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index d781bd6c6ba..af5811fb4a2 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -617,6 +617,35 @@ SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val; --error 1052 SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1; +DROP TABLE t1; + +# +# Bug #27532: ORDER/GROUP BY expressions with IN/BETWEEN and NOT IN/BETWEEN +# + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (3), (2), (4), (1); + +SELECT a, IF(a IN (2,3), a, a+10) FROM t1 + ORDER BY IF(a IN (2,3), a, a+10); +SELECT a, IF(a NOT IN (2,3), a, a+10) FROM t1 + ORDER BY IF(a NOT IN (2,3), a, a+10); +SELECT a, IF(a IN (2,3), a, a+10) FROM t1 + ORDER BY IF(a NOT IN (2,3), a, a+10); + +SELECT a, IF(a BETWEEN 2 AND 3, a, a+10) FROM t1 + ORDER BY IF(a BETWEEN 2 AND 3, a, a+10); +SELECT a, IF(a NOT BETWEEN 2 AND 3, a, a+10) FROM t1 + ORDER BY IF(a NOT BETWEEN 2 AND 3, a, a+10); +SELECT a, IF(a BETWEEN 2 AND 3, a, a+10) FROM t1 + ORDER BY IF(a NOT BETWEEN 2 AND 3, a, a+10); + +SELECT IF(a IN (1,2), a, '') as x1, IF(a NOT IN (1,2), a, '') as x2 + FROM t1 GROUP BY x1, x2; +SELECT IF(a IN (1,2), a, '') as x1, IF(a NOT IN (1,2), a, '') as x2 + FROM t1 GROUP BY x1, IF(a NOT IN (1,2), a, ''); + + DROP TABLE t1; # End of 4.1 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ffb60754381..4d54dfc2b39 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -838,6 +838,26 @@ longlong Item_func_strcmp::val_int() } +bool Item_func_opt_neg::eq(const Item *item, bool binary_cmp) const +{ + /* Assume we don't have rtti */ + if (this == item) + return 1; + if (item->type() != FUNC_ITEM) + return 0; + Item_func *item_func=(Item_func*) item; + if (arg_count != item_func->arg_count || + functype() != item_func->functype()) + return 0; + if (negated != ((Item_func_opt_neg *) item_func)->negated) + return 0; + for (uint i=0; i < arg_count ; i++) + if (!args[i]->eq(item_func->arguments()[i], binary_cmp)) + return 0; + return 1; +} + + void Item_func_interval::fix_length_and_dec() { if (row->cols() > 8) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index a13be83e093..132e019b4a3 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -405,6 +405,7 @@ public: negated= !negated; return this; } + bool eq(const Item *item, bool binary_cmp) const; }; From da037917b22ad522062ddcb15f96bc6249084fd3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 17:09:41 -0700 Subject: [PATCH 553/789] Fix after manual merge --- mysql-test/r/order_by.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 918a6b2e3d1..5eeb9bd6190 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -963,8 +963,8 @@ x1 x2 3 4 1 -2 -DROP TABLE t1; +2 +DROP TABLE t1; create table t1 (a int not null, b int not null, c int not null); insert t1 values (1,1,1),(1,1,2),(1,2,1); select a, b from t1 group by a, b order by sum(c); From e488e6f23a14490b619d5bbbf2fc4db65dc4b9ef Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 19:45:37 -0700 Subject: [PATCH 554/789] Improved coverage for the code added to fix bug 27532. --- mysql-test/r/order_by.result | 25 +++++++++++++++++++++++++ mysql-test/t/order_by.test | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 2d6a4a922bc..79b163dc1ee 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -937,4 +937,29 @@ x1 x2 4 1 2 +SELECT a, a IN (1,2) FROM t1 ORDER BY a IN (1,2); +a a IN (1,2) +3 0 +4 0 +2 1 +1 1 +SELECT a FROM t1 ORDER BY a IN (1,2); +a +3 +4 +2 +1 +SELECT a+10 FROM t1 ORDER BY a IN (1,2); +a+10 +13 +14 +12 +11 +SELECT a, IF(a IN (1,2), a, a+10) FROM t1 +ORDER BY IF(a IN (3,4), a, a+10); +a IF(a IN (1,2), a, a+10) +3 13 +4 14 +1 1 +2 2 DROP TABLE t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index af5811fb4a2..5c607608462 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -645,6 +645,12 @@ SELECT IF(a IN (1,2), a, '') as x1, IF(a NOT IN (1,2), a, '') as x2 SELECT IF(a IN (1,2), a, '') as x1, IF(a NOT IN (1,2), a, '') as x2 FROM t1 GROUP BY x1, IF(a NOT IN (1,2), a, ''); +# The remaining queries are for better coverage +SELECT a, a IN (1,2) FROM t1 ORDER BY a IN (1,2); +SELECT a FROM t1 ORDER BY a IN (1,2); +SELECT a+10 FROM t1 ORDER BY a IN (1,2); +SELECT a, IF(a IN (1,2), a, a+10) FROM t1 + ORDER BY IF(a IN (3,4), a, a+10); DROP TABLE t1; From ee58034fc9c67615e60799e20e7d6d30ed01f58b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 15:22:37 +0800 Subject: [PATCH 555/789] recovery from 5.0 merge for bug18676 mysql-test/r/ndb_autodiscover.result: recovery for bug#18676 merge in 5.0 sql/ha_ndbcluster.cc: recovery for bug#18676 merge in 5.0 sql/handler.cc: recovery for bug#18676 merge in 5.0 sql/sql_table.cc: recovery for bug#18676 merge in 5.0 --- mysql-test/r/ndb_autodiscover.result | 2 +- sql/ha_ndbcluster.cc | 2 ++ sql/handler.cc | 8 ++++---- sql/sql_table.cc | 2 -- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 487f52f6427..cb85c4ac873 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -382,7 +382,7 @@ create table t1 (a int primary key) engine=ndb; select * from t1; a select * from t1; -ERROR HY000: Can't lock file (errno: 157) +ERROR HY000: Can't lock file (errno: 4009) use test; drop database test_only_ndb_tables; CREATE TABLE t9 ( diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 5ea29265388..4db35cd7377 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -221,6 +221,7 @@ static int ndb_to_mysql_error(const NdbError *ndberr) { /* read the mysql mapped error code */ int error= ndberr->mysql_code; + switch (error) { /* errors for which we do not add warnings, just return mapped error code @@ -239,6 +240,7 @@ static int ndb_to_mysql_error(const NdbError *ndberr) default: break; } + /* Push the NDB error message as warning - Used to be able to use SHOW WARNINGS toget more info on what the error is diff --git a/sql/handler.cc b/sql/handler.cc index 751b324165d..23c3103493e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2865,9 +2865,9 @@ ha_find_files(THD *thd,const char *db,const char *path, Ask handler if the table exists in engine RETURN - HA_ERR_NO_SUCH_TABLE Table does not exist - HA_ERR_TABLE_EXIST Table exists - # Error code + 0 Table does not exist + 1 Table exists + # Error code */ struct st_table_exists_in_engine_args @@ -2891,7 +2891,7 @@ static my_bool table_exists_in_engine_handlerton(THD *thd, st_plugin_int *plugin int ha_table_exists_in_engine(THD* thd, const char* db, const char* name) { - int error= HA_ERR_NO_SUCH_TABLE; + int error= 0; DBUG_ENTER("ha_table_exists_in_engine"); DBUG_PRINT("enter", ("db: %s, name: %s", db, name)); st_table_exists_in_engine_args args= {db, name}; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 006ff3d7093..fc401e93d9c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3439,7 +3439,6 @@ bool mysql_create_table_internal(THD *thd, error= 0; goto err; } - DBUG_PRINT("info",("1")); my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias); goto err; } @@ -3451,7 +3450,6 @@ bool mysql_create_table_internal(THD *thd, { if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS) goto warn; - DBUG_PRINT("info",("2")); my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name); goto unlock_and_end; } From e079dbd7ec73f4d05b56743069b0e42685c3c3e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 10:59:00 +0200 Subject: [PATCH 556/789] Only check for warnings produced by mysqltest if --check-testcases --- mysql-test/lib/mtr_report.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index d47f9051763..a2f22ef8870 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -296,12 +296,15 @@ sub mtr_report_stats ($) { } } - # Look for warnings produced by mysqltest in testname.warnings - foreach my $test_warning_file - ( glob("$::glob_mysql_test_dir/r/*.warnings") ) + if ( $::opt_check_testcases ) { - $found_problems= 1; - print WARN "Check myqltest warnings in $test_warning_file\n"; + # Look for warnings produced by mysqltest in testname.warnings + foreach my $test_warning_file + ( glob("$::glob_mysql_test_dir/r/*.warnings") ) + { + $found_problems= 1; + print WARN "Check myqltest warnings in $test_warning_file\n"; + } } if ( $found_problems ) From 93e11dce942e8aec8501982fe3e664a9d4abd471 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 14:01:47 +0500 Subject: [PATCH 557/789] Bug #23675 Partitions: possible security breach via alter now we return different error message if user doesn't have SELECT grants mysql-test/r/partition_grant.result: test result mysql-test/t/partition_grant.test: testcase sql/mysql_priv.h: no_errors parameter added to check_single_table_access() sql/partition_info.cc: access rights control added to the print_no_partition() sql/share/errmsg.txt: message added sql/sql_base.cc: no_errors parameter added to check_single_table_access() sql/sql_parse.cc: no_errors parameter added to check_single_table_access() --- mysql-test/r/partition_grant.result | 11 ++++++++++- mysql-test/t/partition_grant.test | 24 +++++++++++++++++++++++- sql/mysql_priv.h | 2 +- sql/partition_info.cc | 26 +++++++++++++++++++------- sql/share/errmsg.txt | 2 ++ sql/sql_base.cc | 2 +- sql/sql_parse.cc | 12 +++++++----- 7 files changed, 63 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/partition_grant.result b/mysql-test/r/partition_grant.result index e88427e5396..c334a473a2a 100644 --- a/mysql-test/r/partition_grant.result +++ b/mysql-test/r/partition_grant.result @@ -19,7 +19,16 @@ revoke alter on mysqltest_1.* from mysqltest_1@localhost; alter table t1 drop partition p3; ERROR 42000: ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1' revoke select,alter,drop on mysqltest_1.* from mysqltest_1@localhost; -drop user mysqltest_1@localhost; drop table t1; +create table t1 (s1 int); +insert into t1 values (1); +grant alter on mysqltest_1.* to mysqltest_1@localhost; +alter table t1 partition by list (s1) (partition p1 values in (2)); +ERROR HY000: Table has no partition for some existing values +grant select, alter on mysqltest_1.* to mysqltest_1@localhost; +alter table t1 partition by list (s1) (partition p1 values in (2)); +ERROR HY000: Table has no partition for value 1 +drop table t1; +drop user mysqltest_1@localhost; drop schema mysqltest_1; End of 5.1 tests diff --git a/mysql-test/t/partition_grant.test b/mysql-test/t/partition_grant.test index ee7c71b497a..0d30ad01c7a 100644 --- a/mysql-test/t/partition_grant.test +++ b/mysql-test/t/partition_grant.test @@ -52,8 +52,30 @@ disconnect conn3; connection default; revoke select,alter,drop on mysqltest_1.* from mysqltest_1@localhost; -drop user mysqltest_1@localhost; drop table t1; + +# +# Bug #23675 Partitions: possible security breach via alter +# + +create table t1 (s1 int); +insert into t1 values (1); +grant alter on mysqltest_1.* to mysqltest_1@localhost; +connect (conn4,localhost,mysqltest_1,,mysqltest_1); +connection conn4; +--error 1514 +alter table t1 partition by list (s1) (partition p1 values in (2)); +connection default; +grant select, alter on mysqltest_1.* to mysqltest_1@localhost; +disconnect conn4; +connect (conn5,localhost,mysqltest_1,,mysqltest_1); +--error 1514 +alter table t1 partition by list (s1) (partition p1 values in (2)); +disconnect conn5; +connection default; +drop table t1; + +drop user mysqltest_1@localhost; drop schema mysqltest_1; --echo End of 5.1 tests diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 099c9b98c1f..1fa92c00b1e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -598,7 +598,7 @@ class THD; void close_thread_tables(THD *thd, bool locked=0, bool skip_derived=0); bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables); bool check_single_table_access(THD *thd, ulong privilege, - TABLE_LIST *tables); + TABLE_LIST *tables, bool no_errors); bool check_routine_access(THD *thd,ulong want_access,char *db,char *name, bool is_proc, bool no_errors); bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table); diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a7f9bd413c6..98c2e5432ab 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -849,15 +849,27 @@ void partition_info::print_no_partition_found(TABLE *table) { char buf[100]; char *buf_ptr= (char*)&buf; - my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set); + TABLE_LIST table_list; - if (part_expr->null_value) - buf_ptr= (char*)"NULL"; + bzero(&table_list, sizeof(table_list)); + table_list.db= table->s->db.str; + table_list.table_name= table->s->table_name.str; + + if (check_single_table_access(current_thd, + SELECT_ACL, &table_list, TRUE)) + my_message(ER_NO_PARTITION_FOR_GIVEN_VALUE, + ER(ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT), MYF(0)); else - longlong2str(err_value, buf, - part_expr->unsigned_flag ? 10 : -10); - my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr); - dbug_tmp_restore_column_map(table->read_set, old_map); + { + my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set); + if (part_expr->null_value) + buf_ptr= (char*)"NULL"; + else + longlong2str(err_value, buf, + part_expr->unsigned_flag ? 10 : -10); + my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr); + dbug_tmp_restore_column_map(table->read_set, old_map); + } } /* Set up buffers and arrays for fields requiring preparation diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 1d9c7c814fd..38b27b0b5df 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6053,3 +6053,5 @@ ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009 ER_BINLOG_PURGE_EMFILE eng "Too many files opened, please execute the command again" ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus" +ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT + eng "Table has no partition for some existing values" diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d4316f11491..06207492926 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5781,7 +5781,7 @@ bool setup_tables_and_check_access(THD *thd, { if (leaves_tmp->belong_to_view && check_single_table_access(thd, first_table ? want_access_first : - want_access, leaves_tmp)) + want_access, leaves_tmp, FALSE)) { tables->hide_view_error(thd); return TRUE; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a396231b8a8..9c921286184 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4433,6 +4433,8 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables) thd Thread handler privilege requested privilege all_tables global table list of query + no_errors FALSE/TRUE - report/don't report error to + the client (using my_error() call). RETURN 0 - OK @@ -4440,7 +4442,7 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables) */ bool check_single_table_access(THD *thd, ulong privilege, - TABLE_LIST *all_tables) + TABLE_LIST *all_tables, bool no_errors) { Security_context * backup_ctx= thd->security_ctx; @@ -4456,12 +4458,12 @@ bool check_single_table_access(THD *thd, ulong privilege, db_name= all_tables->db; if (check_access(thd, privilege, db_name, - &all_tables->grant.privilege, 0, 0, + &all_tables->grant.privilege, 0, no_errors, test(all_tables->schema_table))) goto deny; /* Show only 1 table for check_grant */ - if (grant_option && check_grant(thd, privilege, all_tables, 0, 1, 0)) + if (grant_option && check_grant(thd, privilege, all_tables, 0, 1, no_errors)) goto deny; thd->security_ctx= backup_ctx; @@ -4489,7 +4491,7 @@ deny: bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables) { - if (check_single_table_access (thd,privilege,all_tables)) + if (check_single_table_access (thd,privilege,all_tables, FALSE)) return 1; /* Check rights on tables of subselects and implictly opened tables */ @@ -4502,7 +4504,7 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables) */ if (view && subselects_tables->belong_to_view == view) { - if (check_single_table_access (thd, privilege, subselects_tables)) + if (check_single_table_access (thd, privilege, subselects_tables, FALSE)) return 1; subselects_tables= subselects_tables->next_global; } From a16d1fd4389fc0a07522b442934ab22f19ae83c1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 14:19:33 +0500 Subject: [PATCH 558/789] merging mysql-test/r/ndb_partition_error2.result: error message fixed --- mysql-test/r/ndb_partition_error2.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/ndb_partition_error2.result b/mysql-test/r/ndb_partition_error2.result index fd477306858..a739ef3923c 100644 --- a/mysql-test/r/ndb_partition_error2.result +++ b/mysql-test/r/ndb_partition_error2.result @@ -1,3 +1,3 @@ drop table if exists t1; create table t1 (s1 int) engine=ndbcluster; -ERROR HY000: For the partitioned engine it is necessary to define all partition +ERROR HY000: For the partitioned engine it is necessary to define all partitions From c5bb750f0b509c2dc30e33b9c51d01e939d777be Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 11:41:43 +0200 Subject: [PATCH 559/789] Portability fix to work around OS X -x86 toolchain bug with common (uninitialized data) symbols mysys/my_pthread.c: Initialize thd_lib_detected for portability (OS X -x86) --- mysys/my_pthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index d8182b67442..aba3e47d754 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -29,7 +29,7 @@ #define SCHED_POLICY SCHED_OTHER #endif -uint thd_lib_detected; +uint thd_lib_detected= 0; #ifndef my_pthread_setprio void my_pthread_setprio(pthread_t thread_id,int prior) From dbd125fd909c531b2296a7bd90283d259a62fb59 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 13:38:19 +0300 Subject: [PATCH 560/789] BUG 27513: fixed left-over sql mode from a test case. --- mysql-test/r/errors.result | 7 +------ mysql-test/t/errors.test | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 0b12853ab80..94debb1785f 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -28,21 +28,16 @@ ERROR 42000: Display width out of range for column 'a' (max = 255) set sql_mode='traditional'; create table t1 (a varchar(66000)); ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead +set sql_mode=default; CREATE TABLE t1 (a INT); SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); a -Warnings: -Error 1365 Division by 0 INSERT INTO t1 VALUES(1); SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); a 1 -Warnings: -Error 1365 Division by 0 INSERT INTO t1 VALUES(2),(3); SELECT a FROM t1 WHERE a IN(1, (SELECT IF(1=0,1,2/0))); a 1 -Warnings: -Error 1365 Division by 0 DROP TABLE t1; diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index 6ddef2a8c08..4fbdcba635f 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -40,6 +40,7 @@ create table t1 (a int(256)); set sql_mode='traditional'; --error 1074 create table t1 (a varchar(66000)); +set sql_mode=default; # # Bug #27513: mysql 5.0.x + NULL pointer DoS From 3246ffded9cf97d45191c293aae4c06d5bf017ea Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 12:42:52 +0200 Subject: [PATCH 561/789] Bug#25337 Cannot build with OpenSSL support - Cleanup Makefile.am, simplify how we build gen_lex_hash and mysql_tzinfo_to_sql sql/Makefile.am: Build mysql_tz_info_to_sql directly from tztime.cc Group all settings for mysql_tzinfo_to_sql and gen_lex_hash together --- sql/Makefile.am | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sql/Makefile.am b/sql/Makefile.am index a84475f3295..801020c7e64 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -27,8 +27,7 @@ SUBDIRS = share libexec_PROGRAMS = mysqld EXTRA_PROGRAMS = gen_lex_hash bin_PROGRAMS = mysql_tzinfo_to_sql -gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@ -SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \ +SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/regex/libregex.a \ @@ -69,6 +68,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ event_data_objects.h event_scheduler.h \ sql_partition.h partition_info.h partition_element.h \ contributors.h sql_servers.h + mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \ @@ -110,11 +110,11 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ sql_builtin.cc sql_tablespace.cc partition_info.cc \ sql_servers.cc - gen_lex_hash_SOURCES = gen_lex_hash.cc -gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) -mysql_tzinfo_to_sql_SOURCES = mysql_tzinfo_to_sql.cc -mysql_tzinfo_to_sql_LDADD = @MYSQLD_EXTRA_LDFLAGS@ $(LDADD) $(CXXLDFLAGS) +gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@ + +mysql_tzinfo_to_sql_SOURCES = tztime.cc +mysql_tzinfo_to_sql_CXXFLAGS= -DTZINFO2SQL DEFS = -DMYSQL_SERVER \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ @@ -133,11 +133,7 @@ DISTCLEANFILES = $(EXTRA_PROGRAMS) MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC) AM_YFLAGS = -d --verbose -mysql_tzinfo_to_sql.cc: - rm -f mysql_tzinfo_to_sql.cc - @LN_CP_F@ $(srcdir)/tztime.cc mysql_tzinfo_to_sql.cc - -link_sources: mysql_tzinfo_to_sql.cc +link_sources: rm -f mini_client_errors.c @LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c mini_client_errors.c rm -f pack.c @@ -149,9 +145,6 @@ link_sources: mysql_tzinfo_to_sql.cc rm -f my_user.c @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c -mysql_tzinfo_to_sql.o: $(mysql_tzinfo_to_sql_SOURCES) - $(CXXCOMPILE) -c $(INCLUDES) -DTZINFO2SQL $< - # This generates lex_hash.h # NOTE Built sources should depend on their sources not the tool # this avoid the rebuild of the built files in a source dist From 2efc0f51cf3e80cd49c1ea0dee9a440936ee6287 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 12:50:39 +0200 Subject: [PATCH 562/789] Bug #26242 UPDATE with subquery and triggers failing with cluster tables In certain cases AFTER UPDATE/DELETE triggers on NDB tables that referenced subject table didn't see the results of operation which caused invocation of those triggers. In other words AFTER trigger invoked as result of update (or deletion) of particular row saw version of this row before update (or deletion). The problem occured because NDB handler in those cases postponed actual update/delete operations to be able to perform them later as one batch. This fix solves the problem by disabling this optimization for particular operation if subject table has AFTER trigger for this operation defined. To achieve this we introduce two new flags for handler::extra() method: HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH. These are called if there exists AFTER DELETE/UPDATE triggers during a statement that potentially can generate calls to delete_row()/update_row(). This includes multi_delete/multi_update statements as well as insert statements that do delete/update as part of an ON DUPLICATE statement. include/my_base.h: Added HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of delete/update is not possible. mysql-test/r/ndb_trigger.result: Bug #26242 UPDATE with subquery and triggers failing with cluster tables --- Added new test cases mysql-test/t/ndb_trigger.test: Bug #26242 UPDATE with subquery and triggers failing with cluster tables --- Added new test cases sql/ha_ndbcluster.cc: Bug #26242 UPDATE with subquery and triggers failing with cluster tables: Use HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of delete/update is not possible sql/ha_ndbcluster.h: Bug #26242 UPDATE with subquery and triggers failing with cluster tables: Added member variables for handling of HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of delete/update is not possible sql/mysql_priv.h: Added new method prepare_triggers_for_insert_stmt to check if batching of delete/update must be disallowed. sql/sql_delete.cc: Use HA_EXTRA_DELETE_CANNOT_BATCH to inform handler when batching of delete is not possible sql/sql_insert.cc: Added method prepare_triggers_for_insert_stmt to check if batching of delete/update must be dissallowed. Use HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of delete/update is not possible sql/sql_load.cc: Call prepare_triggers_for_insert_stmt to check if batching of delete/update must be dissallowed and mark fields used by triggers for the insert statement. sql/sql_trigger.h: Added has_triggers to support what particular triggers exist on a table. sql/sql_update.cc: Use HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of update is not possible --- include/my_base.h | 10 +- mysql-test/r/ndb_trigger.result | 171 ++++++++++++++++++++++++++++++++ mysql-test/t/ndb_trigger.test | 108 ++++++++++++++++++++ sql/ha_ndbcluster.cc | 23 ++++- sql/ha_ndbcluster.h | 2 + sql/mysql_priv.h | 2 + sql/sql_delete.cc | 24 +++++ sql/sql_insert.cc | 51 +++++++++- sql/sql_load.cc | 2 +- sql/sql_trigger.h | 5 + sql/sql_update.cc | 26 +++++ 11 files changed, 416 insertions(+), 8 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index dda64db2ef9..633cd8c8df0 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -161,7 +161,15 @@ enum ha_extra_function { Off by default. */ HA_EXTRA_WRITE_CAN_REPLACE, - HA_EXTRA_WRITE_CANNOT_REPLACE + HA_EXTRA_WRITE_CANNOT_REPLACE, + /* + Inform handler that delete_row()/update_row() cannot batch deletes/updates + and should perform them immediately. This may be needed when table has + AFTER DELETE/UPDATE triggers which access to subject table. + These flags are reset by the handler::extra(HA_EXTRA_RESET) call. + */ + HA_EXTRA_DELETE_CANNOT_BATCH, + HA_EXTRA_UPDATE_CANNOT_BATCH }; /* The following is parameter to ha_panic() */ diff --git a/mysql-test/r/ndb_trigger.result b/mysql-test/r/ndb_trigger.result index 27f83df70c9..562c5120715 100644 --- a/mysql-test/r/ndb_trigger.result +++ b/mysql-test/r/ndb_trigger.result @@ -116,4 +116,175 @@ op a b d 1 1.050000000000000000000000000000 d 2 2.050000000000000000000000000000 drop tables t1, t2, t3; +CREATE TABLE t1 ( +id INT NOT NULL PRIMARY KEY, +xy INT +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (1, 0); +CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END // +CREATE TABLE t2 ( +id INT NOT NULL PRIMARY KEY, +xy INT +) ENGINE=ndbcluster; +INSERT INTO t2 VALUES (2, 0); +CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster; +INSERT INTO t3 VALUES (1); +CREATE TABLE t4 LIKE t1; +CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END // +CREATE TABLE t5 LIKE t2; +UPDATE t1 SET xy = 3 WHERE id = 1; +SELECT xy FROM t1 where id = 1; +xy +3 +SELECT xy FROM t2 where id = 1; +xy +3 +UPDATE t1 SET xy = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1); +SELECT xy FROM t1 where id = 1; +xy +4 +SELECT xy FROM t2 where id = 1; +xy +4 +INSERT INTO t4 SELECT * FROM t1; +INSERT INTO t5 SELECT * FROM t2; +UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1; +SELECT xy FROM t1 where id = 1; +xy +3 +SELECT xy FROM t2 where id = 1; +xy +3 +SELECT xy FROM t4 where id = 1; +xy +3 +SELECT xy FROM t5 where id = 1; +xy +3 +UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1); +SELECT xy FROM t1 where id = 1; +xy +4 +SELECT xy FROM t2 where id = 1; +xy +4 +SELECT xy FROM t4 where id = 1; +xy +4 +SELECT xy FROM t5 where id = 1; +xy +4 +INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5; +SELECT xy FROM t1 where id = 1; +xy +5 +SELECT xy FROM t2 where id = 1; +xy +5 +DROP TRIGGER t1_update; +DROP TRIGGER t4_update; +CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END // +CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END // +INSERT INTO t1 VALUES (5, 0),(6,0); +INSERT INTO t2 VALUES (5, 1),(6,1); +INSERT INTO t3 VALUES (5); +SELECT * FROM t1 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5); +SELECT * FROM t1 order by id; +id xy +1 5 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +INSERT INTO t1 VALUES (5,0); +UPDATE t2 SET xy = 1 WHERE id = 6; +TRUNCATE t4; +INSERT INTO t4 SELECT * FROM t1; +TRUNCATE t5; +INSERT INTO t5 SELECT * FROM t2; +SELECT * FROM t1 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +SELECT * FROM t4 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t5 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5); +SELECT * FROM t1 order by id; +id xy +1 5 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +SELECT * FROM t4 order by id; +id xy +1 5 +6 0 +SELECT * FROM t5 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +INSERT INTO t1 VALUES (5, 0); +REPLACE INTO t2 VALUES (6,1); +SELECT * FROM t1 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +REPLACE INTO t1 VALUES (5, 1); +SELECT * FROM t1 order by id; +id xy +1 5 +5 1 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +DROP TRIGGER t1_delete; +DROP TRIGGER t4_delete; +DROP TABLE t1, t2, t3, t4, t5; End of 5.0 tests diff --git a/mysql-test/t/ndb_trigger.test b/mysql-test/t/ndb_trigger.test index 2521ef17842..25b079cfe7c 100644 --- a/mysql-test/t/ndb_trigger.test +++ b/mysql-test/t/ndb_trigger.test @@ -89,4 +89,112 @@ select * from t2 order by op, a, b; drop tables t1, t2, t3; +# Test for bug#26242 +# Verify that AFTER UPDATE/DELETE triggers are executed +# after the change has actually taken place + +CREATE TABLE t1 ( + id INT NOT NULL PRIMARY KEY, + xy INT +) ENGINE=ndbcluster; + +INSERT INTO t1 VALUES (1, 0); + +DELIMITER //; +CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END // +DELIMITER ;// + +CREATE TABLE t2 ( + id INT NOT NULL PRIMARY KEY, + xy INT +) ENGINE=ndbcluster; + +INSERT INTO t2 VALUES (2, 0); + +CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster; + +INSERT INTO t3 VALUES (1); + +CREATE TABLE t4 LIKE t1; + +DELIMITER //; +CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END // +DELIMITER ;// + +CREATE TABLE t5 LIKE t2; + +UPDATE t1 SET xy = 3 WHERE id = 1; +SELECT xy FROM t1 where id = 1; +SELECT xy FROM t2 where id = 1; + +UPDATE t1 SET xy = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1); +SELECT xy FROM t1 where id = 1; +SELECT xy FROM t2 where id = 1; + +INSERT INTO t4 SELECT * FROM t1; +INSERT INTO t5 SELECT * FROM t2; +UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1; +SELECT xy FROM t1 where id = 1; +SELECT xy FROM t2 where id = 1; +SELECT xy FROM t4 where id = 1; +SELECT xy FROM t5 where id = 1; + +UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1); +SELECT xy FROM t1 where id = 1; +SELECT xy FROM t2 where id = 1; +SELECT xy FROM t4 where id = 1; +SELECT xy FROM t5 where id = 1; + +INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5; +SELECT xy FROM t1 where id = 1; +SELECT xy FROM t2 where id = 1; + +DROP TRIGGER t1_update; +DROP TRIGGER t4_update; + +DELIMITER //; +CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END // +DELIMITER ;// + +DELIMITER //; +CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END // +DELIMITER ;// + +INSERT INTO t1 VALUES (5, 0),(6,0); +INSERT INTO t2 VALUES (5, 1),(6,1); +INSERT INTO t3 VALUES (5); +SELECT * FROM t1 order by id; +SELECT * FROM t2 order by id; +DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5); +SELECT * FROM t1 order by id; +SELECT * FROM t2 order by id; + +INSERT INTO t1 VALUES (5,0); +UPDATE t2 SET xy = 1 WHERE id = 6; +TRUNCATE t4; +INSERT INTO t4 SELECT * FROM t1; +TRUNCATE t5; +INSERT INTO t5 SELECT * FROM t2; +SELECT * FROM t1 order by id; +SELECT * FROM t2 order by id; +SELECT * FROM t4 order by id; +SELECT * FROM t5 order by id; +DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5); +SELECT * FROM t1 order by id; +SELECT * FROM t2 order by id; +SELECT * FROM t4 order by id; +SELECT * FROM t5 order by id; + +INSERT INTO t1 VALUES (5, 0); +REPLACE INTO t2 VALUES (6,1); +SELECT * FROM t1 order by id; +SELECT * FROM t2 order by id; +REPLACE INTO t1 VALUES (5, 1); +SELECT * FROM t1 order by id; +SELECT * FROM t2 order by id; + +DROP TRIGGER t1_delete; +DROP TRIGGER t4_delete; +DROP TABLE t1, t2, t3, t4, t5; + --echo End of 5.0 tests diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d1d3484d432..9c5c10aa3dd 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2524,8 +2524,13 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) ERR_RETURN(op->getNdbError()); } - // Execute update operation - if (!cursor && execute_no_commit(this,trans,false) != 0) { + /* + Execute update operation if we are not doing a scan for update + and there exist UPDATE AFTER triggers + */ + + if ((!cursor || m_update_cannot_batch) && + execute_no_commit(this,trans,false) != 0) { no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } @@ -2566,7 +2571,7 @@ int ha_ndbcluster::delete_row(const byte *record) no_uncommitted_rows_update(-1); - if (!m_primary_key_update) + if (!(m_primary_key_update || m_delete_cannot_batch)) // If deleting from cursor, NoCommit will be handled in next_result DBUG_RETURN(0); } @@ -3277,6 +3282,8 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) DBUG_PRINT("info", ("HA_EXTRA_RESET")); DBUG_PRINT("info", ("Clearing condition stack")); cond_clear(); + m_delete_cannot_batch= FALSE; + m_update_cannot_batch= FALSE; break; case HA_EXTRA_CACHE: /* Cash record in HA_rrnd() */ DBUG_PRINT("info", ("HA_EXTRA_CACHE")); @@ -3393,6 +3400,14 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) DBUG_PRINT("info", ("Turning OFF use of write instead of insert")); m_use_write= FALSE; break; + case HA_EXTRA_DELETE_CANNOT_BATCH: + DBUG_PRINT("info", ("HA_EXTRA_DELETE_CANNOT_BATCH")); + m_delete_cannot_batch= TRUE; + break; + case HA_EXTRA_UPDATE_CANNOT_BATCH: + DBUG_PRINT("info", ("HA_EXTRA_UPDATE_CANNOT_BATCH")); + m_update_cannot_batch= TRUE; + break; } DBUG_RETURN(0); @@ -4744,6 +4759,8 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): m_bulk_insert_rows((ha_rows) 1024), m_rows_changed((ha_rows) 0), m_bulk_insert_not_flushed(FALSE), + m_delete_cannot_batch(FALSE), + m_update_cannot_batch(FALSE), m_ops_pending(0), m_skip_auto_increment(TRUE), m_blobs_pending(0), diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 5d66a7920f9..452192d83a0 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -774,6 +774,8 @@ bool uses_blob_value(bool all_fields); ha_rows m_bulk_insert_rows; ha_rows m_rows_changed; bool m_bulk_insert_not_flushed; + bool m_delete_cannot_batch; + bool m_update_cannot_batch; ha_rows m_ops_pending; bool m_skip_auto_increment; bool m_blobs_pending; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1636b5a31e4..9d45f2ee5e4 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -811,6 +811,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table,List &fields, bool ignore); int check_that_all_fields_are_given_values(THD *thd, TABLE *entry, TABLE_LIST *table_list); +void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table, + enum_duplicates duplic); void mark_fields_used_by_triggers_for_insert_stmt(THD *thd, TABLE *table, enum_duplicates duplic); bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds); diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 87a6575cc64..668a3d8786a 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -209,7 +209,19 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, thd->proc_info="updating"; if (table->triggers) + { table->triggers->mark_fields_used(thd, TRG_EVENT_DELETE); + if (table->triggers->has_triggers(TRG_EVENT_DELETE, + TRG_ACTION_AFTER)) + { + /* + The table has AFTER DELETE triggers that might access to subject table + and therefore might need delete to be done immediately. So we turn-off + the batching. + */ + (void) table->file->extra(HA_EXTRA_DELETE_CANNOT_BATCH); + } + } while (!(error=info.read_record(&info)) && !thd->killed && !thd->net.report_error) @@ -526,7 +538,19 @@ multi_delete::initialize_tables(JOIN *join) else normal_tables= 1; if (tbl->triggers) + { tbl->triggers->mark_fields_used(thd, TRG_EVENT_DELETE); + if (tbl->triggers->has_triggers(TRG_EVENT_DELETE, + TRG_ACTION_AFTER)) + { + /* + The table has AFTER DELETE triggers that might access to subject + table and therefore might need delete to be done immediately. + So we turn-off the batching. + */ + (void) tbl->file->extra(HA_EXTRA_DELETE_CANNOT_BATCH); + } + } } else if ((tab->type != JT_SYSTEM && tab->type != JT_CONST) && walk == delete_tables) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 2ce83caa369..79e9988d8ce 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -279,6 +279,51 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list, } +/* + Prepare triggers for INSERT-like statement. + + SYNOPSIS + prepare_triggers_for_insert_stmt() + thd The current thread + table Table to which insert will happen + duplic Type of duplicate handling for insert which will happen + + NOTE + Prepare triggers for INSERT-like statement by marking fields + used by triggers and inform handlers that batching of UPDATE/DELETE + cannot be done if there are BEFORE UPDATE/DELETE triggers. +*/ + +void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table, + enum_duplicates duplic) +{ + if (table->triggers) + { + if (table->triggers->has_triggers(TRG_EVENT_DELETE, + TRG_ACTION_AFTER)) + { + /* + The table has AFTER DELETE triggers that might access to + subject table and therefore might need delete to be done + immediately. So we turn-off the batching. + */ + (void) table->file->extra(HA_EXTRA_DELETE_CANNOT_BATCH); + } + if (table->triggers->has_triggers(TRG_EVENT_UPDATE, + TRG_ACTION_AFTER)) + { + /* + The table has AFTER UPDATE triggers that might access to subject + table and therefore might need update to be done immediately. + So we turn-off the batching. + */ + (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH); + } + mark_fields_used_by_triggers_for_insert_stmt(thd, table, duplic); + } +} + + /* Mark fields used by triggers for INSERT-like statement. @@ -513,7 +558,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, error= 1; } - mark_fields_used_by_triggers_for_insert_stmt(thd, table, duplic); + prepare_triggers_for_insert_stmt(thd, table, duplic); if (table_list->prepare_where(thd, 0, TRUE) || table_list->prepare_check_option(thd)) @@ -2393,8 +2438,8 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) table_list->prepare_check_option(thd)); if (!res) - mark_fields_used_by_triggers_for_insert_stmt(thd, table, - info.handle_duplicates); + prepare_triggers_for_insert_stmt(thd, table, + info.handle_duplicates); DBUG_RETURN(res); } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index bdc08b7bd2d..857fe81c773 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -222,7 +222,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, DBUG_RETURN(TRUE); } - mark_fields_used_by_triggers_for_insert_stmt(thd, table, handle_duplicates); + prepare_triggers_for_insert_stmt(thd, table, handle_duplicates); uint tot_length=0; bool use_blobs= 0, use_vars= 0; diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index 7e0fadfa677..d2e3c52eef4 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -110,6 +110,11 @@ public: const char *old_table, const char *new_db, const char *new_table); + bool has_triggers(trg_event_type event_type, + trg_action_time_type action_time) + { + return (bodies[event_type][action_time]); + } bool has_delete_triggers() { return (bodies[TRG_EVENT_DELETE][TRG_ACTION_BEFORE] || diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d431b671f18..8ec4fcbbc4d 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -435,7 +435,19 @@ int mysql_update(THD *thd, MODE_STRICT_ALL_TABLES))); if (table->triggers) + { table->triggers->mark_fields_used(thd, TRG_EVENT_UPDATE); + if (table->triggers->has_triggers(TRG_EVENT_UPDATE, + TRG_ACTION_AFTER)) + { + /* + The table has AFTER UPDATE triggers that might access to subject + table and therefore might need update to be done immediately. + So we turn-off the batching. + */ + (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH); + } + } /* We can use compare_record() to optimize away updates if @@ -1000,6 +1012,20 @@ int multi_update::prepare(List ¬_used_values, table->no_keyread=1; table->used_keys.clear_all(); table->pos_in_table_list= tl; + if (table->triggers) + { + table->triggers->mark_fields_used(thd, TRG_EVENT_UPDATE); + if (table->triggers->has_triggers(TRG_EVENT_UPDATE, + TRG_ACTION_AFTER)) + { + /* + The table has AFTER UPDATE triggers that might access to subject + table and therefore might need update to be done immediately. + So we turn-off the batching. + */ + (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH); + } + } } } From 22e2ca5473531bb3af80f85959b51ae112e7b859 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 19:30:43 +0800 Subject: [PATCH 563/789] sync the initialization configuration information between ConfigInfo.cpp and ParamInfo.cpp --- storage/ndb/src/mgmsrv/ParamInfo.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/storage/ndb/src/mgmsrv/ParamInfo.cpp b/storage/ndb/src/mgmsrv/ParamInfo.cpp index a05472de2cb..26a759e43d2 100644 --- a/storage/ndb/src/mgmsrv/ParamInfo.cpp +++ b/storage/ndb/src/mgmsrv/ParamInfo.cpp @@ -380,10 +380,10 @@ const ParamInfo ParamInfoArray[] = { "If set to yes, then NDB Cluster data will not be swapped out to disk", CI_USED, true, - CI_BOOL, - "false", - "false", - "true" }, + CI_INT, + "0", + "1", + "2" }, { CFG_DB_WATCHDOG_INTERVAL, @@ -1114,6 +1114,18 @@ const ParamInfo ParamInfoArray[] = { "0", "0", STR_VALUE(MAX_INT_RNIL) }, + + { + CFG_DB_MEMREPORT_FREQUENCY, + "MemReportFrequency", + DB_TOKEN, + "Frequency of mem reports in seconds, 0 = only when passing %-limits", + CI_USED, + false, + CI_INT, + "0", + "0", + STR_VALUE(MAX_INT_RNIL) }, /*************************************************************************** * API From fe0716d0378994caee61b6fd6ad15059a2fabdc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 14:19:47 +0200 Subject: [PATCH 564/789] build fixes for 5.1.17 CMakeLists.txt: use correct runtime library for RelWithDebugInfo target and always generate .map files scripts/make_win_bin_dist: use RelWithDebInfo target output if exists, include copy mysqld and mysqlmanager debug info in distribution --- CMakeLists.txt | 8 ++++++++ scripts/make_win_bin_dist | 28 +++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb4d77db73f..ab7a7887c94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,14 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) + STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO + ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) + STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO + ${CMAKE_C_FLAGS_RELWITHDEBINFO}) + + # generate .map files + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS") + # remove support for Exception handling STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 146dcad95f1..9916d71e724 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,6 +126,15 @@ if [ -e $DESTDIR ] ; then usage fi +# ---------------------------------------------------------------------- +# Adjust target name if needed, release with debug info has another name +# ---------------------------------------------------------------------- + +if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ] +then + TARGET="relwithdebinfo" +fi + # ---------------------------------------------------------------------- # Copy executables, and client DLL (FIXME why?) # ---------------------------------------------------------------------- @@ -134,18 +143,20 @@ trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR mkdir $DESTDIR mkdir $DESTDIR/bin -cp client/$TARGET/*.exe $DESTDIR/bin/ -cp extra/$TARGET/*.exe $DESTDIR/bin/ -cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ -cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ +cp client/$TARGET/*.exe $DESTDIR/bin/ +cp extra/$TARGET/*.exe $DESTDIR/bin/ +cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map,pdb} $DESTDIR/bin/ +cp tests/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe +cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb +cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then @@ -342,6 +353,9 @@ done cp -pR sql/share $DESTDIR/ +# The SQL initiation code is really expected to be in "share" +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- From 5f74873349b0cf772db976906d091aff30b9fe12 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 17:36:58 +0500 Subject: [PATCH 565/789] Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte additional fix(to satisfy Win where CreateFile func does not support the path longer than 260) mysql-test/r/create.result: Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte additional fix mysql-test/t/create.test: Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte additional fix --- mysql-test/r/create.result | 30 ++++++++++++++++-------------- mysql-test/t/create.test | 29 ++++++++++++++++------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 717201f384a..39b112eb4f6 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -844,6 +844,12 @@ use имÑ_базы_в_кодировке_утф8_длиной_больше_че select database(); database() имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45 +use test; +select SCHEMA_NAME from information_schema.schemata +where schema_name='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +SCHEMA_NAME +имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45 +drop database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 ( имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 int, @@ -854,26 +860,22 @@ select имÑ_полÑ_в_кодировке_утф8_длиной_больше_ from имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; select * from имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 -select SCHEMA_NAME from information_schema.schemata -where schema_name='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; -SCHEMA_NAME -имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45 select TABLE_NAME from information_schema.tables where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; TABLE_NAME имÑ_вью_кодировке_утф8_длиной_больше_чем_42 имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 select COLUMN_NAME from information_schema.columns where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; COLUMN_NAME имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 select INDEX_NAME from information_schema.statistics where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; INDEX_NAME имÑ_индекÑа_в_кодировке_утф8_длиной_больше_чем_48 select TABLE_NAME from information_schema.views where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; TABLE_NAME имÑ_вью_кодировке_утф8_длиной_больше_чем_42 show create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; @@ -887,7 +889,7 @@ View Create View имÑ_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имÑ_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` AS `имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45` from `имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48` create event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48 on schedule every 2 year do select 1; select EVENT_NAME from information_schema.events -where event_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +where event_schema='test'; EVENT_NAME имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48 drop event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48; @@ -898,7 +900,7 @@ ERROR 42000: Identifier name 'очень_очень_очень_очень_оче create trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49 before insert on имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1; select TRIGGER_NAME from information_schema.triggers where -trigger_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +trigger_schema='test'; TRIGGER_NAME имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49 drop trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49; @@ -912,7 +914,7 @@ create procedure имÑ_процедуры_в_кодировке_утф8_дли begin end; select ROUTINE_NAME from information_schema.routines where -routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +routine_schema='test'; ROUTINE_NAME имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50 drop procedure имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50; @@ -924,7 +926,7 @@ create function имÑ_функции_в_кодировке_утф8_длиной returns int return 0; select ROUTINE_NAME from information_schema.routines where -routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +routine_schema='test'; ROUTINE_NAME имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49 drop function имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49; @@ -932,6 +934,6 @@ create function очень_очень_очень_очень_очень_очен returns int return 0; ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long -drop database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +drop view имÑ_вью_кодировке_утф8_длиной_больше_чем_42; +drop table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; set names default; -use test; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 83553e314a7..4fedea1cb84 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -743,6 +743,12 @@ set names utf8; create database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; use имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; select database(); +use test; + +select SCHEMA_NAME from information_schema.schemata +where schema_name='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; + +drop database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 ( имÑ_полÑ_в_кодировке_утф8_длиной_больше_чем_45 int, @@ -756,20 +762,17 @@ from имÑ_таблицы_в_кодировке_утф8_длиной_больш # database, table, field, key, view select * from имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; -select SCHEMA_NAME from information_schema.schemata -where schema_name='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; - select TABLE_NAME from information_schema.tables where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; select COLUMN_NAME from information_schema.columns where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; select INDEX_NAME from information_schema.statistics where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; select TABLE_NAME from information_schema.views where -table_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +table_schema='test'; show create table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; show create view имÑ_вью_кодировке_утф8_длиной_больше_чем_42; @@ -778,7 +781,7 @@ show create view имÑ_вью_кодировке_утф8_длиной_боль create event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48 on schedule every 2 year do select 1; select EVENT_NAME from information_schema.events -where event_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +where event_schema='test'; drop event имÑ_ÑобытиÑ_в_кодировке_утф8_длиной_больше_чем_48; --error 1059 create event @@ -788,7 +791,7 @@ on schedule every 2 year do select 1; create trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49 before insert on имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1; select TRIGGER_NAME from information_schema.triggers where -trigger_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +trigger_schema='test'; drop trigger имÑ_триггера_в_кодировке_утф8_длиной_больше_чем_49; --error 1059 create trigger @@ -801,7 +804,7 @@ create procedure имÑ_процедуры_в_кодировке_утф8_дли begin end; select ROUTINE_NAME from information_schema.routines where -routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +routine_schema='test'; drop procedure имÑ_процедуры_в_кодировке_утф8_длиной_больше_чем_50; --error 1059 create procedure очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66() @@ -812,13 +815,13 @@ create function имÑ_функции_в_кодировке_утф8_длиной returns int return 0; select ROUTINE_NAME from information_schema.routines where -routine_schema='имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45'; +routine_schema='test'; drop function имÑ_функции_в_кодировке_утф8_длиной_больше_чем_49; --error 1059 create function очень_очень_очень_очень_очень_очень_очень_очень_длиннаÑ_Ñтрока_66() returns int return 0; -drop database имÑ_базы_в_кодировке_утф8_длиной_больше_чем_45; +drop view имÑ_вью_кодировке_утф8_длиной_больше_чем_42; +drop table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; set names default; -use test; From ef217b8819276c434caf13e3a4feba0cd49e4adc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 14:46:09 +0200 Subject: [PATCH 566/789] set name for ndb tools --- storage/ndb/tools/delete_all.cpp | 1 + storage/ndb/tools/desc.cpp | 1 + storage/ndb/tools/drop_index.cpp | 1 + storage/ndb/tools/drop_tab.cpp | 1 + storage/ndb/tools/listTables.cpp | 1 + storage/ndb/tools/select_all.cpp | 1 + storage/ndb/tools/select_count.cpp | 1 + 7 files changed, 7 insertions(+) diff --git a/storage/ndb/tools/delete_all.cpp b/storage/ndb/tools/delete_all.cpp index c925e22d3ec..4e3037f1941 100644 --- a/storage/ndb/tools/delete_all.cpp +++ b/storage/ndb/tools/delete_all.cpp @@ -75,6 +75,7 @@ int main(int argc, char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_delete_all"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/storage/ndb/tools/desc.cpp b/storage/ndb/tools/desc.cpp index 4d9d6dff72a..9eb0cf67ceb 100644 --- a/storage/ndb/tools/desc.cpp +++ b/storage/ndb/tools/desc.cpp @@ -81,6 +81,7 @@ int main(int argc, char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_desc"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/storage/ndb/tools/drop_index.cpp b/storage/ndb/tools/drop_index.cpp index 23ebfff6cf4..256c40e1924 100644 --- a/storage/ndb/tools/drop_index.cpp +++ b/storage/ndb/tools/drop_index.cpp @@ -61,6 +61,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_drop_index"); if(con.connect(12, 5, 1) != 0) { return NDBT_ProgramExit(NDBT_FAILED); diff --git a/storage/ndb/tools/drop_tab.cpp b/storage/ndb/tools/drop_tab.cpp index d965be29f31..a7accb904a4 100644 --- a/storage/ndb/tools/drop_tab.cpp +++ b/storage/ndb/tools/drop_tab.cpp @@ -61,6 +61,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_drop_table"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/storage/ndb/tools/listTables.cpp b/storage/ndb/tools/listTables.cpp index 359e308dcb8..6a73bcc54f5 100644 --- a/storage/ndb/tools/listTables.cpp +++ b/storage/ndb/tools/listTables.cpp @@ -307,6 +307,7 @@ int main(int argc, char** argv){ _tabname = argv[0]; ndb_cluster_connection = new Ndb_cluster_connection(opt_connect_str); + ndb_cluster_connection->set_name("ndb_show_tables"); if (ndb_cluster_connection->connect(12,5,1)) fatal("Unable to connect to management server."); if (ndb_cluster_connection->wait_until_ready(30,0) < 0) diff --git a/storage/ndb/tools/select_all.cpp b/storage/ndb/tools/select_all.cpp index 9adde165003..e2072f30edf 100644 --- a/storage/ndb/tools/select_all.cpp +++ b/storage/ndb/tools/select_all.cpp @@ -129,6 +129,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_select_all"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/storage/ndb/tools/select_count.cpp b/storage/ndb/tools/select_count.cpp index 8933d803f53..552d156b665 100644 --- a/storage/ndb/tools/select_count.cpp +++ b/storage/ndb/tools/select_count.cpp @@ -83,6 +83,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_select_count"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; From aaaf49814682e7eb1c947eef8c59f8b2d20461a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 15:09:12 +0200 Subject: [PATCH 567/789] Add expansion of $variables in "let from query", "if with query" and "while with query" --- client/mysqltest.c | 11 ++++++++--- mysql-test/r/mysqltest.result | 3 +++ mysql-test/t/mysqltest.test | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 170819e9a1e..0a1b3aa239c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1328,6 +1328,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end) MYSQL_RES *res; MYSQL_ROW row; MYSQL* mysql = &cur_con->mysql; + DYNAMIC_STRING ds_query; DBUG_ENTER("var_query_set"); LINT_INIT(res); @@ -1337,13 +1338,17 @@ void var_query_set(VAR *var, const char *query, const char** query_end) die("Syntax error in query, missing '`'"); ++query; - if (mysql_real_query(mysql, query, (int)(end - query)) || + /* Eval the query, thus replacing all environment variables */ + init_dynamic_string(&ds_query, 0, (end - query) + 32, 256); + do_eval(&ds_query, query, end, FALSE); + + if (mysql_real_query(mysql, ds_query.str, ds_query.length) || !(res = mysql_store_result(mysql))) { - *end = 0; - die("Error running query '%s': %d %s", query, + die("Error running query '%s': %d %s", ds_query.str, mysql_errno(mysql), mysql_error(mysql)); } + dynstr_free(&ds_query); if ((row = mysql_fetch_row(res)) && row[0]) { diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 71f1c7de4ed..ba37284e597 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -268,6 +268,9 @@ mysqltest: At line 1: Missing assignment operator in let 1 # Execute: echo $success ; 1 +var2: content of variable 1 +var3: content of variable 1 content of variable 1 +length of var3 is longer than 0 mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Could not open file ./non_existingFile mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 221ad5d5c6e..9a7139187b5 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -685,6 +685,21 @@ echo # success: $success ; --echo # Execute: echo \$success ; echo $success ; +# ---------------------------------------------------------------------------- +# Test let from query with $variable +# let $=``; +# ---------------------------------------------------------------------------- + +let $var1=content of variable 1; +let $var2= `select "$var1"`; +let $var3= `select concat("$var1", " ", "$var2")`; +echo var2: $var2; +echo var3: $var3; +if (`select length("$var3") > 0`) +{ + echo length of var3 is longer than 0; +} + # ---------------------------------------------------------------------------- # Test to assign let from query # let $=``; From a3583bf3b55f97dddba183d288102edd022c8304 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 15:15:40 +0200 Subject: [PATCH 568/789] Add "skip" function, makeing mysqltest return an error code indicating test should be skipped --- client/mysqltest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 0a1b3aa239c..c2fd7a4ff0d 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -276,7 +276,7 @@ enum enum_commands { Q_IF, Q_DISABLE_PARSING, Q_ENABLE_PARSING, Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST, - Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, + Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP, Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES, Q_UNKNOWN, /* Unknown command. */ @@ -358,6 +358,7 @@ const char *command_names[]= "die", /* Don't execute any more commands, compare result */ "exit", + "skip", "chmod", "append_file", "cat_file", @@ -6258,6 +6259,9 @@ int main(int argc, char **argv) /* Stop processing any more commands */ abort_flag= 1; break; + case Q_SKIP: + abort_not_supported_test("%s", command->first_argument); + break; case Q_RESULT: die("result, deprecated command"); From 6aa11eebc5e846d2fe9c994be90597431d230aa0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 15:40:40 +0200 Subject: [PATCH 569/789] Skip test cases if the script or binary they need can't be found mysql-test/mysql-test-run.pl: Move some opt_extern hacks to same place. Remove duplicate opt_skip_im=1 if opt_extern mysql-test/t/fix_priv_tables.test: Skip test if $MYSQL_FIX_PRIVILEGE_TABLES is not set mysql-test/t/system_mysql_db_fix30020.test: Skip test if $MYSQL_FIX_SYSTEM_TABLES is not set mysql-test/t/system_mysql_db_fix40123.test: Skip test if $MYSQL_FIX_PRIVILEGE_TABLES is not set --- mysql-test/mysql-test-run.pl | 8 ++------ mysql-test/t/fix_priv_tables.test | 7 +++++++ mysql-test/t/system_mysql_db_fix30020.test | 8 ++++++-- mysql-test/t/system_mysql_db_fix40123.test | 7 +++++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b48ac6c5abc..6bd9122f07f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -724,8 +724,6 @@ sub command_line_setup () { { $mysqld_variables{'port'}= 3306; $mysqld_variables{'master-port'}= 3306; - $opt_skip_ndbcluster= 1; - $opt_skip_im= 1; } if ( $opt_comment ) @@ -1235,6 +1233,7 @@ sub command_line_setup () { { # Turn off features not supported when running with extern server $opt_skip_rpl= 1; + $opt_skip_ndbcluster= 1; # Setup master->[0] with the settings for the extern server $master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock"; @@ -2011,10 +2010,7 @@ sub environment_setup () { $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; } - if (!$opt_extern) - { - $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; - } + $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; # ---------------------------------------------------- # Setup env so childs can execute my_print_defaults diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test index 3a91f41dfcc..3051fd88076 100644 --- a/mysql-test/t/fix_priv_tables.test +++ b/mysql-test/t/fix_priv_tables.test @@ -1,6 +1,13 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +{ + skip Test need MYSQL_FIX_PRIVILEGE_TABLES; +} + # # This is the test for mysql_fix_privilege_tables # It checks that a system tables from mysql 4.1.23 diff --git a/mysql-test/t/system_mysql_db_fix30020.test b/mysql-test/t/system_mysql_db_fix30020.test index b71ae6c2204..23562807c14 100644 --- a/mysql-test/t/system_mysql_db_fix30020.test +++ b/mysql-test/t/system_mysql_db_fix30020.test @@ -1,8 +1,12 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc -# Windows doesn't support execution of shell scripts (to fix!!) ---source include/not_windows.inc +# Don't run this test if $MYSQL_FIX_SYSTEM_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`) +{ + skip Test need MYSQL_FIX_SYSTEM_TABLES; +} # # This is the test for mysql_fix_privilege_tables diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test index 471598625d4..012d05af3b8 100644 --- a/mysql-test/t/system_mysql_db_fix40123.test +++ b/mysql-test/t/system_mysql_db_fix40123.test @@ -1,6 +1,13 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +{ + skip Test need MYSQL_FIX_PRIVILEGE_TABLES; +} + # # This is the test for mysql_fix_privilege_tables # It checks that a system tables from mysql 4.1.23 From 59a64c2b1604649be464d38141e2345c79d27bd3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 16:58:25 +0200 Subject: [PATCH 570/789] Merge from 5.0 mysql-test/r/ndb_trigger.result: Re-generated sql/mysql_priv.h: Merge sql/sql_insert.cc: Merge sql/sql_load.cc: Merge sql/sql_update.cc: Merge --- mysql-test/r/ndb_trigger.result | 171 ++++++++++++++++++++++++++++++++ sql/mysql_priv.h | 3 +- sql/sql_insert.cc | 15 ++- sql/sql_load.cc | 2 +- sql/sql_update.cc | 21 ++-- 5 files changed, 188 insertions(+), 24 deletions(-) diff --git a/mysql-test/r/ndb_trigger.result b/mysql-test/r/ndb_trigger.result index 2aeca5db2d3..28f9f9bdc37 100644 --- a/mysql-test/r/ndb_trigger.result +++ b/mysql-test/r/ndb_trigger.result @@ -141,4 +141,175 @@ a b drop trigger t4_au; drop trigger t4_ad; drop table t1, t2, t3, t4, t5; +CREATE TABLE t1 ( +id INT NOT NULL PRIMARY KEY, +xy INT +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (1, 0); +CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id = NEW.id; END // +CREATE TABLE t2 ( +id INT NOT NULL PRIMARY KEY, +xy INT +) ENGINE=ndbcluster; +INSERT INTO t2 VALUES (2, 0); +CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY) ENGINE=ndbcluster; +INSERT INTO t3 VALUES (1); +CREATE TABLE t4 LIKE t1; +CREATE TRIGGER t4_update AFTER UPDATE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id = NEW.id; END // +CREATE TABLE t5 LIKE t2; +UPDATE t1 SET xy = 3 WHERE id = 1; +SELECT xy FROM t1 where id = 1; +xy +3 +SELECT xy FROM t2 where id = 1; +xy +3 +UPDATE t1 SET xy = 4 WHERE id IN (SELECT id FROM t3 WHERE id = 1); +SELECT xy FROM t1 where id = 1; +xy +4 +SELECT xy FROM t2 where id = 1; +xy +4 +INSERT INTO t4 SELECT * FROM t1; +INSERT INTO t5 SELECT * FROM t2; +UPDATE t1,t4 SET t1.xy = 3, t4.xy = 3 WHERE t1.id = 1 AND t4.id = 1; +SELECT xy FROM t1 where id = 1; +xy +3 +SELECT xy FROM t2 where id = 1; +xy +3 +SELECT xy FROM t4 where id = 1; +xy +3 +SELECT xy FROM t5 where id = 1; +xy +3 +UPDATE t1,t4 SET t1.xy = 4, t4.xy = 4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 1) AND t4.id IN (SELECT id FROM t3 WHERE id = 1); +SELECT xy FROM t1 where id = 1; +xy +4 +SELECT xy FROM t2 where id = 1; +xy +4 +SELECT xy FROM t4 where id = 1; +xy +4 +SELECT xy FROM t5 where id = 1; +xy +4 +INSERT INTO t1 VALUES (1,0) ON DUPLICATE KEY UPDATE xy = 5; +SELECT xy FROM t1 where id = 1; +xy +5 +SELECT xy FROM t2 where id = 1; +xy +5 +DROP TRIGGER t1_update; +DROP TRIGGER t4_update; +CREATE TRIGGER t1_delete AFTER DELETE ON t1 FOR EACH ROW BEGIN REPLACE INTO t2 SELECT * FROM t1 WHERE t1.id > 4; END // +CREATE TRIGGER t4_delete AFTER DELETE ON t4 FOR EACH ROW BEGIN REPLACE INTO t5 SELECT * FROM t4 WHERE t4.id > 4; END // +INSERT INTO t1 VALUES (5, 0),(6,0); +INSERT INTO t2 VALUES (5, 1),(6,1); +INSERT INTO t3 VALUES (5); +SELECT * FROM t1 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +DELETE FROM t1 WHERE id IN (SELECT id FROM t3 WHERE id = 5); +SELECT * FROM t1 order by id; +id xy +1 5 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +INSERT INTO t1 VALUES (5,0); +UPDATE t2 SET xy = 1 WHERE id = 6; +TRUNCATE t4; +INSERT INTO t4 SELECT * FROM t1; +TRUNCATE t5; +INSERT INTO t5 SELECT * FROM t2; +SELECT * FROM t1 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +SELECT * FROM t4 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t5 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +DELETE FROM t1,t4 USING t1,t3,t4 WHERE t1.id IN (SELECT id FROM t3 WHERE id = 5) AND t4.id IN (SELECT id FROM t3 WHERE id = 5); +SELECT * FROM t1 order by id; +id xy +1 5 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +SELECT * FROM t4 order by id; +id xy +1 5 +6 0 +SELECT * FROM t5 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +INSERT INTO t1 VALUES (5, 0); +REPLACE INTO t2 VALUES (6,1); +SELECT * FROM t1 order by id; +id xy +1 5 +5 0 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 1 +REPLACE INTO t1 VALUES (5, 1); +SELECT * FROM t1 order by id; +id xy +1 5 +5 1 +6 0 +SELECT * FROM t2 order by id; +id xy +1 5 +2 0 +5 1 +6 0 +DROP TRIGGER t1_delete; +DROP TRIGGER t4_delete; +DROP TABLE t1, t2, t3, t4, t5; End of 5.1 tests diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b3a7afd449a..9839ee4b6b7 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -974,8 +974,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table,List &fields, bool ignore); int check_that_all_fields_are_given_values(THD *thd, TABLE *entry, TABLE_LIST *table_list); -void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table, - enum_duplicates duplic); +void prepare_triggers_for_insert_stmt(TABLE *table); bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds); bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order, ha_rows rows, ulonglong options, diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index af239c1f62b..d7432318adc 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -340,14 +340,12 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list, return 0; } - +/* Prepare triggers for INSERT-like statement. SYNOPSIS prepare_triggers_for_insert_stmt() - thd The current thread table Table to which insert will happen - duplic Type of duplicate handling for insert which will happen NOTE Prepare triggers for INSERT-like statement by marking fields @@ -355,8 +353,7 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list, cannot be done if there are BEFORE UPDATE/DELETE triggers. */ -void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table, - enum_duplicates duplic) +void prepare_triggers_for_insert_stmt(TABLE *table) { if (table->triggers) { @@ -380,12 +377,11 @@ void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table, */ (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH); } - mark_fields_used_by_triggers_for_insert_stmt(thd, table, duplic); } + table->mark_columns_needed_for_insert(); } -/* bool mysql_insert(THD *thd,TABLE_LIST *table_list, List &fields, List &values_list, @@ -584,7 +580,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, error= 1; } - table->mark_columns_needed_for_insert(); + prepare_triggers_for_insert_stmt(table); + if (table_list->prepare_where(thd, 0, TRUE) || table_list->prepare_check_option(thd)) @@ -2602,7 +2599,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) table_list->prepare_check_option(thd)); if (!res) - table->mark_columns_needed_for_insert(); + prepare_triggers_for_insert_stmt(table); DBUG_RETURN(res); } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 364fda2c94b..01b64b29280 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -226,7 +226,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, DBUG_RETURN(TRUE); } - table->mark_columns_needed_for_insert(); + prepare_triggers_for_insert_stmt(table); uint tot_length=0; bool use_blobs= 0, use_vars= 0; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 7c25f21c14d..72883da4ba9 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1129,19 +1129,16 @@ int multi_update::prepare(List ¬_used_values, table->no_keyread=1; table->used_keys.clear_all(); table->pos_in_table_list= tl; - if (table->triggers) + if (table->triggers && + table->triggers->has_triggers(TRG_EVENT_UPDATE, + TRG_ACTION_AFTER)) { - table->triggers->mark_fields_used(thd, TRG_EVENT_UPDATE); - if (table->triggers->has_triggers(TRG_EVENT_UPDATE, - TRG_ACTION_AFTER)) - { - /* - The table has AFTER UPDATE triggers that might access to subject - table and therefore might need update to be done immediately. - So we turn-off the batching. - */ - (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH); - } + /* + The table has AFTER UPDATE triggers that might access to subject + table and therefore might need update to be done immediately. + So we turn-off the batching. + */ + (void) table->file->extra(HA_EXTRA_UPDATE_CANNOT_BATCH); } } } From 2490b18c766473acd45ee43b96eda7357efb2560 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 19:16:09 +0200 Subject: [PATCH 571/789] Bug#27344 Total failure to start the server - length($sockdir) >= 80 !! mysql-test/mysql-test-run.pl: Create a shorter sockdir path as soon as length of sockdir path is equal to 80 --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 6bd9122f07f..a40c2f157d5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1070,7 +1070,7 @@ sub command_line_setup () { # On some operating systems, there is a limit to the length of a # UNIX domain socket's path far below PATH_MAX, so try to avoid long # socket path names. - $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 ); + $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 80 ); $master->[0]= { From b5d13fcbbf6a6809101422d95a0b1ad7dcc70b2c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 19:19:26 +0200 Subject: [PATCH 572/789] Bug#27344 Total failure to start the server - length($sockdir) >= 80 !! mysql-test/mysql-test-run.pl: Change check to create a tmp file for socket if length($sockdir) >= 80 !! --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 21432687888..2fa9547535f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1050,7 +1050,7 @@ sub command_line_setup () { # On some operating systems, there is a limit to the length of a # UNIX domain socket's path far below PATH_MAX, so try to avoid long # socket path names. - $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 ); + $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 80 ); # Put this into a hash, will be a C struct From 0b4db8addd6aa9fbb87d2cc8eac8331e69d1b0f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 20:32:31 +0300 Subject: [PATCH 573/789] Fixed previous patch, wrong if() -test. --- sql/sql_parse.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 60cb4f09071..2445bccdc21 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3571,8 +3571,8 @@ end_with_restore_list: res= TRUE; // cannot happen else { - if ((thd->options & OPTION_KEEP_LOG) && - thd->no_trans_update.all && !thd->slave_thread) + if (((thd->options & OPTION_KEEP_LOG) || thd->no_trans_update.all) && + !thd->slave_thread) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARNING_NOT_COMPLETE_ROLLBACK, ER(ER_WARNING_NOT_COMPLETE_ROLLBACK)); From 821355da3cc8c883bd95e2f01e7011a4ad33a23c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 21:40:47 +0200 Subject: [PATCH 574/789] Bug #27638: slow logging to CSV table inserts bad query_time and lock_time values When MySQL logged slow query information to a CSV table, it stored the query_time and lock_time values with an incorrect formula. If the time was over 59 seconds, this caused incorrect statistics (either the slow query was not logged, or the time was far from correct). This change fixes the method used to store those TIME values in the slow_log table. mysql-test/r/log_tables-big.result: BitKeeper file /benchmarks/ext3/TOSAVE/tsmith/bk/maint/51/mysql-test/r/log_tables-big.result mysql-test/t/log_tables-big-master.opt: BitKeeper file /benchmarks/ext3/TOSAVE/tsmith/bk/maint/51/mysql-test/t/log_tables-big-master.opt mysql-test/t/log_tables-big.test: BitKeeper file /benchmarks/ext3/TOSAVE/tsmith/bk/maint/51/mysql-test/t/log_tables-big.test sql/time.cc: initialize all TIME fields (except neg, which may store a needed value) in calc_time_from_sec() sql/log.cc: Log_to_csv_event_handler::log_slow(): call store_time() instead of store() for query_time and lock_time include/my_time.h: Add TIME_MAX_VALUE_SECONDS definition --- include/my_time.h | 2 ++ mysql-test/r/log_tables-big.result | 29 +++++++++++++++++++++ mysql-test/t/log_tables-big-master.opt | 1 + mysql-test/t/log_tables-big.test | 35 ++++++++++++++++++++++++++ sql/log.cc | 14 +++++++++-- sql/time.cc | 5 ++++ 6 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/log_tables-big.result create mode 100644 mysql-test/t/log_tables-big-master.opt create mode 100644 mysql-test/t/log_tables-big.test diff --git a/include/my_time.h b/include/my_time.h index d96c5822069..6aa25487cf1 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -72,6 +72,8 @@ typedef long my_time_t; #define TIME_MAX_SECOND 59 #define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + \ TIME_MAX_SECOND) +#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \ + TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND) my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, ulong flags, int *was_cut); diff --git a/mysql-test/r/log_tables-big.result b/mysql-test/r/log_tables-big.result new file mode 100644 index 00000000000..9b81127c825 --- /dev/null +++ b/mysql-test/r/log_tables-big.result @@ -0,0 +1,29 @@ +set session long_query_time=10; +select get_lock('bug27638', 1); +get_lock('bug27638', 1) +1 +set session long_query_time=1; +truncate table mysql.slow_log; +select get_lock('bug27638', 2); +get_lock('bug27638', 2) +0 +select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +qt sql_text +OK select get_lock('bug27638', 2) +truncate table mysql.slow_log; +select get_lock('bug27638', 60); +get_lock('bug27638', 60) +0 +select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +qt sql_text +OK select get_lock('bug27638', 60) +truncate table mysql.slow_log; +select get_lock('bug27638', 101); +get_lock('bug27638', 101) +0 +select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +qt sql_text +OK select get_lock('bug27638', 101) +select release_lock('bug27638'); +release_lock('bug27638') +1 diff --git a/mysql-test/t/log_tables-big-master.opt b/mysql-test/t/log_tables-big-master.opt new file mode 100644 index 00000000000..35ff7911705 --- /dev/null +++ b/mysql-test/t/log_tables-big-master.opt @@ -0,0 +1 @@ +--log-slow-queries diff --git a/mysql-test/t/log_tables-big.test b/mysql-test/t/log_tables-big.test new file mode 100644 index 00000000000..8c956fa6f55 --- /dev/null +++ b/mysql-test/t/log_tables-big.test @@ -0,0 +1,35 @@ +# this test needs multithreaded mysqltest +-- source include/not_embedded.inc + +# Test sleeps for long times +--source include/big_test.inc + +# check that CSV engine was compiled in +--source include/have_csv.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +# +# Bug #27638: slow logging to CSV table inserts bad query_time and lock_time values +# +connection con1; +set session long_query_time=10; +select get_lock('bug27638', 1); +connection con2; +set session long_query_time=1; +truncate table mysql.slow_log; +select get_lock('bug27638', 2); +select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +truncate table mysql.slow_log; +select get_lock('bug27638', 60); +select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +truncate table mysql.slow_log; +select get_lock('bug27638', 101); +select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +connection con1; +select release_lock('bug27638'); +connection default; + +disconnect con1; +disconnect con2; diff --git a/sql/log.cc b/sql/log.cc index 57f16a1e11e..3cfcabd8363 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -569,11 +569,21 @@ bool Log_to_csv_event_handler:: if (query_start_arg) { + /* + A TIME field can not hold the full longlong range; query_time or + lock_time may be truncated without warning here, if greater than + 839 hours (~35 days) + */ + TIME t; + t.neg= 0; + /* fill in query_time field */ - if (table->field[2]->store(query_time, TRUE)) + calc_time_from_sec(&t, (long) min(query_time, (longlong) TIME_MAX_VALUE_SECONDS), 0); + if (table->field[2]->store_time(&t, MYSQL_TIMESTAMP_TIME)) goto err; /* lock_time */ - if (table->field[3]->store(lock_time, TRUE)) + calc_time_from_sec(&t, (long) min(lock_time, (longlong) TIME_MAX_VALUE_SECONDS), 0); + if (table->field[3]->store_time(&t, MYSQL_TIMESTAMP_TIME)) goto err; /* rows_sent */ if (table->field[4]->store((longlong) thd->sent_row_count, TRUE)) diff --git a/sql/time.cc b/sql/time.cc index 4854206b1c8..ef2c87673d5 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -313,6 +313,11 @@ void localtime_to_TIME(TIME *to, struct tm *from) void calc_time_from_sec(TIME *to, long seconds, long microseconds) { long t_seconds; + // to->neg is not cleared, it may already be set to a useful value + to->time_type= MYSQL_TIMESTAMP_TIME; + to->year= 0; + to->month= 0; + to->day= 0; to->hour= seconds/3600L; t_seconds= seconds%3600L; to->minute= t_seconds/60L; From a0c4e184f80de8db3b9d1340715502454ee09ef6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 00:04:44 +0400 Subject: [PATCH 575/789] Fix a failure of this test case on HP-UX. mysql-test/r/information_schema.result: Fix a race in the test case (second attempt). mysql-test/t/information_schema.test: Fix a race in the test case (second attempt). --- mysql-test/r/information_schema.result | 32 +++++++++++--------- mysql-test/t/information_schema.test | 42 +++++++++++++++----------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index ac280f301d8..3453a486da9 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1409,31 +1409,33 @@ user db user3148 test drop user user3148@localhost; DROP TABLE IF EXISTS thread_status; -CREATE TABLE thread_status (variable_name VARCHAR(64), -variable_value DECIMAL(22,7)); -CREATE TABLE server_status (variable_name VARCHAR(64), -variable_value DECIMAL(22,7)); -DROP EVENT IF EXISTS log_status; -CREATE EVENT log_status +DROP TABLE IF EXISTS server_status; +DROP EVENT IF EXISTS event_status; +SET GLOBAL event_scheduler=1; +CREATE EVENT event_status ON SCHEDULE AT NOW() -ON COMPLETION PRESERVE +ON COMPLETION NOT PRESERVE DO BEGIN -INSERT INTO thread_status SELECT variable_name, variable_value FROM -information_schema.session_status; -INSERT INTO server_status SELECT variable_name, variable_value FROM -information_schema.global_status; +CREATE TABLE thread_status +SELECT variable_name, variable_value +FROM information_schema.session_status +WHERE variable_name LIKE 'SSL_ACCEPTS' OR +variable_name LIKE 'SSL_CALLBACK_CACHE_HITS'; +CREATE TABLE server_status +SELECT variable_name +FROM information_schema.global_status +WHERE variable_name LIKE 'ABORTED_CONNECTS' OR +variable_name LIKE 'BINLOG_CACHE_DISK_USE'; END$$ -SET GLOBAL event_scheduler=1; -SELECT * FROM thread_status WHERE variable_name LIKE 'SSL%' LIMIT 1,2; +SELECT variable_name, variable_value FROM thread_status; variable_name variable_value SSL_ACCEPTS 0.0000000 SSL_CALLBACK_CACHE_HITS 0.0000000 -SELECT variable_name FROM server_status LIMIT 1,2; +SELECT variable_name FROM server_status; variable_name ABORTED_CONNECTS BINLOG_CACHE_DISK_USE -DROP EVENT log_status; DROP TABLE thread_status; DROP TABLE server_status; SET GLOBAL event_scheduler=0; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 96a11b3061e..ae330f47bc5 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1049,36 +1049,42 @@ drop user user3148@localhost; # --disable_warnings DROP TABLE IF EXISTS thread_status; -CREATE TABLE thread_status (variable_name VARCHAR(64), -variable_value DECIMAL(22,7)); -CREATE TABLE server_status (variable_name VARCHAR(64), -variable_value DECIMAL(22,7)); -DROP EVENT IF EXISTS log_status; +DROP TABLE IF EXISTS server_status; +DROP EVENT IF EXISTS event_status; + --enable_warnings +SET GLOBAL event_scheduler=1; + DELIMITER $$; -CREATE EVENT log_status +CREATE EVENT event_status ON SCHEDULE AT NOW() - ON COMPLETION PRESERVE + ON COMPLETION NOT PRESERVE DO - BEGIN - INSERT INTO thread_status SELECT variable_name, variable_value FROM -information_schema.session_status; - INSERT INTO server_status SELECT variable_name, variable_value FROM -information_schema.global_status; - END$$ +BEGIN + CREATE TABLE thread_status + SELECT variable_name, variable_value + FROM information_schema.session_status + WHERE variable_name LIKE 'SSL_ACCEPTS' OR + variable_name LIKE 'SSL_CALLBACK_CACHE_HITS'; + + CREATE TABLE server_status + SELECT variable_name + FROM information_schema.global_status + WHERE variable_name LIKE 'ABORTED_CONNECTS' OR + variable_name LIKE 'BINLOG_CACHE_DISK_USE'; +END$$ DELIMITER ;$$ -SET GLOBAL event_scheduler=1; -let $wait_condition=select count(variable_name) != 0 from server_status; +let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_status'; let $wait_timeout=30; --source include/wait_condition.inc -SELECT * FROM thread_status WHERE variable_name LIKE 'SSL%' LIMIT 1,2; -SELECT variable_name FROM server_status LIMIT 1,2; -DROP EVENT log_status; +SELECT variable_name, variable_value FROM thread_status; +SELECT variable_name FROM server_status; + DROP TABLE thread_status; DROP TABLE server_status; SET GLOBAL event_scheduler=0; From 6575e2d296120973db8c8132a7396d054eec24d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 21:35:58 +0000 Subject: [PATCH 576/789] fix test for bug#25721 did not run properly on a fast Windows machine --- mysql-test/r/federated_server.result | 4 +++- mysql-test/t/federated_server.test | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/federated_server.result b/mysql-test/r/federated_server.result index a3e7cd793a6..0905aabb075 100644 --- a/mysql-test/r/federated_server.result +++ b/mysql-test/r/federated_server.result @@ -259,8 +259,10 @@ create procedure p1 () begin DECLARE v INT DEFAULT 0; DECLARE e INT DEFAULT 0; +DECLARE i INT; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; -WHILE v < 10000 do +SET i = sleep(5); +WHILE v < 20000 do CREATE SERVER s FOREIGN DATA WRAPPER mysql OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); diff --git a/mysql-test/t/federated_server.test b/mysql-test/t/federated_server.test index b2075b8e262..20332f65bff 100644 --- a/mysql-test/t/federated_server.test +++ b/mysql-test/t/federated_server.test @@ -296,8 +296,10 @@ create procedure p1 () begin DECLARE v INT DEFAULT 0; DECLARE e INT DEFAULT 0; + DECLARE i INT; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; - WHILE v < 10000 do + SET i = sleep(5); + WHILE v < 20000 do CREATE SERVER s FOREIGN DATA WRAPPER mysql OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); From 4c0f3c50f80d325563380f83a6a6e620d71a359b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 06:49:43 +0200 Subject: [PATCH 577/789] Fixed compilation error on Windows --- sql/sql_trigger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index d2e3c52eef4..5f22a7c9757 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -113,7 +113,7 @@ public: bool has_triggers(trg_event_type event_type, trg_action_time_type action_time) { - return (bodies[event_type][action_time]); + return (bodies[event_type][action_time] != NULL); } bool has_delete_triggers() { From cfe2d1da886ea48c445076a3509b76ea1242e54d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 07:28:09 +0200 Subject: [PATCH 578/789] Removed compiler warnings --- sql/ha_ndbcluster.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 9c5c10aa3dd..2fb245d6d96 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3408,6 +3408,8 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) DBUG_PRINT("info", ("HA_EXTRA_UPDATE_CANNOT_BATCH")); m_update_cannot_batch= TRUE; break; + default: + break; } DBUG_RETURN(0); From f76ab0c46937a0d53ee0907c2a17daca6106c52a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 08:30:16 +0200 Subject: [PATCH 579/789] Deleted reject files accidently checked in configure.in.rej include/my_global.h.rej BUILD/SETUP.sh.rej mysys/thr_alarm.c.rej include/my_pthread.h.rej BitKeeper/deleted/.del-SETUP.sh.rej: Delete: BUILD/SETUP.sh.rej BitKeeper/deleted/.del-configure.in.rej: Delete: configure.in.rej BitKeeper/deleted/.del-my_global.h.rej: Delete: include/my_global.h.rej BitKeeper/deleted/.del-my_pthread.h.rej: Delete: include/my_pthread.h.rej BitKeeper/deleted/.del-thr_alarm.c.rej: Delete: mysys/thr_alarm.c.rej --- BUILD/SETUP.sh.rej | 19 --- configure.in.rej | 299 --------------------------------------- include/my_global.h.rej | 17 --- include/my_pthread.h.rej | 80 ----------- mysys/thr_alarm.c.rej | 220 ---------------------------- 5 files changed, 635 deletions(-) delete mode 100644 BUILD/SETUP.sh.rej delete mode 100644 configure.in.rej delete mode 100644 include/my_global.h.rej delete mode 100644 include/my_pthread.h.rej delete mode 100644 mysys/thr_alarm.c.rej diff --git a/BUILD/SETUP.sh.rej b/BUILD/SETUP.sh.rej deleted file mode 100644 index ccbcaa4404f..00000000000 --- a/BUILD/SETUP.sh.rej +++ /dev/null @@ -1,19 +0,0 @@ -*************** -*** 39,46 **** - c_warnings="$global_warnings -Wunused" - cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" - -! alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet -! pentium_cflags="-mcpu=pentiumpro" - sparc_cflags="" - - # be as fast as we can be without losing our ability to backtrace ---- 39,46 ---- - c_warnings="$global_warnings -Wunused" - cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" - -! #alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet -! #pentium_cflags="-mcpu=pentiumpro" - sparc_cflags="" - - # be as fast as we can be without losing our ability to backtrace diff --git a/configure.in.rej b/configure.in.rej deleted file mode 100644 index 46fbf83b198..00000000000 --- a/configure.in.rej +++ /dev/null @@ -1,299 +0,0 @@ -*************** -*** 388,402 **** - if expr "$target_os" : "[[Ll]]inux.*" > /dev/null - then - MYSQLD_DEFAULT_SWITCHES="--skip-locking" -! IS_LINUX="true" - AC_MSG_RESULT("yes"); - else - MYSQLD_DEFAULT_SWITCHES="" -! IS_LINUX="false" - AC_MSG_RESULT("no"); - fi - AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -! AC_SUBST(IS_LINUX) - - dnl Find paths to some shell programs - AC_PATH_PROG(LN, ln, ln) ---- 388,403 ---- - if expr "$target_os" : "[[Ll]]inux.*" > /dev/null - then - MYSQLD_DEFAULT_SWITCHES="--skip-locking" -! TARGET_LINUX="true" - AC_MSG_RESULT("yes"); -+ AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux]) - else - MYSQLD_DEFAULT_SWITCHES="" -! TARGET_LINUX="false" - AC_MSG_RESULT("no"); - fi - AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -! AC_SUBST(TARGET_LINUX) - - dnl Find paths to some shell programs - AC_PATH_PROG(LN, ln, ln) -*************** -*** 576,582 **** - # (this is true on the MySQL build machines to avoid NSS problems) - # - -! if test "$IS_LINUX" = "true" -a "$static_nss" = "" - then - tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` - if test -n "$tmp" ---- 577,583 ---- - # (this is true on the MySQL build machines to avoid NSS problems) - # - -! if test "$TARGET_LINUX" = "true" -a "$static_nss" = "" - then - tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` - if test -n "$tmp" -*************** -*** 827,833 **** - ]) - AC_SUBST(WRAPLIBS) - -! if test "$IS_LINUX" = "true"; then - AC_MSG_CHECKING([for atomic operations]) - - AC_LANG_SAVE ---- 828,834 ---- - ]) - AC_SUBST(WRAPLIBS) - -! if test "$TARGET_LINUX" = "true"; then - AC_MSG_CHECKING([for atomic operations]) - - AC_LANG_SAVE -*************** -*** 870,876 **** - [ USE_PSTACK=no ]) - pstack_libs= - pstack_dirs= -! if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" - then - have_libiberty= have_libbfd= - my_save_LIBS="$LIBS" ---- 871,877 ---- - [ USE_PSTACK=no ]) - pstack_libs= - pstack_dirs= -! if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" - then - have_libiberty= have_libbfd= - my_save_LIBS="$LIBS" -*************** -*** 1239,1301 **** - # Hack for DEC-UNIX (OSF1) - if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - then -! # Look for LinuxThreads. -! AC_MSG_CHECKING("LinuxThreads") -! grepres=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep LINUXTHREADS | wc -l || echo 0` -! if test "$grepres" -gt 0 -o "$getconfres" -gt 0 - then -! AC_MSG_RESULT("Found") -! AC_DEFINE(HAVE_LINUXTHREADS) -! # Linux 2.0 sanity check -! AC_TRY_COMPILE([#include ], [int a = sched_get_priority_min(1);], , -! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) -! # RedHat 5.0 does not work with dynamic linking of this. -static also -! # gives a speed increase in linux so it does not hurt on other systems. -! with_named_thread="-lpthread" -! else -! AC_MSG_RESULT("Not found") -! # If this is a linux machine we should barf -! AC_MSG_CHECKING("NPTL") -! if test "$IS_LINUX" = "true" -! then -! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep NPTL | wc -l || echo 0` -! if test "$getconfres" -gt 0 - then -! AC_DEFINE(HAVE_LINUXTHREADS) dnl All this code predates NPTL, so "have linuxthreads" is a poor name. -! with_named_thread="-lpthread" - else -! AC_MSG_ERROR([This is a Linux system and neither Linuxthreads nor NPTL were -! found. Please install Linuxthreads or a new glibc and try -! again. See the Installation chapter in the Reference Manual for -! more information.]) - fi -! else -! AC_MSG_CHECKING("DEC threads") -! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthread -lmach -lexc" -! CFLAGS="$CFLAGS -D_REENTRANT" -! CXXFLAGS="$CXXFLAGS -D_REENTRANT" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! AC_MSG_CHECKING("DEC 3.2 threads") -! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthreads -lmach -lc_r" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_DEFINE(HAVE_DEC_3_2_THREADS) -! with_osf32_threads="yes" -! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority" -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! fi -! fi -! fi -! fi - fi - - ---- 1240,1337 ---- - # Hack for DEC-UNIX (OSF1) - if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - then -! AC_MSG_CHECKING("Linux threads") -! if test "$TARGET_LINUX" = "true" - then -! AC_MSG_RESULT("starting") -! # use getconf to check glibc contents -! AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION") -! case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in -! NPTL* ) -! AC_MSG_RESULT("NPTL") -! AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation]) -! with_named_thread="-lpthread" -! ;; -! LINUXTHREADS* ) -! AC_MSG_RESULT("Linuxthreads") -! AC_DEFINE([HAVE_LINUXTHREADS], [1], -! [Whether we are using Xavier Leroy's LinuxThreads]) -! with_named_thread="-lpthread" -! ;; -! * ) -! AC_MSG_RESULT("unknown") -! ;; -! esac -! if test "$with_named_thread" = "no" - then -! # old method, check headers -! # Look for LinuxThreads. -! AC_MSG_CHECKING("LinuxThreads in header file comment") -! res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -! if test "$res" -gt 0 -! then -! AC_MSG_RESULT("Found") -! AC_DEFINE([HAVE_LINUXTHREADS], [1], -! [Whether we are using Xavier Leroy's LinuxThreads]) -! # Linux 2.0 sanity check -! AC_TRY_COMPILE([#include ], [int a = sched_get_priority_min(1);], , -! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) -! # RedHat 5.0 does not work with dynamic linking of this. -static also -! # gives a speed increase in linux so it does not hurt on other systems. -! with_named_thread="-lpthread" -! else -! AC_MSG_RESULT("Not found") -! # If this is a linux machine we should barf -! AC_MSG_ERROR([This is a Linux system without a working getconf, -! and Linuxthreads was not found. Please install it (or a new glibc) and try again. -! See the Installation chapter in the Reference Manual for more information.]) -! fi - else -! AC_MSG_RESULT("no need to check headers") - fi -! AC_MSG_CHECKING("for pthread_create in -lpthread"); -! ac_save_LIBS="$LIBS" -! LIBS="$LIBS -lpthread" -! AC_TRY_LINK( [#include ], -! [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], -! AC_MSG_RESULT("yes"), -! [ AC_MSG_RESULT("no") -! AC_MSG_ERROR([ -! This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed. -! Please install one of these (or a new glibc) and try again. -! See the Installation chapter in the Reference Manual for more information.]) ] -! ) -! LIBS="$ac_save_LIBS" -! else -! AC_MSG_RESULT("no") -! fi # "$TARGET_LINUX" -! fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -! -! if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -! then -! AC_MSG_CHECKING("DEC threads") -! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthread -lmach -lexc" -! CFLAGS="$CFLAGS -D_REENTRANT" -! CXXFLAGS="$CXXFLAGS -D_REENTRANT" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! AC_MSG_CHECKING("DEC 3.2 threads") -! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthreads -lmach -lc_r" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_DEFINE(HAVE_DEC_3_2_THREADS) -! with_osf32_threads="yes" -! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority" -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! fi -! fi - fi - - -*************** -*** 1720,1726 **** - AC_SUBST(COMPILATION_COMMENT) - - AC_MSG_CHECKING("need of special linking flags") -! if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" - then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") ---- 1756,1762 ---- - AC_SUBST(COMPILATION_COMMENT) - - AC_MSG_CHECKING("need of special linking flags") -! if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" - then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") -*************** -*** 1873,1878 **** - tell atod memcpy memmove \ - setupterm strcasecmp sighold vidattr lrand48 localtime_r \ - sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ - pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ - pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ - pthread_attr_getstacksize pthread_key_delete \ ---- 1909,1915 ---- - tell atod memcpy memmove \ - setupterm strcasecmp sighold vidattr lrand48 localtime_r \ - sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ -+ sigaction sigemptyset sigaddset \ - pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ - pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ - pthread_attr_getstacksize pthread_key_delete \ -*************** -*** 1884,1890 **** - # Sanity check: We chould not have any fseeko symbol unless - # large_file_support=yes - AC_CHECK_FUNCS(fseeko, -! [if test "$large_file_support" = no -a "$IS_LINUX" = "true"; - then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); - fi] ---- 1921,1927 ---- - # Sanity check: We chould not have any fseeko symbol unless - # large_file_support=yes - AC_CHECK_FUNCS(fseeko, -! [if test "$large_file_support" = no -a "$TARGET_LINUX" = "true"; - then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); - fi] diff --git a/include/my_global.h.rej b/include/my_global.h.rej deleted file mode 100644 index f2953d169e7..00000000000 --- a/include/my_global.h.rej +++ /dev/null @@ -1,17 +0,0 @@ -*************** -*** 97,103 **** - - - /* Fix problem with S_ISLNK() on Linux */ -! #if defined(HAVE_LINUXTHREADS) - #undef _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif ---- 97,103 ---- - - - /* Fix problem with S_ISLNK() on Linux */ -! #if defined(TARGET_OS_LINUX) || defined(__GLIBC__) - #undef _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif diff --git a/include/my_pthread.h.rej b/include/my_pthread.h.rej deleted file mode 100644 index 1f73655b0bd..00000000000 --- a/include/my_pthread.h.rej +++ /dev/null @@ -1,80 +0,0 @@ -*************** -*** 286,293 **** - #undef HAVE_PTHREAD_RWLOCK_RDLOCK - #undef HAVE_SNPRINTF - -! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) -! #define signal(A,B) pthread_signal((A),(void (*)(int)) (B)) - #define my_pthread_attr_setprio(A,B) - #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ - ---- 294,301 ---- - #undef HAVE_PTHREAD_RWLOCK_RDLOCK - #undef HAVE_SNPRINTF - -! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) -! #define my_signal(A,B) pthread_signal((A),(void (*)(int)) (B)) - #define my_pthread_attr_setprio(A,B) - #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ - -*************** -*** 324,337 **** - #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) - int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ - #endif -! #if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset) -! #define sigset(A,B) do { struct sigaction s; sigset_t set; \ -! sigemptyset(&set); \ -! s.sa_handler = (B); \ -! s.sa_mask = set; \ -! s.sa_flags = 0; \ -! sigaction((A), &s, (struct sigaction *) NULL); \ - } while (0) - #endif - - #ifndef my_pthread_setprio ---- 332,358 ---- - #if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) - int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ - #endif -! -! /* -! We define my_sigset() and use that instead of the system sigset() so that -! we can favor an implementation based on sigaction(). On some systems, such -! as Mac OS X, sigset() results in flags such as SA_RESTART being set, and -! we want to make sure that no such flags are set. -! */ -! #if defined(HAVE_SIGACTION) && !defined(my_sigset) -! #define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ -! DBUG_ASSERT((A) != 0); \ -! sigemptyset(&set); \ -! s.sa_handler = (B); \ -! s.sa_mask = set; \ -! s.sa_flags = 0; \ -! rc= sigaction((A), &s, (struct sigaction *) NULL); \ -! DBUG_ASSERT(rc == 0); \ - } while (0) -+ #elif defined(HAVE_SIGSET) && !defined(my_sigset) -+ #define my_sigset(A,B) sigset((A),(B)) -+ #elif !defined(my_sigset) -+ #define my_sigset(A,B) signal((A),(B)) - #endif - - #ifndef my_pthread_setprio -*************** -*** 416,422 **** - #undef pthread_detach_this_thread - #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } - #undef sigset -! #define sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) - #endif - - #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) ---- 437,443 ---- - #undef pthread_detach_this_thread - #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } - #undef sigset -! #define my_sigset(A,B) pthread_signal((A),(void (*)(int)) (B)) - #endif - - #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) diff --git a/mysys/thr_alarm.c.rej b/mysys/thr_alarm.c.rej deleted file mode 100644 index c991121052e..00000000000 --- a/mysys/thr_alarm.c.rej +++ /dev/null @@ -1,220 +0,0 @@ -*************** -*** 76,96 **** - alarm_aborted=0; - init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0, - compare_ulong,NullS); -! sigfillset(&full_signal_set); /* Neaded to block signals */ - pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_alarm,NULL); -! #if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) -! #if defined(HAVE_mit_thread) -! sigset(THR_CLIENT_ALARM,thread_alarm); /* int. thread system calls */ -! #else - { -! struct sigaction sact; -! sact.sa_flags = 0; -! sact.sa_handler = thread_alarm; -! sigaction(THR_CLIENT_ALARM, &sact, (struct sigaction*) 0); - } -- #endif -- #endif - sigemptyset(&s); - sigaddset(&s, THR_SERVER_ALARM); - alarm_thread=pthread_self(); ---- 74,89 ---- - alarm_aborted=0; - init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0, - compare_ulong,NullS); -! sigfillset(&full_signal_set); /* Needed to block signals */ - pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_alarm,NULL); -! #ifndef USE_ALARM_THREAD -! if (thd_lib_detected != THD_LIB_LT) -! #endif - { -! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1, -! thread_alarm); - } - sigemptyset(&s); - sigaddset(&s, THR_SERVER_ALARM); - alarm_thread=pthread_self(); -*************** -*** 108,120 **** - } - #elif defined(USE_ONE_SIGNAL_HAND) - pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ -! #if THR_SERVER_ALARM == THR_CLIENT_ALARM -! sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */ -! pthread_sigmask(SIG_UNBLOCK, &s, NULL); -! #endif - #else - pthread_sigmask(SIG_UNBLOCK, &s, NULL); -- sigset(THR_SERVER_ALARM,process_alarm); - #endif - DBUG_VOID_RETURN; - } ---- 101,115 ---- - } - #elif defined(USE_ONE_SIGNAL_HAND) - pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ -! if (thd_lib_detected == THD_LIB_LT) -! { -! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1, -! process_alarm); /* Linuxthreads */ -! pthread_sigmask(SIG_UNBLOCK, &s, NULL); -! } - #else -+ my_sigset(THR_SERVER_ALARM, process_alarm); - pthread_sigmask(SIG_UNBLOCK, &s, NULL); - #endif - DBUG_VOID_RETURN; - } -*************** -*** 240,246 **** - if (alarm_data->malloced) - my_free((gptr) alarm_data,MYF(0)); - found++; -! #ifndef DBUG_OFF - break; - #endif - } ---- 235,241 ---- - if (alarm_data->malloced) - my_free((gptr) alarm_data,MYF(0)); - found++; -! #ifdef DBUG_OFF - break; - #endif - } -*************** -*** 249,258 **** - if (!found) - { - if (*alarmed) -! fprintf(stderr,"Warning: Didn't find alarm %lx in queue of %d alarms\n", -! (long) *alarmed, alarm_queue.elements); -! DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n", -! (long) *alarmed)); - } - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); ---- 244,254 ---- - if (!found) - { - if (*alarmed) -! fprintf(stderr, -! "Warning: Didn't find alarm 0x%lx in queue of %d alarms\n", -! (long) *alarmed, alarm_queue.elements); -! DBUG_PRINT("warning",("Didn't find alarm 0x%lx in queue\n", -! (long) *alarmed)); - } - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); -*************** -*** 274,291 **** - This must be first as we can't call DBUG inside an alarm for a normal thread - */ - -! #if THR_SERVER_ALARM == THR_CLIENT_ALARM -! if (!pthread_equal(pthread_self(),alarm_thread)) - { - #if defined(MAIN) && !defined(__bsdi__) -! printf("thread_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */ - #endif - return; - } -- #endif - - /* - We have to do do the handling of the alarm in a sub function, ---- 270,287 ---- - This must be first as we can't call DBUG inside an alarm for a normal thread - */ - -! if (thd_lib_detected == THD_LIB_LT && -! !pthread_equal(pthread_self(),alarm_thread)) - { - #if defined(MAIN) && !defined(__bsdi__) -! printf("thread_alarm in process_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! my_sigset(thd_lib_detected == THD_LIB_LT ? SIGALRM : SIGUSR1, -! process_alarm); /* int. thread system calls */ - #endif - return; - } - - /* - We have to do do the handling of the alarm in a sub function, -*************** -*** 301,307 **** - process_alarm_part2(sig); - #ifndef USE_ALARM_THREAD - #if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND) -! sigset(THR_SERVER_ALARM,process_alarm); - #endif - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); ---- 297,303 ---- - process_alarm_part2(sig); - #ifndef USE_ALARM_THREAD - #if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND) -! my_sigset(THR_SERVER_ALARM, process_alarm); - #endif - pthread_mutex_unlock(&LOCK_alarm); - pthread_sigmask(SIG_SETMASK,&old_mask,NULL); -*************** -*** 504,520 **** - ARGSUSED - */ - -- #if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD) - static sig_handler thread_alarm(int sig) - { - #ifdef MAIN - printf("thread_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! sigset(sig,thread_alarm); /* int. thread system calls */ - #endif - } -- #endif - - - #ifdef HAVE_TIMESPEC_TS_SEC ---- 499,513 ---- - ARGSUSED - */ - - static sig_handler thread_alarm(int sig) - { - #ifdef MAIN - printf("thread_alarm\n"); fflush(stdout); - #endif - #ifdef DONT_REMEMBER_SIGNAL -! my_sigset(sig, thread_alarm); /* int. thread system calls */ - #endif - } - - - #ifdef HAVE_TIMESPEC_TS_SEC -*************** -*** 915,921 **** - printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name()); - fflush(stdout); - #ifdef DONT_REMEMBER_SIGNAL -! sigset(sig,print_signal_warning); /* int. thread system calls */ - #endif - #ifndef OS2 - if (sig == SIGALRM) ---- 908,914 ---- - printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name()); - fflush(stdout); - #ifdef DONT_REMEMBER_SIGNAL -! my_sigset(sig, print_signal_warning); /* int. thread system calls */ - #endif - #ifndef OS2 - if (sig == SIGALRM) From 60289fba0ba697e2bbab6136e7840216bea0633d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 08:36:56 +0200 Subject: [PATCH 580/789] zlib.m4: Only require the more recent zlibCompileFlags() when building the server, client zlib don't need it. Makefile.am: Always build the bundled zlib static only configure.in: Look for dlopen() even if --with-mysqld-ldflags constains "-static", as this is not the same as the flag to "ld", it just informs "libtool" to link static with libraries created part of the build, even if there exists shared versions. make_binary_distribution.sh: Real "mysqlmanager" executable might be in ".libs" configure.in: Look for dlopen() even if --with-mysqld-ldflags constains "-static", as this is not the same as the flag to "ld", it just informs "libtool" to link static with libraries created part of the build, even if there exists shared versions. config/ac-macros/zlib.m4: Only require the more recent zlibCompileFlags() when building the server, client zlib don't need it. scripts/make_binary_distribution.sh: Real "mysqlmanager" executable might be in ".libs" zlib/Makefile.am: Always build the bundled zlib static only --- config/ac-macros/zlib.m4 | 13 +++++++++++-- configure.in | 4 ++-- scripts/make_binary_distribution.sh | 8 +++++++- zlib/Makefile.am | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4 index a01d13937ff..74de715e424 100644 --- a/config/ac-macros/zlib.m4 +++ b/config/ac-macros/zlib.m4 @@ -10,16 +10,25 @@ AC_SUBST([zlib_dir]) mysql_cv_compress="yes" ]) -dnl Auxiliary macro to check for zlib at given path +dnl Auxiliary macro to check for zlib at given path. +dnl We are strict with the server, as "archive" engine +dnl needs zlibCompileFlags(), but for client only we +dnl are less strict, and take the zlib we find. AC_DEFUN([MYSQL_CHECK_ZLIB_DIR], [ save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" CPPFLAGS="$ZLIB_INCLUDES $CPPFLAGS" LIBS="$LIBS $ZLIB_LIBS" +if test X"$with_server" = Xno +then + zlibsym=zlibVersion +else + zlibsym=zlibCompileFlags +fi AC_CACHE_VAL([mysql_cv_compress], [AC_TRY_LINK([#include ], - [return zlibCompileFlags();], + [return $zlibsym();], [mysql_cv_compress="yes" AC_MSG_RESULT([ok])], [mysql_cv_compress="no"]) diff --git a/configure.in b/configure.in index 9b0505a594f..bcf561c02ef 100644 --- a/configure.in +++ b/configure.in @@ -1601,9 +1601,9 @@ fi # dlopen, dlerror case "$with_mysqld_ldflags " in - *"-static "*) + *"-all-static "*) # No need to check for dlopen when mysqld is linked with - # -all-static or -static as it won't be able to load any functions. + # -all-static as it won't be able to load any functions. # NOTE! It would be better if it was possible to test if dlopen # can be used, but a good way to test it couldn't be found diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 7d7918975f2..e8bf39bd016 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -115,7 +115,12 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -# Copy files if they exists, warn for those that don't +# Copy files if they exists, warn for those that don't. +# Note that when listing files to copy, we might list the file name +# twice, once in the directory location where it is build, and a +# second time in the ".libs" location. In the case the firs one +# is a wrapper script, the second one will overwrite it with the +# binary file. copyfileto() { destdir=$1 @@ -165,6 +170,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then # For all other platforms: else BIN_FILES="$BIN_FILES \ + server-tools/instance-manager/.libs/mysqlmanager \ client/mysqltestmanagerc \ client/mysqltestmanager-pwgen tools/mysqltestmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ diff --git a/zlib/Makefile.am b/zlib/Makefile.am index c40c922851e..f5741a782fb 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -21,7 +21,8 @@ LIBS= $(NON_THREADED_LIBS) pkglib_LTLIBRARIES=libz.la -libz_la_LDFLAGS= -version-info 3:3:2 +# We are never interested in a shared version +libz_la_LDFLAGS= -static noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ inftrees.h trees.h zconf.h zlib.h zutil.h From c66a15285f0d8dabc555fc9fd7bac1022a583d91 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 09:10:22 +0200 Subject: [PATCH 581/789] Add extra INSERT to make usre sync_slave_with_master has job to do mysql-test/r/rpl_ssl.result: Add an extra INSERT to make sure that the "sync_slave_with_master" has someghing to do and thus have to wait for the slave IO thread to start. mysql-test/t/rpl_ssl.test: Add an extra INSERT to make sure that the "sync_slave_with_master" has someghing to do and thus have to wait for the slave IO thread to start. --- mysql-test/r/rpl_ssl.result | 1 + mysql-test/t/rpl_ssl.test | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result index 50e2db35165..908f0020188 100644 --- a/mysql-test/r/rpl_ssl.result +++ b/mysql-test/r/rpl_ssl.result @@ -58,6 +58,7 @@ STOP SLAVE; select * from t1; t 1 +insert into t1 values (NULL); show slave status; Slave_IO_State # Master_Host 127.0.0.1 diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test index 5b5f12c91df..dd03d5533b0 100644 --- a/mysql-test/t/rpl_ssl.test +++ b/mysql-test/t/rpl_ssl.test @@ -54,6 +54,9 @@ while ($i) start slave; enable_query_log; connection master; +# INSERT one more record to make sure +# the sync has something to do +insert into t1 values (NULL); sync_slave_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # From e8a0ac29a766a848ffa39e6bf1500200241785a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 09:12:30 +0200 Subject: [PATCH 582/789] Bug#27644 ndb: connecting api node/mysqld may "steal" node_id from running mysqld - test case workaround to avoid random failures --- mysql-test/t/ndb_autodiscover3.test | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/t/ndb_autodiscover3.test b/mysql-test/t/ndb_autodiscover3.test index 73b4bf8b94f..259da6e3501 100644 --- a/mysql-test/t/ndb_autodiscover3.test +++ b/mysql-test/t/ndb_autodiscover3.test @@ -1,5 +1,6 @@ -- source include/have_ndb.inc -- source include/have_multi_ndb.inc +-- source include/ndb_default_cluster.inc -- source include/not_embedded.inc @@ -7,6 +8,11 @@ drop table if exists t1, t2; --enable_warnings +# Workaround for Bug#27644 +# ndb: connecting api node/mysqld may "steal" node_id from running mysqld +# - let ndb_waiter use a fixed node id so "steal" cannot happen +--let connect_str = "nodeid=6;$NDB_CONNECTSTRING" + # # Transaction ongoing while cluster is restarted # @@ -17,7 +23,7 @@ begin; insert into t1 values (1); --exec $NDB_MGM --no-defaults -e "all restart" >> $NDB_TOOLS_OUTPUT ---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT --error 1297 insert into t1 values (2); @@ -35,7 +41,7 @@ insert into t2 values (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10, select * from t2 order by a limit 3; --exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT ---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT --connection server2 create table t2 (a int key) engine=ndbcluster; @@ -49,7 +55,7 @@ select * from t2 order by a limit 3; select * from t2 order by a limit 3; --exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT ---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT --connection server1 show tables; From a3d8d943b96f53e10682094a7ccb90392bd5e8b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 09:16:16 +0200 Subject: [PATCH 583/789] set name for ndb tools --- ndb/tools/delete_all.cpp | 1 + ndb/tools/desc.cpp | 1 + ndb/tools/drop_index.cpp | 1 + ndb/tools/drop_tab.cpp | 1 + ndb/tools/listTables.cpp | 1 + ndb/tools/select_all.cpp | 1 + ndb/tools/select_count.cpp | 1 + 7 files changed, 7 insertions(+) diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index ae380560e35..9b6a8cf94c6 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -67,6 +67,7 @@ int main(int argc, char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_delete_all"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index c2f3ea8b615..83258515796 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -69,6 +69,7 @@ int main(int argc, char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_desc"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 23ebfff6cf4..256c40e1924 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -61,6 +61,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_drop_index"); if(con.connect(12, 5, 1) != 0) { return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index d965be29f31..a7accb904a4 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -61,6 +61,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_drop_table"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index db88f9bc25c..009789824e8 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -219,6 +219,7 @@ int main(int argc, char** argv){ _tabname = argv[0]; ndb_cluster_connection = new Ndb_cluster_connection(opt_connect_str); + ndb_cluster_connection->set_name("ndb_show_tables"); if (ndb_cluster_connection->connect(12,5,1)) fatal("Unable to connect to management server."); if (ndb_cluster_connection->wait_until_ready(30,0) < 0) diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 69bd5b0f917..27d96a9c6ed 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -108,6 +108,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_select_all"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index 8933d803f53..552d156b665 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -83,6 +83,7 @@ int main(int argc, char** argv){ } Ndb_cluster_connection con(opt_connect_str); + con.set_name("ndb_select_count"); if(con.connect(12, 5, 1) != 0) { ndbout << "Unable to connect to management server." << endl; From 046b4bb53c0e62485d2d604f31d33f38a0ee5b46 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 10:00:04 +0200 Subject: [PATCH 584/789] remove manual pages that don't exist from rpm spec file support-files/mysql.spec.sh: remove vanished manual pages --- support-files/mysql.spec.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 0671bd8a58c..99fcfdc9b39 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -556,7 +556,6 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1 %doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1* @@ -577,7 +576,6 @@ fi %attr(755, root, root) %{_bindir}/myisamlog %attr(755, root, root) %{_bindir}/myisampack %attr(755, root, root) %{_bindir}/mysql_convert_table_format -%attr(755, root, root) %{_bindir}/mysql_create_system_tables %attr(755, root, root) %{_bindir}/mysql_fix_extensions %attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables %attr(755, root, root) %{_bindir}/mysql_install_db @@ -739,6 +737,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Apr 05 2007 Daniel Fischer + +- Remove several man pages that vanished after last release. + * Fri Mar 02 2007 Joerg Bruehe - Add several man pages for NDB which are now created. From a127d582591c0a8e238e9c6f3fd813c48cc11477 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 13:25:39 +0500 Subject: [PATCH 585/789] aftermerging fix sql/partition_info.cc: here we have to check for zero return from file->get_default_no_partitions --- sql/partition_info.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 6444d54ea5d..3e0257f5b1d 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -187,8 +187,14 @@ bool partition_info::set_up_default_partitions(handler *file, my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), error_string); goto end; } - if (no_parts == 0) - no_parts= file->get_default_no_partitions(info); + + if ((no_parts == 0) && + ((no_parts= file->get_default_no_partitions(info)) == 0)) + { + my_error(ER_PARTITION_NOT_DEFINED_ERROR, MYF(0), "partitions"); + goto end; + } + if (unlikely(no_parts > MAX_PARTITIONS)) { my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0)); From 483ce953948f92f1a62af719bbb2f23655648288 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 12:01:01 +0200 Subject: [PATCH 586/789] ndb: change attribute id for ANY_VALUE as id was already reserved for upcoming read pached patch --- storage/ndb/include/kernel/AttributeHeader.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/ndb/include/kernel/AttributeHeader.hpp b/storage/ndb/include/kernel/AttributeHeader.hpp index 2d013b31156..8ee1e33d851 100644 --- a/storage/ndb/include/kernel/AttributeHeader.hpp +++ b/storage/ndb/include/kernel/AttributeHeader.hpp @@ -45,7 +45,8 @@ public: STATIC_CONST( ROWID = 0xFFF6 ); STATIC_CONST( ROW_GCI = 0xFFF5 ); STATIC_CONST( FRAGMENT_VARSIZED_MEMORY = 0xFFF4 ); - STATIC_CONST( ANY_VALUE = 0xFFF3 ); + // 0xFFF3 to be used for read packed when merged + STATIC_CONST( ANY_VALUE = 0xFFF2 ); // NOTE: in 5.1 ctors and init take size in bytes From fa1d637e896d71932adcd1451c1564f724590189 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 15:24:34 +0400 Subject: [PATCH 587/789] A set of changes aiming to make the Event Scheduler more user-friendly when there are no up-to-date system tables to support it: - initialize the scheduler before reporting "Ready for connections". This ensures that warnings, if any, are printed before "Ready for connections", and this message is not mangled. - do not abort the scheduler if there are no system tables - check the tables once at start up, remember the status and disable the scheduler if the tables are not up to date. If one attempts to use the scheduler with bad tables, issue an error message. - clean up the behaviour of the module under LOCK TABLES and pre-locking mode - make sure implicit commit of Events DDL works as expected. - add more tests Collateral clean ups in the events code. This patch fixes Bug#23631 Events: SHOW VARIABLES doesn't work when mysql.event is damaged mysql-test/r/events.result: Update results. mysql-test/r/events_bugs.result: Update results. mysql-test/r/events_restart_phase1.result: Update results. mysql-test/r/events_restart_phase2.result: Update results. mysql-test/r/events_restart_phase3.result: Update results. mysql-test/r/events_scheduling.result: Update results. mysql-test/r/events_time_zone.result: Update results. mysql-test/t/events.test: Add new tests for tampering with mysql.event and some more tests for sub-statements, LOCK TABLES mode and pre-locking. mysql-test/t/events_bugs.test: Move the non-concurrent part of test for Bug 16420 to this file. mysql-test/t/events_restart_phase1.test: Rewrite events_restart_* tests to take into account that now we check mysql.event table only once, at server startup. mysql-test/t/events_restart_phase2.test: Rewrite events_restart_* tests to take into account that now we check mysql.event table only once, at server startup. mysql-test/t/events_restart_phase3.test: Rewrite events_restart_* tests to take into account that now we check mysql.event table only once, at server startup. mysql-test/t/events_scheduling.test: Add more coverage for event_scheduler global variable. mysql-test/t/events_time_zone.test: Move the non-concurrent part of the tests for Bug 16420 to events_bugs.test sql/event_data_objects.cc: Move update_timing_fields functionality to Event_db_repository. Make loading of events from a table record more robust to tampering with the table - now we do not check mysql.event on every table open. sql/event_data_objects.h: Cleanup. sql/event_db_repository.cc: Now Event_db_repository is responsible for table I/O only. All the logic of events DDL is handled outside, in Events class please refer to the added test coverage to see how this change affected the behavior of Event Scheduler. Dependency on sp_head.h and sp.h removed. Make this module robust to tweaks with mysql.event table. Move check_system_tables from events.cc to this file sql/event_db_repository.h: Cleanup declarations (remove unused ones, change return type to bool from int). sql/event_queue.cc: Update to adapt to the new start up scheme of the Event Scheduler. sql/event_queue.h: Cleanup declarations. sql/event_scheduler.cc: Make all the error messages uniform: [SEVERITY] Event Scheduler: [user][schema.event] message Using append_identifier for error logging was an overkill - we may need it only if the system character set may have NUL (null character) as part of a valid identifier, this is currently never the case, whereas additional quoting did not look nice in the log. sql/event_scheduler.h: Cleanup the headers. sql/events.cc: Use a different start up procedure of Event Scheduler: - at start up, try to check the system tables first. If they are not up-to-date, disable the scheduler. - try to load all the active events. In case of a load error, abort start up. - do not parse an event on start up. Parsing only gives some information about event validity, but far not all. Consolidate the business logic of Events DDL in this module. Now opt_event_scheduler may change after start up and thus is protected by LOCK_event_metadata mutex. sql/events.h: Use all-static-data-members approach to implement Singleton pattern. sql/mysqld.cc: New invocation scheme of Events. Move some logic to events.cc. Initialize the scheduler before reporting "Ready for connections". sql/set_var.cc: Clean up sys_var_thd_sql_mode::symbolic_mode_representation to work with a LEX_STRING. Move more logic related to @@events_scheduler global variable to Events module. sql/set_var.h: Update declarations. sql/share/errmsg.txt: If someone tampered with mysql.event table after the server has started we no longer give him/her a complete report what was actually broken. Do not send the user to look at the error log in such case, as there is nothing there (check_table_intact is not executed). sql/sp_head.cc: Update to a new declaration of sys_var_thd_sql_mode::symbolic_mode_representation sql/sql_db.cc: New invocation scheme of Events module. sql/sql_parse.cc: Move more logic to Events module. Make sure that we are consistent in the way access rights are checked for Events DDL: always after committing the current transaction and checking the system tables. sql/sql_show.cc: Update to the new declarations of sys_var_thd_sql_mode::symbolic_mode_representation sql/sql_test.cc: New invocation scheme of events. sql/table.cc: mysql.event is a system table. Update check_table_intact to be concurrent, more verbose, and less smart. sql/table.h: Add a helper method. mysql-test/r/events_trans.result: New BitKeeper file ``mysql-test/r/events_trans.result'' mysql-test/t/events_trans.test: New BitKeeper file ``mysql-test/t/events_trans.test'': test cases for Event Scheduler that require a transactional storage engine. --- mysql-test/r/events.result | 406 +++++++-- mysql-test/r/events_bugs.result | 150 +++- mysql-test/r/events_restart_phase1.result | 22 +- mysql-test/r/events_restart_phase2.result | 48 +- mysql-test/r/events_restart_phase3.result | 10 +- mysql-test/r/events_scheduling.result | 4 + mysql-test/r/events_time_zone.result | 142 ---- mysql-test/r/events_trans.result | 159 ++++ mysql-test/t/events.test | 382 ++++++++- mysql-test/t/events_bugs.test | 185 +++- mysql-test/t/events_restart_phase1.test | 46 +- mysql-test/t/events_restart_phase2.test | 44 +- mysql-test/t/events_restart_phase3.test | 22 +- mysql-test/t/events_scheduling.test | 4 + mysql-test/t/events_time_zone.test | 171 +--- mysql-test/t/events_trans.test | 159 ++++ sql/event_data_objects.cc | 94 +-- sql/event_data_objects.h | 3 - sql/event_db_repository.cc | 655 ++++++++------- sql/event_db_repository.h | 28 +- sql/event_queue.cc | 76 +- sql/event_queue.h | 41 +- sql/event_scheduler.cc | 99 +-- sql/event_scheduler.h | 25 +- sql/events.cc | 972 ++++++++++++---------- sql/events.h | 106 ++- sql/mysqld.cc | 46 +- sql/set_var.cc | 65 +- sql/set_var.h | 6 +- sql/share/errmsg.txt | 4 +- sql/sp_head.cc | 28 +- sql/sql_db.cc | 2 +- sql/sql_parse.cc | 53 +- sql/sql_show.cc | 25 +- sql/sql_test.cc | 2 +- sql/table.cc | 265 +++--- sql/table.h | 18 +- 37 files changed, 2820 insertions(+), 1747 deletions(-) create mode 100644 mysql-test/r/events_trans.result create mode 100644 mysql-test/t/events_trans.test diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index b0640af0b13..7125b13cb88 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -1,4 +1,8 @@ -create database if not exists events_test; +drop database if exists events_test; +drop database if exists db_x; +drop database if exists mysqltest_db2; +drop database if exists mysqltest_no_such_database; +create database events_test; use events_test; CREATE USER pauline@localhost; CREATE DATABASE db_x; @@ -223,72 +227,180 @@ drop event root19; drop event root20; drop event ðóóò21; set names latin1; +Create a test event. Only event metadata is relevant, +the actual schedule and body are not. CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED +Try to alter mysql.event: the server should fail to load +event information after mysql.event was tampered with. + +First, let's add a column to the end and make sure everything +works as before + +ALTER TABLE mysql.event ADD dummy INT; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED +SELECT event_name FROM INFORMATION_SCHEMA.events; +event_name +intact_check +SHOW CREATE EVENT intact_check; +Event sql_mode time_zone Create Event +intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" +DROP EVENT no_such_event; +ERROR HY000: Unknown event 'no_such_event' +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +DROP EVENT intact_check_1; +ERROR HY000: Unknown event 'intact_check_1' +DROP EVENT intact_check_2; +DROP EVENT intact_check; +DROP DATABASE IF EXISTS mysqltest_no_such_database; +Warnings: +Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +SELECT @@event_scheduler; +@@event_scheduler +OFF +SHOW VARIABLES LIKE 'event_scheduler'; +Variable_name Value +event_scheduler OFF +SET GLOBAL event_scheduler=OFF; +ALTER TABLE mysql.event DROP dummy; +CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; + +Now let's add a column to the first position: the server +expects to see event schema name there + ALTER TABLE mysql.event ADD dummy INT FIRST; SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. The table is probably corrupted -ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST; -SHOW EVENTS; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. The table is probably corrupted -ALTER TABLE mysql.event DROP dummy2; -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted +SELECT event_name FROM INFORMATION_SCHEMA.events; +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted +SHOW CREATE EVENT intact_check; +ERROR HY000: Unknown event 'intact_check' +DROP EVENT no_such_event; +ERROR HY000: Unknown event 'no_such_event' +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +ERROR HY000: Unknown event 'intact_check_1' +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +ERROR HY000: Unknown event 'intact_check_1' +DROP EVENT intact_check_1; +ERROR HY000: Unknown event 'intact_check_1' +DROP EVENT intact_check_2; +ERROR HY000: Unknown event 'intact_check_2' +DROP EVENT intact_check; +ERROR HY000: Unknown event 'intact_check' +DROP DATABASE IF EXISTS mysqltest_no_such_database; +Warnings: +Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +SELECT @@event_scheduler; +@@event_scheduler +OFF +SHOW VARIABLES LIKE 'event_scheduler'; +Variable_name Value +event_scheduler OFF +SET GLOBAL event_scheduler=OFF; +Clean up +ALTER TABLE mysql.event DROP dummy; +DELETE FROM mysql.event; +CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; +Back up the table, further changes are not reversible CREATE TABLE event_like LIKE mysql.event; INSERT INTO event_like SELECT * FROM mysql.event; -ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details -ALTER TABLE mysql.event MODIFY db char(20) character set utf8 collate utf8_bin default ''; -SHOW CREATE TABLE mysql.event; -Table Create Table -event CREATE TABLE `event` ( - `db` char(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `name` char(64) NOT NULL DEFAULT '', - `body` longblob NOT NULL, - `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `execute_at` datetime DEFAULT NULL, - `interval_value` int(11) DEFAULT NULL, - `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `last_executed` datetime DEFAULT NULL, - `starts` datetime DEFAULT NULL, - `ends` datetime DEFAULT NULL, - `status` enum('ENABLED','DISABLED') NOT NULL DEFAULT 'ENABLED', - `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', - `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', - `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', - `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', - PRIMARY KEY (`db`,`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details -ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin default ''; -"This should work" -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED -ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details -ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default ''; -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ERROR HY000: Cannot load from mysql.event. The table is probably corrupted. Please see the error log for details + +Drop some columns and try more checks. + + ALTER TABLE mysql.event DROP comment, DROP starts; +SHOW EVENTS; +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted +SHOW CREATE EVENT intact_check; +ERROR HY000: Cannot load from mysql.event. The table is probably corrupted +DROP EVENT no_such_event; +ERROR HY000: Unknown event 'no_such_event' +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. The table is probably corrupted +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +ERROR HY000: Unknown event 'intact_check_1' +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +ERROR HY000: Unknown event 'intact_check_1' +DROP EVENT intact_check_1; +ERROR HY000: Unknown event 'intact_check_1' +DROP EVENT intact_check_2; +ERROR HY000: Unknown event 'intact_check_2' +DROP EVENT intact_check; +DROP DATABASE IF EXISTS mysqltest_no_such_database; +Warnings: +Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +SELECT @@event_scheduler; +@@event_scheduler +OFF +SHOW VARIABLES LIKE 'event_scheduler'; +Variable_name Value +event_scheduler OFF +SET GLOBAL event_scheduler=OFF; + +Now drop the table, and test again + + DROP TABLE mysql.event; +SHOW EVENTS; +ERROR 42S02: Table 'mysql.event' doesn't exist +SELECT event_name FROM INFORMATION_SCHEMA.events; +ERROR 42S02: Table 'mysql.event' doesn't exist +SHOW CREATE EVENT intact_check; +ERROR 42S02: Table 'mysql.event' doesn't exist +DROP EVENT no_such_event; +ERROR 42S02: Table 'mysql.event' doesn't exist +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; +ERROR 42S02: Table 'mysql.event' doesn't exist +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +ERROR 42S02: Table 'mysql.event' doesn't exist +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +ERROR 42S02: Table 'mysql.event' doesn't exist +DROP EVENT intact_check_1; +ERROR 42S02: Table 'mysql.event' doesn't exist +DROP EVENT intact_check_2; +ERROR 42S02: Table 'mysql.event' doesn't exist +DROP EVENT intact_check; +ERROR 42S02: Table 'mysql.event' doesn't exist +DROP DATABASE IF EXISTS mysqltest_no_such_database; +Warnings: +Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist +Error 1146 Table 'mysql.event' doesn't exist +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +OK, there is an unnecessary warning about the non-existent table +but it's not easy to fix and no one complained about it. +A similar warning is printed if mysql.proc is missing. +SHOW WARNINGS; +Level Code Message +Error 1146 Table 'mysql.event' doesn't exist +SELECT @@event_scheduler; +@@event_scheduler +OFF +SHOW VARIABLES LIKE 'event_scheduler'; +Variable_name Value +event_scheduler OFF +SET GLOBAL event_scheduler=OFF; +Restore the original table. CREATE TABLE mysql.event like event_like; -INSERT INTO mysql.event SELECT * FROM event_like; DROP TABLE event_like; SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED -DROP EVENT intact_check; create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion @@ -401,4 +513,196 @@ SHOW EVENTS FROM ``; ERROR 42000: Incorrect database name '' SHOW EVENTS FROM `events\\test`; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status + +LOCK TABLES mode. + +create table t1 (a int); +create event e1 on schedule every 10 hour do select 1; +lock table t1 read; +show create event e1; +Event sql_mode time_zone Create Event +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +select event_name from information_schema.events; +event_name +e1 +create event e2 on schedule every 10 hour do select 1; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +alter event e2 disable; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +alter event e2 rename to e3; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +drop event e2; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +drop event e1; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +unlock tables; +lock table t1 write; +show create event e1; +Event sql_mode time_zone Create Event +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +select event_name from information_schema.events; +event_name +e1 +create event e2 on schedule every 10 hour do select 1; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +alter event e2 disable; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +alter event e2 rename to e3; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +drop event e2; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +drop event e1; +ERROR HY000: Table 'event' was not locked with LOCK TABLES +unlock tables; +lock table t1 read, mysql.event read; +show create event e1; +Event sql_mode time_zone Create Event +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +select event_name from information_schema.events; +event_name +e1 +create event e2 on schedule every 10 hour do select 1; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +alter event e2 disable; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +alter event e2 rename to e3; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +drop event e2; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +drop event e1; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +unlock tables; +lock table t1 write, mysql.event read; +show create event e1; +Event sql_mode time_zone Create Event +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +select event_name from information_schema.events; +event_name +e1 +create event e2 on schedule every 10 hour do select 1; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +alter event e2 disable; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +alter event e2 rename to e3; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +drop event e2; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +drop event e1; +ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +unlock tables; +lock table t1 read, mysql.event write; +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types +lock table t1 write, mysql.event write; +ERROR HY000: You can't combine write-locking of system tables with other tables or lock types +lock table mysql.event write; +show create event e1; +Event sql_mode time_zone Create Event +e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 +select event_name from information_schema.events; +event_name +e1 +create event e2 on schedule every 10 hour do select 1; +alter event e2 disable; +alter event e2 rename to e3; +drop event e3; +drop event e1; +unlock tables; +Make sure we have left no events +select event_name from information_schema.events; +event_name + +Events in sub-statements, events and prelocking + + +create event e1 on schedule every 10 hour do select 1; +create function f1() returns int +begin +show create event e1; +return 1; +end| +ERROR 0A000: Not allowed to return a result set from a function +create trigger trg before insert on t1 for each row +begin +show create event e1; +end| +ERROR 0A000: Not allowed to return a result set from a trigger +create function f1() returns int +begin +select event_name from information_schema.events; +return 1; +end| +ERROR 0A000: Not allowed to return a result set from a function +create trigger trg before insert on t1 for each row +begin +select event_name from information_schema.events; +end| +ERROR 0A000: Not allowed to return a result set from a trigger +create function f1() returns int +begin +create event e2 on schedule every 10 hour do select 1; +return 1; +end| +ERROR HY000: Recursion of EVENT DDL statements is forbidden when body is present +create function f1() returns int +begin +alter event e1 rename to e2; +return 1; +end| +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +create function f1() returns int +begin +drop event e2; +return 1; +end| +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +---------------------------------------------------------------------- +create trigger trg before insert on t1 for each row +begin +set new.a= f1(); +end| +create function f1() returns int +begin +call p1(); +return 0; +end| +create procedure p1() +begin +select event_name from information_schema.events; +end| +insert into t1 (a) values (1)| +ERROR 0A000: Not allowed to return a result set from a trigger +drop procedure p1| +create procedure p1() +begin +show create event e1; +end| +insert into t1 (a) values (1)| +ERROR 0A000: Not allowed to return a result set from a trigger +drop procedure p1| +create procedure p1() +begin +create temporary table tmp select event_name from information_schema.events; +end| +expected to work, since we redirect the output into a tmp table +insert into t1 (a) values (1)| +select * from tmp| +event_name +e1 +drop temporary table tmp| +drop procedure p1| +create procedure p1() +begin +alter event e1 rename to e2; +end| +insert into t1 (a) values (1)| +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +drop procedure p1| +create procedure p1() +begin +drop event e1; +end| +insert into t1 (a) values (1)| +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +drop table t1| +drop event e1| drop database events_test; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 6835ecd7fde..b7690a57207 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -1,4 +1,7 @@ -create database if not exists events_test; +drop database if exists events_test; +drop database if exists mysqltest_db1; +drop database if exists mysqltest_db2; +create database events_test; use events_test; CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1; CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2; @@ -381,4 +384,149 @@ ERROR 42000: Access denied; you need the SUPER privilege for this operation DROP EVENT e1; ERROR HY000: Unknown event 'e1' DROP USER mysqltest_u1@localhost; +SET GLOBAL EVENT_SCHEDULER= OFF; +SET @save_time_zone= @@TIME_ZONE; +SET TIME_ZONE= '+00:00'; +SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED +SET TIME_ZONE= '-01:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED +SET TIME_ZONE= '+02:00'; +ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED +SET TIME_ZONE= '-03:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED +SET TIME_ZONE= '+04:00'; +ALTER EVENT e1 DO SELECT 2; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED +DROP EVENT e1; +SET TIME_ZONE='+05:00'; +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO +SELECT 1; +SET TIMESTAMP= @@TIMESTAMP + 1; +SET TIME_ZONE='-05:00'; +CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO +SELECT 1; +SET TIMESTAMP= @@TIMESTAMP + 1; +SET TIME_ZONE='+00:00'; +CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO +SELECT 1; +SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name; +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT +NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL +NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL +NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +SHOW CREATE EVENT e1; +Event sql_mode time_zone Create Event +e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +SHOW CREATE EVENT e2; +Event sql_mode time_zone Create Event +e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +SHOW CREATE EVENT e3; +Event sql_mode time_zone Create Event +e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 +The following should fail, and nothing should be altered. +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00'; +ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE; +ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered +The following should give warnings, and nothing should be created. +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' +DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE +DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE +DO +SELECT 1; +Warnings: +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +The following should succeed giving a warning. +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; +Warnings: +Note 1533 Event execution time is in the past. Event has been disabled +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE +DO +SELECT 1; +Warnings: +Note 1533 Event execution time is in the past. Event has been disabled +CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE +DO +SELECT 1; +Warnings: +Note 1533 Event execution time is in the past. Event has been disabled +The following should succeed without warnings. +ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'; +ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; +CREATE EVENT e6 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO +SELECT 1; +CREATE EVENT e7 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE +DO +SELECT 1; +CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE DISABLE +DO +SELECT 1; +SHOW EVENTS; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +events_test e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +events_test e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED +events_test e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +events_test e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +events_test e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED +events_test e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED +events_test e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED +events_test e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED +DROP EVENT e8; +DROP EVENT e7; +DROP EVENT e6; +DROP EVENT e5; +DROP EVENT e4; +DROP EVENT e3; +DROP EVENT e2; +DROP EVENT e1; +SET TIME_ZONE=@save_time_zone; drop database events_test; diff --git a/mysql-test/r/events_restart_phase1.result b/mysql-test/r/events_restart_phase1.result index 0c032884dc4..7b1de62f2ef 100644 --- a/mysql-test/r/events_restart_phase1.result +++ b/mysql-test/r/events_restart_phase1.result @@ -1,12 +1,16 @@ -create database if not exists mysqltest_events_test; -use mysqltest_events_test; set global event_scheduler=off; +drop database if exists events_test; +create database events_test; +use events_test; create table execution_log(name char(10)); -create event abc1 on schedule every 1 second do insert into execution_log value('abc1'); -create event abc2 on schedule every 1 second do insert into execution_log value('abc2'); -create event abc3 on schedule every 1 second do insert into execution_log value('abc3'); -select name from execution_log; -name -insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1','SYSTEM'); -insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2','SYSTEM'); +create event abc1 on schedule every 1 second do +insert into execution_log value('abc1'); +create event abc2 on schedule every 1 second do +insert into execution_log value('abc2'); +create event abc3 on schedule every 1 second do +insert into execution_log value('abc3'); +create table event_like like mysql.event; +insert into event_like select * from mysql.event; +alter table mysql.event +change column body body longtext character set utf8 collate utf8_bin; "Now we restart the server" diff --git a/mysql-test/r/events_restart_phase2.result b/mysql-test/r/events_restart_phase2.result index 703cb92324f..60ddf06bf23 100644 --- a/mysql-test/r/events_restart_phase2.result +++ b/mysql-test/r/events_restart_phase2.result @@ -1,6 +1,42 @@ -use mysqltest_events_test; -"Should get 0 rows because the queue aborted run -select distinct name from execution_log order by name; -name -delete from mysql.event where name like 'bad%'; -"Now restart the server again" +use events_test; +select @@event_scheduler; +@@event_scheduler +DISABLED +show events; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +select event_name from information_schema.events; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +show create event intact_check; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +drop event no_such_event; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +create event intact_check_1 on schedule every 5 hour do select 5; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +alter event intact_check_1 on schedule every 8 hour do select 8; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +alter event intact_check_1 rename to intact_check_2; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +drop event intact_check_1; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +drop event intact_check_2; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +drop event intact_check; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +set global event_scheduler=on; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +set global event_scheduler=off; +ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start +show variables like 'event_scheduler'; +Variable_name Value +event_scheduler DISABLED +Make sure that we still can create and drop databases, +and no warnings are produced. +drop database if exists mysqltest_database_not_exists; +Warnings: +Note 1008 Can't drop database 'mysqltest_database_not_exists'; database doesn't exist +create database mysqltest_db1; +drop database mysqltest_db1; +Restore the original mysql.event table +drop table mysql.event; +rename table event_like to mysql.event; +Now let's restart the server again diff --git a/mysql-test/r/events_restart_phase3.result b/mysql-test/r/events_restart_phase3.result index e653d6a7c23..8ac00fdc70d 100644 --- a/mysql-test/r/events_restart_phase3.result +++ b/mysql-test/r/events_restart_phase3.result @@ -1,12 +1,12 @@ -use mysqltest_events_test; +use events_test; +select @@event_scheduler; +@@event_scheduler +ON "Should get 3 rows : abc1, abc2, abc3 select distinct name from execution_log order by name; name abc1 abc2 abc3 -drop event abc1; -drop event abc2; -drop event abc3; drop table execution_log; -drop database mysqltest_events_test; +drop database events_test; diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result index d885dc3a048..b945b83093f 100644 --- a/mysql-test/r/events_scheduling.result +++ b/mysql-test/r/events_scheduling.result @@ -1,6 +1,8 @@ CREATE DATABASE IF NOT EXISTS events_test; USE events_test; SET GLOBAL event_scheduler=OFF; +Try agian to make sure it's allowed +SET GLOBAL event_scheduler=OFF; SHOW VARIABLES LIKE 'event_scheduler'; Variable_name Value event_scheduler OFF @@ -13,6 +15,8 @@ SHOW VARIABLES LIKE 'event_scheduler'; Variable_name Value event_scheduler OFF SET GLOBAL event_scheduler=ON; +Try again to make sure it's allowed +SET GLOBAL event_scheduler=ON; SHOW VARIABLES LIKE 'event_scheduler'; Variable_name Value event_scheduler ON diff --git a/mysql-test/r/events_time_zone.result b/mysql-test/r/events_time_zone.result index 3d5ff794848..b20aa445183 100644 --- a/mysql-test/r/events_time_zone.result +++ b/mysql-test/r/events_time_zone.result @@ -3,148 +3,6 @@ CREATE DATABASE mysqltest_db1; USE mysqltest_db1; SET GLOBAL EVENT_SCHEDULER= OFF; SET @save_time_zone= @@TIME_ZONE; -SET TIME_ZONE= '+00:00'; -SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); -CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED -SET TIME_ZONE= '-01:00'; -ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED -SET TIME_ZONE= '+02:00'; -ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' - ON COMPLETION PRESERVE DISABLE; -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED -SET TIME_ZONE= '-03:00'; -ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' - ON COMPLETION PRESERVE DISABLE; -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED -SET TIME_ZONE= '+04:00'; -ALTER EVENT e1 DO SELECT 2; -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED -DROP EVENT e1; -SET TIME_ZONE='+05:00'; -CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO -SELECT 1; -SET TIMESTAMP= @@TIMESTAMP + 1; -SET TIME_ZONE='-05:00'; -CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO -SELECT 1; -SET TIMESTAMP= @@TIMESTAMP + 1; -SET TIME_ZONE='+00:00'; -CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO -SELECT 1; -SELECT * FROM INFORMATION_SCHEMA.EVENTS; -EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT -NULL mysqltest_db1 e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL -NULL mysqltest_db1 e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL -NULL mysqltest_db1 e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -SHOW CREATE EVENT e1; -Event sql_mode time_zone Create Event -e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 -SHOW CREATE EVENT e2; -Event sql_mode time_zone Create Event -e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 -SHOW CREATE EVENT e3; -Event sql_mode time_zone Create Event -e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 -The following should fail, and nothing should be altered. -ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00'; -ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered -ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' DISABLE; -ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered -The following should give warnings, and nothing should be created. -CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' -DO -SELECT 1; -Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created -CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' DISABLE -DO -SELECT 1; -Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created -CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO -SELECT 1; -Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created -CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE -DO -SELECT 1; -Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -The following should succeed giving a warning. -ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; -Warnings: -Note 1533 Event execution time is in the past. Event has been disabled -CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE -DO -SELECT 1; -Warnings: -Note 1533 Event execution time is in the past. Event has been disabled -CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00' - ON COMPLETION PRESERVE -DO -SELECT 1; -Warnings: -Note 1533 Event execution time is in the past. Event has been disabled -The following should succeed without warnings. -ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'; -ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; -CREATE EVENT e6 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO -SELECT 1; -CREATE EVENT e7 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE -DO -SELECT 1; -CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' - ON COMPLETION PRESERVE DISABLE -DO -SELECT 1; -SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED -mysqltest_db1 e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED -mysqltest_db1 e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -mysqltest_db1 e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED -DROP EVENT e8; -DROP EVENT e7; -DROP EVENT e6; -DROP EVENT e5; -DROP EVENT e4; -DROP EVENT e3; -DROP EVENT e2; -DROP EVENT e1; CREATE TABLE t_step (step INT); INSERT INTO t_step VALUES (@step); CREATE FUNCTION round_to_step(i INT, n INT) RETURNS INT diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result new file mode 100644 index 00000000000..145fb8be084 --- /dev/null +++ b/mysql-test/r/events_trans.result @@ -0,0 +1,159 @@ +drop database if exists events_test; +drop database if exists mysqltest_db2; +drop database if exists mysqltest_no_such_database; +create database events_test; +use events_test; + +Test that Events DDL issue an implicit COMMIT + + +set autocommit=off; +select @@autocommit; +@@autocommit +0 +create table t1 (a varchar(255)) engine=innodb; +begin work; +insert into t1 (a) values ("OK: create event"); +create event e1 on schedule every 1 day do select 1; +rollback work; +select * from t1; +a +OK: create event +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: alter event"); +alter event e1 on schedule every 2 day do select 2; +rollback work; +select * from t1; +a +OK: alter event +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: alter event rename"); +alter event e1 rename to e2; +rollback work; +select * from t1; +a +OK: alter event rename +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: drop event"); +drop event e2; +rollback work; +select * from t1; +a +OK: drop event +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: drop event if exists"); +drop event if exists e2; +Warnings: +Note 1305 Event e2 does not exist +rollback work; +select * from t1; +a +OK: drop event if exists +delete from t1; +commit work; +create event e1 on schedule every 1 day do select 1; +begin work; +insert into t1 (a) values ("OK: create event if not exists"); +create event if not exists e1 on schedule every 2 day do select 2; +Warnings: +Note 1526 Event 'e1' already exists +rollback work; +select * from t1; +a +OK: create event if not exists +delete from t1; +commit work; + +Now check various error conditions: make sure we issue an +implicit commit anyway + +begin work; +insert into t1 (a) values ("OK: create event: event already exists"); +create event e1 on schedule every 2 day do select 2; +ERROR HY000: Event 'e1' already exists +rollback work; +select * from t1; +a +OK: create event: event already exists +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: alter event rename: rename to same name"); +alter event e1 rename to e1; +ERROR HY000: Same old and new event name +rollback work; +select * from t1; +a +OK: alter event rename: rename to same name +delete from t1; +commit work; +create event e2 on schedule every 3 day do select 3; +begin work; +insert into t1 (a) values ("OK: alter event rename: destination exists"); +alter event e2 rename to e1; +ERROR HY000: Event 'e1' already exists +rollback work; +select * from t1; +a +OK: alter event rename: destination exists +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: create event: database does not exist"); +create event mysqltest_no_such_database.e1 on schedule every 1 day do select 1; +ERROR 42000: Unknown database 'mysqltest_no_such_database' +rollback work; +select * from t1; +a +OK: create event: database does not exist +delete from t1; +commit work; +grant create, insert, select, delete on mysqltest_db2.* +to mysqltest_user1@localhost; +create database mysqltest_db2; +set autocommit=off; +select @@autocommit; +@@autocommit +0 +create table t1 (a varchar(255)) engine=innodb; +begin work; +insert into t1 (a) values ("OK: create event: insufficient privileges"); +create event e1 on schedule every 1 day do select 1; +ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' +rollback work; +select * from t1; +a +OK: create event: insufficient privileges +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: alter event: insufficient privileges"); +alter event e1 on schedule every 1 day do select 1; +ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' +rollback work; +select * from t1; +a +OK: alter event: insufficient privileges +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: drop event: insufficient privileges"); +drop event e1; +ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' +rollback work; +select * from t1; +a +OK: drop event: insufficient privileges +delete from t1; +commit work; +drop user mysqltest_user1@localhost; +drop database mysqltest_db2; +drop database events_test; diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index 39bc1063ace..c8054e49da4 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -1,7 +1,13 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc -create database if not exists events_test; +--disable_warnings +drop database if exists events_test; +drop database if exists db_x; +drop database if exists mysqltest_db2; +drop database if exists mysqltest_no_such_database; +--enable_warnings +create database events_test; use events_test; # @@ -215,62 +221,161 @@ set names latin1; # # -# mysql.event intact checking start +# mysql.event intact checking +# Check that the server does not crash if +# one has destroyed or tampered with the event table. +# Please see see for events_restart_phase* tests to +# see the server behavior at start up with bad mysql.event +# table. # -# There should be at least 1 second between the ALTERs or we can't catch the change of create_time!! +# +--echo Create a test event. Only event metadata is relevant, +--echo the actual schedule and body are not. # CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; --replace_column 8 # 9 # SHOW EVENTS; -ALTER TABLE mysql.event ADD dummy INT FIRST; ---error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED -SHOW EVENTS; -ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST; ---error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED -SHOW EVENTS; -ALTER TABLE mysql.event DROP dummy2; +# +--echo Try to alter mysql.event: the server should fail to load +--echo event information after mysql.event was tampered with. +--echo +--echo First, let's add a column to the end and make sure everything +--echo works as before +--echo +ALTER TABLE mysql.event ADD dummy INT; --replace_column 8 # 9 # SHOW EVENTS; +SELECT event_name FROM INFORMATION_SCHEMA.events; +--replace_regex /STARTS '[^']+'/STARTS '#'/ +SHOW CREATE EVENT intact_check; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT no_such_event; +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT intact_check_1; +DROP EVENT intact_check_2; +DROP EVENT intact_check; +DROP DATABASE IF EXISTS mysqltest_no_such_database; +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +SELECT @@event_scheduler; +SHOW VARIABLES LIKE 'event_scheduler'; +SET GLOBAL event_scheduler=OFF; +# Clean up +ALTER TABLE mysql.event DROP dummy; +CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; +--echo +--echo Now let's add a column to the first position: the server +--echo expects to see event schema name there +--echo +ALTER TABLE mysql.event ADD dummy INT FIRST; +--error ER_CANNOT_LOAD_FROM_TABLE +SHOW EVENTS; +--error ER_CANNOT_LOAD_FROM_TABLE +SELECT event_name FROM INFORMATION_SCHEMA.events; +--error ER_EVENT_DOES_NOT_EXIST +SHOW CREATE EVENT intact_check; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT no_such_event; +--error ER_CANNOT_LOAD_FROM_TABLE +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; +--error ER_EVENT_DOES_NOT_EXIST +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +--error ER_EVENT_DOES_NOT_EXIST +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT intact_check_1; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT intact_check_2; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT intact_check; +# Should work OK +DROP DATABASE IF EXISTS mysqltest_no_such_database; +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +SELECT @@event_scheduler; +SHOW VARIABLES LIKE 'event_scheduler'; +SET GLOBAL event_scheduler=OFF; +--echo Clean up +ALTER TABLE mysql.event DROP dummy; +DELETE FROM mysql.event; +CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; +--echo Back up the table, further changes are not reversible CREATE TABLE event_like LIKE mysql.event; INSERT INTO event_like SELECT * FROM mysql.event; -#sleep a bit or we won't catch the change of time ---sleep 1.1 -ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; ---error ER_CANNOT_LOAD_FROM_TABLE -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; -ALTER TABLE mysql.event MODIFY db char(20) character set utf8 collate utf8_bin default ''; -#wait a bit or we won't see the difference because of seconds resolution ---sleep 1.1 -SHOW CREATE TABLE mysql.event; ---error ER_CANNOT_LOAD_FROM_TABLE -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ---sleep 1.1 -ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin default ''; ---sleep 1.1 ---echo "This should work" ---replace_column 8 # 9 # -SHOW EVENTS; ---sleep 1.1 -ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; ---error ER_CANNOT_LOAD_FROM_TABLE -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ---sleep 1.1 -ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default ''; ---sleep 1.1 ---error ER_CANNOT_LOAD_FROM_TABLE -SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ---sleep 1.1 +--echo +--echo Drop some columns and try more checks. +--echo +--echo ALTER TABLE mysql.event DROP comment, DROP starts; ---sleep 1.1 ---error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED +--error ER_CANNOT_LOAD_FROM_TABLE +SHOW EVENTS; +--error ER_CANNOT_LOAD_FROM_TABLE SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; +--error ER_CANNOT_LOAD_FROM_TABLE +SHOW CREATE EVENT intact_check; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT no_such_event; +--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; +--error ER_EVENT_DOES_NOT_EXIST +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +--error ER_EVENT_DOES_NOT_EXIST +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT intact_check_1; +--error ER_EVENT_DOES_NOT_EXIST +DROP EVENT intact_check_2; +# Should succeed +DROP EVENT intact_check; +DROP DATABASE IF EXISTS mysqltest_no_such_database; +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +SELECT @@event_scheduler; +SHOW VARIABLES LIKE 'event_scheduler'; +SET GLOBAL event_scheduler=OFF; +--echo +--echo Now drop the table, and test again +--echo +--echo DROP TABLE mysql.event; +--error ER_NO_SUCH_TABLE +SHOW EVENTS; +--error ER_NO_SUCH_TABLE +SELECT event_name FROM INFORMATION_SCHEMA.events; +--error ER_NO_SUCH_TABLE +SHOW CREATE EVENT intact_check; +--error ER_NO_SUCH_TABLE +DROP EVENT no_such_event; +--error ER_NO_SUCH_TABLE +CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; +--error ER_NO_SUCH_TABLE +ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; +--error ER_NO_SUCH_TABLE +ALTER EVENT intact_check_1 RENAME TO intact_check_2; +--error ER_NO_SUCH_TABLE +DROP EVENT intact_check_1; +--error ER_NO_SUCH_TABLE +DROP EVENT intact_check_2; +--error ER_NO_SUCH_TABLE +DROP EVENT intact_check; +DROP DATABASE IF EXISTS mysqltest_no_such_database; +CREATE DATABASE mysqltest_db2; +DROP DATABASE mysqltest_db2; +--echo OK, there is an unnecessary warning about the non-existent table +--echo but it's not easy to fix and no one complained about it. +--echo A similar warning is printed if mysql.proc is missing. +SHOW WARNINGS; +SELECT @@event_scheduler; +SHOW VARIABLES LIKE 'event_scheduler'; +SET GLOBAL event_scheduler=OFF; +--echo Restore the original table. CREATE TABLE mysql.event like event_like; -INSERT INTO mysql.event SELECT * FROM event_like; DROP TABLE event_like; --replace_column 8 # 9 # SHOW EVENTS; -DROP EVENT intact_check; # # mysql.event intact checking end # @@ -424,5 +529,200 @@ SHOW EVENTS FROM aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SHOW EVENTS FROM ``; SHOW EVENTS FROM `events\\test`; +# +# A check for events SQL under LOCK TABLES and in pre-locked mode. +# +--echo +--echo LOCK TABLES mode. +--echo +# +# SHOW CREATE EVENT and INFORMATION_SCHEMA.events are available and +# cause an implicit lock/unlock of mysql.event table, regardless of the +# currently locked tables. +# +create table t1 (a int); +create event e1 on schedule every 10 hour do select 1; +# +lock table t1 read; +# +--replace_regex /STARTS '[^']+'/STARTS '#'/ +show create event e1; +select event_name from information_schema.events; +--error ER_TABLE_NOT_LOCKED +create event e2 on schedule every 10 hour do select 1; +--error ER_TABLE_NOT_LOCKED +alter event e2 disable; +--error ER_TABLE_NOT_LOCKED +alter event e2 rename to e3; +--error ER_TABLE_NOT_LOCKED +drop event e2; +--error ER_TABLE_NOT_LOCKED +drop event e1; +unlock tables; +# +lock table t1 write; +# +--replace_regex /STARTS '[^']+'/STARTS '#'/ +show create event e1; +select event_name from information_schema.events; +--error ER_TABLE_NOT_LOCKED +create event e2 on schedule every 10 hour do select 1; +--error ER_TABLE_NOT_LOCKED +alter event e2 disable; +--error ER_TABLE_NOT_LOCKED +alter event e2 rename to e3; +--error ER_TABLE_NOT_LOCKED +drop event e2; +--error ER_TABLE_NOT_LOCKED +drop event e1; +unlock tables; +# +lock table t1 read, mysql.event read; +# +--replace_regex /STARTS '[^']+'/STARTS '#'/ +show create event e1; +select event_name from information_schema.events; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +create event e2 on schedule every 10 hour do select 1; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +alter event e2 disable; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +alter event e2 rename to e3; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +drop event e2; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +drop event e1; +unlock tables; +# +lock table t1 write, mysql.event read; +# +--replace_regex /STARTS '[^']+'/STARTS '#'/ +show create event e1; +select event_name from information_schema.events; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +create event e2 on schedule every 10 hour do select 1; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +alter event e2 disable; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +alter event e2 rename to e3; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +drop event e2; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +drop event e1; +unlock tables; +# +--error ER_WRONG_LOCK_OF_SYSTEM_TABLE +lock table t1 read, mysql.event write; +# +--error ER_WRONG_LOCK_OF_SYSTEM_TABLE +lock table t1 write, mysql.event write; +# +lock table mysql.event write; +--replace_regex /STARTS '[^']+'/STARTS '#'/ +show create event e1; +select event_name from information_schema.events; +create event e2 on schedule every 10 hour do select 1; +alter event e2 disable; +alter event e2 rename to e3; +drop event e3; +drop event e1; +unlock tables; +--echo Make sure we have left no events +select event_name from information_schema.events; +--echo +--echo Events in sub-statements, events and prelocking +--echo +--echo +create event e1 on schedule every 10 hour do select 1; +delimiter |; +--error ER_SP_NO_RETSET +create function f1() returns int +begin + show create event e1; + return 1; +end| +--error ER_SP_NO_RETSET +create trigger trg before insert on t1 for each row +begin + show create event e1; +end| +--error ER_SP_NO_RETSET +create function f1() returns int +begin + select event_name from information_schema.events; + return 1; +end| +--error ER_SP_NO_RETSET +create trigger trg before insert on t1 for each row +begin + select event_name from information_schema.events; +end| +--error ER_EVENT_RECURSION_FORBIDDEN +create function f1() returns int +begin + create event e2 on schedule every 10 hour do select 1; + return 1; +end| +--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG +create function f1() returns int +begin + alter event e1 rename to e2; + return 1; +end| +--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG +create function f1() returns int +begin + drop event e2; + return 1; +end| +--echo ---------------------------------------------------------------------- +create trigger trg before insert on t1 for each row +begin + set new.a= f1(); +end| +create function f1() returns int +begin + call p1(); + return 0; +end| +create procedure p1() +begin + select event_name from information_schema.events; +end| +--error ER_SP_NO_RETSET +insert into t1 (a) values (1)| +drop procedure p1| +create procedure p1() +begin + show create event e1; +end| +--error ER_SP_NO_RETSET +insert into t1 (a) values (1)| +drop procedure p1| +create procedure p1() +begin + create temporary table tmp select event_name from information_schema.events; +end| +--echo expected to work, since we redirect the output into a tmp table +insert into t1 (a) values (1)| +select * from tmp| +drop temporary table tmp| +drop procedure p1| +create procedure p1() +begin + alter event e1 rename to e2; +end| +--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG +insert into t1 (a) values (1)| +drop procedure p1| +create procedure p1() +begin + drop event e1; +end| +--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG +insert into t1 (a) values (1)| +drop table t1| +drop event e1| +delimiter ;| drop database events_test; diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 56c44dc3a9f..8343c6b4bc6 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1,7 +1,12 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc -create database if not exists events_test; +--disable_warnings +drop database if exists events_test; +drop database if exists mysqltest_db1; +drop database if exists mysqltest_db2; +--enable_warnings +create database events_test; use events_test; # @@ -429,6 +434,184 @@ DROP USER mysqltest_u1@localhost; # +# BUG#16420: Events: timestamps become UTC +# BUG#26429: SHOW CREATE EVENT is incorrect for an event that +# STARTS NOW() +# BUG#26431: Impossible to re-create an event from backup if its +# STARTS clause is in the past +# WL#3698: Events: execution in local time zone +# +# Here we only check non-concurrent aspects of the patch. +# For the actual tests of time zones please see events_time_zone.test +# +SET GLOBAL EVENT_SCHEDULER= OFF; +SET @save_time_zone= @@TIME_ZONE; + +#---------------------------------------------------------------------- + +# We will use a separate connection because SET TIMESTAMP will stop +# the clock in that connection. + +SET TIME_ZONE= '+00:00'; +SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); + + +# Test when event time zone is updated on ALTER EVENT. +# + +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +SHOW EVENTS; + +# Test storing and updating of the event time zone. +# +SET TIME_ZONE= '-01:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; +SHOW EVENTS; + +# This will update event time zone. +SET TIME_ZONE= '+02:00'; +ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; + +# This will update event time zone. +SET TIME_ZONE= '-03:00'; +ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' + ON COMPLETION PRESERVE DISABLE; +SHOW EVENTS; + +# This will not update event time zone, as no time is being adjusted. +SET TIME_ZONE= '+04:00'; +ALTER EVENT e1 DO SELECT 2; +SHOW EVENTS; + +DROP EVENT e1; + +#---------------------------------------------------------------------- + +# Create some events. +SET TIME_ZONE='+05:00'; +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO + SELECT 1; + +SET TIMESTAMP= @@TIMESTAMP + 1; + +SET TIME_ZONE='-05:00'; +CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO + SELECT 1; + +SET TIMESTAMP= @@TIMESTAMP + 1; + +SET TIME_ZONE='+00:00'; +CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO + SELECT 1; + + +# Test INFORMATION_SCHEMA.EVENTS. +# + +SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name; + + +# Test SHOW EVENTS. +# + +SHOW EVENTS; + + +# Test SHOW CREATE EVENT. +# + +SHOW CREATE EVENT e1; +SHOW CREATE EVENT e2; +SHOW CREATE EVENT e3; + +#---------------------------------------------------------------------- + +# Test times in the past. +# + +--echo The following should fail, and nothing should be altered. + +--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00'; + +--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE; + +--echo The following should give warnings, and nothing should be created. + +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' +DO + SELECT 1; + +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' DISABLE +DO + SELECT 1; + +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO + SELECT 1; + +CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE +DO + SELECT 1; + +SHOW EVENTS; + +--echo The following should succeed giving a warning. + +ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; + +CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE +DO + SELECT 1; + +CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE +DO + SELECT 1; + +--echo The following should succeed without warnings. + +ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'; + +ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; + +CREATE EVENT e6 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO + SELECT 1; + +CREATE EVENT e7 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' + ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE +DO + SELECT 1; + +CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' + ON COMPLETION PRESERVE DISABLE +DO + SELECT 1; + +SHOW EVENTS; + + +DROP EVENT e8; +DROP EVENT e7; +DROP EVENT e6; +DROP EVENT e5; +DROP EVENT e4; +DROP EVENT e3; +DROP EVENT e2; +DROP EVENT e1; + +SET TIME_ZONE=@save_time_zone; + +# # End of tests # drop database events_test; diff --git a/mysql-test/t/events_restart_phase1.test b/mysql-test/t/events_restart_phase1.test index 0a84f6c4966..6a94ef12222 100644 --- a/mysql-test/t/events_restart_phase1.test +++ b/mysql-test/t/events_restart_phase1.test @@ -1,19 +1,43 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc +# +# Test that when the server is restarted, it checks mysql.event table, +# and disables the scheduler if it's not up to date. +# + +# Switch off the scheduler for now. +set global event_scheduler=off; --disable_warnings -create database if not exists mysqltest_events_test; +drop database if exists events_test; --enable_warnings - -use mysqltest_events_test; -set global event_scheduler=off; +create database events_test; +use events_test; create table execution_log(name char(10)); -create event abc1 on schedule every 1 second do insert into execution_log value('abc1'); -create event abc2 on schedule every 1 second do insert into execution_log value('abc2'); -create event abc3 on schedule every 1 second do insert into execution_log value('abc3'); ---sleep 1.5 -select name from execution_log; -insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1','SYSTEM'); -insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2','SYSTEM'); +create event abc1 on schedule every 1 second do + insert into execution_log value('abc1'); +create event abc2 on schedule every 1 second do + insert into execution_log value('abc2'); +create event abc3 on schedule every 1 second do + insert into execution_log value('abc3'); +# +# There are various conditions when a server would regard mysql.event +# table as damaged: +# - the table has more column than specified in the compiled in value, but +# the version of the server which created the table is the same +# - the column count in the table is less than the compiled in value +# - some column has an incompatible type specification (for what is an +# incompatible type specification please refer to the comments in the source +# +# Unfortunately, in order to test a condition, we need to restart the +# server. Therefore, here we test only one simple case: changing the data +# type of the 'body' field to blob. +# +# First, let's do a backup to not depend on actual definition of mysql.event +create table event_like like mysql.event; +insert into event_like select * from mysql.event; +# Now let's alter the table and restart the server +alter table mysql.event + change column body body longtext character set utf8 collate utf8_bin; --echo "Now we restart the server" diff --git a/mysql-test/t/events_restart_phase2.test b/mysql-test/t/events_restart_phase2.test index 845472377ba..c3f799634b3 100644 --- a/mysql-test/t/events_restart_phase2.test +++ b/mysql-test/t/events_restart_phase2.test @@ -1,9 +1,41 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc -use mysqltest_events_test; ---sleep 1.5 ---echo "Should get 0 rows because the queue aborted run -select distinct name from execution_log order by name; -delete from mysql.event where name like 'bad%'; ---echo "Now restart the server again" +use events_test; +# Event scheduler should be disabled: the system tables are damaged +select @@event_scheduler; +# Try various Event Scheduler operation and check the output. +--error ER_EVENTS_DB_ERROR +show events; +--error ER_EVENTS_DB_ERROR +select event_name from information_schema.events; +--error ER_EVENTS_DB_ERROR +show create event intact_check; +--error ER_EVENTS_DB_ERROR +drop event no_such_event; +--error ER_EVENTS_DB_ERROR +create event intact_check_1 on schedule every 5 hour do select 5; +--error ER_EVENTS_DB_ERROR +alter event intact_check_1 on schedule every 8 hour do select 8; +--error ER_EVENTS_DB_ERROR +alter event intact_check_1 rename to intact_check_2; +--error ER_EVENTS_DB_ERROR +drop event intact_check_1; +--error ER_EVENTS_DB_ERROR +drop event intact_check_2; +--error ER_EVENTS_DB_ERROR +drop event intact_check; +--error ER_EVENTS_DB_ERROR +set global event_scheduler=on; +--error ER_EVENTS_DB_ERROR +set global event_scheduler=off; +show variables like 'event_scheduler'; +--echo Make sure that we still can create and drop databases, +--echo and no warnings are produced. +drop database if exists mysqltest_database_not_exists; +create database mysqltest_db1; +drop database mysqltest_db1; +--echo Restore the original mysql.event table +drop table mysql.event; +rename table event_like to mysql.event; +--echo Now let's restart the server again diff --git a/mysql-test/t/events_restart_phase3.test b/mysql-test/t/events_restart_phase3.test index 76cd9d22752..1be40c72717 100644 --- a/mysql-test/t/events_restart_phase3.test +++ b/mysql-test/t/events_restart_phase3.test @@ -1,14 +1,18 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc - -use mysqltest_events_test; ---sleep 2 +# +# We need this file primarily to make sure that the scheduler is restarted +# and enabled after we have restored mysql.event table. +# This is the final step of the "cleanup". +# +# Make sure also that events are executed OK after restart, just in case. +use events_test; +# Make sure the scheduler was started successfully +select @@event_scheduler; +let $wait_condition=select count(distinct name)=3 from execution_log; +--source include/wait_condition.inc --echo "Should get 3 rows : abc1, abc2, abc3 select distinct name from execution_log order by name; - -drop event abc1; -drop event abc2; -drop event abc3; drop table execution_log; - -drop database mysqltest_events_test; +# Will drop all events +drop database events_test; diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index e3b55685e65..ff9dfaad927 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -5,6 +5,8 @@ CREATE DATABASE IF NOT EXISTS events_test; USE events_test; +SET GLOBAL event_scheduler=OFF; +--echo Try agian to make sure it's allowed SET GLOBAL event_scheduler=OFF; SHOW VARIABLES LIKE 'event_scheduler'; SET GLOBAL event_scheduler=1; @@ -12,6 +14,8 @@ SHOW VARIABLES LIKE 'event_scheduler'; SET GLOBAL event_scheduler=0; SHOW VARIABLES LIKE 'event_scheduler'; SET GLOBAL event_scheduler=ON; +--echo Try again to make sure it's allowed +SET GLOBAL event_scheduler=ON; SHOW VARIABLES LIKE 'event_scheduler'; --error ER_WRONG_VALUE_FOR_VAR SET GLOBAL event_scheduler=DISABLED; diff --git a/mysql-test/t/events_time_zone.test b/mysql-test/t/events_time_zone.test index fff84c7a995..5f929e0b07a 100644 --- a/mysql-test/t/events_time_zone.test +++ b/mysql-test/t/events_time_zone.test @@ -20,6 +20,7 @@ let $old_db= `SELECT DATABASE()`; USE mysqltest_db1; SET GLOBAL EVENT_SCHEDULER= OFF; +SET @save_time_zone= @@TIME_ZONE; # @@ -31,176 +32,6 @@ SET GLOBAL EVENT_SCHEDULER= OFF; # WL#3698: Events: execution in local time zone # -SET @save_time_zone= @@TIME_ZONE; - -#---------------------------------------------------------------------- - -# We will use a separate connection because SET TIMESTAMP will stop -# the clock in that connection. - -connect (conn1, localhost, root, , mysqltest_db1); - -SET TIME_ZONE= '+00:00'; -SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); - - -# Test when event time zone is updated on ALTER EVENT. -# - -CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; -SHOW EVENTS; - -# Test storing and updating of the event time zone. -# -SET TIME_ZONE= '-01:00'; -ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; -SHOW EVENTS; - -# This will update event time zone. -SET TIME_ZONE= '+02:00'; -ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' - ON COMPLETION PRESERVE DISABLE; -SHOW EVENTS; - -# This will update event time zone. -SET TIME_ZONE= '-03:00'; -ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' - ON COMPLETION PRESERVE DISABLE; -SHOW EVENTS; - -# This will not update event time zone, as no time is being adjusted. -SET TIME_ZONE= '+04:00'; -ALTER EVENT e1 DO SELECT 2; -SHOW EVENTS; - -DROP EVENT e1; - -#---------------------------------------------------------------------- - -# Create some events. -SET TIME_ZONE='+05:00'; -CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO - SELECT 1; - -SET TIMESTAMP= @@TIMESTAMP + 1; - -SET TIME_ZONE='-05:00'; -CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO - SELECT 1; - -SET TIMESTAMP= @@TIMESTAMP + 1; - -SET TIME_ZONE='+00:00'; -CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO - SELECT 1; - - -# Test INFORMATION_SCHEMA.EVENTS. -# - -SELECT * FROM INFORMATION_SCHEMA.EVENTS; - - -# Test SHOW EVENTS. -# - -SHOW EVENTS; - - -# Test SHOW CREATE EVENT. -# - -SHOW CREATE EVENT e1; -SHOW CREATE EVENT e2; -SHOW CREATE EVENT e3; - -#---------------------------------------------------------------------- - -# Test times in the past. -# - ---echo The following should fail, and nothing should be altered. - ---error ER_EVENT_CANNOT_ALTER_IN_THE_PAST -ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00'; - ---error ER_EVENT_CANNOT_ALTER_IN_THE_PAST -ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' DISABLE; - ---echo The following should give warnings, and nothing should be created. - -CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' -DO - SELECT 1; - -CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' DISABLE -DO - SELECT 1; - -CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO - SELECT 1; - -CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE -DO - SELECT 1; - -SHOW EVENTS; - ---echo The following should succeed giving a warning. - -ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; - -CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE -DO - SELECT 1; - -CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00' - ON COMPLETION PRESERVE -DO - SELECT 1; - ---echo The following should succeed without warnings. - -ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'; - -ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; - -CREATE EVENT e6 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO - SELECT 1; - -CREATE EVENT e7 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' - ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE -DO - SELECT 1; - -CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' - ON COMPLETION PRESERVE DISABLE -DO - SELECT 1; - -SHOW EVENTS; - - -DROP EVENT e8; -DROP EVENT e7; -DROP EVENT e6; -DROP EVENT e5; -DROP EVENT e4; -DROP EVENT e3; -DROP EVENT e2; -DROP EVENT e1; - - -disconnect conn1; -connection default; - #---------------------------------------------------------------------- # Create rounding function. diff --git a/mysql-test/t/events_trans.test b/mysql-test/t/events_trans.test new file mode 100644 index 00000000000..41044f9975f --- /dev/null +++ b/mysql-test/t/events_trans.test @@ -0,0 +1,159 @@ +# +# Tests that require transactions +# +-- source include/have_innodb.inc +--disable_warnings +drop database if exists events_test; +drop database if exists mysqltest_db2; +drop database if exists mysqltest_no_such_database; +--enable_warnings +create database events_test; +use events_test; + +--echo +--echo Test that Events DDL issue an implicit COMMIT +--echo +--echo +set autocommit=off; +# Sanity check +select @@autocommit; +create table t1 (a varchar(255)) engine=innodb; +# Basic: check that successful Events DDL commits pending transaction +begin work; +insert into t1 (a) values ("OK: create event"); +create event e1 on schedule every 1 day do select 1; +rollback work; +select * from t1; +delete from t1; +commit work; +# +begin work; +insert into t1 (a) values ("OK: alter event"); +alter event e1 on schedule every 2 day do select 2; +rollback work; +select * from t1; +delete from t1; +commit work; +# +begin work; +insert into t1 (a) values ("OK: alter event rename"); +alter event e1 rename to e2; +rollback work; +select * from t1; +delete from t1; +commit work; +# +begin work; +insert into t1 (a) values ("OK: drop event"); +drop event e2; +rollback work; +select * from t1; +delete from t1; +commit work; +# +begin work; +insert into t1 (a) values ("OK: drop event if exists"); +drop event if exists e2; +rollback work; +select * from t1; +delete from t1; +commit work; +# +create event e1 on schedule every 1 day do select 1; +begin work; +insert into t1 (a) values ("OK: create event if not exists"); +create event if not exists e1 on schedule every 2 day do select 2; +rollback work; +select * from t1; +delete from t1; +commit work; +--echo +--echo Now check various error conditions: make sure we issue an +--echo implicit commit anyway +--echo +# +begin work; +insert into t1 (a) values ("OK: create event: event already exists"); +--error ER_EVENT_ALREADY_EXISTS +create event e1 on schedule every 2 day do select 2; +rollback work; +select * from t1; +delete from t1; +commit work; +# +begin work; +insert into t1 (a) values ("OK: alter event rename: rename to same name"); +--error ER_EVENT_SAME_NAME +alter event e1 rename to e1; +rollback work; +select * from t1; +delete from t1; +commit work; +# +create event e2 on schedule every 3 day do select 3; +begin work; +insert into t1 (a) values ("OK: alter event rename: destination exists"); +--error ER_EVENT_ALREADY_EXISTS +alter event e2 rename to e1; +rollback work; +select * from t1; +delete from t1; +commit work; +# +begin work; +insert into t1 (a) values ("OK: create event: database does not exist"); +--error ER_BAD_DB_ERROR +create event mysqltest_no_such_database.e1 on schedule every 1 day do select 1; +rollback work; +select * from t1; +delete from t1; +commit work; +# +# Privilege checks +# +grant create, insert, select, delete on mysqltest_db2.* + to mysqltest_user1@localhost; +create database mysqltest_db2; +connect (conn1,localhost,mysqltest_user1,,mysqltest_db2); +set autocommit=off; +# Sanity check +select @@autocommit; +create table t1 (a varchar(255)) engine=innodb; +# Not enough privileges to CREATE EVENT +begin work; +insert into t1 (a) values ("OK: create event: insufficient privileges"); +--error ER_DBACCESS_DENIED_ERROR +create event e1 on schedule every 1 day do select 1; +rollback work; +select * from t1; +delete from t1; +commit work; +# Not enough privileges to ALTER EVENT +begin work; +insert into t1 (a) values ("OK: alter event: insufficient privileges"); +--error ER_DBACCESS_DENIED_ERROR +alter event e1 on schedule every 1 day do select 1; +rollback work; +select * from t1; +delete from t1; +commit work; +# Not enough privileges to DROP EVENT +begin work; +insert into t1 (a) values ("OK: drop event: insufficient privileges"); +--error ER_DBACCESS_DENIED_ERROR +drop event e1; +rollback work; +select * from t1; +delete from t1; +commit work; +# Cleanup +disconnect conn1; +connection default; +drop user mysqltest_user1@localhost; +drop database mysqltest_db2; + +# +# Cleanup +# +drop database events_test; + diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index e87a78a5e37..95bfba548de 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -20,8 +20,6 @@ #include "event_db_repository.h" #include "sp_head.h" -/* That's a provisional solution */ -extern Event_db_repository events_event_db_repository; #define EVEX_MAX_INTERVAL_VALUE 1000000000L @@ -215,7 +213,7 @@ Event_parse_data::init_body(THD *thd) ++body_begin; --body.length; } - body.str= thd->strmake((char *)body_begin, body.length); + body.str= thd->strmake(body_begin, body.length); DBUG_VOID_RETURN; } @@ -694,7 +692,7 @@ Event_basic::load_string_fields(Field **fields, ...) va_start(args, fields); field_name= (enum enum_events_table_field) va_arg(args, int); - while (field_name != ET_FIELD_COUNT) + while (field_name < ET_FIELD_COUNT) { field_value= va_arg(args, LEX_STRING *); if ((field_value->str= get_field(&mem_root, fields[field_name])) == NullS) @@ -858,13 +856,19 @@ Event_job_data::load_from_row(THD *thd, TABLE *table) if (!table) goto error; - if (table->s->fields != ET_FIELD_COUNT) + if (table->s->fields < ET_FIELD_COUNT) goto error; LEX_STRING tz_name; - load_string_fields(table->field, ET_FIELD_DB, &dbname, ET_FIELD_NAME, &name, - ET_FIELD_BODY, &body, ET_FIELD_DEFINER, &definer, - ET_FIELD_TIME_ZONE, &tz_name, ET_FIELD_COUNT); + if (load_string_fields(table->field, + ET_FIELD_DB, &dbname, + ET_FIELD_NAME, &name, + ET_FIELD_BODY, &body, + ET_FIELD_DEFINER, &definer, + ET_FIELD_TIME_ZONE, &tz_name, + ET_FIELD_COUNT)) + goto error; + if (load_time_zone(thd, tz_name)) goto error; @@ -910,19 +914,24 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table) { char *ptr; TIME time; + LEX_STRING tz_name; DBUG_ENTER("Event_queue_element::load_from_row"); if (!table) goto error; - if (table->s->fields != ET_FIELD_COUNT) + if (table->s->fields < ET_FIELD_COUNT) + goto error; + + if (load_string_fields(table->field, + ET_FIELD_DB, &dbname, + ET_FIELD_NAME, &name, + ET_FIELD_DEFINER, &definer, + ET_FIELD_TIME_ZONE, &tz_name, + ET_FIELD_COUNT)) goto error; - LEX_STRING tz_name; - load_string_fields(table->field, ET_FIELD_DB, &dbname, ET_FIELD_NAME, &name, - ET_FIELD_DEFINER, &definer, - ET_FIELD_TIME_ZONE, &tz_name, ET_FIELD_COUNT); if (load_time_zone(thd, tz_name)) goto error; @@ -1039,7 +1048,11 @@ Event_timed::load_from_row(THD *thd, TABLE *table) if (Event_queue_element::load_from_row(thd, table)) goto error; - load_string_fields(table->field, ET_FIELD_BODY, &body, ET_FIELD_COUNT); + if (load_string_fields(table->field, + ET_FIELD_BODY, &body, + ET_FIELD_COUNT)) + goto error; + ptr= strchr(definer.str, '@'); @@ -1594,10 +1607,8 @@ Event_queue_element::mark_last_executed(THD *thd) bool Event_queue_element::update_timing_fields(THD *thd) { - TABLE *table; - Field **fields; - Open_tables_state backup; - int ret= FALSE; + Event_db_repository *db_repository= Events::get_db_repository(); + int ret; DBUG_ENTER("Event_queue_element::update_timing_fields"); @@ -1607,46 +1618,13 @@ Event_queue_element::update_timing_fields(THD *thd) if (!(status_changed || last_executed_changed)) DBUG_RETURN(0); - thd->reset_n_backup_open_tables_state(&backup); - - if (events_event_db_repository.open_event_table(thd, TL_WRITE, &table)) - { - ret= TRUE; - goto done; - } - fields= table->field; - if ((ret= events_event_db_repository. - find_named_event(thd, dbname, name, table))) - goto done; - - store_record(table,record[1]); - /* Don't update create on row update. */ - table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; - - if (last_executed_changed) - { - TIME time; - my_tz_UTC->gmt_sec_to_TIME(&time, last_executed); - - fields[ET_FIELD_LAST_EXECUTED]->set_notnull(); - fields[ET_FIELD_LAST_EXECUTED]->store_time(&time, - MYSQL_TIMESTAMP_DATETIME); - last_executed_changed= FALSE; - } - if (status_changed) - { - fields[ET_FIELD_STATUS]->set_notnull(); - fields[ET_FIELD_STATUS]->store((longlong)status, TRUE); - status_changed= FALSE; - } - - if ((table->file->ha_update_row(table->record[1], table->record[0]))) - ret= TRUE; - -done: - close_thread_tables(thd); - thd->restore_backup_open_tables_state(&backup); - + ret= db_repository->update_timing_fields_for_event(thd, + dbname, name, + last_executed_changed, + last_executed, + status_changed, + (ulonglong) status); + last_executed_changed= status_changed= FALSE; DBUG_RETURN(ret); } diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index 358373889e5..ab9bff176e1 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -18,7 +18,6 @@ #define EVEX_GET_FIELD_FAILED -2 #define EVEX_COMPILE_ERROR -3 -#define EVEX_GENERAL_ERROR -4 #define EVEX_BAD_PARAMS -5 #define EVEX_MICROSECOND_UNSUP -6 @@ -173,8 +172,6 @@ public: ulong sql_mode; - uint execution_count; - Event_job_data(); virtual ~Event_job_data(); diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 9e1ce1b4594..859836c72a8 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -18,12 +18,6 @@ #include "event_data_objects.h" #include "events.h" #include "sql_show.h" -#include "sp.h" -#include "sp_head.h" - - -static -time_t mysql_event_last_create_time= 0L; static const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] = @@ -127,26 +121,21 @@ const TABLE_FIELD_W_TYPE event_table_fields[ET_FIELD_COUNT] = }; -/* +/** Puts some data common to CREATE and ALTER EVENT into a row. - SYNOPSIS - mysql_event_fill_row() - thd THD - table The row to fill out - et Event's data - is_update CREATE EVENT or ALTER EVENT + Used both when an event is created and when it is altered. - RETURN VALUE - 0 OK - EVEX_GENERAL_ERROR Bad data - EVEX_GET_FIELD_FAILED Field count does not match. table corrupted? + @param thd THD + @param table The row to fill out + @param et Event's data + @param is_update CREATE EVENT or ALTER EVENT - DESCRIPTION - Used both when an event is created and when it is altered. + @retval FALSE success + @retval TRUE error */ -static int +static bool mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, my_bool is_update) { @@ -160,6 +149,17 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, DBUG_PRINT("info", ("name =[%s]", et->name.str)); DBUG_PRINT("info", ("body =[%s]", et->body.str)); + if (table->s->fields < ET_FIELD_COUNT) + { + /* + Safety: this can only happen if someone started the server + and then altered mysql.event. + */ + my_error(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED, MYF(0), table->alias, + (int) ET_FIELD_COUNT, table->s->fields); + DBUG_RETURN(TRUE); + } + if (fields[f_num= ET_FIELD_DEFINER]-> store(et->definer.str, et->definer.length, scs)) goto err_truncate; @@ -263,11 +263,11 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, goto err_truncate; } - DBUG_RETURN(0); + DBUG_RETURN(FALSE); err_truncate: my_error(ER_EVENT_DATA_TOO_LONG, MYF(0), fields[f_num]->field_name); - DBUG_RETURN(EVEX_GENERAL_ERROR); + DBUG_RETURN(TRUE); } @@ -381,40 +381,33 @@ Event_db_repository::table_scan_all_for_i_s(THD *thd, TABLE *schema_table, } -/* +/** Fills I_S.EVENTS with data loaded from mysql.event. Also used by SHOW EVENTS - SYNOPSIS - Event_db_repository::fill_schema_events() - thd Thread - tables The schema table - db If not NULL then get events only from this schema + The reason we reset and backup open tables here is that this + function may be called from any query that accesses + INFORMATION_SCHEMA - including a query that is issued from + a pre-locked statement, one that already has open and locked + tables. - RETURN VALUE - FALSE OK - TRUE Error + @retval FALSE success + @retval TRUE error */ -int +bool Event_db_repository::fill_schema_events(THD *thd, TABLE_LIST *tables, const char *db) { TABLE *schema_table= tables->table; TABLE *event_table= NULL; - Open_tables_state backup; int ret= 0; DBUG_ENTER("Event_db_repository::fill_schema_events"); DBUG_PRINT("info",("db=%s", db? db:"(null)")); - thd->reset_n_backup_open_tables_state(&backup); if (open_event_table(thd, TL_READ, &event_table)) - { - sql_print_error("Table mysql.event is damaged."); - thd->restore_backup_open_tables_state(&backup); - DBUG_RETURN(1); - } + DBUG_RETURN(TRUE); /* 1. SELECT I_S => use table scan. I_S.EVENTS does not guarantee order @@ -431,164 +424,101 @@ Event_db_repository::fill_schema_events(THD *thd, TABLE_LIST *tables, ret= table_scan_all_for_i_s(thd, schema_table, event_table); close_thread_tables(thd); - thd->restore_backup_open_tables_state(&backup); DBUG_PRINT("info", ("Return code=%d", ret)); DBUG_RETURN(ret); } -/* - Open mysql.event table for read +/** + Open mysql.event table for read. - SYNOPSIS - Events::open_event_table() - thd [in] Thread context - lock_type [in] How to lock the table - table [out] We will store the open table here + It's assumed that the caller knows what they are doing: + - whether it was necessary to reset-and-backup the open tables state + - whether the requested lock does not lead to a deadlock + - whether this open mode would work under LOCK TABLES, or inside a + stored function or trigger. - RETURN VALUE - 1 Cannot lock table - 2 The table is corrupted - different number of fields - 0 OK + @param[in] thd Thread context + @param[in] lock_type How to lock the table + @param[out] table We will store the open table here + + @retval TRUE open and lock failed - an error message is pushed into the + stack + @retval FALSE success */ -int +bool Event_db_repository::open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table) { TABLE_LIST tables; DBUG_ENTER("Event_db_repository::open_event_table"); - bzero((char*) &tables, sizeof(tables)); - tables.db= (char*) "mysql"; - tables.table_name= tables.alias= (char*) "event"; - tables.lock_type= lock_type; + tables.init_one_table("mysql", "event", lock_type); if (simple_open_n_lock_tables(thd, &tables)) - DBUG_RETURN(1); + DBUG_RETURN(TRUE); - if (table_check_intact(tables.table, ET_FIELD_COUNT, - event_table_fields, - &mysql_event_last_create_time, - ER_CANNOT_LOAD_FROM_TABLE)) - { - close_thread_tables(thd); - DBUG_RETURN(2); - } *table= tables.table; tables.table->use_all_columns(); - DBUG_RETURN(0); + DBUG_RETURN(FALSE); } -/* - Checks parameters which we got from the parsing phase. +/** + Creates an event record in mysql.event table. - SYNOPSIS - check_parse_params() - thd Thread context - parse_data Event's data + Creates an event. Relies on mysql_event_fill_row which is shared with + ::update_event. - RETURN VALUE - FALSE OK - TRUE Error (reported) -*/ + @pre All semantic checks must be performed outside. This function + only creates a record on disk. + @pre The thread handle has no open tables. -static int -check_parse_params(THD *thd, Event_parse_data *parse_data) -{ - DBUG_ENTER("check_parse_params"); + @param[in,out] THD + @param[in] parse_data Parsed event definition + @param[in] create_if_not TRUE if IF NOT EXISTS clause was provided + to CREATE EVENT statement - if (parse_data->check_parse_data(thd)) - DBUG_RETURN(EVEX_BAD_PARAMS); - - if (!parse_data->dbname.str || - (thd->lex->sql_command == SQLCOM_ALTER_EVENT && thd->lex->spname && - !thd->lex->spname->m_db.str)) - { - my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0)); - DBUG_RETURN(EVEX_BAD_PARAMS); - } - - if (check_access(thd, EVENT_ACL, parse_data->dbname.str, 0, 0, 0, - is_schema_db(parse_data->dbname.str)) || - (thd->lex->sql_command == SQLCOM_ALTER_EVENT && thd->lex->spname && - (check_access(thd, EVENT_ACL, thd->lex->spname->m_db.str, 0, 0, 0, - is_schema_db(thd->lex->spname->m_db.str))))) - DBUG_RETURN(EVEX_BAD_PARAMS); - - DBUG_RETURN(0); -} - - -/* - Creates an event in mysql.event - - SYNOPSIS - Event_db_repository::create_event() - thd [in] THD - parse_data [in] Object containing info about the event - create_if_not [in] Whether to generate anwarning in case event exists - - RETURN VALUE - 0 OK - EVEX_GENERAL_ERROR Failure - - DESCRIPTION - Creates an event. Relies on mysql_event_fill_row which is shared with - ::update_event. The name of the event is inside "et". + @retval FALSE success + @retval TRUE error */ bool Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, my_bool create_if_not) { - int ret= 0; + int ret= 1; TABLE *table= NULL; - char old_db_buf[NAME_LEN+1]; - LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) }; - bool dbchanged= FALSE; DBUG_ENTER("Event_db_repository::create_event"); - if (check_parse_params(thd, parse_data)) - goto err; - if (parse_data->do_not_create) - goto ok; - DBUG_PRINT("info", ("open mysql.event for update")); + if (open_event_table(thd, TL_WRITE, &table)) - { - my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0)); - goto err; - } + goto end; DBUG_PRINT("info", ("name: %.*s", parse_data->name.length, parse_data->name.str)); DBUG_PRINT("info", ("check existance of an event with the same name")); - if (!find_named_event(thd, parse_data->dbname, parse_data->name, table)) + if (!find_named_event(parse_data->dbname, parse_data->name, table)) { if (create_if_not) { push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_EVENT_ALREADY_EXISTS, ER(ER_EVENT_ALREADY_EXISTS), parse_data->name.str); - goto ok; + ret= 0; } - my_error(ER_EVENT_ALREADY_EXISTS, MYF(0), parse_data->name.str); - goto err; + else + my_error(ER_EVENT_ALREADY_EXISTS, MYF(0), parse_data->name.str); + goto end; } - DBUG_PRINT("info", ("non-existant, go forward")); - - if ((ret= sp_use_new_db(thd, parse_data->dbname, &old_db, 0, &dbchanged))) - { - my_error(ER_BAD_DB_ERROR, MYF(0)); - goto err; - } + DBUG_PRINT("info", ("non-existent, go forward")); restore_record(table, s->default_values); // Get default values for fields @@ -598,7 +528,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, table->field[ET_FIELD_DB]->char_length()) { my_error(ER_TOO_LONG_IDENT, MYF(0), parse_data->dbname.str); - goto err; + goto end; } if (system_charset_info->cset-> @@ -607,20 +537,13 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, table->field[ET_FIELD_NAME]->char_length()) { my_error(ER_TOO_LONG_IDENT, MYF(0), parse_data->name.str); - goto err; + goto end; } if (parse_data->body.length > table->field[ET_FIELD_BODY]->field_length) { my_error(ER_TOO_LONG_BODY, MYF(0), parse_data->name.str); - goto err; - } - - if (!(parse_data->expression) && !(parse_data->execute_at)) - { - DBUG_PRINT("error", ("neither expression nor execute_at are set!")); - my_error(ER_EVENT_NEITHER_M_EXPR_NOR_M_AT, MYF(0)); - goto err; + goto end; } ((Field_timestamp *)table->field[ET_FIELD_CREATED])->set_time(); @@ -629,93 +552,70 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, mysql_event_fill_row() calls my_error() in case of error so no need to handle it here */ - if ((ret= mysql_event_fill_row(thd, table, parse_data, FALSE))) - goto err; + if (mysql_event_fill_row(thd, table, parse_data, FALSE)) + goto end; - /* Close active transaction only if We are going to modify disk */ - if (end_active_trans(thd)) - goto err; - if (table->file->ha_write_row(table->record[0])) + if ((ret= table->file->ha_write_row(table->record[0]))) { - my_error(ER_EVENT_STORE_FAILED, MYF(0), parse_data->name.str, ret); - goto err; + table->file->print_error(ret, MYF(0)); + goto end; } + ret= 0; -ok: - if (dbchanged) - (void) mysql_change_db(thd, old_db.str, 1); - /* - This statement may cause a spooky valgrind warning at startup - inside init_key_cache on my system (ahristov, 2006/08/10) - */ - close_thread_tables(thd); - DBUG_RETURN(FALSE); - -err: - if (dbchanged) - (void) mysql_change_db(thd, old_db.str, 1); +end: if (table) close_thread_tables(thd); - DBUG_RETURN(TRUE); + DBUG_RETURN(test(ret)); } -/* +/** Used to execute ALTER EVENT. Pendant to Events::update_event(). - SYNOPSIS - Event_db_repository::update_event() - thd THD - sp_name the name of the event to alter - et event's data + @param[in,out] thd thread handle + @param[in] parse_data parsed event definition + @paran[in[ new_dbname not NULL if ALTER EVENT RENAME + points at a new database name + @param[in] new_name not NULL if ALTER EVENT RENAME + points at a new event name - RETURN VALUE - FALSE OK - TRUE Error (reported) + @pre All semantic checks are performed outside this function, + it only updates the event definition on disk. + @pre We don't have any tables open in the given thread. - NOTES - sp_name is passed since this is the name of the event to - alter in case of RENAME TO. + @retval FALSE success + @retval TRUE error (reported) */ bool Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data, - LEX_STRING *new_dbname, LEX_STRING *new_name) + LEX_STRING *new_dbname, + LEX_STRING *new_name) { CHARSET_INFO *scs= system_charset_info; TABLE *table= NULL; + int ret= 1; DBUG_ENTER("Event_db_repository::update_event"); - if (open_event_table(thd, TL_WRITE, &table)) - { - my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0)); - goto err; - } + /* None or both must be set */ + DBUG_ASSERT(new_dbname && new_name || new_dbname == new_name); - if (check_parse_params(thd, parse_data) || parse_data->do_not_create) - goto err; + if (open_event_table(thd, TL_WRITE, &table)) + goto end; DBUG_PRINT("info", ("dbname: %s", parse_data->dbname.str)); DBUG_PRINT("info", ("name: %s", parse_data->name.str)); DBUG_PRINT("info", ("user: %s", parse_data->definer.str)); - if (new_dbname) - DBUG_PRINT("info", ("rename to: %s@%s", new_dbname->str, new_name->str)); /* first look whether we overwrite */ if (new_name) { - if (!sortcmp_lex_string(parse_data->name, *new_name, scs) && - !sortcmp_lex_string(parse_data->dbname, *new_dbname, scs)) - { - my_error(ER_EVENT_SAME_NAME, MYF(0), parse_data->name.str); - goto err; - } - - if (!find_named_event(thd, *new_dbname, *new_name, table)) + DBUG_PRINT("info", ("rename to: %s@%s", new_dbname->str, new_name->str)); + if (!find_named_event(*new_dbname, *new_name, table)) { my_error(ER_EVENT_ALREADY_EXISTS, MYF(0), new_name->str); - goto err; + goto end; } } /* @@ -724,10 +624,10 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data, overwrite the key and SE will tell us that it cannot find the already found row (copied into record[1] later */ - if (find_named_event(thd, parse_data->dbname, parse_data->name, table)) + if (find_named_event(parse_data->dbname, parse_data->name, table)) { my_error(ER_EVENT_DOES_NOT_EXIST, MYF(0), parse_data->name.str); - goto err; + goto end; } store_record(table,record[1]); @@ -740,7 +640,7 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data, handle it here */ if (mysql_event_fill_row(thd, table, parse_data, TRUE)) - goto err; + goto end; if (new_dbname) { @@ -748,42 +648,32 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data, table->field[ET_FIELD_NAME]->store(new_name->str, new_name->length, scs); } - /* Close active transaction only if We are going to modify disk */ - if (end_active_trans(thd)) - goto err; - - int res; - if ((res= table->file->ha_update_row(table->record[1], table->record[0]))) + if ((ret= table->file->ha_update_row(table->record[1], table->record[0]))) { - my_error(ER_EVENT_STORE_FAILED, MYF(0), parse_data->name.str, res); - goto err; + table->file->print_error(ret, MYF(0)); + goto end; } + ret= 0; - /* close mysql.event or we crash later when loading the event from disk */ - close_thread_tables(thd); - DBUG_RETURN(FALSE); - -err: +end: if (table) close_thread_tables(thd); - DBUG_RETURN(TRUE); + DBUG_RETURN(test(ret)); } -/* - Drops an event +/** + Delete event record from mysql.event table. - SYNOPSIS - Event_db_repository::drop_event() - thd [in] THD - db [in] Database name - name [in] Event's name - drop_if_exists [in] If set and the event not existing => warning - onto the stack + @param[in,out] thd thread handle + @param[in] db Database name + @param[in] name Event name + @param[in] drop_if_exists DROP IF EXISTS clause was specified. + If set, and the event does not exist, + the error is downgraded to a warning. - RETURN VALUE - FALSE OK - TRUE Error (reported) + @retval FALSE success + @retval TRUE error (reported) */ bool @@ -791,66 +681,59 @@ Event_db_repository::drop_event(THD *thd, LEX_STRING db, LEX_STRING name, bool drop_if_exists) { TABLE *table= NULL; - Open_tables_state backup; - int ret; + int ret= 1; DBUG_ENTER("Event_db_repository::drop_event"); DBUG_PRINT("enter", ("%s@%s", db.str, name.str)); - thd->reset_n_backup_open_tables_state(&backup); - if ((ret= open_event_table(thd, TL_WRITE, &table))) + if (open_event_table(thd, TL_WRITE, &table)) + goto end; + + if (!find_named_event(db, name, table)) { - my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0)); - goto done; + if ((ret= table->file->ha_delete_row(table->record[0]))) + table->file->print_error(ret, MYF(0)); + goto end; } - if (!(ret= find_named_event(thd, db, name, table))) + /* Event not found */ + if (!drop_if_exists) { - /* Close active transaction only if we are actually going to modify disk */ - if (!(ret= end_active_trans(thd)) && - (ret= table->file->ha_delete_row(table->record[0]))) - my_error(ER_EVENT_CANNOT_DELETE, MYF(0)); - } - else - { - if (drop_if_exists) - { - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST), - "Event", name.str); - ret= 0; - } else - my_error(ER_EVENT_DOES_NOT_EXIST, MYF(0), name.str); + my_error(ER_EVENT_DOES_NOT_EXIST, MYF(0), name.str); + goto end; } -done: + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST), + "Event", name.str); + ret= 0; + +end: if (table) close_thread_tables(thd); - thd->restore_backup_open_tables_state(&backup); - DBUG_RETURN(ret); + DBUG_RETURN(test(ret)); } -/* +/** Positions the internal pointer of `table` to the place where (db, name) is stored. - SYNOPSIS - Event_db_repository::find_named_event() - thd Thread - db Schema - name Event name - table Opened mysql.event + In case search succeeded, the table cursor points at the found row. - RETURN VALUE - FALSE OK - TRUE No such event + @param[in] db database name + @param[in] name event name + @param[in,out] table mysql.event table + + + @retval FALSE an event with such db/name key exists + @reval TRUE no record found or an error occured. */ bool -Event_db_repository::find_named_event(THD *thd, LEX_STRING db, LEX_STRING name, - TABLE *table) +Event_db_repository::find_named_event(LEX_STRING db, LEX_STRING name, + TABLE *table) { byte key[MAX_KEY_LENGTH]; DBUG_ENTER("Event_db_repository::find_named_event"); @@ -902,15 +785,15 @@ Event_db_repository::drop_schema_events(THD *thd, LEX_STRING schema) } -/* - Drops all events by field which has specific value of the field +/** + Drops all events which have a specific value of a field. - SYNOPSIS - Event_db_repository::drop_events_by_field() - thd Thread - table mysql.event TABLE - field Which field of the row to use for matching - field_value The value that should match + @pre The thread handle has no open tables. + + @param[in,out] thd Thread + @param[in,out] table mysql.event TABLE + @param[in] field Which field of the row to use for matching + @param[in] field_value The value that should match */ void @@ -925,16 +808,7 @@ Event_db_repository::drop_events_by_field(THD *thd, DBUG_PRINT("enter", ("field=%d field_value=%s", field, field_value.str)); if (open_event_table(thd, TL_WRITE, &table)) - { - /* - Currently being used only for DROP DATABASE - In this case we don't need - error message since the OK packet has been sent. But for DROP USER we - could need it. - - my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0)); - */ DBUG_VOID_RETURN; - } /* only enabled events are in memory, so we go now and delete the rest */ init_read_record(&read_record_info, thd, table, NULL, 1, 0); @@ -942,14 +816,20 @@ Event_db_repository::drop_events_by_field(THD *thd, { char *et_field= get_field(thd->mem_root, table->field[field]); - LEX_STRING et_field_lex= { et_field, strlen(et_field) }; - DBUG_PRINT("info", ("Current event %s name=%s", et_field, - get_field(thd->mem_root, table->field[ET_FIELD_NAME]))); - - if (!sortcmp_lex_string(et_field_lex, field_value, system_charset_info)) + /* et_field may be NULL if the table is corrupted or out of memory */ + if (et_field) { - DBUG_PRINT("info", ("Dropping")); - ret= table->file->ha_delete_row(table->record[0]); + LEX_STRING et_field_lex= { et_field, strlen(et_field) }; + DBUG_PRINT("info", ("Current event %s name=%s", et_field, + get_field(thd->mem_root, + table->field[ET_FIELD_NAME]))); + + if (!sortcmp_lex_string(et_field_lex, field_value, system_charset_info)) + { + DBUG_PRINT("info", ("Dropping")); + if ((ret= table->file->ha_delete_row(table->record[0]))) + table->file->print_error(ret, MYF(0)); + } } } end_read_record(&read_record_info); @@ -959,20 +839,14 @@ Event_db_repository::drop_events_by_field(THD *thd, } -/* +/** Looks for a named event in mysql.event and then loads it from - the table, compiles and inserts it into the cache. + the table. - SYNOPSIS - Event_db_repository::load_named_event() - thd [in] Thread context - dbname [in] Event's db name - name [in] Event's name - etn [out] The loaded event + @pre The given thread does not have open tables. - RETURN VALUE - FALSE OK - TRUE Error (reported) + @retval FALSE success + @retval TRUE error */ bool @@ -980,26 +854,169 @@ Event_db_repository::load_named_event(THD *thd, LEX_STRING dbname, LEX_STRING name, Event_basic *etn) { TABLE *table= NULL; - int ret= 0; - Open_tables_state backup; + bool ret; DBUG_ENTER("Event_db_repository::load_named_event"); DBUG_PRINT("enter",("thd: 0x%lx name: %*s", (long) thd, name.length, name.str)); - thd->reset_n_backup_open_tables_state(&backup); + if (!(ret= open_event_table(thd, TL_READ, &table))) + { + if ((ret= find_named_event(dbname, name, table))) + my_error(ER_EVENT_DOES_NOT_EXIST, MYF(0), name.str); + else if ((ret= etn->load_from_row(thd, table))) + my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0), "event"); - if ((ret= open_event_table(thd, TL_READ, &table))) - my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0)); - else if ((ret= find_named_event(thd, dbname, name, table))) - my_error(ER_EVENT_DOES_NOT_EXIST, MYF(0), name.str); - else if ((ret= etn->load_from_row(thd, table))) - my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0), "event"); - - if (table) close_thread_tables(thd); + } - thd->restore_backup_open_tables_state(&backup); - /* In this case no memory was allocated so we don't need to clean */ DBUG_RETURN(ret); } + + +/** + Update the event record in mysql.event table with a changed status + and/or last execution time. + + @pre The thread handle does not have open tables. +*/ + +bool +Event_db_repository:: +update_timing_fields_for_event(THD *thd, + LEX_STRING event_db_name, + LEX_STRING event_name, + bool update_last_executed, + my_time_t last_executed, + bool update_status, + ulonglong status) +{ + TABLE *table= NULL; + Field **fields; + int ret= 1; + + DBUG_ENTER("Event_db_repository::update_timing_fields_for_event"); + + if (open_event_table(thd, TL_WRITE, &table)) + goto end; + + fields= table->field; + + if (find_named_event(event_db_name, event_name, table)) + goto end; + + store_record(table, record[1]); + /* Don't update create on row update. */ + table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; + + if (update_last_executed) + { + TIME time; + my_tz_UTC->gmt_sec_to_TIME(&time, last_executed); + + fields[ET_FIELD_LAST_EXECUTED]->set_notnull(); + fields[ET_FIELD_LAST_EXECUTED]->store_time(&time, + MYSQL_TIMESTAMP_DATETIME); + } + if (update_status) + { + fields[ET_FIELD_STATUS]->set_notnull(); + fields[ET_FIELD_STATUS]->store(status, TRUE); + } + + if ((ret= table->file->ha_update_row(table->record[1], table->record[0]))) + { + table->file->print_error(ret, MYF(0)); + goto end; + } + + ret= 0; + +end: + if (table) + close_thread_tables(thd); + + DBUG_RETURN(test(ret)); +} + + +/** + Open mysql.db, mysql.user and mysql.event and check whether: + - mysql.db exists and is up to date (or from a newer version of MySQL), + - mysql.user has column Event_priv at an expected position, + - mysql.event exists and is up to date (or from a newer version of + MySQL) + + This function is called only when the server is started. + @pre The passed in thread handle has no open tables. + + @retval FALSE OK + @retval TRUE Error, an error message is output to the error log. +*/ + +bool +Event_db_repository::check_system_tables(THD *thd) +{ + TABLE_LIST tables; + int ret= FALSE; + const unsigned int event_priv_column_position= 29; + + DBUG_ENTER("Event_db_repository::check_system_tables"); + DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); + + + /* Check mysql.db */ + tables.init_one_table("mysql", "db", TL_READ); + + if (simple_open_n_lock_tables(thd, &tables)) + { + ret= 1; + sql_print_error("Cannot open mysql.db"); + } + else + { + if (table_check_intact(tables.table, MYSQL_DB_FIELD_COUNT, + mysql_db_table_fields)) + ret= 1; + /* in case of an error, the message is printed inside table_check_intact */ + + close_thread_tables(thd); + } + /* Check mysql.user */ + tables.init_one_table("mysql", "user", TL_READ); + + if (simple_open_n_lock_tables(thd, &tables)) + { + ret= 1; + sql_print_error("Cannot open mysql.user"); + } + else + { + if (tables.table->s->fields < event_priv_column_position || + strncmp(tables.table->field[event_priv_column_position]->field_name, + STRING_WITH_LEN("Event_priv"))) + { + sql_print_error("mysql.user has no `Event_priv` column at position %d", + event_priv_column_position); + ret= 1; + } + close_thread_tables(thd); + } + /* Check mysql.event */ + tables.init_one_table("mysql", "event", TL_READ); + + if (simple_open_n_lock_tables(thd, &tables)) + { + ret= 1; + sql_print_error("Cannot open mysql.event"); + } + else + { + if (table_check_intact(tables.table, ET_FIELD_COUNT, event_table_fields)) + ret= 1; + /* in case of an error, the message is printed inside table_check_intact */ + close_thread_tables(thd); + } + + DBUG_RETURN(test(ret)); +} diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h index 7d609dba860..01de0be3afd 100644 --- a/sql/event_db_repository.h +++ b/sql/event_db_repository.h @@ -15,7 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define EVEX_OPEN_TABLE_FAILED -1 +/* + @file + This is a private header file of Events module. Please do not include it + directly. All public declarations of Events module should be stored in + events.h and event_data_objects.h. +*/ enum enum_events_table_field { @@ -69,17 +74,28 @@ public: drop_schema_events(THD *thd, LEX_STRING schema); bool - find_named_event(THD *thd, LEX_STRING db, LEX_STRING name, TABLE *table); + find_named_event(LEX_STRING db, LEX_STRING name, TABLE *table); bool load_named_event(THD *thd, LEX_STRING dbname, LEX_STRING name, Event_basic *et); - int + bool open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table); - int + bool fill_schema_events(THD *thd, TABLE_LIST *tables, const char *db); + bool + update_timing_fields_for_event(THD *thd, + LEX_STRING event_db_name, + LEX_STRING event_name, + bool update_last_executed, + my_time_t last_executed, + bool update_status, + ulonglong status); +public: + static bool + check_system_tables(THD *thd); private: void drop_events_by_field(THD *thd, enum enum_events_table_field field, @@ -91,9 +107,7 @@ private: bool table_scan_all_for_i_s(THD *thd, TABLE *schema_table, TABLE *event_table); - static bool - check_system_tables(THD *thd); - +private: /* Prevent use of these */ Event_db_repository(const Event_db_repository &); void operator=(Event_db_repository &); diff --git a/sql/event_queue.cc b/sql/event_queue.cc index f110bfdd1bf..2fe6e0b87e0 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -72,39 +72,21 @@ event_queue_element_compare_q(void *vptr, byte* a, byte *b) Event_queue::Event_queue() :mutex_last_unlocked_at_line(0), mutex_last_locked_at_line(0), mutex_last_attempted_lock_at_line(0), - mutex_queue_data_locked(FALSE), mutex_queue_data_attempting_lock(FALSE) + mutex_queue_data_locked(FALSE), + mutex_queue_data_attempting_lock(FALSE), + next_activation_at(0) { mutex_last_unlocked_in_func= mutex_last_locked_in_func= mutex_last_attempted_lock_in_func= ""; - next_activation_at= 0; -} - -/* - Inits mutexes. - - SYNOPSIS - Event_queue::init_mutexes() -*/ - -void -Event_queue::init_mutexes() -{ pthread_mutex_init(&LOCK_event_queue, MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_queue_state, NULL); } -/* - Destroys mutexes. - - SYNOPSIS - Event_queue::deinit_mutexes() -*/ - -void -Event_queue::deinit_mutexes() +Event_queue::~Event_queue() { + deinit_queue(); pthread_mutex_destroy(&LOCK_event_queue); pthread_cond_destroy(&COND_queue_state); } @@ -176,33 +158,47 @@ Event_queue::deinit_queue() /** Adds an event to the queue. - SYNOPSIS - Event_queue::create_event() - dbname The schema of the new event - name The name of the new event + Compute the next execution time for an event, and if it is still + active, add it to the queue. Otherwise delete it. + The object is left intact in case of an error. Otherwise + the queue container assumes ownership of it. + + @param[in] thd thread handle + @param[in] new_element a new element to add to the queue + @param[out] created set to TRUE if no error and the element is + added to the queue, FALSE otherwise + + @retval TRUE an error occured. The value of created is undefined, + the element was not deleted. + @retval FALSE success */ -void -Event_queue::create_event(THD *thd, Event_queue_element *new_element) +bool +Event_queue::create_event(THD *thd, Event_queue_element *new_element, + bool *created) { DBUG_ENTER("Event_queue::create_event"); DBUG_PRINT("enter", ("thd: 0x%lx et=%s.%s", (long) thd, new_element->dbname.str, new_element->name.str)); + /* Will do nothing if the event is disabled */ + new_element->compute_next_execution_time(); if (new_element->status == Event_queue_element::DISABLED) - delete new_element; - else { - new_element->compute_next_execution_time(); - DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element)); - - LOCK_QUEUE_DATA(); - queue_insert_safe(&queue, (byte *) new_element); - dbug_dump_queue(thd->query_start()); - pthread_cond_broadcast(&COND_queue_state); - UNLOCK_QUEUE_DATA(); + delete new_element; + *created= FALSE; + DBUG_RETURN(FALSE); } - DBUG_VOID_RETURN; + + DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element)); + + LOCK_QUEUE_DATA(); + *created= (queue_insert_safe(&queue, (byte *) new_element) == FALSE); + dbug_dump_queue(thd->query_start()); + pthread_cond_broadcast(&COND_queue_state); + UNLOCK_QUEUE_DATA(); + + DBUG_RETURN(!*created); } diff --git a/sql/event_queue.h b/sql/event_queue.h index 95f52b7b588..04bb8b93b06 100644 --- a/sql/event_queue.h +++ b/sql/event_queue.h @@ -25,23 +25,16 @@ class Event_queue { public: Event_queue(); - - void - init_mutexes(); - - void - deinit_mutexes(); + ~Event_queue(); bool init_queue(THD *thd); - void - deinit_queue(); - /* Methods for queue management follow */ - void - create_event(THD *thd, Event_queue_element *new_element); + bool + create_event(THD *thd, Event_queue_element *new_element, + bool *created); void update_event(THD *thd, LEX_STRING dbname, LEX_STRING name, @@ -64,9 +57,23 @@ public: void dump_internal_status(); +private: void empty_queue(); -protected: + + void + deinit_queue(); + /* helper functions for working with mutexes & conditionals */ + void + lock_data(const char *func, uint line); + + void + unlock_data(const char *func, uint line); + + void + cond_wait(THD *thd, struct timespec *abstime, const char* msg, + const char *func, uint line); + void find_n_remove_event(LEX_STRING db, LEX_STRING name); @@ -98,16 +105,6 @@ protected: bool mutex_queue_data_attempting_lock; bool waiting_on_cond; - /* helper functions for working with mutexes & conditionals */ - void - lock_data(const char *func, uint line); - - void - unlock_data(const char *func, uint line); - - void - cond_wait(THD *thd, struct timespec *abstime, const char* msg, - const char *func, uint line); }; #endif /* _EVENT_QUEUE_H_ */ diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index d50ea932596..a9a93cbc74b 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -37,7 +37,6 @@ extern pthread_attr_t connection_attrib; Event_db_repository *Event_worker_thread::db_repository; -Events *Event_worker_thread::events_facade; static @@ -80,11 +79,11 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et) prefix.length(0); prefix.append("Event Scheduler: ["); - append_identifier(thd, &prefix, et->definer.str, et->definer.length); + prefix.append(et->definer.str, et->definer.length, system_charset_info); prefix.append("][", 2); - append_identifier(thd,&prefix, et->dbname.str, et->dbname.length); + prefix.append(et->dbname.str, et->dbname.length, system_charset_info); prefix.append('.'); - append_identifier(thd,&prefix, et->name.str, et->name.length); + prefix.append(et->name.str, et->name.length, system_charset_info); prefix.append("] ", 2); List_iterator_fast it(thd->warn_list); @@ -95,7 +94,6 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et) err_msg.length(0); err_msg.append(prefix); err_msg.append(err->msg, strlen(err->msg), system_charset_info); - err_msg.append("]"); DBUG_ASSERT(err->level < 3); (sql_print_message_handlers[err->level])("%*s", err_msg.length(), err_msg.c_ptr()); @@ -239,7 +237,7 @@ event_scheduler_thread(void *arg) } -/* +/** Function that executes an event in a child thread. Setups the environment for the event execution and cleans after that. @@ -266,7 +264,7 @@ event_worker_thread(void *arg) } -/* +/** Function that executes an event in a child thread. Setups the environment for the event execution and cleans after that. @@ -315,17 +313,27 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event) print_warnings(thd, job_data); - sql_print_information("Event Scheduler: " - "[%s.%s of %s] executed in thread %lu. " - "RetCode=%d", job_data->dbname.str, job_data->name.str, - job_data->definer.str, thd->thread_id, ret); - if (ret == EVEX_COMPILE_ERROR) + switch (ret) { + case 0: sql_print_information("Event Scheduler: " - "COMPILE ERROR for event %s.%s of %s", + "[%s].[%s.%s] executed successfully in thread %lu.", + job_data->definer.str, job_data->dbname.str, job_data->name.str, - job_data->definer.str); - else if (ret == EVEX_MICROSECOND_UNSUP) - sql_print_information("Event Scheduler: MICROSECOND is not supported"); + thd->thread_id); + break; + case EVEX_COMPILE_ERROR: + sql_print_information("Event Scheduler: " + "[%s].[%s.%s] event compilation failed.", + job_data->definer.str, + job_data->dbname.str, job_data->name.str); + break; + default: + sql_print_information("Event Scheduler: " + "[%s].[%s.%s] event execution failed.", + job_data->definer.str, + job_data->dbname.str, job_data->name.str); + break; + } end: delete job_data; @@ -349,66 +357,34 @@ end: problem. However, this comes at the price of introduction bi-directional association between class Events and class Event_worker_thread. */ - events_facade->drop_event(thd, event->dbname, event->name, FALSE); + Events::drop_event(thd, event->dbname, event->name, FALSE); } DBUG_PRINT("info", ("Done with Event %s.%s", event->dbname.str, event->name.str)); delete event; deinit_event_thread(thd); - pthread_exit(0); + /* + Do not pthread_exit since we want local destructors for stack objects + to be invoked. + */ } -/* - Performs initialization of the scheduler data, outside of the - threading primitives. - - SYNOPSIS - Event_scheduler::init_scheduler() -*/ - -void -Event_scheduler::init_scheduler(Event_queue *q) -{ - LOCK_DATA(); - queue= q; - started_events= 0; - scheduler_thd= NULL; - state= INITIALIZED; - UNLOCK_DATA(); -} - - -void -Event_scheduler::deinit_scheduler() {} - - -/* - Inits scheduler's threading primitives. - - SYNOPSIS - Event_scheduler::init_mutexes() -*/ - -void -Event_scheduler::init_mutexes() +Event_scheduler::Event_scheduler(Event_queue *queue_arg) + :state(UNINITIALIZED), + scheduler_thd(NULL), + queue(queue_arg), + started_events(0) { pthread_mutex_init(&LOCK_scheduler_state, MY_MUTEX_INIT_FAST); pthread_cond_init(&COND_state, NULL); } -/* - Deinits scheduler's threading primitives. - - SYNOPSIS - Event_scheduler::deinit_mutexes() -*/ - -void -Event_scheduler::deinit_mutexes() +Event_scheduler::~Event_scheduler() { + stop(); /* does nothing if not running */ pthread_mutex_destroy(&LOCK_scheduler_state); pthread_cond_destroy(&COND_state); } @@ -639,6 +615,9 @@ Event_scheduler::is_running() Stops the scheduler (again). Waits for acknowledgement from the scheduler that it has stopped - synchronous stopping. + Already running events will not be stopped. If the user needs + them stopped manual intervention is needed. + SYNOPSIS Event_scheduler::stop() diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h index 74d53c4f63d..70635196745 100644 --- a/sql/event_scheduler.h +++ b/sql/event_scheduler.h @@ -15,7 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* +/** + @file This file is internal to Events module. Please do not include it directly. All public declarations of Events module are in events.h and event_data_objects.h. @@ -41,10 +42,9 @@ class Event_worker_thread { public: static void - init(Events *events, Event_db_repository *db_repo) + init(Event_db_repository *db_repository_arg) { - db_repository= db_repo; - events_facade= events; + db_repository= db_repository_arg; } void @@ -55,15 +55,15 @@ private: print_warnings(THD *thd, Event_job_data *et); static Event_db_repository *db_repository; - static Events *events_facade; }; class Event_scheduler { public: - Event_scheduler():state(UNINITIALIZED){} - ~Event_scheduler(){} + Event_scheduler(Event_queue *event_queue_arg); + ~Event_scheduler(); + /* State changing methods follow */ @@ -80,17 +80,6 @@ public: bool run(THD *thd); - void - init_scheduler(Event_queue *queue); - - void - deinit_scheduler(); - - void - init_mutexes(); - - void - deinit_mutexes(); /* Information retrieving methods follow */ bool diff --git a/sql/events.cc b/sql/events.cc index fd8160e103c..3182cea25f2 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -19,7 +19,6 @@ #include "event_db_repository.h" #include "event_queue.h" #include "event_scheduler.h" -#include "sp_head.h" /* TODO list : @@ -66,7 +65,7 @@ static const char *opt_event_scheduler_state_names[]= { "OFF", "ON", "0", "1", "DISABLED", NullS }; -TYPELIB Events::opt_typelib= +const TYPELIB Events::opt_typelib= { array_elements(opt_event_scheduler_state_names)-1, "", @@ -82,7 +81,7 @@ TYPELIB Events::opt_typelib= */ static const char *var_event_scheduler_state_names[]= { "OFF", "ON", NullS }; -TYPELIB Events::var_typelib= +const TYPELIB Events::var_typelib= { array_elements(var_event_scheduler_state_names)-1, "", @@ -90,20 +89,13 @@ TYPELIB Events::var_typelib= NULL }; - -static -Event_queue events_event_queue; - -static -Event_scheduler events_event_scheduler; - - -Event_db_repository events_event_db_repository; - -Events Events::singleton; - -enum Events::enum_opt_event_scheduler Events::opt_event_scheduler= - Events::EVENTS_OFF; +Event_queue *Events::event_queue; +Event_scheduler *Events::scheduler; +Event_db_repository *Events::db_repository; +enum Events::enum_opt_event_scheduler +Events::opt_event_scheduler= Events::EVENTS_OFF; +pthread_mutex_t Events::LOCK_event_metadata; +bool Events::check_system_tables_error= FALSE; /* @@ -128,25 +120,89 @@ int sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs) } -/* - Accessor for the singleton instance. +/** + @brief Initialize the start up option of the Events scheduler. - SYNOPSIS - Events::get_instance() + Do not initialize the scheduler subsystem yet - the initialization + is split into steps as it has to fit into the common MySQL + initialization framework. + No locking as this is called only at start up. - RETURN VALUE - address + @param[in,out] argument The value of the argument. If this value + is found in the typelib, the argument is + updated. + + @retval TRUE unknown option value + @retval FALSE success */ -Events * -Events::get_instance() +bool +Events::set_opt_event_scheduler(char *argument) { - DBUG_ENTER("Events::get_instance"); - DBUG_RETURN(&singleton); + if (argument == NULL) + opt_event_scheduler= Events::EVENTS_DISABLED; + else + { + int type; + /* + type= 1 2 3 4 5 + (OFF | ON) - (0 | 1) (DISABLE ) + */ + const static enum enum_opt_event_scheduler type2state[]= + { EVENTS_OFF, EVENTS_ON, EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED }; + + type= find_type(argument, &opt_typelib, 1); + + DBUG_ASSERT(type >= 0 && type <= 5); /* guaranteed by find_type */ + + if (type == 0) + { + fprintf(stderr, "Unknown option to event-scheduler: %s\n", argument); + return TRUE; + } + opt_event_scheduler= type2state[type-1]; + } + return FALSE; } -/* +/** + Return a string representation of the current scheduler mode. +*/ + +const char * +Events::get_opt_event_scheduler_str() +{ + const char *str; + + pthread_mutex_lock(&LOCK_event_metadata); + str= opt_typelib.type_names[(int) opt_event_scheduler]; + pthread_mutex_unlock(&LOCK_event_metadata); + + return str; +} + + +/** + Push an error into the error stack if the system tables are + not up to date. +*/ + +bool Events::check_if_system_tables_error() +{ + DBUG_ENTER("Events::check_if_system_tables_error"); + + if (check_system_tables_error) + { + my_error(ER_EVENTS_DB_ERROR, MYF(0)); + DBUG_RETURN(TRUE); + } + + DBUG_RETURN(FALSE); +} + + +/** Reconstructs interval expression from interval type and expression value that is in form of a value of the smalles entity: For @@ -278,56 +334,70 @@ common_1_lev_code: return 0; } -/* - Constructor of Events class. It's called when events.o - is loaded. Assigning addressed of static variables in this - object file. - SYNOPSIS - Events::Events() -*/ +/** + Create a new event. -Events::Events() -{ - scheduler= &events_event_scheduler; - event_queue= &events_event_queue; - db_repository= &events_event_db_repository; -} + @param[in,out] thd THD + @param[in] parse_data Event's data from parsing stage + @param[in] if_not_exists Whether IF NOT EXISTS was + specified + In case there is an event with the same name (db) and + IF NOT EXISTS is specified, an warning is put into the stack. + @sa Events::drop_event for the notes about locking, pre-locking + and Events DDL. - -/* - The function exported to the world for creating of events. - - SYNOPSIS - Events::create_event() - thd [in] THD - parse_data [in] Event's data from parsing stage - if_not_exists [in] Whether IF NOT EXISTS was specified in the DDL - - RETURN VALUE - FALSE OK - TRUE Error (Reported) - - NOTES - In case there is an event with the same name (db) and - IF NOT EXISTS is specified, an warning is put into the stack. + @retval FALSE OK + @retval TRUE Error (reported) */ bool -Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) +Events::create_event(THD *thd, Event_parse_data *parse_data, + bool if_not_exists) { int ret; DBUG_ENTER("Events::create_event"); - if (unlikely(check_system_tables_error)) + + /* + Let's commit the transaction first - MySQL manual specifies + that a DDL issues an implicit commit, and it doesn't say "successful + DDL", so that an implicit commit is a property of any successfully + parsed DDL statement. + */ + if (end_active_trans(thd)) + DBUG_RETURN(TRUE); + + if (check_if_system_tables_error()) + DBUG_RETURN(TRUE); + + /* + Perform semantic checks outside of Event_db_repository: + once CREATE EVENT is supported in prepared statements, the + checks will be moved to PREPARE phase. + */ + if (parse_data->check_parse_data(thd)) + DBUG_RETURN(TRUE); + + /* At create, one of them must be set */ + DBUG_ASSERT(parse_data->expression || parse_data->execute_at); + + if (check_access(thd, EVENT_ACL, parse_data->dbname.str, 0, 0, 0, + is_schema_db(parse_data->dbname.str))) + DBUG_RETURN(TRUE); + + if (check_db_dir_existence(parse_data->dbname.str)) { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); + my_error(ER_BAD_DB_ERROR, MYF(0)); DBUG_RETURN(TRUE); } + if (parse_data->do_not_create) + DBUG_RETURN(FALSE); + pthread_mutex_lock(&LOCK_event_metadata); + /* On error conditions my_error() is called so no need to handle here */ - if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists)) && - !parse_data->do_not_create) + if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists))) { Event_queue_element *new_element; @@ -337,11 +407,16 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) parse_data->name, new_element))) { - DBUG_ASSERT(ret == OP_LOAD_ERROR); + db_repository->drop_event(thd, parse_data->dbname, parse_data->name, + TRUE); delete new_element; } - else - event_queue->create_event(thd, new_element); + else if (event_queue) + { + /* TODO: do not ignore the out parameter and a possible OOM error! */ + bool created; + event_queue->create_event(thd, new_element, &created); + } } pthread_mutex_unlock(&LOCK_event_metadata); @@ -349,42 +424,85 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) } -/* - The function exported to the world for alteration of events. +/** + Alter an event. - SYNOPSIS - Events::update_event() - thd [in] THD - parse_data [in] Event's data from parsing stage - rename_to [in] Set in case of RENAME TO. + @param[in,out] thd THD + @param[in] parse_data Event's data from parsing stage + @param[in] new_dbname A new schema name for the event. Set in the case of + ALTER EVENT RENAME, otherwise is NULL. + @param[in] new_name A new name for the event. Set in the case of + ALTER EVENT RENAME - RETURN VALUE - FALSE OK - TRUE Error + Parameter 'et' contains data about dbname and event name. + Parameter 'new_name' is the new name of the event, if not null + this means that RENAME TO was specified in the query + @sa Events::drop_event for the locking notes. - NOTES - et contains data about dbname and event name. - new_name is the new name of the event, if not null this means - that RENAME TO was specified in the query + @retval FALSE OK + @retval TRUE error (reported) */ bool -Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) +Events::update_event(THD *thd, Event_parse_data *parse_data, + LEX_STRING *new_dbname, LEX_STRING *new_name) { int ret; Event_queue_element *new_element; + DBUG_ENTER("Events::update_event"); - LEX_STRING *new_dbname= rename_to ? &rename_to->m_db : NULL; - LEX_STRING *new_name= rename_to ? &rename_to->m_name : NULL; - if (unlikely(check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); + + /* + For consistency, implicit COMMIT should be the first thing in the + execution chain. + */ + if (end_active_trans(thd)) DBUG_RETURN(TRUE); + + if (check_if_system_tables_error()) + DBUG_RETURN(TRUE); + + if (parse_data->check_parse_data(thd) || parse_data->do_not_create) + DBUG_RETURN(TRUE); + + if (check_access(thd, EVENT_ACL, parse_data->dbname.str, 0, 0, 0, + is_schema_db(parse_data->dbname.str))) + DBUG_RETURN(TRUE); + + if (new_dbname) /* It's a rename */ + { + /* Check that the new and the old names differ. */ + if ( !sortcmp_lex_string(parse_data->dbname, *new_dbname, + system_charset_info) && + !sortcmp_lex_string(parse_data->name, *new_name, + system_charset_info)) + { + my_error(ER_EVENT_SAME_NAME, MYF(0), parse_data->name.str); + DBUG_RETURN(TRUE); + } + + /* + And the user has sufficient privileges to use the target database. + Do it before checking whether the database exists: we don't want + to tell the user that a database doesn't exist if they can not + access it. + */ + if (check_access(thd, EVENT_ACL, new_dbname->str, 0, 0, 0, + is_schema_db(new_dbname->str))) + DBUG_RETURN(TRUE); + + /* Check that the target database exists */ + if (check_db_dir_existence(new_dbname->str)) + { + my_error(ER_BAD_DB_ERROR, MYF(0)); + DBUG_RETURN(TRUE); + } } pthread_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ - if (!(ret= db_repository->update_event(thd, parse_data, new_dbname, new_name))) + if (!(ret= db_repository->update_event(thd, parse_data, + new_dbname, new_name))) { LEX_STRING dbname= new_dbname ? *new_dbname : parse_data->dbname; LEX_STRING name= new_name ? *new_name : parse_data->name; @@ -397,9 +515,17 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) DBUG_ASSERT(ret == OP_LOAD_ERROR); delete new_element; } - else + else if (event_queue) + { + /* + TODO: check if an update actually has inserted an entry + into the queue. + If not, and the element is ON COMPLETION NOT PRESERVE, delete + it right away. + */ event_queue->update_event(thd, parse_data->dbname, parse_data->name, new_element); + } } pthread_mutex_unlock(&LOCK_event_metadata); @@ -407,20 +533,28 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to) } -/* +/** Drops an event - SYNOPSIS - Events::drop_event() - thd [in] THD - dbname [in] Event's schema - name [in] Event's name - if_exists [in] When set and the event does not exist => - warning onto the stack + @param[in,out] thd THD + @param[in] dbname Event's schema + @param[in] name Event's name + @param[in] if_exists When this is set and the event does not exist + a warning is pushed into the warning stack. + Otherwise the operation produces an error. - RETURN VALUE - FALSE OK - TRUE Error (reported) + @note Similarly to DROP PROCEDURE, we do not allow DROP EVENT + under LOCK TABLES mode, unless table mysql.event is locked. To + ensure that, we do not reset & backup the open tables state in + this function - if in LOCK TABLES or pre-locking mode, this will + lead to an error 'Table mysql.event is not locked with LOCK + TABLES' unless it _is_ locked. In pre-locked mode there is + another barrier - DROP EVENT commits the current transaction, + and COMMIT/ROLLBACK is not allowed in stored functions and + triggers. + + @retval FALSE OK + @retval TRUE Error (reported) */ bool @@ -428,16 +562,35 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) { int ret; DBUG_ENTER("Events::drop_event"); - if (unlikely(check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); + + /* + In MySQL, DDL must always commit: since mysql.* tables are + non-transactional, we must modify them outside a transaction + to not break atomicity. + But the second and more important reason to commit here + regardless whether we're actually changing mysql.event table + or not is replication: end_active_trans syncs the binary log, + and unless we run DDL in it's own transaction it may simply + never appear on the slave in case the outside transaction + rolls back. + */ + if (end_active_trans(thd)) + DBUG_RETURN(TRUE); + + if (check_if_system_tables_error()) + DBUG_RETURN(TRUE); + + if (check_access(thd, EVENT_ACL, dbname.str, 0, 0, 0, + is_schema_db(dbname.str))) DBUG_RETURN(TRUE); - } pthread_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists))) - event_queue->drop_event(thd, dbname, name); + { + if (event_queue) + event_queue->drop_event(thd, dbname, name); + } pthread_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); } @@ -446,10 +599,12 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) /** Drops all events from a schema - SYNOPSIS - Events::drop_schema_events() - thd Thread - db ASCIIZ schema name + @note We allow to drop all events in a schema even if the + scheduler is disabled. This is to not produce any warnings + in case of DROP DATABASE and a disabled scheduler. + + @param[in,out] thd Thread + @param[in] db ASCIIZ schema name */ void @@ -459,14 +614,15 @@ Events::drop_schema_events(THD *thd, char *db) DBUG_ENTER("Events::drop_schema_events"); DBUG_PRINT("enter", ("dropping events from %s", db)); - if (unlikely(check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); - DBUG_VOID_RETURN; - } + + /* + sic: no check if the scheduler is disabled or system tables + are damaged, as intended. + */ pthread_mutex_lock(&LOCK_event_metadata); - event_queue->drop_schema_events(thd, db_lex); + if (event_queue) + event_queue->drop_schema_events(thd, db_lex); db_repository->drop_schema_events(thd, db_lex); pthread_mutex_unlock(&LOCK_event_metadata); @@ -474,115 +630,137 @@ Events::drop_schema_events(THD *thd, char *db) } -/* - SHOW CREATE EVENT +/** + A helper function to generate SHOW CREATE EVENT output from + a named event +*/ + +static bool +send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol) +{ + char show_str_buf[10 * STRING_BUFFER_USUAL_SIZE]; + String show_str(show_str_buf, sizeof(show_str_buf), system_charset_info); + List field_list; + LEX_STRING sql_mode; + const String *tz_name; + + DBUG_ENTER("send_show_create_event"); + + show_str.length(0); + if (et->get_create_event(thd, &show_str)) + DBUG_RETURN(TRUE); + + field_list.push_back(new Item_empty_string("Event", NAME_LEN)); + + if (sys_var_thd_sql_mode::symbolic_mode_representation(thd, et->sql_mode, + &sql_mode)) + DBUG_RETURN(TRUE); + + field_list.push_back(new Item_empty_string("sql_mode", sql_mode.length)); + + tz_name= et->time_zone->get_name(); + + field_list.push_back(new Item_empty_string("time_zone", + tz_name->length())); + + field_list.push_back(new Item_empty_string("Create Event", + show_str.length())); + + if (protocol->send_fields(&field_list, + Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) + DBUG_RETURN(TRUE); + + protocol->prepare_for_resend(); + + protocol->store(et->name.str, et->name.length, system_charset_info); + protocol->store(sql_mode.str, sql_mode.length, system_charset_info); + protocol->store(tz_name->ptr(), tz_name->length(), system_charset_info); + protocol->store(show_str.c_ptr(), show_str.length(), system_charset_info); + + if (protocol->write()) + DBUG_RETURN(TRUE); + + send_eof(thd); + + DBUG_RETURN(FALSE); +} + + +/** + Implement SHOW CREATE EVENT statement - SYNOPSIS - Events::show_create_event() thd Thread context spn The name of the event (db, name) - RETURN VALUE - FALSE OK - TRUE Error during writing to the wire + @retval FALSE OK + @retval TRUE error (reported) */ bool Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) { - CHARSET_INFO *scs= system_charset_info; - int ret; - Event_timed *et= new Event_timed(); + Open_tables_state open_tables_backup; + Event_timed et; + bool ret; DBUG_ENTER("Events::show_create_event"); DBUG_PRINT("enter", ("name: %s@%s", dbname.str, name.str)); - if (unlikely(check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); - DBUG_RETURN(TRUE); - } - ret= db_repository->load_named_event(thd, dbname, name, et); + if (check_if_system_tables_error()) + DBUG_RETURN(TRUE); + + if (check_access(thd, EVENT_ACL, dbname.str, 0, 0, 0, + is_schema_db(dbname.str))) + DBUG_RETURN(TRUE); + + /* + We would like to allow SHOW CREATE EVENT under LOCK TABLES and + in pre-locked mode. mysql.event table is marked as a system table. + This flag reduces the set of its participation scenarios in LOCK TABLES + operation, and therefore an out-of-bound open of this table + for reading like the one below (sic, only for reading) is + more or less deadlock-free. For additional information about when a + deadlock can occur please refer to the description of 'system table' + flag. + */ + thd->reset_n_backup_open_tables_state(&open_tables_backup); + ret= db_repository->load_named_event(thd, dbname, name, &et); + thd->restore_backup_open_tables_state(&open_tables_backup); if (!ret) - { - Protocol *protocol= thd->protocol; - char show_str_buf[10 * STRING_BUFFER_USUAL_SIZE]; - String show_str(show_str_buf, sizeof(show_str_buf), scs); - List field_list; - byte *sql_mode_str; - ulong sql_mode_len=0; + ret= send_show_create_event(thd, &et, thd->protocol); - show_str.length(0); - show_str.set_charset(system_charset_info); - - if (et->get_create_event(thd, &show_str)) - goto err; - - field_list.push_back(new Item_empty_string("Event", NAME_LEN)); - - sql_mode_str= - sys_var_thd_sql_mode::symbolic_mode_representation(thd, et->sql_mode, - &sql_mode_len); - - field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); - - const String *tz_name= et->time_zone->get_name(); - field_list.push_back(new Item_empty_string("time_zone", - tz_name->length())); - - field_list.push_back(new Item_empty_string("Create Event", - show_str.length())); - - if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | - Protocol::SEND_EOF)) - goto err; - - protocol->prepare_for_resend(); - protocol->store(et->name.str, et->name.length, scs); - - protocol->store((char*) sql_mode_str, sql_mode_len, scs); - - protocol->store((char*) tz_name->ptr(), tz_name->length(), scs); - - protocol->store(show_str.c_ptr(), show_str.length(), scs); - ret= protocol->write(); - send_eof(thd); - } - delete et; DBUG_RETURN(ret); -err: - delete et; - DBUG_RETURN(TRUE); } -/* - Proxy for Event_db_repository::fill_schema_events. - Callback for I_S from sql_show.cc +/** + Check access rights and fill INFORMATION_SCHEMA.events table. - SYNOPSIS - Events::fill_schema_events() - thd Thread context - tables The schema table + @param[in,out] thd Thread context + @param[in] table The temporary table to fill. cond Unused - RETURN VALUE - 0 OK - !0 Error + In MySQL INFORMATION_SCHEMA tables are temporary tables that are + created and filled on demand. In this function, we fill + INFORMATION_SCHEMA.events. It is a callback for I_S module, invoked from + sql_show.cc + + @return Has to be integer, as such is the requirement of the I_S API + @retval 0 success + @retval 1 an error, pushed into the error stack */ int Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */) { char *db= NULL; + int ret; + Open_tables_state open_tables_backup; DBUG_ENTER("Events::fill_schema_events"); - Events *myself= get_instance(); - if (unlikely(myself->check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); - DBUG_RETURN(TRUE); - } + + if (check_if_system_tables_error()) + DBUG_RETURN(1); /* If it's SHOW EVENTS then thd->lex->select_lex.db is guaranteed not to @@ -596,7 +774,17 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */) DBUG_RETURN(1); db= thd->lex->select_lex.db; } - DBUG_RETURN(myself->db_repository->fill_schema_events(thd, tables, db)); + /* + Reset and backup of the currently open tables in this thread + is a way to allow SELECTs from INFORMATION_SCHEMA.events under + LOCK TABLES and in pre-locked mode. See also + Events::show_create_event for additional comments. + */ + thd->reset_n_backup_open_tables_state(&open_tables_backup); + ret= db_repository->fill_schema_events(thd, tables, db); + thd->restore_backup_open_tables_state(&open_tables_backup); + + DBUG_RETURN(ret); } @@ -615,14 +803,17 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */) */ bool -Events::init() +Events::init(my_bool opt_noacl) { THD *thd; bool res= FALSE; + DBUG_ENTER("Events::init"); - if (opt_event_scheduler == Events::EVENTS_DISABLED) - DBUG_RETURN(FALSE); + /* Disable the scheduler if running with --skip-grant-tables */ + if (opt_noacl) + opt_event_scheduler= EVENTS_DISABLED; + /* We need a temporary THD during boot */ if (!(thd= new THD())) @@ -638,30 +829,67 @@ Events::init() thd->thread_stack= (char*) &thd; thd->store_globals(); - if (check_system_tables(thd)) + /* + We will need Event_db_repository anyway, even if the scheduler is + disabled - to perform events DDL. + */ + if (!(db_repository= new Event_db_repository)) { + res= TRUE; /* fatal error: request unireg_abort */ + goto end; + } + + /* + Since we allow event DDL even if the scheduler is disabled, + check the system tables, as we might need them. + */ + if (Event_db_repository::check_system_tables(thd)) + { + sql_print_error("Event Scheduler: An error occurred when initializing " + "system tables.%s", + opt_event_scheduler == EVENTS_DISABLED ? + "" : " Disabling the Event Scheduler."); + + /* Disable the scheduler since the system tables are not up to date */ + opt_event_scheduler= EVENTS_DISABLED; check_system_tables_error= TRUE; - sql_print_error("Event Scheduler: The system tables are damaged. " - "The scheduler subsystem will be unusable during this run."); - goto end; - } - check_system_tables_error= FALSE; - - if (event_queue->init_queue(thd) || load_events_from_db(thd)) - { - sql_print_error("Event Scheduler: Error while loading from disk."); goto end; } - scheduler->init_scheduler(event_queue); + /* + Was disabled explicitly from the command line, or because we're running + with --skip-grant-tables, or because we have no system tables. + */ + if (opt_event_scheduler == Events::EVENTS_DISABLED) + goto end; + DBUG_ASSERT(opt_event_scheduler == Events::EVENTS_ON || opt_event_scheduler == Events::EVENTS_OFF); - if (opt_event_scheduler == Events::EVENTS_ON) - res= scheduler->start(); - Event_worker_thread::init(this, db_repository); + if (!(event_queue= new Event_queue) || + !(scheduler= new Event_scheduler(event_queue))) + { + res= TRUE; /* fatal error: request unireg_abort */ + goto end; + } + + if (event_queue->init_queue(thd) || load_events_from_db(thd) || + opt_event_scheduler == EVENTS_ON && scheduler->start()) + { + sql_print_error("Event Scheduler: Error while loading from disk."); + res= TRUE; /* fatal error: request unireg_abort */ + goto end; + } + Event_worker_thread::init(db_repository); + end: + if (res) + { + delete db_repository; + delete event_queue; + delete scheduler; + } delete thd; /* Remember that we don't have a THD */ my_pthread_setspecific_ptr(THR_THD, NULL); @@ -684,14 +912,18 @@ void Events::deinit() { DBUG_ENTER("Events::deinit"); - if (likely(!check_system_tables_error)) - { - scheduler->stop(); - scheduler->deinit_scheduler(); - event_queue->deinit_queue(); + if (opt_event_scheduler != EVENTS_DISABLED) + { + delete scheduler; + scheduler= NULL; /* safety */ + delete event_queue; + event_queue= NULL; /* safety */ } + delete db_repository; + db_repository= NULL; /* safety */ + DBUG_VOID_RETURN; } @@ -708,8 +940,6 @@ void Events::init_mutexes() { pthread_mutex_init(&LOCK_event_metadata, MY_MUTEX_INIT_FAST); - event_queue->init_mutexes(); - scheduler->init_mutexes(); } @@ -723,8 +953,6 @@ Events::init_mutexes() void Events::destroy_mutexes() { - event_queue->deinit_mutexes(); - scheduler->deinit_mutexes(); pthread_mutex_destroy(&LOCK_event_metadata); } @@ -747,283 +975,163 @@ Events::dump_internal_status() puts("LLA = Last Locked At LUA = Last Unlocked At"); puts("WOC = Waiting On Condition DL = Data Locked"); - scheduler->dump_internal_status(); - event_queue->dump_internal_status(); + pthread_mutex_lock(&LOCK_event_metadata); + if (opt_event_scheduler == EVENTS_DISABLED) + puts("The Event Scheduler is disabled"); + else + { + scheduler->dump_internal_status(); + event_queue->dump_internal_status(); + } + pthread_mutex_unlock(&LOCK_event_metadata); DBUG_VOID_RETURN; } /** - Starts execution of events by the scheduler + Starts or stops the event scheduler thread. - SYNOPSIS - Events::start_execution_of_events() - - RETURN VALUE - FALSE OK - TRUE Error + @retval FALSE success + @retval TRUE error */ bool -Events::start_execution_of_events() +Events::start_or_stop_event_scheduler(enum_opt_event_scheduler start_or_stop) { - DBUG_ENTER("Events::start_execution_of_events"); - if (unlikely(check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); - DBUG_RETURN(TRUE); - } - DBUG_RETURN(scheduler->start()); -} - - -/* - Stops execution of events by the scheduler. - Already running events will not be stopped. If the user needs - them stopped manual intervention is needed. - - SYNOPSIS - Events::stop_execution_of_events() - - RETURN VALUE - FALSE OK - TRUE Error -*/ - -bool -Events::stop_execution_of_events() -{ - DBUG_ENTER("Events::stop_execution_of_events"); - if (unlikely(check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); - DBUG_RETURN(TRUE); - } - DBUG_RETURN(scheduler->stop()); -} - - -/* - Checks whether the scheduler is running or not. - - SYNOPSIS - Events::is_started() - - RETURN VALUE - TRUE Yes - FALSE No -*/ - -bool -Events::is_execution_of_events_started() -{ - DBUG_ENTER("Events::is_execution_of_events_started"); - if (unlikely(check_system_tables_error)) - { - my_error(ER_EVENTS_DB_ERROR, MYF(0)); - DBUG_RETURN(FALSE); - } - DBUG_RETURN(scheduler->is_running()); -} - - - -/* - Opens mysql.db and mysql.user and checks whether: - 1. mysql.db has column Event_priv at column 20 (0 based); - 2. mysql.user has column Event_priv at column 29 (0 based); - - SYNOPSIS - Events::check_system_tables() - thd Thread - - RETURN VALUE - FALSE OK - TRUE Error -*/ - -bool -Events::check_system_tables(THD *thd) -{ - TABLE_LIST tables; - Open_tables_state backup; bool ret= FALSE; - DBUG_ENTER("Events::check_system_tables"); - DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); + DBUG_ENTER("Events::start_or_stop_event_scheduler"); - thd->reset_n_backup_open_tables_state(&backup); + DBUG_ASSERT(start_or_stop == Events::EVENTS_ON || + start_or_stop == Events::EVENTS_OFF); - bzero((char*) &tables, sizeof(tables)); - tables.db= (char*) "mysql"; - tables.table_name= tables.alias= (char*) "db"; - tables.lock_type= TL_READ; + /* + If the scheduler was disabled because there are no/bad + system tables, produce a more meaningful error message + than ER_OPTION_PREVENTS_STATEMENT + */ + if (check_if_system_tables_error()) + DBUG_RETURN(TRUE); - if ((ret= simple_open_n_lock_tables(thd, &tables))) + pthread_mutex_lock(&LOCK_event_metadata); + + if (opt_event_scheduler == EVENTS_DISABLED) { - sql_print_error("Event Scheduler: Cannot open mysql.db"); + my_error(ER_OPTION_PREVENTS_STATEMENT, + MYF(0), "--event-scheduler=DISABLED or --skip-grant-tables"); ret= TRUE; + goto end; } - ret= table_check_intact(tables.table, MYSQL_DB_FIELD_COUNT, - mysql_db_table_fields, &mysql_db_table_last_check, - ER_CANNOT_LOAD_FROM_TABLE); - close_thread_tables(thd); - bzero((char*) &tables, sizeof(tables)); - tables.db= (char*) "mysql"; - tables.table_name= tables.alias= (char*) "user"; - tables.lock_type= TL_READ; - - if (simple_open_n_lock_tables(thd, &tables)) - { - sql_print_error("Event Scheduler: Cannot open mysql.user"); - ret= TRUE; - } + if (start_or_stop == EVENTS_ON) + ret= scheduler->start(); else + ret= scheduler->stop(); + + if (ret) { - if (tables.table->s->fields < 29 || - strncmp(tables.table->field[29]->field_name, - STRING_WITH_LEN("Event_priv"))) - { - sql_print_error("mysql.user has no `Event_priv` column at position %d", - 29); - ret= TRUE; - } - close_thread_tables(thd); + my_error(ER_EVENT_SET_VAR_ERROR, MYF(0)); + goto end; } - thd->restore_backup_open_tables_state(&backup); + opt_event_scheduler= start_or_stop; +end: + pthread_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); } -/* - Loads all ENABLED events from mysql.event into the prioritized - queue. Called during scheduler main thread initialization. Compiles - the events. Creates Event_queue_element instances for every ENABLED event - from mysql.event. +/** + Loads all ENABLED events from mysql.event into a prioritized + queue. - SYNOPSIS - Events::load_events_from_db() - thd Thread context. Used for memory allocation in some cases. + This function is called during the server start up. It reads + every event, computes the next execution time, and if the event + needs execution, adds it to a prioritized queue. Otherwise, if + ON COMPLETION DROP is specified, the event is automatically + removed from the table. - RETURN VALUE - 0 OK - !0 Error (EVEX_OPEN_TABLE_FAILED, EVEX_MICROSECOND_UNSUP, - EVEX_COMPILE_ERROR) - in all these cases mysql.event was - tampered. + @param[in,out] thd Thread context. Used for memory allocation in some cases. - NOTES - Reports the error to the console + @retval FALSE success + @retval TRUE error, the load is aborted + + @note Reports the error to the console */ -int +bool Events::load_events_from_db(THD *thd) { TABLE *table; READ_RECORD read_record_info; - int ret= -1; + bool ret= TRUE; uint count= 0; - bool clean_the_queue= TRUE; DBUG_ENTER("Events::load_events_from_db"); DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); - if ((ret= db_repository->open_event_table(thd, TL_READ, &table))) + if ((ret= db_repository->open_event_table(thd, TL_WRITE, &table))) { - sql_print_error("Event Scheduler: Table mysql.event is damaged. Can not open"); - DBUG_RETURN(EVEX_OPEN_TABLE_FAILED); + sql_print_error("Event Scheduler: Failed to open table mysql.event"); + DBUG_RETURN(TRUE); } - init_read_record(&read_record_info, thd, table ,NULL,1,0); + init_read_record(&read_record_info, thd, table, NULL, 0, 1); while (!(read_record_info.read_record(&read_record_info))) { Event_queue_element *et; + bool created; + bool drop_on_completion; + if (!(et= new Event_queue_element)) - { - DBUG_PRINT("info", ("Out of memory")); - break; - } + goto end; + DBUG_PRINT("info", ("Loading event from row.")); - if ((ret= et->load_from_row(thd, table))) + if (et->load_from_row(thd, table)) { sql_print_error("Event Scheduler: " "Error while reading from mysql.event. " "The table is probably corrupted"); - break; - } - if (et->status != Event_queue_element::ENABLED) - { - DBUG_PRINT("info",("%s is disabled",et->name.str)); - delete et; - continue; - } - - /* let's find when to be executed */ - if (et->compute_next_execution_time()) - { - sql_print_error("Event Scheduler: Error while computing execution time of %s.%s." - " Skipping", et->dbname.str, et->name.str); - continue; - } - - { - Event_job_data temp_job_data; - DBUG_PRINT("info", ("Event %s loaded from row. ", et->name.str)); - - temp_job_data.load_from_row(thd, table); - - /* - We load only on scheduler root just to check whether the body - compiles. - */ - switch (ret= temp_job_data.compile(thd, thd->mem_root)) { - case EVEX_MICROSECOND_UNSUP: - sql_print_error("Event Scheduler: mysql.event is tampered. MICROSECOND is not " - "supported but found in mysql.event"); - break; - case EVEX_COMPILE_ERROR: - sql_print_error("Event Scheduler: Error while compiling %s.%s. Aborting load", - et->dbname.str, et->name.str); - break; - default: - break; - } - thd->end_statement(); - thd->cleanup_after_query(); - } - if (ret) - { delete et; goto end; } + drop_on_completion= (et->on_completion == + Event_queue_element::ON_COMPLETION_DROP); - DBUG_PRINT("load_events_from_db", ("Adding 0x%lx to the exec list.", - (long) et)); - event_queue->create_event(thd, et); - count++; + + if (event_queue->create_event(thd, et, &created)) + { + /* Out of memory */ + delete et; + goto end; + } + if (created) + count++; + else if (drop_on_completion) + { + /* + If not created, a stale event - drop if immediately if + ON COMPLETION NOT PRESERVE + */ + int rc= table->file->ha_delete_row(table->record[0]); + if (rc) + { + table->file->print_error(rc, MYF(0)); + goto end; + } + } } - clean_the_queue= FALSE; + sql_print_information("Event Scheduler: Loaded %d event%s", + count, (count == 1) ? "" : "s"); + ret= FALSE; + end: end_read_record(&read_record_info); - if (clean_the_queue) - { - event_queue->empty_queue(); - ret= -1; - } - else - { - ret= 0; - sql_print_information("Event Scheduler: Loaded %d event%s", - count, (count == 1)?"":"s"); - } - close_thread_tables(thd); - DBUG_PRINT("info", ("Status code %d. Loaded %d event(s)", ret, count)); DBUG_RETURN(ret); } diff --git a/sql/events.h b/sql/events.h index f97a0c5f57e..db0e947ab6c 100644 --- a/sql/events.h +++ b/sql/events.h @@ -15,7 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -class sp_name; +/* + @file + A public interface of Events Scheduler module. +*/ + class Event_parse_data; class Event_db_repository; class Event_queue; @@ -40,6 +44,22 @@ sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs); /** @class Events -- a facade to the functionality of the Event Scheduler. + Every public operation against the scheduler has to be executed via the + interface provided by a static method of this class. No instance of this + class is ever created and it has no non-static data members. + + The life cycle of the Events module is the following: + + At server start up: + set_opt_event_scheduler() -> init_mutexes() -> init() + When the server is running: + create_event(), drop_event(), start_or_stop_event_scheduler(), etc + At shutdown: + deinit(), destroy_mutexes(). + + The peculiar initialization and shutdown cycle is an adaptation to the + outside server startup/shutdown framework and mimics the rest of MySQL + subsystems (ACL, time zone tables, etc). */ class Events @@ -53,47 +73,48 @@ public: EVENTS_DISABLED= 4 }; - static enum_opt_event_scheduler opt_event_scheduler; - static TYPELIB opt_typelib; - static TYPELIB var_typelib; + /* Possible values of @@event_scheduler variable */ + static const TYPELIB var_typelib; - bool - init(); + static bool + set_opt_event_scheduler(char *argument); - void + static const char * + get_opt_event_scheduler_str(); + + /* A hack needed for Event_queue_element */ + static Event_db_repository * + get_db_repository() { return db_repository; } + + static bool + init(my_bool opt_noacl); + + static void deinit(); - void + static void init_mutexes(); - void + static void destroy_mutexes(); - bool - start_execution_of_events(); + static bool + start_or_stop_event_scheduler(enum enum_opt_event_scheduler start_or_stop); - bool - stop_execution_of_events(); - - bool - is_execution_of_events_started(); - - static Events * - get_instance(); - - bool + static bool create_event(THD *thd, Event_parse_data *parse_data, bool if_exists); - bool - update_event(THD *thd, Event_parse_data *parse_data, sp_name *rename_to); + static bool + update_event(THD *thd, Event_parse_data *parse_data, + LEX_STRING *new_dbname, LEX_STRING *new_name); - bool + static bool drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists); - void + static void drop_schema_events(THD *thd, char *db); - bool + static bool show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name); /* Needed for both SHOW CREATE EVENT and INFORMATION_SCHEMA */ @@ -104,31 +125,28 @@ public: static int fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */); - void + static void dump_internal_status(); private: - bool - check_system_tables(THD *thd); + static bool check_if_system_tables_error(); - int + static bool load_events_from_db(THD *thd); - /* Singleton DP is used */ - Events(); - ~Events(){} - - /* Singleton instance */ - static Events singleton; - - Event_queue *event_queue; - Event_scheduler *scheduler; - Event_db_repository *db_repository; - - pthread_mutex_t LOCK_event_metadata; - - bool check_system_tables_error; +private: + /* Command line option names */ + static const TYPELIB opt_typelib; + static pthread_mutex_t LOCK_event_metadata; + static Event_queue *event_queue; + static Event_scheduler *scheduler; + static Event_db_repository *db_repository; + /* Current state of Event Scheduler */ + static enum enum_opt_event_scheduler opt_event_scheduler; + /* Set to TRUE if an error at start up */ + static bool check_system_tables_error; +private: /* Prevent use of these */ Events(const Events &); void operator=(Events &); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a0687929de5..6364eed5c57 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -890,7 +890,7 @@ static void close_connections(void) } (void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list - Events::get_instance()->deinit(); + Events::deinit(); end_slave(); if (thread_count) @@ -1335,7 +1335,7 @@ static void clean_up_mutexes() (void) pthread_mutex_destroy(&LOCK_bytes_sent); (void) pthread_mutex_destroy(&LOCK_bytes_received); (void) pthread_mutex_destroy(&LOCK_user_conn); - Events::get_instance()->destroy_mutexes(); + Events::destroy_mutexes(); #ifdef HAVE_OPENSSL (void) pthread_mutex_destroy(&LOCK_des_key_file); #ifndef HAVE_YASSL @@ -3062,7 +3062,7 @@ static int init_thread_environment() (void) pthread_mutex_init(&LOCK_server_started, MY_MUTEX_INIT_FAST); (void) pthread_cond_init(&COND_server_started,NULL); sp_cache_init(); - Events::get_instance()->init_mutexes(); + Events::init_mutexes(); /* Parameter for threads created for connections */ (void) pthread_attr_init(&connection_attrib); (void) pthread_attr_setdetachstate(&connection_attrib, @@ -3841,21 +3841,15 @@ we force server id to 2, but this MySQL server will not act as a slave."); create_shutdown_thread(); create_maintenance_thread(); + if (Events::init(opt_noacl)) + unireg_abort(1); + sql_print_information(ER(ER_STARTUP),my_progname,server_version, ((unix_sock == INVALID_SOCKET) ? (char*) "" : mysqld_unix_port), mysqld_port, MYSQL_COMPILATION_COMMENT); - if (!opt_noacl) - { - if (Events::get_instance()->init()) - unireg_abort(1); - } - else - { - Events::opt_event_scheduler = Events::EVENTS_DISABLED; - } /* Signal threads waiting for server to be started */ pthread_mutex_lock(&LOCK_server_started); @@ -7568,32 +7562,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } #endif case OPT_EVENT_SCHEDULER: - if (!argument) - Events::opt_event_scheduler= Events::EVENTS_DISABLED; - else - { - int type; - /* - type= 5 1 2 3 4 - (DISABLE ) - (OFF | ON) - (0 | 1) - */ - switch ((type=find_type(argument, &Events::opt_typelib, 1))) { - case 0: - fprintf(stderr, "Unknown option to event-scheduler: %s\n",argument); - exit(1); - case 5: /* OPT_DISABLED */ - Events::opt_event_scheduler= Events::EVENTS_DISABLED; - break; - case 2: /* OPT_ON */ - case 4: /* 1 */ - Events::opt_event_scheduler= Events::EVENTS_ON; - break; - case 1: /* OPT_OFF */ - case 3: /* 0 */ - Events::opt_event_scheduler= Events::EVENTS_OFF; - break; - } - } + if (Events::set_opt_event_scheduler(argument)) + exit(1); break; case (int) OPT_SKIP_NEW: opt_specialflag|= SPECIAL_NO_NEW_FUNC; diff --git a/sql/set_var.cc b/sql/set_var.cc index fef6fccfd06..d5bf9ca4bc8 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1683,7 +1683,7 @@ byte *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type, } -bool sys_var::check_enum(THD *thd, set_var *var, TYPELIB *enum_names) +bool sys_var::check_enum(THD *thd, set_var *var, const TYPELIB *enum_names) { char buff[STRING_BUFFER_USUAL_SIZE]; const char *value; @@ -3640,21 +3640,18 @@ bool sys_var_thd_table_type::update(THD *thd, set_var *var) SYNOPSIS thd in thread handler val in sql_mode value - len out pointer on length of string - - RETURN - pointer to string with sql_mode representation + rep out pointer pointer to string with sql_mode representation */ -byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, - ulonglong val, - ulong *len) +bool +sys_var_thd_sql_mode:: +symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep) { - char buff[256]; + char buff[STRING_BUFFER_USUAL_SIZE*8]; String tmp(buff, sizeof(buff), &my_charset_latin1); - ulong length; tmp.length(0); + for (uint i= 0; val; val>>= 1, i++) { if (val & 1) @@ -3665,20 +3662,25 @@ byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, } } - if ((length= tmp.length())) - length--; - *len= length; - return (byte*) thd->strmake(tmp.ptr(), length); + if (tmp.length()) + tmp.length(tmp.length() - 1); /* trim the trailing comma */ + + rep->str= thd->strmake(tmp.ptr(), tmp.length()); + + rep->length= rep->str ? tmp.length() : 0; + + return rep->length != tmp.length(); } byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { + LEX_STRING sql_mode; ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : thd->variables.*offset); - ulong length_unused; - return symbolic_mode_representation(thd, val, &length_unused); + (void) symbolic_mode_representation(thd, val, &sql_mode); + return sql_mode.str; } @@ -4009,24 +4011,13 @@ sys_var_event_scheduler::update(THD *thd, set_var *var) int res; /* here start the thread if not running. */ DBUG_ENTER("sys_var_event_scheduler::update"); - if (Events::opt_event_scheduler == Events::EVENTS_DISABLED) - { - my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--event-scheduler=DISABLED or --skip-grant-tables"); - DBUG_RETURN(TRUE); - } - DBUG_PRINT("info", ("new_value: %d", (int) var->save_result.ulong_value)); - if (var->save_result.ulong_value == Events::EVENTS_ON) - res= Events::get_instance()->start_execution_of_events(); - else if (var->save_result.ulong_value == Events::EVENTS_OFF) - res= Events::get_instance()->stop_execution_of_events(); - else - { - assert(0); // Impossible - } - if (res) - my_error(ER_EVENT_SET_VAR_ERROR, MYF(0)); + enum Events::enum_opt_event_scheduler + new_state= + (enum Events::enum_opt_event_scheduler) var->save_result.ulong_value; + + res= Events::start_or_stop_event_scheduler(new_state); DBUG_RETURN((bool) res); } @@ -4035,15 +4026,7 @@ sys_var_event_scheduler::update(THD *thd, set_var *var) byte *sys_var_event_scheduler::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { - int state; - if (Events::opt_event_scheduler == Events::EVENTS_DISABLED) - state= Events::EVENTS_DISABLED; // This should be DISABLED - else if (Events::get_instance()->is_execution_of_events_started()) - state= Events::EVENTS_ON; // This should be ON - else - state= Events::EVENTS_OFF; // This should be OFF - - return (byte*) Events::opt_typelib.type_names[state]; + return (byte *) Events::get_opt_event_scheduler_str(); } diff --git a/sql/set_var.h b/sql/set_var.h index 8887d91ec69..e4284c374bb 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -61,7 +61,7 @@ public: sys_vars++; } virtual bool check(THD *thd, set_var *var); - bool check_enum(THD *thd, set_var *var, TYPELIB *enum_names); + bool check_enum(THD *thd, set_var *var, const TYPELIB *enum_names); bool check_set(THD *thd, set_var *var, TYPELIB *enum_names); virtual bool update(THD *thd, set_var *var)=0; virtual void set_default(THD *thd_arg, enum_var_type type) {} @@ -440,8 +440,8 @@ public: } void set_default(THD *thd, enum_var_type type); byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); - static byte *symbolic_mode_representation(THD *thd, ulonglong sql_mode, - ulong *length); + static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode, + LEX_STRING *rep); }; diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 0a40f2b9ed1..d0d20a9e232 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5884,8 +5884,8 @@ ER_COL_COUNT_DOESNT_MATCH_CORRUPTED eng "Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted" ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d gefunden. Tabelle ist wahrscheinlich beschädigt" ER_CANNOT_LOAD_FROM_TABLE - eng "Cannot load from mysql.%s. The table is probably corrupted. Please see the error log for details" - ger "Kann mysql.%s nicht einlesen. Tabelle ist wahrscheinlich beschädigt, siehe Fehlerlog" + eng "Cannot load from mysql.%s. The table is probably corrupted" + ger "Kann mysql.%s nicht einlesen. Tabelle ist wahrscheinlich beschädigt" ER_EVENT_CANNOT_DELETE eng "Failed to delete the event from mysql.event" ger "Löschen des Events aus mysql.event fehlgeschlagen" diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 8eeec741dcf..9bedc6fb38e 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2104,8 +2104,7 @@ sp_head::show_create_procedure(THD *thd) String buffer(buff, sizeof(buff), system_charset_info); int res; List field_list; - byte *sql_mode_str; - ulong sql_mode_len; + LEX_STRING sql_mode; bool full_access; DBUG_ENTER("sp_head::show_create_procedure"); DBUG_PRINT("info", ("procedure %s", m_name.str)); @@ -2116,12 +2115,10 @@ sp_head::show_create_procedure(THD *thd) if (check_show_routine_access(thd, this, &full_access)) DBUG_RETURN(1); - sql_mode_str= - sys_var_thd_sql_mode::symbolic_mode_representation(thd, - m_sql_mode, - &sql_mode_len); + sys_var_thd_sql_mode::symbolic_mode_representation(thd, m_sql_mode, + &sql_mode); field_list.push_back(new Item_empty_string("Procedure", NAME_LEN)); - field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); + field_list.push_back(new Item_empty_string("sql_mode", sql_mode.length)); // 1024 is for not to confuse old clients Item_empty_string *definition= new Item_empty_string("Create Procedure", max(buffer.length(),1024)); @@ -2133,7 +2130,7 @@ sp_head::show_create_procedure(THD *thd) DBUG_RETURN(1); protocol->prepare_for_resend(); protocol->store(m_name.str, m_name.length, system_charset_info); - protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info); + protocol->store((char*) sql_mode.str, sql_mode.length, system_charset_info); if (full_access) protocol->store(m_defstr.str, m_defstr.length, system_charset_info); else @@ -2176,23 +2173,18 @@ sp_head::show_create_function(THD *thd) String buffer(buff, sizeof(buff), system_charset_info); int res; List field_list; - byte *sql_mode_str; - ulong sql_mode_len; + LEX_STRING sql_mode; bool full_access; DBUG_ENTER("sp_head::show_create_function"); DBUG_PRINT("info", ("procedure %s", m_name.str)); - LINT_INIT(sql_mode_str); - LINT_INIT(sql_mode_len); if (check_show_routine_access(thd, this, &full_access)) DBUG_RETURN(1); - sql_mode_str= - sys_var_thd_sql_mode::symbolic_mode_representation(thd, - m_sql_mode, - &sql_mode_len); + sys_var_thd_sql_mode::symbolic_mode_representation(thd, m_sql_mode, + &sql_mode); field_list.push_back(new Item_empty_string("Function",NAME_LEN)); - field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); + field_list.push_back(new Item_empty_string("sql_mode", sql_mode.length)); Item_empty_string *definition= new Item_empty_string("Create Function", max(buffer.length(),1024)); definition->maybe_null= TRUE; @@ -2203,7 +2195,7 @@ sp_head::show_create_function(THD *thd) DBUG_RETURN(1); protocol->prepare_for_resend(); protocol->store(m_name.str, m_name.length, system_charset_info); - protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info); + protocol->store(sql_mode.str, sql_mode.length, system_charset_info); if (full_access) protocol->store(m_defstr.str, m_defstr.length, system_charset_info); else diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 4fd35b7e6e8..cc9dc4c1fec 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -953,7 +953,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) exit: (void)sp_drop_db_routines(thd, db); /* QQ Ignore errors for now */ - Events::get_instance()->drop_schema_events(thd, db); + Events::drop_schema_events(thd, db); /* If this database was the client's selected database, we silently change the client's selected database to nothing (to have an empty diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7720f293b10..23ec0fd0128 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -26,7 +26,6 @@ #include "sp.h" #include "sp_cache.h" #include "events.h" -#include "event_data_objects.h" #include "sql_trigger.h" /* Used in error handling only */ @@ -3151,13 +3150,16 @@ end_with_restore_list: switch (lex->sql_command) { case SQLCOM_CREATE_EVENT: - res= Events::get_instance()-> - create_event(thd, lex->event_parse_data, - lex->create_info.options & HA_LEX_CREATE_IF_NOT_EXISTS); + { + bool if_not_exists= (lex->create_info.options & + HA_LEX_CREATE_IF_NOT_EXISTS); + res= Events::create_event(thd, lex->event_parse_data, if_not_exists); break; + } case SQLCOM_ALTER_EVENT: - res= Events::get_instance()->update_event(thd, lex->event_parse_data, - lex->spname); + res= Events::update_event(thd, lex->event_parse_data, + lex->spname ? &lex->spname->m_db : NULL, + lex->spname ? &lex->spname->m_name : NULL); break; default: DBUG_ASSERT(0); @@ -3175,39 +3177,16 @@ end_with_restore_list: } /* lex->unit.cleanup() is called outside, no need to call it here */ break; - case SQLCOM_DROP_EVENT: case SQLCOM_SHOW_CREATE_EVENT: - { - DBUG_ASSERT(lex->spname); - if (! lex->spname->m_db.str) - { - my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0)); - goto error; - } - if (check_access(thd, EVENT_ACL, lex->spname->m_db.str, 0, 0, 0, - is_schema_db(lex->spname->m_db.str))) - break; - - if (lex->spname->m_name.length > NAME_LEN) - { - my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str); - /* this jumps to the end of the function and skips own messaging */ - goto error; - } - - if (lex->sql_command == SQLCOM_SHOW_CREATE_EVENT) - res= Events::get_instance()->show_create_event(thd, lex->spname->m_db, - lex->spname->m_name); - else - { - if (!(res= Events::get_instance()->drop_event(thd, - lex->spname->m_db, - lex->spname->m_name, - lex->drop_if_exists))) - send_ok(thd); - } + res= Events::show_create_event(thd, lex->spname->m_db, + lex->spname->m_name); + break; + case SQLCOM_DROP_EVENT: + if (!(res= Events::drop_event(thd, + lex->spname->m_db, lex->spname->m_name, + lex->drop_if_exists))) + send_ok(thd); break; - } case SQLCOM_CREATE_FUNCTION: // UDF function { if (check_access(thd,INSERT_ACL,"mysql",0,1,0,0)) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ea9b835df4d..613222fcd6e 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3760,8 +3760,7 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db, LEX_STRING *definer_buffer) { CHARSET_INFO *cs= system_charset_info; - byte *sql_mode_str; - ulong sql_mode_len; + LEX_STRING sql_mode_rep; restore_record(table, s->default_values); table->field[1]->store(db, strlen(db), cs); @@ -3777,11 +3776,9 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db, table->field[14]->store(STRING_WITH_LEN("OLD"), cs); table->field[15]->store(STRING_WITH_LEN("NEW"), cs); - sql_mode_str= - sys_var_thd_sql_mode::symbolic_mode_representation(thd, - sql_mode, - &sql_mode_len); - table->field[17]->store((const char*)sql_mode_str, sql_mode_len, cs); + sys_var_thd_sql_mode::symbolic_mode_representation(thd, sql_mode, + &sql_mode_rep); + table->field[17]->store(sql_mode_rep.str, sql_mode_rep.length, cs); table->field[18]->store((const char *)definer_buffer->str, definer_buffer->length, cs); return schema_table_store_record(thd, table); } @@ -4307,13 +4304,13 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) CHARSET_INFO *scs= system_charset_info; TIME time; Event_timed et; - DBUG_ENTER("fill_events_copy_to_schema_tab"); + DBUG_ENTER("copy_event_to_schema_table"); restore_record(sch_table, s->default_values); if (et.load_from_row(thd, event_table)) { - my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0)); + my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0), event_table->alias); DBUG_RETURN(1); } @@ -4348,13 +4345,11 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) /* SQL_MODE */ { - byte *sql_mode_str; - ulong sql_mode_len= 0; - sql_mode_str= - sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode, - &sql_mode_len); + LEX_STRING sql_mode; + sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode, + &sql_mode); sch_table->field[ISE_SQL_MODE]-> - store((const char*)sql_mode_str, sql_mode_len, scs); + store(sql_mode.str, sql_mode.length, scs); } int not_used=0; diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 9e30cf5878c..d7573b42c5f 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -537,6 +537,6 @@ Estimated memory (with thread stack): %ld\n", (long) (thread_count * thread_stack + info.hblkhd + info.arena)); #endif - Events::get_instance()->dump_internal_status(); + Events::dump_internal_status(); puts(""); } diff --git a/sql/table.cc b/sql/table.cc index 71e510bf0ac..5e901318919 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -250,7 +250,7 @@ void free_table_share(TABLE_SHARE *share) Currently these are: help_category, help_keyword, help_relation, help_topic, - proc, + proc, event time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type @@ -283,7 +283,14 @@ inline bool is_system_table_name(const char *name, uint length) my_tolower(ci, name[0]) == 't' && my_tolower(ci, name[1]) == 'i' && my_tolower(ci, name[2]) == 'm' && - my_tolower(ci, name[3]) == 'e' + my_tolower(ci, name[3]) == 'e' || + + /* mysql.event table */ + my_tolower(ci, name[0]) == 'e' && + my_tolower(ci, name[1]) == 'v' && + my_tolower(ci, name[2]) == 'e' && + my_tolower(ci, name[3]) == 'n' && + my_tolower(ci, name[4]) == 't' ) ); } @@ -2432,153 +2439,143 @@ bool check_column_name(const char *name) } -/* +/** Checks whether a table is intact. Should be done *just* after the table has been opened. - - SYNOPSIS - table_check_intact() - table The table to check - table_f_count Expected number of columns in the table - table_def Expected structure of the table (column name and type) - last_create_time The table->file->create_time of the table in memory - we have checked last time - error_num ER_XXXX from the error messages file. When 0 no error - is sent to the client in case types does not match. - If different col number either - ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE or - ER_COL_COUNT_DOESNT_MATCH_CORRUPTED is used - RETURNS - FALSE OK - TRUE There was an error + @param[in] table The table to check + @param[in] table_f_count Expected number of columns in the table + @param[in] table_def Expected structure of the table (column name + and type) + + @retval FALSE OK + @retval TRUE There was an error. An error message is output + to the error log. We do not push an error + message into the error stack because this + function is currently only called at start up, + and such errors never reach the user. */ my_bool table_check_intact(TABLE *table, const uint table_f_count, - const TABLE_FIELD_W_TYPE *table_def, - time_t *last_create_time, int error_num) + const TABLE_FIELD_W_TYPE *table_def) { uint i; my_bool error= FALSE; my_bool fields_diff_count; DBUG_ENTER("table_check_intact"); - DBUG_PRINT("info",("table: %s expected_count: %d last_create_time: %ld", - table->alias, table_f_count, *last_create_time)); - - if ((fields_diff_count= (table->s->fields != table_f_count)) || - (*last_create_time != table->file->stats.create_time)) - { - DBUG_PRINT("info", ("I am suspecting, checking table")); - if (fields_diff_count) - { - /* previous MySQL version */ - error= TRUE; - if (MYSQL_VERSION_ID > table->s->mysql_version) - { - my_error(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE, MYF(0), table->alias, - table_f_count, table->s->fields, table->s->mysql_version, - MYSQL_VERSION_ID); - sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE), - table->alias, table_f_count, table->s->fields, - table->s->mysql_version, MYSQL_VERSION_ID); - DBUG_RETURN(error); + DBUG_PRINT("info",("table: %s expected_count: %d", + table->alias, table_f_count)); - } - else if (MYSQL_VERSION_ID == table->s->mysql_version) - { - my_error(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED,MYF(0), table->alias, - table_f_count, table->s->fields); - sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED), table->alias, - table_f_count, table->s->fields); - } - else - { - /* - Moving from newer mysql to older one -> let's say not an error but - will check the definition afterwards. If a column was added at the - end then we don't care much since it's not in the middle. - */ - error= FALSE; - } - } - /* definitely something has changed */ - char buffer[255]; - for (i=0 ; i < table_f_count; i++, table_def++) - { - String sql_type(buffer, sizeof(buffer), system_charset_info); - sql_type.length(0); - /* - Name changes are not fatal, we use sequence numbers => no problem - for us but this can show tampered table or broken table. - */ - if (i < table->s->fields) - { - Field *field= table->field[i]; - if (strncmp(field->field_name, table_def->name.str, - table_def->name.length)) - { - sql_print_error("(%s) Expected field %s at position %d, found %s", - table->alias, table_def->name.str, i, - field->field_name); - } - - /* - If the type does not match than something is really wrong - Check up to length - 1. Why? - 1. datetime -> datetim -> the same - 2. int(11) -> int(11 -> the same - 3. set('one','two') -> set('one','two' - so for sets if the same prefix is there it's ok if more are - added as part of the set. The same is valid for enum. So a new - table running on a old server will be valid. - */ - field->sql_type(sql_type); - if (strncmp(sql_type.c_ptr_safe(), table_def->type.str, - table_def->type.length - 1)) - { - sql_print_error("(%s) Expected field %s at position %d to have type " - "%s, found %s", table->alias, table_def->name.str, - i, table_def->type.str, sql_type.c_ptr_safe()); - error= TRUE; - } - else if (table_def->cset.str && !field->has_charset()) - { - sql_print_error("(%s) Expected field %s at position %d to have " - "character set '%s' but found no such", table->alias, - table_def->name.str, i, table_def->cset.str); - error= TRUE; - } - else if (table_def->cset.str && - strcmp(field->charset()->csname, table_def->cset.str)) - { - sql_print_error("(%s) Expected field %s at position %d to have " - "character set '%s' but found '%s'", table->alias, - table_def->name.str, i, table_def->cset.str, - field->charset()->csname); - error= TRUE; - } - } - else - { - sql_print_error("(%s) Expected field %s at position %d to have type %s " - " but no field found.", table->alias, - table_def->name.str, i, table_def->type.str); - error= TRUE; - } - } - if (!error) - *last_create_time= table->file->stats.create_time; - else if (!fields_diff_count && error_num) - my_error(error_num,MYF(0), table->alias, table_f_count, table->s->fields); - } - else + fields_diff_count= (table->s->fields != table_f_count); + if (fields_diff_count) { - DBUG_PRINT("info", ("Table seems ok without thorough checking.")); - *last_create_time= table->file->stats.create_time; + DBUG_PRINT("info", ("Column count has changed, checking the definition")); + + /* previous MySQL version */ + if (MYSQL_VERSION_ID > table->s->mysql_version) + { + sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE), + table->alias, table_f_count, table->s->fields, + table->s->mysql_version, MYSQL_VERSION_ID); + DBUG_RETURN(TRUE); + } + else if (MYSQL_VERSION_ID == table->s->mysql_version) + { + sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED), table->alias, + table_f_count, table->s->fields); + DBUG_RETURN(TRUE); + } + /* + Something has definitely changed, but we're running an older + version of MySQL with new system tables. + Let's check column definitions. If a column was added at + the end of the table, then we don't care much since such change + is backward compatible. + */ } - - DBUG_RETURN(error); + char buffer[STRING_BUFFER_USUAL_SIZE]; + for (i=0 ; i < table_f_count; i++, table_def++) + { + String sql_type(buffer, sizeof(buffer), system_charset_info); + sql_type.length(0); + if (i < table->s->fields) + { + Field *field= table->field[i]; + + if (strncmp(field->field_name, table_def->name.str, + table_def->name.length)) + { + /* + Name changes are not fatal, we use ordinal numbers to access columns. + Still this can be a sign of a tampered table, output an error + to the error log. + */ + sql_print_error("Incorrect definition of table %s.%s: " + "expected column '%s' at position %d, found '%s'.", + table->s->db.str, table->alias, table_def->name.str, i, + field->field_name); + } + field->sql_type(sql_type); + /* + Generally, if column types don't match, then something is + wrong. + + However, we only compare column definitions up to the + length of the original definition, since we consider the + following definitions compatible: + + 1. DATETIME and DATETIM + 2. INT(11) and INT(11 + 3. SET('one', 'two') and SET('one', 'two', 'more') + + For SETs or ENUMs, if the same prefix is there it's OK to + add more elements - they will get higher ordinal numbers and + the new table definition is backward compatible with the + original one. + */ + if (strncmp(sql_type.c_ptr_safe(), table_def->type.str, + table_def->type.length - 1)) + { + sql_print_error("Incorrect definition of table %s.%s: " + "expected column '%s' at position %d to have type " + "%s, found type %s.", table->s->db.str, table->alias, + table_def->name.str, i, table_def->type.str, + sql_type.c_ptr_safe()); + error= TRUE; + } + else if (table_def->cset.str && !field->has_charset()) + { + sql_print_error("Incorrect definition of table %s.%s: " + "expected the type of column '%s' at position %d " + "to have character set '%s' but the type has no " + "character set.", table->s->db.str, table->alias, + table_def->name.str, i, table_def->cset.str); + error= TRUE; + } + else if (table_def->cset.str && + strcmp(field->charset()->csname, table_def->cset.str)) + { + sql_print_error("Incorrect definition of table %s.%s: " + "expected the type of column '%s' at position %d " + "to have character set '%s' but found " + "character set '%s'.", table->s->db.str, table->alias, + table_def->name.str, i, table_def->cset.str, + field->charset()->csname); + error= TRUE; + } + } + else + { + sql_print_error("Incorrect definition of table %s.%s: " + "expected column '%s' at position %d to have type %s " + " but the column is not found.", + table->s->db.str, table->alias, + table_def->name.str, i, table_def->type.str); + error= TRUE; + } + } + DBUG_RETURN(error); } diff --git a/sql/table.h b/sql/table.h index 0eb372e9cca..628341df55d 100644 --- a/sql/table.h +++ b/sql/table.h @@ -684,6 +684,21 @@ class index_hint; typedef struct st_table_list { st_table_list() {} /* Remove gcc warning */ + + /** + Prepare TABLE_LIST that consists of one table instance to use in + simple_open_and_lock_tables + */ + inline void init_one_table(const char *db_name_arg, + const char *table_name_arg, + enum thr_lock_type lock_type_arg) + { + bzero((char*) this, sizeof(*this)); + db= (char*) db_name_arg; + table_name= alias= (char*) table_name_arg; + lock_type= lock_type_arg; + } + /* List of tables local to a subquery (used by SQL_LIST). Considers views as leaves (unlike 'next_leaf' below). Created at parse time @@ -1092,8 +1107,7 @@ typedef struct st_table_field_w_type my_bool table_check_intact(TABLE *table, const uint table_f_count, - const TABLE_FIELD_W_TYPE *table_def, - time_t *last_create_time, int error_num); + const TABLE_FIELD_W_TYPE *table_def); static inline my_bitmap_map *tmp_use_all_columns(TABLE *table, MY_BITMAP *bitmap) From 390a0ede48b42ee41fd26f21dfed088b98dff396 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 13:53:44 +0200 Subject: [PATCH 588/789] Protect against dying twice Cleanup exit handling --- client/mysqltest.c | 85 ++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index c2fd7a4ff0d..d4b959e3fb4 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -792,27 +792,65 @@ void free_used_memory() } +static void cleanup_and_exit(int exit_code) +{ + free_used_memory(); + my_end(MY_CHECK_ERROR); + + if (!silent) + { + switch (exit_code) + { + case 1: + printf("not ok\n"); + break; + case 0: + printf("ok\n"); + break; + case 62: + printf("skipped\n"); + break; + default: + printf("unknown exit code: %d\n", exit_code); + DBUG_ASSERT(0); + } + } + + exit(exit_code); +} + void die(const char *fmt, ...) { + static int dying= 0; va_list args; DBUG_ENTER("die"); DBUG_PRINT("enter", ("start_lineno: %d", start_lineno)); + /* + Protect against dying twice + first time 'die' is called, try to write log files + second time, just exit + */ + if (dying) + cleanup_and_exit(1); + /* Print the error message */ - va_start(args, fmt); + fprintf(stderr, "mysqltest: "); + if (cur_file && cur_file != file_stack) + fprintf(stderr, "In included file \"%s\": ", + cur_file->file_name); + if (start_lineno > 0) + fprintf(stderr, "At line %u: ", start_lineno); if (fmt) { - fprintf(stderr, "mysqltest: "); - if (cur_file && cur_file != file_stack) - fprintf(stderr, "In included file \"%s\": ", - cur_file->file_name); - if (start_lineno > 0) - fprintf(stderr, "At line %u: ", start_lineno); + va_start(args, fmt); vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - fflush(stderr); + va_end(args); } - va_end(args); + else + fprintf(stderr, "unknown error"); + fprintf(stderr, "\n"); + fflush(stderr); /* Dump the result that has been accumulated so far to .log file */ if (result_file_name && ds_res.length) @@ -822,14 +860,7 @@ void die(const char *fmt, ...) if (result_file_name && ds_warning_messages.length) dump_warning_messages(); - /* Clean up and exit */ - free_used_memory(); - my_end(MY_CHECK_ERROR); - - if (!silent) - printf("not ok\n"); - - exit(1); + cleanup_and_exit(1); } @@ -862,14 +893,7 @@ void abort_not_supported_test(const char *fmt, ...) } va_end(args); - /* Clean up and exit */ - free_used_memory(); - my_end(MY_CHECK_ERROR); - - if (!silent) - printf("skipped\n"); - - exit(62); + cleanup_and_exit(62); } @@ -6375,14 +6399,9 @@ int main(int argc, char **argv) dynstr_free(&ds_res); timer_output(); - free_used_memory(); - my_end(MY_CHECK_ERROR); - /* Yes, if we got this far the test has suceeded! Sakila smiles */ - if (!silent) - printf("ok\n"); - exit(0); - return 0; /* Keep compiler happy */ + cleanup_and_exit(0); + return 0; /* Keep compiler happy too */ } From 44ac93108024f802fd91d62dd3076d3c0e66de92 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 15:59:42 +0200 Subject: [PATCH 589/789] ha_ndbcluster.cc: Bug #26591 Cluster handler does not set bits in null bytes correctly: Improved comments ha_ndbcluster_binlog.cc: Bug #26591 Cluster handler does not set bits in null bytes correctly: Using empty_record() instead of bzero sql/ha_ndbcluster.cc: Bug #26591 Cluster handler does not set bits in null bytes correctly: Improved comments sql/ha_ndbcluster_binlog.cc: Bug #26591 Cluster handler does not set bits in null bytes correctly: Using empty_record() instead of bzero --- sql/ha_ndbcluster.cc | 11 +++++++++-- sql/ha_ndbcluster_binlog.cc | 16 ++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 5fa57b63d90..4f555c543a9 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3126,11 +3126,18 @@ void ndb_unpack_record(TABLE *table, NdbValue *value, my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set); DBUG_ENTER("ndb_unpack_record"); - // Set filler bits + /* + Set the filler bits of the null byte, since they are + not touched in the code below. + + The filler bits are the MSBs in the last null byte + */ if (table->s->null_bytes > 0) buf[table->s->null_bytes - 1]|= 256U - (1U << table->s->last_null_bit_pos); - // Set null flag(s) + /* + Set null flag(s) + */ for ( ; field; p_field++, value++, field= *p_field) { diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index d1c2ad15894..1c5db73ef6e 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -2273,9 +2273,11 @@ int ndb_add_ndb_binlog_index(THD *thd, void *_row) break; } - // Set all fields non-null. - if(ndb_binlog_index->s->null_bytes > 0) - bzero(ndb_binlog_index->record[0], ndb_binlog_index->s->null_bytes); + /* + Intialize ndb_binlog_index->record[0] + */ + empty_record(ndb_binlog_index); + ndb_binlog_index->field[0]->store(row.master_log_pos); ndb_binlog_index->field[1]->store(row.master_log_file, strlen(row.master_log_file), @@ -3909,9 +3911,11 @@ restart: IF_DBUG(int ret=) trans.use_table(::server_id, tbl); DBUG_ASSERT(ret == 0); - // Set all fields non-null. - if(table->s->null_bytes > 0) - bzero(table->record[0], table->s->null_bytes); + /* + Intialize table->record[0] + */ + empty_record(table); + table->field[0]->store((longlong)::server_id); table->field[1]->store((longlong)gci); table->field[2]->store("", 0, &my_charset_bin); From e996362040f5733c9296d74ecfb00ca6d552e3ff Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 16:04:31 +0200 Subject: [PATCH 590/789] test of row locking. --- .../suite/row_lock/include/row_lock.inc | 83 ++++ .../row_lock/include/row_lock_big_tab.inc | 94 +++++ .../row_lock/include/row_lock_big_tab_1.inc | 93 +++++ .../row_lock/include/row_lock_big_tab_2.inc | 93 +++++ .../suite/row_lock/include/row_lock_trig.inc | 96 +++++ .../suite/row_lock/include/row_lock_view.inc | 89 +++++ .../row_lock/include/row_lock_view_mix.inc | 92 +++++ .../include/row_lock_view_storedp.inc | 126 +++++++ .../row_lock/include/row_lock_view_trig.inc | 99 +++++ .../suite/row_lock/r/innodb_row_lock_1.result | 142 +++++++ .../suite/row_lock/r/innodb_row_lock_2.result | 32 ++ .../suite/row_lock/r/innodb_row_lock_3.result | 32 ++ .../suite/row_lock/r/innodb_row_lock_4.result | 142 +++++++ .../suite/row_lock/r/innodb_row_lock_5.result | 32 ++ .../row_lock/r/innodb_row_lock_big_tab.result | 97 +++++ .../r/innodb_row_lock_big_tab_1.result | 145 +++++++ .../r/innodb_row_lock_big_tab_2.result | 113 ++++++ .../row_lock/r/innodb_row_lock_trig_1.result | 151 ++++++++ .../row_lock/r/innodb_row_lock_trig_2.result | 37 ++ .../row_lock/r/innodb_row_lock_view_1.result | 34 ++ .../row_lock/r/innodb_row_lock_view_2.result | 40 ++ .../r/innodb_row_lock_view_mix_1.result | 48 +++ .../r/innodb_row_lock_view_mix_2.result | 40 ++ .../r/innodb_row_lock_view_storedp_1.result | 312 +++++++++++++++ .../r/innodb_row_lock_view_storedp_2.result | 47 +++ .../r/innodb_row_lock_view_trig_1.result | 183 +++++++++ .../r/innodb_row_lock_view_trig_2.result | 38 ++ .../suite/row_lock/r/ndb_row_lock_1.result | 139 +++++++ .../suite/row_lock/r/ndb_row_lock_2.result | 31 ++ .../suite/row_lock/r/ndb_row_lock_3.result | 30 ++ .../suite/row_lock/r/ndb_row_lock_4.result | 139 +++++++ .../suite/row_lock/r/ndb_row_lock_5.result | 30 ++ .../row_lock/r/ndb_row_lock_big_tab.result | 177 +++++++++ .../row_lock/r/ndb_row_lock_big_tab_1.result | 357 ++++++++++++++++++ .../row_lock/r/ndb_row_lock_big_tab_2.result | 255 +++++++++++++ .../row_lock/r/ndb_row_lock_trig_1.result | 148 ++++++++ .../row_lock/r/ndb_row_lock_trig_2.result | 35 ++ .../row_lock/r/ndb_row_lock_view_1.result | 194 ++++++++++ .../row_lock/r/ndb_row_lock_view_2.result | 200 ++++++++++ .../row_lock/r/ndb_row_lock_view_mix_1.result | 169 +++++++++ .../row_lock/r/ndb_row_lock_view_mix_2.result | 38 ++ .../r/ndb_row_lock_view_storedp_1.result | 309 +++++++++++++++ .../r/ndb_row_lock_view_storedp_2.result | 46 +++ .../r/ndb_row_lock_view_trig_1.result | 180 +++++++++ .../r/ndb_row_lock_view_trig_2.result | 36 ++ mysql-test/suite/row_lock/readme.txt | 9 + .../suite/row_lock/summary_of_sel_test.txt | 36 ++ .../suite/row_lock/t/innodb_row_lock_1.test | 9 + .../suite/row_lock/t/innodb_row_lock_2.test | 9 + .../suite/row_lock/t/innodb_row_lock_3.test | 9 + .../suite/row_lock/t/innodb_row_lock_4.test | 9 + .../suite/row_lock/t/innodb_row_lock_5.test | 9 + .../row_lock/t/innodb_row_lock_big_tab.test | 9 + .../row_lock/t/innodb_row_lock_big_tab_1.test | 10 + .../row_lock/t/innodb_row_lock_big_tab_2.test | 10 + .../row_lock/t/innodb_row_lock_trig_1.test | 9 + .../row_lock/t/innodb_row_lock_trig_2.test | 9 + .../row_lock/t/innodb_row_lock_view_1.test | 9 + .../row_lock/t/innodb_row_lock_view_2.test | 9 + .../t/innodb_row_lock_view_mix_1.test | 9 + .../t/innodb_row_lock_view_mix_2.test | 10 + .../t/innodb_row_lock_view_storedp_1.test | 9 + .../t/innodb_row_lock_view_storedp_2.test | 9 + .../t/innodb_row_lock_view_trig_1.test | 9 + .../t/innodb_row_lock_view_trig_2.test | 9 + .../suite/row_lock/t/ndb_row_lock_1.test | 6 + .../suite/row_lock/t/ndb_row_lock_2.test | 6 + .../suite/row_lock/t/ndb_row_lock_3.test | 6 + .../suite/row_lock/t/ndb_row_lock_4.test | 6 + .../suite/row_lock/t/ndb_row_lock_5.test | 6 + .../row_lock/t/ndb_row_lock_big_tab.test | 6 + .../row_lock/t/ndb_row_lock_big_tab_1.test | 7 + .../row_lock/t/ndb_row_lock_big_tab_2.test | 7 + .../suite/row_lock/t/ndb_row_lock_trig_1.test | 6 + .../suite/row_lock/t/ndb_row_lock_trig_2.test | 6 + .../suite/row_lock/t/ndb_row_lock_view_1.test | 7 + .../suite/row_lock/t/ndb_row_lock_view_2.test | 6 + .../row_lock/t/ndb_row_lock_view_mix_1.test | 6 + .../row_lock/t/ndb_row_lock_view_mix_2.test | 6 + .../t/ndb_row_lock_view_storedp_1.test | 6 + .../t/ndb_row_lock_view_storedp_2.test | 6 + .../row_lock/t/ndb_row_lock_view_trig_1.test | 6 + .../row_lock/t/ndb_row_lock_view_trig_2.test | 6 + 83 files changed, 5364 insertions(+) create mode 100644 mysql-test/suite/row_lock/include/row_lock.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_big_tab.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_trig.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_view.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_view_mix.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_view_storedp.inc create mode 100644 mysql-test/suite/row_lock/include/row_lock_view_trig.inc create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_1.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_2.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_3.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_4.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_5.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result create mode 100644 mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_1.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_2.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_3.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_4.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_5.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result create mode 100644 mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result create mode 100644 mysql-test/suite/row_lock/readme.txt create mode 100644 mysql-test/suite/row_lock/summary_of_sel_test.txt create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_1.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_2.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_3.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_4.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_5.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test create mode 100644 mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_1.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_2.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_3.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_4.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_5.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test create mode 100644 mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test diff --git a/mysql-test/suite/row_lock/include/row_lock.inc b/mysql-test/suite/row_lock/include/row_lock.inc new file mode 100644 index 00000000000..8572bc0246e --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock.inc @@ -0,0 +1,83 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +eval $indext2; +COMMIT; +SELECT @@global.tx_isolation; + +# Both transaction are able to update the tables +eval EXPLAIN $select; +eval $select; + +--echo connection root1; +CONNECTION root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP TABLE t1, t2; + diff --git a/mysql-test/suite/row_lock/include/row_lock_big_tab.inc b/mysql-test/suite/row_lock/include/row_lock_big_tab.inc new file mode 100644 index 00000000000..f0823067eac --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_big_tab.inc @@ -0,0 +1,94 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +eval $indext2; +DELIMITER |; +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO + INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); + SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN + DECLARE res int DEFAULT 0; + SELECT count(*)/2 INTO res FROM t1; + RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO + INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); + SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN + DECLARE res int DEFAULT 0; + SELECT count(*)/2 INTO res FROM t2; + RETURN res; +END; +| +DELIMITER ;| +CALL fill_t1 (10); +CALL fill_t2 (10); +COMMIT; +SELECT @@global.tx_isolation; +# With the two separate selects (without join) the differs from +# that select with join. + +# Both transaction are able to update the tables +eval EXPLAIN $select; +eval $select; + +--echo connection root1; +CONNECTION root1; +SELECT k from t1 WHERE k < half_t1(); +SELECT k from t1 WHERE k >= half_t1(); +UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP VIEW IF EXISTS v1; +DROP TABLE t1, t2; +#DROP VIEW v1; + diff --git a/mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc b/mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc new file mode 100644 index 00000000000..8535c016819 --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_big_tab_1.inc @@ -0,0 +1,93 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +eval $indext2; +DELIMITER |; +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO + INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); + SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN + DECLARE res int DEFAULT 0; + SELECT MOD(k,2) INTO res FROM t1; + RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO + INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); + SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN + DECLARE res int DEFAULT 0; + SELECT MOD(k,2) INTO res FROM t2; + RETURN res; +END; +| +DELIMITER ;| +eval CALL fill_t1 ($nbrows); +eval CALL fill_t2 ($nbrows); +COMMIT; +SELECT @@global.tx_isolation; +# With the two separate selects (without join) the differs from +# that select with join. + +# Both transaction are able to update the tables +eval EXPLAIN $select; +eval $select; + +--echo connection root1; +CONNECTION root1; +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE; +UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k; +SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k; +SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k; + +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP TABLE t1, t2; + + diff --git a/mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc b/mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc new file mode 100644 index 00000000000..050f2a54016 --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_big_tab_2.inc @@ -0,0 +1,93 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +eval $indext2; +DELIMITER |; +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO + INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); + SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN + DECLARE res int DEFAULT 0; + SELECT MOD(k,2) INTO res FROM t1; + RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO + INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); + SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN + DECLARE res int DEFAULT 0; + SELECT MOD(k,2) INTO res FROM t2; + RETURN res; +END; +| +DELIMITER ;| +eval CALL fill_t1 ($nbrows); +eval CALL fill_t2 ($nbrows); +COMMIT; +SELECT @@global.tx_isolation; +# With the two separate selects (without join) the differs from +# that select with join. + +# Both transaction are able to update the tables +eval EXPLAIN $select; +eval $select; + +--echo connection root1; +CONNECTION root1; +#SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k FOR UPDATE; +DELETE FROM t1 WHERE t1.k % 2 = 1; +SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k; +SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k; + +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM t1 WHERE k < 40 ORDER BY t1.k; +SELECT * FROM t2 WHERE k < 40 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP TABLE t1, t2; + + diff --git a/mysql-test/suite/row_lock/include/row_lock_trig.inc b/mysql-test/suite/row_lock/include/row_lock_trig.inc new file mode 100644 index 00000000000..384f00f243e --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_trig.inc @@ -0,0 +1,96 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +eval $indext2; +DELIMITER |; + +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 + FOR EACH ROW BEGIN + UPDATE t1 SET l = NEW.i WHERE i = OLD.i; + END; +| + +DELIMITER ;| + +COMMIT; +SELECT @@global.tx_isolation; +# With the two separate selects (without join) the differs from +# that select with join. + +# Both transaction are able to update the tables +eval EXPLAIN $select; +eval $select; +--echo connection root1; +CONNECTION root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t2 SET t2.i=223 WHERE t2.i=123; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +UPDATE t2 SET t2.i=226 WHERE t2.i=126; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t2 SET t2.i=224 WHERE t2.i=124; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP TABLE t1, t2; +#DROP VIEW v1; + diff --git a/mysql-test/suite/row_lock/include/row_lock_view.inc b/mysql-test/suite/row_lock/include/row_lock_view.inc new file mode 100644 index 00000000000..fbed8f64d3a --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_view.inc @@ -0,0 +1,89 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +eval $indext2; +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +# With the two separate selects (without join) the differs from +# that select with join. + +# Both transaction are able to update the tables +eval EXPLAIN $select; +eval $select; + +--echo connection root1; +CONNECTION root1; +UPDATE v1 SET i=325 where i=125; +SELECT * FROM v1 ORDER BY i,l; +SELECT * FROM t1 ORDER BY t1.k; + +--echo connection default; +CONNECTION default; +UPDATE v1 SET i=323 where i=123; +SELECT * FROM v1 ORDER BY i,l; +SELECT * FROM t1 ORDER BY t1.k; + +--echo connection root1; +CONNECTION root1; +UPDATE v1 SET i=326 where i=126; +SELECT * FROM v1 ORDER BY i,l; +SELECT * FROM t1 ORDER BY t1.k; + +--echo connection default; +CONNECTION default; +UPDATE v1 SET i=324 where i=124; +SELECT * FROM v1 ORDER BY i,l; +SELECT * FROM t1 ORDER BY t1.k; + +--echo connection root1; +CONNECTION root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP VIEW IF EXISTS v1; +DROP TABLE t1, t2; +#DROP VIEW v1; + diff --git a/mysql-test/suite/row_lock/include/row_lock_view_mix.inc b/mysql-test/suite/row_lock/include/row_lock_view_mix.inc new file mode 100644 index 00000000000..9e8cf3d34fc --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_view_mix.inc @@ -0,0 +1,92 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +eval $indext2; +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +# With the two separate selects (without join) the differs from +# that select with join. + +# Both transaction are able to update the tables +eval EXPLAIN $select; +eval $select; + +--echo connection root1; +CONNECTION root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +#UPDATE v1 SET i=325 where i=125; +#SELECT * FROM v1 ORDER BY i,l; +#SELECT * FROM t1 ORDER BY t1.k; + +--echo connection default; +CONNECTION default; +UPDATE v1 SET i=323 where i=123; +SELECT * FROM v1 ORDER BY i,l; +SELECT * FROM t1 ORDER BY t1.k; + +--echo connection root1; +CONNECTION root1; +UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE v1 SET i=324 where i=124; +SELECT * FROM v1 ORDER BY i,l; +SELECT * FROM t1 ORDER BY t1.k; + +--echo connection root1; +CONNECTION root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP VIEW IF EXISTS v1; +DROP TABLE t1, t2; +#DROP VIEW v1; + diff --git a/mysql-test/suite/row_lock/include/row_lock_view_storedp.inc b/mysql-test/suite/row_lock/include/row_lock_view_storedp.inc new file mode 100644 index 00000000000..479392098be --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_view_storedp.inc @@ -0,0 +1,126 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +DROP PROCEDURE IF EXISTS stp_t; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +CONNECT (root2, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +INSERT INTO t1 VALUES (5,127,5,127); +INSERT INTO t1 VALUES (6,128,6,128); +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +INSERT INTO t2 VALUES (5,127,5,127); +INSERT INTO t2 VALUES (6,128,6,128); +eval $indext2; +CREATE VIEW v1 AS SELECT t1.i from t1; +DELIMITER |; + +CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA + BEGIN + UPDATE t2 SET i = p2 WHERE i = p1; + UPDATE v1 SET i = p2 WHERE i = p1; + SELECT * FROM v1 ORDER BY i; + SELECT * FROM t1 ORDER BY t1.k; + SELECT * FROM t2 ORDER BY t2.k; + END; +| + +DELIMITER ;| + +COMMIT; +SELECT @@global.tx_isolation; +eval EXPLAIN $select; +eval $select; +--echo connection root1; +CONNECTION root1; +CALL stp_t (125, 225); + +--echo connection root2; +CONNECTION root2; +CALL stp_t (127, 227); + +--echo connection default; +CONNECTION default; +CALL stp_t (123, 223); + +--echo connection root1; +CONNECTION root1; +CALL stp_t (126, 226); + +--echo connection root2; +CONNECTION root2; +CALL stp_t (128, 228); + +--echo connection default; +CONNECTION default; +CALL stp_t (124, 224); + +--echo connection root1; +CONNECTION root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root2; +CONNECTION root2; +DELETE FROM t1 WHERE t1.i=228; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection root1; +CONNECTION root1; +COMMIT; + +--echo connection default; +CONNECTION default; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root1; + +--echo connection root2; +CONNECTION root2; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root2; + +--echo connection default; +CONNECTION default; +--disable_warnings +DROP VIEW v1; +DROP PROCEDURE stp_t; +DROP TABLE t1, t2; +--enable_warnings diff --git a/mysql-test/suite/row_lock/include/row_lock_view_trig.inc b/mysql-test/suite/row_lock/include/row_lock_view_trig.inc new file mode 100644 index 00000000000..785eb1b66a9 --- /dev/null +++ b/mysql-test/suite/row_lock/include/row_lock_view_trig.inc @@ -0,0 +1,99 @@ +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +--enable_warnings +SET autocommit=0; +# Create additional connections used through test +CONNECT (root1, localhost, root,,); +SET autocommit=0; +--echo connection default; +CONNECTION default; +eval CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +eval $indext1; +eval CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=$engine; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +eval $indext2; +CREATE VIEW v1 AS SELECT t1.i from t1; +DELIMITER |; + +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 + FOR EACH ROW BEGIN + UPDATE v1 SET i = NEW.i WHERE i = OLD.i; + END; +| + +DELIMITER ;| + +COMMIT; +SELECT @@global.tx_isolation; +eval EXPLAIN $select; +eval $select; +--echo connection root1; +CONNECTION root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t2 SET t2.i=223 WHERE t2.i=123; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +UPDATE t2 SET t2.i=226 WHERE t2.i=126; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +UPDATE t2 SET t2.i=224 WHERE t2.i=124; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection default; +CONNECTION default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +COMMIT; + +--echo connection root1; +CONNECTION root1; +ROLLBACK; + +--echo connection default; +CONNECTION default; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; + +--echo connection root1; +CONNECTION root1; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +DISCONNECT root1; +--echo connection default; +CONNECTION default; +DROP TABLE t1, t2; +DROP VIEW v1; + diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_1.result new file mode 100644 index 00000000000..54ed4350ba9 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_1.result @@ -0,0 +1,142 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_2.result new file mode 100644 index 00000000000..56154e64489 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_2.result @@ -0,0 +1,32 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_3.result b/mysql-test/suite/row_lock/r/innodb_row_lock_3.result new file mode 100644 index 00000000000..a89c55973d2 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_3.result @@ -0,0 +1,32 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_4.result b/mysql-test/suite/row_lock/r/innodb_row_lock_4.result new file mode 100644 index 00000000000..310d24a456a --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_4.result @@ -0,0 +1,142 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_5.result b/mysql-test/suite/row_lock/r/innodb_row_lock_5.result new file mode 100644 index 00000000000..ace5fddfad5 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_5.result @@ -0,0 +1,32 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result new file mode 100644 index 00000000000..8f00c3a0bb7 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab.result @@ -0,0 +1,97 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +CREATE INDEX ixi ON t2 (i); +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT count(*)/2 INTO res FROM t1; +RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT count(*)/2 INTO res FROM t2; +RETURN res; +END; +| +CALL fill_t1 (10); +CALL fill_t2 (10); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 10 Using where; Using index +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where; Using index +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE; +i i +connection root1; +SELECT k from t1 WHERE k < half_t1(); +k +0 +1 +2 +3 +4 +SELECT k from t1 WHERE k >= half_t1(); +k +5 +6 +7 +8 +9 +UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +0 1111 0 100 +1 1111 1 101 +2 1111 2 102 +3 1111 3 103 +4 1111 4 104 +5 105 5 105 +6 106 6 106 +7 107 7 107 +8 108 8 108 +9 109 9 109 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +0 2222 0 100 +1 2222 1 101 +2 2222 2 102 +3 2222 3 103 +4 2222 4 104 +5 105 5 105 +6 106 6 106 +7 107 7 107 +8 108 8 108 +9 109 9 109 +connection default; +UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result new file mode 100644 index 00000000000..0b12f149193 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_1.result @@ -0,0 +1,145 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +CREATE INDEX ixi ON t2 (i); +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t1; +RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t2; +RETURN res; +END; +| +CALL fill_t1 (40); +CALL fill_t2 (40); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY ixi 5 NULL 40 Using where; Using index +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1 +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE; +i i +100 100 +102 102 +104 104 +106 106 +108 108 +110 110 +112 112 +114 114 +116 116 +118 118 +120 120 +122 122 +124 124 +126 126 +128 128 +130 130 +132 132 +134 134 +136 136 +138 138 +connection root1; +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE; +i i +101 101 +103 103 +105 105 +107 107 +109 109 +111 111 +113 113 +115 115 +117 117 +119 119 +121 121 +123 123 +125 125 +127 127 +129 129 +131 131 +133 133 +135 135 +137 137 +139 139 +UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k; +SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k; +k i j l +0 100 0 100 +1 1111 1 101 +2 102 2 102 +3 1111 3 103 +4 104 4 104 +5 1111 5 105 +6 106 6 106 +7 1111 7 107 +8 108 8 108 +9 1111 9 109 +10 110 10 110 +11 1111 11 111 +12 112 12 112 +13 1111 13 113 +14 114 14 114 +15 1111 15 115 +16 116 16 116 +17 1111 17 117 +18 118 18 118 +19 1111 19 119 +SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k; +k i j l +0 100 0 100 +1 2222 1 101 +2 102 2 102 +3 2222 3 103 +4 104 4 104 +5 2222 5 105 +6 106 6 106 +7 2222 7 107 +8 108 8 108 +9 2222 9 109 +10 110 10 110 +11 2222 11 111 +12 112 12 112 +13 2222 13 113 +14 114 14 114 +15 2222 15 115 +16 116 16 116 +17 2222 17 117 +18 118 18 118 +19 2222 19 119 +connection default; +UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result new file mode 100644 index 00000000000..cc9f297f9fb --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_big_tab_2.result @@ -0,0 +1,113 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +CREATE INDEX ixi ON t2 (i); +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t1; +RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t2; +RETURN res; +END; +| +CALL fill_t1 (40); +CALL fill_t2 (40); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY ixi 5 NULL 40 Using where; Using index +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1 +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE; +i i +100 100 +102 102 +104 104 +106 106 +108 108 +110 110 +112 112 +114 114 +116 116 +118 118 +120 120 +122 122 +124 124 +126 126 +128 128 +130 130 +132 132 +134 134 +136 136 +138 138 +connection root1; +DELETE FROM t1 WHERE t1.k % 2 = 1; +SELECT * FROM t1 WHERE k < 20 ORDER BY t1.k; +k i j l +0 100 0 100 +2 102 2 102 +4 104 4 104 +6 106 6 106 +8 108 8 108 +10 110 10 110 +12 112 12 112 +14 114 14 114 +16 116 16 116 +18 118 18 118 +SELECT * FROM t2 WHERE k < 20 ORDER BY t2.k; +k i j l +0 100 0 100 +1 101 1 101 +2 102 2 102 +3 103 3 103 +4 104 4 104 +5 105 5 105 +6 106 6 106 +7 107 7 107 +8 108 8 108 +9 109 9 109 +10 110 10 110 +11 111 11 111 +12 112 12 112 +13 113 13 113 +14 114 14 114 +15 115 15 115 +16 116 16 116 +17 117 17 117 +18 118 18 118 +19 119 19 119 +connection default; +UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k % 2 = 0 AND t1.k = t2.k; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result new file mode 100644 index 00000000000..dd43e5752e5 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_trig_1.result @@ -0,0 +1,151 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE t1 SET l = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 225 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t2 SET t2.i=223 WHERE t2.i=123; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t2 SET t2.i=226 WHERE t2.i=126; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 225 +4 126 4 226 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t2 SET t2.i=224 WHERE t2.i=124; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 225 +4 126 4 226 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result new file mode 100644 index 00000000000..cb3a5c692e9 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_trig_2.result @@ -0,0 +1,37 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE t1 SET l = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result new file mode 100644 index 00000000000..834cb669833 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_1.result @@ -0,0 +1,34 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE v1 SET i=325 where i=125; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result new file mode 100644 index 00000000000..440138d4cd1 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_2.result @@ -0,0 +1,40 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +1 SIMPLE t2 index NULL PRIMARY 4 NULL 4 Using index +SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +i +123 +124 +123 +124 +123 +124 +123 +124 +connection root1; +UPDATE v1 SET i=325 where i=125; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result new file mode 100644 index 00000000000..230873b67a0 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_1.result @@ -0,0 +1,48 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 2 Using where; Using index +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE v1 SET i=323 where i=123; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result new file mode 100644 index 00000000000..d792d573f8e --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_mix_2.result @@ -0,0 +1,40 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +1 SIMPLE t2 index NULL PRIMARY 4 NULL 4 Using index +SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +i +123 +124 +123 +124 +123 +124 +123 +124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result new file mode 100644 index 00000000000..77b9a4dd964 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_1.result @@ -0,0 +1,312 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +INSERT INTO t1 VALUES (5,127,5,127); +INSERT INTO t1 VALUES (6,128,6,128); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +INSERT INTO t2 VALUES (5,127,5,127); +INSERT INTO t2 VALUES (6,128,6,128); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA +BEGIN +UPDATE t2 SET i = p2 WHERE i = p1; +UPDATE v1 SET i = p2 WHERE i = p1; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 6 Using where; Using index +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +CALL stp_t (125, 225); +i +123 +124 +126 +127 +128 +225 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +CALL stp_t (127, 227); +i +123 +124 +125 +126 +128 +227 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 128 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 128 6 128 +connection default; +CALL stp_t (123, 223); +i +124 +125 +126 +127 +128 +223 +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root1; +CALL stp_t (126, 226); +i +123 +124 +127 +128 +225 +226 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +CALL stp_t (128, 228); +i +123 +124 +125 +126 +227 +228 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +connection default; +CALL stp_t (124, 224); +i +125 +126 +127 +128 +223 +224 +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +DELETE FROM t1 WHERE t1.i=228; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +COMMIT; +connection root1; +ROLLBACK; +connection root1; +COMMIT; +connection default; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +127 +128 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root1; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +127 +128 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +SELECT * FROM v1 ORDER BY i; +i +123 +124 +125 +126 +227 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +connection default; +DROP TABLE t1, t2; +DROP VIEW v1; +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result new file mode 100644 index 00000000000..73d8a3f4bea --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_storedp_2.result @@ -0,0 +1,47 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +INSERT INTO t1 VALUES (5,127,5,127); +INSERT INTO t1 VALUES (6,128,6,128); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +INSERT INTO t2 VALUES (5,127,5,127); +INSERT INTO t2 VALUES (6,128,6,128); +#CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA +BEGIN +UPDATE t2 SET i = p2 WHERE i = p1; +UPDATE v1 SET i = p2 WHERE i = p1; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +CALL stp_t (125, 225); diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result new file mode 100644 index 00000000000..90383a9489f --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_1.result @@ -0,0 +1,183 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE v1 SET i = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index ixi ixi 5 NULL 4 Using where; Using index +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; +SELECT * FROM v1 ORDER BY i; +i +123 +124 +126 +225 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t2 SET t2.i=223 WHERE t2.i=123; +SELECT * FROM v1 ORDER BY i; +i +124 +125 +126 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t2 SET t2.i=226 WHERE t2.i=126; +SELECT * FROM v1 ORDER BY i; +i +123 +124 +225 +226 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t2 SET t2.i=224 WHERE t2.i=124; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +223 +224 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; +DROP VIEW v1; +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result b/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result new file mode 100644 index 00000000000..55793558b21 --- /dev/null +++ b/mysql-test/suite/row_lock/r/innodb_row_lock_view_trig_2.result @@ -0,0 +1,38 @@ +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE v1 SET i = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_1.result new file mode 100644 index 00000000000..248c7d5ea1f --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_1.result @@ -0,0 +1,139 @@ +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_2.result new file mode 100644 index 00000000000..109d99dd036 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_2.result @@ -0,0 +1,31 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_3.result b/mysql-test/suite/row_lock/r/ndb_row_lock_3.result new file mode 100644 index 00000000000..c936ea209ff --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_3.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_4.result b/mysql-test/suite/row_lock/r/ndb_row_lock_4.result new file mode 100644 index 00000000000..875c783bd81 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_4.result @@ -0,0 +1,139 @@ +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t1,t2 SET t1.i=223,t2.i=223 WHERE t1.i=123 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t1,t2 SET t1.i=224,t2.i=224 WHERE t1.i=124 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_5.result b/mysql-test/suite/row_lock/r/ndb_row_lock_5.result new file mode 100644 index 00000000000..0d94f8abf72 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_5.result @@ -0,0 +1,30 @@ +DROP TABLE IF EXISTS t1, t2; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result new file mode 100644 index 00000000000..94b67c63d94 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab.result @@ -0,0 +1,177 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +CREATE INDEX ixi ON t2 (i); +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT count(*)/2 INTO res FROM t1; +RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT count(*)/2 INTO res FROM t2; +RETURN res; +END; +| +CALL fill_t1 (10); +CALL fill_t2 (10); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE; +i i +connection root1; +SELECT k from t1 WHERE k < half_t1(); +k +0 +3 +1 +2 +4 +SELECT k from t1 WHERE k >= half_t1(); +k +6 +7 +9 +5 +8 +UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k < half_t1() AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +0 1111 0 100 +1 1111 1 101 +2 1111 2 102 +3 1111 3 103 +4 1111 4 104 +5 105 5 105 +6 106 6 106 +7 107 7 107 +8 108 8 108 +9 109 9 109 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +0 2222 0 100 +1 2222 1 101 +2 2222 2 102 +3 2222 3 103 +4 2222 4 104 +5 105 5 105 +6 106 6 106 +7 107 7 107 +8 108 8 108 +9 109 9 109 +connection default; +UPDATE t1,t2 SET t1.i=3333,t2.i=4444 WHERE t1.k >= half_t1() AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +0 100 0 100 +1 101 1 101 +2 102 2 102 +3 103 3 103 +4 104 4 104 +5 3333 5 105 +6 3333 6 106 +7 3333 7 107 +8 3333 8 108 +9 3333 9 109 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +0 100 0 100 +1 101 1 101 +2 102 2 102 +3 103 3 103 +4 104 4 104 +5 4444 5 105 +6 4444 6 106 +7 4444 7 107 +8 4444 8 108 +9 4444 9 109 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +0 100 0 100 +1 101 1 101 +2 102 2 102 +3 103 3 103 +4 104 4 104 +5 3333 5 105 +6 3333 6 106 +7 3333 7 107 +8 3333 8 108 +9 3333 9 109 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +0 100 0 100 +1 101 1 101 +2 102 2 102 +3 103 3 103 +4 104 4 104 +5 4444 5 105 +6 4444 6 106 +7 4444 7 107 +8 4444 8 108 +9 4444 9 109 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +0 100 0 100 +1 101 1 101 +2 102 2 102 +3 103 3 103 +4 104 4 104 +5 3333 5 105 +6 3333 6 106 +7 3333 7 107 +8 3333 8 108 +9 3333 9 109 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +0 100 0 100 +1 101 1 101 +2 102 2 102 +3 103 3 103 +4 104 4 104 +5 4444 5 105 +6 4444 6 106 +7 4444 7 107 +8 4444 8 108 +9 4444 9 109 +connection default; +DROP VIEW IF EXISTS v1; +Warnings: +Note 1051 Unknown table 'test.v1' +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result new file mode 100644 index 00000000000..9803895e1a7 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_1.result @@ -0,0 +1,357 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +CREATE INDEX ixi ON t2 (i); +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t1; +RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t2; +RETURN res; +END; +| +CALL fill_t1 (200); +CALL fill_t2 (200); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 200 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1 +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE; +i i +135 135 +119 119 +211 211 +184 184 +232 232 +105 105 +188 188 +216 216 +255 255 +154 154 +197 197 +279 279 +218 218 +127 127 +203 203 +281 281 +194 194 +161 161 +276 276 +122 122 +139 139 +183 183 +114 114 +247 247 +144 144 +148 148 +174 174 +267 267 +142 142 +168 168 +226 226 +258 258 +231 231 +146 146 +253 253 +189 189 +230 230 +290 290 +178 178 +158 158 +130 130 +214 214 +133 133 +229 229 +294 294 +295 295 +108 108 +112 112 +297 297 +151 151 +251 251 +270 270 +291 291 +159 159 +132 132 +121 121 +244 244 +272 272 +293 293 +186 186 +111 111 +166 166 +201 201 +175 175 +180 180 +209 209 +192 192 +246 246 +195 195 +107 107 +233 233 +239 239 +103 103 +109 109 +128 128 +266 266 +143 143 +160 160 +187 187 +243 243 +273 273 +259 259 +110 110 +176 176 +141 141 +170 170 +215 215 +191 191 +200 200 +271 271 +162 162 +260 260 +106 106 +150 150 +126 126 +147 147 +155 155 +193 193 +207 207 +287 287 +235 235 +252 252 +129 129 +205 205 +268 268 +278 278 +116 116 +137 137 +199 199 +217 217 +234 234 +190 190 +236 236 +257 257 +100 100 +210 210 +212 212 +264 264 +221 221 +241 241 +256 256 +262 262 +265 265 +269 269 +277 277 +173 173 +177 177 +208 208 +219 219 +285 285 +101 101 +164 164 +113 113 +125 125 +202 202 +140 140 +156 156 +282 282 +181 181 +206 206 +299 299 +102 102 +145 145 +227 227 +196 196 +138 138 +198 198 +204 204 +237 237 +171 171 +284 284 +263 263 +292 292 +104 104 +149 149 +250 250 +296 296 +228 228 +280 280 +242 242 +248 248 +185 185 +220 220 +245 245 +275 275 +118 118 +120 120 +152 152 +153 153 +157 157 +182 182 +179 179 +254 254 +288 288 +172 172 +283 283 +286 286 +115 115 +238 238 +289 289 +131 131 +223 223 +134 134 +136 136 +222 222 +225 225 +261 261 +274 274 +123 123 +163 163 +224 224 +117 117 +298 298 +169 169 +124 124 +167 167 +240 240 +249 249 +165 165 +213 213 +connection root1; +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 1 AND t1.k = t2.k LOCK IN SHARE MODE; +i i +209 209 +195 195 +107 107 +233 233 +239 239 +103 103 +109 109 +143 143 +187 187 +243 243 +273 273 +259 259 +141 141 +215 215 +191 191 +271 271 +147 147 +155 155 +193 193 +207 207 +287 287 +235 235 +129 129 +205 205 +137 137 +199 199 +217 217 +257 257 +221 221 +241 241 +265 265 +269 269 +277 277 +173 173 +177 177 +135 135 +119 119 +211 211 +105 105 +255 255 +197 197 +279 279 +127 127 +203 203 +281 281 +161 161 +139 139 +183 183 +247 247 +267 267 +231 231 +253 253 +189 189 +133 133 +229 229 +295 295 +297 297 +151 151 +251 251 +291 291 +159 159 +121 121 +293 293 +111 111 +201 201 +175 175 +185 185 +245 245 +275 275 +153 153 +157 157 +179 179 +283 283 +115 115 +289 289 +131 131 +223 223 +225 225 +261 261 +123 123 +163 163 +117 117 +169 169 +167 167 +249 249 +165 165 +213 213 +219 219 +285 285 +101 101 +113 113 +125 125 +181 181 +299 299 +145 145 +227 227 +237 237 +171 171 +263 263 +149 149 +UPDATE t1,t2 SET t1.i=1111,t2.i=2222 WHERE t1.k % 2 = 1 AND t1.k = t2.k; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result new file mode 100644 index 00000000000..adb89b03480 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_big_tab_2.result @@ -0,0 +1,255 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +CREATE INDEX ixi ON t2 (i); +CREATE PROCEDURE fill_t1 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t1 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t1() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t1; +RETURN res; +END; +| +CREATE PROCEDURE fill_t2 (IN upb int) +BEGIN +DECLARE cnt int DEFAULT 0; +WHILE cnt < upb DO +INSERT INTO t2 VALUES (cnt, cnt+100, cnt, cnt+100); +SET cnt= cnt+1; +END WHILE; +END; +| +CREATE FUNCTION half_t2() RETURNS int +BEGIN +DECLARE res int DEFAULT 0; +SELECT MOD(k,2) INTO res FROM t2; +RETURN res; +END; +| +CALL fill_t1 (200); +CALL fill_t2 (200); +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 200 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.k 1 +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE; +i i +135 135 +119 119 +211 211 +184 184 +232 232 +105 105 +188 188 +216 216 +255 255 +154 154 +197 197 +279 279 +218 218 +127 127 +203 203 +281 281 +194 194 +161 161 +276 276 +122 122 +139 139 +183 183 +114 114 +247 247 +144 144 +148 148 +174 174 +267 267 +142 142 +168 168 +226 226 +258 258 +231 231 +146 146 +253 253 +189 189 +230 230 +290 290 +178 178 +158 158 +130 130 +214 214 +133 133 +229 229 +294 294 +295 295 +108 108 +112 112 +297 297 +151 151 +251 251 +270 270 +291 291 +159 159 +132 132 +121 121 +244 244 +272 272 +293 293 +186 186 +111 111 +166 166 +201 201 +175 175 +180 180 +209 209 +192 192 +246 246 +195 195 +107 107 +233 233 +239 239 +103 103 +109 109 +128 128 +266 266 +143 143 +160 160 +187 187 +243 243 +273 273 +259 259 +110 110 +176 176 +141 141 +170 170 +215 215 +191 191 +200 200 +271 271 +162 162 +260 260 +106 106 +150 150 +126 126 +147 147 +155 155 +193 193 +207 207 +287 287 +235 235 +252 252 +129 129 +205 205 +268 268 +278 278 +116 116 +137 137 +199 199 +217 217 +234 234 +190 190 +236 236 +257 257 +100 100 +210 210 +212 212 +264 264 +221 221 +241 241 +256 256 +262 262 +265 265 +269 269 +277 277 +173 173 +177 177 +208 208 +219 219 +285 285 +101 101 +164 164 +113 113 +125 125 +202 202 +140 140 +156 156 +282 282 +181 181 +206 206 +299 299 +102 102 +145 145 +227 227 +196 196 +138 138 +198 198 +204 204 +237 237 +171 171 +284 284 +263 263 +292 292 +104 104 +149 149 +250 250 +296 296 +228 228 +280 280 +242 242 +248 248 +185 185 +220 220 +245 245 +275 275 +118 118 +120 120 +152 152 +153 153 +157 157 +182 182 +179 179 +254 254 +288 288 +172 172 +283 283 +286 286 +115 115 +238 238 +289 289 +131 131 +223 223 +134 134 +136 136 +222 222 +225 225 +261 261 +274 274 +123 123 +163 163 +224 224 +117 117 +298 298 +169 169 +124 124 +167 167 +240 240 +249 249 +165 165 +213 213 +connection root1; +DELETE FROM t1 WHERE t1.k % 2 = 1; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result new file mode 100644 index 00000000000..eb69fd2e306 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_trig_1.result @@ -0,0 +1,148 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE t1 SET l = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 225 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t2 SET t2.i=223 WHERE t2.i=123; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t2 SET t2.i=226 WHERE t2.i=126; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 225 +4 126 4 226 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t2 SET t2.i=224 WHERE t2.i=124; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 225 +4 126 4 226 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 223 +2 124 2 224 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result new file mode 100644 index 00000000000..bedb75da93a --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_trig_2.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE t1 SET l = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result new file mode 100644 index 00000000000..279f2626c73 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_1.result @@ -0,0 +1,194 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE v1 SET i=325 where i=125; +SELECT * FROM v1 ORDER BY i,l; +i l +123 123 +123 124 +123 125 +123 126 +124 123 +124 124 +124 125 +124 126 +126 123 +126 124 +126 125 +126 126 +325 123 +325 124 +325 125 +325 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 325 3 125 +4 126 4 126 +connection default; +UPDATE v1 SET i=323 where i=123; +SELECT * FROM v1 ORDER BY i,l; +i l +124 123 +124 124 +124 125 +124 126 +125 123 +125 124 +125 125 +125 126 +126 123 +126 124 +126 125 +126 126 +323 123 +323 124 +323 125 +323 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE v1 SET i=326 where i=126; +SELECT * FROM v1 ORDER BY i,l; +i l +123 123 +123 124 +123 125 +123 126 +124 123 +124 124 +124 125 +124 126 +325 123 +325 124 +325 125 +325 126 +326 123 +326 124 +326 125 +326 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 325 3 125 +4 326 4 126 +connection default; +UPDATE v1 SET i=324 where i=124; +SELECT * FROM v1 ORDER BY i,l; +i l +125 123 +125 124 +125 125 +125 126 +126 123 +126 124 +126 125 +126 126 +323 123 +323 124 +323 125 +323 126 +324 123 +324 124 +324 125 +324 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 325 3 125 +4 326 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP VIEW IF EXISTS v1; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result new file mode 100644 index 00000000000..9e74e93b0cc --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_2.result @@ -0,0 +1,200 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 +SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +i +123 +124 +123 +124 +123 +124 +123 +124 +connection root1; +UPDATE v1 SET i=325 where i=125; +SELECT * FROM v1 ORDER BY i,l; +i l +123 123 +123 124 +123 125 +123 126 +124 123 +124 124 +124 125 +124 126 +126 123 +126 124 +126 125 +126 126 +325 123 +325 124 +325 125 +325 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 325 3 125 +4 126 4 126 +connection default; +UPDATE v1 SET i=323 where i=123; +SELECT * FROM v1 ORDER BY i,l; +i l +124 123 +124 124 +124 125 +124 126 +125 123 +125 124 +125 125 +125 126 +126 123 +126 124 +126 125 +126 126 +323 123 +323 124 +323 125 +323 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE v1 SET i=326 where i=126; +SELECT * FROM v1 ORDER BY i,l; +i l +123 123 +123 124 +123 125 +123 126 +124 123 +124 124 +124 125 +124 126 +325 123 +325 124 +325 125 +325 126 +326 123 +326 124 +326 125 +326 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 325 3 125 +4 326 4 126 +connection default; +UPDATE v1 SET i=324 where i=124; +SELECT * FROM v1 ORDER BY i,l; +i l +125 123 +125 124 +125 125 +125 126 +126 123 +126 124 +126 125 +126 126 +323 123 +323 124 +323 125 +323 126 +324 123 +324 124 +324 125 +324 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 325 3 125 +4 326 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP VIEW IF EXISTS v1; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result new file mode 100644 index 00000000000..b5b1c519702 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_1.result @@ -0,0 +1,169 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +1 SIMPLE t2 ref ixi ixi 5 test.t1.i 1 Using where +SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +i i +123 123 +124 124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE v1 SET i=323 where i=123; +SELECT * FROM v1 ORDER BY i,l; +i l +124 123 +124 124 +124 125 +124 126 +125 123 +125 124 +125 125 +125 126 +126 123 +126 124 +126 125 +126 126 +323 123 +323 124 +323 125 +323 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t1,t2 SET t1.i=226,t2.i=226 WHERE t1.i=126 AND t2.i=t1.i; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE v1 SET i=324 where i=124; +SELECT * FROM v1 ORDER BY i,l; +i l +125 123 +125 124 +125 125 +125 126 +126 123 +126 124 +126 125 +126 126 +323 123 +323 124 +323 125 +323 126 +324 123 +324 124 +324 125 +324 126 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 323 1 123 +2 324 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP VIEW IF EXISTS v1; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result new file mode 100644 index 00000000000..d92f9ad9664 --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_mix_2.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i, t2.l from t1,t2; +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 +SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +i +123 +124 +123 +124 +123 +124 +123 +124 +connection root1; +UPDATE t1,t2 SET t1.i=225,t2.i=225 WHERE t1.i=125 AND t2.i=t1.i; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result new file mode 100644 index 00000000000..e2a2a6e7deb --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_1.result @@ -0,0 +1,309 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +DROP PROCEDURE IF EXISTS stp_t; +SET autocommit=0; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +INSERT INTO t1 VALUES (5,127,5,127); +INSERT INTO t1 VALUES (6,128,6,128); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +INSERT INTO t2 VALUES (5,127,5,127); +INSERT INTO t2 VALUES (6,128,6,128); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA +BEGIN +UPDATE t2 SET i = p2 WHERE i = p1; +UPDATE v1 SET i = p2 WHERE i = p1; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +CALL stp_t (125, 225); +i +123 +124 +126 +127 +128 +225 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +CALL stp_t (127, 227); +i +123 +124 +125 +126 +128 +227 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 128 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 128 6 128 +connection default; +CALL stp_t (123, 223); +i +124 +125 +126 +127 +128 +223 +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root1; +CALL stp_t (126, 226); +i +123 +124 +127 +128 +225 +226 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +CALL stp_t (128, 228); +i +123 +124 +125 +126 +227 +228 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +connection default; +CALL stp_t (124, 224); +i +125 +126 +127 +128 +223 +224 +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +DELETE FROM t1 WHERE t1.i=228; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +COMMIT; +connection root1; +ROLLBACK; +connection root1; +COMMIT; +connection default; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +127 +128 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root1; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +127 +128 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 127 5 127 +6 128 6 128 +connection root2; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +223 +227 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +5 227 5 127 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +5 227 5 127 +6 228 6 128 +connection default; +DROP VIEW v1; +DROP PROCEDURE stp_t; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result new file mode 100644 index 00000000000..6dbd5f834ed --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_storedp_2.result @@ -0,0 +1,46 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +DROP PROCEDURE IF EXISTS stp_t; +SET autocommit=0; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +INSERT INTO t1 VALUES (5,127,5,127); +INSERT INTO t1 VALUES (6,128,6,128); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +INSERT INTO t2 VALUES (5,127,5,127); +INSERT INTO t2 VALUES (6,128,6,128); +#CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE PROCEDURE stp_t (IN p1 int, IN p2 int) MODIFIES SQL DATA +BEGIN +UPDATE t2 SET i = p2 WHERE i = p1; +UPDATE v1 SET i = p2 WHERE i = p1; +SELECT * FROM v1 ORDER BY i; +SELECT * FROM t1 ORDER BY t1.k; +SELECT * FROM t2 ORDER BY t2.k; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +CALL stp_t (125, 225); diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result new file mode 100644 index 00000000000..f5c745ca41c --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_1.result @@ -0,0 +1,180 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE v1 SET i = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ixi ixi 5 NULL 10 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; +SELECT * FROM v1 ORDER BY i; +i +123 +124 +126 +225 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 126 4 126 +connection default; +UPDATE t2 SET t2.i=223 WHERE t2.i=123; +SELECT * FROM v1 ORDER BY i; +i +124 +125 +126 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 124 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +UPDATE t2 SET t2.i=226 WHERE t2.i=126; +SELECT * FROM v1 ORDER BY i; +i +123 +124 +225 +226 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +UPDATE t2 SET t2.i=224 WHERE t2.i=124; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +223 +224 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +DELETE FROM t1 WHERE t1.i=226; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 123 1 123 +2 124 2 124 +3 225 3 125 +4 226 4 126 +connection default; +DELETE FROM t1 WHERE t1.i=224; +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +COMMIT; +connection root1; +ROLLBACK; +connection default; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection root1; +SELECT * FROM v1 ORDER BY i; +i +125 +126 +223 +SELECT * FROM t1 ORDER BY t1.k; +k i j l +1 223 1 123 +3 125 3 125 +4 126 4 126 +SELECT * FROM t2 ORDER BY t2.k; +k i j l +1 223 1 123 +2 224 2 124 +3 125 3 125 +4 126 4 126 +connection default; +DROP TABLE t1, t2; +DROP VIEW v1; diff --git a/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result b/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result new file mode 100644 index 00000000000..d6a38753c1d --- /dev/null +++ b/mysql-test/suite/row_lock/r/ndb_row_lock_view_trig_2.result @@ -0,0 +1,36 @@ +DROP TABLE IF EXISTS t1, t2; +DROP VIEW IF EXISTS v1; +SET autocommit=0; +SET autocommit=0; +connection default; +CREATE TABLE t1 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t1 VALUES (1,123,1,123); +INSERT INTO t1 VALUES (2,124,2,124); +INSERT INTO t1 VALUES (3,125,3,125); +INSERT INTO t1 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t1 (i); +CREATE TABLE t2 (k INT NOT NULL PRIMARY KEY, i INT, j INT, l INT) ENGINE=NDB; +INSERT INTO t2 VALUES (1,123,1,123); +INSERT INTO t2 VALUES (2,124,2,124); +INSERT INTO t2 VALUES (3,125,3,125); +INSERT INTO t2 VALUES (4,126,4,126); +#CREATE INDEX ixi ON t2 (i); +CREATE VIEW v1 AS SELECT t1.i from t1; +CREATE TRIGGER trig_t2 AFTER UPDATE ON t2 +FOR EACH ROW BEGIN +UPDATE v1 SET i = NEW.i WHERE i = OLD.i; +END; +| +COMMIT; +SELECT @@global.tx_isolation; +@@global.tx_isolation +REPEATABLE-READ +EXPLAIN SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where +SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +i +123 +124 +connection root1; +UPDATE t2 SET t2.i=225 WHERE t2.i=125; diff --git a/mysql-test/suite/row_lock/readme.txt b/mysql-test/suite/row_lock/readme.txt new file mode 100644 index 00000000000..b43f04ecda4 --- /dev/null +++ b/mysql-test/suite/row_lock/readme.txt @@ -0,0 +1,9 @@ +All row lock test with InnoDB have to be executed with the options + +--innodb_lock_wait_timeout=1 +--innodb_locks_unsafe_for_binlog + +for example + +perl mysql-test-run.pl --mysqld=--innodb_lock_wait_timeout=2 --mysqld=--innodb_locks_unsafe_for_binlog --suite=row_lock innodb_row_lock_2 + diff --git a/mysql-test/suite/row_lock/summary_of_sel_test.txt b/mysql-test/suite/row_lock/summary_of_sel_test.txt new file mode 100644 index 00000000000..0fa332e957a --- /dev/null +++ b/mysql-test/suite/row_lock/summary_of_sel_test.txt @@ -0,0 +1,36 @@ +Test plan: +Create 2 tables with a primary key and 3 integer columns. Both get the same rows (1,123,1,123),(2,124,2,124),(3,125,3,125),(4,126,4,126). The second and third column may get an index to have cases with, without and mutilple index. Create views on the tables. Create an update trigger. Create a stored procedure updating the table. Create a stored function updating the table and deliver the key as result. + +The test isself consists of 2 sessions (transactions) running in "parallel" (same user "root") accessing and locking the same tables on basis of a row lock. Expected is that both sessions(transactions) can update the table successfully. + +First session +execute an explain to every select and one of the following selects on the first half of table t1: +- select ... where ... for update; +- select ... where ... lock in share mode; +- select ... where ... for update; +- select ... where ... lock in share mode; +- select ... ignore index ... where ... for update; +- select ... ignore index ... where ... lock in share mode; +- select ... where (select...) ... for update; +- select ... where (select...) ... lock in share mode; +- (select ... where) union (select ... where) for update; +- (select ... where) union (select ... where) lock in...; +- select ... where ... for update; +- select ... where ... lock in ...; +- select ... where ... for update; +- select ... where ... lock in ...; +Then executes +- update +- delete +- trigger accessing table t1 +- stored procedure accessing table t1 +- stored function accessing table t1 + +Second session +executes the same on the last half of table t1 + +call of mysqld with option +--innodb_locks_unsafe_for_binlog + +As the tests above work with small tables (<10 rows) there must be at least one test with a big table (>1000 rows) doing a table scan. + diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_1.test new file mode 100644 index 00000000000..e0440fe2669 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_1.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_2.test new file mode 100644 index 00000000000..5cb3ea9f2d9 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_2.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_3.test b/mysql-test/suite/row_lock/t/innodb_row_lock_3.test new file mode 100644 index 00000000000..11f4dc423d6 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_3.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_4.test b/mysql-test/suite/row_lock/t/innodb_row_lock_4.test new file mode 100644 index 00000000000..0a8ca9c13a0 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_4.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_5.test b/mysql-test/suite/row_lock/t/innodb_row_lock_5.test new file mode 100644 index 00000000000..7e411d31649 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_5.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test new file mode 100644 index 00000000000..0c5b8b41bd5 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_big_tab.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test new file mode 100644 index 00000000000..a12a07d82a9 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_1.test @@ -0,0 +1,10 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $nbrows= 40; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_big_tab_1.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test new file mode 100644 index 00000000000..49e834eb2ce --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_big_tab_2.test @@ -0,0 +1,10 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $nbrows= 40; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.k % 2= 0 AND t1.k = t2.k LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_big_tab_2.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test new file mode 100644 index 00000000000..225513d3f87 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_trig_1.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_trig.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test new file mode 100644 index 00000000000..88dee5f23f8 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_trig_2.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_trig.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test new file mode 100644 index 00000000000..d6381e1da5b --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_1.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test new file mode 100644 index 00000000000..ee45e683669 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_2.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test new file mode 100644 index 00000000000..49cba88dd23 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_1.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_mix.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test new file mode 100644 index 00000000000..b07f3a3378a --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_mix_2.test @@ -0,0 +1,10 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +#let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_mix.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test new file mode 100644 index 00000000000..d507ff3296f --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_1.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_storedp.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test new file mode 100644 index 00000000000..a1bfb16055e --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_storedp_2.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_storedp.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test new file mode 100644 index 00000000000..24c76532d17 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_1.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_trig.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test b/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test new file mode 100644 index 00000000000..a8a67d77979 --- /dev/null +++ b/mysql-test/suite/row_lock/t/innodb_row_lock_view_trig_2.test @@ -0,0 +1,9 @@ +--source include/have_innodb.inc +SELECT @@global.innodb_table_locks into @table_locks; +SET @@global.innodb_table_locks= OFF; +let $engine= InnoDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_trig.inc +SET @@global.innodb_table_locks= @table_locks; diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_1.test new file mode 100644 index 00000000000..6ac2e829008 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_1.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_2.test new file mode 100644 index 00000000000..994ecba96b0 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_2.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_3.test b/mysql-test/suite/row_lock/t/ndb_row_lock_3.test new file mode 100644 index 00000000000..2de43c61c2a --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_3.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_4.test b/mysql-test/suite/row_lock/t/ndb_row_lock_4.test new file mode 100644 index 00000000000..72b20488c74 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_4.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_5.test b/mysql-test/suite/row_lock/t/ndb_row_lock_5.test new file mode 100644 index 00000000000..045f127a4ef --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_5.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1 ignore index (ixi),t2 IGNORE INDEX (ixi) WHERE t1.i<125 AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test new file mode 100644 index 00000000000..bf2df104e03 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < half_t1() AND t2.i=t1.i LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_big_tab.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test new file mode 100644 index 00000000000..4d32991d379 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_1.test @@ -0,0 +1,7 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $nbrows= 200; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_big_tab_1.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test new file mode 100644 index 00000000000..894a83fc1b0 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_big_tab_2.test @@ -0,0 +1,7 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $nbrows= 200; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i < t1.k % 2 = 0 AND t2.k=t1.k LOCK IN SHARE MODE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_big_tab_2.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test new file mode 100644 index 00000000000..a5586a6101e --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_trig_1.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_trig.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test new file mode 100644 index 00000000000..7af13697ccc --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_trig_2.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_trig.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test new file mode 100644 index 00000000000..a1aaf5ab441 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_1.test @@ -0,0 +1,7 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view.inc + diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test new file mode 100644 index 00000000000..b8feef693e7 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_2.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test new file mode 100644 index 00000000000..a97626048d3 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_1.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i,t2.i FROM t1,t2 WHERE t1.i<125 AND t2.i=t1.i FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_mix.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test new file mode 100644 index 00000000000..e7a9a715785 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_mix_2.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT v1.i FROM v1 WHERE v1.i<125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_mix.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test new file mode 100644 index 00000000000..f57bcb3dd1b --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_1.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_storedp.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test new file mode 100644 index 00000000000..b0aaa38fb93 --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_storedp_2.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_storedp.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test new file mode 100644 index 00000000000..9c4128d78bf --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_1.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= CREATE INDEX ixi ON t1 (i); +let $indext2= CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_trig.inc diff --git a/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test b/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test new file mode 100644 index 00000000000..38c9472fb3d --- /dev/null +++ b/mysql-test/suite/row_lock/t/ndb_row_lock_view_trig_2.test @@ -0,0 +1,6 @@ +--source include/have_ndb.inc +let $engine= NDB; +let $select= SELECT t1.i FROM t1 WHERE t1.i< 125 FOR UPDATE; +let $indext1= #CREATE INDEX ixi ON t1 (i); +let $indext2= #CREATE INDEX ixi ON t2 (i); +--source suite/row_lock/include/row_lock_view_trig.inc From ea3afa8d1e1325e621246a17fce30ddd24e74da2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 20:26:18 +0500 Subject: [PATCH 591/789] bug #26074 Mysql crash creating partition As we have unified paths inside partition engine, we should look for '/' as a path separator mysql-test/r/windows.result: result fixed mysql-test/t/windows.test: testcase sql/ha_partition.cc: check for '/' instead of FN_LIBCHAR --- mysql-test/r/windows.result | 15 +++++++++++++++ mysql-test/t/windows.test | 21 +++++++++++++++++++++ sql/ha_partition.cc | 3 ++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result index 7472b724f47..423123692e5 100644 --- a/mysql-test/r/windows.result +++ b/mysql-test/r/windows.result @@ -26,3 +26,18 @@ ERROR HY000: No paths allowed for shared library execute abc; ERROR HY000: No paths allowed for shared library deallocate prepare abc; +CREATE TABLE t1 ( +`pkid` int(11) NOT NULL AUTO_INCREMENT, +`SALES_DATE` date NOT NULL DEFAULT '0000-00-00', +KEY `pkid` (`pkid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +PARTITION BY RANGE (MONTH(SALES_DATE)) +( +PARTITION p0 VALUES LESS THAN (2) ENGINE=INNODB +data DIRECTORY='c:/tmp/' + index DIRECTORY = 'c:/tmp/', +PARTITION p1 VALUES LESS THAN (3) ENGINE=INNODB +data DIRECTORY='c:/tmp/' + index DIRECTORY = 'c:/tmp/' +); +drop table t1; diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test index a10d54b5452..efdf0963b80 100644 --- a/mysql-test/t/windows.test +++ b/mysql-test/t/windows.test @@ -1,5 +1,6 @@ # Windows-specific tests --source include/windows.inc +-- source include/have_innodb.inc # # Bug 9148: Denial of service @@ -49,3 +50,23 @@ execute abc; execute abc; deallocate prepare abc; +# +# Bug #26074 Mysql crash when creating partitions +# + +CREATE TABLE t1 ( + `pkid` int(11) NOT NULL AUTO_INCREMENT, + `SALES_DATE` date NOT NULL DEFAULT '0000-00-00', + KEY `pkid` (`pkid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +PARTITION BY RANGE (MONTH(SALES_DATE)) +( + PARTITION p0 VALUES LESS THAN (2) ENGINE=INNODB + data DIRECTORY='c:/tmp/' + index DIRECTORY = 'c:/tmp/', + PARTITION p1 VALUES LESS THAN (3) ENGINE=INNODB + data DIRECTORY='c:/tmp/' + index DIRECTORY = 'c:/tmp/' +); + +DROP TABLE t1; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index d3979fa0718..3c25dcd202f 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1781,7 +1781,8 @@ int ha_partition::set_up_table_before_create(TABLE *table, } table->s->max_rows= part_elem->part_max_rows; table->s->min_rows= part_elem->part_min_rows; - partition_name= strrchr(partition_name_with_path, FN_LIBCHAR); + /* Here we have unified path so should always look for '/', not FN_LIBCHAR */ + partition_name= strrchr(partition_name_with_path, '/'); if ((part_elem->index_file_name && (error= append_file_to_dir(thd, (const char**)&part_elem->index_file_name, From 1686a01a268f64182c8b7a70841dd72ad2517348 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 17:54:37 +0200 Subject: [PATCH 592/789] changed supported sql function to inpuzt files. mysql-test/suite/funcs_1/r/a_version_check.result: new version mysql-test/suite/partitions/include/partition_supported_sql_funcs.inc: read data from file. mysql-test/suite/partitions/include/partition_supported_sql_funcs_delete.inc: read data from file. mysql-test/suite/partitions/include/partition_supported_sql_funcs_main.inc: read data from file. mysql-test/suite/partitions/r/partition_supported_sql_func_innodb.result: read data from file. mysql-test/suite/partitions/r/partition_supported_sql_func_myisam.result: read data from file. mysql-test/suite/partitions/t/disabled.def: added not executable test program. mysql-test/suite/partitions/t/partition_supported_sql_func_innodb.test: switched to long test. mysql-test/suite/partitions/t/partition_supported_sql_func_myisam.test: switched to long test BitKeeper/etc/ignore: Added mysql-test/suite/partitions/t/partition.test mysql-test/suite/partitions/r/dif mysql-test/suite/partitions/r/partition.result mysql-test/suite/partitions/r/partition_t55.out mysql-test/suite/partitions/r/partition_t55.refout to the ignore list mysql-test/suite/partitions/r/partition_supported_sql_func_ndb.result: new result file. mysql-test/suite/partitions/t/partition_supported_sql_func_ndb.test: ndb wrapper. mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in: inpu file. mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_date.in: input file mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_float.in: input file mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_int.in: input file mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_time.in: input file mysql-test/suite/partitions/r/partition_t55.out: reference fiel for output data to compare --- .bzrignore | 5 + .../suite/funcs_1/r/a_version_check.result | 2 +- .../include/partition_supported_sql_funcs.inc | 93 +- .../partition_supported_sql_funcs_delete.inc | 53 +- .../partition_supported_sql_funcs_int_ch1.in | 4 + .../partition_supported_sql_funcs_int_date.in | 4 + ...partition_supported_sql_funcs_int_float.in | 4 + .../partition_supported_sql_funcs_int_int.in | 45 + .../partition_supported_sql_funcs_int_time.in | 4 + .../partition_supported_sql_funcs_main.inc | 39 +- ...partition_supported_sql_func_innodb.result | 11023 +++++++++++-- ...partition_supported_sql_func_myisam.result | 11023 +++++++++++-- .../r/partition_supported_sql_func_ndb.result | 13724 ++++++++++++++++ .../suite/partitions/r/partition_t55.out | 68 + mysql-test/suite/partitions/t/disabled.def | 2 +- .../partition_supported_sql_func_innodb.test | 10 +- .../partition_supported_sql_func_myisam.test | 6 +- .../t/partition_supported_sql_func_ndb.test | 40 + 18 files changed, 34205 insertions(+), 1944 deletions(-) create mode 100644 mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in create mode 100644 mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_date.in create mode 100644 mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_float.in create mode 100644 mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_int.in create mode 100644 mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_time.in create mode 100644 mysql-test/suite/partitions/r/partition_supported_sql_func_ndb.result create mode 100644 mysql-test/suite/partitions/r/partition_t55.out create mode 100644 mysql-test/suite/partitions/t/partition_supported_sql_func_ndb.test diff --git a/.bzrignore b/.bzrignore index c04ce91b355..bb7712a277c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -2956,3 +2956,8 @@ win/vs71cache.txt win/vs8cache.txt zlib/*.ds? zlib/*.vcproj +mysql-test/suite/partitions/t/partition.test +mysql-test/suite/partitions/r/dif +mysql-test/suite/partitions/r/partition.result +mysql-test/suite/partitions/r/partition_t55.out +mysql-test/suite/partitions/r/partition_t55.refout diff --git a/mysql-test/suite/funcs_1/r/a_version_check.result b/mysql-test/suite/funcs_1/r/a_version_check.result index 1569c40e4e5..da6ba0846fd 100644 --- a/mysql-test/suite/funcs_1/r/a_version_check.result +++ b/mysql-test/suite/funcs_1/r/a_version_check.result @@ -6,6 +6,6 @@ . updated with each new version --- THIS IS INTENDED! -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -funcs_1 checked with version: 5.1.16 +funcs_1 checked with version: 5.1.17 Warnings: Warning 1548 Leading spaces are removed from name ' ' diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs.inc b/mysql-test/suite/partitions/include/partition_supported_sql_funcs.inc index f74fce39a7d..b2e102f8e07 100644 --- a/mysql-test/suite/partitions/include/partition_supported_sql_funcs.inc +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs.inc @@ -1,7 +1,7 @@ ################################################################################ -# t/partition_supported_sql_funcs.inc # # +# t/partition_supported_sql_funcs.inc # # # # Purpose: # -# Tests around sql functions # +# Tests frame for allowed sql functions # # # # # #------------------------------------------------------------------------------# @@ -83,24 +83,23 @@ eval insert into t3 values ($val1); eval insert into t3 values ($val2); eval insert into t3 values ($val3); -eval insert into t4 values (1,$val1); -eval insert into t4 values (2,$val2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval load data infile '$MYSQL_TEST_DIR/suite/partitions/include/$infile' into table t4; -eval insert into t5 values (1,$val1); -eval insert into t5 values (2,$val2); -eval insert into t5 values (3,$val3); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval load data infile '$MYSQL_TEST_DIR/suite/partitions/include/$infile' into table t5; -eval insert into t6 values (1,$val2); -eval insert into t6 values (2,$val3); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval load data infile '$MYSQL_TEST_DIR/suite/partitions/include/$infile' into table t6; -eval select $sqlfunc from t1; +eval select $sqlfunc from t1 order by col1; -select * from t1; -select * from t2; -select * from t3; -select * from t4; -select * from t5; -select * from t6; +select * from t1 order by col1; +select * from t2 order by col1; +select * from t3 order by col1; +select * from t4 order by colint; +select * from t5 order by colint; +select * from t6 order by colint; if ($do_long_tests) { @@ -111,12 +110,12 @@ if ($do_long_tests) eval update t5 set col1=$val4 where col1=$val1; eval update t6 set col1=$val4 where col1=$val1; - select * from t1; - select * from t2; - select * from t3; - select * from t4; - select * from t5; - select * from t6; + select * from t1 order by col1; + select * from t2 order by col1; + select * from t3 order by col1; + select * from t4 order by colint; + select * from t5 order by colint; + select * from t6 order by colint; } --echo ------------------------------------------------------------------------- @@ -175,46 +174,63 @@ partition by range(colint) (partition p0 values less than ($valsqlfunc), partition p1 values less than maxvalue); -select * from t11; -select * from t22; -select * from t33; -select * from t44; -select * from t55; -select * from t66; +select * from t11 order by col1; +select * from t22 order by col1; +select * from t33 order by col1; +select * from t44 order by colint; +select * from t55 order by colint; +select * from t66 order by colint; if ($do_long_tests) { + --echo --------------------------- + --echo ---- some alter table begin + --echo --------------------------- eval alter table t11 reorganize partition p0,p1 into (partition s1 values less than maxvalue); - select * from t11; + select * from t11 order by col1; eval alter table t11 reorganize partition s1 into (partition p0 values less than (15), partition p1 values less than maxvalue); - select * from t11; + select * from t11 order by col1; + +eval alter table t55 +partition by list(colint) +subpartition by hash($sqlfunc) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), + partition p1 values in (11,12,13,14,15,16,17,18,19,20), + partition p2 values in (21,22,23,24,25,26,27,28,29,30), + partition p3 values in (31,32,33,34,35,36,37,38,39,40), + partition p4 values in (41,42,43,44,45,46,47,48,49,50), + partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); + show create table t55; + select * from t55 order by colint; eval alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); - select * from t66; + select * from t66 order by colint; eval alter table t66 reorganize partition s1 into (partition p0 values less than ($valsqlfunc), partition p1 values less than maxvalue); - select * from t66; + select * from t66 order by colint; eval alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); - select * from t66; + select * from t66 order by colint; - eval alter table t66 - add partition s0 - (partition p0 values less than ($valsqlfunc); - select * fromt t66; + eval alter table t66 + reorganize partition s1 into + (partition p0 values less than ($valsqlfunc), + partition p1 values less than maxvalue); + select * from t66 order by colint; let $t1=t1; let $t2=t2; @@ -233,6 +249,9 @@ if ($do_long_tests) let $t6=t66; --source suite/partitions/include/partition_supported_sql_funcs_delete.inc # --source include/partition_supported_sql_funcs_delete.inc + --echo ------------------------- + --echo ---- some alter table end + --echo ------------------------- } --disable_warnings drop table if exists t1 ; diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_delete.inc b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_delete.inc index c733d750fab..76e8bd6dcc6 100644 --- a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_delete.inc +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_delete.inc @@ -1,3 +1,16 @@ +################################################################################ +# t/partition_supported_sql_funcs_delete.inc # # # +# Purpose: # +# Delete access of the tests frame for allowed sql functions # +# # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-11-22 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ --echo ------------------------------------------------------------------------- --echo --- Delete rows and partitions of tables with $sqlfunc --echo ------------------------------------------------------------------------- @@ -9,25 +22,25 @@ eval delete from $t4 where col1=$val2; eval delete from $t5 where col1=$val2; eval delete from $t6 where col1=$val2; -eval select * from $t1; -eval select * from $t2; -eval select * from $t3; -eval select * from $t4; -eval select * from $t5; +eval select * from $t1 order by col1; +eval select * from $t2 order by col1; +eval select * from $t3 order by col1; +eval select * from $t4 order by colint; +eval select * from $t5 order by colint; eval insert into $t1 values ($val2); eval insert into $t2 values ($val2); eval insert into $t3 values ($val2); -eval insert into $t4 values (4,$val2); -eval insert into $t5 values (4,$val2); -eval insert into $t6 values (4,$val2); +eval insert into $t4 values (60,$val2); +eval insert into $t5 values (60,$val2); +eval insert into $t6 values (60,$val2); -eval select * from $t1; -eval select * from $t2; -eval select * from $t3; -eval select * from $t4; -eval select * from $t5; -eval select * from $t6; +eval select * from $t1 order by col1; +eval select * from $t2 order by col1; +eval select * from $t3 order by col1; +eval select * from $t4 order by colint; +eval select * from $t5 order by colint; +eval select * from $t6 order by colint; eval alter table $t1 drop partition p0; eval alter table $t2 drop partition p0; @@ -35,9 +48,9 @@ eval alter table $t4 drop partition p0; eval alter table $t5 drop partition p0; eval alter table $t6 drop partition p0; -eval select * from $t1; -eval select * from $t2; -eval select * from $t3; -eval select * from $t4; -eval select * from $t5; -eval select * from $t6; +eval select * from $t1 order by col1; +eval select * from $t2 order by col1; +eval select * from $t3 order by col1; +eval select * from $t4 order by colint; +eval select * from $t5 order by colint; +eval select * from $t6 order by colint; diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in new file mode 100644 index 00000000000..8ae6e5fc807 --- /dev/null +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in @@ -0,0 +1,4 @@ +1 1 +2 9 +3 3 +4 8 \ No newline at end of file diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_date.in b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_date.in new file mode 100644 index 00000000000..9eb41fb007b --- /dev/null +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_date.in @@ -0,0 +1,4 @@ +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 \ No newline at end of file diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_float.in b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_float.in new file mode 100644 index 00000000000..34d8b1d1c4d --- /dev/null +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_float.in @@ -0,0 +1,4 @@ +1 5.1230 +2 13.345 +3 17.987 +4 15.654 diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_int.in b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_int.in new file mode 100644 index 00000000000..d2f5c82a241 --- /dev/null +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_int.in @@ -0,0 +1,45 @@ +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 \ No newline at end of file diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_time.in b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_time.in new file mode 100644 index 00000000000..941ba418f32 --- /dev/null +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_int_time.in @@ -0,0 +1,4 @@ +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 diff --git a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_main.inc b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_main.inc index ccfdd7a2ece..b0ec63d39a9 100644 --- a/mysql-test/suite/partitions/include/partition_supported_sql_funcs_main.inc +++ b/mysql-test/suite/partitions/include/partition_supported_sql_funcs_main.inc @@ -2,7 +2,7 @@ # t/partition_supported_sql_funcs_main.inc # # # # Purpose: # -# Tests around sql functions # +# Tests which SQL functions are allowed in partinioning clauses. # # # # # #------------------------------------------------------------------------------# @@ -11,12 +11,28 @@ # Change Author: # # Change Date: # # Change: # +# # +# This test uses a test frame (partition_supported_sql_funcs.inc) for every # +# SQL function allowed in the partitioning parts of CREATE and ALTE TABLE. # +# The variales represent the # +# - SQL function isself with a column (sqlfunc) and a literal (valsqlsunc), # +# - the type of the column (coltype), # +# - a file with test values of the coltype (infile) and # +# - single test values (val1 to val4). # +# The test frame includes CREATE/ALTER TABLE and some access statements. # +# Column types are int, float(7,4), char(1), date and time depending on the # +# SQL function. The test frame uses the include file # +# "partition_supported_sql_funcs_delete.inc" testing the deletion of # +# partitions. # +# The CREATE and ALTER TABLE statement do not cover the complete partitions # +# functions, but will ashure that the SQL functions are basically working. # ################################################################################ let $sqlfunc = abs(col1); let $valsqlfunc = abs(15); let $coltype = int; +let $infile = partition_supported_sql_funcs_int_int.in; let $val1 = 5 ; let $val2 = 13 ; let $val3 = 17 ; @@ -27,6 +43,7 @@ let $val4 = 15 ; let $sqlfunc = ascii(col1); let $valsqlfunc = ascii('5'); let $coltype = char(1); +let $infile = partition_supported_sql_funcs_int_ch1.in; let $val1 = '1'; let $val2 = '9'; let $val3 = '3'; @@ -37,6 +54,7 @@ let $val4 = '8'; let $sqlfunc = cast(ceiling(col1) as signed integer); let $valsqlfunc = cast(ceiling(15) as signed integer); let $coltype = float(7,4); +let $infile = partition_supported_sql_funcs_int_float.in; let $val1 = 5.1230; let $val2 = 13.345; let $val3 = 17.987; @@ -47,6 +65,7 @@ let $val4 = 15.654 ; let $sqlfunc = cast(floor(col1) as signed); let $valsqlfunc = cast(floor(15.123) as signed); let $coltype = float(7,4); +let $infile = partition_supported_sql_funcs_int_float.in; let $val1 = 5.1230; let $val2 = 13.345; let $val3 = 17.987; @@ -57,6 +76,7 @@ let $val4 = 15.654 ; let $sqlfunc = cast(mod(col1,10) as signed); let $valsqlfunc = cast(mod(15,10) as signed); let $coltype = float(7,4); +let $infile = partition_supported_sql_funcs_int_float.in; let $val1 = 5.0000; let $val2 = 19; let $val3 = 17; @@ -67,6 +87,7 @@ let $val4 = 15 ; let $sqlfunc = ord(col1); let $valsqlfunc = ord('a'); let $coltype = char(3); +let $infile = partition_supported_sql_funcs_int_ch1.in; let $val1 = '1'; let $val2 = '9'; let $val3 = '3'; @@ -77,6 +98,7 @@ let $val4 = '8'; let $sqlfunc = day(col1); let $valsqlfunc = day('2006-12-21'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-02-03'; let $val2 = '2006-01-17'; let $val3 = '2006-01-25'; @@ -87,6 +109,7 @@ let $val4 = '2006-02-05'; let $sqlfunc = dayofmonth(col1); let $valsqlfunc = dayofmonth('2006-12-24'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-02-03'; let $val2 = '2006-01-17'; let $val3 = '2006-01-25'; @@ -97,6 +120,7 @@ let $val4 = '2006-02-05'; let $sqlfunc = dayofweek(col1); let $valsqlfunc = dayofweek('2006-12-24'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-01-03'; let $val2 = '2006-02-17'; let $val3 = '2006-01-25'; @@ -107,6 +131,7 @@ let $val4 = '2006-02-05'; let $sqlfunc = dayofyear(col1); let $valsqlfunc = dayofyear('2006-12-25'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-01-03'; let $val2 = '2006-01-17'; let $val3 = '2006-02-25'; @@ -120,6 +145,7 @@ let $coltype = char(30); let $sqlfunc = extract(month from col1); let $valsqlfunc = extract(year from '1998-11-23'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-01-03'; let $val2 = '2006-02-17'; let $val3 = '2006-01-25'; @@ -130,6 +156,7 @@ let $val4 = '2006-02-05'; let $sqlfunc = hour(col1); let $valsqlfunc = hour('18:30'); let $coltype = time; +let $infile = partition_supported_sql_funcs_int_time.in; let $val1 = '09:09'; let $val2 = '14:30'; let $val3 = '21:59'; @@ -140,6 +167,7 @@ let $val4 = '10:30'; let $sqlfunc = microsecond(col1); let $valsqlfunc = microsecond('10:30:10.000010'); let $coltype = time; +let $infile = partition_supported_sql_funcs_int_time.in; let $val1 = '09:09:15.000002'; let $val2 = '04:30:01.000018'; let $val3 = '00:59:22.000024'; @@ -160,6 +188,7 @@ let $val4 = '10:24:23'; let $sqlfunc = second(col1); let $valsqlfunc = second('18:30:14'); let $coltype = time; +let $infile = partition_supported_sql_funcs_int_time.in; let $val1 = '09:09:09'; let $val2 = '14:30:20'; let $val3 = '21:59:22'; @@ -173,6 +202,7 @@ let $coltype = char(30); let $sqlfunc = month(col1); let $valsqlfunc = month('2006-10-14'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-01-03'; let $val2 = '2006-12-17'; let $val3 = '2006-05-25'; @@ -183,6 +213,7 @@ let $val4 = '2006-11-06'; let $sqlfunc = quarter(col1); let $valsqlfunc = quarter('2006-10-14'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-01-03'; let $val2 = '2006-12-17'; let $val3 = '2006-09-25'; @@ -193,6 +224,7 @@ let $val4 = '2006-07-30'; let $sqlfunc = time_to_sec(col1)-(time_to_sec(col1)-20); let $valsqlfunc = time_to_sec('18:30:14')-(time_to_sec('17:59:59')); let $coltype = time; +let $infile = partition_supported_sql_funcs_int_time.in; let $val1 = '09:09:15'; let $val2 = '14:30:45'; let $val3 = '21:59:22'; @@ -203,6 +235,7 @@ let $val4 = '10:33:11'; let $sqlfunc = to_days(col1)-to_days('2006-01-01'); let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-02-03'; let $val2 = '2006-01-17'; let $val3 = '2006-01-25'; @@ -213,6 +246,7 @@ let $val4 = '2006-02-06'; let $sqlfunc = weekday(col1); let $valsqlfunc = weekday('2006-10-14'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-12-03'; let $val2 = '2006-11-17'; let $val3 = '2006-05-25'; @@ -223,6 +257,7 @@ let $val4 = '2006-02-06'; let $sqlfunc = weekofyear(col1); let $valsqlfunc = weekofyear('2006-02-14'); let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-01-03'; let $val2 = '2006-03-17'; let $val3 = '2006-05-25'; @@ -233,6 +268,7 @@ let $val4 = '2006-09-06'; let $sqlfunc = year(col1)-1990; let $valsqlfunc = year('2005-10-14')-1990; let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '1996-01-03'; let $val2 = '2000-02-17'; let $val3 = '2004-05-25'; @@ -243,6 +279,7 @@ let $val4 = '2002-02-15'; let $sqlfunc = yearweek(col1)-200600; let $valsqlfunc = yearweek('2006-10-14')-200600; let $coltype = date; +let $infile = partition_supported_sql_funcs_int_date.in; let $val1 = '2006-01-03'; let $val2 = '2006-08-17'; let $val3 = '2006-03-25'; diff --git a/mysql-test/suite/partitions/r/partition_supported_sql_func_innodb.result b/mysql-test/suite/partitions/r/partition_supported_sql_func_innodb.result index bb25ac5fc73..196f7930bb0 100644 --- a/mysql-test/suite/partitions/r/partition_supported_sql_func_innodb.result +++ b/mysql-test/suite/partitions/r/partition_supported_sql_func_innodb.result @@ -55,44 +55,329 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); -insert into t4 values (1,5 ); -insert into t4 values (2,13 ); -insert into t5 values (1,5 ); -insert into t5 values (2,13 ); -insert into t5 values (3,17 ); -insert into t6 values (1,13 ); -insert into t6 values (2,17 ); -select abs(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t6; +select abs(col1) from t1 order by col1; abs(col1) 5 13 -select * from t1; +select * from t1 order by col1; col1 5 13 -select * from t2; +select * from t2 order by col1; col1 5 13 17 -select * from t3; +select * from t3 order by col1; col1 5 13 17 -select * from t4; +select * from t4 order by colint; colint col1 1 5 2 13 -select * from t5; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; colint col1 1 5 2 13 -3 17 -select * from t6; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; colint col1 -1 13 -2 17 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +update t1 set col1=15 where col1=5 ; +update t2 set col1=15 where col1=5 ; +update t3 set col1=15 where col1=5 ; +update t4 set col1=15 where col1=5 ; +update t5 set col1=15 where col1=5 ; +update t6 set col1=15 where col1=5 ; +select * from t1 order by col1; +col1 +13 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- --- Alter tables with abs(col1) ------------------------------------------------------------------------- @@ -142,33 +427,1241 @@ alter table t66 partition by range(colint) (partition p0 values less than (abs(15)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5 13 -select * from t22; +15 +select * from t22 order by col1; col1 -5 13 +15 17 -select * from t33; +select * from t33 order by col1; col1 -5 13 +15 17 -select * from t44; +select * from t44 order by colint; colint col1 -1 5 +1 15 2 13 -select * from t55; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t55 order by colint; colint col1 -1 5 +1 15 2 13 -3 17 -select * from t66; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t66 order by colint; colint col1 -1 13 -2 17 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13 +15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13 +15 +alter table t55 +partition by list(colint) +subpartition by hash(abs(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with abs(col1) +------------------------------------------------------------------------- +delete from t1 where col1=13 ; +delete from t2 where col1=13 ; +delete from t3 where col1=13 ; +delete from t4 where col1=13 ; +delete from t5 where col1=13 ; +delete from t6 where col1=13 ; +select * from t1 order by col1; +col1 +15 +select * from t2 order by col1; +col1 +15 +17 +select * from t3 order by col1; +col1 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +insert into t1 values (13 ); +insert into t2 values (13 ); +insert into t3 values (13 ); +insert into t4 values (60,13 ); +insert into t5 values (60,13 ); +insert into t6 values (60,13 ); +select * from t1 order by col1; +col1 +13 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t5 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t6 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t5 order by colint; +colint col1 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t6 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with abs(col1) +------------------------------------------------------------------------- +delete from t11 where col1=13 ; +delete from t22 where col1=13 ; +delete from t33 where col1=13 ; +delete from t44 where col1=13 ; +delete from t55 where col1=13 ; +delete from t66 where col1=13 ; +select * from t11 order by col1; +col1 +15 +select * from t22 order by col1; +col1 +15 +17 +select * from t33 order by col1; +col1 +15 +17 +select * from t44 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t55 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +insert into t11 values (13 ); +insert into t22 values (13 ); +insert into t33 values (13 ); +insert into t44 values (60,13 ); +insert into t55 values (60,13 ); +insert into t66 values (60,13 ); +select * from t11 order by col1; +col1 +13 +15 +select * from t22 order by col1; +col1 +13 +15 +17 +select * from t33 order by col1; +col1 +13 +15 +17 +select * from t44 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t55 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t66 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15 +select * from t22 order by col1; +col1 +13 +15 +17 +select * from t33 order by col1; +col1 +13 +15 +17 +select * from t44 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t55 order by colint; +colint col1 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t66 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -238,44 +1731,83 @@ insert into t2 values ('3'); insert into t3 values ('1'); insert into t3 values ('9'); insert into t3 values ('3'); -insert into t4 values (1,'1'); -insert into t4 values (2,'9'); -insert into t5 values (1,'1'); -insert into t5 values (2,'9'); -insert into t5 values (3,'3'); -insert into t6 values (1,'9'); -insert into t6 values (2,'3'); -select ascii(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; +select ascii(col1) from t1 order by col1; ascii(col1) 49 57 -select * from t1; +select * from t1 order by col1; col1 1 9 -select * from t2; +select * from t2 order by col1; col1 1 -9 3 -select * from t3; +9 +select * from t3 order by col1; col1 1 -9 3 -select * from t4; -colint col1 -1 1 -2 9 -select * from t5; +9 +select * from t4 order by colint; colint col1 1 1 2 9 3 3 -select * from t6; +4 8 +select * from t5 order by colint; colint col1 -1 9 -2 3 +1 1 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +update t1 set col1='8' where col1='1'; +update t2 set col1='8' where col1='1'; +update t3 set col1='8' where col1='1'; +update t4 set col1='8' where col1='1'; +update t5 set col1='8' where col1='1'; +update t6 set col1='8' where col1='1'; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 ------------------------------------------------------------------------- --- Alter tables with ascii(col1) ------------------------------------------------------------------------- @@ -325,33 +1857,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (ascii('5')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -1 +8 9 -select * from t22; +select * from t22 order by col1; col1 -1 -9 3 -select * from t33; -col1 -1 +8 9 +select * from t33 order by col1; +col1 3 -select * from t44; +8 +9 +select * from t44 order by colint; colint col1 -1 1 -2 9 -select * from t55; -colint col1 -1 1 +1 8 2 9 3 3 -select * from t66; +4 8 +select * from t55 order by colint; colint col1 -1 9 -2 3 +1 8 +2 9 +3 3 +4 8 +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t55 +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(1) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ascii(col1) +------------------------------------------------------------------------- +delete from t1 where col1='9'; +delete from t2 where col1='9'; +delete from t3 where col1='9'; +delete from t4 where col1='9'; +delete from t5 where col1='9'; +delete from t6 where col1='9'; +select * from t1 order by col1; +col1 +8 +select * from t2 order by col1; +col1 +3 +8 +select * from t3 order by col1; +col1 +3 +8 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t1 values ('9'); +insert into t2 values ('9'); +insert into t3 values ('9'); +insert into t4 values (60,'9'); +insert into t5 values (60,'9'); +insert into t6 values (60,'9'); +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t6 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +60 9 +select * from t5 order by colint; +colint col1 +60 9 +select * from t6 order by colint; +colint col1 +60 9 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ascii(col1) +------------------------------------------------------------------------- +delete from t11 where col1='9'; +delete from t22 where col1='9'; +delete from t33 where col1='9'; +delete from t44 where col1='9'; +delete from t55 where col1='9'; +delete from t66 where col1='9'; +select * from t11 order by col1; +col1 +8 +select * from t22 order by col1; +col1 +3 +8 +select * from t33 order by col1; +col1 +3 +8 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t11 values ('9'); +insert into t22 values ('9'); +insert into t33 values ('9'); +insert into t44 values (60,'9'); +insert into t55 values (60,'9'); +insert into t66 values (60,'9'); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t66 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +60 9 +select * from t55 order by colint; +colint col1 +60 9 +select * from t66 order by colint; +colint col1 +60 9 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -421,44 +2231,83 @@ insert into t2 values (17.987); insert into t3 values (5.1230); insert into t3 values (13.345); insert into t3 values (17.987); -insert into t4 values (1,5.1230); -insert into t4 values (2,13.345); -insert into t5 values (1,5.1230); -insert into t5 values (2,13.345); -insert into t5 values (3,17.987); -insert into t6 values (1,13.345); -insert into t6 values (2,17.987); -select cast(ceiling(col1) as signed integer) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(ceiling(col1) as signed integer) from t1 order by col1; cast(ceiling(col1) as signed integer) 6 14 -select * from t1; +select * from t1 order by col1; col1 5.1230 13.3450 -select * from t2; +select * from t2 order by col1; col1 5.1230 13.3450 17.9870 -select * from t3; +select * from t3 order by col1; col1 5.1230 13.3450 17.9870 -select * from t4; -colint col1 -1 5.1230 -2 13.3450 -select * from t5; +select * from t4 order by colint; colint col1 1 5.1230 2 13.3450 3 17.9870 -select * from t6; +4 15.6540 +select * from t5 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15.654 where col1=5.1230; +update t2 set col1=15.654 where col1=5.1230; +update t3 set col1=15.654 where col1=5.1230; +update t4 set col1=15.654 where col1=5.1230; +update t5 set col1=15.654 where col1=5.1230; +update t6 set col1=15.654 where col1=5.1230; +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 ------------------------------------------------------------------------- --- Alter tables with cast(ceiling(col1) as signed integer) ------------------------------------------------------------------------- @@ -508,33 +2357,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (cast(ceiling(15) as signed integer)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5.1230 13.3450 -select * from t22; +15.6540 +select * from t22 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t33; +select * from t33 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t44; +select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -select * from t55; -colint col1 -1 5.1230 +1 15.6540 2 13.3450 3 17.9870 -select * from t66; +4 15.6540 +select * from t55 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t55 +partition by list(colint) +subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +delete from t1 where col1=13.345; +delete from t2 where col1=13.345; +delete from t3 where col1=13.345; +delete from t4 where col1=13.345; +delete from t5 where col1=13.345; +delete from t6 where col1=13.345; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t1 values (13.345); +insert into t2 values (13.345); +insert into t3 values (13.345); +insert into t4 values (60,13.345); +insert into t5 values (60,13.345); +insert into t6 values (60,13.345); +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t6 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +60 13.3450 +select * from t5 order by colint; +colint col1 +60 13.3450 +select * from t6 order by colint; +colint col1 +60 13.3450 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +delete from t11 where col1=13.345; +delete from t22 where col1=13.345; +delete from t33 where col1=13.345; +delete from t44 where col1=13.345; +delete from t55 where col1=13.345; +delete from t66 where col1=13.345; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t11 values (13.345); +insert into t22 values (13.345); +insert into t33 values (13.345); +insert into t44 values (60,13.345); +insert into t55 values (60,13.345); +insert into t66 values (60,13.345); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t66 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +60 13.3450 +select * from t55 order by colint; +colint col1 +60 13.3450 +select * from t66 order by colint; +colint col1 +60 13.3450 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -604,44 +2729,83 @@ insert into t2 values (17.987); insert into t3 values (5.1230); insert into t3 values (13.345); insert into t3 values (17.987); -insert into t4 values (1,5.1230); -insert into t4 values (2,13.345); -insert into t5 values (1,5.1230); -insert into t5 values (2,13.345); -insert into t5 values (3,17.987); -insert into t6 values (1,13.345); -insert into t6 values (2,17.987); -select cast(floor(col1) as signed) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(floor(col1) as signed) from t1 order by col1; cast(floor(col1) as signed) 5 13 -select * from t1; +select * from t1 order by col1; col1 5.1230 13.3450 -select * from t2; +select * from t2 order by col1; col1 5.1230 13.3450 17.9870 -select * from t3; +select * from t3 order by col1; col1 5.1230 13.3450 17.9870 -select * from t4; -colint col1 -1 5.1230 -2 13.3450 -select * from t5; +select * from t4 order by colint; colint col1 1 5.1230 2 13.3450 3 17.9870 -select * from t6; +4 15.6540 +select * from t5 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15.654 where col1=5.1230; +update t2 set col1=15.654 where col1=5.1230; +update t3 set col1=15.654 where col1=5.1230; +update t4 set col1=15.654 where col1=5.1230; +update t5 set col1=15.654 where col1=5.1230; +update t6 set col1=15.654 where col1=5.1230; +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 ------------------------------------------------------------------------- --- Alter tables with cast(floor(col1) as signed) ------------------------------------------------------------------------- @@ -691,33 +2855,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (cast(floor(15.123) as signed)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5.1230 13.3450 -select * from t22; +15.6540 +select * from t22 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t33; +select * from t33 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t44; +select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -select * from t55; -colint col1 -1 5.1230 +1 15.6540 2 13.3450 3 17.9870 -select * from t66; +4 15.6540 +select * from t55 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t55 +partition by list(colint) +subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +delete from t1 where col1=13.345; +delete from t2 where col1=13.345; +delete from t3 where col1=13.345; +delete from t4 where col1=13.345; +delete from t5 where col1=13.345; +delete from t6 where col1=13.345; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t1 values (13.345); +insert into t2 values (13.345); +insert into t3 values (13.345); +insert into t4 values (60,13.345); +insert into t5 values (60,13.345); +insert into t6 values (60,13.345); +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t6 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +60 13.3450 +select * from t5 order by colint; +colint col1 +60 13.3450 +select * from t6 order by colint; +colint col1 +60 13.3450 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +delete from t11 where col1=13.345; +delete from t22 where col1=13.345; +delete from t33 where col1=13.345; +delete from t44 where col1=13.345; +delete from t55 where col1=13.345; +delete from t66 where col1=13.345; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t11 values (13.345); +insert into t22 values (13.345); +insert into t33 values (13.345); +insert into t44 values (60,13.345); +insert into t55 values (60,13.345); +insert into t66 values (60,13.345); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t66 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +60 13.3450 +select * from t55 order by colint; +colint col1 +60 13.3450 +select * from t66 order by colint; +colint col1 +60 13.3450 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -787,44 +3227,83 @@ insert into t2 values (17); insert into t3 values (5.0000); insert into t3 values (19); insert into t3 values (17); -insert into t4 values (1,5.0000); -insert into t4 values (2,19); -insert into t5 values (1,5.0000); -insert into t5 values (2,19); -insert into t5 values (3,17); -insert into t6 values (1,19); -insert into t6 values (2,17); -select cast(mod(col1,10) as signed) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(mod(col1,10) as signed) from t1 order by col1; cast(mod(col1,10) as signed) 5 9 -select * from t1; +select * from t1 order by col1; col1 5.0000 19.0000 -select * from t2; +select * from t2 order by col1; col1 5.0000 -19.0000 17.0000 -select * from t3; +19.0000 +select * from t3 order by col1; col1 5.0000 -19.0000 17.0000 -select * from t4; +19.0000 +select * from t4 order by colint; colint col1 -1 5.0000 -2 19.0000 -select * from t5; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; colint col1 -1 5.0000 -2 19.0000 -3 17.0000 -select * from t6; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; colint col1 -1 19.0000 -2 17.0000 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15 where col1=5.0000; +update t2 set col1=15 where col1=5.0000; +update t3 set col1=15 where col1=5.0000; +update t4 set col1=15 where col1=5.0000; +update t5 set col1=15 where col1=5.0000; +update t6 set col1=15 where col1=5.0000; +select * from t1 order by col1; +col1 +15.0000 +19.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 ------------------------------------------------------------------------- --- Alter tables with cast(mod(col1,10) as signed) ------------------------------------------------------------------------- @@ -874,33 +3353,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (cast(mod(15,10) as signed)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5.0000 +15.0000 19.0000 -select * from t22; +select * from t22 order by col1; col1 -5.0000 -19.0000 +15.0000 17.0000 -select * from t33; -col1 -5.0000 19.0000 +select * from t33 order by col1; +col1 +15.0000 17.0000 -select * from t44; +19.0000 +select * from t44 order by colint; colint col1 -1 5.0000 -2 19.0000 -select * from t55; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; colint col1 -1 5.0000 -2 19.0000 -3 17.0000 -select * from t66; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; colint col1 -1 19.0000 -2 17.0000 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +alter table t55 +partition by list(colint) +subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +delete from t1 where col1=19; +delete from t2 where col1=19; +delete from t3 where col1=19; +delete from t4 where col1=19; +delete from t5 where col1=19; +delete from t6 where col1=19; +select * from t1 order by col1; +col1 +15.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +insert into t1 values (19); +insert into t2 values (19); +insert into t3 values (19); +insert into t4 values (60,19); +insert into t5 values (60,19); +insert into t6 values (60,19); +select * from t1 order by col1; +col1 +15.0000 +19.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +60 19.0000 +select * from t5 order by colint; +colint col1 +60 19.0000 +select * from t6 order by colint; +colint col1 +60 19.0000 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +delete from t11 where col1=19; +delete from t22 where col1=19; +delete from t33 where col1=19; +delete from t44 where col1=19; +delete from t55 where col1=19; +delete from t66 where col1=19; +select * from t11 order by col1; +col1 +15.0000 +select * from t22 order by col1; +col1 +15.0000 +17.0000 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +select * from t44 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +insert into t11 values (19); +insert into t22 values (19); +insert into t33 values (19); +insert into t44 values (60,19); +insert into t55 values (60,19); +insert into t66 values (60,19); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +select * from t22 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t44 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t44 order by colint; +colint col1 +60 19.0000 +select * from t55 order by colint; +colint col1 +60 19.0000 +select * from t66 order by colint; +colint col1 +60 19.0000 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -970,44 +3727,83 @@ insert into t2 values ('3'); insert into t3 values ('1'); insert into t3 values ('9'); insert into t3 values ('3'); -insert into t4 values (1,'1'); -insert into t4 values (2,'9'); -insert into t5 values (1,'1'); -insert into t5 values (2,'9'); -insert into t5 values (3,'3'); -insert into t6 values (1,'9'); -insert into t6 values (2,'3'); -select ord(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; +select ord(col1) from t1 order by col1; ord(col1) 49 57 -select * from t1; +select * from t1 order by col1; col1 1 9 -select * from t2; +select * from t2 order by col1; col1 1 -9 3 -select * from t3; +9 +select * from t3 order by col1; col1 1 -9 3 -select * from t4; -colint col1 -1 1 -2 9 -select * from t5; +9 +select * from t4 order by colint; colint col1 1 1 2 9 3 3 -select * from t6; +4 8 +select * from t5 order by colint; colint col1 -1 9 -2 3 +1 1 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +update t1 set col1='8' where col1='1'; +update t2 set col1='8' where col1='1'; +update t3 set col1='8' where col1='1'; +update t4 set col1='8' where col1='1'; +update t5 set col1='8' where col1='1'; +update t6 set col1='8' where col1='1'; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 ------------------------------------------------------------------------- --- Alter tables with ord(col1) ------------------------------------------------------------------------- @@ -1057,33 +3853,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (ord('a')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -1 +8 9 -select * from t22; +select * from t22 order by col1; col1 -1 -9 3 -select * from t33; -col1 -1 +8 9 +select * from t33 order by col1; +col1 3 -select * from t44; +8 +9 +select * from t44 order by colint; colint col1 -1 1 -2 9 -select * from t55; -colint col1 -1 1 +1 8 2 9 3 3 -select * from t66; +4 8 +select * from t55 order by colint; colint col1 -1 9 -2 3 +1 8 +2 9 +3 3 +4 8 +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t55 +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(3) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ord(col1) +------------------------------------------------------------------------- +delete from t1 where col1='9'; +delete from t2 where col1='9'; +delete from t3 where col1='9'; +delete from t4 where col1='9'; +delete from t5 where col1='9'; +delete from t6 where col1='9'; +select * from t1 order by col1; +col1 +8 +select * from t2 order by col1; +col1 +3 +8 +select * from t3 order by col1; +col1 +3 +8 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t1 values ('9'); +insert into t2 values ('9'); +insert into t3 values ('9'); +insert into t4 values (60,'9'); +insert into t5 values (60,'9'); +insert into t6 values (60,'9'); +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t6 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +60 9 +select * from t5 order by colint; +colint col1 +60 9 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ord(col1) +------------------------------------------------------------------------- +delete from t11 where col1='9'; +delete from t22 where col1='9'; +delete from t33 where col1='9'; +delete from t44 where col1='9'; +delete from t55 where col1='9'; +delete from t66 where col1='9'; +select * from t11 order by col1; +col1 +8 +select * from t22 order by col1; +col1 +3 +8 +select * from t33 order by col1; +col1 +3 +8 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t11 values ('9'); +insert into t22 values ('9'); +insert into t33 values ('9'); +insert into t44 values (60,'9'); +insert into t55 values (60,'9'); +insert into t66 values (60,'9'); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t66 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +60 9 +select * from t55 order by colint; +colint col1 +60 9 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1153,44 +4225,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-02-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-02-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-01-25'); -select day(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select day(col1) from t1 order by col1; day(col1) -3 17 -select * from t1; +3 +select * from t1 order by col1; col1 -2006-02-03 2006-01-17 -select * from t2; -col1 2006-02-03 +select * from t2 order by col1; +col1 2006-01-17 2006-01-25 -select * from t3; -col1 2006-02-03 +select * from t3 order by col1; +col1 2006-01-17 2006-01-25 -select * from t4; -colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t5; +2006-02-03 +select * from t4 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-02-03'; +update t2 set col1='2006-02-05' where col1='2006-02-03'; +update t3 set col1='2006-02-05' where col1='2006-02-03'; +update t4 set col1='2006-02-05' where col1='2006-02-03'; +update t5 set col1='2006-02-05' where col1='2006-02-03'; +update t6 set col1='2006-02-05' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with day(col1) ------------------------------------------------------------------------- @@ -1240,33 +4351,307 @@ alter table t66 partition by range(colint) (partition p0 values less than (day('2006-12-21')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-02-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t33; +2006-02-05 +select * from t33 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t44; +2006-02-05 +select * from t44 order by colint; colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t55; -colint col1 -1 2006-02-03 +1 2006-02-05 2 2006-01-17 3 2006-01-25 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(day(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with day(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with day(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1336,44 +4721,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-02-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-02-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-01-25'); -select dayofmonth(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofmonth(col1) from t1 order by col1; dayofmonth(col1) -3 17 -select * from t1; +3 +select * from t1 order by col1; col1 -2006-02-03 2006-01-17 -select * from t2; -col1 2006-02-03 +select * from t2 order by col1; +col1 2006-01-17 2006-01-25 -select * from t3; -col1 2006-02-03 +select * from t3 order by col1; +col1 2006-01-17 2006-01-25 -select * from t4; -colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t5; +2006-02-03 +select * from t4 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-02-03'; +update t2 set col1='2006-02-05' where col1='2006-02-03'; +update t3 set col1='2006-02-05' where col1='2006-02-03'; +update t4 set col1='2006-02-05' where col1='2006-02-03'; +update t5 set col1='2006-02-05' where col1='2006-02-03'; +update t6 set col1='2006-02-05' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofmonth(col1) ------------------------------------------------------------------------- @@ -1423,33 +4847,307 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofmonth('2006-12-24')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-02-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t33; +2006-02-05 +select * from t33 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t44; +2006-02-05 +select * from t44 order by colint; colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t55; -colint col1 -1 2006-02-03 +1 2006-02-05 2 2006-01-17 3 2006-01-25 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofmonth(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofmonth(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1519,44 +5217,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-02-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-02-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-02-17'); -insert into t6 values (2,'2006-01-25'); -select dayofweek(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofweek(col1) from t1 order by col1; dayofweek(col1) 3 6 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-02-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t3; +2006-02-17 +select * from t3 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t4; +2006-02-17 +select * from t4 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t5; -colint col1 -2 2006-02-17 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -1 2006-01-03 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofweek(col1) ------------------------------------------------------------------------- @@ -1606,33 +5343,319 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofweek('2006-12-24')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-02-05 2006-02-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 -2006-02-17 2006-01-25 -select * from t33; -col1 -2006-01-03 +2006-02-05 2006-02-17 +select * from t33 order by col1; +col1 2006-01-25 -select * from t44; +2006-02-05 +2006-02-17 +select * from t44 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t55; -colint col1 -2 2006-02-17 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -1 2006-01-03 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t55 +partition by list(colint) +subpartition by hash(dayofweek(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofweek(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-02-17'; +delete from t2 where col1='2006-02-17'; +delete from t3 where col1='2006-02-17'; +delete from t4 where col1='2006-02-17'; +delete from t5 where col1='2006-02-17'; +delete from t6 where col1='2006-02-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-02-17'); +insert into t3 values ('2006-02-17'); +insert into t4 values (60,'2006-02-17'); +insert into t5 values (60,'2006-02-17'); +insert into t6 values (60,'2006-02-17'); +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofweek(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-02-17'; +delete from t22 where col1='2006-02-17'; +delete from t33 where col1='2006-02-17'; +delete from t44 where col1='2006-02-17'; +delete from t55 where col1='2006-02-17'; +delete from t66 where col1='2006-02-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-02-17'); +insert into t22 values ('2006-02-17'); +insert into t33 values ('2006-02-17'); +insert into t44 values (60,'2006-02-17'); +insert into t55 values (60,'2006-02-17'); +insert into t66 values (60,'2006-02-17'); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1702,44 +5725,83 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-02-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-02-25'); -select dayofyear(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 17 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-01-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t5; +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t6; +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -1789,33 +5851,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofyear('2006-12-25')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t33; +select * from t33 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t44; +select * from t44 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t55; +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t66; +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1885,44 +6223,83 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-02-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-02-25'); -select dayofyear(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 17 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-01-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t5; +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t6; +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -1972,33 +6349,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofyear('2006-12-25')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t33; +select * from t33 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t44; +select * from t44 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t55; +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t66; +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2068,44 +6721,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-02-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-02-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-02-17'); -insert into t6 values (2,'2006-01-25'); -select extract(month from col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select extract(month from col1) from t1 order by col1; extract(month from col1) 1 2 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-02-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t3; +2006-02-17 +select * from t3 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t4; +2006-02-17 +select * from t4 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t5; -colint col1 -2 2006-02-17 -1 2006-01-03 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with extract(month from col1) ------------------------------------------------------------------------- @@ -2155,33 +6847,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (extract(year from '1998-11-23')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-02-05 2006-02-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 -2006-02-17 2006-01-25 -select * from t33; -col1 -2006-01-03 +2006-02-05 2006-02-17 +select * from t33 order by col1; +col1 2006-01-25 -select * from t44; +2006-02-05 +2006-02-17 +select * from t44 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t55; -colint col1 -2 2006-02-17 -1 2006-01-03 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t55 +partition by list(colint) +subpartition by hash(extract(month from col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with extract(month from col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-02-17'; +delete from t2 where col1='2006-02-17'; +delete from t3 where col1='2006-02-17'; +delete from t4 where col1='2006-02-17'; +delete from t5 where col1='2006-02-17'; +delete from t6 where col1='2006-02-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-02-17'); +insert into t3 values ('2006-02-17'); +insert into t4 values (60,'2006-02-17'); +insert into t5 values (60,'2006-02-17'); +insert into t6 values (60,'2006-02-17'); +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with extract(month from col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-02-17'; +delete from t22 where col1='2006-02-17'; +delete from t33 where col1='2006-02-17'; +delete from t44 where col1='2006-02-17'; +delete from t55 where col1='2006-02-17'; +delete from t66 where col1='2006-02-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-02-17'); +insert into t22 values ('2006-02-17'); +insert into t33 values ('2006-02-17'); +insert into t44 values (60,'2006-02-17'); +insert into t55 values (60,'2006-02-17'); +insert into t66 values (60,'2006-02-17'); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2251,44 +7219,83 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); -insert into t4 values (1,'09:09'); -insert into t4 values (2,'14:30'); -insert into t5 values (1,'09:09'); -insert into t5 values (2,'14:30'); -insert into t5 values (3,'21:59'); -insert into t6 values (1,'14:30'); -insert into t6 values (2,'21:59'); -select hour(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select hour(col1) from t1 order by col1; hour(col1) 9 14 -select * from t1; +select * from t1 order by col1; col1 09:09:00 14:30:00 -select * from t2; +select * from t2 order by col1; col1 09:09:00 14:30:00 21:59:00 -select * from t3; +select * from t3 order by col1; col1 09:09:00 14:30:00 21:59:00 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -select * from t5; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -3 21:59:00 -select * from t6; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:00 -2 21:59:00 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:30' where col1='09:09'; +update t2 set col1='10:30' where col1='09:09'; +update t3 set col1='10:30' where col1='09:09'; +update t4 set col1='10:30' where col1='09:09'; +update t5 set col1='10:30' where col1='09:09'; +update t6 set col1='10:30' where col1='09:09'; +select * from t1 order by col1; +col1 +10:30:00 +14:30:00 +select * from t2 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with hour(col1) ------------------------------------------------------------------------- @@ -2338,33 +7345,315 @@ alter table t66 partition by range(colint) (partition p0 values less than (hour('18:30')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:00 +10:30:00 14:30:00 -select * from t22; +select * from t22 order by col1; col1 -09:09:00 +10:30:00 14:30:00 21:59:00 -select * from t33; +select * from t33 order by col1; col1 -09:09:00 +10:30:00 14:30:00 21:59:00 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -select * from t55; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -3 21:59:00 -select * from t66; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:00 -2 21:59:00 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +alter table t55 +partition by list(colint) +subpartition by hash(hour(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with hour(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30'; +delete from t2 where col1='14:30'; +delete from t3 where col1='14:30'; +delete from t4 where col1='14:30'; +delete from t5 where col1='14:30'; +delete from t6 where col1='14:30'; +select * from t1 order by col1; +col1 +10:30:00 +select * from t2 order by col1; +col1 +10:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30'); +insert into t2 values ('14:30'); +insert into t3 values ('14:30'); +insert into t4 values (60,'14:30'); +insert into t5 values (60,'14:30'); +insert into t6 values (60,'14:30'); +select * from t1 order by col1; +col1 +10:30:00 +14:30:00 +select * from t2 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +60 14:30:00 +select * from t5 order by colint; +colint col1 +60 14:30:00 +select * from t6 order by colint; +colint col1 +60 14:30:00 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with hour(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30'; +delete from t22 where col1='14:30'; +delete from t33 where col1='14:30'; +delete from t44 where col1='14:30'; +delete from t55 where col1='14:30'; +delete from t66 where col1='14:30'; +select * from t11 order by col1; +col1 +10:30:00 +select * from t22 order by col1; +col1 +10:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30'); +insert into t22 values ('14:30'); +insert into t33 values ('14:30'); +insert into t44 values (60,'14:30'); +insert into t55 values (60,'14:30'); +insert into t66 values (60,'14:30'); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +select * from t22 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +14:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +60 14:30:00 +select * from t55 order by colint; +colint col1 +60 14:30:00 +select * from t66 order by colint; +colint col1 +60 14:30:00 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2434,44 +7723,83 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); -insert into t4 values (1,'09:09:15.000002'); -insert into t4 values (2,'04:30:01.000018'); -insert into t5 values (1,'09:09:15.000002'); -insert into t5 values (2,'04:30:01.000018'); -insert into t5 values (3,'00:59:22.000024'); -insert into t6 values (1,'04:30:01.000018'); -insert into t6 values (2,'00:59:22.000024'); -select microsecond(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select microsecond(col1) from t1 order by col1; microsecond(col1) 0 0 -select * from t1; +select * from t1 order by col1; col1 -09:09:15 04:30:01 -select * from t2; +09:09:15 +select * from t2 order by col1; col1 -09:09:15 -04:30:01 00:59:22 -select * from t3; -col1 -09:09:15 04:30:01 +09:09:15 +select * from t3 order by col1; +col1 00:59:22 -select * from t4; -colint col1 -1 09:09:15 -2 04:30:01 -select * from t5; +04:30:01 +09:09:15 +select * from t4 order by colint; colint col1 1 09:09:15 2 04:30:01 3 00:59:22 -select * from t6; +4 05:30:34 +select * from t5 order by colint; colint col1 -1 04:30:01 -2 00:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t2 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t3 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t4 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t5 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t6 set col1='05:30:34.000037' where col1='09:09:15.000002'; +select * from t1 order by col1; +col1 +04:30:01 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with microsecond(col1) ------------------------------------------------------------------------- @@ -2521,33 +7849,301 @@ alter table t66 partition by range(colint) (partition p0 values less than (microsecond('10:30:10.000010')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:15 04:30:01 -select * from t22; +05:30:34 +select * from t22 order by col1; col1 -09:09:15 -04:30:01 00:59:22 -select * from t33; -col1 -09:09:15 04:30:01 +05:30:34 +select * from t33 order by col1; +col1 00:59:22 -select * from t44; +04:30:01 +05:30:34 +select * from t44 order by colint; colint col1 -1 09:09:15 -2 04:30:01 -select * from t55; -colint col1 -1 09:09:15 +1 05:30:34 2 04:30:01 3 00:59:22 -select * from t66; +4 05:30:34 +select * from t55 order by colint; colint col1 -1 04:30:01 -2 00:59:22 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +alter table t55 +partition by list(colint) +subpartition by hash(microsecond(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with microsecond(col1) +------------------------------------------------------------------------- +delete from t1 where col1='04:30:01.000018'; +delete from t2 where col1='04:30:01.000018'; +delete from t3 where col1='04:30:01.000018'; +delete from t4 where col1='04:30:01.000018'; +delete from t5 where col1='04:30:01.000018'; +delete from t6 where col1='04:30:01.000018'; +select * from t1 order by col1; +col1 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +insert into t1 values ('04:30:01.000018'); +insert into t2 values ('04:30:01.000018'); +insert into t3 values ('04:30:01.000018'); +insert into t4 values (60,'04:30:01.000018'); +insert into t5 values (60,'04:30:01.000018'); +insert into t6 values (60,'04:30:01.000018'); +select * from t1 order by col1; +col1 +04:30:01 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t5 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t6 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +60 04:30:01 +select * from t5 order by colint; +colint col1 +60 04:30:01 +select * from t6 order by colint; +colint col1 +60 04:30:01 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with microsecond(col1) +------------------------------------------------------------------------- +delete from t11 where col1='04:30:01.000018'; +delete from t22 where col1='04:30:01.000018'; +delete from t33 where col1='04:30:01.000018'; +delete from t44 where col1='04:30:01.000018'; +delete from t55 where col1='04:30:01.000018'; +delete from t66 where col1='04:30:01.000018'; +select * from t11 order by col1; +col1 +05:30:34 +select * from t22 order by col1; +col1 +00:59:22 +05:30:34 +select * from t33 order by col1; +col1 +00:59:22 +05:30:34 +select * from t44 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +insert into t11 values ('04:30:01.000018'); +insert into t22 values ('04:30:01.000018'); +insert into t33 values ('04:30:01.000018'); +insert into t44 values (60,'04:30:01.000018'); +insert into t55 values (60,'04:30:01.000018'); +insert into t66 values (60,'04:30:01.000018'); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +select * from t22 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t33 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t44 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t55 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t66 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t44 order by colint; +colint col1 +60 04:30:01 +select * from t55 order by colint; +colint col1 +60 04:30:01 +select * from t66 order by colint; +colint col1 +60 04:30:01 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2617,44 +8213,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:15'); -insert into t4 values (2,'14:30:45'); -insert into t5 values (1,'09:09:15'); -insert into t5 values (2,'14:30:45'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:45'); -insert into t6 values (2,'21:59:22'); -select minute(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select minute(col1) from t1 order by col1; minute(col1) 9 30 -select * from t1; +select * from t1 order by col1; col1 09:09:15 14:30:45 -select * from t2; +select * from t2 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:45 1 09:09:15 -select * from t5; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 -2 14:30:45 1 09:09:15 -3 21:59:22 -select * from t6; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:24:23' where col1='09:09:15'; +update t2 set col1='10:24:23' where col1='09:09:15'; +update t3 set col1='10:24:23' where col1='09:09:15'; +update t4 set col1='10:24:23' where col1='09:09:15'; +update t5 set col1='10:24:23' where col1='09:09:15'; +update t6 set col1='10:24:23' where col1='09:09:15'; +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with minute(col1) ------------------------------------------------------------------------- @@ -2704,33 +8339,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (minute('18:30')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:15 +10:24:23 14:30:45 -select * from t22; +select * from t22 order by col1; col1 -09:09:15 +10:24:23 14:30:45 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:15 +10:24:23 14:30:45 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:45 -1 09:09:15 -select * from t55; +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -2 14:30:45 -1 09:09:15 -3 21:59:22 -select * from t66; +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +alter table t55 +partition by list(colint) +subpartition by hash(minute(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with minute(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:45'; +delete from t2 where col1='14:30:45'; +delete from t3 where col1='14:30:45'; +delete from t4 where col1='14:30:45'; +delete from t5 where col1='14:30:45'; +delete from t6 where col1='14:30:45'; +select * from t1 order by col1; +col1 +10:24:23 +select * from t2 order by col1; +col1 +10:24:23 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:45'); +insert into t2 values ('14:30:45'); +insert into t3 values ('14:30:45'); +insert into t4 values (60,'14:30:45'); +insert into t5 values (60,'14:30:45'); +insert into t6 values (60,'14:30:45'); +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t6 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:45 +select * from t5 order by colint; +colint col1 +60 14:30:45 +select * from t6 order by colint; +colint col1 +60 14:30:45 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with minute(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:45'; +delete from t22 where col1='14:30:45'; +delete from t33 where col1='14:30:45'; +delete from t44 where col1='14:30:45'; +delete from t55 where col1='14:30:45'; +delete from t66 where col1='14:30:45'; +select * from t11 order by col1; +col1 +10:24:23 +select * from t22 order by col1; +col1 +10:24:23 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:45'); +insert into t22 values ('14:30:45'); +insert into t33 values ('14:30:45'); +insert into t44 values (60,'14:30:45'); +insert into t55 values (60,'14:30:45'); +insert into t66 values (60,'14:30:45'); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +select * from t22 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +select * from t22 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:45 +select * from t55 order by colint; +colint col1 +60 14:30:45 +select * from t66 order by colint; +colint col1 +60 14:30:45 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2800,44 +8723,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:09'); -insert into t4 values (2,'14:30:20'); -insert into t5 values (1,'09:09:09'); -insert into t5 values (2,'14:30:20'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:20'); -insert into t6 values (2,'21:59:22'); -select second(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select second(col1) from t1 order by col1; second(col1) 9 20 -select * from t1; +select * from t1 order by col1; col1 09:09:09 14:30:20 -select * from t2; +select * from t2 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t5; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t6; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:22:33' where col1='09:09:09'; +update t2 set col1='10:22:33' where col1='09:09:09'; +update t3 set col1='10:22:33' where col1='09:09:09'; +update t4 set col1='10:22:33' where col1='09:09:09'; +update t5 set col1='10:22:33' where col1='09:09:09'; +update t6 set col1='10:22:33' where col1='09:09:09'; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with second(col1) ------------------------------------------------------------------------- @@ -2887,33 +8849,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (second('18:30:14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:09 +10:22:33 14:30:20 -select * from t22; +select * from t22 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t55; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t66; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:20'; +delete from t2 where col1='14:30:20'; +delete from t3 where col1='14:30:20'; +delete from t4 where col1='14:30:20'; +delete from t5 where col1='14:30:20'; +delete from t6 where col1='14:30:20'; +select * from t1 order by col1; +col1 +10:22:33 +select * from t2 order by col1; +col1 +10:22:33 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:20'); +insert into t2 values ('14:30:20'); +insert into t3 values ('14:30:20'); +insert into t4 values (60,'14:30:20'); +insert into t5 values (60,'14:30:20'); +insert into t6 values (60,'14:30:20'); +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:20 +select * from t5 order by colint; +colint col1 +60 14:30:20 +select * from t6 order by colint; +colint col1 +60 14:30:20 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:20'; +delete from t22 where col1='14:30:20'; +delete from t33 where col1='14:30:20'; +delete from t44 where col1='14:30:20'; +delete from t55 where col1='14:30:20'; +delete from t66 where col1='14:30:20'; +select * from t11 order by col1; +col1 +10:22:33 +select * from t22 order by col1; +col1 +10:22:33 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:20'); +insert into t22 values ('14:30:20'); +insert into t33 values ('14:30:20'); +insert into t44 values (60,'14:30:20'); +insert into t55 values (60,'14:30:20'); +insert into t66 values (60,'14:30:20'); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:20 +select * from t55 order by colint; +colint col1 +60 14:30:20 +select * from t66 order by colint; +colint col1 +60 14:30:20 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2983,44 +9233,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:09'); -insert into t4 values (2,'14:30:20'); -insert into t5 values (1,'09:09:09'); -insert into t5 values (2,'14:30:20'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:20'); -insert into t6 values (2,'21:59:22'); -select second(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select second(col1) from t1 order by col1; second(col1) 9 20 -select * from t1; +select * from t1 order by col1; col1 09:09:09 14:30:20 -select * from t2; +select * from t2 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t5; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t6; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t6 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +update t1 set col1='10:22:33' where col1='09:09:09'; +update t2 set col1='10:22:33' where col1='09:09:09'; +update t3 set col1='10:22:33' where col1='09:09:09'; +update t4 set col1='10:22:33' where col1='09:09:09'; +update t5 set col1='10:22:33' where col1='09:09:09'; +update t6 set col1='10:22:33' where col1='09:09:09'; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t6 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 ------------------------------------------------------------------------- --- Alter tables with second(col1) ------------------------------------------------------------------------- @@ -3070,33 +9359,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (second('18:30:14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:09 +10:22:33 14:30:20 -select * from t22; +select * from t22 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t55; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t55 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t66; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t66 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:20'; +delete from t2 where col1='14:30:20'; +delete from t3 where col1='14:30:20'; +delete from t4 where col1='14:30:20'; +delete from t5 where col1='14:30:20'; +delete from t6 where col1='14:30:20'; +select * from t1 order by col1; +col1 +10:22:33 +select * from t2 order by col1; +col1 +10:22:33 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +insert into t1 values ('14:30:20'); +insert into t2 values ('14:30:20'); +insert into t3 values ('14:30:20'); +insert into t4 values (60,'14:30:20'); +insert into t5 values (60,'14:30:20'); +insert into t6 values (60,'14:30:20'); +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t6 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:20 +select * from t5 order by colint; +colint col1 +60 14:30:20 +select * from t6 order by colint; +colint col1 +60 14:30:20 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:20'; +delete from t22 where col1='14:30:20'; +delete from t33 where col1='14:30:20'; +delete from t44 where col1='14:30:20'; +delete from t55 where col1='14:30:20'; +delete from t66 where col1='14:30:20'; +select * from t11 order by col1; +col1 +10:22:33 +select * from t22 order by col1; +col1 +10:22:33 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +insert into t11 values ('14:30:20'); +insert into t22 values ('14:30:20'); +insert into t33 values ('14:30:20'); +insert into t44 values (60,'14:30:20'); +insert into t55 values (60,'14:30:20'); +insert into t66 values (60,'14:30:20'); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:20 +select * from t55 order by colint; +colint col1 +60 14:30:20 +select * from t66 order by colint; +colint col1 +60 14:30:20 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3166,44 +9743,83 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-12-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-12-17'); -insert into t5 values (3,'2006-05-25'); -insert into t6 values (1,'2006-12-17'); -insert into t6 values (2,'2006-05-25'); -select month(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select month(col1) from t1 order by col1; month(col1) 1 12 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-12-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-05-25 2006-12-17 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 -2006-12-17 2006-05-25 -select * from t4; +2006-12-17 +select * from t4 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-12-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-11-06' where col1='2006-01-03'; +update t2 set col1='2006-11-06' where col1='2006-01-03'; +update t3 set col1='2006-11-06' where col1='2006-01-03'; +update t4 set col1='2006-11-06' where col1='2006-01-03'; +update t5 set col1='2006-11-06' where col1='2006-01-03'; +update t6 set col1='2006-11-06' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with month(col1) ------------------------------------------------------------------------- @@ -3253,33 +9869,315 @@ alter table t66 partition by range(colint) (partition p0 values less than (month('2006-10-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-11-06 2006-12-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 2006-05-25 +2006-11-06 2006-12-17 -select * from t33; +select * from t33 order by col1; col1 -2006-01-03 -2006-12-17 2006-05-25 -select * from t44; +2006-11-06 +2006-12-17 +select * from t44 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-12-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +alter table t55 +partition by list(colint) +subpartition by hash(month(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with month(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-12-17'; +delete from t2 where col1='2006-12-17'; +delete from t3 where col1='2006-12-17'; +delete from t4 where col1='2006-12-17'; +delete from t5 where col1='2006-12-17'; +delete from t6 where col1='2006-12-17'; +select * from t1 order by col1; +col1 +2006-11-06 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-12-17'); +insert into t3 values ('2006-12-17'); +insert into t4 values (60,'2006-12-17'); +insert into t5 values (60,'2006-12-17'); +insert into t6 values (60,'2006-12-17'); +select * from t1 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +60 2006-12-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with month(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-12-17'; +delete from t22 where col1='2006-12-17'; +delete from t33 where col1='2006-12-17'; +delete from t44 where col1='2006-12-17'; +delete from t55 where col1='2006-12-17'; +delete from t66 where col1='2006-12-17'; +select * from t11 order by col1; +col1 +2006-11-06 +select * from t22 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-12-17'); +insert into t22 values ('2006-12-17'); +insert into t33 values ('2006-12-17'); +insert into t44 values (60,'2006-12-17'); +insert into t55 values (60,'2006-12-17'); +insert into t66 values (60,'2006-12-17'); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t22 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t44 order by colint; +colint col1 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +60 2006-12-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3349,44 +10247,83 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-12-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-12-17'); -insert into t5 values (3,'2006-09-25'); -insert into t6 values (1,'2006-12-17'); -insert into t6 values (2,'2006-09-25'); -select quarter(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select quarter(col1) from t1 order by col1; quarter(col1) 1 4 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-12-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 -2006-12-17 2006-09-25 -select * from t3; +2006-12-17 +select * from t3 order by col1; col1 2006-01-03 -2006-12-17 2006-09-25 -select * from t4; +2006-12-17 +select * from t4 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-09-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-12-17 -2 2006-09-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-07-30' where col1='2006-01-03'; +update t2 set col1='2006-07-30' where col1='2006-01-03'; +update t3 set col1='2006-07-30' where col1='2006-01-03'; +update t4 set col1='2006-07-30' where col1='2006-01-03'; +update t5 set col1='2006-07-30' where col1='2006-01-03'; +update t6 set col1='2006-07-30' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with quarter(col1) ------------------------------------------------------------------------- @@ -3436,33 +10373,313 @@ alter table t66 partition by range(colint) (partition p0 values less than (quarter('2006-10-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-07-30 2006-12-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 -2006-12-17 +2006-07-30 2006-09-25 -select * from t33; -col1 -2006-01-03 2006-12-17 +select * from t33 order by col1; +col1 +2006-07-30 2006-09-25 -select * from t44; +2006-12-17 +select * from t44 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-09-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-12-17 -2 2006-09-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +alter table t55 +partition by list(colint) +subpartition by hash(quarter(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with quarter(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-12-17'; +delete from t2 where col1='2006-12-17'; +delete from t3 where col1='2006-12-17'; +delete from t4 where col1='2006-12-17'; +delete from t5 where col1='2006-12-17'; +delete from t6 where col1='2006-12-17'; +select * from t1 order by col1; +col1 +2006-07-30 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-12-17'); +insert into t3 values ('2006-12-17'); +insert into t4 values (60,'2006-12-17'); +insert into t5 values (60,'2006-12-17'); +insert into t6 values (60,'2006-12-17'); +select * from t1 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +4 2006-02-05 +60 2006-12-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with quarter(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-12-17'; +delete from t22 where col1='2006-12-17'; +delete from t33 where col1='2006-12-17'; +delete from t44 where col1='2006-12-17'; +delete from t55 where col1='2006-12-17'; +delete from t66 where col1='2006-12-17'; +select * from t11 order by col1; +col1 +2006-07-30 +select * from t22 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-12-17'); +insert into t22 values ('2006-12-17'); +insert into t33 values ('2006-12-17'); +insert into t44 values (60,'2006-12-17'); +insert into t55 values (60,'2006-12-17'); +insert into t66 values (60,'2006-12-17'); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t22 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t44 order by colint; +colint col1 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +4 2006-02-05 +60 2006-12-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3532,44 +10749,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:15'); -insert into t4 values (2,'14:30:45'); -insert into t5 values (1,'09:09:15'); -insert into t5 values (2,'14:30:45'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:45'); -insert into t6 values (2,'21:59:22'); -select time_to_sec(col1)-(time_to_sec(col1)-20) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1; time_to_sec(col1)-(time_to_sec(col1)-20) 20 20 -select * from t1; +select * from t1 order by col1; col1 09:09:15 14:30:45 -select * from t2; +select * from t2 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 1 09:09:15 -2 14:30:45 -select * from t5; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 1 09:09:15 -2 14:30:45 -3 21:59:22 -select * from t6; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:33:11' where col1='09:09:15'; +update t2 set col1='10:33:11' where col1='09:09:15'; +update t3 set col1='10:33:11' where col1='09:09:15'; +update t4 set col1='10:33:11' where col1='09:09:15'; +update t5 set col1='10:33:11' where col1='09:09:15'; +update t6 set col1='10:33:11' where col1='09:09:15'; +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- @@ -3619,33 +10875,319 @@ alter table t66 partition by range(colint) (partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:15 +10:33:11 14:30:45 -select * from t22; +select * from t22 order by col1; col1 -09:09:15 +10:33:11 14:30:45 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:15 +10:33:11 14:30:45 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -1 09:09:15 -2 14:30:45 -select * from t55; +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -1 09:09:15 -2 14:30:45 -3 21:59:22 -select * from t66; +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +alter table t55 +partition by list(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:45'; +delete from t2 where col1='14:30:45'; +delete from t3 where col1='14:30:45'; +delete from t4 where col1='14:30:45'; +delete from t5 where col1='14:30:45'; +delete from t6 where col1='14:30:45'; +select * from t1 order by col1; +col1 +10:33:11 +select * from t2 order by col1; +col1 +10:33:11 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:45'); +insert into t2 values ('14:30:45'); +insert into t3 values ('14:30:45'); +insert into t4 values (60,'14:30:45'); +insert into t5 values (60,'14:30:45'); +insert into t6 values (60,'14:30:45'); +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t6 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:45 +select * from t5 order by colint; +colint col1 +60 14:30:45 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:45'; +delete from t22 where col1='14:30:45'; +delete from t33 where col1='14:30:45'; +delete from t44 where col1='14:30:45'; +delete from t55 where col1='14:30:45'; +delete from t66 where col1='14:30:45'; +select * from t11 order by col1; +col1 +10:33:11 +select * from t22 order by col1; +col1 +10:33:11 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:45'); +insert into t22 values ('14:30:45'); +insert into t33 values ('14:30:45'); +insert into t44 values (60,'14:30:45'); +insert into t55 values (60,'14:30:45'); +insert into t66 values (60,'14:30:45'); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +select * from t22 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +select * from t22 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:45 +select * from t55 order by colint; +colint col1 +60 14:30:45 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3715,44 +11257,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-02-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-02-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-01-25'); -select to_days(col1)-to_days('2006-01-01') from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select to_days(col1)-to_days('2006-01-01') from t1 order by col1; to_days(col1)-to_days('2006-01-01') -33 16 -select * from t1; +33 +select * from t1 order by col1; col1 -2006-02-03 2006-01-17 -select * from t2; +2006-02-03 +select * from t2 order by col1; col1 2006-01-17 2006-01-25 2006-02-03 -select * from t3; +select * from t3 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t4; +2006-02-03 +select * from t4 order by colint; colint col1 -2 2006-01-17 1 2006-02-03 -select * from t5; -colint col1 2 2006-01-17 3 2006-01-25 -1 2006-02-03 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-02-03'; +update t2 set col1='2006-02-06' where col1='2006-02-03'; +update t3 set col1='2006-02-06' where col1='2006-02-03'; +update t4 set col1='2006-02-06' where col1='2006-02-03'; +update t5 set col1='2006-02-06' where col1='2006-02-03'; +update t6 set col1='2006-02-06' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with to_days(col1)-to_days('2006-01-01') ------------------------------------------------------------------------- @@ -3802,33 +11383,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-02-03 2006-01-17 -select * from t22; +2006-02-06 +select * from t22 order by col1; col1 2006-01-17 2006-01-25 -2006-02-03 -select * from t33; +2006-02-06 +select * from t33 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t44; -colint col1 -2 2006-01-17 -1 2006-02-03 -select * from t55; +2006-02-06 +select * from t44 order by colint; colint col1 +1 2006-02-06 2 2006-01-17 3 2006-01-25 -1 2006-02-03 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t55 +partition by list(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3898,44 +11757,83 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); -insert into t4 values (1,'2006-12-03'); -insert into t4 values (2,'2006-11-17'); -insert into t5 values (1,'2006-12-03'); -insert into t5 values (2,'2006-11-17'); -insert into t5 values (3,'2006-05-25'); -insert into t6 values (1,'2006-11-17'); -insert into t6 values (2,'2006-05-25'); -select weekday(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select weekday(col1) from t1 order by col1; weekday(col1) -6 4 -select * from t1; +6 +select * from t1 order by col1; col1 -2006-12-03 2006-11-17 -select * from t2; +2006-12-03 +select * from t2 order by col1; col1 -2006-12-03 -2006-11-17 2006-05-25 -select * from t3; -col1 -2006-12-03 2006-11-17 +2006-12-03 +select * from t3 order by col1; +col1 2006-05-25 -select * from t4; +2006-11-17 +2006-12-03 +select * from t4 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -3 2006-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-11-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-12-03'; +update t2 set col1='2006-02-06' where col1='2006-12-03'; +update t3 set col1='2006-02-06' where col1='2006-12-03'; +update t4 set col1='2006-02-06' where col1='2006-12-03'; +update t5 set col1='2006-02-06' where col1='2006-12-03'; +update t6 set col1='2006-02-06' where col1='2006-12-03'; +select * from t1 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with weekday(col1) ------------------------------------------------------------------------- @@ -3985,33 +11883,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (weekday('2006-10-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-12-03 +2006-02-06 2006-11-17 -select * from t22; +select * from t22 order by col1; col1 -2006-12-03 -2006-11-17 +2006-02-06 2006-05-25 -select * from t33; -col1 -2006-12-03 2006-11-17 +select * from t33 order by col1; +col1 +2006-02-06 2006-05-25 -select * from t44; +2006-11-17 +select * from t44 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -3 2006-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-11-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +alter table t55 +partition by list(colint) +subpartition by hash(weekday(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekday(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-11-17'; +delete from t2 where col1='2006-11-17'; +delete from t3 where col1='2006-11-17'; +delete from t4 where col1='2006-11-17'; +delete from t5 where col1='2006-11-17'; +delete from t6 where col1='2006-11-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-11-17'); +insert into t2 values ('2006-11-17'); +insert into t3 values ('2006-11-17'); +insert into t4 values (60,'2006-11-17'); +insert into t5 values (60,'2006-11-17'); +insert into t6 values (60,'2006-11-17'); +select * from t1 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +60 2006-11-17 +select * from t5 order by colint; +colint col1 +60 2006-11-17 +select * from t6 order by colint; +colint col1 +60 2006-11-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekday(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-11-17'; +delete from t22 where col1='2006-11-17'; +delete from t33 where col1='2006-11-17'; +delete from t44 where col1='2006-11-17'; +delete from t55 where col1='2006-11-17'; +delete from t66 where col1='2006-11-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-11-17'); +insert into t22 values ('2006-11-17'); +insert into t33 values ('2006-11-17'); +insert into t44 values (60,'2006-11-17'); +insert into t55 values (60,'2006-11-17'); +insert into t66 values (60,'2006-11-17'); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t22 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t44 order by colint; +colint col1 +60 2006-11-17 +select * from t55 order by colint; +colint col1 +60 2006-11-17 +select * from t66 order by colint; +colint col1 +60 2006-11-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -4081,44 +12257,83 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-03-17'); insert into t3 values ('2006-05-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-03-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-03-17'); -insert into t5 values (3,'2006-05-25'); -insert into t6 values (1,'2006-03-17'); -insert into t6 values (2,'2006-05-25'); -select weekofyear(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select weekofyear(col1) from t1 order by col1; weekofyear(col1) 1 11 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-03-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-03-17 2006-05-25 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 2006-03-17 2006-05-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -3 2006-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-03-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-09-06' where col1='2006-01-03'; +update t2 set col1='2006-09-06' where col1='2006-01-03'; +update t3 set col1='2006-09-06' where col1='2006-01-03'; +update t4 set col1='2006-09-06' where col1='2006-01-03'; +update t5 set col1='2006-09-06' where col1='2006-01-03'; +update t6 set col1='2006-09-06' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with weekofyear(col1) ------------------------------------------------------------------------- @@ -4168,33 +12383,319 @@ alter table t66 partition by range(colint) (partition p0 values less than (weekofyear('2006-02-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-03-17 -select * from t22; +2006-09-06 +select * from t22 order by col1; col1 -2006-01-03 2006-03-17 2006-05-25 -select * from t33; +2006-09-06 +select * from t33 order by col1; col1 -2006-01-03 2006-03-17 2006-05-25 -select * from t44; +2006-09-06 +select * from t44 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -3 2006-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-03-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +alter table t55 +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-03-17'; +delete from t2 where col1='2006-03-17'; +delete from t3 where col1='2006-03-17'; +delete from t4 where col1='2006-03-17'; +delete from t5 where col1='2006-03-17'; +delete from t6 where col1='2006-03-17'; +select * from t1 order by col1; +col1 +2006-09-06 +select * from t2 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-03-17'); +insert into t2 values ('2006-03-17'); +insert into t3 values ('2006-03-17'); +insert into t4 values (60,'2006-03-17'); +insert into t5 values (60,'2006-03-17'); +insert into t6 values (60,'2006-03-17'); +select * from t1 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +60 2006-03-17 +select * from t5 order by colint; +colint col1 +60 2006-03-17 +select * from t6 order by colint; +colint col1 +60 2006-03-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-03-17'; +delete from t22 where col1='2006-03-17'; +delete from t33 where col1='2006-03-17'; +delete from t44 where col1='2006-03-17'; +delete from t55 where col1='2006-03-17'; +delete from t66 where col1='2006-03-17'; +select * from t11 order by col1; +col1 +2006-09-06 +select * from t22 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-03-17'); +insert into t22 values ('2006-03-17'); +insert into t33 values ('2006-03-17'); +insert into t44 values (60,'2006-03-17'); +insert into t55 values (60,'2006-03-17'); +insert into t66 values (60,'2006-03-17'); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t22 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-09-06 +select * from t22 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +60 2006-03-17 +select * from t55 order by colint; +colint col1 +60 2006-03-17 +select * from t66 order by colint; +colint col1 +60 2006-03-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -4264,44 +12765,83 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); -insert into t4 values (1,'1996-01-03'); -insert into t4 values (2,'2000-02-17'); -insert into t5 values (1,'1996-01-03'); -insert into t5 values (2,'2000-02-17'); -insert into t5 values (3,'2004-05-25'); -insert into t6 values (1,'2000-02-17'); -insert into t6 values (2,'2004-05-25'); -select year(col1)-1990 from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select year(col1)-1990 from t1 order by col1; year(col1)-1990 6 10 -select * from t1; +select * from t1 order by col1; col1 1996-01-03 2000-02-17 -select * from t2; +select * from t2 order by col1; col1 1996-01-03 2000-02-17 2004-05-25 -select * from t3; +select * from t3 order by col1; col1 1996-01-03 2000-02-17 2004-05-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -3 2004-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2000-02-17 -2 2004-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2002-02-15' where col1='1996-01-03'; +update t2 set col1='2002-02-15' where col1='1996-01-03'; +update t3 set col1='2002-02-15' where col1='1996-01-03'; +update t4 set col1='2002-02-15' where col1='1996-01-03'; +update t5 set col1='2002-02-15' where col1='1996-01-03'; +update t6 set col1='2002-02-15' where col1='1996-01-03'; +select * from t1 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t2 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with year(col1)-1990 ------------------------------------------------------------------------- @@ -4351,33 +12891,315 @@ alter table t66 partition by range(colint) (partition p0 values less than (year('2005-10-14')-1990), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -1996-01-03 2000-02-17 -select * from t22; +2002-02-15 +select * from t22 order by col1; col1 -1996-01-03 2000-02-17 +2002-02-15 2004-05-25 -select * from t33; +select * from t33 order by col1; col1 -1996-01-03 2000-02-17 +2002-02-15 2004-05-25 -select * from t44; +select * from t44 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -3 2004-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2000-02-17 -2 2004-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +alter table t55 +partition by list(colint) +subpartition by hash(year(col1)-1990) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with year(col1)-1990 +------------------------------------------------------------------------- +delete from t1 where col1='2000-02-17'; +delete from t2 where col1='2000-02-17'; +delete from t3 where col1='2000-02-17'; +delete from t4 where col1='2000-02-17'; +delete from t5 where col1='2000-02-17'; +delete from t6 where col1='2000-02-17'; +select * from t1 order by col1; +col1 +2002-02-15 +select * from t2 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2000-02-17'); +insert into t2 values ('2000-02-17'); +insert into t3 values ('2000-02-17'); +insert into t4 values (60,'2000-02-17'); +insert into t5 values (60,'2000-02-17'); +insert into t6 values (60,'2000-02-17'); +select * from t1 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t2 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +60 2000-02-17 +select * from t5 order by colint; +colint col1 +60 2000-02-17 +select * from t6 order by colint; +colint col1 +60 2000-02-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with year(col1)-1990 +------------------------------------------------------------------------- +delete from t11 where col1='2000-02-17'; +delete from t22 where col1='2000-02-17'; +delete from t33 where col1='2000-02-17'; +delete from t44 where col1='2000-02-17'; +delete from t55 where col1='2000-02-17'; +delete from t66 where col1='2000-02-17'; +select * from t11 order by col1; +col1 +2002-02-15 +select * from t22 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2000-02-17'); +insert into t22 values ('2000-02-17'); +insert into t33 values ('2000-02-17'); +insert into t44 values (60,'2000-02-17'); +insert into t55 values (60,'2000-02-17'); +insert into t66 values (60,'2000-02-17'); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t22 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +60 2000-02-17 +select * from t55 order by colint; +colint col1 +60 2000-02-17 +select * from t66 order by colint; +colint col1 +60 2000-02-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -4447,44 +13269,83 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-08-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-08-17'); -insert into t5 values (3,'2006-03-25'); -insert into t6 values (1,'2006-08-17'); -insert into t6 values (2,'2006-03-25'); -select yearweek(col1)-200600 from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select yearweek(col1)-200600 from t1 order by col1; yearweek(col1)-200600 1 33 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-08-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-03-25 2006-08-17 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 -2006-08-17 2006-03-25 -select * from t4; +2006-08-17 +select * from t4 order by colint; colint col1 -1 2006-01-03 -2 2006-08-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -3 2006-03-25 -1 2006-01-03 -2 2006-08-17 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-08-17 -2 2006-03-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-11-15' where col1='2006-01-03'; +update t2 set col1='2006-11-15' where col1='2006-01-03'; +update t3 set col1='2006-11-15' where col1='2006-01-03'; +update t4 set col1='2006-11-15' where col1='2006-01-03'; +update t5 set col1='2006-11-15' where col1='2006-01-03'; +update t6 set col1='2006-11-15' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with yearweek(col1)-200600 ------------------------------------------------------------------------- @@ -4534,33 +13395,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (yearweek('2006-10-14')-200600), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-08-17 -select * from t22; +2006-11-15 +select * from t22 order by col1; col1 -2006-01-03 2006-03-25 2006-08-17 -select * from t33; +2006-11-15 +select * from t33 order by col1; col1 -2006-01-03 -2006-08-17 2006-03-25 -select * from t44; +2006-08-17 +2006-11-15 +select * from t44 order by colint; colint col1 -1 2006-01-03 -2 2006-08-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -3 2006-03-25 -1 2006-01-03 -2 2006-08-17 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-08-17 -2 2006-03-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +alter table t55 +partition by list(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +delete from t1 where col1='2006-08-17'; +delete from t2 where col1='2006-08-17'; +delete from t3 where col1='2006-08-17'; +delete from t4 where col1='2006-08-17'; +delete from t5 where col1='2006-08-17'; +delete from t6 where col1='2006-08-17'; +select * from t1 order by col1; +col1 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-08-17'); +insert into t2 values ('2006-08-17'); +insert into t3 values ('2006-08-17'); +insert into t4 values (60,'2006-08-17'); +insert into t5 values (60,'2006-08-17'); +insert into t6 values (60,'2006-08-17'); +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +60 2006-08-17 +select * from t5 order by colint; +colint col1 +60 2006-08-17 +select * from t6 order by colint; +colint col1 +60 2006-08-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +delete from t11 where col1='2006-08-17'; +delete from t22 where col1='2006-08-17'; +delete from t33 where col1='2006-08-17'; +delete from t44 where col1='2006-08-17'; +delete from t55 where col1='2006-08-17'; +delete from t66 where col1='2006-08-17'; +select * from t11 order by col1; +col1 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-08-17'); +insert into t22 values ('2006-08-17'); +insert into t33 values ('2006-08-17'); +insert into t44 values (60,'2006-08-17'); +insert into t55 values (60,'2006-08-17'); +insert into t66 values (60,'2006-08-17'); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t44 order by colint; +colint col1 +60 2006-08-17 +select * from t55 order by colint; +colint col1 +60 2006-08-17 +select * from t66 order by colint; +colint col1 +60 2006-08-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; diff --git a/mysql-test/suite/partitions/r/partition_supported_sql_func_myisam.result b/mysql-test/suite/partitions/r/partition_supported_sql_func_myisam.result index 73d69e5c90a..86742038990 100644 --- a/mysql-test/suite/partitions/r/partition_supported_sql_func_myisam.result +++ b/mysql-test/suite/partitions/r/partition_supported_sql_func_myisam.result @@ -55,44 +55,329 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); -insert into t4 values (1,5 ); -insert into t4 values (2,13 ); -insert into t5 values (1,5 ); -insert into t5 values (2,13 ); -insert into t5 values (3,17 ); -insert into t6 values (1,13 ); -insert into t6 values (2,17 ); -select abs(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t6; +select abs(col1) from t1 order by col1; abs(col1) 5 13 -select * from t1; +select * from t1 order by col1; col1 5 13 -select * from t2; +select * from t2 order by col1; col1 5 13 17 -select * from t3; +select * from t3 order by col1; col1 5 13 17 -select * from t4; +select * from t4 order by colint; colint col1 1 5 2 13 -select * from t5; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; colint col1 1 5 2 13 -3 17 -select * from t6; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; colint col1 -1 13 -2 17 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +update t1 set col1=15 where col1=5 ; +update t2 set col1=15 where col1=5 ; +update t3 set col1=15 where col1=5 ; +update t4 set col1=15 where col1=5 ; +update t5 set col1=15 where col1=5 ; +update t6 set col1=15 where col1=5 ; +select * from t1 order by col1; +col1 +13 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- --- Alter tables with abs(col1) ------------------------------------------------------------------------- @@ -142,33 +427,1241 @@ alter table t66 partition by range(colint) (partition p0 values less than (abs(15)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5 13 -select * from t22; +15 +select * from t22 order by col1; col1 -5 13 +15 17 -select * from t33; +select * from t33 order by col1; col1 -5 13 +15 17 -select * from t44; +select * from t44 order by colint; colint col1 -1 5 +1 15 2 13 -select * from t55; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t55 order by colint; colint col1 -1 5 +1 15 2 13 -3 17 -select * from t66; +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t66 order by colint; colint col1 -1 13 -2 17 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13 +15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13 +15 +alter table t55 +partition by list(colint) +subpartition by hash(abs(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with abs(col1) +------------------------------------------------------------------------- +delete from t1 where col1=13 ; +delete from t2 where col1=13 ; +delete from t3 where col1=13 ; +delete from t4 where col1=13 ; +delete from t5 where col1=13 ; +delete from t6 where col1=13 ; +select * from t1 order by col1; +col1 +15 +select * from t2 order by col1; +col1 +15 +17 +select * from t3 order by col1; +col1 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +insert into t1 values (13 ); +insert into t2 values (13 ); +insert into t3 values (13 ); +insert into t4 values (60,13 ); +insert into t5 values (60,13 ); +insert into t6 values (60,13 ); +select * from t1 order by col1; +col1 +13 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t5 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t6 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t5 order by colint; +colint col1 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t6 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with abs(col1) +------------------------------------------------------------------------- +delete from t11 where col1=13 ; +delete from t22 where col1=13 ; +delete from t33 where col1=13 ; +delete from t44 where col1=13 ; +delete from t55 where col1=13 ; +delete from t66 where col1=13 ; +select * from t11 order by col1; +col1 +15 +select * from t22 order by col1; +col1 +15 +17 +select * from t33 order by col1; +col1 +15 +17 +select * from t44 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t55 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +insert into t11 values (13 ); +insert into t22 values (13 ); +insert into t33 values (13 ); +insert into t44 values (60,13 ); +insert into t55 values (60,13 ); +insert into t66 values (60,13 ); +select * from t11 order by col1; +col1 +13 +15 +select * from t22 order by col1; +col1 +13 +15 +17 +select * from t33 order by col1; +col1 +13 +15 +17 +select * from t44 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t55 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t66 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15 +select * from t22 order by col1; +col1 +13 +15 +17 +select * from t33 order by col1; +col1 +13 +15 +17 +select * from t44 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t55 order by colint; +colint col1 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t66 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -238,44 +1731,83 @@ insert into t2 values ('3'); insert into t3 values ('1'); insert into t3 values ('9'); insert into t3 values ('3'); -insert into t4 values (1,'1'); -insert into t4 values (2,'9'); -insert into t5 values (1,'1'); -insert into t5 values (2,'9'); -insert into t5 values (3,'3'); -insert into t6 values (1,'9'); -insert into t6 values (2,'3'); -select ascii(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; +select ascii(col1) from t1 order by col1; ascii(col1) 49 57 -select * from t1; +select * from t1 order by col1; col1 1 9 -select * from t2; +select * from t2 order by col1; col1 1 -9 3 -select * from t3; +9 +select * from t3 order by col1; col1 1 -9 3 -select * from t4; -colint col1 -1 1 -2 9 -select * from t5; +9 +select * from t4 order by colint; colint col1 1 1 2 9 3 3 -select * from t6; +4 8 +select * from t5 order by colint; colint col1 -1 9 -2 3 +1 1 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +update t1 set col1='8' where col1='1'; +update t2 set col1='8' where col1='1'; +update t3 set col1='8' where col1='1'; +update t4 set col1='8' where col1='1'; +update t5 set col1='8' where col1='1'; +update t6 set col1='8' where col1='1'; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 ------------------------------------------------------------------------- --- Alter tables with ascii(col1) ------------------------------------------------------------------------- @@ -325,33 +1857,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (ascii('5')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -1 +8 9 -select * from t22; +select * from t22 order by col1; col1 -1 -9 3 -select * from t33; -col1 -1 +8 9 +select * from t33 order by col1; +col1 3 -select * from t44; +8 +9 +select * from t44 order by colint; colint col1 -1 1 -2 9 -select * from t55; -colint col1 -1 1 +1 8 2 9 3 3 -select * from t66; +4 8 +select * from t55 order by colint; colint col1 -1 9 -2 3 +1 8 +2 9 +3 3 +4 8 +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t55 +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ascii(col1) +------------------------------------------------------------------------- +delete from t1 where col1='9'; +delete from t2 where col1='9'; +delete from t3 where col1='9'; +delete from t4 where col1='9'; +delete from t5 where col1='9'; +delete from t6 where col1='9'; +select * from t1 order by col1; +col1 +8 +select * from t2 order by col1; +col1 +3 +8 +select * from t3 order by col1; +col1 +3 +8 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t1 values ('9'); +insert into t2 values ('9'); +insert into t3 values ('9'); +insert into t4 values (60,'9'); +insert into t5 values (60,'9'); +insert into t6 values (60,'9'); +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t6 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +60 9 +select * from t5 order by colint; +colint col1 +60 9 +select * from t6 order by colint; +colint col1 +60 9 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ascii(col1) +------------------------------------------------------------------------- +delete from t11 where col1='9'; +delete from t22 where col1='9'; +delete from t33 where col1='9'; +delete from t44 where col1='9'; +delete from t55 where col1='9'; +delete from t66 where col1='9'; +select * from t11 order by col1; +col1 +8 +select * from t22 order by col1; +col1 +3 +8 +select * from t33 order by col1; +col1 +3 +8 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t11 values ('9'); +insert into t22 values ('9'); +insert into t33 values ('9'); +insert into t44 values (60,'9'); +insert into t55 values (60,'9'); +insert into t66 values (60,'9'); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t66 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +60 9 +select * from t55 order by colint; +colint col1 +60 9 +select * from t66 order by colint; +colint col1 +60 9 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -421,44 +2231,83 @@ insert into t2 values (17.987); insert into t3 values (5.1230); insert into t3 values (13.345); insert into t3 values (17.987); -insert into t4 values (1,5.1230); -insert into t4 values (2,13.345); -insert into t5 values (1,5.1230); -insert into t5 values (2,13.345); -insert into t5 values (3,17.987); -insert into t6 values (1,13.345); -insert into t6 values (2,17.987); -select cast(ceiling(col1) as signed integer) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(ceiling(col1) as signed integer) from t1 order by col1; cast(ceiling(col1) as signed integer) 6 14 -select * from t1; +select * from t1 order by col1; col1 5.1230 13.3450 -select * from t2; +select * from t2 order by col1; col1 5.1230 13.3450 17.9870 -select * from t3; +select * from t3 order by col1; col1 5.1230 13.3450 17.9870 -select * from t4; -colint col1 -1 5.1230 -2 13.3450 -select * from t5; +select * from t4 order by colint; colint col1 1 5.1230 2 13.3450 3 17.9870 -select * from t6; +4 15.6540 +select * from t5 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15.654 where col1=5.1230; +update t2 set col1=15.654 where col1=5.1230; +update t3 set col1=15.654 where col1=5.1230; +update t4 set col1=15.654 where col1=5.1230; +update t5 set col1=15.654 where col1=5.1230; +update t6 set col1=15.654 where col1=5.1230; +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 ------------------------------------------------------------------------- --- Alter tables with cast(ceiling(col1) as signed integer) ------------------------------------------------------------------------- @@ -508,33 +2357,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (cast(ceiling(15) as signed integer)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5.1230 13.3450 -select * from t22; +15.6540 +select * from t22 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t33; +select * from t33 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t44; +select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -select * from t55; -colint col1 -1 5.1230 +1 15.6540 2 13.3450 3 17.9870 -select * from t66; +4 15.6540 +select * from t55 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t55 +partition by list(colint) +subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +delete from t1 where col1=13.345; +delete from t2 where col1=13.345; +delete from t3 where col1=13.345; +delete from t4 where col1=13.345; +delete from t5 where col1=13.345; +delete from t6 where col1=13.345; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t1 values (13.345); +insert into t2 values (13.345); +insert into t3 values (13.345); +insert into t4 values (60,13.345); +insert into t5 values (60,13.345); +insert into t6 values (60,13.345); +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t6 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +60 13.3450 +select * from t5 order by colint; +colint col1 +60 13.3450 +select * from t6 order by colint; +colint col1 +60 13.3450 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +delete from t11 where col1=13.345; +delete from t22 where col1=13.345; +delete from t33 where col1=13.345; +delete from t44 where col1=13.345; +delete from t55 where col1=13.345; +delete from t66 where col1=13.345; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t11 values (13.345); +insert into t22 values (13.345); +insert into t33 values (13.345); +insert into t44 values (60,13.345); +insert into t55 values (60,13.345); +insert into t66 values (60,13.345); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t66 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +60 13.3450 +select * from t55 order by colint; +colint col1 +60 13.3450 +select * from t66 order by colint; +colint col1 +60 13.3450 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -604,44 +2729,83 @@ insert into t2 values (17.987); insert into t3 values (5.1230); insert into t3 values (13.345); insert into t3 values (17.987); -insert into t4 values (1,5.1230); -insert into t4 values (2,13.345); -insert into t5 values (1,5.1230); -insert into t5 values (2,13.345); -insert into t5 values (3,17.987); -insert into t6 values (1,13.345); -insert into t6 values (2,17.987); -select cast(floor(col1) as signed) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(floor(col1) as signed) from t1 order by col1; cast(floor(col1) as signed) 5 13 -select * from t1; +select * from t1 order by col1; col1 5.1230 13.3450 -select * from t2; +select * from t2 order by col1; col1 5.1230 13.3450 17.9870 -select * from t3; +select * from t3 order by col1; col1 5.1230 13.3450 17.9870 -select * from t4; -colint col1 -1 5.1230 -2 13.3450 -select * from t5; +select * from t4 order by colint; colint col1 1 5.1230 2 13.3450 3 17.9870 -select * from t6; +4 15.6540 +select * from t5 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15.654 where col1=5.1230; +update t2 set col1=15.654 where col1=5.1230; +update t3 set col1=15.654 where col1=5.1230; +update t4 set col1=15.654 where col1=5.1230; +update t5 set col1=15.654 where col1=5.1230; +update t6 set col1=15.654 where col1=5.1230; +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 ------------------------------------------------------------------------- --- Alter tables with cast(floor(col1) as signed) ------------------------------------------------------------------------- @@ -691,33 +2855,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (cast(floor(15.123) as signed)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5.1230 13.3450 -select * from t22; +15.6540 +select * from t22 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t33; +select * from t33 order by col1; col1 -5.1230 13.3450 +15.6540 17.9870 -select * from t44; +select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -select * from t55; -colint col1 -1 5.1230 +1 15.6540 2 13.3450 3 17.9870 -select * from t66; +4 15.6540 +select * from t55 order by colint; colint col1 -1 13.3450 -2 17.9870 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t55 +partition by list(colint) +subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +delete from t1 where col1=13.345; +delete from t2 where col1=13.345; +delete from t3 where col1=13.345; +delete from t4 where col1=13.345; +delete from t5 where col1=13.345; +delete from t6 where col1=13.345; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t1 values (13.345); +insert into t2 values (13.345); +insert into t3 values (13.345); +insert into t4 values (60,13.345); +insert into t5 values (60,13.345); +insert into t6 values (60,13.345); +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t6 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +60 13.3450 +select * from t5 order by colint; +colint col1 +60 13.3450 +select * from t6 order by colint; +colint col1 +60 13.3450 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +delete from t11 where col1=13.345; +delete from t22 where col1=13.345; +delete from t33 where col1=13.345; +delete from t44 where col1=13.345; +delete from t55 where col1=13.345; +delete from t66 where col1=13.345; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t11 values (13.345); +insert into t22 values (13.345); +insert into t33 values (13.345); +insert into t44 values (60,13.345); +insert into t55 values (60,13.345); +insert into t66 values (60,13.345); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t66 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +60 13.3450 +select * from t55 order by colint; +colint col1 +60 13.3450 +select * from t66 order by colint; +colint col1 +60 13.3450 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -787,44 +3227,83 @@ insert into t2 values (17); insert into t3 values (5.0000); insert into t3 values (19); insert into t3 values (17); -insert into t4 values (1,5.0000); -insert into t4 values (2,19); -insert into t5 values (1,5.0000); -insert into t5 values (2,19); -insert into t5 values (3,17); -insert into t6 values (1,19); -insert into t6 values (2,17); -select cast(mod(col1,10) as signed) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(mod(col1,10) as signed) from t1 order by col1; cast(mod(col1,10) as signed) 5 9 -select * from t1; +select * from t1 order by col1; col1 5.0000 19.0000 -select * from t2; +select * from t2 order by col1; col1 5.0000 -19.0000 17.0000 -select * from t3; +19.0000 +select * from t3 order by col1; col1 5.0000 -19.0000 17.0000 -select * from t4; +19.0000 +select * from t4 order by colint; colint col1 -1 5.0000 -2 19.0000 -select * from t5; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; colint col1 -1 5.0000 -2 19.0000 -3 17.0000 -select * from t6; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; colint col1 -1 19.0000 -2 17.0000 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15 where col1=5.0000; +update t2 set col1=15 where col1=5.0000; +update t3 set col1=15 where col1=5.0000; +update t4 set col1=15 where col1=5.0000; +update t5 set col1=15 where col1=5.0000; +update t6 set col1=15 where col1=5.0000; +select * from t1 order by col1; +col1 +15.0000 +19.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 ------------------------------------------------------------------------- --- Alter tables with cast(mod(col1,10) as signed) ------------------------------------------------------------------------- @@ -874,33 +3353,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (cast(mod(15,10) as signed)), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -5.0000 +15.0000 19.0000 -select * from t22; +select * from t22 order by col1; col1 -5.0000 -19.0000 +15.0000 17.0000 -select * from t33; -col1 -5.0000 19.0000 +select * from t33 order by col1; +col1 +15.0000 17.0000 -select * from t44; +19.0000 +select * from t44 order by colint; colint col1 -1 5.0000 -2 19.0000 -select * from t55; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; colint col1 -1 5.0000 -2 19.0000 -3 17.0000 -select * from t66; +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; colint col1 -1 19.0000 -2 17.0000 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +alter table t55 +partition by list(colint) +subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +delete from t1 where col1=19; +delete from t2 where col1=19; +delete from t3 where col1=19; +delete from t4 where col1=19; +delete from t5 where col1=19; +delete from t6 where col1=19; +select * from t1 order by col1; +col1 +15.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +insert into t1 values (19); +insert into t2 values (19); +insert into t3 values (19); +insert into t4 values (60,19); +insert into t5 values (60,19); +insert into t6 values (60,19); +select * from t1 order by col1; +col1 +15.0000 +19.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +60 19.0000 +select * from t5 order by colint; +colint col1 +60 19.0000 +select * from t6 order by colint; +colint col1 +60 19.0000 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +delete from t11 where col1=19; +delete from t22 where col1=19; +delete from t33 where col1=19; +delete from t44 where col1=19; +delete from t55 where col1=19; +delete from t66 where col1=19; +select * from t11 order by col1; +col1 +15.0000 +select * from t22 order by col1; +col1 +15.0000 +17.0000 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +select * from t44 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +insert into t11 values (19); +insert into t22 values (19); +insert into t33 values (19); +insert into t44 values (60,19); +insert into t55 values (60,19); +insert into t66 values (60,19); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +select * from t22 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t44 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t44 order by colint; +colint col1 +60 19.0000 +select * from t55 order by colint; +colint col1 +60 19.0000 +select * from t66 order by colint; +colint col1 +60 19.0000 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -970,44 +3727,83 @@ insert into t2 values ('3'); insert into t3 values ('1'); insert into t3 values ('9'); insert into t3 values ('3'); -insert into t4 values (1,'1'); -insert into t4 values (2,'9'); -insert into t5 values (1,'1'); -insert into t5 values (2,'9'); -insert into t5 values (3,'3'); -insert into t6 values (1,'9'); -insert into t6 values (2,'3'); -select ord(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; +select ord(col1) from t1 order by col1; ord(col1) 49 57 -select * from t1; +select * from t1 order by col1; col1 1 9 -select * from t2; +select * from t2 order by col1; col1 1 -9 3 -select * from t3; +9 +select * from t3 order by col1; col1 1 -9 3 -select * from t4; -colint col1 -1 1 -2 9 -select * from t5; +9 +select * from t4 order by colint; colint col1 1 1 2 9 3 3 -select * from t6; +4 8 +select * from t5 order by colint; colint col1 -1 9 -2 3 +1 1 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +update t1 set col1='8' where col1='1'; +update t2 set col1='8' where col1='1'; +update t3 set col1='8' where col1='1'; +update t4 set col1='8' where col1='1'; +update t5 set col1='8' where col1='1'; +update t6 set col1='8' where col1='1'; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 ------------------------------------------------------------------------- --- Alter tables with ord(col1) ------------------------------------------------------------------------- @@ -1057,33 +3853,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (ord('a')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -1 +8 9 -select * from t22; +select * from t22 order by col1; col1 -1 -9 3 -select * from t33; -col1 -1 +8 9 +select * from t33 order by col1; +col1 3 -select * from t44; +8 +9 +select * from t44 order by colint; colint col1 -1 1 -2 9 -select * from t55; -colint col1 -1 1 +1 8 2 9 3 3 -select * from t66; +4 8 +select * from t55 order by colint; colint col1 -1 9 -2 3 +1 8 +2 9 +3 3 +4 8 +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t55 +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(3) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ord(col1) +------------------------------------------------------------------------- +delete from t1 where col1='9'; +delete from t2 where col1='9'; +delete from t3 where col1='9'; +delete from t4 where col1='9'; +delete from t5 where col1='9'; +delete from t6 where col1='9'; +select * from t1 order by col1; +col1 +8 +select * from t2 order by col1; +col1 +3 +8 +select * from t3 order by col1; +col1 +3 +8 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t1 values ('9'); +insert into t2 values ('9'); +insert into t3 values ('9'); +insert into t4 values (60,'9'); +insert into t5 values (60,'9'); +insert into t6 values (60,'9'); +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t6 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +60 9 +select * from t5 order by colint; +colint col1 +60 9 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ord(col1) +------------------------------------------------------------------------- +delete from t11 where col1='9'; +delete from t22 where col1='9'; +delete from t33 where col1='9'; +delete from t44 where col1='9'; +delete from t55 where col1='9'; +delete from t66 where col1='9'; +select * from t11 order by col1; +col1 +8 +select * from t22 order by col1; +col1 +3 +8 +select * from t33 order by col1; +col1 +3 +8 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t11 values ('9'); +insert into t22 values ('9'); +insert into t33 values ('9'); +insert into t44 values (60,'9'); +insert into t55 values (60,'9'); +insert into t66 values (60,'9'); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t66 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +60 9 +select * from t55 order by colint; +colint col1 +60 9 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1153,44 +4225,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-02-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-02-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-01-25'); -select day(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select day(col1) from t1 order by col1; day(col1) -3 17 -select * from t1; +3 +select * from t1 order by col1; col1 -2006-02-03 2006-01-17 -select * from t2; -col1 2006-02-03 +select * from t2 order by col1; +col1 2006-01-17 2006-01-25 -select * from t3; -col1 2006-02-03 +select * from t3 order by col1; +col1 2006-01-17 2006-01-25 -select * from t4; -colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t5; +2006-02-03 +select * from t4 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-02-03'; +update t2 set col1='2006-02-05' where col1='2006-02-03'; +update t3 set col1='2006-02-05' where col1='2006-02-03'; +update t4 set col1='2006-02-05' where col1='2006-02-03'; +update t5 set col1='2006-02-05' where col1='2006-02-03'; +update t6 set col1='2006-02-05' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with day(col1) ------------------------------------------------------------------------- @@ -1240,33 +4351,307 @@ alter table t66 partition by range(colint) (partition p0 values less than (day('2006-12-21')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-02-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t33; +2006-02-05 +select * from t33 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t44; +2006-02-05 +select * from t44 order by colint; colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t55; -colint col1 -1 2006-02-03 +1 2006-02-05 2 2006-01-17 3 2006-01-25 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(day(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with day(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with day(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1336,44 +4721,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-02-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-02-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-01-25'); -select dayofmonth(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofmonth(col1) from t1 order by col1; dayofmonth(col1) -3 17 -select * from t1; +3 +select * from t1 order by col1; col1 -2006-02-03 2006-01-17 -select * from t2; -col1 2006-02-03 +select * from t2 order by col1; +col1 2006-01-17 2006-01-25 -select * from t3; -col1 2006-02-03 +select * from t3 order by col1; +col1 2006-01-17 2006-01-25 -select * from t4; -colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t5; +2006-02-03 +select * from t4 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-02-03'; +update t2 set col1='2006-02-05' where col1='2006-02-03'; +update t3 set col1='2006-02-05' where col1='2006-02-03'; +update t4 set col1='2006-02-05' where col1='2006-02-03'; +update t5 set col1='2006-02-05' where col1='2006-02-03'; +update t6 set col1='2006-02-05' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofmonth(col1) ------------------------------------------------------------------------- @@ -1423,33 +4847,307 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofmonth('2006-12-24')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-02-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t33; +2006-02-05 +select * from t33 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t44; +2006-02-05 +select * from t44 order by colint; colint col1 -1 2006-02-03 -2 2006-01-17 -select * from t55; -colint col1 -1 2006-02-03 +1 2006-02-05 2 2006-01-17 3 2006-01-25 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofmonth(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofmonth(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1519,44 +5217,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-02-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-02-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-02-17'); -insert into t6 values (2,'2006-01-25'); -select dayofweek(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofweek(col1) from t1 order by col1; dayofweek(col1) 3 6 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-02-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t3; +2006-02-17 +select * from t3 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t4; +2006-02-17 +select * from t4 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t5; -colint col1 -2 2006-02-17 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -1 2006-01-03 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofweek(col1) ------------------------------------------------------------------------- @@ -1606,33 +5343,319 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofweek('2006-12-24')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-02-05 2006-02-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 -2006-02-17 2006-01-25 -select * from t33; -col1 -2006-01-03 +2006-02-05 2006-02-17 +select * from t33 order by col1; +col1 2006-01-25 -select * from t44; +2006-02-05 +2006-02-17 +select * from t44 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t55; -colint col1 -2 2006-02-17 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -1 2006-01-03 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t55 +partition by list(colint) +subpartition by hash(dayofweek(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofweek(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-02-17'; +delete from t2 where col1='2006-02-17'; +delete from t3 where col1='2006-02-17'; +delete from t4 where col1='2006-02-17'; +delete from t5 where col1='2006-02-17'; +delete from t6 where col1='2006-02-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-02-17'); +insert into t3 values ('2006-02-17'); +insert into t4 values (60,'2006-02-17'); +insert into t5 values (60,'2006-02-17'); +insert into t6 values (60,'2006-02-17'); +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofweek(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-02-17'; +delete from t22 where col1='2006-02-17'; +delete from t33 where col1='2006-02-17'; +delete from t44 where col1='2006-02-17'; +delete from t55 where col1='2006-02-17'; +delete from t66 where col1='2006-02-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-02-17'); +insert into t22 values ('2006-02-17'); +insert into t33 values ('2006-02-17'); +insert into t44 values (60,'2006-02-17'); +insert into t55 values (60,'2006-02-17'); +insert into t66 values (60,'2006-02-17'); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1702,44 +5725,83 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-02-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-02-25'); -select dayofyear(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 17 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-01-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t5; +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t6; +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -1789,33 +5851,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofyear('2006-12-25')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t33; +select * from t33 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t44; +select * from t44 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t55; +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t66; +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1885,44 +6223,83 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-02-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-02-25'); -select dayofyear(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 17 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-01-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 2006-01-17 2006-02-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t5; +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t6; +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -1972,33 +6349,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (dayofyear('2006-12-25')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-01-17 -select * from t22; +2006-02-05 +select * from t22 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t33; +select * from t33 order by col1; col1 -2006-01-03 2006-01-17 +2006-02-05 2006-02-25 -select * from t44; +select * from t44 order by colint; colint col1 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t55; +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -3 2006-02-25 -1 2006-01-03 +1 2006-02-03 2 2006-01-17 -select * from t66; +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-01-17 -2 2006-02-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2068,44 +6721,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-02-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-02-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-02-17'); -insert into t6 values (2,'2006-01-25'); -select extract(month from col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select extract(month from col1) from t1 order by col1; extract(month from col1) 1 2 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-02-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t3; +2006-02-17 +select * from t3 order by col1; col1 2006-01-03 -2006-02-17 2006-01-25 -select * from t4; +2006-02-17 +select * from t4 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t5; -colint col1 -2 2006-02-17 -1 2006-01-03 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with extract(month from col1) ------------------------------------------------------------------------- @@ -2155,33 +6847,309 @@ alter table t66 partition by range(colint) (partition p0 values less than (extract(year from '1998-11-23')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-02-05 2006-02-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 -2006-02-17 2006-01-25 -select * from t33; -col1 -2006-01-03 +2006-02-05 2006-02-17 +select * from t33 order by col1; +col1 2006-01-25 -select * from t44; +2006-02-05 +2006-02-17 +select * from t44 order by colint; colint col1 -2 2006-02-17 -1 2006-01-03 -select * from t55; -colint col1 -2 2006-02-17 -1 2006-01-03 +1 2006-02-03 +2 2006-01-17 3 2006-01-25 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-02-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t55 +partition by list(colint) +subpartition by hash(extract(month from col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with extract(month from col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-02-17'; +delete from t2 where col1='2006-02-17'; +delete from t3 where col1='2006-02-17'; +delete from t4 where col1='2006-02-17'; +delete from t5 where col1='2006-02-17'; +delete from t6 where col1='2006-02-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-02-17'); +insert into t3 values ('2006-02-17'); +insert into t4 values (60,'2006-02-17'); +insert into t5 values (60,'2006-02-17'); +insert into t6 values (60,'2006-02-17'); +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with extract(month from col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-02-17'; +delete from t22 where col1='2006-02-17'; +delete from t33 where col1='2006-02-17'; +delete from t44 where col1='2006-02-17'; +delete from t55 where col1='2006-02-17'; +delete from t66 where col1='2006-02-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-02-17'); +insert into t22 values ('2006-02-17'); +insert into t33 values ('2006-02-17'); +insert into t44 values (60,'2006-02-17'); +insert into t55 values (60,'2006-02-17'); +insert into t66 values (60,'2006-02-17'); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2251,44 +7219,83 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); -insert into t4 values (1,'09:09'); -insert into t4 values (2,'14:30'); -insert into t5 values (1,'09:09'); -insert into t5 values (2,'14:30'); -insert into t5 values (3,'21:59'); -insert into t6 values (1,'14:30'); -insert into t6 values (2,'21:59'); -select hour(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select hour(col1) from t1 order by col1; hour(col1) 9 14 -select * from t1; +select * from t1 order by col1; col1 09:09:00 14:30:00 -select * from t2; +select * from t2 order by col1; col1 09:09:00 14:30:00 21:59:00 -select * from t3; +select * from t3 order by col1; col1 09:09:00 14:30:00 21:59:00 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -select * from t5; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -3 21:59:00 -select * from t6; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:00 -2 21:59:00 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:30' where col1='09:09'; +update t2 set col1='10:30' where col1='09:09'; +update t3 set col1='10:30' where col1='09:09'; +update t4 set col1='10:30' where col1='09:09'; +update t5 set col1='10:30' where col1='09:09'; +update t6 set col1='10:30' where col1='09:09'; +select * from t1 order by col1; +col1 +10:30:00 +14:30:00 +select * from t2 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with hour(col1) ------------------------------------------------------------------------- @@ -2338,33 +7345,315 @@ alter table t66 partition by range(colint) (partition p0 values less than (hour('18:30')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:00 +10:30:00 14:30:00 -select * from t22; +select * from t22 order by col1; col1 -09:09:00 +10:30:00 14:30:00 21:59:00 -select * from t33; +select * from t33 order by col1; col1 -09:09:00 +10:30:00 14:30:00 21:59:00 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -select * from t55; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -2 14:30:00 -1 09:09:00 -3 21:59:00 -select * from t66; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:00 -2 21:59:00 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +alter table t55 +partition by list(colint) +subpartition by hash(hour(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with hour(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30'; +delete from t2 where col1='14:30'; +delete from t3 where col1='14:30'; +delete from t4 where col1='14:30'; +delete from t5 where col1='14:30'; +delete from t6 where col1='14:30'; +select * from t1 order by col1; +col1 +10:30:00 +select * from t2 order by col1; +col1 +10:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30'); +insert into t2 values ('14:30'); +insert into t3 values ('14:30'); +insert into t4 values (60,'14:30'); +insert into t5 values (60,'14:30'); +insert into t6 values (60,'14:30'); +select * from t1 order by col1; +col1 +10:30:00 +14:30:00 +select * from t2 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +60 14:30:00 +select * from t5 order by colint; +colint col1 +60 14:30:00 +select * from t6 order by colint; +colint col1 +60 14:30:00 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with hour(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30'; +delete from t22 where col1='14:30'; +delete from t33 where col1='14:30'; +delete from t44 where col1='14:30'; +delete from t55 where col1='14:30'; +delete from t66 where col1='14:30'; +select * from t11 order by col1; +col1 +10:30:00 +select * from t22 order by col1; +col1 +10:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30'); +insert into t22 values ('14:30'); +insert into t33 values ('14:30'); +insert into t44 values (60,'14:30'); +insert into t55 values (60,'14:30'); +insert into t66 values (60,'14:30'); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +select * from t22 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +14:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +60 14:30:00 +select * from t55 order by colint; +colint col1 +60 14:30:00 +select * from t66 order by colint; +colint col1 +60 14:30:00 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2434,44 +7723,83 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); -insert into t4 values (1,'09:09:15.000002'); -insert into t4 values (2,'04:30:01.000018'); -insert into t5 values (1,'09:09:15.000002'); -insert into t5 values (2,'04:30:01.000018'); -insert into t5 values (3,'00:59:22.000024'); -insert into t6 values (1,'04:30:01.000018'); -insert into t6 values (2,'00:59:22.000024'); -select microsecond(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select microsecond(col1) from t1 order by col1; microsecond(col1) 0 0 -select * from t1; +select * from t1 order by col1; col1 -09:09:15 04:30:01 -select * from t2; +09:09:15 +select * from t2 order by col1; col1 -09:09:15 -04:30:01 00:59:22 -select * from t3; -col1 -09:09:15 04:30:01 +09:09:15 +select * from t3 order by col1; +col1 00:59:22 -select * from t4; -colint col1 -1 09:09:15 -2 04:30:01 -select * from t5; +04:30:01 +09:09:15 +select * from t4 order by colint; colint col1 1 09:09:15 2 04:30:01 3 00:59:22 -select * from t6; +4 05:30:34 +select * from t5 order by colint; colint col1 -1 04:30:01 -2 00:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t2 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t3 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t4 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t5 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t6 set col1='05:30:34.000037' where col1='09:09:15.000002'; +select * from t1 order by col1; +col1 +04:30:01 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with microsecond(col1) ------------------------------------------------------------------------- @@ -2521,33 +7849,301 @@ alter table t66 partition by range(colint) (partition p0 values less than (microsecond('10:30:10.000010')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:15 04:30:01 -select * from t22; +05:30:34 +select * from t22 order by col1; col1 -09:09:15 -04:30:01 00:59:22 -select * from t33; -col1 -09:09:15 04:30:01 +05:30:34 +select * from t33 order by col1; +col1 00:59:22 -select * from t44; +04:30:01 +05:30:34 +select * from t44 order by colint; colint col1 -1 09:09:15 -2 04:30:01 -select * from t55; -colint col1 -1 09:09:15 +1 05:30:34 2 04:30:01 3 00:59:22 -select * from t66; +4 05:30:34 +select * from t55 order by colint; colint col1 -1 04:30:01 -2 00:59:22 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +alter table t55 +partition by list(colint) +subpartition by hash(microsecond(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with microsecond(col1) +------------------------------------------------------------------------- +delete from t1 where col1='04:30:01.000018'; +delete from t2 where col1='04:30:01.000018'; +delete from t3 where col1='04:30:01.000018'; +delete from t4 where col1='04:30:01.000018'; +delete from t5 where col1='04:30:01.000018'; +delete from t6 where col1='04:30:01.000018'; +select * from t1 order by col1; +col1 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +insert into t1 values ('04:30:01.000018'); +insert into t2 values ('04:30:01.000018'); +insert into t3 values ('04:30:01.000018'); +insert into t4 values (60,'04:30:01.000018'); +insert into t5 values (60,'04:30:01.000018'); +insert into t6 values (60,'04:30:01.000018'); +select * from t1 order by col1; +col1 +04:30:01 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t5 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t6 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +60 04:30:01 +select * from t5 order by colint; +colint col1 +60 04:30:01 +select * from t6 order by colint; +colint col1 +60 04:30:01 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with microsecond(col1) +------------------------------------------------------------------------- +delete from t11 where col1='04:30:01.000018'; +delete from t22 where col1='04:30:01.000018'; +delete from t33 where col1='04:30:01.000018'; +delete from t44 where col1='04:30:01.000018'; +delete from t55 where col1='04:30:01.000018'; +delete from t66 where col1='04:30:01.000018'; +select * from t11 order by col1; +col1 +05:30:34 +select * from t22 order by col1; +col1 +00:59:22 +05:30:34 +select * from t33 order by col1; +col1 +00:59:22 +05:30:34 +select * from t44 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +insert into t11 values ('04:30:01.000018'); +insert into t22 values ('04:30:01.000018'); +insert into t33 values ('04:30:01.000018'); +insert into t44 values (60,'04:30:01.000018'); +insert into t55 values (60,'04:30:01.000018'); +insert into t66 values (60,'04:30:01.000018'); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +select * from t22 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t33 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t44 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t55 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t66 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t44 order by colint; +colint col1 +60 04:30:01 +select * from t55 order by colint; +colint col1 +60 04:30:01 +select * from t66 order by colint; +colint col1 +60 04:30:01 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2617,44 +8213,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:15'); -insert into t4 values (2,'14:30:45'); -insert into t5 values (1,'09:09:15'); -insert into t5 values (2,'14:30:45'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:45'); -insert into t6 values (2,'21:59:22'); -select minute(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select minute(col1) from t1 order by col1; minute(col1) 9 30 -select * from t1; +select * from t1 order by col1; col1 09:09:15 14:30:45 -select * from t2; +select * from t2 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:45 1 09:09:15 -select * from t5; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 -2 14:30:45 1 09:09:15 -3 21:59:22 -select * from t6; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:24:23' where col1='09:09:15'; +update t2 set col1='10:24:23' where col1='09:09:15'; +update t3 set col1='10:24:23' where col1='09:09:15'; +update t4 set col1='10:24:23' where col1='09:09:15'; +update t5 set col1='10:24:23' where col1='09:09:15'; +update t6 set col1='10:24:23' where col1='09:09:15'; +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with minute(col1) ------------------------------------------------------------------------- @@ -2704,33 +8339,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (minute('18:30')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:15 +10:24:23 14:30:45 -select * from t22; +select * from t22 order by col1; col1 -09:09:15 +10:24:23 14:30:45 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:15 +10:24:23 14:30:45 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:45 -1 09:09:15 -select * from t55; +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -2 14:30:45 -1 09:09:15 -3 21:59:22 -select * from t66; +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +alter table t55 +partition by list(colint) +subpartition by hash(minute(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with minute(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:45'; +delete from t2 where col1='14:30:45'; +delete from t3 where col1='14:30:45'; +delete from t4 where col1='14:30:45'; +delete from t5 where col1='14:30:45'; +delete from t6 where col1='14:30:45'; +select * from t1 order by col1; +col1 +10:24:23 +select * from t2 order by col1; +col1 +10:24:23 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:45'); +insert into t2 values ('14:30:45'); +insert into t3 values ('14:30:45'); +insert into t4 values (60,'14:30:45'); +insert into t5 values (60,'14:30:45'); +insert into t6 values (60,'14:30:45'); +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t6 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:45 +select * from t5 order by colint; +colint col1 +60 14:30:45 +select * from t6 order by colint; +colint col1 +60 14:30:45 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with minute(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:45'; +delete from t22 where col1='14:30:45'; +delete from t33 where col1='14:30:45'; +delete from t44 where col1='14:30:45'; +delete from t55 where col1='14:30:45'; +delete from t66 where col1='14:30:45'; +select * from t11 order by col1; +col1 +10:24:23 +select * from t22 order by col1; +col1 +10:24:23 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:45'); +insert into t22 values ('14:30:45'); +insert into t33 values ('14:30:45'); +insert into t44 values (60,'14:30:45'); +insert into t55 values (60,'14:30:45'); +insert into t66 values (60,'14:30:45'); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +select * from t22 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +select * from t22 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:45 +select * from t55 order by colint; +colint col1 +60 14:30:45 +select * from t66 order by colint; +colint col1 +60 14:30:45 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2800,44 +8723,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:09'); -insert into t4 values (2,'14:30:20'); -insert into t5 values (1,'09:09:09'); -insert into t5 values (2,'14:30:20'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:20'); -insert into t6 values (2,'21:59:22'); -select second(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select second(col1) from t1 order by col1; second(col1) 9 20 -select * from t1; +select * from t1 order by col1; col1 09:09:09 14:30:20 -select * from t2; +select * from t2 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t5; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t6; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:22:33' where col1='09:09:09'; +update t2 set col1='10:22:33' where col1='09:09:09'; +update t3 set col1='10:22:33' where col1='09:09:09'; +update t4 set col1='10:22:33' where col1='09:09:09'; +update t5 set col1='10:22:33' where col1='09:09:09'; +update t6 set col1='10:22:33' where col1='09:09:09'; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with second(col1) ------------------------------------------------------------------------- @@ -2887,33 +8849,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (second('18:30:14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:09 +10:22:33 14:30:20 -select * from t22; +select * from t22 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t55; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t66; +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:20'; +delete from t2 where col1='14:30:20'; +delete from t3 where col1='14:30:20'; +delete from t4 where col1='14:30:20'; +delete from t5 where col1='14:30:20'; +delete from t6 where col1='14:30:20'; +select * from t1 order by col1; +col1 +10:22:33 +select * from t2 order by col1; +col1 +10:22:33 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:20'); +insert into t2 values ('14:30:20'); +insert into t3 values ('14:30:20'); +insert into t4 values (60,'14:30:20'); +insert into t5 values (60,'14:30:20'); +insert into t6 values (60,'14:30:20'); +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:20 +select * from t5 order by colint; +colint col1 +60 14:30:20 +select * from t6 order by colint; +colint col1 +60 14:30:20 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:20'; +delete from t22 where col1='14:30:20'; +delete from t33 where col1='14:30:20'; +delete from t44 where col1='14:30:20'; +delete from t55 where col1='14:30:20'; +delete from t66 where col1='14:30:20'; +select * from t11 order by col1; +col1 +10:22:33 +select * from t22 order by col1; +col1 +10:22:33 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:20'); +insert into t22 values ('14:30:20'); +insert into t33 values ('14:30:20'); +insert into t44 values (60,'14:30:20'); +insert into t55 values (60,'14:30:20'); +insert into t66 values (60,'14:30:20'); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:20 +select * from t55 order by colint; +colint col1 +60 14:30:20 +select * from t66 order by colint; +colint col1 +60 14:30:20 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2983,44 +9233,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:09'); -insert into t4 values (2,'14:30:20'); -insert into t5 values (1,'09:09:09'); -insert into t5 values (2,'14:30:20'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:20'); -insert into t6 values (2,'21:59:22'); -select second(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select second(col1) from t1 order by col1; second(col1) 9 20 -select * from t1; +select * from t1 order by col1; col1 09:09:09 14:30:20 -select * from t2; +select * from t2 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:09 14:30:20 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t5; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t6; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t6 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +update t1 set col1='10:22:33' where col1='09:09:09'; +update t2 set col1='10:22:33' where col1='09:09:09'; +update t3 set col1='10:22:33' where col1='09:09:09'; +update t4 set col1='10:22:33' where col1='09:09:09'; +update t5 set col1='10:22:33' where col1='09:09:09'; +update t6 set col1='10:22:33' where col1='09:09:09'; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t6 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 ------------------------------------------------------------------------- --- Alter tables with second(col1) ------------------------------------------------------------------------- @@ -3070,33 +9359,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (second('18:30:14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:09 +10:22:33 14:30:20 -select * from t22; +select * from t22 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:09 +10:22:33 14:30:20 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -2 14:30:20 -1 09:09:09 -select * from t55; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t55 order by colint; colint col1 -2 14:30:20 -3 21:59:22 -1 09:09:09 -select * from t66; +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t66 order by colint; colint col1 -1 14:30:20 -2 21:59:22 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:20'; +delete from t2 where col1='14:30:20'; +delete from t3 where col1='14:30:20'; +delete from t4 where col1='14:30:20'; +delete from t5 where col1='14:30:20'; +delete from t6 where col1='14:30:20'; +select * from t1 order by col1; +col1 +10:22:33 +select * from t2 order by col1; +col1 +10:22:33 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +insert into t1 values ('14:30:20'); +insert into t2 values ('14:30:20'); +insert into t3 values ('14:30:20'); +insert into t4 values (60,'14:30:20'); +insert into t5 values (60,'14:30:20'); +insert into t6 values (60,'14:30:20'); +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t6 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:20 +select * from t5 order by colint; +colint col1 +60 14:30:20 +select * from t6 order by colint; +colint col1 +60 14:30:20 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:20'; +delete from t22 where col1='14:30:20'; +delete from t33 where col1='14:30:20'; +delete from t44 where col1='14:30:20'; +delete from t55 where col1='14:30:20'; +delete from t66 where col1='14:30:20'; +select * from t11 order by col1; +col1 +10:22:33 +select * from t22 order by col1; +col1 +10:22:33 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +insert into t11 values ('14:30:20'); +insert into t22 values ('14:30:20'); +insert into t33 values ('14:30:20'); +insert into t44 values (60,'14:30:20'); +insert into t55 values (60,'14:30:20'); +insert into t66 values (60,'14:30:20'); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:20 +select * from t55 order by colint; +colint col1 +60 14:30:20 +select * from t66 order by colint; +colint col1 +60 14:30:20 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3166,44 +9743,83 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-12-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-12-17'); -insert into t5 values (3,'2006-05-25'); -insert into t6 values (1,'2006-12-17'); -insert into t6 values (2,'2006-05-25'); -select month(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select month(col1) from t1 order by col1; month(col1) 1 12 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-12-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-05-25 2006-12-17 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 -2006-12-17 2006-05-25 -select * from t4; +2006-12-17 +select * from t4 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-12-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-11-06' where col1='2006-01-03'; +update t2 set col1='2006-11-06' where col1='2006-01-03'; +update t3 set col1='2006-11-06' where col1='2006-01-03'; +update t4 set col1='2006-11-06' where col1='2006-01-03'; +update t5 set col1='2006-11-06' where col1='2006-01-03'; +update t6 set col1='2006-11-06' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with month(col1) ------------------------------------------------------------------------- @@ -3253,33 +9869,315 @@ alter table t66 partition by range(colint) (partition p0 values less than (month('2006-10-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-11-06 2006-12-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 2006-05-25 +2006-11-06 2006-12-17 -select * from t33; +select * from t33 order by col1; col1 -2006-01-03 -2006-12-17 2006-05-25 -select * from t44; +2006-11-06 +2006-12-17 +select * from t44 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-12-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +alter table t55 +partition by list(colint) +subpartition by hash(month(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with month(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-12-17'; +delete from t2 where col1='2006-12-17'; +delete from t3 where col1='2006-12-17'; +delete from t4 where col1='2006-12-17'; +delete from t5 where col1='2006-12-17'; +delete from t6 where col1='2006-12-17'; +select * from t1 order by col1; +col1 +2006-11-06 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-12-17'); +insert into t3 values ('2006-12-17'); +insert into t4 values (60,'2006-12-17'); +insert into t5 values (60,'2006-12-17'); +insert into t6 values (60,'2006-12-17'); +select * from t1 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +60 2006-12-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with month(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-12-17'; +delete from t22 where col1='2006-12-17'; +delete from t33 where col1='2006-12-17'; +delete from t44 where col1='2006-12-17'; +delete from t55 where col1='2006-12-17'; +delete from t66 where col1='2006-12-17'; +select * from t11 order by col1; +col1 +2006-11-06 +select * from t22 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-12-17'); +insert into t22 values ('2006-12-17'); +insert into t33 values ('2006-12-17'); +insert into t44 values (60,'2006-12-17'); +insert into t55 values (60,'2006-12-17'); +insert into t66 values (60,'2006-12-17'); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t22 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t44 order by colint; +colint col1 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +60 2006-12-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3349,44 +10247,83 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-12-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-12-17'); -insert into t5 values (3,'2006-09-25'); -insert into t6 values (1,'2006-12-17'); -insert into t6 values (2,'2006-09-25'); -select quarter(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select quarter(col1) from t1 order by col1; quarter(col1) 1 4 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-12-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 -2006-12-17 2006-09-25 -select * from t3; +2006-12-17 +select * from t3 order by col1; col1 2006-01-03 -2006-12-17 2006-09-25 -select * from t4; +2006-12-17 +select * from t4 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-09-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-12-17 -2 2006-09-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-07-30' where col1='2006-01-03'; +update t2 set col1='2006-07-30' where col1='2006-01-03'; +update t3 set col1='2006-07-30' where col1='2006-01-03'; +update t4 set col1='2006-07-30' where col1='2006-01-03'; +update t5 set col1='2006-07-30' where col1='2006-01-03'; +update t6 set col1='2006-07-30' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with quarter(col1) ------------------------------------------------------------------------- @@ -3436,33 +10373,313 @@ alter table t66 partition by range(colint) (partition p0 values less than (quarter('2006-10-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 +2006-07-30 2006-12-17 -select * from t22; +select * from t22 order by col1; col1 -2006-01-03 -2006-12-17 +2006-07-30 2006-09-25 -select * from t33; -col1 -2006-01-03 2006-12-17 +select * from t33 order by col1; +col1 +2006-07-30 2006-09-25 -select * from t44; +2006-12-17 +select * from t44 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -2 2006-12-17 -1 2006-01-03 -3 2006-09-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-12-17 -2 2006-09-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +alter table t55 +partition by list(colint) +subpartition by hash(quarter(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with quarter(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-12-17'; +delete from t2 where col1='2006-12-17'; +delete from t3 where col1='2006-12-17'; +delete from t4 where col1='2006-12-17'; +delete from t5 where col1='2006-12-17'; +delete from t6 where col1='2006-12-17'; +select * from t1 order by col1; +col1 +2006-07-30 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-12-17'); +insert into t3 values ('2006-12-17'); +insert into t4 values (60,'2006-12-17'); +insert into t5 values (60,'2006-12-17'); +insert into t6 values (60,'2006-12-17'); +select * from t1 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +4 2006-02-05 +60 2006-12-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with quarter(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-12-17'; +delete from t22 where col1='2006-12-17'; +delete from t33 where col1='2006-12-17'; +delete from t44 where col1='2006-12-17'; +delete from t55 where col1='2006-12-17'; +delete from t66 where col1='2006-12-17'; +select * from t11 order by col1; +col1 +2006-07-30 +select * from t22 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-12-17'); +insert into t22 values ('2006-12-17'); +insert into t33 values ('2006-12-17'); +insert into t44 values (60,'2006-12-17'); +insert into t55 values (60,'2006-12-17'); +insert into t66 values (60,'2006-12-17'); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t22 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t44 order by colint; +colint col1 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +4 2006-02-05 +60 2006-12-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3532,44 +10749,83 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -insert into t4 values (1,'09:09:15'); -insert into t4 values (2,'14:30:45'); -insert into t5 values (1,'09:09:15'); -insert into t5 values (2,'14:30:45'); -insert into t5 values (3,'21:59:22'); -insert into t6 values (1,'14:30:45'); -insert into t6 values (2,'21:59:22'); -select time_to_sec(col1)-(time_to_sec(col1)-20) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1; time_to_sec(col1)-(time_to_sec(col1)-20) 20 20 -select * from t1; +select * from t1 order by col1; col1 09:09:15 14:30:45 -select * from t2; +select * from t2 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t3; +select * from t3 order by col1; col1 09:09:15 14:30:45 21:59:22 -select * from t4; +select * from t4 order by colint; colint col1 1 09:09:15 -2 14:30:45 -select * from t5; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; colint col1 1 09:09:15 -2 14:30:45 -3 21:59:22 -select * from t6; +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:33:11' where col1='09:09:15'; +update t2 set col1='10:33:11' where col1='09:09:15'; +update t3 set col1='10:33:11' where col1='09:09:15'; +update t4 set col1='10:33:11' where col1='09:09:15'; +update t5 set col1='10:33:11' where col1='09:09:15'; +update t6 set col1='10:33:11' where col1='09:09:15'; +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 ------------------------------------------------------------------------- --- Alter tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- @@ -3619,33 +10875,319 @@ alter table t66 partition by range(colint) (partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -09:09:15 +10:33:11 14:30:45 -select * from t22; +select * from t22 order by col1; col1 -09:09:15 +10:33:11 14:30:45 21:59:22 -select * from t33; +select * from t33 order by col1; col1 -09:09:15 +10:33:11 14:30:45 21:59:22 -select * from t44; +select * from t44 order by colint; colint col1 -1 09:09:15 -2 14:30:45 -select * from t55; +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; colint col1 -1 09:09:15 -2 14:30:45 -3 21:59:22 -select * from t66; +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; colint col1 -1 14:30:45 -2 21:59:22 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +alter table t55 +partition by list(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:45'; +delete from t2 where col1='14:30:45'; +delete from t3 where col1='14:30:45'; +delete from t4 where col1='14:30:45'; +delete from t5 where col1='14:30:45'; +delete from t6 where col1='14:30:45'; +select * from t1 order by col1; +col1 +10:33:11 +select * from t2 order by col1; +col1 +10:33:11 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:45'); +insert into t2 values ('14:30:45'); +insert into t3 values ('14:30:45'); +insert into t4 values (60,'14:30:45'); +insert into t5 values (60,'14:30:45'); +insert into t6 values (60,'14:30:45'); +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t6 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:45 +select * from t5 order by colint; +colint col1 +60 14:30:45 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:45'; +delete from t22 where col1='14:30:45'; +delete from t33 where col1='14:30:45'; +delete from t44 where col1='14:30:45'; +delete from t55 where col1='14:30:45'; +delete from t66 where col1='14:30:45'; +select * from t11 order by col1; +col1 +10:33:11 +select * from t22 order by col1; +col1 +10:33:11 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:45'); +insert into t22 values ('14:30:45'); +insert into t33 values ('14:30:45'); +insert into t44 values (60,'14:30:45'); +insert into t55 values (60,'14:30:45'); +insert into t66 values (60,'14:30:45'); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +select * from t22 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +select * from t22 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:45 +select * from t55 order by colint; +colint col1 +60 14:30:45 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3715,44 +11257,83 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -insert into t4 values (1,'2006-02-03'); -insert into t4 values (2,'2006-01-17'); -insert into t5 values (1,'2006-02-03'); -insert into t5 values (2,'2006-01-17'); -insert into t5 values (3,'2006-01-25'); -insert into t6 values (1,'2006-01-17'); -insert into t6 values (2,'2006-01-25'); -select to_days(col1)-to_days('2006-01-01') from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select to_days(col1)-to_days('2006-01-01') from t1 order by col1; to_days(col1)-to_days('2006-01-01') -33 16 -select * from t1; +33 +select * from t1 order by col1; col1 -2006-02-03 2006-01-17 -select * from t2; +2006-02-03 +select * from t2 order by col1; col1 2006-01-17 2006-01-25 2006-02-03 -select * from t3; +select * from t3 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t4; +2006-02-03 +select * from t4 order by colint; colint col1 -2 2006-01-17 1 2006-02-03 -select * from t5; -colint col1 2 2006-01-17 3 2006-01-25 -1 2006-02-03 -select * from t6; +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-02-03'; +update t2 set col1='2006-02-06' where col1='2006-02-03'; +update t3 set col1='2006-02-06' where col1='2006-02-03'; +update t4 set col1='2006-02-06' where col1='2006-02-03'; +update t5 set col1='2006-02-06' where col1='2006-02-03'; +update t6 set col1='2006-02-06' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with to_days(col1)-to_days('2006-01-01') ------------------------------------------------------------------------- @@ -3802,33 +11383,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-02-03 2006-01-17 -select * from t22; +2006-02-06 +select * from t22 order by col1; col1 2006-01-17 2006-01-25 -2006-02-03 -select * from t33; +2006-02-06 +select * from t33 order by col1; col1 -2006-02-03 2006-01-17 2006-01-25 -select * from t44; -colint col1 -2 2006-01-17 -1 2006-02-03 -select * from t55; +2006-02-06 +select * from t44 order by colint; colint col1 +1 2006-02-06 2 2006-01-17 3 2006-01-25 -1 2006-02-03 -select * from t66; +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-17 -2 2006-01-25 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t55 +partition by list(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3898,44 +11757,83 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); -insert into t4 values (1,'2006-12-03'); -insert into t4 values (2,'2006-11-17'); -insert into t5 values (1,'2006-12-03'); -insert into t5 values (2,'2006-11-17'); -insert into t5 values (3,'2006-05-25'); -insert into t6 values (1,'2006-11-17'); -insert into t6 values (2,'2006-05-25'); -select weekday(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select weekday(col1) from t1 order by col1; weekday(col1) -6 4 -select * from t1; +6 +select * from t1 order by col1; col1 -2006-12-03 2006-11-17 -select * from t2; +2006-12-03 +select * from t2 order by col1; col1 -2006-12-03 -2006-11-17 2006-05-25 -select * from t3; -col1 -2006-12-03 2006-11-17 +2006-12-03 +select * from t3 order by col1; +col1 2006-05-25 -select * from t4; +2006-11-17 +2006-12-03 +select * from t4 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -3 2006-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-11-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-12-03'; +update t2 set col1='2006-02-06' where col1='2006-12-03'; +update t3 set col1='2006-02-06' where col1='2006-12-03'; +update t4 set col1='2006-02-06' where col1='2006-12-03'; +update t5 set col1='2006-02-06' where col1='2006-12-03'; +update t6 set col1='2006-02-06' where col1='2006-12-03'; +select * from t1 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with weekday(col1) ------------------------------------------------------------------------- @@ -3985,33 +11883,311 @@ alter table t66 partition by range(colint) (partition p0 values less than (weekday('2006-10-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-12-03 +2006-02-06 2006-11-17 -select * from t22; +select * from t22 order by col1; col1 -2006-12-03 -2006-11-17 +2006-02-06 2006-05-25 -select * from t33; -col1 -2006-12-03 2006-11-17 +select * from t33 order by col1; +col1 +2006-02-06 2006-05-25 -select * from t44; +2006-11-17 +select * from t44 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-12-03 -2 2006-11-17 -3 2006-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-11-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +alter table t55 +partition by list(colint) +subpartition by hash(weekday(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekday(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-11-17'; +delete from t2 where col1='2006-11-17'; +delete from t3 where col1='2006-11-17'; +delete from t4 where col1='2006-11-17'; +delete from t5 where col1='2006-11-17'; +delete from t6 where col1='2006-11-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-11-17'); +insert into t2 values ('2006-11-17'); +insert into t3 values ('2006-11-17'); +insert into t4 values (60,'2006-11-17'); +insert into t5 values (60,'2006-11-17'); +insert into t6 values (60,'2006-11-17'); +select * from t1 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +60 2006-11-17 +select * from t5 order by colint; +colint col1 +60 2006-11-17 +select * from t6 order by colint; +colint col1 +60 2006-11-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekday(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-11-17'; +delete from t22 where col1='2006-11-17'; +delete from t33 where col1='2006-11-17'; +delete from t44 where col1='2006-11-17'; +delete from t55 where col1='2006-11-17'; +delete from t66 where col1='2006-11-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-11-17'); +insert into t22 values ('2006-11-17'); +insert into t33 values ('2006-11-17'); +insert into t44 values (60,'2006-11-17'); +insert into t55 values (60,'2006-11-17'); +insert into t66 values (60,'2006-11-17'); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t22 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t44 order by colint; +colint col1 +60 2006-11-17 +select * from t55 order by colint; +colint col1 +60 2006-11-17 +select * from t66 order by colint; +colint col1 +60 2006-11-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -4081,44 +12257,83 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-03-17'); insert into t3 values ('2006-05-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-03-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-03-17'); -insert into t5 values (3,'2006-05-25'); -insert into t6 values (1,'2006-03-17'); -insert into t6 values (2,'2006-05-25'); -select weekofyear(col1) from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select weekofyear(col1) from t1 order by col1; weekofyear(col1) 1 11 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-03-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-03-17 2006-05-25 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 2006-03-17 2006-05-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -3 2006-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-03-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-09-06' where col1='2006-01-03'; +update t2 set col1='2006-09-06' where col1='2006-01-03'; +update t3 set col1='2006-09-06' where col1='2006-01-03'; +update t4 set col1='2006-09-06' where col1='2006-01-03'; +update t5 set col1='2006-09-06' where col1='2006-01-03'; +update t6 set col1='2006-09-06' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with weekofyear(col1) ------------------------------------------------------------------------- @@ -4168,33 +12383,319 @@ alter table t66 partition by range(colint) (partition p0 values less than (weekofyear('2006-02-14')), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-03-17 -select * from t22; +2006-09-06 +select * from t22 order by col1; col1 -2006-01-03 2006-03-17 2006-05-25 -select * from t33; +2006-09-06 +select * from t33 order by col1; col1 -2006-01-03 2006-03-17 2006-05-25 -select * from t44; +2006-09-06 +select * from t44 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 2006-01-03 -2 2006-03-17 -3 2006-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-03-17 -2 2006-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +alter table t55 +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-03-17'; +delete from t2 where col1='2006-03-17'; +delete from t3 where col1='2006-03-17'; +delete from t4 where col1='2006-03-17'; +delete from t5 where col1='2006-03-17'; +delete from t6 where col1='2006-03-17'; +select * from t1 order by col1; +col1 +2006-09-06 +select * from t2 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-03-17'); +insert into t2 values ('2006-03-17'); +insert into t3 values ('2006-03-17'); +insert into t4 values (60,'2006-03-17'); +insert into t5 values (60,'2006-03-17'); +insert into t6 values (60,'2006-03-17'); +select * from t1 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +60 2006-03-17 +select * from t5 order by colint; +colint col1 +60 2006-03-17 +select * from t6 order by colint; +colint col1 +60 2006-03-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-03-17'; +delete from t22 where col1='2006-03-17'; +delete from t33 where col1='2006-03-17'; +delete from t44 where col1='2006-03-17'; +delete from t55 where col1='2006-03-17'; +delete from t66 where col1='2006-03-17'; +select * from t11 order by col1; +col1 +2006-09-06 +select * from t22 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-03-17'); +insert into t22 values ('2006-03-17'); +insert into t33 values ('2006-03-17'); +insert into t44 values (60,'2006-03-17'); +insert into t55 values (60,'2006-03-17'); +insert into t66 values (60,'2006-03-17'); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t22 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-09-06 +select * from t22 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +60 2006-03-17 +select * from t55 order by colint; +colint col1 +60 2006-03-17 +select * from t66 order by colint; +colint col1 +60 2006-03-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -4264,44 +12765,83 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); -insert into t4 values (1,'1996-01-03'); -insert into t4 values (2,'2000-02-17'); -insert into t5 values (1,'1996-01-03'); -insert into t5 values (2,'2000-02-17'); -insert into t5 values (3,'2004-05-25'); -insert into t6 values (1,'2000-02-17'); -insert into t6 values (2,'2004-05-25'); -select year(col1)-1990 from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select year(col1)-1990 from t1 order by col1; year(col1)-1990 6 10 -select * from t1; +select * from t1 order by col1; col1 1996-01-03 2000-02-17 -select * from t2; +select * from t2 order by col1; col1 1996-01-03 2000-02-17 2004-05-25 -select * from t3; +select * from t3 order by col1; col1 1996-01-03 2000-02-17 2004-05-25 -select * from t4; +select * from t4 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -3 2004-05-25 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2000-02-17 -2 2004-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2002-02-15' where col1='1996-01-03'; +update t2 set col1='2002-02-15' where col1='1996-01-03'; +update t3 set col1='2002-02-15' where col1='1996-01-03'; +update t4 set col1='2002-02-15' where col1='1996-01-03'; +update t5 set col1='2002-02-15' where col1='1996-01-03'; +update t6 set col1='2002-02-15' where col1='1996-01-03'; +select * from t1 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t2 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with year(col1)-1990 ------------------------------------------------------------------------- @@ -4351,33 +12891,315 @@ alter table t66 partition by range(colint) (partition p0 values less than (year('2005-10-14')-1990), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -1996-01-03 2000-02-17 -select * from t22; +2002-02-15 +select * from t22 order by col1; col1 -1996-01-03 2000-02-17 +2002-02-15 2004-05-25 -select * from t33; +select * from t33 order by col1; col1 -1996-01-03 2000-02-17 +2002-02-15 2004-05-25 -select * from t44; +select * from t44 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -1 1996-01-03 -2 2000-02-17 -3 2004-05-25 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2000-02-17 -2 2004-05-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +alter table t55 +partition by list(colint) +subpartition by hash(year(col1)-1990) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with year(col1)-1990 +------------------------------------------------------------------------- +delete from t1 where col1='2000-02-17'; +delete from t2 where col1='2000-02-17'; +delete from t3 where col1='2000-02-17'; +delete from t4 where col1='2000-02-17'; +delete from t5 where col1='2000-02-17'; +delete from t6 where col1='2000-02-17'; +select * from t1 order by col1; +col1 +2002-02-15 +select * from t2 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2000-02-17'); +insert into t2 values ('2000-02-17'); +insert into t3 values ('2000-02-17'); +insert into t4 values (60,'2000-02-17'); +insert into t5 values (60,'2000-02-17'); +insert into t6 values (60,'2000-02-17'); +select * from t1 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t2 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +60 2000-02-17 +select * from t5 order by colint; +colint col1 +60 2000-02-17 +select * from t6 order by colint; +colint col1 +60 2000-02-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with year(col1)-1990 +------------------------------------------------------------------------- +delete from t11 where col1='2000-02-17'; +delete from t22 where col1='2000-02-17'; +delete from t33 where col1='2000-02-17'; +delete from t44 where col1='2000-02-17'; +delete from t55 where col1='2000-02-17'; +delete from t66 where col1='2000-02-17'; +select * from t11 order by col1; +col1 +2002-02-15 +select * from t22 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2000-02-17'); +insert into t22 values ('2000-02-17'); +insert into t33 values ('2000-02-17'); +insert into t44 values (60,'2000-02-17'); +insert into t55 values (60,'2000-02-17'); +insert into t66 values (60,'2000-02-17'); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t22 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +60 2000-02-17 +select * from t55 order by colint; +colint col1 +60 2000-02-17 +select * from t66 order by colint; +colint col1 +60 2000-02-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -4447,44 +13269,83 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); -insert into t4 values (1,'2006-01-03'); -insert into t4 values (2,'2006-08-17'); -insert into t5 values (1,'2006-01-03'); -insert into t5 values (2,'2006-08-17'); -insert into t5 values (3,'2006-03-25'); -insert into t6 values (1,'2006-08-17'); -insert into t6 values (2,'2006-03-25'); -select yearweek(col1)-200600 from t1; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select yearweek(col1)-200600 from t1 order by col1; yearweek(col1)-200600 1 33 -select * from t1; +select * from t1 order by col1; col1 2006-01-03 2006-08-17 -select * from t2; +select * from t2 order by col1; col1 2006-01-03 2006-03-25 2006-08-17 -select * from t3; +select * from t3 order by col1; col1 2006-01-03 -2006-08-17 2006-03-25 -select * from t4; +2006-08-17 +select * from t4 order by colint; colint col1 -1 2006-01-03 -2 2006-08-17 -select * from t5; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; colint col1 -3 2006-03-25 -1 2006-01-03 -2 2006-08-17 -select * from t6; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; colint col1 -1 2006-08-17 -2 2006-03-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-11-15' where col1='2006-01-03'; +update t2 set col1='2006-11-15' where col1='2006-01-03'; +update t3 set col1='2006-11-15' where col1='2006-01-03'; +update t4 set col1='2006-11-15' where col1='2006-01-03'; +update t5 set col1='2006-11-15' where col1='2006-01-03'; +update t6 set col1='2006-11-15' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 ------------------------------------------------------------------------- --- Alter tables with yearweek(col1)-200600 ------------------------------------------------------------------------- @@ -4534,33 +13395,321 @@ alter table t66 partition by range(colint) (partition p0 values less than (yearweek('2006-10-14')-200600), partition p1 values less than maxvalue); -select * from t11; +select * from t11 order by col1; col1 -2006-01-03 2006-08-17 -select * from t22; +2006-11-15 +select * from t22 order by col1; col1 -2006-01-03 2006-03-25 2006-08-17 -select * from t33; +2006-11-15 +select * from t33 order by col1; col1 -2006-01-03 -2006-08-17 2006-03-25 -select * from t44; +2006-08-17 +2006-11-15 +select * from t44 order by colint; colint col1 -1 2006-01-03 -2 2006-08-17 -select * from t55; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; colint col1 -3 2006-03-25 -1 2006-01-03 -2 2006-08-17 -select * from t66; +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; colint col1 -1 2006-08-17 -2 2006-03-25 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +alter table t55 +partition by list(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +delete from t1 where col1='2006-08-17'; +delete from t2 where col1='2006-08-17'; +delete from t3 where col1='2006-08-17'; +delete from t4 where col1='2006-08-17'; +delete from t5 where col1='2006-08-17'; +delete from t6 where col1='2006-08-17'; +select * from t1 order by col1; +col1 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-08-17'); +insert into t2 values ('2006-08-17'); +insert into t3 values ('2006-08-17'); +insert into t4 values (60,'2006-08-17'); +insert into t5 values (60,'2006-08-17'); +insert into t6 values (60,'2006-08-17'); +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +60 2006-08-17 +select * from t5 order by colint; +colint col1 +60 2006-08-17 +select * from t6 order by colint; +colint col1 +60 2006-08-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +delete from t11 where col1='2006-08-17'; +delete from t22 where col1='2006-08-17'; +delete from t33 where col1='2006-08-17'; +delete from t44 where col1='2006-08-17'; +delete from t55 where col1='2006-08-17'; +delete from t66 where col1='2006-08-17'; +select * from t11 order by col1; +col1 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-08-17'); +insert into t22 values ('2006-08-17'); +insert into t33 values ('2006-08-17'); +insert into t44 values (60,'2006-08-17'); +insert into t55 values (60,'2006-08-17'); +insert into t66 values (60,'2006-08-17'); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t44 order by colint; +colint col1 +60 2006-08-17 +select * from t55 order by colint; +colint col1 +60 2006-08-17 +select * from t66 order by colint; +colint col1 +60 2006-08-17 +------------------------- +---- some alter table end +------------------------- drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; diff --git a/mysql-test/suite/partitions/r/partition_supported_sql_func_ndb.result b/mysql-test/suite/partitions/r/partition_supported_sql_func_ndb.result new file mode 100644 index 00000000000..5dc27d16538 --- /dev/null +++ b/mysql-test/suite/partitions/r/partition_supported_sql_func_ndb.result @@ -0,0 +1,13724 @@ +------------------------------------------------------------------------- +--- abs(col1) in partition with coltype int +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with abs(col1) +------------------------------------------------------------------------- +create table t1 (col1 int) engine='NDB' +partition by range(abs(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 int) engine='NDB' +partition by list(abs(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 int) engine='NDB' +partition by hash(abs(col1)); +create table t4 (colint int, col1 int) engine='NDB' +partition by range(colint) +subpartition by hash(abs(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 int) engine='NDB' +partition by list(colint) +subpartition by hash(abs(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 int) engine='NDB' +partition by range(colint) +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with abs(col1) +------------------------------------------------------------------------- +insert into t1 values (5 ); +insert into t1 values (13 ); +insert into t2 values (5 ); +insert into t2 values (13 ); +insert into t2 values (17 ); +insert into t3 values (5 ); +insert into t3 values (13 ); +insert into t3 values (17 ); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t6; +select abs(col1) from t1 order by col1; +abs(col1) +5 +13 +select * from t1 order by col1; +col1 +5 +13 +select * from t2 order by col1; +col1 +5 +13 +17 +select * from t3 order by col1; +col1 +5 +13 +17 +select * from t4 order by colint; +colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; +colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; +colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +update t1 set col1=15 where col1=5 ; +update t2 set col1=15 where col1=5 ; +update t3 set col1=15 where col1=5 ; +update t4 set col1=15 where col1=5 ; +update t5 set col1=15 where col1=5 ; +update t6 set col1=15 where col1=5 ; +select * from t1 order by col1; +col1 +13 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +------------------------------------------------------------------------- +--- Alter tables with abs(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(abs(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(abs(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(abs(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(abs(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(abs(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13 +15 +select * from t22 order by col1; +col1 +13 +15 +17 +select * from t33 order by col1; +col1 +13 +15 +17 +select * from t44 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t55 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13 +15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13 +15 +alter table t55 +partition by list(colint) +subpartition by hash(abs(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` int(11) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (abs(15)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with abs(col1) +------------------------------------------------------------------------- +delete from t1 where col1=13 ; +delete from t2 where col1=13 ; +delete from t3 where col1=13 ; +delete from t4 where col1=13 ; +delete from t5 where col1=13 ; +delete from t6 where col1=13 ; +select * from t1 order by col1; +col1 +15 +select * from t2 order by col1; +col1 +15 +17 +select * from t3 order by col1; +col1 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t5 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +insert into t1 values (13 ); +insert into t2 values (13 ); +insert into t3 values (13 ); +insert into t4 values (60,13 ); +insert into t5 values (60,13 ); +insert into t6 values (60,13 ); +select * from t1 order by col1; +col1 +13 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t5 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t6 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15 +select * from t2 order by col1; +col1 +13 +15 +17 +select * from t3 order by col1; +col1 +13 +15 +17 +select * from t4 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t5 order by colint; +colint col1 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t6 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with abs(col1) +------------------------------------------------------------------------- +delete from t11 where col1=13 ; +delete from t22 where col1=13 ; +delete from t33 where col1=13 ; +delete from t44 where col1=13 ; +delete from t55 where col1=13 ; +delete from t66 where col1=13 ; +select * from t11 order by col1; +col1 +15 +select * from t22 order by col1; +col1 +15 +17 +select * from t33 order by col1; +col1 +15 +17 +select * from t44 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t55 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +insert into t11 values (13 ); +insert into t22 values (13 ); +insert into t33 values (13 ); +insert into t44 values (60,13 ); +insert into t55 values (60,13 ); +insert into t66 values (60,13 ); +select * from t11 order by col1; +col1 +13 +15 +select * from t22 order by col1; +col1 +13 +15 +17 +select * from t33 order by col1; +col1 +13 +15 +17 +select * from t44 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t55 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t66 order by colint; +colint col1 +1 15 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15 +select * from t22 order by col1; +col1 +13 +15 +17 +select * from t33 order by col1; +col1 +13 +15 +17 +select * from t44 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t55 order by colint; +colint col1 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +select * from t66 order by colint; +colint col1 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 13 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- ascii(col1) in partition with coltype char(1) +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with ascii(col1) +------------------------------------------------------------------------- +create table t1 (col1 char(1)) engine='NDB' +partition by range(ascii(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 char(1)) engine='NDB' +partition by list(ascii(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 char(1)) engine='NDB' +partition by hash(ascii(col1)); +create table t4 (colint int, col1 char(1)) engine='NDB' +partition by range(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 char(1)) engine='NDB' +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 char(1)) engine='NDB' +partition by range(colint) +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with ascii(col1) +------------------------------------------------------------------------- +insert into t1 values ('1'); +insert into t1 values ('9'); +insert into t2 values ('1'); +insert into t2 values ('9'); +insert into t2 values ('3'); +insert into t3 values ('1'); +insert into t3 values ('9'); +insert into t3 values ('3'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; +select ascii(col1) from t1 order by col1; +ascii(col1) +49 +57 +select * from t1 order by col1; +col1 +1 +9 +select * from t2 order by col1; +col1 +1 +3 +9 +select * from t3 order by col1; +col1 +1 +3 +9 +select * from t4 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +update t1 set col1='8' where col1='1'; +update t2 set col1='8' where col1='1'; +update t3 set col1='8' where col1='1'; +update t4 set col1='8' where col1='1'; +update t5 set col1='8' where col1='1'; +update t6 set col1='8' where col1='1'; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Alter tables with ascii(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(ascii(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(ascii(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(ascii(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t55 +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(1) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ascii('5')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ascii(col1) +------------------------------------------------------------------------- +delete from t1 where col1='9'; +delete from t2 where col1='9'; +delete from t3 where col1='9'; +delete from t4 where col1='9'; +delete from t5 where col1='9'; +delete from t6 where col1='9'; +select * from t1 order by col1; +col1 +8 +select * from t2 order by col1; +col1 +3 +8 +select * from t3 order by col1; +col1 +3 +8 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t1 values ('9'); +insert into t2 values ('9'); +insert into t3 values ('9'); +insert into t4 values (60,'9'); +insert into t5 values (60,'9'); +insert into t6 values (60,'9'); +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t6 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +60 9 +select * from t5 order by colint; +colint col1 +60 9 +select * from t6 order by colint; +colint col1 +60 9 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ascii(col1) +------------------------------------------------------------------------- +delete from t11 where col1='9'; +delete from t22 where col1='9'; +delete from t33 where col1='9'; +delete from t44 where col1='9'; +delete from t55 where col1='9'; +delete from t66 where col1='9'; +select * from t11 order by col1; +col1 +8 +select * from t22 order by col1; +col1 +3 +8 +select * from t33 order by col1; +col1 +3 +8 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t11 values ('9'); +insert into t22 values ('9'); +insert into t33 values ('9'); +insert into t44 values (60,'9'); +insert into t55 values (60,'9'); +insert into t66 values (60,'9'); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t66 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +60 9 +select * from t55 order by colint; +colint col1 +60 9 +select * from t66 order by colint; +colint col1 +60 9 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- cast(ceiling(col1) as signed integer) in partition with coltype float(7,4) +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +create table t1 (col1 float(7,4)) engine='NDB' +partition by range(cast(ceiling(col1) as signed integer)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 float(7,4)) engine='NDB' +partition by list(cast(ceiling(col1) as signed integer)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 float(7,4)) engine='NDB' +partition by hash(cast(ceiling(col1) as signed integer)); +create table t4 (colint int, col1 float(7,4)) engine='NDB' +partition by range(colint) +subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 float(7,4)) engine='NDB' +partition by list(colint) +subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 float(7,4)) engine='NDB' +partition by range(colint) +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +insert into t1 values (5.1230); +insert into t1 values (13.345); +insert into t2 values (5.1230); +insert into t2 values (13.345); +insert into t2 values (17.987); +insert into t3 values (5.1230); +insert into t3 values (13.345); +insert into t3 values (17.987); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(ceiling(col1) as signed integer) from t1 order by col1; +cast(ceiling(col1) as signed integer) +6 +14 +select * from t1 order by col1; +col1 +5.1230 +13.3450 +select * from t2 order by col1; +col1 +5.1230 +13.3450 +17.9870 +select * from t3 order by col1; +col1 +5.1230 +13.3450 +17.9870 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15.654 where col1=5.1230; +update t2 set col1=15.654 where col1=5.1230; +update t3 set col1=15.654 where col1=5.1230; +update t4 set col1=15.654 where col1=5.1230; +update t5 set col1=15.654 where col1=5.1230; +update t6 set col1=15.654 where col1=5.1230; +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Alter tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(cast(ceiling(col1) as signed integer)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(cast(ceiling(col1) as signed integer)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(cast(ceiling(col1) as signed integer)); +alter table t44 +partition by range(colint) +subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t55 +partition by list(colint) +subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(ceiling(15) as signed integer)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +delete from t1 where col1=13.345; +delete from t2 where col1=13.345; +delete from t3 where col1=13.345; +delete from t4 where col1=13.345; +delete from t5 where col1=13.345; +delete from t6 where col1=13.345; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t1 values (13.345); +insert into t2 values (13.345); +insert into t3 values (13.345); +insert into t4 values (60,13.345); +insert into t5 values (60,13.345); +insert into t6 values (60,13.345); +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t6 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +60 13.3450 +select * from t5 order by colint; +colint col1 +60 13.3450 +select * from t6 order by colint; +colint col1 +60 13.3450 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) +------------------------------------------------------------------------- +delete from t11 where col1=13.345; +delete from t22 where col1=13.345; +delete from t33 where col1=13.345; +delete from t44 where col1=13.345; +delete from t55 where col1=13.345; +delete from t66 where col1=13.345; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t11 values (13.345); +insert into t22 values (13.345); +insert into t33 values (13.345); +insert into t44 values (60,13.345); +insert into t55 values (60,13.345); +insert into t66 values (60,13.345); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t66 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +60 13.3450 +select * from t55 order by colint; +colint col1 +60 13.3450 +select * from t66 order by colint; +colint col1 +60 13.3450 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- cast(floor(col1) as signed) in partition with coltype float(7,4) +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +create table t1 (col1 float(7,4)) engine='NDB' +partition by range(cast(floor(col1) as signed)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 float(7,4)) engine='NDB' +partition by list(cast(floor(col1) as signed)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 float(7,4)) engine='NDB' +partition by hash(cast(floor(col1) as signed)); +create table t4 (colint int, col1 float(7,4)) engine='NDB' +partition by range(colint) +subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 float(7,4)) engine='NDB' +partition by list(colint) +subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 float(7,4)) engine='NDB' +partition by range(colint) +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +insert into t1 values (5.1230); +insert into t1 values (13.345); +insert into t2 values (5.1230); +insert into t2 values (13.345); +insert into t2 values (17.987); +insert into t3 values (5.1230); +insert into t3 values (13.345); +insert into t3 values (17.987); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(floor(col1) as signed) from t1 order by col1; +cast(floor(col1) as signed) +5 +13 +select * from t1 order by col1; +col1 +5.1230 +13.3450 +select * from t2 order by col1; +col1 +5.1230 +13.3450 +17.9870 +select * from t3 order by col1; +col1 +5.1230 +13.3450 +17.9870 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15.654 where col1=5.1230; +update t2 set col1=15.654 where col1=5.1230; +update t3 set col1=15.654 where col1=5.1230; +update t4 set col1=15.654 where col1=5.1230; +update t5 set col1=15.654 where col1=5.1230; +update t6 set col1=15.654 where col1=5.1230; +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Alter tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(cast(floor(col1) as signed)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(cast(floor(col1) as signed)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(cast(floor(col1) as signed)); +alter table t44 +partition by range(colint) +subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +alter table t55 +partition by list(colint) +subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(floor(15.123) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 15.6540 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +delete from t1 where col1=13.345; +delete from t2 where col1=13.345; +delete from t3 where col1=13.345; +delete from t4 where col1=13.345; +delete from t5 where col1=13.345; +delete from t6 where col1=13.345; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t1 values (13.345); +insert into t2 values (13.345); +insert into t3 values (13.345); +insert into t4 values (60,13.345); +insert into t5 values (60,13.345); +insert into t6 values (60,13.345); +select * from t1 order by col1; +col1 +13.3450 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t5 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t6 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +15.6540 +select * from t2 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t3 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t4 order by colint; +colint col1 +60 13.3450 +select * from t5 order by colint; +colint col1 +60 13.3450 +select * from t6 order by colint; +colint col1 +60 13.3450 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(floor(col1) as signed) +------------------------------------------------------------------------- +delete from t11 where col1=13.345; +delete from t22 where col1=13.345; +delete from t33 where col1=13.345; +delete from t44 where col1=13.345; +delete from t55 where col1=13.345; +delete from t66 where col1=13.345; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +insert into t11 values (13.345); +insert into t22 values (13.345); +insert into t33 values (13.345); +insert into t44 values (60,13.345); +insert into t55 values (60,13.345); +insert into t66 values (60,13.345); +select * from t11 order by col1; +col1 +13.3450 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t55 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +select * from t66 order by colint; +colint col1 +1 15.6540 +3 17.9870 +4 15.6540 +60 13.3450 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +15.6540 +select * from t22 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t33 order by col1; +col1 +13.3450 +15.6540 +17.9870 +select * from t44 order by colint; +colint col1 +60 13.3450 +select * from t55 order by colint; +colint col1 +60 13.3450 +select * from t66 order by colint; +colint col1 +60 13.3450 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- cast(mod(col1,10) as signed) in partition with coltype float(7,4) +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +create table t1 (col1 float(7,4)) engine='NDB' +partition by range(cast(mod(col1,10) as signed)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 float(7,4)) engine='NDB' +partition by list(cast(mod(col1,10) as signed)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 float(7,4)) engine='NDB' +partition by hash(cast(mod(col1,10) as signed)); +create table t4 (colint int, col1 float(7,4)) engine='NDB' +partition by range(colint) +subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 float(7,4)) engine='NDB' +partition by list(colint) +subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 float(7,4)) engine='NDB' +partition by range(colint) +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +insert into t1 values (5.0000); +insert into t1 values (19); +insert into t2 values (5.0000); +insert into t2 values (19); +insert into t2 values (17); +insert into t3 values (5.0000); +insert into t3 values (19); +insert into t3 values (17); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; +select cast(mod(col1,10) as signed) from t1 order by col1; +cast(mod(col1,10) as signed) +5 +9 +select * from t1 order by col1; +col1 +5.0000 +19.0000 +select * from t2 order by col1; +col1 +5.0000 +17.0000 +19.0000 +select * from t3 order by col1; +col1 +5.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +update t1 set col1=15 where col1=5.0000; +update t2 set col1=15 where col1=5.0000; +update t3 set col1=15 where col1=5.0000; +update t4 set col1=15 where col1=5.0000; +update t5 set col1=15 where col1=5.0000; +update t6 set col1=15 where col1=5.0000; +select * from t1 order by col1; +col1 +15.0000 +19.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Alter tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(cast(mod(col1,10) as signed)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(cast(mod(col1,10) as signed)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(cast(mod(col1,10) as signed)); +alter table t44 +partition by range(colint) +subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +select * from t22 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t44 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +alter table t55 +partition by list(colint) +subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` float(7,4) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (cast(mod(15,10) as signed)), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +delete from t1 where col1=19; +delete from t2 where col1=19; +delete from t3 where col1=19; +delete from t4 where col1=19; +delete from t5 where col1=19; +delete from t6 where col1=19; +select * from t1 order by col1; +col1 +15.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +insert into t1 values (19); +insert into t2 values (19); +insert into t3 values (19); +insert into t4 values (60,19); +insert into t5 values (60,19); +insert into t6 values (60,19); +select * from t1 order by col1; +col1 +15.0000 +19.0000 +select * from t2 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t5 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t6 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t4 order by colint; +colint col1 +60 19.0000 +select * from t5 order by colint; +colint col1 +60 19.0000 +select * from t6 order by colint; +colint col1 +60 19.0000 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +------------------------------------------------------------------------- +delete from t11 where col1=19; +delete from t22 where col1=19; +delete from t33 where col1=19; +delete from t44 where col1=19; +delete from t55 where col1=19; +delete from t66 where col1=19; +select * from t11 order by col1; +col1 +15.0000 +select * from t22 order by col1; +col1 +15.0000 +17.0000 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +select * from t44 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +insert into t11 values (19); +insert into t22 values (19); +insert into t33 values (19); +insert into t44 values (60,19); +insert into t55 values (60,19); +insert into t66 values (60,19); +select * from t11 order by col1; +col1 +15.0000 +19.0000 +select * from t22 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t44 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t55 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +select * from t66 order by colint; +colint col1 +1 5.1230 +2 13.3450 +3 17.9870 +4 15.6540 +60 19.0000 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +15.0000 +17.0000 +19.0000 +select * from t44 order by colint; +colint col1 +60 19.0000 +select * from t55 order by colint; +colint col1 +60 19.0000 +select * from t66 order by colint; +colint col1 +60 19.0000 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- ord(col1) in partition with coltype char(3) +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with ord(col1) +------------------------------------------------------------------------- +create table t1 (col1 char(3)) engine='NDB' +partition by range(ord(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 char(3)) engine='NDB' +partition by list(ord(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 char(3)) engine='NDB' +partition by hash(ord(col1)); +create table t4 (colint int, col1 char(3)) engine='NDB' +partition by range(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 char(3)) engine='NDB' +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 char(3)) engine='NDB' +partition by range(colint) +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with ord(col1) +------------------------------------------------------------------------- +insert into t1 values ('1'); +insert into t1 values ('9'); +insert into t2 values ('1'); +insert into t2 values ('9'); +insert into t2 values ('3'); +insert into t3 values ('1'); +insert into t3 values ('9'); +insert into t3 values ('3'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; +select ord(col1) from t1 order by col1; +ord(col1) +49 +57 +select * from t1 order by col1; +col1 +1 +9 +select * from t2 order by col1; +col1 +1 +3 +9 +select * from t3 order by col1; +col1 +1 +3 +9 +select * from t4 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 1 +2 9 +3 3 +4 8 +update t1 set col1='8' where col1='1'; +update t2 set col1='8' where col1='1'; +update t3 set col1='8' where col1='1'; +update t4 set col1='8' where col1='1'; +update t5 set col1='8' where col1='1'; +update t6 set col1='8' where col1='1'; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t6 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Alter tables with ord(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(ord(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(ord(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(ord(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +8 +9 +alter table t55 +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(3) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 8 +2 9 +3 3 +4 8 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ord(col1) +------------------------------------------------------------------------- +delete from t1 where col1='9'; +delete from t2 where col1='9'; +delete from t3 where col1='9'; +delete from t4 where col1='9'; +delete from t5 where col1='9'; +delete from t6 where col1='9'; +select * from t1 order by col1; +col1 +8 +select * from t2 order by col1; +col1 +3 +8 +select * from t3 order by col1; +col1 +3 +8 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t1 values ('9'); +insert into t2 values ('9'); +insert into t3 values ('9'); +insert into t4 values (60,'9'); +insert into t5 values (60,'9'); +insert into t6 values (60,'9'); +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t5 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t6 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +8 +9 +select * from t2 order by col1; +col1 +3 +8 +9 +select * from t3 order by col1; +col1 +3 +8 +9 +select * from t4 order by colint; +colint col1 +60 9 +select * from t5 order by colint; +colint col1 +60 9 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with ord(col1) +------------------------------------------------------------------------- +delete from t11 where col1='9'; +delete from t22 where col1='9'; +delete from t33 where col1='9'; +delete from t44 where col1='9'; +delete from t55 where col1='9'; +delete from t66 where col1='9'; +select * from t11 order by col1; +col1 +8 +select * from t22 order by col1; +col1 +3 +8 +select * from t33 order by col1; +col1 +3 +8 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +insert into t11 values ('9'); +insert into t22 values ('9'); +insert into t33 values ('9'); +insert into t44 values (60,'9'); +insert into t55 values (60,'9'); +insert into t66 values (60,'9'); +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t55 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +select * from t66 order by colint; +colint col1 +1 8 +3 3 +4 8 +60 9 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +8 +9 +select * from t22 order by col1; +col1 +3 +8 +9 +select * from t33 order by col1; +col1 +3 +8 +9 +select * from t44 order by colint; +colint col1 +60 9 +select * from t55 order by colint; +colint col1 +60 9 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- day(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with day(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(day(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(day(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(day(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(day(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(day(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with day(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-02-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-02-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-02-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-01-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select day(col1) from t1 order by col1; +day(col1) +17 +3 +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-03 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-02-03'; +update t2 set col1='2006-02-05' where col1='2006-02-03'; +update t3 set col1='2006-02-05' where col1='2006-02-03'; +update t4 set col1='2006-02-05' where col1='2006-02-03'; +update t5 set col1='2006-02-05' where col1='2006-02-03'; +update t6 set col1='2006-02-05' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with day(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(day(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(day(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(day(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(day(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(day(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(day(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (day('2006-12-21')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with day(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with day(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- dayofmonth(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with dayofmonth(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(dayofmonth(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(dayofmonth(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(dayofmonth(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with dayofmonth(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-02-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-02-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-02-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-01-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofmonth(col1) from t1 order by col1; +dayofmonth(col1) +17 +3 +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-03 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-02-03'; +update t2 set col1='2006-02-05' where col1='2006-02-03'; +update t3 set col1='2006-02-05' where col1='2006-02-03'; +update t4 set col1='2006-02-05' where col1='2006-02-03'; +update t5 set col1='2006-02-05' where col1='2006-02-03'; +update t6 set col1='2006-02-05' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with dayofmonth(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(dayofmonth(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(dayofmonth(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(dayofmonth(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofmonth('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-05 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofmonth(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofmonth(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-05 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- dayofweek(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with dayofweek(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(dayofweek(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(dayofweek(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(dayofweek(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(dayofweek(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(dayofweek(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with dayofweek(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-02-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-02-17'); +insert into t3 values ('2006-01-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofweek(col1) from t1 order by col1; +dayofweek(col1) +3 +6 +select * from t1 order by col1; +col1 +2006-01-03 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-01-25 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-03 +2006-01-25 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with dayofweek(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(dayofweek(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(dayofweek(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(dayofweek(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(dayofweek(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(dayofweek(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t55 +partition by list(colint) +subpartition by hash(dayofweek(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofweek('2006-12-24')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofweek(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-02-17'; +delete from t2 where col1='2006-02-17'; +delete from t3 where col1='2006-02-17'; +delete from t4 where col1='2006-02-17'; +delete from t5 where col1='2006-02-17'; +delete from t6 where col1='2006-02-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-02-17'); +insert into t3 values ('2006-02-17'); +insert into t4 values (60,'2006-02-17'); +insert into t5 values (60,'2006-02-17'); +insert into t6 values (60,'2006-02-17'); +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofweek(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-02-17'; +delete from t22 where col1='2006-02-17'; +delete from t33 where col1='2006-02-17'; +delete from t44 where col1='2006-02-17'; +delete from t55 where col1='2006-02-17'; +delete from t66 where col1='2006-02-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-02-17'); +insert into t22 values ('2006-02-17'); +insert into t33 values ('2006-02-17'); +insert into t44 values (60,'2006-02-17'); +insert into t55 values (60,'2006-02-17'); +insert into t66 values (60,'2006-02-17'); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- dayofyear(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with dayofyear(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(dayofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(dayofyear(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(dayofyear(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with dayofyear(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-02-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-02-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofyear(col1) from t1 order by col1; +dayofyear(col1) +3 +17 +select * from t1 order by col1; +col1 +2006-01-03 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-01-17 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-03 +2006-01-17 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with dayofyear(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(dayofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(dayofyear(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(dayofyear(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- dayofyear(col1) in partition with coltype char(30) +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with dayofyear(col1) +------------------------------------------------------------------------- +create table t1 (col1 char(30)) engine='NDB' +partition by range(dayofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 char(30)) engine='NDB' +partition by list(dayofyear(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 char(30)) engine='NDB' +partition by hash(dayofyear(col1)); +create table t4 (colint int, col1 char(30)) engine='NDB' +partition by range(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 char(30)) engine='NDB' +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 char(30)) engine='NDB' +partition by range(colint) +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with dayofyear(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-02-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-02-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select dayofyear(col1) from t1 order by col1; +dayofyear(col1) +3 +17 +select * from t1 order by col1; +col1 +2006-01-03 +2006-01-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-01-17 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-03 +2006-01-17 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with dayofyear(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(dayofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(dayofyear(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(dayofyear(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +alter table t55 +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(30) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (dayofyear('2006-12-25')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t3 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with dayofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t33 order by col1; +col1 +2006-01-17 +2006-02-05 +2006-02-25 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- extract(month from col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with extract(month from col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(extract(month from col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(extract(month from col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(extract(month from col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(extract(month from col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(extract(month from col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with extract(month from col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-02-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-02-17'); +insert into t3 values ('2006-01-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select extract(month from col1) from t1 order by col1; +extract(month from col1) +1 +2 +select * from t1 order by col1; +col1 +2006-01-03 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-01-25 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-03 +2006-01-25 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-05' where col1='2006-01-03'; +update t2 set col1='2006-02-05' where col1='2006-01-03'; +update t3 set col1='2006-02-05' where col1='2006-01-03'; +update t4 set col1='2006-02-05' where col1='2006-01-03'; +update t5 set col1='2006-02-05' where col1='2006-01-03'; +update t6 set col1='2006-02-05' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with extract(month from col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(extract(month from col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(extract(month from col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(extract(month from col1)); +alter table t44 +partition by range(colint) +subpartition by hash(extract(month from col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(extract(month from col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +alter table t55 +partition by list(colint) +subpartition by hash(extract(month from col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (extract(year from '1998-11-23')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with extract(month from col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-02-17'; +delete from t2 where col1='2006-02-17'; +delete from t3 where col1='2006-02-17'; +delete from t4 where col1='2006-02-17'; +delete from t5 where col1='2006-02-17'; +delete from t6 where col1='2006-02-17'; +select * from t1 order by col1; +col1 +2006-02-05 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-02-17'); +insert into t2 values ('2006-02-17'); +insert into t3 values ('2006-02-17'); +insert into t4 values (60,'2006-02-17'); +insert into t5 values (60,'2006-02-17'); +insert into t6 values (60,'2006-02-17'); +select * from t1 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t4 order by colint; +colint col1 +60 2006-02-17 +select * from t5 order by colint; +colint col1 +60 2006-02-17 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with extract(month from col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-02-17'; +delete from t22 where col1='2006-02-17'; +delete from t33 where col1='2006-02-17'; +delete from t44 where col1='2006-02-17'; +delete from t55 where col1='2006-02-17'; +delete from t66 where col1='2006-02-17'; +select * from t11 order by col1; +col1 +2006-02-05 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-02-17'); +insert into t22 values ('2006-02-17'); +insert into t33 values ('2006-02-17'); +insert into t44 values (60,'2006-02-17'); +insert into t55 values (60,'2006-02-17'); +insert into t66 values (60,'2006-02-17'); +select * from t11 order by col1; +col1 +2006-02-05 +2006-02-17 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-05 +2006-02-17 +select * from t44 order by colint; +colint col1 +60 2006-02-17 +select * from t55 order by colint; +colint col1 +60 2006-02-17 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- hour(col1) in partition with coltype time +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with hour(col1) +------------------------------------------------------------------------- +create table t1 (col1 time) engine='NDB' +partition by range(hour(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 time) engine='NDB' +partition by list(hour(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 time) engine='NDB' +partition by hash(hour(col1)); +create table t4 (colint int, col1 time) engine='NDB' +partition by range(colint) +subpartition by hash(hour(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 time) engine='NDB' +partition by list(colint) +subpartition by hash(hour(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 time) engine='NDB' +partition by range(colint) +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with hour(col1) +------------------------------------------------------------------------- +insert into t1 values ('09:09'); +insert into t1 values ('14:30'); +insert into t2 values ('09:09'); +insert into t2 values ('14:30'); +insert into t2 values ('21:59'); +insert into t3 values ('09:09'); +insert into t3 values ('14:30'); +insert into t3 values ('21:59'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select hour(col1) from t1 order by col1; +hour(col1) +9 +14 +select * from t1 order by col1; +col1 +09:09:00 +14:30:00 +select * from t2 order by col1; +col1 +09:09:00 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +09:09:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:30' where col1='09:09'; +update t2 set col1='10:30' where col1='09:09'; +update t3 set col1='10:30' where col1='09:09'; +update t4 set col1='10:30' where col1='09:09'; +update t5 set col1='10:30' where col1='09:09'; +update t6 set col1='10:30' where col1='09:09'; +select * from t1 order by col1; +col1 +10:30:00 +14:30:00 +select * from t2 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Alter tables with hour(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(hour(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(hour(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(hour(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(hour(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(hour(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +select * from t22 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +alter table t55 +partition by list(colint) +subpartition by hash(hour(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (hour('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with hour(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30'; +delete from t2 where col1='14:30'; +delete from t3 where col1='14:30'; +delete from t4 where col1='14:30'; +delete from t5 where col1='14:30'; +delete from t6 where col1='14:30'; +select * from t1 order by col1; +col1 +10:30:00 +select * from t2 order by col1; +col1 +10:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30'); +insert into t2 values ('14:30'); +insert into t3 values ('14:30'); +insert into t4 values (60,'14:30'); +insert into t5 values (60,'14:30'); +insert into t6 values (60,'14:30'); +select * from t1 order by col1; +col1 +10:30:00 +14:30:00 +select * from t2 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +14:30:00 +21:59:00 +select * from t3 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t4 order by colint; +colint col1 +60 14:30:00 +select * from t5 order by colint; +colint col1 +60 14:30:00 +select * from t6 order by colint; +colint col1 +60 14:30:00 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with hour(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30'; +delete from t22 where col1='14:30'; +delete from t33 where col1='14:30'; +delete from t44 where col1='14:30'; +delete from t55 where col1='14:30'; +delete from t66 where col1='14:30'; +select * from t11 order by col1; +col1 +10:30:00 +select * from t22 order by col1; +col1 +10:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30'); +insert into t22 values ('14:30'); +insert into t33 values ('14:30'); +insert into t44 values (60,'14:30'); +insert into t55 values (60,'14:30'); +insert into t66 values (60,'14:30'); +select * from t11 order by col1; +col1 +10:30:00 +14:30:00 +select * from t22 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:00 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +14:30:00 +21:59:00 +select * from t33 order by col1; +col1 +10:30:00 +14:30:00 +21:59:00 +select * from t44 order by colint; +colint col1 +60 14:30:00 +select * from t55 order by colint; +colint col1 +60 14:30:00 +select * from t66 order by colint; +colint col1 +60 14:30:00 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- microsecond(col1) in partition with coltype time +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with microsecond(col1) +------------------------------------------------------------------------- +create table t1 (col1 time) engine='NDB' +partition by range(microsecond(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 time) engine='NDB' +partition by list(microsecond(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 time) engine='NDB' +partition by hash(microsecond(col1)); +create table t4 (colint int, col1 time) engine='NDB' +partition by range(colint) +subpartition by hash(microsecond(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 time) engine='NDB' +partition by list(colint) +subpartition by hash(microsecond(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 time) engine='NDB' +partition by range(colint) +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with microsecond(col1) +------------------------------------------------------------------------- +insert into t1 values ('09:09:15.000002'); +insert into t1 values ('04:30:01.000018'); +insert into t2 values ('09:09:15.000002'); +insert into t2 values ('04:30:01.000018'); +insert into t2 values ('00:59:22.000024'); +insert into t3 values ('09:09:15.000002'); +insert into t3 values ('04:30:01.000018'); +insert into t3 values ('00:59:22.000024'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select microsecond(col1) from t1 order by col1; +microsecond(col1) +0 +0 +select * from t1 order by col1; +col1 +04:30:01 +09:09:15 +select * from t2 order by col1; +col1 +00:59:22 +04:30:01 +09:09:15 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +09:09:15 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t2 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t3 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t4 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t5 set col1='05:30:34.000037' where col1='09:09:15.000002'; +update t6 set col1='05:30:34.000037' where col1='09:09:15.000002'; +select * from t1 order by col1; +col1 +04:30:01 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Alter tables with microsecond(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(microsecond(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(microsecond(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(microsecond(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(microsecond(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(microsecond(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +select * from t22 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t33 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t44 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +alter table t55 +partition by list(colint) +subpartition by hash(microsecond(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (microsecond('10:30:10.000010')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 05:30:34 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with microsecond(col1) +------------------------------------------------------------------------- +delete from t1 where col1='04:30:01.000018'; +delete from t2 where col1='04:30:01.000018'; +delete from t3 where col1='04:30:01.000018'; +delete from t4 where col1='04:30:01.000018'; +delete from t5 where col1='04:30:01.000018'; +delete from t6 where col1='04:30:01.000018'; +select * from t1 order by col1; +col1 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +insert into t1 values ('04:30:01.000018'); +insert into t2 values ('04:30:01.000018'); +insert into t3 values ('04:30:01.000018'); +insert into t4 values (60,'04:30:01.000018'); +insert into t5 values (60,'04:30:01.000018'); +insert into t6 values (60,'04:30:01.000018'); +select * from t1 order by col1; +col1 +04:30:01 +05:30:34 +select * from t2 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t5 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t6 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t4 order by colint; +colint col1 +60 04:30:01 +select * from t5 order by colint; +colint col1 +60 04:30:01 +select * from t6 order by colint; +colint col1 +60 04:30:01 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with microsecond(col1) +------------------------------------------------------------------------- +delete from t11 where col1='04:30:01.000018'; +delete from t22 where col1='04:30:01.000018'; +delete from t33 where col1='04:30:01.000018'; +delete from t44 where col1='04:30:01.000018'; +delete from t55 where col1='04:30:01.000018'; +delete from t66 where col1='04:30:01.000018'; +select * from t11 order by col1; +col1 +05:30:34 +select * from t22 order by col1; +col1 +00:59:22 +05:30:34 +select * from t33 order by col1; +col1 +00:59:22 +05:30:34 +select * from t44 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +insert into t11 values ('04:30:01.000018'); +insert into t22 values ('04:30:01.000018'); +insert into t33 values ('04:30:01.000018'); +insert into t44 values (60,'04:30:01.000018'); +insert into t55 values (60,'04:30:01.000018'); +insert into t66 values (60,'04:30:01.000018'); +select * from t11 order by col1; +col1 +04:30:01 +05:30:34 +select * from t22 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t33 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t44 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t55 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +select * from t66 order by colint; +colint col1 +1 05:30:34 +3 00:59:22 +4 05:30:34 +60 04:30:01 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +00:59:22 +04:30:01 +05:30:34 +select * from t44 order by colint; +colint col1 +60 04:30:01 +select * from t55 order by colint; +colint col1 +60 04:30:01 +select * from t66 order by colint; +colint col1 +60 04:30:01 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- minute(col1) in partition with coltype time +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with minute(col1) +------------------------------------------------------------------------- +create table t1 (col1 time) engine='NDB' +partition by range(minute(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 time) engine='NDB' +partition by list(minute(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 time) engine='NDB' +partition by hash(minute(col1)); +create table t4 (colint int, col1 time) engine='NDB' +partition by range(colint) +subpartition by hash(minute(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 time) engine='NDB' +partition by list(colint) +subpartition by hash(minute(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 time) engine='NDB' +partition by range(colint) +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with minute(col1) +------------------------------------------------------------------------- +insert into t1 values ('09:09:15'); +insert into t1 values ('14:30:45'); +insert into t2 values ('09:09:15'); +insert into t2 values ('14:30:45'); +insert into t2 values ('21:59:22'); +insert into t3 values ('09:09:15'); +insert into t3 values ('14:30:45'); +insert into t3 values ('21:59:22'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select minute(col1) from t1 order by col1; +minute(col1) +9 +30 +select * from t1 order by col1; +col1 +09:09:15 +14:30:45 +select * from t2 order by col1; +col1 +09:09:15 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +09:09:15 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:24:23' where col1='09:09:15'; +update t2 set col1='10:24:23' where col1='09:09:15'; +update t3 set col1='10:24:23' where col1='09:09:15'; +update t4 set col1='10:24:23' where col1='09:09:15'; +update t5 set col1='10:24:23' where col1='09:09:15'; +update t6 set col1='10:24:23' where col1='09:09:15'; +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Alter tables with minute(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(minute(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(minute(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(minute(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(minute(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(minute(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +select * from t22 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +alter table t55 +partition by list(colint) +subpartition by hash(minute(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (minute('18:30')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with minute(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:45'; +delete from t2 where col1='14:30:45'; +delete from t3 where col1='14:30:45'; +delete from t4 where col1='14:30:45'; +delete from t5 where col1='14:30:45'; +delete from t6 where col1='14:30:45'; +select * from t1 order by col1; +col1 +10:24:23 +select * from t2 order by col1; +col1 +10:24:23 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:45'); +insert into t2 values ('14:30:45'); +insert into t3 values ('14:30:45'); +insert into t4 values (60,'14:30:45'); +insert into t5 values (60,'14:30:45'); +insert into t6 values (60,'14:30:45'); +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t5 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t6 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:24:23 +14:30:45 +select * from t2 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:45 +select * from t5 order by colint; +colint col1 +60 14:30:45 +select * from t6 order by colint; +colint col1 +60 14:30:45 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with minute(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:45'; +delete from t22 where col1='14:30:45'; +delete from t33 where col1='14:30:45'; +delete from t44 where col1='14:30:45'; +delete from t55 where col1='14:30:45'; +delete from t66 where col1='14:30:45'; +select * from t11 order by col1; +col1 +10:24:23 +select * from t22 order by col1; +col1 +10:24:23 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:45'); +insert into t22 values ('14:30:45'); +insert into t33 values ('14:30:45'); +insert into t44 values (60,'14:30:45'); +insert into t55 values (60,'14:30:45'); +insert into t66 values (60,'14:30:45'); +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +select * from t22 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t55 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t66 order by colint; +colint col1 +1 10:24:23 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:24:23 +14:30:45 +select * from t22 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:24:23 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:45 +select * from t55 order by colint; +colint col1 +60 14:30:45 +select * from t66 order by colint; +colint col1 +60 14:30:45 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- second(col1) in partition with coltype time +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with second(col1) +------------------------------------------------------------------------- +create table t1 (col1 time) engine='NDB' +partition by range(second(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 time) engine='NDB' +partition by list(second(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 time) engine='NDB' +partition by hash(second(col1)); +create table t4 (colint int, col1 time) engine='NDB' +partition by range(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 time) engine='NDB' +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 time) engine='NDB' +partition by range(colint) +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with second(col1) +------------------------------------------------------------------------- +insert into t1 values ('09:09:09'); +insert into t1 values ('14:30:20'); +insert into t2 values ('09:09:09'); +insert into t2 values ('14:30:20'); +insert into t2 values ('21:59:22'); +insert into t3 values ('09:09:09'); +insert into t3 values ('14:30:20'); +insert into t3 values ('21:59:22'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select second(col1) from t1 order by col1; +second(col1) +9 +20 +select * from t1 order by col1; +col1 +09:09:09 +14:30:20 +select * from t2 order by col1; +col1 +09:09:09 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +09:09:09 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:22:33' where col1='09:09:09'; +update t2 set col1='10:22:33' where col1='09:09:09'; +update t3 set col1='10:22:33' where col1='09:09:09'; +update t4 set col1='10:22:33' where col1='09:09:09'; +update t5 set col1='10:22:33' where col1='09:09:09'; +update t6 set col1='10:22:33' where col1='09:09:09'; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Alter tables with second(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(second(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(second(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(second(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:20'; +delete from t2 where col1='14:30:20'; +delete from t3 where col1='14:30:20'; +delete from t4 where col1='14:30:20'; +delete from t5 where col1='14:30:20'; +delete from t6 where col1='14:30:20'; +select * from t1 order by col1; +col1 +10:22:33 +select * from t2 order by col1; +col1 +10:22:33 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:20'); +insert into t2 values ('14:30:20'); +insert into t3 values ('14:30:20'); +insert into t4 values (60,'14:30:20'); +insert into t5 values (60,'14:30:20'); +insert into t6 values (60,'14:30:20'); +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:20 +select * from t5 order by colint; +colint col1 +60 14:30:20 +select * from t6 order by colint; +colint col1 +60 14:30:20 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:20'; +delete from t22 where col1='14:30:20'; +delete from t33 where col1='14:30:20'; +delete from t44 where col1='14:30:20'; +delete from t55 where col1='14:30:20'; +delete from t66 where col1='14:30:20'; +select * from t11 order by col1; +col1 +10:22:33 +select * from t22 order by col1; +col1 +10:22:33 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:20'); +insert into t22 values ('14:30:20'); +insert into t33 values ('14:30:20'); +insert into t44 values (60,'14:30:20'); +insert into t55 values (60,'14:30:20'); +insert into t66 values (60,'14:30:20'); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t55 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +select * from t66 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:20 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:20 +select * from t55 order by colint; +colint col1 +60 14:30:20 +select * from t66 order by colint; +colint col1 +60 14:30:20 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- second(col1) in partition with coltype char(30) +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with second(col1) +------------------------------------------------------------------------- +create table t1 (col1 char(30)) engine='NDB' +partition by range(second(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 char(30)) engine='NDB' +partition by list(second(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 char(30)) engine='NDB' +partition by hash(second(col1)); +create table t4 (colint int, col1 char(30)) engine='NDB' +partition by range(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 char(30)) engine='NDB' +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 char(30)) engine='NDB' +partition by range(colint) +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with second(col1) +------------------------------------------------------------------------- +insert into t1 values ('09:09:09'); +insert into t1 values ('14:30:20'); +insert into t2 values ('09:09:09'); +insert into t2 values ('14:30:20'); +insert into t2 values ('21:59:22'); +insert into t3 values ('09:09:09'); +insert into t3 values ('14:30:20'); +insert into t3 values ('21:59:22'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select second(col1) from t1 order by col1; +second(col1) +9 +20 +select * from t1 order by col1; +col1 +09:09:09 +14:30:20 +select * from t2 order by col1; +col1 +09:09:09 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +09:09:09 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t6 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +update t1 set col1='10:22:33' where col1='09:09:09'; +update t2 set col1='10:22:33' where col1='09:09:09'; +update t3 set col1='10:22:33' where col1='09:09:09'; +update t4 set col1='10:22:33' where col1='09:09:09'; +update t5 set col1='10:22:33' where col1='09:09:09'; +update t6 set col1='10:22:33' where col1='09:09:09'; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t6 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +------------------------------------------------------------------------- +--- Alter tables with second(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(second(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(second(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(second(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +alter table t55 +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` char(30) DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (second('18:30:14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:20'; +delete from t2 where col1='14:30:20'; +delete from t3 where col1='14:30:20'; +delete from t4 where col1='14:30:20'; +delete from t5 where col1='14:30:20'; +delete from t6 where col1='14:30:20'; +select * from t1 order by col1; +col1 +10:22:33 +select * from t2 order by col1; +col1 +10:22:33 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +insert into t1 values ('14:30:20'); +insert into t2 values ('14:30:20'); +insert into t3 values ('14:30:20'); +insert into t4 values (60,'14:30:20'); +insert into t5 values (60,'14:30:20'); +insert into t6 values (60,'14:30:20'); +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t5 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t6 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:22:33 +14:30:20 +select * from t2 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t3 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:20 +select * from t5 order by colint; +colint col1 +60 14:30:20 +select * from t6 order by colint; +colint col1 +60 14:30:20 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with second(col1) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:20'; +delete from t22 where col1='14:30:20'; +delete from t33 where col1='14:30:20'; +delete from t44 where col1='14:30:20'; +delete from t55 where col1='14:30:20'; +delete from t66 where col1='14:30:20'; +select * from t11 order by col1; +col1 +10:22:33 +select * from t22 order by col1; +col1 +10:22:33 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +insert into t11 values ('14:30:20'); +insert into t22 values ('14:30:20'); +insert into t33 values ('14:30:20'); +insert into t44 values (60,'14:30:20'); +insert into t55 values (60,'14:30:20'); +insert into t66 values (60,'14:30:20'); +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t55 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +select * from t66 order by colint; +colint col1 +1 09:09:15.000002 +2 04:30:01.000018 +3 00:59:22.000024 +4 05:30:34.000037 +60 14:30:20 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:22:33 +14:30:20 +select * from t22 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t33 order by col1; +col1 +10:22:33 +14:30:20 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:20 +select * from t55 order by colint; +colint col1 +60 14:30:20 +select * from t66 order by colint; +colint col1 +60 14:30:20 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- month(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with month(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(month(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(month(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(month(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(month(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(month(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with month(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-12-17'); +insert into t2 values ('2006-05-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-12-17'); +insert into t3 values ('2006-05-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select month(col1) from t1 order by col1; +month(col1) +1 +12 +select * from t1 order by col1; +col1 +2006-01-03 +2006-12-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-05-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-01-03 +2006-05-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-11-06' where col1='2006-01-03'; +update t2 set col1='2006-11-06' where col1='2006-01-03'; +update t3 set col1='2006-11-06' where col1='2006-01-03'; +update t4 set col1='2006-11-06' where col1='2006-01-03'; +update t5 set col1='2006-11-06' where col1='2006-01-03'; +update t6 set col1='2006-11-06' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with month(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(month(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(month(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(month(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(month(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(month(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t22 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +alter table t55 +partition by list(colint) +subpartition by hash(month(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (month('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with month(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-12-17'; +delete from t2 where col1='2006-12-17'; +delete from t3 where col1='2006-12-17'; +delete from t4 where col1='2006-12-17'; +delete from t5 where col1='2006-12-17'; +delete from t6 where col1='2006-12-17'; +select * from t1 order by col1; +col1 +2006-11-06 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-12-17'); +insert into t3 values ('2006-12-17'); +insert into t4 values (60,'2006-12-17'); +insert into t5 values (60,'2006-12-17'); +insert into t6 values (60,'2006-12-17'); +select * from t1 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t4 order by colint; +colint col1 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +60 2006-12-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with month(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-12-17'; +delete from t22 where col1='2006-12-17'; +delete from t33 where col1='2006-12-17'; +delete from t44 where col1='2006-12-17'; +delete from t55 where col1='2006-12-17'; +delete from t66 where col1='2006-12-17'; +select * from t11 order by col1; +col1 +2006-11-06 +select * from t22 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-12-17'); +insert into t22 values ('2006-12-17'); +insert into t33 values ('2006-12-17'); +insert into t44 values (60,'2006-12-17'); +insert into t55 values (60,'2006-12-17'); +insert into t66 values (60,'2006-12-17'); +select * from t11 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t22 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +2006-11-06 +2006-12-17 +select * from t33 order by col1; +col1 +2006-05-25 +2006-11-06 +2006-12-17 +select * from t44 order by colint; +colint col1 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +60 2006-12-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- quarter(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with quarter(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(quarter(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(quarter(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(quarter(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(quarter(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(quarter(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with quarter(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-12-17'); +insert into t2 values ('2006-09-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-12-17'); +insert into t3 values ('2006-09-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select quarter(col1) from t1 order by col1; +quarter(col1) +1 +4 +select * from t1 order by col1; +col1 +2006-01-03 +2006-12-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-09-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-01-03 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-07-30' where col1='2006-01-03'; +update t2 set col1='2006-07-30' where col1='2006-01-03'; +update t3 set col1='2006-07-30' where col1='2006-01-03'; +update t4 set col1='2006-07-30' where col1='2006-01-03'; +update t5 set col1='2006-07-30' where col1='2006-01-03'; +update t6 set col1='2006-07-30' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with quarter(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(quarter(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(quarter(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(quarter(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(quarter(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(quarter(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t22 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +alter table t55 +partition by list(colint) +subpartition by hash(quarter(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (quarter('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with quarter(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-12-17'; +delete from t2 where col1='2006-12-17'; +delete from t3 where col1='2006-12-17'; +delete from t4 where col1='2006-12-17'; +delete from t5 where col1='2006-12-17'; +delete from t6 where col1='2006-12-17'; +select * from t1 order by col1; +col1 +2006-07-30 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-12-17'); +insert into t2 values ('2006-12-17'); +insert into t3 values ('2006-12-17'); +insert into t4 values (60,'2006-12-17'); +insert into t5 values (60,'2006-12-17'); +insert into t6 values (60,'2006-12-17'); +select * from t1 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t2 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t4 order by colint; +colint col1 +60 2006-12-17 +select * from t5 order by colint; +colint col1 +60 2006-12-17 +select * from t6 order by colint; +colint col1 +4 2006-02-05 +60 2006-12-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with quarter(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-12-17'; +delete from t22 where col1='2006-12-17'; +delete from t33 where col1='2006-12-17'; +delete from t44 where col1='2006-12-17'; +delete from t55 where col1='2006-12-17'; +delete from t66 where col1='2006-12-17'; +select * from t11 order by col1; +col1 +2006-07-30 +select * from t22 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-12-17'); +insert into t22 values ('2006-12-17'); +insert into t33 values ('2006-12-17'); +insert into t44 values (60,'2006-12-17'); +insert into t55 values (60,'2006-12-17'); +insert into t66 values (60,'2006-12-17'); +select * from t11 order by col1; +col1 +2006-07-30 +2006-12-17 +select * from t22 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-12-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-07-30 +2006-09-25 +2006-12-17 +select * from t44 order by colint; +colint col1 +60 2006-12-17 +select * from t55 order by colint; +colint col1 +60 2006-12-17 +select * from t66 order by colint; +colint col1 +4 2006-02-05 +60 2006-12-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- time_to_sec(col1)-(time_to_sec(col1)-20) in partition with coltype time +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +create table t1 (col1 time) engine='NDB' +partition by range(time_to_sec(col1)-(time_to_sec(col1)-20)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 time) engine='NDB' +partition by list(time_to_sec(col1)-(time_to_sec(col1)-20)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 time) engine='NDB' +partition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)); +create table t4 (colint int, col1 time) engine='NDB' +partition by range(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 time) engine='NDB' +partition by list(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 time) engine='NDB' +partition by range(colint) +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +insert into t1 values ('09:09:15'); +insert into t1 values ('14:30:45'); +insert into t2 values ('09:09:15'); +insert into t2 values ('14:30:45'); +insert into t2 values ('21:59:22'); +insert into t3 values ('09:09:15'); +insert into t3 values ('14:30:45'); +insert into t3 values ('21:59:22'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1; +time_to_sec(col1)-(time_to_sec(col1)-20) +20 +20 +select * from t1 order by col1; +col1 +09:09:15 +14:30:45 +select * from t2 order by col1; +col1 +09:09:15 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +09:09:15 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 09:09:15 +2 04:30:01 +3 00:59:22 +4 05:30:34 +update t1 set col1='10:33:11' where col1='09:09:15'; +update t2 set col1='10:33:11' where col1='09:09:15'; +update t3 set col1='10:33:11' where col1='09:09:15'; +update t4 set col1='10:33:11' where col1='09:09:15'; +update t5 set col1='10:33:11' where col1='09:09:15'; +update t6 set col1='10:33:11' where col1='09:09:15'; +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t6 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Alter tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(time_to_sec(col1)-(time_to_sec(col1)-20)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(time_to_sec(col1)-(time_to_sec(col1)-20)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)); +alter table t44 +partition by range(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +select * from t22 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +alter table t55 +partition by list(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` time DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +delete from t1 where col1='14:30:45'; +delete from t2 where col1='14:30:45'; +delete from t3 where col1='14:30:45'; +delete from t4 where col1='14:30:45'; +delete from t5 where col1='14:30:45'; +delete from t6 where col1='14:30:45'; +select * from t1 order by col1; +col1 +10:33:11 +select * from t2 order by col1; +col1 +10:33:11 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t1 values ('14:30:45'); +insert into t2 values ('14:30:45'); +insert into t3 values ('14:30:45'); +insert into t4 values (60,'14:30:45'); +insert into t5 values (60,'14:30:45'); +insert into t6 values (60,'14:30:45'); +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t5 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t6 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +10:33:11 +14:30:45 +select * from t2 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t3 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t4 order by colint; +colint col1 +60 14:30:45 +select * from t5 order by colint; +colint col1 +60 14:30:45 +select * from t6 order by colint; +colint col1 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) +------------------------------------------------------------------------- +delete from t11 where col1='14:30:45'; +delete from t22 where col1='14:30:45'; +delete from t33 where col1='14:30:45'; +delete from t44 where col1='14:30:45'; +delete from t55 where col1='14:30:45'; +delete from t66 where col1='14:30:45'; +select * from t11 order by col1; +col1 +10:33:11 +select * from t22 order by col1; +col1 +10:33:11 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +insert into t11 values ('14:30:45'); +insert into t22 values ('14:30:45'); +insert into t33 values ('14:30:45'); +insert into t44 values (60,'14:30:45'); +insert into t55 values (60,'14:30:45'); +insert into t66 values (60,'14:30:45'); +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +select * from t22 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t55 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +select * from t66 order by colint; +colint col1 +1 10:33:11 +2 04:30:01 +3 00:59:22 +4 05:30:34 +60 14:30:45 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +10:33:11 +14:30:45 +select * from t22 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t33 order by col1; +col1 +10:33:11 +14:30:45 +21:59:22 +select * from t44 order by colint; +colint col1 +60 14:30:45 +select * from t55 order by colint; +colint col1 +60 14:30:45 +select * from t66 order by colint; +colint col1 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- to_days(col1)-to_days('2006-01-01') in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(to_days(col1)-to_days('2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(to_days(col1)-to_days('2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(to_days(col1)-to_days('2006-01-01')); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +insert into t1 values ('2006-02-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-02-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-02-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-01-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select to_days(col1)-to_days('2006-01-01') from t1 order by col1; +to_days(col1)-to_days('2006-01-01') +16 +33 +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-03 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-02-03'; +update t2 set col1='2006-02-06' where col1='2006-02-03'; +update t3 set col1='2006-02-06' where col1='2006-02-03'; +update t4 set col1='2006-02-06' where col1='2006-02-03'; +update t5 set col1='2006-02-06' where col1='2006-02-03'; +update t6 set col1='2006-02-06' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(to_days(col1)-to_days('2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(to_days(col1)-to_days('2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(to_days(col1)-to_days('2006-01-01')); +alter table t44 +partition by range(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t55 +partition by list(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- weekday(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with weekday(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(weekday(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(weekday(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(weekday(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(weekday(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(weekday(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with weekday(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-12-03'); +insert into t1 values ('2006-11-17'); +insert into t2 values ('2006-12-03'); +insert into t2 values ('2006-11-17'); +insert into t2 values ('2006-05-25'); +insert into t3 values ('2006-12-03'); +insert into t3 values ('2006-11-17'); +insert into t3 values ('2006-05-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select weekday(col1) from t1 order by col1; +weekday(col1) +4 +6 +select * from t1 order by col1; +col1 +2006-11-17 +2006-12-03 +select * from t2 order by col1; +col1 +2006-05-25 +2006-11-17 +2006-12-03 +select * from t3 order by col1; +col1 +2006-05-25 +2006-11-17 +2006-12-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-12-03'; +update t2 set col1='2006-02-06' where col1='2006-12-03'; +update t3 set col1='2006-02-06' where col1='2006-12-03'; +update t4 set col1='2006-02-06' where col1='2006-12-03'; +update t5 set col1='2006-02-06' where col1='2006-12-03'; +update t6 set col1='2006-02-06' where col1='2006-12-03'; +select * from t1 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with weekday(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(weekday(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(weekday(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(weekday(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(weekday(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(weekday(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t22 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +alter table t55 +partition by list(colint) +subpartition by hash(weekday(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekday('2006-10-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekday(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-11-17'; +delete from t2 where col1='2006-11-17'; +delete from t3 where col1='2006-11-17'; +delete from t4 where col1='2006-11-17'; +delete from t5 where col1='2006-11-17'; +delete from t6 where col1='2006-11-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-11-17'); +insert into t2 values ('2006-11-17'); +insert into t3 values ('2006-11-17'); +insert into t4 values (60,'2006-11-17'); +insert into t5 values (60,'2006-11-17'); +insert into t6 values (60,'2006-11-17'); +select * from t1 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t2 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +select * from t3 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t4 order by colint; +colint col1 +60 2006-11-17 +select * from t5 order by colint; +colint col1 +60 2006-11-17 +select * from t6 order by colint; +colint col1 +60 2006-11-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekday(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-11-17'; +delete from t22 where col1='2006-11-17'; +delete from t33 where col1='2006-11-17'; +delete from t44 where col1='2006-11-17'; +delete from t55 where col1='2006-11-17'; +delete from t66 where col1='2006-11-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-11-17'); +insert into t22 values ('2006-11-17'); +insert into t33 values ('2006-11-17'); +insert into t44 values (60,'2006-11-17'); +insert into t55 values (60,'2006-11-17'); +insert into t66 values (60,'2006-11-17'); +select * from t11 order by col1; +col1 +2006-02-06 +2006-11-17 +select * from t22 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-11-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +select * from t33 order by col1; +col1 +2006-02-06 +2006-05-25 +2006-11-17 +select * from t44 order by colint; +colint col1 +60 2006-11-17 +select * from t55 order by colint; +colint col1 +60 2006-11-17 +select * from t66 order by colint; +colint col1 +60 2006-11-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- weekofyear(col1) in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with weekofyear(col1) +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(weekofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(weekofyear(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(weekofyear(col1)); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with weekofyear(col1) +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-03-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-03-17'); +insert into t2 values ('2006-05-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-03-17'); +insert into t3 values ('2006-05-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select weekofyear(col1) from t1 order by col1; +weekofyear(col1) +1 +11 +select * from t1 order by col1; +col1 +2006-01-03 +2006-03-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-03-17 +2006-05-25 +select * from t3 order by col1; +col1 +2006-01-03 +2006-03-17 +2006-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-09-06' where col1='2006-01-03'; +update t2 set col1='2006-09-06' where col1='2006-01-03'; +update t3 set col1='2006-09-06' where col1='2006-01-03'; +update t4 set col1='2006-09-06' where col1='2006-01-03'; +update t5 set col1='2006-09-06' where col1='2006-01-03'; +update t6 set col1='2006-09-06' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with weekofyear(col1) +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(weekofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(weekofyear(col1)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(weekofyear(col1)); +alter table t44 +partition by range(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t22 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +alter table t55 +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (weekofyear('2006-02-14')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekofyear(col1) +------------------------------------------------------------------------- +delete from t1 where col1='2006-03-17'; +delete from t2 where col1='2006-03-17'; +delete from t3 where col1='2006-03-17'; +delete from t4 where col1='2006-03-17'; +delete from t5 where col1='2006-03-17'; +delete from t6 where col1='2006-03-17'; +select * from t1 order by col1; +col1 +2006-09-06 +select * from t2 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-03-17'); +insert into t2 values ('2006-03-17'); +insert into t3 values ('2006-03-17'); +insert into t4 values (60,'2006-03-17'); +insert into t5 values (60,'2006-03-17'); +insert into t6 values (60,'2006-03-17'); +select * from t1 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-09-06 +select * from t2 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t3 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t4 order by colint; +colint col1 +60 2006-03-17 +select * from t5 order by colint; +colint col1 +60 2006-03-17 +select * from t6 order by colint; +colint col1 +60 2006-03-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with weekofyear(col1) +------------------------------------------------------------------------- +delete from t11 where col1='2006-03-17'; +delete from t22 where col1='2006-03-17'; +delete from t33 where col1='2006-03-17'; +delete from t44 where col1='2006-03-17'; +delete from t55 where col1='2006-03-17'; +delete from t66 where col1='2006-03-17'; +select * from t11 order by col1; +col1 +2006-09-06 +select * from t22 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-03-17'); +insert into t22 values ('2006-03-17'); +insert into t33 values ('2006-03-17'); +insert into t44 values (60,'2006-03-17'); +insert into t55 values (60,'2006-03-17'); +insert into t66 values (60,'2006-03-17'); +select * from t11 order by col1; +col1 +2006-03-17 +2006-09-06 +select * from t22 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-03-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-09-06 +select * from t22 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t33 order by col1; +col1 +2006-03-17 +2006-05-25 +2006-09-06 +select * from t44 order by colint; +colint col1 +60 2006-03-17 +select * from t55 order by colint; +colint col1 +60 2006-03-17 +select * from t66 order by colint; +colint col1 +60 2006-03-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- year(col1)-1990 in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with year(col1)-1990 +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(year(col1)-1990) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(year(col1)-1990) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(year(col1)-1990); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(year(col1)-1990) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(year(col1)-1990) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with year(col1)-1990 +------------------------------------------------------------------------- +insert into t1 values ('1996-01-03'); +insert into t1 values ('2000-02-17'); +insert into t2 values ('1996-01-03'); +insert into t2 values ('2000-02-17'); +insert into t2 values ('2004-05-25'); +insert into t3 values ('1996-01-03'); +insert into t3 values ('2000-02-17'); +insert into t3 values ('2004-05-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select year(col1)-1990 from t1 order by col1; +year(col1)-1990 +6 +10 +select * from t1 order by col1; +col1 +1996-01-03 +2000-02-17 +select * from t2 order by col1; +col1 +1996-01-03 +2000-02-17 +2004-05-25 +select * from t3 order by col1; +col1 +1996-01-03 +2000-02-17 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2002-02-15' where col1='1996-01-03'; +update t2 set col1='2002-02-15' where col1='1996-01-03'; +update t3 set col1='2002-02-15' where col1='1996-01-03'; +update t4 set col1='2002-02-15' where col1='1996-01-03'; +update t5 set col1='2002-02-15' where col1='1996-01-03'; +update t6 set col1='2002-02-15' where col1='1996-01-03'; +select * from t1 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t2 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with year(col1)-1990 +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(year(col1)-1990) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(year(col1)-1990) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(year(col1)-1990); +alter table t44 +partition by range(colint) +subpartition by hash(year(col1)-1990) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(year(col1)-1990) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t22 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +alter table t55 +partition by list(colint) +subpartition by hash(year(col1)-1990) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (year('2005-10-14')-1990), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with year(col1)-1990 +------------------------------------------------------------------------- +delete from t1 where col1='2000-02-17'; +delete from t2 where col1='2000-02-17'; +delete from t3 where col1='2000-02-17'; +delete from t4 where col1='2000-02-17'; +delete from t5 where col1='2000-02-17'; +delete from t6 where col1='2000-02-17'; +select * from t1 order by col1; +col1 +2002-02-15 +select * from t2 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2000-02-17'); +insert into t2 values ('2000-02-17'); +insert into t3 values ('2000-02-17'); +insert into t4 values (60,'2000-02-17'); +insert into t5 values (60,'2000-02-17'); +insert into t6 values (60,'2000-02-17'); +select * from t1 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t2 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +select * from t2 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t3 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t4 order by colint; +colint col1 +60 2000-02-17 +select * from t5 order by colint; +colint col1 +60 2000-02-17 +select * from t6 order by colint; +colint col1 +60 2000-02-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with year(col1)-1990 +------------------------------------------------------------------------- +delete from t11 where col1='2000-02-17'; +delete from t22 where col1='2000-02-17'; +delete from t33 where col1='2000-02-17'; +delete from t44 where col1='2000-02-17'; +delete from t55 where col1='2000-02-17'; +delete from t66 where col1='2000-02-17'; +select * from t11 order by col1; +col1 +2002-02-15 +select * from t22 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2000-02-17'); +insert into t22 values ('2000-02-17'); +insert into t33 values ('2000-02-17'); +insert into t44 values (60,'2000-02-17'); +insert into t55 values (60,'2000-02-17'); +insert into t66 values (60,'2000-02-17'); +select * from t11 order by col1; +col1 +2000-02-17 +2002-02-15 +select * from t22 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2000-02-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +select * from t22 order by col1; +col1 +2002-02-15 +2004-05-25 +select * from t33 order by col1; +col1 +2000-02-17 +2002-02-15 +2004-05-25 +select * from t44 order by colint; +colint col1 +60 2000-02-17 +select * from t55 order by colint; +colint col1 +60 2000-02-17 +select * from t66 order by colint; +colint col1 +60 2000-02-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- yearweek(col1)-200600 in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(yearweek(col1)-200600) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(yearweek(col1)-200600) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(yearweek(col1)-200600); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +insert into t1 values ('2006-01-03'); +insert into t1 values ('2006-08-17'); +insert into t2 values ('2006-01-03'); +insert into t2 values ('2006-08-17'); +insert into t2 values ('2006-03-25'); +insert into t3 values ('2006-01-03'); +insert into t3 values ('2006-08-17'); +insert into t3 values ('2006-03-25'); +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; +load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +select yearweek(col1)-200600 from t1 order by col1; +yearweek(col1)-200600 +1 +33 +select * from t1 order by col1; +col1 +2006-01-03 +2006-08-17 +select * from t2 order by col1; +col1 +2006-01-03 +2006-03-25 +2006-08-17 +select * from t3 order by col1; +col1 +2006-01-03 +2006-03-25 +2006-08-17 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-11-15' where col1='2006-01-03'; +update t2 set col1='2006-11-15' where col1='2006-01-03'; +update t3 set col1='2006-11-15' where col1='2006-01-03'; +update t4 set col1='2006-11-15' where col1='2006-01-03'; +update t5 set col1='2006-11-15' where col1='2006-01-03'; +update t6 set col1='2006-11-15' where col1='2006-01-03'; +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(yearweek(col1)-200600) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(yearweek(col1)-200600) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(yearweek(col1)-200600); +alter table t44 +partition by range(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +alter table t55 +partition by list(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (yearweek('2006-10-14')-200600), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +delete from t1 where col1='2006-08-17'; +delete from t2 where col1='2006-08-17'; +delete from t3 where col1='2006-08-17'; +delete from t4 where col1='2006-08-17'; +delete from t5 where col1='2006-08-17'; +delete from t6 where col1='2006-08-17'; +select * from t1 order by col1; +col1 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-08-17'); +insert into t2 values ('2006-08-17'); +insert into t3 values ('2006-08-17'); +insert into t4 values (60,'2006-08-17'); +insert into t5 values (60,'2006-08-17'); +insert into t6 values (60,'2006-08-17'); +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t2 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t3 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t4 order by colint; +colint col1 +60 2006-08-17 +select * from t5 order by colint; +colint col1 +60 2006-08-17 +select * from t6 order by colint; +colint col1 +60 2006-08-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with yearweek(col1)-200600 +------------------------------------------------------------------------- +delete from t11 where col1='2006-08-17'; +delete from t22 where col1='2006-08-17'; +delete from t33 where col1='2006-08-17'; +delete from t44 where col1='2006-08-17'; +delete from t55 where col1='2006-08-17'; +delete from t66 where col1='2006-08-17'; +select * from t11 order by col1; +col1 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-11-15 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-08-17'); +insert into t22 values ('2006-08-17'); +insert into t33 values ('2006-08-17'); +insert into t44 values (60,'2006-08-17'); +insert into t55 values (60,'2006-08-17'); +insert into t66 values (60,'2006-08-17'); +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t44 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t55 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +select * from t66 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +60 2006-08-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-08-17 +2006-11-15 +select * from t22 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t33 order by col1; +col1 +2006-03-25 +2006-08-17 +2006-11-15 +select * from t44 order by colint; +colint col1 +60 2006-08-17 +select * from t55 order by colint; +colint col1 +60 2006-08-17 +select * from t66 order by colint; +colint col1 +60 2006-08-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; diff --git a/mysql-test/suite/partitions/r/partition_t55.out b/mysql-test/suite/partitions/r/partition_t55.out new file mode 100644 index 00000000000..d86ceda8c38 --- /dev/null +++ b/mysql-test/suite/partitions/r/partition_t55.out @@ -0,0 +1,68 @@ +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +27 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp0.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp0.MYI +18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp1.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp1.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp2.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp2.MYI +18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp3.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp3.MYI +18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp4.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp4.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp0.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp0.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp1.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp1.MYI +18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp2.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp2.MYI +18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp3.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp3.MYI +36 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp4.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp4.MYI +36 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp0.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp0.MYI +0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp1.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp1.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp2.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp2.MYI +18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp3.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp3.MYI +27 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp4.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp4.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp0.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp0.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp1.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp1.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp2.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp2.MYI +18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp3.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp3.MYI +45 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp4.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp4.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp0.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp0.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp1.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp1.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp2.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp2.MYI +0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp3.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp3.MYI +0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp4.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp4.MYI +0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp0.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp0.MYI +0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp1.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp1.MYI +0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp2.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp2.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp3.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp3.MYI +9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp4.MYD +1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp4.MYI +8594 MYSQL_TEST_DIR/var/master-data/test/t55.frm +408 MYSQL_TEST_DIR/var/master-data/test/t55.par diff --git a/mysql-test/suite/partitions/t/disabled.def b/mysql-test/suite/partitions/t/disabled.def index ede5d6b6e60..212ca0206e2 100644 --- a/mysql-test/suite/partitions/t/disabled.def +++ b/mysql-test/suite/partitions/t/disabled.def @@ -13,4 +13,4 @@ partition_alter2_ndb : cannot create t1 partition_char_innodb : crash. Bug? More investigations partition_sessions : needs system_3_init.inc partition_engine_ndb : cannot create t1 - +partition_supported_sql_func_ndb : cannot create t1 diff --git a/mysql-test/suite/partitions/t/partition_supported_sql_func_innodb.test b/mysql-test/suite/partitions/t/partition_supported_sql_func_innodb.test index 4440f814d1e..135c869c841 100644 --- a/mysql-test/suite/partitions/t/partition_supported_sql_func_innodb.test +++ b/mysql-test/suite/partitions/t/partition_supported_sql_func_innodb.test @@ -2,8 +2,8 @@ # t/partition_supported_sql_funcs_innodb.test # # # # Purpose: # -# Tests around sql functions # -# INNODB branch # +# Tests which SQL functions are allowed in partinioning clauses with # +# INNODB. # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -18,16 +18,12 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing -# any of the variables. -# - #------------------------------------------------------------------------------# # General not engine specific settings and requirements ##### Options, for debugging support ##### let $debug= 0; -let $do_long_tests= 0; +let $do_long_tests= 1; # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/partitions/t/partition_supported_sql_func_myisam.test b/mysql-test/suite/partitions/t/partition_supported_sql_func_myisam.test index 3daa72c7ff7..131a5e23f39 100644 --- a/mysql-test/suite/partitions/t/partition_supported_sql_func_myisam.test +++ b/mysql-test/suite/partitions/t/partition_supported_sql_func_myisam.test @@ -2,8 +2,8 @@ # t/partition_supported_sql_funcs_myisam.test # # # # Purpose: # -# Tests around sql functions # -# MyISAM branch # +# Tests which SQL functions are allowed in partinioning clauses with # +# MYISAM. # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -27,7 +27,7 @@ ##### Options, for debugging support ##### let $debug= 0; -let $do_long_tests= 0; +let $do_long_tests= 1; # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/partitions/t/partition_supported_sql_func_ndb.test b/mysql-test/suite/partitions/t/partition_supported_sql_func_ndb.test new file mode 100644 index 00000000000..2a536fbce94 --- /dev/null +++ b/mysql-test/suite/partitions/t/partition_supported_sql_func_ndb.test @@ -0,0 +1,40 @@ +################################################################################ +# t/partition_supported_sql_funcs_myisam.test # +# # +# Purpose: # +# Tests which SQL functions are allowed in partinioning clauses with # +# NDB. # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-11-22 # +# Change Author: # +# Change Date: # +# Change: # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; +let $do_long_tests= 1; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +--source include/have_ndb.inc +##### Storage engine to be tested +let $engine= 'NDB'; + +#------------------------------------------------------------------------------# +--source suite/partitions/include/partition_supported_sql_funcs_main.inc +# --source include/partition_supported_sql_funcs_main.inc + From ff452d050a78083b878260f8d2393016503ae0cb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 20:47:22 +0400 Subject: [PATCH 593/789] Post-merge and post-review fixes for the patch for Bug#23631 "Events: SHOW VARIABLES doesn't work when mysql.event is damaged: mysql-test/r/events.result: Update results (a post-merge fix) mysql-test/r/events_bugs.result: Update results (a post-merge fix) mysql-test/r/events_scheduling.result: Update results (a post-merge fix) mysql-test/t/events_scheduling.test: Make sure this test has no races. sql/event_data_objects.cc: Manual post-merge fix for the events replication patch. sql/event_data_objects.h: A post-merge fix. sql/event_db_repository.cc: A post-merge fix. sql/event_scheduler.cc: We should drop the event inside ::execute since there we have the right credentials to do so (otherwise Events::drop_event returns "access denied" error). sql/events.cc: A post-review fix for: rename start_or_stop_event_scheduler to switch_event_scheduler_state. sql/events.h: A post-review fix for: rename start_or_stop_event_scheduler to switch_event_scheduler_state. sql/set_var.cc: A post-review fix for: rename start_or_stop_event_scheduler to switch_event_scheduler_state. sql/sql_yacc.yy: Remove unused declaratoins. --- mysql-test/r/events.result | 16 +++--- mysql-test/r/events_bugs.result | 62 ++++++++++----------- mysql-test/r/events_scheduling.result | 50 ++++++++++------- mysql-test/t/events_scheduling.test | 77 ++++++++++++++++++++------- sql/event_data_objects.cc | 72 ++++++++++++++++++++++--- sql/event_data_objects.h | 2 +- sql/event_db_repository.cc | 7 +++ sql/event_scheduler.cc | 23 +------- sql/events.cc | 12 ++--- sql/events.h | 2 +- sql/set_var.cc | 2 +- sql/sql_yacc.yy | 2 - 12 files changed, 209 insertions(+), 118 deletions(-) diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index 7125b13cb88..0b1cd67f559 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -197,7 +197,7 @@ create event SHOW CREATE EVENT ðóóò21; Event sql_mode time_zone Create Event ðóóò21 SYSTEM CREATE EVENT `ðóóò21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'òîâà å 1251 êîìåíòàð' DO select 1 -insert into mysql.event (db, name, body, definer, interval_value, interval_field) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND"); +insert into mysql.event (db, name, body, definer, interval_value, interval_field, originator) values (database(), "root22", "select 1", user(), 100, "SECOND_MICROSECOND", 1); show create event root22; ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' SHOW EVENTS; @@ -231,8 +231,8 @@ Create a test event. Only event metadata is relevant, the actual schedule and body are not. CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing"; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 Try to alter mysql.event: the server should fail to load event information after mysql.event was tampered with. @@ -241,8 +241,8 @@ works as before ALTER TABLE mysql.event ADD dummy INT; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 SELECT event_name FROM INFORMATION_SCHEMA.events; event_name intact_check @@ -330,7 +330,7 @@ ERROR HY000: Cannot load from mysql.event. The table is probably corrupted DROP EVENT no_such_event; ERROR HY000: Unknown event 'no_such_event' CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5; -ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. The table is probably corrupted +ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 16. The table is probably corrupted ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8; ERROR HY000: Unknown event 'intact_check_1' ALTER EVENT intact_check_1 RENAME TO intact_check_2; @@ -400,7 +400,7 @@ Restore the original table. CREATE TABLE mysql.event like event_like; DROP TABLE event_like; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion @@ -512,7 +512,7 @@ ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SHOW EVENTS FROM ``; ERROR 42000: Incorrect database name '' SHOW EVENTS FROM `events\\test`; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator LOCK TABLES mode. diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index ba82a7d7b1b..c4053bcfb47 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -390,30 +390,30 @@ SET TIME_ZONE= '+00:00'; SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59'); CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1 SET TIME_ZONE= '-01:00'; ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00'; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED 1 SET TIME_ZONE= '+02:00'; ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1 SET TIME_ZONE= '-03:00'; ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00' ON COMPLETION PRESERVE DISABLE; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1 SET TIME_ZONE= '+04:00'; ALTER EVENT e1 DO SELECT 2; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1 DROP EVENT e1; SET TIME_ZONE='+05:00'; CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO @@ -427,15 +427,15 @@ SET TIME_ZONE='+00:00'; CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO SELECT 1; SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name; -EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT -NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL -NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL -NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL +EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR +NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 +NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 +NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 SHOW CREATE EVENT e1; Event sql_mode time_zone Create Event e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 @@ -475,10 +475,10 @@ SELECT 1; Warnings: Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED -events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 +events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 The following should succeed giving a warning. ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; @@ -511,15 +511,15 @@ CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00' DO SELECT 1; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status -events_test e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -events_test e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED -events_test e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -events_test e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -events_test e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED -events_test e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED -events_test e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED -events_test e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +events_test e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +events_test e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 +events_test e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +events_test e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +events_test e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 +events_test e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1 +events_test e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 +events_test e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1 DROP EVENT e8; DROP EVENT e7; DROP EVENT e6; diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result index 33c0781d4e7..d45bffcd7ff 100644 --- a/mysql-test/r/events_scheduling.result +++ b/mysql-test/r/events_scheduling.result @@ -44,44 +44,56 @@ CREATE TABLE table_1(a int); CREATE TABLE table_2(a int); CREATE TABLE table_3(a int); CREATE TABLE table_4(a int); -CREATE TABLE T19170(s1 TIMESTAMP); SET GLOBAL event_scheduler=ON; -CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1); -CREATE EVENT start_n_end -ON SCHEDULE EVERY 1 SECOND +CREATE EVENT event_1 ON SCHEDULE EVERY 2 SECOND +DO +INSERT INTO table_1 VALUES (1); +CREATE EVENT event_2 ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 6 SECOND ON COMPLETION PRESERVE -DO INSERT INTO table_2 VALUES(1); -CREATE EVENT only_one_time ON SCHEDULE EVERY 2 SECOND ENDS NOW() + INTERVAL 1 SECOND DO INSERT INTO table_3 VALUES(1); -CREATE EVENT two_time ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND ON COMPLETION PRESERVE DO INSERT INTO table_4 VALUES(1); +DO +INSERT INTO table_2 VALUES (1); +CREATE EVENT event_3 ON SCHEDULE EVERY 2 SECOND ENDS NOW() + INTERVAL 1 SECOND +ON COMPLETION NOT PRESERVE +DO +INSERT INTO table_3 VALUES (1); +CREATE EVENT event_4 ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND +ON COMPLETION PRESERVE +DO +INSERT INTO table_4 VALUES (1); SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1; IF(SUM(a) >= 4, 'OK', 'ERROR') OK SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2; IF(SUM(a) >= 5, 'OK', 'ERROR') OK -SELECT IF(SUM(a) > 0, 'OK', 'ERROR') FROM table_3; -IF(SUM(a) > 0, 'OK', 'ERROR') +SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3; +IF(SUM(a) >= 1, 'OK', 'ERROR') OK -SELECT IF(SUM(a) > 0, 'OK', 'ERROR') FROM table_4; -IF(SUM(a) > 0, 'OK', 'ERROR') +SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4; +IF(SUM(a) >= 1, 'OK', 'ERROR') OK -DROP EVENT two_sec; -SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; +SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') +FROM INFORMATION_SCHEMA.EVENTS +WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') OK -SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; +SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') +FROM INFORMATION_SCHEMA.EVENTS +WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') OK -DROP EVENT IF EXISTS events_test.start_n_end; "Already dropped because ended. Therefore an error." -DROP EVENT only_one_time; -ERROR HY000: Unknown event 'only_one_time' +DROP EVENT event_3; +ERROR HY000: Unknown event 'event_3' +DROP EVENT event_1; "Should be preserved" SELECT EVENT_NAME, STATUS FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_NAME; EVENT_NAME STATUS -two_time DISABLED -DROP EVENT two_time; +event_2 DISABLED +event_4 DISABLED +DROP EVENT event_2; +DROP EVENT event_4; DROP TABLE table_1; DROP TABLE table_2; DROP TABLE table_3; diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index b53a548b6ed..5b839e25910 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -34,34 +34,73 @@ CREATE TABLE table_1(a int); CREATE TABLE table_2(a int); CREATE TABLE table_3(a int); CREATE TABLE table_4(a int); -CREATE TABLE T19170(s1 TIMESTAMP); + SET GLOBAL event_scheduler=ON; # We need to have 2 to make it safe with valgrind. This is probably because # of when we calculate the timestamp value -CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1); -CREATE EVENT start_n_end - ON SCHEDULE EVERY 1 SECOND - ENDS NOW() + INTERVAL 6 SECOND - ON COMPLETION PRESERVE - DO INSERT INTO table_2 VALUES(1); ---sleep 5 -CREATE EVENT only_one_time ON SCHEDULE EVERY 2 SECOND ENDS NOW() + INTERVAL 1 SECOND DO INSERT INTO table_3 VALUES(1); -CREATE EVENT two_time ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND ON COMPLETION PRESERVE DO INSERT INTO table_4 VALUES(1); ---sleep 5 +CREATE EVENT event_1 ON SCHEDULE EVERY 2 SECOND +DO + INSERT INTO table_1 VALUES (1); + +CREATE EVENT event_2 ON SCHEDULE EVERY 1 SECOND +ENDS NOW() + INTERVAL 6 SECOND +ON COMPLETION PRESERVE +DO + INSERT INTO table_2 VALUES (1); + +CREATE EVENT event_3 ON SCHEDULE EVERY 2 SECOND ENDS NOW() + INTERVAL 1 SECOND +ON COMPLETION NOT PRESERVE +DO + INSERT INTO table_3 VALUES (1); + +CREATE EVENT event_4 ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND +ON COMPLETION PRESERVE +DO + INSERT INTO table_4 VALUES (1); + +# Let event_1 insert at least 4 records into the table +let $wait_condition=select count(*) >= 4 from table_1; +--source include/wait_condition.inc + +# Let event_2 reach the end of its execution interval +let $wait_condition=select count(*) = 0 from information_schema.events +where event_name='event_2' and status='enabled'; +--source include/wait_condition.inc + +# Let event_3, which is ON COMPLETION NOT PRESERVE execute and drop itself +let $wait_condition=select count(*) = 0 from information_schema.events +where event_name='event_3'; +--source include/wait_condition.inc + +# Let event_4 reach the end of its execution interval +let $wait_condition=select count(*) = 0 from information_schema.events +where event_name='event_4' and status='enabled'; +--source include/wait_condition.inc + +# check the data + SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1; SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2; -SELECT IF(SUM(a) > 0, 'OK', 'ERROR') FROM table_3; -SELECT IF(SUM(a) > 0, 'OK', 'ERROR') FROM table_4; -DROP EVENT two_sec; -SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; -SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='start_n_end' AND ENDS IS NOT NULL; -DROP EVENT IF EXISTS events_test.start_n_end; +SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3; +SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4; + +SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') +FROM INFORMATION_SCHEMA.EVENTS +WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; + +SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') +FROM INFORMATION_SCHEMA.EVENTS +WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; + --echo "Already dropped because ended. Therefore an error." --error ER_EVENT_DOES_NOT_EXIST -DROP EVENT only_one_time; +DROP EVENT event_3; + +DROP EVENT event_1; --echo "Should be preserved" SELECT EVENT_NAME, STATUS FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_NAME; -DROP EVENT two_time; +DROP EVENT event_2; +DROP EVENT event_4; DROP TABLE table_1; DROP TABLE table_2; DROP TABLE table_3; diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 95bfba548de..1881a3540e4 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -99,7 +99,9 @@ Event_parse_data::new_instance(THD *thd) */ Event_parse_data::Event_parse_data() - :on_completion(ON_COMPLETION_DROP), status(ENABLED), do_not_create(FALSE), + :on_completion(Event_basic::ON_COMPLETION_DROP), + status(Event_basic::ENABLED), + do_not_create(FALSE), item_starts(NULL), item_ends(NULL), item_execute_at(NULL), starts_null(TRUE), ends_null(TRUE), execute_at_null(TRUE), item_expression(NULL), expression(0) @@ -241,7 +243,7 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc) if (ltime_utc >= (my_time_t) thd->query_start()) return; - if (on_completion == ON_COMPLETION_DROP) + if (on_completion == Event_basic::ON_COMPLETION_DROP) { switch (thd->lex->sql_command) { case SQLCOM_CREATE_EVENT: @@ -258,9 +260,9 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc) do_not_create= TRUE; } - else if (status == ENABLED) + else if (status == Event_basic::ENABLED) { - status= DISABLED; + status= Event_basic::DISABLED; push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_EVENT_EXEC_TIME_IN_THE_PAST, ER(ER_EVENT_EXEC_TIME_IN_THE_PAST)); @@ -589,6 +591,7 @@ Event_parse_data::check_parse_data(THD *thd) ret= init_execute_at(thd) || init_interval(thd) || init_starts(thd) || init_ends(thd); + check_originator_id(thd); DBUG_RETURN(ret); } @@ -635,6 +638,31 @@ Event_parse_data::init_definer(THD *thd) } +/** + Set the originator id of the event to the server_id if executing on + the master or set to the server_id of the master if executing on + the slave. If executing on slave, also set status to SLAVESIDE_DISABLED. + + SYNOPSIS + Event_parse_data::check_originator_id() +*/ +void Event_parse_data::check_originator_id(THD *thd) +{ + /* Disable replicated events on slave. */ + if ((thd->system_thread == SYSTEM_THREAD_SLAVE_SQL) || + (thd->system_thread == SYSTEM_THREAD_SLAVE_IO)) + { + DBUG_PRINT("info", ("Invoked object status set to SLAVESIDE_DISABLED.")); + if ((status == Event_basic::ENABLED) || + (status == Event_basic::DISABLED)) + status = Event_basic::SLAVESIDE_DISABLED; + originator = thd->server_id; + } + else + originator = server_id; +} + + /* Constructor @@ -1004,8 +1032,23 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table) goto error; DBUG_PRINT("load_from_row", ("Event [%s] is [%s]", name.str, ptr)); - status= (ptr[0]=='E'? Event_queue_element::ENABLED: - Event_queue_element::DISABLED); + + /* Set event status (ENABLED | SLAVESIDE_DISABLED | DISABLED) */ + switch (ptr[0]) + { + case 'E' : + status = Event_queue_element::ENABLED; + break; + case 'S' : + status = Event_queue_element::SLAVESIDE_DISABLED; + break; + case 'D' : + status = Event_queue_element::DISABLED; + break; + } + if ((ptr= get_field(&mem_root, table->field[ET_FIELD_ORIGINATOR])) == NullS) + goto error; + originator = table->field[ET_FIELD_ORIGINATOR]->val_int(); /* ToDo : Andrey . Find a way not to allocate ptr on event_mem_root */ if ((ptr= get_field(&mem_root, @@ -1356,7 +1399,7 @@ Event_queue_element::compute_next_execution_time() (long) starts, (long) ends, (long) last_executed, (long) this)); - if (status == Event_queue_element::DISABLED) + if (status != Event_queue_element::ENABLED) { DBUG_PRINT("compute_next_execution_time", ("Event %s is DISABLED", name.str)); @@ -1708,6 +1751,8 @@ Event_timed::get_create_event(THD *thd, String *buf) if (status == Event_timed::ENABLED) buf->append(STRING_WITH_LEN("ENABLE")); + else if (status == Event_timed::SLAVESIDE_DISABLED) + buf->append(STRING_WITH_LEN("DISABLE ON SLAVE")); else buf->append(STRING_WITH_LEN("DISABLE")); @@ -1765,7 +1810,7 @@ Event_job_data::get_fake_create_event(String *buf) */ int -Event_job_data::execute(THD *thd) +Event_job_data::execute(THD *thd, bool drop) { Security_context save_ctx; /* this one is local and not needed after exec */ @@ -1805,6 +1850,17 @@ Event_job_data::execute(THD *thd) definer_host.str, dbname.str)); ret= -99; } + if (drop) + { + sql_print_information("Event Scheduler: Dropping %s.%s", + dbname.str, name.str); + /* + We must do it here since here we're under the right authentication + ID of the event definer + */ + if (Events::drop_event(thd, dbname, name, FALSE)) + ret= 1; + } event_restore_security_context(thd, &save_ctx); done: diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index 4d58484e5c2..eb851c98065 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -184,7 +184,7 @@ public: load_from_row(THD *thd, TABLE *table); int - execute(THD *thd); + execute(THD *thd, bool drop); int compile(THD *thd, MEM_ROOT *mem_root); diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index cc981c9cb69..fcd48757957 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -905,6 +905,13 @@ update_timing_fields_for_event(THD *thd, DBUG_ENTER("Event_db_repository::update_timing_fields_for_event"); + /* + Turn off row binlogging of event timing updates. These are not used + for RBR of events replicated to the slave. + */ + if (thd->current_stmt_binlog_row_based) + thd->clear_current_stmt_binlog_row_based(); + if (open_event_table(thd, TL_WRITE, &table)) goto end; diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index a9a93cbc74b..fa5cde9a43a 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -309,7 +309,7 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event) thd->enable_slow_log= TRUE; - ret= job_data->execute(thd); + ret= job_data->execute(thd, event->dropped); print_warnings(thd, job_data); @@ -338,27 +338,6 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event) end: delete job_data; - if (event->dropped) - { - sql_print_information("Event Scheduler: Dropping %s.%s", - event->dbname.str, event->name.str); - /* - Using db_repository can lead to a race condition because we access - the table without holding LOCK_metadata. - Scenario: - 1. CREATE EVENT xyz AT ... (conn thread) - 2. execute xyz (worker) - 3. CREATE EVENT XYZ EVERY ... (conn thread) - 4. drop xyz (worker) - 5. XYZ was just created on disk but `drop xyz` of the worker dropped it. - A consequent load to create Event_queue_element will fail. - - If all operations are performed under LOCK_metadata there is no such - problem. However, this comes at the price of introduction bi-directional - association between class Events and class Event_worker_thread. - */ - Events::drop_event(thd, event->dbname, event->name, FALSE); - } DBUG_PRINT("info", ("Done with Event %s.%s", event->dbname.str, event->name.str)); diff --git a/sql/events.cc b/sql/events.cc index 7c44116af55..10a002121a0 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -1041,14 +1041,14 @@ Events::dump_internal_status() */ bool -Events::start_or_stop_event_scheduler(enum_opt_event_scheduler start_or_stop) +Events::switch_event_scheduler_state(enum_opt_event_scheduler new_state) { bool ret= FALSE; - DBUG_ENTER("Events::start_or_stop_event_scheduler"); + DBUG_ENTER("Events::switch_event_scheduler_state"); - DBUG_ASSERT(start_or_stop == Events::EVENTS_ON || - start_or_stop == Events::EVENTS_OFF); + DBUG_ASSERT(new_state == Events::EVENTS_ON || + new_state == Events::EVENTS_OFF); /* If the scheduler was disabled because there are no/bad @@ -1068,7 +1068,7 @@ Events::start_or_stop_event_scheduler(enum_opt_event_scheduler start_or_stop) goto end; } - if (start_or_stop == EVENTS_ON) + if (new_state == EVENTS_ON) ret= scheduler->start(); else ret= scheduler->stop(); @@ -1079,7 +1079,7 @@ Events::start_or_stop_event_scheduler(enum_opt_event_scheduler start_or_stop) goto end; } - opt_event_scheduler= start_or_stop; + opt_event_scheduler= new_state; end: pthread_mutex_unlock(&LOCK_event_metadata); diff --git a/sql/events.h b/sql/events.h index db0e947ab6c..1b99b072fd7 100644 --- a/sql/events.h +++ b/sql/events.h @@ -99,7 +99,7 @@ public: destroy_mutexes(); static bool - start_or_stop_event_scheduler(enum enum_opt_event_scheduler start_or_stop); + switch_event_scheduler_state(enum enum_opt_event_scheduler new_state); static bool create_event(THD *thd, Event_parse_data *parse_data, bool if_exists); diff --git a/sql/set_var.cc b/sql/set_var.cc index 898d47e766e..741969214bd 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -4020,7 +4020,7 @@ sys_var_event_scheduler::update(THD *thd, set_var *var) new_state= (enum Events::enum_opt_event_scheduler) var->save_result.ulong_value; - res= Events::start_or_stop_event_scheduler(new_state); + res= Events::switch_event_scheduler_state(new_state); DBUG_RETURN((bool) res); } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 0c6ce1d7eeb..50bc81cc13d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -948,7 +948,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token SIGNED_SYM %token SIMPLE_SYM /* SQL-2003-N */ %token SLAVE -%token SLAVESIDE_DISABLE_SYM %token SMALLINT /* SQL-2003-R */ %token SNAPSHOT_SYM %token SOCKET_SYM @@ -10004,7 +10003,6 @@ keyword_sp: | SIMPLE_SYM {} | SHARE_SYM {} | SHUTDOWN {} - | SLAVESIDE_DISABLE_SYM {} | SNAPSHOT_SYM {} | SOUNDS_SYM {} | SQL_CACHE_SYM {} From 923d2d3a0174c29e7232ce637b38a1da1afebfc7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 21:01:09 +0400 Subject: [PATCH 594/789] Remove a dead file. BitKeeper/deleted/.del-openssl_2.result: Delete: mysql-test/r/openssl_2.result --- mysql-test/r/openssl_2.result | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 mysql-test/r/openssl_2.result diff --git a/mysql-test/r/openssl_2.result b/mysql-test/r/openssl_2.result deleted file mode 100644 index 879c623dd40..00000000000 --- a/mysql-test/r/openssl_2.result +++ /dev/null @@ -1,25 +0,0 @@ -SHOW STATUS LIKE 'Ssl%'; -Variable_name Value -Ssl_accepts 1 -Ssl_finished_accepts 1 -Ssl_finished_connects 0 -Ssl_accept_renegotiates 0 -Ssl_connect_renegotiates 0 -Ssl_callback_cache_hits 0 -Ssl_session_cache_hits 0 -Ssl_session_cache_misses 0 -Ssl_session_cache_timeouts 0 -Ssl_used_session_cache_entries 1 -Ssl_client_connects 0 -Ssl_session_cache_overflows 0 -Ssl_session_cache_size 128 -Ssl_session_cache_mode SERVER -Ssl_sessions_reused 0 -Ssl_ctx_verify_mode 7 -Ssl_ctx_verify_depth 4294967295 -Ssl_verify_mode 7 -Ssl_verify_depth 4294967295 -Ssl_version TLSv1 -Ssl_cipher EDH-RSA-DES-CBC3-SHA -Ssl_cipher_list -Ssl_default_timeout 7200 From aadfe5e7fcd732be86ed620d016621450d496919 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 21:46:25 +0400 Subject: [PATCH 595/789] Fix a compile error with LINT enabled builds. --- sql/sp_head.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 9bedc6fb38e..cb19e800510 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2109,9 +2109,6 @@ sp_head::show_create_procedure(THD *thd) DBUG_ENTER("sp_head::show_create_procedure"); DBUG_PRINT("info", ("procedure %s", m_name.str)); - LINT_INIT(sql_mode_str); - LINT_INIT(sql_mode_len); - if (check_show_routine_access(thd, this, &full_access)) DBUG_RETURN(1); From e3e600bcf13d7ccda16c1cf45367346649eb5183 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 20:12:56 +0200 Subject: [PATCH 596/789] Add "query_sorted" command to mysqltest Usage: query_sorted ; client/mysqltest.c: Add query_sorted command to mysqltest mysql-test/r/mysqltest.result: Update result mysql-test/t/mysqltest.test: Add tests for query_sorted --- client/mysqltest.c | 144 +++++++++++++++++++++++++++------- mysql-test/r/mysqltest.result | 16 ++++ mysql-test/t/mysqltest.test | 18 +++++ 3 files changed, 149 insertions(+), 29 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 6f0a1ba3498..47c1393df79 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -98,7 +98,8 @@ static my_bool sp_protocol= 0, sp_protocol_enabled= 0; static my_bool view_protocol= 0, view_protocol_enabled= 0; static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0; static my_bool parsing_disabled= 0; -static my_bool display_result_vertically= FALSE, display_metadata= FALSE; +static my_bool display_result_vertically= FALSE, + display_metadata= FALSE, display_result_sorted= FALSE; static my_bool disable_query_log= 0, disable_result_log= 0; static my_bool disable_warnings= 0, disable_ps_warnings= 0; static my_bool disable_info= 1; @@ -265,7 +266,7 @@ enum enum_commands { Q_EXEC, Q_DELIMITER, Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR, Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, - Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, + Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_QUERY_SORTED, Q_START_TIMER, Q_END_TIMER, Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, @@ -337,6 +338,7 @@ const char *command_names[]= "horizontal_results", "query_vertical", "query_horizontal", + "query_sorted", "start_timer", "end_timer", "character_set", @@ -473,6 +475,7 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val, int len); void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val); void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val); +void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING* ds_input); void handle_error(struct st_command*, unsigned int err_errno, const char *err_error, @@ -5163,7 +5166,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) { MYSQL *mysql= &cn->mysql; DYNAMIC_STRING *ds; + DYNAMIC_STRING *save_ds= NULL; DYNAMIC_STRING ds_result; + DYNAMIC_STRING ds_sorted; DYNAMIC_STRING ds_warnings; DYNAMIC_STRING eval_query; char *query; @@ -5304,6 +5309,18 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) dynstr_free(&query_str); } + if (display_result_sorted) + { + /* + Collect the query output in a separate string + that can be sorted before it's added to the + global result string + */ + init_dynamic_string(&ds_sorted, "", 1024, 1024); + save_ds= ds; /* Remember original ds */ + ds= &ds_sorted; + } + /* Find out how to run this query @@ -5321,6 +5338,14 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) run_query_normal(cn, command, flags, query, query_len, ds, &ds_warnings); + if (display_result_sorted) + { + /* Sort the result set and append it to result */ + dynstr_append_sorted(save_ds, &ds_sorted); + ds= save_ds; + dynstr_free(&ds_sorted); + } + if (sp_created) { if (util_query(mysql, "DROP PROCEDURE mysqltest_tmp_sp ")) @@ -5763,37 +5788,24 @@ int main(int argc, char **argv) case Q_EVAL_RESULT: eval_result = 1; break; case Q_EVAL: + case Q_QUERY_VERTICAL: + case Q_QUERY_HORIZONTAL: + case Q_QUERY_SORTED: if (command->query == command->query_buf) { + /* Skip the first part of command, i.e query_xxx */ command->query= command->first_argument; command->first_word_len= 0; } /* fall through */ - case Q_QUERY_VERTICAL: - case Q_QUERY_HORIZONTAL: - { - my_bool old_display_result_vertically= display_result_vertically; - - /* Remove "query_*" if this is first iteration */ - if (command->query == command->query_buf) - command->query= command->first_argument; - - display_result_vertically= (command->type == Q_QUERY_VERTICAL); - if (save_file[0]) - { - strmake(command->require_file, save_file, sizeof(save_file)); - save_file[0]= 0; - } - run_query(cur_con, command, QUERY_REAP_FLAG|QUERY_SEND_FLAG); - display_result_vertically= old_display_result_vertically; - command->last_argument= command->end; - command_executed++; - break; - } case Q_QUERY: case Q_REAP: { - int flags; + my_bool old_display_result_vertically= display_result_vertically; + my_bool old_display_result_sorted= display_result_sorted; + /* Default is full query, both reap and send */ + int flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG; + if (q_send_flag) { /* Last command was an empty 'send' */ @@ -5804,11 +5816,10 @@ int main(int argc, char **argv) { flags= QUERY_REAP_FLAG; } - else - { - /* full query, both reap and send */ - flags= QUERY_REAP_FLAG | QUERY_SEND_FLAG; - } + + /* Check for special property for this query */ + display_result_vertically= (command->type == Q_QUERY_VERTICAL); + display_result_sorted= (command->type == Q_QUERY_SORTED); if (save_file[0]) { @@ -5818,6 +5829,11 @@ int main(int argc, char **argv) run_query(cur_con, command, flags); command_executed++; command->last_argument= command->end; + + /* Restore settings */ + display_result_vertically= old_display_result_vertically; + display_result_sorted= old_display_result_sorted; + break; } case Q_SEND: @@ -7427,3 +7443,73 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val) char *end= longlong10_to_str(val, buff, 10); replace_dynstr_append_mem(ds, buff, end - buff); } + + + +/* + Build a list of pointer to each line in ds_input, sort + the list and use the sorted list to append the strings + sorted to the output ds + + SYNOPSIS + dynstr_append_sorted + ds - string where the sorted output will be appended + ds_input - string to be sorted + +*/ + +static int comp_lines(const char **a, const char **b) +{ + return (strcmp(*a,*b)); +} + +void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input) +{ + unsigned i; + char *start= ds_input->str; + DYNAMIC_ARRAY lines; + DBUG_ENTER("dynstr_append_sorted"); + + if (!*start) + DBUG_VOID_RETURN; /* No input */ + + my_init_dynamic_array(&lines, sizeof(const char*), 32, 32); + + /* First line is result header, skip past it */ + while (*start && *start != '\n') + start++; + start++; /* Skip past \n */ + dynstr_append_mem(ds, ds_input->str, start - ds_input->str); + + /* Insert line(s) in array */ + while (*start) + { + char* line_end= (char*)start; + + /* Find end of line */ + while (*line_end && *line_end != '\n') + line_end++; + *line_end= 0; + + /* Insert pointer to the line in array */ + if (insert_dynamic(&lines, (gptr) &start)) + die("Out of memory inserting lines to sort"); + + start= line_end+1; + } + + /* Sort array */ + qsort(lines.buffer, lines.elements, + sizeof(char**), (qsort_cmp)comp_lines); + + /* Create new result */ + for (i= 0; i < lines.elements ; i++) + { + const char **line= dynamic_element(&lines, i, const char**); + dynstr_append(ds, *line); + dynstr_append(ds, "\n"); + } + + delete_dynamic(&lines); + DBUG_VOID_RETURN; +} diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 3ddb82d4a8d..537316c4924 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -526,4 +526,20 @@ hello hello mysqltest: At line 1: test of die Some output +create table t1( a int, b char(255), c timestamp); +insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 2", '2007-04-05'); +insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 3", '2007-04-05'); +select * from t1; +a b c +1 Line 1 2007-04-05 00:00:00 +2 Part 2 2007-04-05 00:00:00 +1 Line 1 2007-04-05 00:00:00 +2 Part 3 2007-04-05 00:00:00 +select * from t1; +a b c +1 Line 1 2007-04-05 00:00:00 +1 Line 1 2007-04-05 00:00:00 +2 Part 2 2007-04-05 00:00:00 +2 Part 3 2007-04-05 00:00:00 +select * from t1; End of tests diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index c06d51d9d49..b840dc6e9d0 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1602,5 +1602,23 @@ EOF --exec echo "echo Some output; exit; echo Not this;" | $MYSQL_TEST 2>&1 +# ---------------------------------------------------------------------------- +# test for query_sorted +# ---------------------------------------------------------------------------- + +create table t1( a int, b char(255), c timestamp); +insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 2", '2007-04-05'); +insert into t1 values(1, 'Line 1', '2007-04-05'), (2, "Part 3", '2007-04-05'); +select * from t1; +query_sorted select * from t1; +disable_result_log; +query_sorted select * from t1; +enable_result_log; +query_sorted select ''; +query_sorted select "h"; +query_sorted select "he"; +query_sorted select "hep"; +query_sorted select "hepp"; + --echo End of tests From 25677bdc2e385f67f7df13c5fb25d0973e1f00d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 23:22:33 +0400 Subject: [PATCH 597/789] Fix a compile failure on Windows. --- sql/set_var.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index 741969214bd..ea2888aec56 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3683,7 +3683,7 @@ byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : thd->variables.*offset); (void) symbolic_mode_representation(thd, val, &sql_mode); - return sql_mode.str; + return (byte *) sql_mode.str; } From b89367f2f8ad437551a449825f0e03dea553fcce Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 22:34:33 +0300 Subject: [PATCH 598/789] Fixes for tests after merge from 5.0 mysql-test/r/grant.result: Fixed a result. Editor added wrong characters. mysql-test/r/mysqlbinlog2.result: Fixed mysql-test/r/sp.result: Fixed a result, moved lines around. mysql-test/r/sp_trans.result: Fixed a result, moved lines around. mysql-test/t/mysqlbinlog2.test: Merged tests from 5.0 mysql-test/t/sp_trans.test: Merged test from 5.0 and fixed to be compatible with 5.1 sql/sql_class.cc: Merged from 5.0 sql/sql_error.cc: Fixed push_warning() --- mysql-test/r/grant.result | 60 +++++------ mysql-test/r/mysqlbinlog2.result | 2 - mysql-test/r/sp.result | 169 ++++++++++++++++--------------- mysql-test/r/sp_trans.result | 46 +++++---- mysql-test/t/mysqlbinlog2.test | 10 +- mysql-test/t/sp_trans.test | 4 +- sql/sql_class.cc | 2 + sql/sql_error.cc | 10 +- 8 files changed, 151 insertions(+), 152 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 7bfe8a33f02..4fa61210339 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -260,29 +260,29 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C GRANT SELECT, INSERT, UPDATE ON `test`.* TO 'mysqltest_1'@'localhost' drop user mysqltest_1@localhost; SET NAMES koi8r; -CREATE DATABASE ツト; -USE ツト; -CREATE TABLE ï¾”ï¾ï¾‚ (ヒï¾ï¾Œ int); -GRANT SELECT ON ツト.* TO タレナメ@localhost; -SHOW GRANTS FOR タレナメ@localhost; -Grants for タレナメ@localhost -GRANT USAGE ON *.* TO 'タレナメ'@'localhost' -GRANT SELECT ON `ツト`.* TO 'タレナメ'@'localhost' -REVOKE SELECT ON ツト.* FROM タレナメ@localhost; -GRANT SELECT ON ツト.ï¾”ï¾ï¾‚ TO タレナメ@localhost; -SHOW GRANTS FOR タレナメ@localhost; -Grants for タレナメ@localhost -GRANT USAGE ON *.* TO 'タレナメ'@'localhost' -GRANT SELECT ON `ツト`.`ï¾”ï¾ï¾‚` TO 'タレナメ'@'localhost' -REVOKE SELECT ON ツト.ï¾”ï¾ï¾‚ FROM タレナメ@localhost; -GRANT SELECT (ヒï¾ï¾Œ) ON ツト.ï¾”ï¾ï¾‚ TO タレナメ@localhost; -SHOW GRANTS FOR タレナメ@localhost; -Grants for タレナメ@localhost -GRANT USAGE ON *.* TO 'タレナメ'@'localhost' -GRANT SELECT (ヒï¾ï¾Œ) ON `ツト`.`ï¾”ï¾ï¾‚` TO 'タレナメ'@'localhost' -REVOKE SELECT (ヒï¾ï¾Œ) ON ツト.ï¾”ï¾ï¾‚ FROM タレナメ@localhost; -DROP USER タレナメ@localhost; -DROP DATABASE ツト; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁ (ËÏÌ int); +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +GRANT SELECT ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁ FROM ÀÚÅÒ@localhost; +DROP USER ÀÚÅÒ@localhost; +DROP DATABASE ÂÄ; SET NAMES latin1; USE test; CREATE TABLE t1 (a int ); @@ -613,22 +613,22 @@ set @user123="non-existent"; select * from mysql.db where user=@user123; Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv set names koi8r; -create database ツト; -grant select on ツト.* to root@localhost; -select hex(Db) from mysql.db where Db='ツト'; +create database ÂÄ; +grant select on ÂÄ.* to root@localhost; +select hex(Db) from mysql.db where Db='ÂÄ'; hex(Db) D0B1D0B4 show grants for root@localhost; Grants for root@localhost GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION -GRANT SELECT ON `ツト`.* TO 'root'@'localhost' +GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost' flush privileges; show grants for root@localhost; Grants for root@localhost GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION -GRANT SELECT ON `ツト`.* TO 'root'@'localhost' -drop database ツト; -revoke all privileges on ツト.* from root@localhost; +GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost' +drop database ÂÄ; +revoke all privileges on ÂÄ.* from root@localhost; show grants for root@localhost; Grants for root@localhost GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index 8ca18b70e69..ef6e4ee80fd 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -134,7 +134,6 @@ SET @@session.sql_mode=0/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; insert into t1 values(null, "d")/*!*/; -SET INSERT_ID=5/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -512,7 +511,6 @@ SET @@session.sql_mode=0/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; insert into t1 values(null, "d")/*!*/; -SET INSERT_ID=5/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index aa3d7b160c9..676332e6f03 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5643,90 +5643,6 @@ t3_id_1 t3_id_2 t4_id DROP PROCEDURE p1| DROP VIEW v1, v2| DROP TABLE t3, t4| -drop function if exists bug20777| -drop table if exists examplebug20777| -create function bug20777(f1 bigint unsigned) returns bigint unsigned -begin -set f1 = (f1 - 10); set f1 = (f1 10); -return f1; -end| -select bug20777(9223372036854775803) as '9223372036854775803 2**63-5'; -9223372036854775803 2**63-5 -9223372036854775803 -select bug20777(9223372036854775804) as '9223372036854775804 2**63-4'; -9223372036854775804 2**63-4 -9223372036854775804 -select bug20777(9223372036854775805) as '9223372036854775805 2**63-3'; -9223372036854775805 2**63-3 -9223372036854775805 -select bug20777(9223372036854775806) as '9223372036854775806 2**63-2'; -9223372036854775806 2**63-2 -9223372036854775806 -select bug20777(9223372036854775807) as '9223372036854775807 2**63-1'; -9223372036854775807 2**63-1 -9223372036854775807 -select bug20777(9223372036854775808) as '9223372036854775808 2**63+0'; -9223372036854775808 2**63+0 -9223372036854775808 -select bug20777(9223372036854775809) as '9223372036854775809 2**63+1'; -9223372036854775809 2**63+1 -9223372036854775809 -select bug20777(9223372036854775810) as '9223372036854775810 2**63+2'; -9223372036854775810 2**63+2 -9223372036854775810 -select bug20777(-9223372036854775808) as 'lower bounds signed bigint'; -lower bounds signed bigint -0 -select bug20777(9223372036854775807) as 'upper bounds signed bigint'; -upper bounds signed bigint -9223372036854775807 -select bug20777(0) as 'lower bounds unsigned bigint'; -lower bounds unsigned bigint -0 -select bug20777(18446744073709551615) as 'upper bounds unsigned bigint'; -upper bounds unsigned bigint -18446744073709551615 -select bug20777(18446744073709551616) as 'upper bounds unsigned bigint 1'; -upper bounds unsigned bigint 1 -18446744073709551615 -select bug20777(-1) as 'lower bounds unsigned bigint - 1'; -lower bounds unsigned bigint - 1 -0 -create table examplebug20777 as select -0 as 'i', -bug20777(9223372036854775806) as '2**63-2', -bug20777(9223372036854775807) as '2**63-1', -bug20777(9223372036854775808) as '2**63', -bug20777(9223372036854775809) as '2**63+1', -bug20777(18446744073709551614) as '2**64-2', -bug20777(18446744073709551615) as '2**64-1', -bug20777(18446744073709551616) as '2**64', -bug20777(0) as '0', -bug20777(-1) as '-1'; -insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1); -show create table examplebug20777; -Table Create Table -examplebug20777 CREATE TABLE `examplebug20777` ( - `i` int(1) NOT NULL DEFAULT '0', - `2**63-2` bigint(20) unsigned DEFAULT NULL, - `2**63-1` bigint(20) unsigned DEFAULT NULL, - `2**63` bigint(20) unsigned DEFAULT NULL, - `2**63+1` bigint(20) unsigned DEFAULT NULL, - `2**64-2` bigint(20) unsigned DEFAULT NULL, - `2**64-1` bigint(20) unsigned DEFAULT NULL, - `2**64` bigint(20) unsigned DEFAULT NULL, - `0` bigint(20) unsigned DEFAULT NULL, - `-1` bigint(20) unsigned DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from examplebug20777 order by i; -i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 0 -1 -0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 18446744073709551615 0 0 -1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616 0 0 -drop table examplebug20777; -select bug20777(18446744073709551613)+1; -bug20777(18446744073709551613)+1 -18446744073709551614 -drop function bug20777; End of 5.0 tests Begin of 5.1 tests drop function if exists pi; @@ -6160,6 +6076,91 @@ DATABASE() NULL DROP DATABASE mysqltest1| use test| +drop function if exists bug20777| +drop table if exists examplebug20777| +create function bug20777(f1 bigint unsigned) returns bigint unsigned +begin +set f1 = (f1 - 10); set f1 = (f1 + 10); +return f1; +end| +select bug20777(9223372036854775803) as '9223372036854775803 2**63-5'; +9223372036854775803 2**63-5 +9223372036854775803 +select bug20777(9223372036854775804) as '9223372036854775804 2**63-4'; +9223372036854775804 2**63-4 +9223372036854775804 +select bug20777(9223372036854775805) as '9223372036854775805 2**63-3'; +9223372036854775805 2**63-3 +9223372036854775805 +select bug20777(9223372036854775806) as '9223372036854775806 2**63-2'; +9223372036854775806 2**63-2 +9223372036854775806 +select bug20777(9223372036854775807) as '9223372036854775807 2**63-1'; +9223372036854775807 2**63-1 +9223372036854775807 +select bug20777(9223372036854775808) as '9223372036854775808 2**63+0'; +9223372036854775808 2**63+0 +9223372036854775808 +select bug20777(9223372036854775809) as '9223372036854775809 2**63+1'; +9223372036854775809 2**63+1 +9223372036854775809 +select bug20777(9223372036854775810) as '9223372036854775810 2**63+2'; +9223372036854775810 2**63+2 +9223372036854775810 +select bug20777(-9223372036854775808) as 'lower bounds signed bigint'; +lower bounds signed bigint +0 +select bug20777(9223372036854775807) as 'upper bounds signed bigint'; +upper bounds signed bigint +9223372036854775807 +select bug20777(0) as 'lower bounds unsigned bigint'; +lower bounds unsigned bigint +0 +select bug20777(18446744073709551615) as 'upper bounds unsigned bigint'; +upper bounds unsigned bigint +18446744073709551615 +select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1'; +upper bounds unsigned bigint + 1 +18446744073709551615 +select bug20777(-1) as 'lower bounds unsigned bigint - 1'; +lower bounds unsigned bigint - 1 +0 +create table examplebug20777 as select +0 as 'i', +bug20777(9223372036854775806) as '2**63-2', +bug20777(9223372036854775807) as '2**63-1', +bug20777(9223372036854775808) as '2**63', +bug20777(9223372036854775809) as '2**63+1', +bug20777(18446744073709551614) as '2**64-2', +bug20777(18446744073709551615) as '2**64-1', +bug20777(18446744073709551616) as '2**64', +bug20777(0) as '0', +bug20777(-1) as '-1'; +insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1); +show create table examplebug20777; +Table Create Table +examplebug20777 CREATE TABLE `examplebug20777` ( + `i` int(1) NOT NULL DEFAULT '0', + `2**63-2` bigint(20) unsigned DEFAULT NULL, + `2**63-1` bigint(20) unsigned DEFAULT NULL, + `2**63` bigint(20) unsigned DEFAULT NULL, + `2**63+1` bigint(20) unsigned DEFAULT NULL, + `2**64-2` bigint(20) unsigned DEFAULT NULL, + `2**64-1` bigint(20) unsigned DEFAULT NULL, + `2**64` bigint(20) unsigned DEFAULT NULL, + `0` bigint(20) unsigned DEFAULT NULL, + `-1` bigint(20) unsigned DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from examplebug20777 order by i; +i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 0 -1 +0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 18446744073709551615 0 0 +1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616 0 0 +drop table examplebug20777; +select bug20777(18446744073709551613)+1; +bug20777(18446744073709551613)+1 +18446744073709551614 +drop function bug20777; +End of 5.0 tests. drop table t1,t2; CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM; CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb; diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index daf77b80d6e..c976ea7a415 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -530,27 +530,6 @@ count(*) drop table t3, t4| drop procedure bug14210| set @@session.max_heap_table_size=default| -drop function if exists bug23333| -drop table if exists t1,t2| -CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| -CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| -insert into t2 values (1,1)| -create function bug23333() -RETURNS int(11) -DETERMINISTIC -begin -insert into t1 values (null); -select count(*) from t1 into @a; -return @a; -end| -reset master| -insert into t2 values (bug23333(),1)| -ERROR 23000: Duplicate entry '1' for key 1 -show binlog events from 98 /* with fixes for #23333 will show there is the query */| -Log_name Pos Event_type Server_id End_log_pos Info -select count(*),@a from t1 /* must be 1,1 */| -count(*) @a -1 1 CREATE DATABASE db_bug7787| use db_bug7787| CREATE PROCEDURE p1() @@ -577,3 +556,28 @@ f1 bug13575(f1) 3 ccc drop function bug13575| drop table t3| +drop function if exists bug23333| +drop table if exists t1,t2| +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| +CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| +insert into t2 values (1,1)| +create function bug23333() +RETURNS int(11) +DETERMINISTIC +begin +insert into t1 values (null); +select count(*) from t1 into @a; +return @a; +end| +reset master| +insert into t2 values (bug23333(),1)| +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +show binlog events from 106 /* with fixes for #23333 will show there is the query */| +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Table_map 1 # # +master-bin.000001 # Table_map 1 # # +master-bin.000001 # Write_rows 1 # # +master-bin.000001 # Query 1 # # +select count(*),@a from t1 /* must be 1,1 */| +count(*) @a +1 1 diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index a7014706f09..ac647f772b1 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -60,7 +60,7 @@ select "--- stop-position --" as ""; --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=600 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -115,14 +115,14 @@ select "--- start-position --" as ""; --enable_query_log --exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log -select "--- start and stop positions ---" as ""; ---enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=600 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 ---disable_query_log select "--- stop-position --" as ""; --enable_query_log --exec $MYSQL_BINLOG --short-form --stop-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log +select "--- start and stop positions ---" as ""; +--enable_query_log +--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--disable_query_log select "--- start-datetime --" as ""; --enable_query_log --exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 4925dc0eba2..d57fb980956 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -617,10 +617,10 @@ begin end| reset master| ---error ER_DUP_ENTRY +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t2 values (bug23333(),1)| --replace_column 2 # 5 # 6 # -show binlog events from 98 /* with fixes for #23333 will show there is the query */| +show binlog events from 106 /* with fixes for #23333 will show there is the query */| select count(*),@a from t1 /* must be 1,1 */| # diff --git a/sql/sql_class.cc b/sql/sql_class.cc index b952251ce09..944d343164f 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -367,6 +367,7 @@ void THD::init(void) if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; options= thd_startup_options; + no_trans_update.stmt= no_trans_update.all= FALSE; open_options=ha_open_options; update_lock_default= (variables.low_priority_updates ? TL_WRITE_LOW_PRIORITY : @@ -437,6 +438,7 @@ void THD::cleanup(void) DBUG_ENTER("THD::cleanup"); DBUG_ASSERT(cleanup_done == 0); + killed= KILL_CONNECTION; #ifdef ENABLE_WHEN_BINLOG_WILL_BE_ABLE_TO_PREPARE if (transaction.xid_state.xa_state == XA_PREPARED) { diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 70882d8f4e8..f551a7ef4b2 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -147,15 +147,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, if (thd->warn_list.elements < thd->variables.max_error_count) { - /* - The following code is here to change the allocation to not - use the thd->mem_root, which is freed after each query - */ - MEM_ROOT *old_root= thd->mem_root; - thd->mem_root= &thd->warn_root; - if ((err= new MYSQL_ERROR(thd, code, level, msg))) + /* We have to use warn_root, as mem_root is freed after each query */ + if ((err= new (&thd->warn_root) MYSQL_ERROR(thd, code, level, msg))) thd->warn_list.push_back(err); - thd->mem_root= old_root; } thd->warn_count[(uint) level]++; thd->total_warn_count++; From 393e2aa9d5bbaad68c5c2624a714b1553dfb2075 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 21:53:02 +0200 Subject: [PATCH 599/789] Bug#26121 mysqldump includes LOCK TABLES general_log WRITE - Giving the directive '--all-databases' to mysqldump caused an attempt to lock and dump log tables which don't support this operation. - With this patch the log tables are excluded from the set of databases tables to dump. client/mysqldump.c: - Ignore log tables which can't be locked. mysql-test/t/mysqldump.test: Added test --- client/mysqldump.c | 16 ++++++++++++---- mysql-test/t/mysqldump.test | 7 +++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index c86a2fc385f..829c1bb5bf5 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -818,11 +818,15 @@ static int get_options(int *argc, char ***argv) (hash_get_key) get_table_key, (hash_free_key) free_table_ent, 0)) return(EX_EOM); - /* Don't copy cluster internal log tables */ + /* Don't copy internal log tables */ if (my_hash_insert(&ignore_table, (byte*) my_strdup("mysql.apply_status", MYF(MY_WME))) || my_hash_insert(&ignore_table, - (byte*) my_strdup("mysql.schema", MYF(MY_WME)))) + (byte*) my_strdup("mysql.schema", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (byte*) my_strdup("mysql.general_log", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (byte*) my_strdup("mysql.slow_log", MYF(MY_WME)))) return(EX_EOM); if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option))) @@ -3291,8 +3295,12 @@ static int dump_all_tables_in_db(char *database) init_dynamic_string(&query, "LOCK TABLES ", 256, 1024); for (numrows= 0 ; (table= getTableName(1)) ; numrows++) { - dynstr_append(&query, quote_name(table, table_buff, 1)); - dynstr_append(&query, " READ /*!32311 LOCAL */,"); + char *end= strmov(afterdot, table); + if (include_table(hash_key,end - hash_key)) + { + dynstr_append(&query, quote_name(table, table_buff, 1)); + dynstr_append(&query, " READ /*!32311 LOCAL */,"); + } } if (numrows && mysql_real_query(mysql, query.str, query.length-1)) DB_error(mysql, "when using LOCK TABLES"); diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index d9372ad35c1..aa4f22c8a39 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1546,6 +1546,13 @@ drop view v1; drop table t1; drop database mysqldump_test_db; +# +# BUG#26121 mysqldump includes LOCK TABLES general_log WRITE +# +--exec $MYSQL_DUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug26121.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug26121.sql +--remove_file $MYSQLTEST_VARDIR/tmp/bug26121.sql + --echo # --echo # End of 5.1 tests --echo # From dd0c20ac289b6257c59c4867bb15aafec0db3f22 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 00:38:57 +0400 Subject: [PATCH 600/789] 3d attempt to fix information_schema.test failure on HP-UX. Apparently it's the only platform in pushbuild where we compile without openssl. mysql-test/r/information_schema.result: Update results. mysql-test/r/openssl_1.result: Update results. mysql-test/t/information_schema.test: Move the part of the test case that needs SSL support to openssl_1.test mysql-test/t/openssl_1.test: Add a test case that needs SSL support. --- mysql-test/r/information_schema.result | 11 -------- mysql-test/r/openssl_1.result | 22 +++++++++++++++ mysql-test/t/information_schema.test | 17 ++---------- mysql-test/t/openssl_1.test | 37 ++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 3453a486da9..c04b0a0ac47 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1408,7 +1408,6 @@ select user,db from information_schema.processlist; user db user3148 test drop user user3148@localhost; -DROP TABLE IF EXISTS thread_status; DROP TABLE IF EXISTS server_status; DROP EVENT IF EXISTS event_status; SET GLOBAL event_scheduler=1; @@ -1417,26 +1416,16 @@ ON SCHEDULE AT NOW() ON COMPLETION NOT PRESERVE DO BEGIN -CREATE TABLE thread_status -SELECT variable_name, variable_value -FROM information_schema.session_status -WHERE variable_name LIKE 'SSL_ACCEPTS' OR -variable_name LIKE 'SSL_CALLBACK_CACHE_HITS'; CREATE TABLE server_status SELECT variable_name FROM information_schema.global_status WHERE variable_name LIKE 'ABORTED_CONNECTS' OR variable_name LIKE 'BINLOG_CACHE_DISK_USE'; END$$ -SELECT variable_name, variable_value FROM thread_status; -variable_name variable_value -SSL_ACCEPTS 0.0000000 -SSL_CALLBACK_CACHE_HITS 0.0000000 SELECT variable_name FROM server_status; variable_name ABORTED_CONNECTS BINLOG_CACHE_DISK_USE -DROP TABLE thread_status; DROP TABLE server_status; SET GLOBAL event_scheduler=0; End of 5.1 tests. diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 34d8e3ab768..deb25ed1bb6 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -51,3 +51,25 @@ SSL error: Unable to get private key from '' mysqltest: Could not open connection 'default': 2026 SSL connection error SSL error: Unable to get certificate from '' mysqltest: Could not open connection 'default': 2026 SSL connection error +End of 5.0 tests +DROP TABLE IF EXISTS thread_status; +DROP EVENT IF EXISTS event_status; +SET GLOBAL event_scheduler=1; +CREATE EVENT event_status +ON SCHEDULE AT NOW() +ON COMPLETION NOT PRESERVE +DO +BEGIN +CREATE TABLE thread_status +SELECT variable_name, variable_value +FROM information_schema.session_status +WHERE variable_name LIKE 'SSL_ACCEPTS' OR +variable_name LIKE 'SSL_CALLBACK_CACHE_HITS'; +END$$ +SELECT variable_name, variable_value FROM thread_status; +variable_name variable_value +SSL_ACCEPTS 0.0000000 +SSL_CALLBACK_CACHE_HITS 0.0000000 +DROP TABLE thread_status; +SET GLOBAL event_scheduler=0; +End of 5.1 tests diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index ae330f47bc5..a49044e63c1 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1042,16 +1042,13 @@ select user,db from information_schema.processlist; connection default; drop user user3148@localhost; - - # -# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in Event +# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS +# in Event (see also openssl_1.test) # --disable_warnings -DROP TABLE IF EXISTS thread_status; DROP TABLE IF EXISTS server_status; DROP EVENT IF EXISTS event_status; - --enable_warnings SET GLOBAL event_scheduler=1; @@ -1063,12 +1060,6 @@ CREATE EVENT event_status ON COMPLETION NOT PRESERVE DO BEGIN - CREATE TABLE thread_status - SELECT variable_name, variable_value - FROM information_schema.session_status - WHERE variable_name LIKE 'SSL_ACCEPTS' OR - variable_name LIKE 'SSL_CALLBACK_CACHE_HITS'; - CREATE TABLE server_status SELECT variable_name FROM information_schema.global_status @@ -1079,15 +1070,11 @@ END$$ DELIMITER ;$$ let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_status'; -let $wait_timeout=30; --source include/wait_condition.inc -SELECT variable_name, variable_value FROM thread_status; SELECT variable_name FROM server_status; -DROP TABLE thread_status; DROP TABLE server_status; SET GLOBAL event_scheduler=0; --echo End of 5.1 tests. - diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 8772b8157e3..bbbbc7409b6 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -96,4 +96,41 @@ drop table t1; --error 1 --exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 +--echo End of 5.0 tests +# +# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in +# Event (see also information_schema.test for the other part of test for +# this bug). +# +--disable_warnings +DROP TABLE IF EXISTS thread_status; +DROP EVENT IF EXISTS event_status; +--enable_warnings + +SET GLOBAL event_scheduler=1; + +DELIMITER $$; + +CREATE EVENT event_status + ON SCHEDULE AT NOW() + ON COMPLETION NOT PRESERVE + DO +BEGIN + CREATE TABLE thread_status + SELECT variable_name, variable_value + FROM information_schema.session_status + WHERE variable_name LIKE 'SSL_ACCEPTS' OR + variable_name LIKE 'SSL_CALLBACK_CACHE_HITS'; +END$$ + +DELIMITER ;$$ + +let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_status'; +--source include/wait_condition.inc + +SELECT variable_name, variable_value FROM thread_status; + +DROP TABLE thread_status; +SET GLOBAL event_scheduler=0; +--echo End of 5.1 tests From a06ff97656cf8882cd87f23b206a92646be4fa0e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 01:53:15 +0400 Subject: [PATCH 601/789] A fix for events_trans.test failure on many hosts (5.1-runtime) sql/event_data_objects.cc: Disable an event if its data in the table is corrupted. sql/events.cc: A fix for events_trans failure on most of the hosts. A better error message if the event table is old (don't suggest it's corrupted, it may simply have bad data). --- sql/event_data_objects.cc | 1 + sql/events.cc | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 1881a3540e4..3d2a5b277fe 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1043,6 +1043,7 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table) status = Event_queue_element::SLAVESIDE_DISABLED; break; case 'D' : + default: status = Event_queue_element::DISABLED; break; } diff --git a/sql/events.cc b/sql/events.cc index 10a002121a0..200f46b7f7a 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -387,7 +387,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, if (check_db_dir_existence(parse_data->dbname.str)) { - my_error(ER_BAD_DB_ERROR, MYF(0)); + my_error(ER_BAD_DB_ERROR, MYF(0), parse_data->dbname.str); DBUG_RETURN(TRUE); } @@ -508,7 +508,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, /* Check that the target database exists */ if (check_db_dir_existence(new_dbname->str)) { - my_error(ER_BAD_DB_ERROR, MYF(0)); + my_error(ER_BAD_DB_ERROR, MYF(0), new_dbname->str); DBUG_RETURN(TRUE); } } @@ -1116,7 +1116,7 @@ Events::load_events_from_db(THD *thd) DBUG_ENTER("Events::load_events_from_db"); DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); - if ((ret= db_repository->open_event_table(thd, TL_WRITE, &table))) + if (db_repository->open_event_table(thd, TL_WRITE, &table)) { sql_print_error("Event Scheduler: Failed to open table mysql.event"); DBUG_RETURN(TRUE); @@ -1137,8 +1137,8 @@ Events::load_events_from_db(THD *thd) if (et->load_from_row(thd, table)) { sql_print_error("Event Scheduler: " - "Error while reading from mysql.event. " - "The table is probably corrupted"); + "Error while loading events from mysql.event. " + "The table probably contains bad data or is corrupted"); delete et; goto end; } From 93e7a470826e62f2a851d2db435e9f9361b2fb01 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 02:57:38 +0400 Subject: [PATCH 602/789] Fix events.test failure on manu pushbuild hosts (5.1-runtime). sql/event_db_repository.cc: Fix events.test failure on many pushbuild hosts (5.1-runtime). Make sure that when reading mysql.event the key number matches the field number that we're using to read by key. Also, print an error in case of a handler error (to not return 'Unknown error' when a table is corrupted to the user). --- sql/event_db_repository.cc | 52 ++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index fcd48757957..e3b45d5e0b2 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -310,38 +310,52 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, DBUG_PRINT("info", ("Using prefix scanning on PK")); event_table->file->ha_index_init(0, 1); - event_table->field[ET_FIELD_DB]->store(db, strlen(db), scs); key_info= event_table->key_info; + + if (key_info->key_parts == 0 || + key_info->key_part[0].field != event_table->field[ET_FIELD_DB]) + { + /* Corrupted table: no index or index on a wrong column */ + my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0), "event"); + ret= 1; + goto end; + } + + event_table->field[ET_FIELD_DB]->store(db, strlen(db), scs); key_len= key_info->key_part[0].store_length; if (!(key_buf= (byte *)alloc_root(thd->mem_root, key_len))) { - ret= 1; /* Don't send error, it would be done by sql_alloc_error_handler() */ + ret= 1; + goto end; } - else + + key_copy(key_buf, event_table->record[0], key_info, key_len); + if (!(ret= event_table->file->index_read(event_table->record[0], key_buf, + (key_part_map)1, HA_READ_PREFIX))) { - key_copy(key_buf, event_table->record[0], key_info, key_len); - if (!(ret= event_table->file->index_read(event_table->record[0], key_buf, - (key_part_map)1, HA_READ_PREFIX))) + DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret)); + do { - DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret)); - do - { - ret= copy_event_to_schema_table(thd, schema_table, event_table); - if (ret == 0) - ret= event_table->file->index_next_same(event_table->record[0], - key_buf, key_len); - } while (ret == 0); - } - DBUG_PRINT("info", ("Scan finished. ret=%d", ret)); + ret= copy_event_to_schema_table(thd, schema_table, event_table); + if (ret == 0) + ret= event_table->file->index_next_same(event_table->record[0], + key_buf, key_len); + } while (ret == 0); } - event_table->file->ha_index_end(); + DBUG_PRINT("info", ("Scan finished. ret=%d", ret)); + /* ret is guaranteed to be != 0 */ if (ret == HA_ERR_END_OF_FILE || ret == HA_ERR_KEY_NOT_FOUND) - DBUG_RETURN(FALSE); + ret= 0; + else + event_table->file->print_error(ret, MYF(0)); - DBUG_RETURN(TRUE); +end: + event_table->file->ha_index_end(); + + DBUG_RETURN(test(ret)); } From e739ca87433d358645d06d9eec913c835868e1ef Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 16:06:10 +0500 Subject: [PATCH 603/789] merging fix mysql-test/r/type_set.result: result fixed --- mysql-test/r/type_set.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index a75438293f6..877400ab7e1 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -82,6 +82,6 @@ Note 1291 Column 'f1' has duplicated value '1' in SET show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f1` set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1') default NULL + `f1` set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1') DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; From 9bc5135f81f1ab34175b4c70f660c2ad15fa4711 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 18:56:39 +0400 Subject: [PATCH 604/789] Polishing: add comments. sql/parse_file.cc: Add comments. --- sql/parse_file.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sql/parse_file.cc b/sql/parse_file.cc index 1351cf66161..aa352433141 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -719,14 +719,18 @@ nlist_err: /* parse parameters - + SYNOPSIS File_parser::parse() base base address for parameter writing (structure like TABLE) mem_root MEM_ROOT for parameters allocation parameters parameters description - required number of required parameters in above list + required number of parameters in the above list. If the file + contains more parameters than "required", they will + be ignored. If the file contains less parameters + then "required", non-existing parameters will + remain their values. hook hook called for unknown keys hook_data some data specific for the hook @@ -909,6 +913,13 @@ list_err: } } } + + /* + NOTE: if we read less than "required" parameters, it is still Ok. + Probably, we've just read the file of the previous version, which + contains less parameters. + */ + DBUG_RETURN(FALSE); } From c557623a68b2c09ec7fd319b6a58d624dd2c2413 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 19:44:14 +0400 Subject: [PATCH 605/789] Remove a race between Event Scheduler shutdown and SHOW PROCESSLIST. This will hopefully fix events.test failure on vmware-win32, where scheduling is very primitive. mysql-test/t/events_scheduling.test: This test case has no races now and can be enabled under valgrind. sql/event_scheduler.cc: Make Event Scheduler thread shutdown more synchronous: report successful shutdown only after having removed the scheduler thread from the global list of threads. This ensures that after the scheduler has been stopped, its thread is not present in SHOW PROCESSLIST output. --- mysql-test/t/events_scheduling.test | 1 - sql/event_scheduler.cc | 24 +++++++----------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index 5b839e25910..31c09a3d561 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -1,6 +1,5 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc --- source include/not_valgrind.inc CREATE DATABASE IF NOT EXISTS events_test; USE events_test; diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index fa5cde9a43a..0603a299079 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -154,8 +154,6 @@ deinit_event_thread(THD *thd) thread_running--; delete thd; pthread_mutex_unlock(&LOCK_thread_count); - - my_thread_end(); } @@ -231,8 +229,7 @@ event_scheduler_thread(void *arg) if (!res) scheduler->run(thd); - deinit_event_thread(thd); - pthread_exit(0); + my_thread_end(); DBUG_RETURN(0); // Against gcc warnings } @@ -260,6 +257,7 @@ event_worker_thread(void *arg) Event_worker_thread worker_thread; worker_thread.run(thd, event); + my_thread_end(); return 0; // Can't return anything here } @@ -494,12 +492,14 @@ Event_scheduler::run(THD *thd) } DBUG_PRINT("info", ("state=%s", scheduler_states_names[state].str)); } + LOCK_DATA(); - DBUG_PRINT("info", ("Signalling back to the stopper COND_state")); + deinit_event_thread(thd); + scheduler_thd= NULL; state= INITIALIZED; + DBUG_PRINT("info", ("Signalling back to the stopper COND_state")); pthread_cond_signal(&COND_state); UNLOCK_DATA(); - sql_print_information("Event Scheduler: Stopped"); DBUG_RETURN(res); } @@ -651,17 +651,7 @@ Event_scheduler::stop() COND_STATE_WAIT(thd, NULL, "Waiting scheduler to stop"); } while (state == STOPPING); DBUG_PRINT("info", ("Scheduler thread has cleaned up. Set state to INIT")); - /* - The rationale behind setting it to NULL here but not destructing it - beforehand is because the THD will be deinited in event_scheduler_thread(). - It's more clear when the post_init and the deinit is done in one function. - Here we just mark that the scheduler doesn't have a THD anymore. Though for - milliseconds the old thread could exist we can't use it anymore. When we - unlock the mutex in this function a little later the state will be - INITIALIZED. Therefore, a connection thread could enter the critical section - and will create a new THD object. - */ - scheduler_thd= NULL; + sql_print_information("Event Scheduler: Stopped"); end: UNLOCK_DATA(); DBUG_RETURN(FALSE); From 52b86a6e0a9be6f3c41f24b9c30d2b6f885ad94f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 20:21:30 +0400 Subject: [PATCH 606/789] Polishing: note added. --- sql/sp_head.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 1f44fa6639c..21225d82188 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -954,6 +954,12 @@ sp_head::execute(THD *thd) m_first_instance->m_last_cached_sp == this) || (m_recursion_level + 1 == m_next_cached_sp->m_recursion_level)); + /* + NOTE: The SQL Standard does not specify the context that should be + preserved for stored routines. However, at SAP/Walldorf meeting it was + decided that current database should be preserved. + */ + if (m_db.length && (err_status= sp_use_new_db(thd, m_db, &old_db, 0, &dbchanged))) goto done; From 35a0f4723418eae8b30fb375bfd6a5de9ef85ecf Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Apr 2007 00:13:27 +0400 Subject: [PATCH 607/789] Bug#27586: Wrong autoinc value assigned by LOAD DATA in the NO_AUTO_VALUE_ON_ZERO mode. The table->auto_increment_field_not_null variable wasn't reset after reading a row which may lead to inserting a wrong value to the auto-increment field to the following row. The table->auto_increment_field_not_null variable is reset now right after a row is being written in the read_fixed_length() and the read_sep_field() functions. Removed wrong setting of the table->auto_increment_field_not_null variable in the read_sep_field() function. mysql-test/t/loaddata.test: Added a test case for the bug#27586: Wrong autoinc value assigned by LOAD DATA in the NO_AUTO_VALUE_ON_ZERO mode. mysql-test/r/loaddata.result: Added a test case for the bug#27586: Wrong autoinc value assigned by LOAD DATA in the NO_AUTO_VALUE_ON_ZERO mode. sql/sql_load.cc: Bug#27586: Wrong autoinc value assigned by LOAD DATA in the NO_AUTO_VALUE_ON_ZERO mode. The table->auto_increment_field_not_null variable is reset now right after a row is being written in the read_fixed_length() and the read_sep_field() functions. Remove wrong setting of the table->auto_increment_field_not_null variable in the read_sep_field() function. --- mysql-test/r/loaddata.result | 9 +++++++++ mysql-test/t/loaddata.test | 16 ++++++++++++++++ sql/sql_load.cc | 15 ++++++++------- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index bef483569d4..0478e48025f 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -156,3 +156,12 @@ select load_file("MYSQL_TEST_DIR/t/loaddata.test"); load_file("MYSQL_TEST_DIR/t/loaddata.test") NULL drop table t1, t2; +create table t1(f1 int); +insert into t1 values(1),(null); +create table t2(f2 int auto_increment primary key); +select * from t2; +f2 +1 +2 +SET @@SQL_MODE=@OLD_SQL_MODE; +drop table t1,t2; diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 125a65826ca..e6788cd7798 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -136,4 +136,20 @@ eval select load_file("$MYSQL_TEST_DIR/t/loaddata.test"); # cleanup drop table t1, t2; +# +# Bug#27586: Wrong autoinc value assigned by LOAD DATA in the +# NO_AUTO_VALUE_ON_ZERO mode +# +create table t1(f1 int); +insert into t1 values(1),(null); +create table t2(f2 int auto_increment primary key); +disable_query_log; +eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1; +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; +eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2; +enable_query_log; +select * from t2; +--exec rm $MYSQLTEST_VARDIR/tmp/t1 +SET @@SQL_MODE=@OLD_SQL_MODE; +drop table t1,t2; # End of 5.0 tests diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 7a535381c01..e06235847ea 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -532,7 +532,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, Item_field *sql_field; TABLE *table= table_list->table; ulonglong id; - bool no_trans_update; + bool no_trans_update, err; DBUG_ENTER("read_fixed_length"); id= 0; @@ -624,7 +624,9 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, DBUG_RETURN(-1); } - if (write_record(thd, table, &info)) + err= write_record(thd, table, &info); + table->auto_increment_field_not_null= FALSE; + if (err) DBUG_RETURN(1); thd->no_trans_update= no_trans_update; @@ -669,7 +671,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, TABLE *table= table_list->table; uint enclosed_length; ulonglong id; - bool no_trans_update; + bool no_trans_update, err; DBUG_ENTER("read_sep_field"); enclosed_length=enclosed.length(); @@ -716,8 +718,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, DBUG_RETURN(1); } field->set_null(); - if (field == table->next_number_field) - table->auto_increment_field_not_null= TRUE; if (!field->maybe_null()) { if (field->type() == FIELD_TYPE_TIMESTAMP) @@ -803,8 +803,9 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, DBUG_RETURN(-1); } - - if (write_record(thd, table, &info)) + err= write_record(thd, table, &info); + table->auto_increment_field_not_null= FALSE; + if (err) DBUG_RETURN(1); /* If auto_increment values are used, save the first one for From 375bb35ea144d8268a93b6b7f052aa59c701ad8b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Apr 2007 00:28:09 +0200 Subject: [PATCH 608/789] disabled test and feature --- mysql-test/t/disabled.def | 2 ++ sql/ha_ndbcluster.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index fd64becbc00..5011fcbb7d4 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -36,3 +36,5 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb plugin : Bug#25659 memory leak via "plugins" test rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly + +rpl_ndb_stm_innodb : Bug#26783 diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 4f555c543a9..d12f94c6967 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4166,6 +4166,8 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd, extern MASTER_INFO *active_mi; static int ndbcluster_update_apply_status(THD *thd, int do_update) { + return 0; + Thd_ndb *thd_ndb= get_thd_ndb(thd); Ndb *ndb= thd_ndb->ndb; NDBDICT *dict= ndb->getDictionary(); From e6e1ce7abca03736a4c1fb187ce522ef6d817bb9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Apr 2007 04:14:44 +0200 Subject: [PATCH 609/789] mysql.spec.sh: Removed man page for "mysql_create_system_tables" support-files/mysql.spec.sh: Removed man page for "mysql_create_system_tables" --- support-files/mysql.spec.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 39e3ada88d6..54e2a6adba6 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -556,7 +556,6 @@ fi %attr(755, root, root) %{_bindir}/myisamlog %attr(755, root, root) %{_bindir}/myisampack %attr(755, root, root) %{_bindir}/mysql_convert_table_format -%attr(755, root, root) %{_bindir}/mysql_create_system_tables %attr(755, root, root) %{_bindir}/mysql_explain_log %attr(755, root, root) %{_bindir}/mysql_fix_extensions %attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables @@ -716,6 +715,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Sat Apr 07 2007 Kent Boortz + +- Removed man page for "mysql_create_system_tables" + * Wed Mar 21 2007 Daniel Fischer - Add debug server. From 795121926ef797fd9988ee65b97b16af0ace9af8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Apr 2007 11:31:49 +0500 Subject: [PATCH 610/789] test temporarily disabled --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index fd64becbc00..f536521f830 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -36,3 +36,4 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb plugin : Bug#25659 memory leak via "plugins" test rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly +ndb_partition_error2 : HF's not sure if the test can work as internded on all the platforms From 3f0c44c605c6e6f9e3bbb92f7a43a598be5d5b1b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Apr 2007 23:16:03 +0500 Subject: [PATCH 611/789] after-merging fix mysql-test/r/events_trans.result: result fixed mysql-test/r/windows.result: merging fix mysql-test/t/events_trans.test: moved to events_trans_notembedded.test mysql-test/r/events_trans_notembedded.result: New BitKeeper file ``mysql-test/r/events_trans_notembedded.result'' mysql-test/t/events_trans_notembedded.test: New BitKeeper file ``mysql-test/t/events_trans_notembedded.test'' --- mysql-test/r/events_trans.result | 41 ------------- mysql-test/r/events_trans_notembedded.result | 45 +++++++++++++++ mysql-test/r/windows.result | 4 +- mysql-test/t/events_trans.test | 44 -------------- mysql-test/t/events_trans_notembedded.test | 61 ++++++++++++++++++++ 5 files changed, 108 insertions(+), 87 deletions(-) create mode 100644 mysql-test/r/events_trans_notembedded.result create mode 100644 mysql-test/t/events_trans_notembedded.test diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result index 145fb8be084..a9829db0c61 100644 --- a/mysql-test/r/events_trans.result +++ b/mysql-test/r/events_trans.result @@ -1,5 +1,4 @@ drop database if exists events_test; -drop database if exists mysqltest_db2; drop database if exists mysqltest_no_such_database; create database events_test; use events_test; @@ -116,44 +115,4 @@ a OK: create event: database does not exist delete from t1; commit work; -grant create, insert, select, delete on mysqltest_db2.* -to mysqltest_user1@localhost; -create database mysqltest_db2; -set autocommit=off; -select @@autocommit; -@@autocommit -0 -create table t1 (a varchar(255)) engine=innodb; -begin work; -insert into t1 (a) values ("OK: create event: insufficient privileges"); -create event e1 on schedule every 1 day do select 1; -ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' -rollback work; -select * from t1; -a -OK: create event: insufficient privileges -delete from t1; -commit work; -begin work; -insert into t1 (a) values ("OK: alter event: insufficient privileges"); -alter event e1 on schedule every 1 day do select 1; -ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' -rollback work; -select * from t1; -a -OK: alter event: insufficient privileges -delete from t1; -commit work; -begin work; -insert into t1 (a) values ("OK: drop event: insufficient privileges"); -drop event e1; -ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' -rollback work; -select * from t1; -a -OK: drop event: insufficient privileges -delete from t1; -commit work; -drop user mysqltest_user1@localhost; -drop database mysqltest_db2; drop database events_test; diff --git a/mysql-test/r/events_trans_notembedded.result b/mysql-test/r/events_trans_notembedded.result new file mode 100644 index 00000000000..1e3dfffe232 --- /dev/null +++ b/mysql-test/r/events_trans_notembedded.result @@ -0,0 +1,45 @@ +drop database if exists events_test; +drop database if exists mysqltest_db2; +create database events_test; +use events_test; +grant create, insert, select, delete on mysqltest_db2.* +to mysqltest_user1@localhost; +create database mysqltest_db2; +set autocommit=off; +select @@autocommit; +@@autocommit +0 +create table t1 (a varchar(255)) engine=innodb; +begin work; +insert into t1 (a) values ("OK: create event: insufficient privileges"); +create event e1 on schedule every 1 day do select 1; +ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' +rollback work; +select * from t1; +a +OK: create event: insufficient privileges +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: alter event: insufficient privileges"); +alter event e1 on schedule every 1 day do select 1; +ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' +rollback work; +select * from t1; +a +OK: alter event: insufficient privileges +delete from t1; +commit work; +begin work; +insert into t1 (a) values ("OK: drop event: insufficient privileges"); +drop event e1; +ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' +rollback work; +select * from t1; +a +OK: drop event: insufficient privileges +delete from t1; +commit work; +drop user mysqltest_user1@localhost; +drop database mysqltest_db2; +drop database events_test; diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result index 423123692e5..af1977bacbc 100644 --- a/mysql-test/r/windows.result +++ b/mysql-test/r/windows.result @@ -35,9 +35,9 @@ PARTITION BY RANGE (MONTH(SALES_DATE)) ( PARTITION p0 VALUES LESS THAN (2) ENGINE=INNODB data DIRECTORY='c:/tmp/' - index DIRECTORY = 'c:/tmp/', + index DIRECTORY = 'c:/tmp/', PARTITION p1 VALUES LESS THAN (3) ENGINE=INNODB data DIRECTORY='c:/tmp/' - index DIRECTORY = 'c:/tmp/' + index DIRECTORY = 'c:/tmp/' ); drop table t1; diff --git a/mysql-test/t/events_trans.test b/mysql-test/t/events_trans.test index 41044f9975f..77427070cbb 100644 --- a/mysql-test/t/events_trans.test +++ b/mysql-test/t/events_trans.test @@ -4,7 +4,6 @@ -- source include/have_innodb.inc --disable_warnings drop database if exists events_test; -drop database if exists mysqltest_db2; drop database if exists mysqltest_no_such_database; --enable_warnings create database events_test; @@ -108,49 +107,6 @@ rollback work; select * from t1; delete from t1; commit work; -# -# Privilege checks -# -grant create, insert, select, delete on mysqltest_db2.* - to mysqltest_user1@localhost; -create database mysqltest_db2; -connect (conn1,localhost,mysqltest_user1,,mysqltest_db2); -set autocommit=off; -# Sanity check -select @@autocommit; -create table t1 (a varchar(255)) engine=innodb; -# Not enough privileges to CREATE EVENT -begin work; -insert into t1 (a) values ("OK: create event: insufficient privileges"); ---error ER_DBACCESS_DENIED_ERROR -create event e1 on schedule every 1 day do select 1; -rollback work; -select * from t1; -delete from t1; -commit work; -# Not enough privileges to ALTER EVENT -begin work; -insert into t1 (a) values ("OK: alter event: insufficient privileges"); ---error ER_DBACCESS_DENIED_ERROR -alter event e1 on schedule every 1 day do select 1; -rollback work; -select * from t1; -delete from t1; -commit work; -# Not enough privileges to DROP EVENT -begin work; -insert into t1 (a) values ("OK: drop event: insufficient privileges"); ---error ER_DBACCESS_DENIED_ERROR -drop event e1; -rollback work; -select * from t1; -delete from t1; -commit work; -# Cleanup -disconnect conn1; -connection default; -drop user mysqltest_user1@localhost; -drop database mysqltest_db2; # # Cleanup diff --git a/mysql-test/t/events_trans_notembedded.test b/mysql-test/t/events_trans_notembedded.test new file mode 100644 index 00000000000..adc293d7e79 --- /dev/null +++ b/mysql-test/t/events_trans_notembedded.test @@ -0,0 +1,61 @@ +# +# Tests that require transactions +# +-- source include/not_embedded.inc +-- source include/have_innodb.inc +--disable_warnings +drop database if exists events_test; +drop database if exists mysqltest_db2; +--enable_warnings +create database events_test; +use events_test; + +# +# Privilege checks +# +grant create, insert, select, delete on mysqltest_db2.* + to mysqltest_user1@localhost; +create database mysqltest_db2; +connect (conn1,localhost,mysqltest_user1,,mysqltest_db2); +set autocommit=off; +# Sanity check +select @@autocommit; +create table t1 (a varchar(255)) engine=innodb; +# Not enough privileges to CREATE EVENT +begin work; +insert into t1 (a) values ("OK: create event: insufficient privileges"); +--error ER_DBACCESS_DENIED_ERROR +create event e1 on schedule every 1 day do select 1; +rollback work; +select * from t1; +delete from t1; +commit work; +# Not enough privileges to ALTER EVENT +begin work; +insert into t1 (a) values ("OK: alter event: insufficient privileges"); +--error ER_DBACCESS_DENIED_ERROR +alter event e1 on schedule every 1 day do select 1; +rollback work; +select * from t1; +delete from t1; +commit work; +# Not enough privileges to DROP EVENT +begin work; +insert into t1 (a) values ("OK: drop event: insufficient privileges"); +--error ER_DBACCESS_DENIED_ERROR +drop event e1; +rollback work; +select * from t1; +delete from t1; +commit work; +# Cleanup +disconnect conn1; +connection default; +drop user mysqltest_user1@localhost; +drop database mysqltest_db2; + +# +# Cleanup +# +drop database events_test; + From a1576f9209993517cfbbc64e3a7d4ba4edb4dbb5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Apr 2007 00:05:34 +0500 Subject: [PATCH 612/789] merging fix mysql-test/r/windows.result: result fixed --- mysql-test/r/windows.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result index af1977bacbc..9f3828bff61 100644 --- a/mysql-test/r/windows.result +++ b/mysql-test/r/windows.result @@ -40,4 +40,4 @@ PARTITION p1 VALUES LESS THAN (3) ENGINE=INNODB data DIRECTORY='c:/tmp/' index DIRECTORY = 'c:/tmp/' ); -drop table t1; +DROP TABLE t1; From 33ac50f0769a01028bdb57a741eb449140ca5504 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Apr 2007 17:53:10 +0500 Subject: [PATCH 613/789] bug#27608 XML output is not well-formed Problem: output was empty if the result is empty. Fix: print XML header and footer, even if the result is empty, to produce well-formed XML output. client/mysql.cc: Print header and footer even on empty set, when --xml mysql-test/r/client_xml.result: Adding test case mysql-test/t/client_xml.test: Adding test case --- client/mysql.cc | 11 +++++++++ mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++ mysql-test/r/client_xml.result | 14 +++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++ mysql-test/t/client_xml.test | 2 ++ 5 files changed, 100 insertions(+) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/client/mysql.cc b/client/mysql.cc index 510420fdf3d..6b37bb7b6f5 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2117,6 +2117,17 @@ com_go(String *buffer,char *line __attribute__((unused))) if (!mysql_num_rows(result) && ! quick && !info_flag) { strmov(buff, "Empty set"); + if (opt_xml) + { + /* + We must print XML header and footer + to produce a well-formed XML even if + the result set is empty (Bug#27608). + */ + init_pager(); + print_table_data_xml(result); + end_pager(); + } } else { diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index 6a148954fcd..ed5e8f2c1b8 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -71,4 +71,18 @@ insert into t1 values (1, 2, 'a&b ab'); + + + +-------------- +select 1 limit 0 +-------------- + + + + +Empty set + +Bye drop table t1; diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/client_xml.test b/mysql-test/t/client_xml.test index 017b7a1569a..8ee63a6131b 100644 --- a/mysql-test/t/client_xml.test +++ b/mysql-test/t/client_xml.test @@ -17,5 +17,7 @@ insert into t1 values (1, 2, 'a&b ab'); --exec $MYSQL --xml test -e "select 1 > 2 from dual" --exec $MYSQL --xml test -e "select 1 & 3 from dual" --exec $MYSQL --xml test -e "select null from dual" +--exec $MYSQL --xml test -e "select 1 limit 0" +--exec $MYSQL --xml test -vv -e "select 1 limit 0" drop table t1; From 8e2b68c3cdf44b899b71829b90f4cb1a3fec53bd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Apr 2007 17:58:56 +0500 Subject: [PATCH 614/789] Bug#22648 LC_TIME_NAMES: Setting GLOBAL has no effect Problem: setting/displaying @@LC_TIME_NAMES didn't distinguish between GLOBAL and SESSION variable types - always SESSION variable was set/shonw. Fix: set either global or session value. Also, "mysqld --lc-time-names" was added to set "global default" value. mysql-test/r/variables.result: Adding test cases mysql-test/t/variables.test: Adding test cases sql/mysql_priv.h: Declaring variable for global default. sql/mysqld.cc: Adding --lc-time-names sql/set_var.cc: Distinguish between GLOBAL and SESSION variables. sql/sql_class.cc: Don't initialize to en_US, use global_system_variables value instead. --- mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++ mysql-test/r/variables.result | 31 +++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++ mysql-test/t/variables.test | 24 ++++++++++++++++++ sql/mysql_priv.h | 1 + sql/mysqld.cc | 19 ++++++++++++++- sql/set_var.cc | 14 ++++++++--- sql/sql_class.cc | 1 - 8 files changed, 158 insertions(+), 5 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 60010183d32..3d76f8e4a90 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -637,6 +637,37 @@ set lc_time_names=0; select @@lc_time_names; @@lc_time_names en_US +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +en_US en_US +set @@global.lc_time_names=fr_FR; +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +fr_FR en_US +New connection +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +fr_FR fr_FR +set @@lc_time_names=ru_RU; +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +fr_FR ru_RU +Returnung to default connection +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +fr_FR en_US +set lc_time_names=default; +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +fr_FR fr_FR +set @@global.lc_time_names=default; +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +en_US fr_FR +set @@lc_time_names=default; +select @@global.lc_time_names, @@lc_time_names; +@@global.lc_time_names @@lc_time_names +en_US en_US set @test = @@query_prealloc_size; set @@query_prealloc_size = @test; select @@query_prealloc_size = @test; diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 697e55945ef..0ad85a32568 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -504,6 +504,30 @@ select @@lc_time_names; set lc_time_names=0; select @@lc_time_names; +# +# Bug #22648 LC_TIME_NAMES: Setting GLOBAL has no effect +# +select @@global.lc_time_names, @@lc_time_names; +set @@global.lc_time_names=fr_FR; +select @@global.lc_time_names, @@lc_time_names; +--echo New connection +connect (con1,localhost,root,,); +connection con1; +select @@global.lc_time_names, @@lc_time_names; +set @@lc_time_names=ru_RU; +select @@global.lc_time_names, @@lc_time_names; +disconnect con1; +connection default; +--echo Returnung to default connection +select @@global.lc_time_names, @@lc_time_names; +set lc_time_names=default; +select @@global.lc_time_names, @@lc_time_names; +set @@global.lc_time_names=default; +select @@global.lc_time_names, @@lc_time_names; +set @@lc_time_names=default; +select @@global.lc_time_names, @@lc_time_names; + + # # Bug #13334: query_prealloc_size default less than minimum # diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index de567eacbeb..f9aa8441a27 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -149,6 +149,7 @@ typedef struct my_locale_st extern MY_LOCALE my_locale_en_US; extern MY_LOCALE *my_locales[]; +extern MY_LOCALE *my_default_lc_time_names; MY_LOCALE *my_locale_by_name(const char *name); MY_LOCALE *my_locale_by_number(uint number); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b0fc5a30ff5..2a42af8450f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -315,6 +315,7 @@ static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr; static char *opt_init_slave, *language_ptr, *opt_init_connect; static char *default_character_set_name; static char *character_set_filesystem_name; +static char *lc_time_names_name; static char *my_bind_addr_str; static char *default_collation_name; static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME; @@ -495,6 +496,8 @@ CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; CHARSET_INFO *character_set_filesystem; +MY_LOCALE *my_default_lc_time_names; + SHOW_COMP_OPTION have_isam; SHOW_COMP_OPTION have_raid, have_ssl, have_symlink, have_query_cache; SHOW_COMP_OPTION have_geometry, have_rtree_keys, have_dlopen; @@ -2826,6 +2829,14 @@ static int init_common_variables(const char *conf_file_name, int argc, return 1; global_system_variables.character_set_filesystem= character_set_filesystem; + if (!(my_default_lc_time_names= + my_locale_by_name(lc_time_names_name))) + { + sql_print_error("Unknown locale: '%s'", MYF(0), lc_time_names_name); + return 1; + } + global_system_variables.lc_time_names= my_default_lc_time_names; + sys_init_connect.value_length= 0; if ((sys_init_connect.value= opt_init_connect)) sys_init_connect.value_length= strlen(opt_init_connect); @@ -4749,6 +4760,7 @@ enum options_mysqld OPT_DEFAULT_COLLATION, OPT_CHARACTER_SET_CLIENT_HANDSHAKE, OPT_CHARACTER_SET_FILESYSTEM, + OPT_LC_TIME_NAMES, OPT_INIT_CONNECT, OPT_INIT_SLAVE, OPT_SECURE_AUTH, @@ -5078,6 +5090,11 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, "Client error messages in given language. May be given as a full path.", (gptr*) &language_ptr, (gptr*) &language_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"lc-time-names", OPT_LC_TIME_NAMES, + "Set the language used for the month names and the days of the week.", + (gptr*) &lc_time_names_name, + (gptr*) &lc_time_names_name, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).", (gptr*) &opt_local_infile, @@ -6552,7 +6569,7 @@ static void mysql_init_variables(void) default_collation_name= compiled_default_collation_name; sys_charset_system.value= (char*) system_charset_info->csname; character_set_filesystem_name= (char*) "binary"; - + lc_time_names_name= (char*) "en_US"; /* Set default values for some option variables */ global_system_variables.table_type= DB_TYPE_MYISAM; diff --git a/sql/set_var.cc b/sql/set_var.cc index 46c2a775d8a..d4dcfafe522 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2825,7 +2825,10 @@ bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var) bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var) { - thd->variables.lc_time_names= var->save_result.locale_value; + if (var->type == OPT_GLOBAL) + global_system_variables.lc_time_names= var->save_result.locale_value; + else + thd->variables.lc_time_names= var->save_result.locale_value; return 0; } @@ -2833,13 +2836,18 @@ bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var) byte *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { - return (byte *)(thd->variables.lc_time_names->name); + return type == OPT_GLOBAL ? + (byte *) global_system_variables.lc_time_names->name : + (byte *) thd->variables.lc_time_names->name; } void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type) { - thd->variables.lc_time_names = &my_locale_en_US; + if (type == OPT_GLOBAL) + global_system_variables.lc_time_names= my_default_lc_time_names; + else + thd->variables.lc_time_names= global_system_variables.lc_time_names; } /* diff --git a/sql/sql_class.cc b/sql/sql_class.cc index a94f903a47b..6f3b7433860 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -343,7 +343,6 @@ void THD::init(void) total_warn_count= 0; update_charset(); bzero((char *) &status_var, sizeof(status_var)); - variables.lc_time_names = &my_locale_en_US; } From eaff83cb0ace80ec2165d5dba9b45284b4500e15 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 10:05:01 +0200 Subject: [PATCH 615/789] ndb - bug#27728 (5.1) Make sure API is connected to nodes when subscribing storage/ndb/include/kernel/signaldata/SumaImpl.hpp: new error code storage/ndb/src/kernel/blocks/suma/Suma.cpp: make sure API is connected in SUB_START_REQ storage/ndb/src/ndbapi/ndberror.c: new error code --- storage/ndb/include/kernel/signaldata/SumaImpl.hpp | 3 ++- storage/ndb/src/kernel/blocks/suma/Suma.cpp | 10 ++++++++++ storage/ndb/src/ndbapi/ndberror.c | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp index 077ea8e879c..072c3955ac4 100644 --- a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp +++ b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -119,7 +119,8 @@ struct SubStartRef { Undefined = 1, NF_FakeErrorREF = 11, Busy = 701, - NotMaster = 702 + NotMaster = 702, + PartiallyConnected = 1421 }; STATIC_CONST( SignalLength = 7 ); diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index 1197ffdad94..717448ca03b 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -2394,6 +2394,16 @@ Suma::execSUB_START_REQ(Signal* signal){ sendSubStartRef(signal, 1412); DBUG_VOID_RETURN; } + + if (c_startup.m_restart_server_node_id == 0 && + !c_connected_nodes.get(refToNode(subscriberRef))) + + { + jam(); + sendSubStartRef(signal, SubStartRef::PartiallyConnected); + return; + } + DBUG_PRINT("info",("c_subscriberPool size: %d free: %d", c_subscriberPool.getSize(), c_subscriberPool.getNoOfFree())); diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c index 13e6c95644c..ed3829ed74f 100644 --- a/storage/ndb/src/ndbapi/ndberror.c +++ b/storage/ndb/src/ndbapi/ndberror.c @@ -490,6 +490,7 @@ ErrorBundle ErrorCodes[] = { { 1419, DMEC, SE, "Subscription already dropped" }, { 1420, DMEC, TR, "Subscriber manager busy with adding/removing a table" }, + { 1421, DMEC, SE, "Partially connected API in NdbOperation::execute()" }, { 4004, DMEC, AE, "Attribute name or id not found in the table" }, From 01a007a5663adf2d63fbfbb55138642eb624fd1e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 10:15:35 +0200 Subject: [PATCH 616/789] ndb - bug#27651 (5.1) Only prepare "next" GCI if we're in the first 4 highest GCI's to avoid we can get several buckets with same GCI storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: Only prepare "next" GCI if we're in the first 4 highest GCI's to avoid we can get several buckets with same GCI --- .../ndb/src/ndbapi/NdbEventOperationImpl.cpp | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp index 828ba51bc21..b75bfb16dd2 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -979,7 +979,7 @@ NdbEventOperationImpl::printAll() NdbEventBuffer::NdbEventBuffer(Ndb *ndb) : m_system_nodes(ndb->theImpl->theNoOfDBnodes), m_ndb(ndb), - m_latestGCI(0), + m_latestGCI(0), m_latest_complete_GCI(0), m_total_alloc(0), m_free_thresh(10), m_min_free_thresh(10), @@ -1470,7 +1470,7 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep) , m_flush_gci #endif ); - + Uint32 idx = bucket - (Gci_container*)m_active_gci.getBase(); if (unlikely(bucket == 0)) { /** @@ -1515,8 +1515,20 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep) } reportStatus(); bzero(bucket, sizeof(Gci_container)); - bucket->m_gci = gci + ACTIVE_GCI_DIRECTORY_SIZE; - bucket->m_gcp_complete_rep_count = m_system_nodes; + if (likely(idx < ACTIVE_GCI_DIRECTORY_SIZE)) + { + /** + * Only "prepare" next GCI if we're in + * the first 4 highest GCI's...else + * this is somekind of "late" GCI... + * which is only initialized to 0 + * + * This to make sure we dont get several buckets with same GCI + */ + bucket->m_gci = gci + ACTIVE_GCI_DIRECTORY_SIZE; + bucket->m_gcp_complete_rep_count = m_system_nodes; + } + if(unlikely(m_latest_complete_GCI > gci)) { complete_outof_order_gcis(); From 05285a62ae635e42b787ab014128e84aea84abfb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 10:27:02 +0200 Subject: [PATCH 617/789] ndb - add event log listener test tool storage/ndb/test/tools/Makefile.am: add event log listener test tool storage/ndb/test/tools/log_listner.cpp: New BitKeeper file ``storage/ndb/test/tools/log_listner.cpp'' --- storage/ndb/test/tools/Makefile.am | 3 +- storage/ndb/test/tools/log_listner.cpp | 88 ++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 storage/ndb/test/tools/log_listner.cpp diff --git a/storage/ndb/test/tools/Makefile.am b/storage/ndb/test/tools/Makefile.am index 8c451c0b6a1..1ec6246ce74 100644 --- a/storage/ndb/test/tools/Makefile.am +++ b/storage/ndb/test/tools/Makefile.am @@ -13,7 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -ndbtest_PROGRAMS = hugoLoad hugoFill hugoLockRecords hugoPkDelete hugoPkRead hugoPkReadRecord hugoPkUpdate hugoScanRead hugoScanUpdate restart verify_index copy_tab create_index ndb_cpcc listen_event +ndbtest_PROGRAMS = hugoLoad hugoFill hugoLockRecords hugoPkDelete hugoPkRead hugoPkReadRecord hugoPkUpdate hugoScanRead hugoScanUpdate restart verify_index copy_tab create_index ndb_cpcc listen_event eventlog # transproxy @@ -33,6 +33,7 @@ copy_tab_SOURCES = copy_tab.cpp create_index_SOURCES = create_index.cpp ndb_cpcc_SOURCES = cpcc.cpp listen_event_SOURCES = listen.cpp +eventlog_SOURCES = log_listner.cpp include $(top_srcdir)/storage/ndb/config/common.mk.am include $(top_srcdir)/storage/ndb/config/type_ndbapitest.mk.am diff --git a/storage/ndb/test/tools/log_listner.cpp b/storage/ndb/test/tools/log_listner.cpp new file mode 100644 index 00000000000..c5125ef7414 --- /dev/null +++ b/storage/ndb/test/tools/log_listner.cpp @@ -0,0 +1,88 @@ +#include +#include +#include +#include + +NDB_STD_OPTS_VARS; + +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_logevent_listen"), + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void usage() +{ + char desc[] = + "tabname\n"\ + "This program list all properties of table(s) in NDB Cluster.\n"\ + " ex: desc T1 T2 T4\n"; + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} + +int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, + 15, NDB_MGM_EVENT_CATEGORY_CONNECTION, + 15, NDB_MGM_EVENT_CATEGORY_NODE_RESTART, + 15, NDB_MGM_EVENT_CATEGORY_STARTUP, + 15, NDB_MGM_EVENT_CATEGORY_SHUTDOWN, + 15, NDB_MGM_EVENT_CATEGORY_STATISTIC, + 15, NDB_MGM_EVENT_CATEGORY_ERROR, + 15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT, + 15, NDB_MGM_EVENT_CATEGORY_CONGESTION, + 0 }; + +int +main(int argc, char** argv) +{ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; +#ifndef DBUG_OFF + opt_debug= "d:t:O,/tmp/ndb_desc.trace"; +#endif + if ((ho_error=handle_options(&argc, &argv, my_long_options, + ndb_std_get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + + NdbMgmHandle handle= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(handle, opt_connect_str); + + while (true) + { + if (ndb_mgm_connect(handle,0,0,0) == -1) + { + ndbout_c("Failed to connect"); + exit(0); + } + + NdbLogEventHandle le = ndb_mgm_create_logevent_handle(handle, filter); + if (le == 0) + { + ndbout_c("Failed to create logevent handle"); + exit(0); + } + + struct ndb_logevent event; + while (true) + { + int r= ndb_logevent_get_next(le, &event,5000); + if (r < 0) + { + ndbout_c("Error while getting next event"); + break; + } + if (r == 0) + { + continue; + } + ndbout_c("Got event: %d", event.type); + } + + ndb_mgm_destroy_logevent_handle(&le); + ndb_mgm_disconnect(handle); + } + + return 0; +} From d6a3989a2325e8882fc0d725a220155e33af7ff4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 11:31:45 +0200 Subject: [PATCH 618/789] add a manual page back support-files/mysql.spec.sh: add mysql_install_db.1 back --- support-files/mysql.spec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 99fcfdc9b39..506cdf70604 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -556,6 +556,7 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1 %doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1* From 5ded16c5d0830b4b84830e3e17bc63dd099492aa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 15:01:04 +0500 Subject: [PATCH 619/789] Bug#27069 set with identical elements are created(additional fix) issue an error in strict mode if enum|set column has duplicates members in 'create table' mysql-test/r/strict.result: test case mysql-test/t/strict.test: test case sql/sql_table.cc: issue an error in strict mode if enum|set has duplicates members --- mysql-test/r/strict.result | 5 +++++ mysql-test/t/strict.test | 9 +++++++++ sql/sql_table.cc | 27 +++++++++++++++++++-------- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 636a00a4343..f9d84df5d9f 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1386,4 +1386,9 @@ ERROR 01000: Data truncated for column 'a' at row 1 insert into t1 values ('2E3x'); ERROR 01000: Data truncated for column 'a' at row 1 drop table t1; +set sql_mode='traditional'; +create table t1 (f1 set('a','a')); +ERROR HY000: Column 'f1' has duplicated value 'a' in SET +create table t1 (f1 enum('a','a')); +ERROR HY000: Column 'f1' has duplicated value 'a' in ENUM End of 5.0 tests diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 5e4d956527b..1792c0fccbc 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -1249,4 +1249,13 @@ insert into t1 values ('2000a'); insert into t1 values ('2E3x'); drop table t1; +# +# Bug#27069 set with identical elements are created +# +set sql_mode='traditional'; +--error 1291 +create table t1 (f1 set('a','a')); +--error 1291 +create table t1 (f1 enum('a','a')); + --echo End of 5.0 tests diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 607fc4c5040..f498d33191b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -414,10 +414,11 @@ static int sort_keys(KEY *a, KEY *b) which has some duplicates on its right RETURN VALUES - void + 0 ok + 1 Error */ -void check_duplicates_in_interval(const char *set_or_name, +bool check_duplicates_in_interval(const char *set_or_name, const char *name, TYPELIB *typelib, CHARSET_INFO *cs, unsigned int *dup_val_count) { @@ -433,6 +434,13 @@ void check_duplicates_in_interval(const char *set_or_name, tmp.count--; if (find_type2(&tmp, (const char*)*cur_value, *cur_length, cs)) { + if ((current_thd->variables.sql_mode & + (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))) + { + my_error(ER_DUPLICATED_VALUE_IN_TYPE, MYF(0), + name,*cur_value,set_or_name); + return 1; + } push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_NOTE, ER_DUPLICATED_VALUE_IN_TYPE, ER(ER_DUPLICATED_VALUE_IN_TYPE), @@ -440,6 +448,7 @@ void check_duplicates_in_interval(const char *set_or_name, (*dup_val_count)++; } } + return 0; } @@ -575,9 +584,10 @@ int prepare_create_field(create_field *sql_field, if (sql_field->charset->state & MY_CS_BINSORT) sql_field->pack_flag|=FIELDFLAG_BINARY; sql_field->unireg_check=Field::INTERVAL_FIELD; - check_duplicates_in_interval("ENUM",sql_field->field_name, - sql_field->interval, - sql_field->charset, &dup_val_count); + if (check_duplicates_in_interval("ENUM",sql_field->field_name, + sql_field->interval, + sql_field->charset, &dup_val_count)) + DBUG_RETURN(1); break; case FIELD_TYPE_SET: sql_field->pack_flag=pack_length_to_packflag(sql_field->pack_length) | @@ -585,9 +595,10 @@ int prepare_create_field(create_field *sql_field, if (sql_field->charset->state & MY_CS_BINSORT) sql_field->pack_flag|=FIELDFLAG_BINARY; sql_field->unireg_check=Field::BIT_FIELD; - check_duplicates_in_interval("SET",sql_field->field_name, - sql_field->interval, - sql_field->charset, &dup_val_count); + if (check_duplicates_in_interval("SET",sql_field->field_name, + sql_field->interval, + sql_field->charset, &dup_val_count)) + DBUG_RETURN(1); /* Check that count of unique members is not more then 64 */ if (sql_field->interval->count - dup_val_count > sizeof(longlong)*8) { From 9f5e640d303c63197ec53aead4da0766ce3af2ee Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 12:19:00 +0200 Subject: [PATCH 620/789] Give the "sync_slave_with_master" something to do --- mysql-test/r/rpl_ssl.result | 1 + mysql-test/t/rpl_ssl.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result index 17a16d5020d..baa6edf8373 100644 --- a/mysql-test/r/rpl_ssl.result +++ b/mysql-test/r/rpl_ssl.result @@ -57,6 +57,7 @@ STOP SLAVE; select * from t1; t 1 +insert into t1 values (NULL); show slave status; Slave_IO_State # Master_Host 127.0.0.1 diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test index 249ed16f931..07a7226fb79 100644 --- a/mysql-test/t/rpl_ssl.test +++ b/mysql-test/t/rpl_ssl.test @@ -54,6 +54,7 @@ while ($i) start slave; enable_query_log; connection master; +insert into t1 values (NULL); sync_slave_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 8 # 9 # 23 # 33 # From 5565d32936deb276b68f8cfcb3c25e4421ac94bf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 14:45:13 +0200 Subject: [PATCH 621/789] Add --logdir option ot mysqltest --- client/mysqltest.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 02993398b45..3d7e082897f 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -92,6 +92,7 @@ enum { static int record= 0, opt_sleep= -1; static char *db= 0, *pass= 0; const char *user= 0, *host= 0, *unix_sock= 0, *opt_basedir= "./"; +const char *opt_logdir= ""; const char *opt_include= 0, *opt_charsets_dir; static int port= 0; static int opt_max_connect_retries; @@ -1009,7 +1010,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname) die(NullS); if (!eval_result && (uint) stat_info.st_size != ds->length) { - DBUG_PRINT("info",("Size differs: result size: %u file size: %llu", + DBUG_PRINT("info",("Size differs: result size: %u file size: %lu", ds->length, stat_info.st_size)); DBUG_PRINT("info",("result: '%s'", ds->str)); DBUG_RETURN(RESULT_LENGTH_MISMATCH); @@ -4244,6 +4245,8 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include, (gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"logdir", 0, "Directory for log files", (gptr*) &opt_logdir, + (gptr*) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"mark-progress", OPT_MARK_PROGRESS, "Write linenumber and elapsed time to .progress ", (gptr*) &opt_mark_progress, (gptr*) &opt_mark_progress, 0, @@ -4546,15 +4549,18 @@ void dump_result_to_reject_file(char *buf, int size) void dump_result_to_log_file(char *buf, int size) { char log_file[FN_REFLEN]; - str_to_file(fn_format(log_file, result_file_name, "", ".log", + str_to_file(fn_format(log_file, result_file_name, opt_logdir, ".log", + *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : MY_REPLACE_EXT), buf, size); } void dump_progress(void) { - char log_file[FN_REFLEN]; - str_to_file(fn_format(log_file, result_file_name, "", ".progress", + char progress_file[FN_REFLEN]; + str_to_file(fn_format(progress_file, result_file_name, + opt_logdir, ".progress", + *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : MY_REPLACE_EXT), ds_progress.str, ds_progress.length); } @@ -4563,7 +4569,8 @@ void dump_warning_messages(void) { char warn_file[FN_REFLEN]; - str_to_file(fn_format(warn_file, result_file_name, "", ".warnings", + str_to_file(fn_format(warn_file, result_file_name, opt_logdir, ".warnings", + *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : MY_REPLACE_EXT), ds_warning_messages.str, ds_warning_messages.length); } From d75aa05538993927ccdba80641d092b319529bb5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 15:26:35 +0200 Subject: [PATCH 622/789] Bug#27171 mysqlbinlog produces different output depends from option -R a better fix, that works with 4.1 servers which don't send a fake Format_description_log_event. --- client/mysqlbinlog.cc | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index bb417293e8c..a371981e24d 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1042,7 +1042,7 @@ static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, uint logname_len; NET* net; int error= 0; - my_off_t old_off= min(start_position_mot, BIN_LOG_HEADER_SIZE); + my_off_t old_off= start_position_mot; char fname[FN_REFLEN+1]; DBUG_ENTER("dump_remote_log_entries"); @@ -1160,6 +1160,18 @@ could be out of memory"); len= 1; // fake Rotate, so don't increment old_off } } + else if (type == FORMAT_DESCRIPTION_EVENT) + { + /* + This could be an fake Format_description_log_event that server + (5.0+) automatically sends to a slave on connect, before sending + a first event at the requested position. If this is the case, + don't increment old_off. Real Format_description_log_event always + starts from BIN_LOG_HEADER_SIZE position. + */ + if (old_off != BIN_LOG_HEADER_SIZE) + len= 1; // fake event, don't increment old_off + } if ((error= process_event(print_event_info, ev, old_off))) { error= ((error < 0) ? 0 : 1); @@ -1172,16 +1184,16 @@ could be out of memory"); const char *old_fname= le->fname; uint old_len= le->fname_len; File file; - + if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0) { error= 1; goto err; } - + if ((error= process_event(print_event_info, ev, old_off))) { - my_close(file,MYF(MY_WME)); + my_close(file,MYF(MY_WME)); error= ((error < 0) ? 0 : 1); goto err; } @@ -1196,15 +1208,8 @@ could be out of memory"); /* Let's adjust offset for remote log as for local log to produce similar text and to have --stop-position to work identically. - - Exception - the server sends Format_description_log_event - in the beginning of the dump, and only after it the event from - start_position. Let the old_off reflect it. */ - if (old_off < start_position_mot) - old_off= start_position_mot; - else - old_off+= len-1; + old_off+= len-1; } err: From 041767e12319c1f4e72a862408f87e97bc6bd587 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 16:55:48 +0300 Subject: [PATCH 623/789] Bug #27659: The optimizer transforms DISTINCT into a GROUP BY when possible. It does that by constructing the same structure (a list of ORDER instances) the parser makes when parsing GROUP BY. While doing that it also eliminates duplicates. But if a duplicate is found it doesn't advance the pointer to ref_pointer array, so the next (and subsequent) ORDER structures point to the wrong element in the SELECT list. Fixed by advancing the pointer in ref_pointer_array even in the case of a duplicate. mysql-test/r/distinct.result: Bug #27659: test case mysql-test/t/distinct.test: Bug #27659: test case sql/sql_select.cc: Bug #27659: use correct ref_pointer_array element --- mysql-test/r/distinct.result | 14 ++++++++++++++ mysql-test/t/distinct.test | 13 +++++++++++++ sql/sql_select.cc | 5 ++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 3508a83a810..190e8595126 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -668,3 +668,17 @@ NULL 3 4 DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES(1,1),(1,2),(1,3); +SELECT DISTINCT a, b FROM t1; +a b +1 1 +1 2 +1 3 +SELECT DISTINCT a, a, b FROM t1; +a a b +1 1 1 +1 1 2 +1 1 3 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 476e4ce7735..7310f98cd16 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -540,3 +540,16 @@ EXPLAIN SELECT a FROM t1 GROUP BY a; SELECT a FROM t1 GROUP BY a; DROP TABLE t1; + +# +#Bug #27659: SELECT DISTINCT returns incorrect result set when field is +#repeated +# +# +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES(1,1),(1,2),(1,3); +SELECT DISTINCT a, b FROM t1; +SELECT DISTINCT a, a, b FROM t1; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d65ecb6fa3b..79ae4ade8ab 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13539,9 +13539,7 @@ create_distinct_group(THD *thd, Item **ref_pointer_array, ORDER *ord_iter; for (ord_iter= group; ord_iter; ord_iter= ord_iter->next) if ((*ord_iter->item)->eq(item, 1)) - break; - if (ord_iter) - continue; + goto next_item; ORDER *ord=(ORDER*) thd->calloc(sizeof(ORDER)); if (!ord) @@ -13556,6 +13554,7 @@ create_distinct_group(THD *thd, Item **ref_pointer_array, *prev=ord; prev= &ord->next; } +next_item: ref_pointer_array++; } *prev=0; From d66e47213d4553c76985ba5ef85b3bd8a249e5e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 18:01:29 +0300 Subject: [PATCH 624/789] Small fixes for merge. mysql-test/include/not_embedded.inc: Fixed a typo. mysql-test/lib/mtr_cases.pl: Fixed typo and wrong error message. mysql-test/r/binlog_statement_insert_delayed.result: Fixed result file. sql/event_db_repository.cc: Fixed type. sql/log.cc: Fixed type. --- mysql-test/include/not_embedded.inc | 2 +- mysql-test/lib/mtr_cases.pl | 4 ++-- mysql-test/r/binlog_statement_insert_delayed.result | 12 ++++++------ sql/event_db_repository.cc | 2 +- sql/log.cc | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-test/include/not_embedded.inc b/mysql-test/include/not_embedded.inc index fcc1756caab..360f268ad4f 100644 --- a/mysql-test/include/not_embedded.inc +++ b/mysql-test/include/not_embedded.inc @@ -1,5 +1,5 @@ -- require r/not_embedded.require disable_query_log; -select version() like N'%embedded%' as 'have_embedded'; +select version() like '%embedded%' as 'have_embedded'; enable_query_log; diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 28c78fbffeb..2c563f23e5a 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -534,7 +534,7 @@ sub collect_one_test_case($$$$$$$) { ! ( $tinfo->{'binlog_format'} eq $::used_binlog_format ) ) { $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "Not running with binlog format '$tinfo->{'binlog_format'}'"; + $tinfo->{'comment'}= "Requiring binlog format '$tinfo->{'binlog_format'}'"; return; } @@ -599,7 +599,7 @@ our @tags= ( ["include/have_innodb.inc", "innodb_test", 1], ["include/have_binlog_format_row.inc", "binlog_format", "row"], - ["include/have_binlog_format_statement.inc", "binlog_format", "stmt"], + ["include/have_binlog_format_statement.inc", "binlog_format", "statement"], ["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"], ["include/big_test.inc", "big_test", 1], ["include/have_debug.inc", "need_debug", 1], diff --git a/mysql-test/r/binlog_statement_insert_delayed.result b/mysql-test/r/binlog_statement_insert_delayed.result index 7a1b9a7ec9b..3a2dc441632 100644 --- a/mysql-test/r/binlog_statement_insert_delayed.result +++ b/mysql-test/r/binlog_statement_insert_delayed.result @@ -3,13 +3,13 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); -show binlog events from 102; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam -master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (207) -master-bin.000001 # Intvar 1 # INSERT_ID=208 -master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (null) -master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (300) +master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam +master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207) +master-bin.000001 # Intvar # # INSERT_ID=208 +master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null) +master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); 11 == 11 diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 864fa094190..e49fd6791a0 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -940,7 +940,7 @@ update_timing_fields_for_event(THD *thd, if (update_last_executed) { - TIME time; + MYSQL_TIME time; my_tz_UTC->gmt_sec_to_TIME(&time, last_executed); fields[ET_FIELD_LAST_EXECUTED]->set_notnull(); diff --git a/sql/log.cc b/sql/log.cc index 694a80ba57b..6adb765966c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -574,7 +574,7 @@ bool Log_to_csv_event_handler:: lock_time may be truncated without warning here, if greater than 839 hours (~35 days) */ - TIME t; + MYSQL_TIME t; t.neg= 0; /* fill in query_time field */ From 3f96702b06b70b5b922ba1007077767d65a081e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 17:05:22 +0200 Subject: [PATCH 625/789] Add OPT_LOG_DIR --- client/mysqltest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 3d7e082897f..6fcecf7fbef 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -86,7 +86,7 @@ enum { OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES, - OPT_MARK_PROGRESS, OPT_CHARSETS_DIR + OPT_MARK_PROGRESS, OPT_CHARSETS_DIR, OPT_LOG_DIR }; static int record= 0, opt_sleep= -1; @@ -4245,7 +4245,7 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include, (gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"logdir", 0, "Directory for log files", (gptr*) &opt_logdir, + {"logdir", OPT_LOG_DIR, "Directory for log files", (gptr*) &opt_logdir, (gptr*) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"mark-progress", OPT_MARK_PROGRESS, "Write linenumber and elapsed time to .progress ", From 3120134a0a9a659514be0ccb806cae4a097cc991 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 17:06:36 +0200 Subject: [PATCH 626/789] Init dying to 1 just after passing the guard --- client/mysqltest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index 6fcecf7fbef..c4bd2712549 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -837,6 +837,7 @@ void die(const char *fmt, ...) */ if (dying) cleanup_and_exit(1); + dying= 1; /* Print the error message */ fprintf(stderr, "mysqltest: "); From da43360e1fb78faee98d45bc07a5b1437264da31 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 17:09:35 +0200 Subject: [PATCH 627/789] Take into account wether vertical_results are in effect --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index c4bd2712549..d2a01a7689c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -6180,7 +6180,7 @@ int main(int argc, char **argv) } /* Check for special property for this query */ - display_result_vertically= (command->type == Q_QUERY_VERTICAL); + display_result_vertically|= (command->type == Q_QUERY_VERTICAL); display_result_sorted= (command->type == Q_QUERY_SORTED); if (save_file[0]) From 247c3a81a1cf3c72ac86a9a1bf466a750bb6c6e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 17:33:04 +0200 Subject: [PATCH 628/789] Update result(which mysterioulsy got lost) --- mysql-test/r/mysqltest.result | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 51ca5e2a813..e460275e758 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -546,4 +546,19 @@ a b c 2 Part 2 2007-04-05 00:00:00 2 Part 3 2007-04-05 00:00:00 select * from t1; +select ''; + + +select "h"; +h +h +select "he"; +he +he +select "hep"; +hep +hep +select "hepp"; +hepp +hepp End of tests From 6c15d02a37a7770335ec746a25a8bb5479e52372 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 19:07:06 +0300 Subject: [PATCH 629/789] Patch for displaying questions per second average correctly. --- sql/sql_parse.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0c50a6212ad..46f76db28ad 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1140,6 +1140,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, STATUS_VAR current_global_status_var; ulong uptime; uint length; + ulonglong queries_per_second1000; #ifndef EMBEDDED_LIBRARY char buff[250]; uint buff_len= sizeof(buff); @@ -1152,19 +1153,23 @@ bool dispatch_command(enum enum_server_command command, THD *thd, statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_STATUS], &LOCK_status); calc_sum_of_all_status(¤t_global_status_var); - uptime= (ulong) (thd->start_time - server_start_time); + if (!(uptime= (ulong) (thd->start_time - server_start_time))) + queries_per_second1000= 0; + else + queries_per_second1000= thd->query_id * LL(1000) / uptime; + length= my_snprintf((char*) buff, buff_len - 1, "Uptime: %lu Threads: %d Questions: %lu " "Slow queries: %lu Opens: %lu Flush tables: %lu " - "Open tables: %u Queries per second avg: %.3f", + "Open tables: %u Queries per second avg: %u.%u", uptime, (int) thread_count, (ulong) thd->query_id, current_global_status_var.long_query_count, current_global_status_var.opened_tables, refresh_version, cached_open_tables(), - (uptime ? (ulonglong2double(thd->query_id) / - (double) uptime) : (double) 0)); + (uint) (queries_per_second1000 / 1000), + (uint) (queries_per_second1000 % 1000)); #ifdef SAFEMALLOC if (sf_malloc_cur_memory) // Using SAFEMALLOC { From 8e72b760aa0a407f68bf37df37d31caa382d2f82 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Apr 2007 19:08:08 +0300 Subject: [PATCH 630/789] Bug #19372: Added a test case. The problem was fixed by the fix for bug #17379. The problem was that because of some conditions the optimizer always preferred range or full index scan access methods to lookup access methods even when the latter were much cheaper. mysql-test/r/select.result: Bug #19372: test case. The problem was fixed by the patch for bug #17379 mysql-test/t/select.test: Bug #19372: test case. The problem was fixed by the patch for bug #17379 --- mysql-test/r/select.result | 9 +++++++++ mysql-test/t/select.test | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index b501d547e0a..bfe0b9d19df 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3986,4 +3986,13 @@ t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); faq_id 265 DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a Date: Wed, 11 Apr 2007 01:47:42 +0200 Subject: [PATCH 631/789] my_memmem.c: Back port of include change and copyright from 5.1 Makefile.am, zlib.m4: Use separate libtool convenience library for the bundled zlib to embed into executables and shared libraries created, and one to install into the pkglib directory zlib/Makefile.am: Use separate libtool convenience library for the bundled zlib to embed into executables and shared libraries created, and one to install into the pkglib directory config/ac-macros/zlib.m4: Use separate libtool convenience library for the bundled zlib to embed into executables and shared libraries created, and one to install into the pkglib directory mysys/my_memmem.c: Back port of include change and copyright from 5.1 --- config/ac-macros/zlib.m4 | 2 +- mysys/my_memmem.c | 18 +++++++++++++++++- zlib/Makefile.am | 17 +++++++++-------- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4 index 74de715e424..5defdfd6749 100644 --- a/config/ac-macros/zlib.m4 +++ b/config/ac-macros/zlib.m4 @@ -2,7 +2,7 @@ dnl Define zlib paths to point at bundled zlib AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [ ZLIB_INCLUDES="-I\$(top_srcdir)/zlib" -ZLIB_LIBS="\$(top_builddir)/zlib/libz.la" +ZLIB_LIBS="\$(top_builddir)/zlib/libzlt.la" dnl Omit -L$pkglibdir as it's always in the list of mysql_config deps. ZLIB_DEPS="-lz" zlib_dir="zlib" diff --git a/mysys/my_memmem.c b/mysys/my_memmem.c index 682a1314f09..9230337409d 100644 --- a/mysys/my_memmem.c +++ b/mysys/my_memmem.c @@ -1,4 +1,20 @@ -#include "my_base.h" +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include /* my_memmem, port of a GNU extension. diff --git a/zlib/Makefile.am b/zlib/Makefile.am index f5741a782fb..edcbd5f4a75 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -19,17 +19,18 @@ INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include LIBS= $(NON_THREADED_LIBS) -pkglib_LTLIBRARIES=libz.la +pkglib_LTLIBRARIES = libz.la +noinst_LTLIBRARIES = libzlt.la -# We are never interested in a shared version -libz_la_LDFLAGS= -static +libz_la_LDFLAGS = -static -noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ - inftrees.h trees.h zconf.h zlib.h zutil.h +noinst_HEADERS = crc32.h deflate.h inffast.h inffixed.h inflate.h \ + inftrees.h trees.h zconf.h zlib.h zutil.h -libz_la_SOURCES= adler32.c compress.c crc32.c deflate.c gzio.c \ - infback.c inffast.c inflate.c inftrees.c trees.c \ - uncompr.c zutil.c +libz_la_SOURCES = adler32.c compress.c crc32.c deflate.c gzio.c \ + infback.c inffast.c inflate.c inftrees.c trees.c \ + uncompr.c zutil.c +libzlt_la_SOURCES = $(libz_la_SOURCES) EXTRA_DIST= README FAQ INDEX ChangeLog algorithm.txt zlib.3 CMakeLists.txt From f159d066b5b1751dd92c4cbc3649246f7426c4bf Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 07:56:11 +0200 Subject: [PATCH 632/789] ndb - bug#27748 testcase --- mysql-test/r/rpl_ndb_basic.result | 27 +++++++++++++++++++++++++++ mysql-test/t/rpl_ndb_basic.test | 31 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/mysql-test/r/rpl_ndb_basic.result b/mysql-test/r/rpl_ndb_basic.result index 32a1c790c99..c2f31465294 100644 --- a/mysql-test/r/rpl_ndb_basic.result +++ b/mysql-test/r/rpl_ndb_basic.result @@ -24,6 +24,33 @@ nid nom prenom select * from t1 order by nid; nid nom prenom 1 XYZ2 ABC2 +delete from t1; +insert into t1 values(1,"AA", "AA"); +insert into t1 values(2,"BB", "BB"); +insert into t1 values(3,"CC", "CC"); +insert into t1 values(4,"DD", "DD"); +begin; +delete from t1 where nid = 1; +insert into t1 values (1,"A2", "A2"); +update t1 set nom="B2" where nid = 2; +delete from t1 where nid = 2; +update t1 set nom = "D2" where nid = 4; +delete from t1 where nid = 4; +insert into t1 values (4, "D3", "D3"); +update t1 set nom = "D4" where nid = 4; +insert into t1 values (5, "EE", "EE"); +delete from t1 where nid = 5; +commit; +select * from t1 order by 1; +nid nom prenom +1 A2 A2 +3 CC CC +4 D4 D3 +select * from t1 order by 1; +nid nom prenom +1 A2 A2 +3 CC CC +4 D4 D3 DROP table t1; CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0', `nom` char(4) default NULL, diff --git a/mysql-test/t/rpl_ndb_basic.test b/mysql-test/t/rpl_ndb_basic.test index 5290dc377c2..f0a0b9b0436 100644 --- a/mysql-test/t/rpl_ndb_basic.test +++ b/mysql-test/t/rpl_ndb_basic.test @@ -35,6 +35,37 @@ select * from t1 order by nid; # Bug #11087 would have row with nid 2 missing select * from t1 order by nid; +--connection master +delete from t1; +insert into t1 values(1,"AA", "AA"); +insert into t1 values(2,"BB", "BB"); +insert into t1 values(3,"CC", "CC"); +insert into t1 values(4,"DD", "DD"); + +begin; +# delete+insert = update +delete from t1 where nid = 1; +insert into t1 values (1,"A2", "A2"); + +# update+delete = delete +update t1 set nom="B2" where nid = 2; +delete from t1 where nid = 2; + +# multi-update +update t1 set nom = "D2" where nid = 4; +delete from t1 where nid = 4; +insert into t1 values (4, "D3", "D3"); +update t1 set nom = "D4" where nid = 4; + +# insert+delete = nothing +insert into t1 values (5, "EE", "EE"); +delete from t1 where nid = 5; + +commit; +select * from t1 order by 1; +--sync_slave_with_master +--connection slave +select * from t1 order by 1; --connection master DROP table t1; From a908db7b74eb5925bf3ca6ab019b44df346bf4f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 08:23:16 +0200 Subject: [PATCH 633/789] ndb - bug#27748 fix commit trigger on multi-update ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp: fix commit trigger on multi-update --- ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp index e16d3df6d8d..37bf33f0313 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp @@ -390,6 +390,7 @@ Dbtup::commitRecord(Signal* signal, fragptr.p = regFragPtr; tabptr.p = regTabPtr; + Uint32 hashValue = firstOpPtr.p->hashValue; if (opType == ZINSERT_DELETE) { ljam(); @@ -412,6 +413,7 @@ Dbtup::commitRecord(Signal* signal, //-------------------------------------------------------------------- Uint32 saveOpType = regOperPtr->optype; regOperPtr->optype = ZINSERT; + regOperPtr->hashValue = hashValue; operPtr.p = regOperPtr; checkDetachedTriggers(signal, @@ -444,6 +446,8 @@ Dbtup::commitRecord(Signal* signal, befOpPtr.p->changeMask.clear(); befOpPtr.p->changeMask.bitOR(attributeMask); befOpPtr.p->gci = regOperPtr->gci; + befOpPtr.p->optype = ZUPDATE; + befOpPtr.p->hashValue = hashValue; befOpPtr.p->optype = opType; operPtr.p = befOpPtr.p; @@ -478,11 +482,13 @@ Dbtup::commitRecord(Signal* signal, Uint32 fragPageId = befOpPtr.p->fragPageId; Uint32 pageIndex = befOpPtr.p->pageIndex; + befOpPtr.p->optype = ZDELETE; befOpPtr.p->realPageId = befOpPtr.p->realPageIdC; befOpPtr.p->pageOffset = befOpPtr.p->pageOffsetC; befOpPtr.p->fragPageId = befOpPtr.p->fragPageIdC; befOpPtr.p->pageIndex = befOpPtr.p->pageIndexC; befOpPtr.p->gci = regOperPtr->gci; + befOpPtr.p->hashValue = hashValue; befOpPtr.p->optype = opType; operPtr.p = befOpPtr.p; From 561cd328a35edc7cdfd3253ba1ca0c7aa5a938d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 09:06:27 +0200 Subject: [PATCH 634/789] Add replace_result for things that are not tested --- mysql-test/r/rpl_ssl.result | 4 ++-- mysql-test/t/rpl_ssl.test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/r/rpl_ssl.result index baa6edf8373..6bc1e996965 100644 --- a/mysql-test/r/rpl_ssl.result +++ b/mysql-test/r/rpl_ssl.result @@ -65,7 +65,7 @@ Master_User replssl Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 12320 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -80,7 +80,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 12320 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test index 07a7226fb79..f83f8b983b2 100644 --- a/mysql-test/t/rpl_ssl.test +++ b/mysql-test/t/rpl_ssl.test @@ -57,5 +57,5 @@ connection master; insert into t1 values (NULL); sync_slave_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 8 # 9 # 23 # 33 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # query_vertical show slave status; From 7c086fc7cabdbc172dfd10febed05895ac176efb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 11:10:14 +0200 Subject: [PATCH 635/789] BUG#27583 (slave sql fails to read from iocache when slave got stopped at pos==4): Submitting patch on behalf of Andrei, who discovered the problem and provided the patch. An update of the group relay log coordinates when rotating forgot to update the group relay log name and only updated the group relay log position (and group master log name and position). This patch adds code to update the group relay log *name* as well as the position sql/log_event.cc: Setting group relay log name as well when rotating, not just the group relay log position. --- sql/log_event.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/log_event.cc b/sql/log_event.cc index 593328c4bf2..d8c0d782bf8 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3663,6 +3663,9 @@ int Rotate_log_event::do_update_pos(RELAY_LOG_INFO *rli) memcpy(rli->group_master_log_name, new_log_ident, ident_len+1); rli->notify_group_master_log_name_update(); rli->group_master_log_pos= pos; + strmake(rli->group_relay_log_name, rli->event_relay_log_name, + sizeof(rli->group_relay_log_name) - 1); + rli->notify_group_relay_log_name_update(); rli->group_relay_log_pos= rli->event_relay_log_pos; DBUG_PRINT("info", ("new group_master_log_name: '%s' " "new group_master_log_pos: %lu", From 2c840daa953b68823b5681cdf68adb640139515b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 13:27:36 +0300 Subject: [PATCH 636/789] Added warn_root as argument for push_back() --- sql/sql_error.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_error.cc b/sql/sql_error.cc index f551a7ef4b2..61442c52de7 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -149,7 +149,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, { /* We have to use warn_root, as mem_root is freed after each query */ if ((err= new (&thd->warn_root) MYSQL_ERROR(thd, code, level, msg))) - thd->warn_list.push_back(err); + thd->warn_list.push_back(err, &thd->warn_root); } thd->warn_count[(uint) level]++; thd->total_warn_count++; From 60e587bd2881e7bbc8462d8c7c057232a57fb67e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 12:30:30 +0200 Subject: [PATCH 637/789] Added comment about changing major version number. --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index 50ca08ab1ed..89a6b97e0c7 100644 --- a/configure.in +++ b/configure.in @@ -7,6 +7,9 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also update version.c in ndb +# +# When changing major version number please also check switch statement +# in mysqlbinlog::check_master_version(). AM_INIT_AUTOMAKE(mysql, 5.1.18-beta) AM_CONFIG_HEADER(config.h) From 8fe487beba161e6290d9e063efc4c3019c9ed412 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 13:58:16 +0300 Subject: [PATCH 638/789] Bug #27530: The function CRC32() returns unsigned integer. But the metadata (the unsigned flag) for the function was set incorrectly. As a result type arithmetics based on the function's metadata (like finding the concise type of an temporary table column to hold the result) returned incorrect results. Fixed by returning correct type information. This fix is based on code contributed by Martin Friebe (martin@hybyte.com) on 2007-03-30. mysql-test/r/func_str.result: Bug #27530: test case mysql-test/t/func_str.test: Bug #27530: test case sql/item_strfunc.h: Bug #27530: Marked CRC32() as returning unsigned --- mysql-test/r/bdb_notembedded.result | 35 +++++++++++++++ mysql-test/r/func_str.result | 69 +++++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 ++++++++++++++++ mysql-test/t/func_str.test | 18 ++++++++ sql/item_strfunc.h | 2 +- 5 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 92265c77984..d8afbe13c76 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1992,4 +1992,73 @@ abc SELECT INSERT('abc', 6, 3, '1234'); INSERT('abc', 6, 3, '1234') abc +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT CRC32(a) AS C FROM t1; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1; +CRC32(a) COUNT(*) +450215437 1 +498629140 1 +1790921346 1 +1842515611 1 +2212294583 1 +2226203566 1 +2366072709 1 +2707236321 1 +4088798008 1 +4194326291 1 +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1 ORDER BY 1; +CRC32(a) COUNT(*) +450215437 1 +498629140 1 +1790921346 1 +1842515611 1 +2212294583 1 +2226203566 1 +2366072709 1 +2707236321 1 +4088798008 1 +4194326291 1 +SELECT * FROM (SELECT CRC32(a) FROM t1) t2; +CRC32(a) +2212294583 +450215437 +1842515611 +4088798008 +2226203566 +498629140 +1790921346 +4194326291 +2366072709 +2707236321 +CREATE TABLE t2 SELECT CRC32(a) FROM t1; +desc t2; +Field Type Null Key Default Extra +CRC32(a) int(10) unsigned YES NULL +SELECT * FROM v1; +C +2212294583 +450215437 +1842515611 +4088798008 +2226203566 +498629140 +1790921346 +4194326291 +2366072709 +2707236321 +SELECT * FROM (SELECT * FROM v1) x; +C +2212294583 +450215437 +1842515611 +4088798008 +2226203566 +498629140 +1790921346 +4194326291 +2366072709 +2707236321 +DROP TABLE t1, t2; +DROP VIEW v1; End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 0e4b404fe3a..bca977e6df3 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1058,4 +1058,22 @@ SELECT INSERT('abc', 4, 3, '1234'); SELECT INSERT('abc', 5, 3, '1234'); SELECT INSERT('abc', 6, 3, '1234'); +# +# Bug #27530: Grouping on crc32, or create table select crc32 +# +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT CRC32(a) AS C FROM t1; + +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1; +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1 ORDER BY 1; +SELECT * FROM (SELECT CRC32(a) FROM t1) t2; +CREATE TABLE t2 SELECT CRC32(a) FROM t1; +desc t2; +SELECT * FROM v1; +SELECT * FROM (SELECT * FROM v1) x; + +DROP TABLE t1, t2; +DROP VIEW v1; + --echo End of 5.0 tests diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 778ea6e9496..d7c4a3eddef 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -790,7 +790,7 @@ class Item_func_crc32 :public Item_int_func { String value; public: - Item_func_crc32(Item *a) :Item_int_func(a) {} + Item_func_crc32(Item *a) :Item_int_func(a) { unsigned_flag= 1; } const char *func_name() const { return "crc32"; } void fix_length_and_dec() { max_length=10; } longlong val_int(); From f89df01cc00bf612ffb0575fe0258a6b0769db1b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 13:01:11 +0200 Subject: [PATCH 639/789] make configure handle service pack version strings configure.in: recognize service pack version strings --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a447732a06a..d3da80c2a16 100644 --- a/configure.in +++ b/configure.in @@ -30,7 +30,7 @@ NDB_VERSION_STATUS="" # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"` -MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` +MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION | sed -e 's|[[^0-9.]].*$||;s|$|.|' | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` # The port should be constant for a LONG time MYSQL_TCP_PORT_DEFAULT=3306 From 056e6ba495b9978dcfb208dfd995471a39a2f6a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 14:27:03 +0200 Subject: [PATCH 640/789] don't copy pdb files from the release target output folder, since this target does not build them scripts/make_win_bin_dist: don't try to copy the pdb files from the release output folder --- scripts/make_win_bin_dist | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 862c572a75a..2e10e530ca6 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -146,7 +146,11 @@ mkdir $DESTDIR/bin cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.{exe,map,pdb} $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ +if [ x"$TARGET" != x"release" ] +then + cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ +fi cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ @@ -155,8 +159,11 @@ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map +if [ x"$TARGET" != x"release" ] +then + cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb +fi if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then From 796c53ea7a0edcad496b027a6cd99cecc89ca78e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 15:06:30 +0200 Subject: [PATCH 641/789] Eliminating warnings that pin-pointed a bug in a printout. sql/mysqld.cc: sql_print_error() does not have a MYF field, so none should be provided. --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 382f6683bf6..b62d6c9470a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2919,7 +2919,7 @@ static int init_common_variables(const char *conf_file_name, int argc, if (!(my_default_lc_time_names= my_locale_by_name(lc_time_names_name))) { - sql_print_error("Unknown locale: '%s'", MYF(0), lc_time_names_name); + sql_print_error("Unknown locale: '%s'", lc_time_names_name); return 1; } global_system_variables.lc_time_names= my_default_lc_time_names; From 8187aaa851791fd2a7177437d2763d942a7fea73 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 15:21:11 +0200 Subject: [PATCH 642/789] Bug#26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11 - try to catch as many malloc failures as possible and give error messages ndb/src/ndbapi/ObjectMap.cpp: New BitKeeper file ``ndb/src/ndbapi/ObjectMap.cpp'' --- ndb/include/ndbapi/Ndb.hpp | 20 +- ndb/include/ndbapi/NdbDictionary.hpp | 24 +- ndb/include/ndbapi/NdbReceiver.hpp | 4 +- ndb/include/ndbapi/NdbTransaction.hpp | 2 +- ndb/include/util/BaseString.hpp | 7 + ndb/include/util/Vector.hpp | 68 ++++- ndb/src/common/util/BaseString.cpp | 145 +++++++++- ndb/src/ndbapi/DictCache.cpp | 13 +- ndb/src/ndbapi/DictCache.hpp | 2 +- ndb/src/ndbapi/Makefile.am | 3 +- ndb/src/ndbapi/Ndb.cpp | 47 +++- ndb/src/ndbapi/NdbDictionary.cpp | 80 ++++-- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 262 ++++++++++++++---- ndb/src/ndbapi/NdbDictionaryImpl.hpp | 10 +- ndb/src/ndbapi/NdbImpl.hpp | 34 ++- ndb/src/ndbapi/NdbOperation.cpp | 6 +- ndb/src/ndbapi/NdbRecAttr.cpp | 13 +- ndb/src/ndbapi/NdbReceiver.cpp | 35 ++- ndb/src/ndbapi/NdbScanFilter.cpp | 12 +- ndb/src/ndbapi/NdbScanOperation.cpp | 9 +- ndb/src/ndbapi/NdbTransaction.cpp | 14 +- ndb/src/ndbapi/Ndbif.cpp | 3 +- ndb/src/ndbapi/Ndblist.cpp | 10 +- ndb/src/ndbapi/ObjectMap.cpp | 62 +++++ ndb/src/ndbapi/ObjectMap.hpp | 51 +--- ndb/src/ndbapi/SignalSender.cpp | 10 +- ndb/src/ndbapi/ndb_cluster_connection.cpp | 15 +- .../ndbapi/ndb_cluster_connection_impl.hpp | 2 +- sql/ha_ndbcluster.cc | 176 +++++++++--- 29 files changed, 878 insertions(+), 261 deletions(-) create mode 100644 ndb/src/ndbapi/ObjectMap.cpp diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 516333d1834..5af86cd09a8 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -1051,6 +1051,18 @@ class Ndb friend class NdbDictionaryImpl; friend class NdbDictInterface; friend class NdbBlob; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; + friend class Ndb_free_list_t; #endif public: @@ -1091,7 +1103,7 @@ public: * * @param aCatalogName is the new name of the current catalog */ - void setCatalogName(const char * aCatalogName); + int setCatalogName(const char * aCatalogName); /** * The current schema name can be fetched by getSchemaName. @@ -1105,7 +1117,7 @@ public: * * @param aSchemaName is the new name of the current schema */ - void setSchemaName(const char * aSchemaName); + int setSchemaName(const char * aSchemaName); #endif /** @@ -1120,7 +1132,7 @@ public: * * @param aDatabaseName is the new name of the current database */ - void setDatabaseName(const char * aDatabaseName); + int setDatabaseName(const char * aDatabaseName); /** * The current database schema name can be fetched by getDatabaseSchemaName. @@ -1134,7 +1146,7 @@ public: * * @param aDatabaseSchemaName is the new name of the current database schema */ - void setDatabaseSchemaName(const char * aDatabaseSchemaName); + int setDatabaseSchemaName(const char * aDatabaseSchemaName); /** * Initializes the Ndb object diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 34686dd4db1..445bb513ffc 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -358,7 +358,7 @@ public: * Set name of column * @param name Name of the column */ - void setName(const char * name); + int setName(const char * name); /** * Set whether column is nullable or not @@ -446,7 +446,7 @@ public: void setAutoIncrement(bool); bool getAutoIncrement() const; void setAutoIncrementInitialValue(Uint64 val); - void setDefaultValue(const char*); + int setDefaultValue(const char*); const char* getDefaultValue() const; static const Column * FRAGMENT; @@ -661,13 +661,13 @@ public: * Name of table * @param name Name of table */ - void setName(const char * name); + int setName(const char * name); /** * Add a column definition to a table * @note creates a copy */ - void addColumn(const Column &); + int addColumn(const Column &); /** * @see NdbDictionary::Table::getLogging. @@ -723,7 +723,7 @@ public: /** * Set frm file to store with this table */ - void setFrm(const void* data, Uint32 len); + int setFrm(const void* data, Uint32 len); /** * Set table object type @@ -875,26 +875,26 @@ public: /** * Set the name of an index */ - void setName(const char * name); + int setName(const char * name); /** * Define the name of the table to be indexed */ - void setTable(const char * name); + int setTable(const char * name); /** * Add a column to the index definition * Note that the order of columns will be in * the order they are added (only matters for ordered indexes). */ - void addColumn(const Column & c); + int addColumn(const Column & c); /** * Add a column name to the index definition * Note that the order of indexes will be in * the order they are added (only matters for ordered indexes). */ - void addColumnName(const char * name); + int addColumnName(const char * name); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** @@ -903,7 +903,7 @@ public: * the order they are added (only matters for ordered indexes). * Depricated, use addColumnName instead. */ - void addIndexColumn(const char * name); + int addIndexColumn(const char * name); #endif /** @@ -911,7 +911,7 @@ public: * Note that the order of indexes will be in * the order they are added (only matters for ordered indexes). */ - void addColumnNames(unsigned noOfNames, const char ** names); + int addColumnNames(unsigned noOfNames, const char ** names); #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** @@ -920,7 +920,7 @@ public: * the order they are added (only matters for ordered indexes). * Depricated, use addColumnNames instead. */ - void addIndexColumns(int noOfNames, const char ** names); + int addIndexColumns(int noOfNames, const char ** names); #endif /** diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index 0af55c88f68..b8abd281496 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -38,7 +38,7 @@ public: }; NdbReceiver(Ndb *aNdb); - void init(ReceiverType type, void* owner); + int init(ReceiverType type, void* owner); void release(); ~NdbReceiver(); @@ -75,7 +75,7 @@ private: * At setup */ class NdbRecAttr * getValue(const class NdbColumnImpl*, char * user_dst_ptr); - void do_get_value(NdbReceiver*, Uint32 rows, Uint32 key_size, Uint32 range); + int do_get_value(NdbReceiver*, Uint32 rows, Uint32 key_size, Uint32 range); void prepareSend(); void calculate_batch_size(Uint32, Uint32, Uint32&, Uint32&, Uint32&); diff --git a/ndb/include/ndbapi/NdbTransaction.hpp b/ndb/include/ndbapi/NdbTransaction.hpp index 1a9c7158adf..d3405633f80 100644 --- a/ndb/include/ndbapi/NdbTransaction.hpp +++ b/ndb/include/ndbapi/NdbTransaction.hpp @@ -585,7 +585,7 @@ private: NdbTransaction(Ndb* aNdb); ~NdbTransaction(); - void init(); // Initialize connection object for new transaction + int init(); // Initialize connection object for new transaction int executeNoBlobs(ExecType execType, AbortOption abortOption = AbortOnError, diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index 44e1e4614be..34ca2d2be3d 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -185,6 +185,7 @@ public: private: char* m_chr; unsigned m_len; + friend bool operator!(const BaseString& str); }; inline const char* @@ -249,6 +250,12 @@ BaseString::operator!=(const char *str) const return strcmp(m_chr, str) != 0; } +inline bool +operator!(const BaseString& str) +{ + return str.m_chr == NULL; +} + inline BaseString& BaseString::assign(const BaseString& str) { diff --git a/ndb/include/util/Vector.hpp b/ndb/include/util/Vector.hpp index aeddbbb22f0..8f403b435dd 100644 --- a/ndb/include/util/Vector.hpp +++ b/ndb/include/util/Vector.hpp @@ -29,14 +29,14 @@ public: const T& operator[](unsigned i) const; unsigned size() const { return m_size; }; - void push_back(const T &); + int push_back(const T &); T& back(); void erase(unsigned index); void clear(); - void fill(unsigned new_size, T & obj); + int fill(unsigned new_size, T & obj); Vector& operator=(const Vector&); @@ -52,6 +52,14 @@ private: template Vector::Vector(int i){ m_items = new T[i]; + if (m_items == NULL) + { + errno = ENOMEM; + m_size = 0; + m_arraySize = 0; + m_incSize = 0; + return; + } m_size = 0; m_arraySize = i; m_incSize = 50; @@ -89,12 +97,15 @@ Vector::back(){ } template -void +int Vector::push_back(const T & t){ if(m_size == m_arraySize){ T * tmp = new T [m_arraySize + m_incSize]; - if(!tmp) - abort(); + if(tmp == NULL) + { + errno = ENOMEM; + return -1; + } for (unsigned k = 0; k < m_size; k++) tmp[k] = m_items[k]; delete[] m_items; @@ -103,6 +114,8 @@ Vector::push_back(const T & t){ } m_items[m_size] = t; m_size++; + + return 0; } template @@ -123,10 +136,12 @@ Vector::clear(){ } template -void +int Vector::fill(unsigned new_size, T & obj){ while(m_size <= new_size) - push_back(obj); + if (push_back(obj)) + return -1; + return 0; } template @@ -150,8 +165,8 @@ struct MutexVector : public NdbLockable { const T& operator[](unsigned i) const; unsigned size() const { return m_size; }; - void push_back(const T &); - void push_back(const T &, bool lockMutex); + int push_back(const T &); + int push_back(const T &, bool lockMutex); T& back(); void erase(unsigned index); @@ -160,7 +175,7 @@ struct MutexVector : public NdbLockable { void clear(); void clear(bool lockMutex); - void fill(unsigned new_size, T & obj); + int fill(unsigned new_size, T & obj); private: T * m_items; unsigned m_size; @@ -171,6 +186,14 @@ private: template MutexVector::MutexVector(int i){ m_items = new T[i]; + if (m_items == NULL) + { + errno = ENOMEM; + m_size = 0; + m_arraySize = 0; + m_incSize = 0; + return; + } m_size = 0; m_arraySize = i; m_incSize = 50; @@ -208,11 +231,17 @@ MutexVector::back(){ } template -void +int MutexVector::push_back(const T & t){ lock(); if(m_size == m_arraySize){ T * tmp = new T [m_arraySize + m_incSize]; + if (tmp == NULL) + { + errno = ENOMEM; + unlock(); + return -1; + } for (unsigned k = 0; k < m_size; k++) tmp[k] = m_items[k]; delete[] m_items; @@ -222,15 +251,23 @@ MutexVector::push_back(const T & t){ m_items[m_size] = t; m_size++; unlock(); + return 0; } template -void +int MutexVector::push_back(const T & t, bool lockMutex){ if(lockMutex) lock(); if(m_size == m_arraySize){ T * tmp = new T [m_arraySize + m_incSize]; + if (tmp == NULL) + { + errno = ENOMEM; + if(lockMutex) + unlock(); + return -1; + } for (unsigned k = 0; k < m_size; k++) tmp[k] = m_items[k]; delete[] m_items; @@ -241,6 +278,7 @@ MutexVector::push_back(const T & t, bool lockMutex){ m_size++; if(lockMutex) unlock(); + return 0; } template @@ -288,10 +326,12 @@ MutexVector::clear(bool l){ } template -void +int MutexVector::fill(unsigned new_size, T & obj){ while(m_size <= new_size) - push_back(obj); + if (push_back(obj)) + return -1; + return 0; } #endif diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp index 6f20ae6a002..7e5adf0e9ef 100644 --- a/ndb/src/common/util/BaseString.cpp +++ b/ndb/src/common/util/BaseString.cpp @@ -16,19 +16,36 @@ /* -*- c-basic-offset: 4; -*- */ #include #include -#include +#include "basestring_vsnprintf.h" BaseString::BaseString() { m_chr = new char[1]; + if (m_chr == NULL) + { + errno = ENOMEM; + m_len = 0; + return; + } m_chr[0] = 0; m_len = 0; } BaseString::BaseString(const char* s) { + if (s == NULL) + { + m_chr = NULL; + m_len = 0; + } const size_t n = strlen(s); m_chr = new char[n + 1]; + if (m_chr == NULL) + { + errno = ENOMEM; + m_len = 0; + return; + } memcpy(m_chr, s, n + 1); m_len = n; } @@ -37,7 +54,20 @@ BaseString::BaseString(const BaseString& str) { const char* const s = str.m_chr; const size_t n = str.m_len; + if (s == NULL) + { + m_chr = NULL; + m_len = 0; + return; + } char* t = new char[n + 1]; + if (t == NULL) + { + errno = ENOMEM; + m_chr = NULL; + m_len = 0; + return; + } memcpy(t, s, n + 1); m_chr = t; m_len = n; @@ -51,9 +81,23 @@ BaseString::~BaseString() BaseString& BaseString::assign(const char* s) { - const size_t n = strlen(s); + if (s == NULL) + { + m_chr = NULL; + m_len = 0; + return *this; + } + size_t n = strlen(s); char* t = new char[n + 1]; - memcpy(t, s, n + 1); + if (t) + { + memcpy(t, s, n + 1); + } + else + { + errno = ENOMEM; + n = 0; + } delete[] m_chr; m_chr = t; m_len = n; @@ -64,8 +108,16 @@ BaseString& BaseString::assign(const char* s, size_t n) { char* t = new char[n + 1]; - memcpy(t, s, n); - t[n] = 0; + if (t) + { + memcpy(t, s, n); + t[n] = 0; + } + else + { + errno = ENOMEM; + n = 0; + } delete[] m_chr; m_chr = t; m_len = n; @@ -83,10 +135,19 @@ BaseString::assign(const BaseString& str, size_t n) BaseString& BaseString::append(const char* s) { - const size_t n = strlen(s); + size_t n = strlen(s); char* t = new char[m_len + n + 1]; - memcpy(t, m_chr, m_len); - memcpy(t + m_len, s, n + 1); + if (t) + { + memcpy(t, m_chr, m_len); + memcpy(t + m_len, s, n + 1); + } + else + { + errno = ENOMEM; + m_len = 0; + n = 0; + } delete[] m_chr; m_chr = t; m_len += n; @@ -130,8 +191,14 @@ BaseString::assfmt(const char *fmt, ...) l = basestring_vsnprintf(buf, sizeof(buf), fmt, ap) + 1; va_end(ap); if(l > (int)m_len) { + char *t = new char[l]; + if (t == NULL) + { + errno = ENOMEM; + return *this; + } delete[] m_chr; - m_chr = new char[l]; + m_chr = t; } va_start(ap, fmt); basestring_vsnprintf(m_chr, l, fmt, ap); @@ -155,6 +222,11 @@ BaseString::appfmt(const char *fmt, ...) l = basestring_vsnprintf(buf, sizeof(buf), fmt, ap) + 1; va_end(ap); char *tmp = new char[l]; + if (tmp == NULL) + { + errno = ENOMEM; + return *this; + } va_start(ap, fmt); basestring_vsnprintf(tmp, l, fmt, ap); va_end(ap); @@ -242,9 +314,28 @@ BaseString::argify(const char *argv0, const char *src) { Vector vargv; if(argv0 != NULL) - vargv.push_back(strdup(argv0)); + { + char *t = strdup(argv0); + if (t == NULL) + { + errno = ENOMEM; + return NULL; + } + if (vargv.push_back(t)) + { + free(t); + return NULL; + } + } char *tmp = new char[strlen(src)+1]; + if (tmp == NULL) + { + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + errno = ENOMEM; + return NULL; + } char *dst = tmp; const char *end = src + strlen(src); /* Copy characters from src to destination, while compacting them @@ -287,20 +378,48 @@ BaseString::argify(const char *argv0, const char *src) { /* Make sure the string is properly terminated */ *dst++ = '\0'; src++; - - vargv.push_back(strdup(begin)); + + { + char *t = strdup(begin); + if (t == NULL) + { + delete[] tmp; + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + errno = ENOMEM; + return NULL; + } + if (vargv.push_back(t)) + { + free(t); + delete[] tmp; + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + return NULL; + } + } } end: delete[] tmp; - vargv.push_back(NULL); + if (vargv.push_back(NULL)) + { + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + return NULL; + } /* Convert the C++ Vector into a C-vector of strings, suitable for * calling execv(). */ char **argv = (char **)malloc(sizeof(*argv) * (vargv.size())); if(argv == NULL) + { + for(size_t i = 0; i < vargv.size(); i++) + free(vargv[i]); + errno = ENOMEM; return NULL; + } for(size_t i = 0; i < vargv.size(); i++){ argv[i] = vargv[i]; diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index 82e8d82bc24..6a815067233 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -141,7 +141,7 @@ void GlobalDictCache::printCache() } NdbTableImpl * -GlobalDictCache::get(const char * name) +GlobalDictCache::get(const char * name, int *error) { DBUG_ENTER("GlobalDictCache::get"); DBUG_PRINT("enter", ("name: %s", name)); @@ -151,6 +151,11 @@ GlobalDictCache::get(const char * name) versions = m_tableHash.getData(name, len); if(versions == 0){ versions = new Vector(2); + if (versions == NULL) + { + *error = -1; + DBUG_RETURN(0); + } m_tableHash.insertKey(name, len, 0, versions); } @@ -180,7 +185,11 @@ GlobalDictCache::get(const char * name) tmp.m_impl = 0; tmp.m_status = RETREIVING; tmp.m_refCount = 1; // The one retreiving it - versions->push_back(tmp); + if (versions->push_back(tmp)) + { + *error = -1; + DBUG_RETURN(0); + } DBUG_RETURN(0); } diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index 4b569c114c9..db90a07d487 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -67,7 +67,7 @@ public: GlobalDictCache(); ~GlobalDictCache(); - NdbTableImpl * get(const char * name); + NdbTableImpl * get(const char * name, int *error); NdbTableImpl* put(const char * name, NdbTableImpl *); void drop(NdbTableImpl *); diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index 85013b540dc..1a5d10eae5b 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -48,7 +48,8 @@ libndbapi_la_SOURCES = \ DictCache.cpp \ ndb_cluster_connection.cpp \ NdbBlob.cpp \ - SignalSender.cpp + SignalSender.cpp \ + ObjectMap.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 57077559c49..3e407c43ca1 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -182,6 +182,7 @@ Ndb::NDB_connect(Uint32 tNode) nodeSequence = tp->getNodeSequence(tNode); bool node_is_alive = tp->get_node_alive(tNode); if (node_is_alive) { + DBUG_PRINT("info",("Sending signal to node %u", tNode)); tReturnCode = tp->sendSignal(tSignal, tNode); releaseSignal(tSignal); if (tReturnCode != -1) { @@ -449,7 +450,11 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) theRemainingStartTransactions--; NdbTransaction* tConNext = theTransactionList; - tConnection->init(); + if (tConnection->init()) + { + theError.code = tConnection->theError.code; + DBUG_RETURN(NULL); + } theTransactionList = tConnection; // into a transaction list. tConnection->next(tConNext); // Add the active connection object tConnection->setTransactionId(tFirstTransId); @@ -1129,27 +1134,35 @@ const char * Ndb::getCatalogName() const } -void Ndb::setCatalogName(const char * a_catalog_name) +int Ndb::setCatalogName(const char * a_catalog_name) { if (a_catalog_name) { - theImpl->m_dbname.assign(a_catalog_name); - theImpl->update_prefix(); + if (!theImpl->m_dbname.assign(a_catalog_name) || + theImpl->update_prefix()) + { + theError.code = 4000; + return -1; + } } + return 0; } - const char * Ndb::getSchemaName() const { return theImpl->m_schemaname.c_str(); } -void Ndb::setSchemaName(const char * a_schema_name) +int Ndb::setSchemaName(const char * a_schema_name) { if (a_schema_name) { - theImpl->m_schemaname.assign(a_schema_name); - theImpl->update_prefix(); + if (!theImpl->m_schemaname.assign(a_schema_name) || + theImpl->update_prefix()) + { + theError.code = 4000; + return -1; + } } } @@ -1161,9 +1174,9 @@ const char * Ndb::getDatabaseName() const return getCatalogName(); } -void Ndb::setDatabaseName(const char * a_catalog_name) +int Ndb::setDatabaseName(const char * a_catalog_name) { - setCatalogName(a_catalog_name); + return setCatalogName(a_catalog_name); } const char * Ndb::getDatabaseSchemaName() const @@ -1171,9 +1184,9 @@ const char * Ndb::getDatabaseSchemaName() const return getSchemaName(); } -void Ndb::setDatabaseSchemaName(const char * a_schema_name) +int Ndb::setDatabaseSchemaName(const char * a_schema_name) { - setSchemaName(a_schema_name); + return setSchemaName(a_schema_name); } bool Ndb::usingFullyQualifiedNames() @@ -1287,6 +1300,11 @@ const BaseString Ndb::getDatabaseFromInternalName(const char * internalName) { char * databaseName = new char[strlen(internalName) + 1]; + if (databaseName == NULL) + { + errno = ENOMEM; + return BaseString(NULL); + } strcpy(databaseName, internalName); register char *ptr = databaseName; @@ -1303,6 +1321,11 @@ const BaseString Ndb::getSchemaFromInternalName(const char * internalName) { char * schemaName = new char[strlen(internalName)]; + if (schemaName == NULL) + { + errno = ENOMEM; + return BaseString(NULL); + } register const char *ptr1 = internalName; /* Scan name for the second table_name_separator */ diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 0a52f62aa01..86a6624959e 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -52,9 +52,9 @@ NdbDictionary::Column::operator=(const NdbDictionary::Column& column) return *this; } -void +int NdbDictionary::Column::setName(const char * name){ - m_impl.m_name.assign(name); + return !m_impl.m_name.assign(name); } const char* @@ -208,10 +208,10 @@ NdbDictionary::Column::setAutoIncrementInitialValue(Uint64 val){ m_impl.m_autoIncrementInitialValue = val; } -void +int NdbDictionary::Column::setDefaultValue(const char* defaultValue) { - m_impl.m_defaultValue.assign(defaultValue); + return !m_impl.m_defaultValue.assign(defaultValue); } const char* @@ -273,9 +273,9 @@ NdbDictionary::Table::operator=(const NdbDictionary::Table& table) return *this; } -void +int NdbDictionary::Table::setName(const char * name){ - m_impl.setName(name); + return m_impl.setName(name); } const char * @@ -288,18 +288,30 @@ NdbDictionary::Table::getTableId() const { return m_impl.m_tableId; } -void +int NdbDictionary::Table::addColumn(const Column & c){ NdbColumnImpl* col = new NdbColumnImpl; + if (col == NULL) + { + errno = ENOMEM; + return -1; + } (* col) = NdbColumnImpl::getImpl(c); - m_impl.m_columns.push_back(col); + if (m_impl.m_columns.push_back(col)) + { + return -1; + } if(c.getPrimaryKey()){ m_impl.m_noOfKeys++; } if (col->getBlobType()) { m_impl.m_noOfBlobs++; } - m_impl.buildColumnHash(); + if (m_impl.buildColumnHash()) + { + return -1; + } + return 0; } const NdbDictionary::Column* @@ -442,9 +454,9 @@ NdbDictionary::Table::setSingleUserMode(enum NdbDictionary::Table::SingleUserMod m_impl.m_single_user_mode = (Uint8)mode; } -void +int NdbDictionary::Table::setFrm(const void* data, Uint32 len){ - m_impl.m_frm.assign(data, len); + return m_impl.m_frm.assign(data, len); } NdbDictionary::Object::Status @@ -491,6 +503,7 @@ NdbDictionary::Table::createTableInDb(Ndb* pNdb, bool equalOk) const { /***************************************************************** * Index facade */ + NdbDictionary::Index::Index(const char * name) : m_impl(* new NdbIndexImpl(* this)) { @@ -509,9 +522,9 @@ NdbDictionary::Index::~Index(){ } } -void +int NdbDictionary::Index::setName(const char * name){ - m_impl.setName(name); + return m_impl.setName(name); } const char * @@ -519,9 +532,9 @@ NdbDictionary::Index::getName() const { return m_impl.getName(); } -void +int NdbDictionary::Index::setTable(const char * table){ - m_impl.setTable(table); + return m_impl.setTable(table); } const char * @@ -556,39 +569,56 @@ NdbDictionary::Index::getIndexColumn(int no) const { return NULL; } -void +int NdbDictionary::Index::addColumn(const Column & c){ NdbColumnImpl* col = new NdbColumnImpl; + if (col == NULL) + { + errno = ENOMEM; + return -1; + } (* col) = NdbColumnImpl::getImpl(c); - m_impl.m_columns.push_back(col); + if (m_impl.m_columns.push_back(col)) + { + return -1; + } + return 0; } -void +int NdbDictionary::Index::addColumnName(const char * name){ const Column c(name); - addColumn(c); + return addColumn(c); } -void +int NdbDictionary::Index::addIndexColumn(const char * name){ const Column c(name); - addColumn(c); + return addColumn(c); } -void +int NdbDictionary::Index::addColumnNames(unsigned noOfNames, const char ** names){ for(unsigned i = 0; i < noOfNames; i++) { const Column c(names[i]); - addColumn(c); + if (addColumn(c)) + { + return -1; + } } + return 0; } -void +int NdbDictionary::Index::addIndexColumns(int noOfNames, const char ** names){ for(int i = 0; i < noOfNames; i++) { const Column c(names[i]); - addColumn(c); + if (addColumn(c)) + { + return -1; + } } + return 0; } void diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 8604d50830d..3fed04de26d 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -390,22 +390,34 @@ NdbTableImpl::equal(const NdbTableImpl& obj) const DBUG_RETURN(true); } -void +int NdbTableImpl::assign(const NdbTableImpl& org) { m_tableId = org.m_tableId; - m_internalName.assign(org.m_internalName); - m_externalName.assign(org.m_externalName); - m_newExternalName.assign(org.m_newExternalName); - m_frm.assign(org.m_frm.get_data(), org.m_frm.length()); + if (!m_internalName.assign(org.m_internalName) || + !m_externalName.assign(org.m_externalName) || + !m_newExternalName.assign(org.m_newExternalName) || + m_frm.assign(org.m_frm.get_data(), org.m_frm.length())) + { + return -1; + } m_fragmentType = org.m_fragmentType; m_fragmentCount = org.m_fragmentCount; for(unsigned i = 0; i hashValues; - Vector > chains; chains.fill(size, hashValues); + Vector > chains; + if (chains.fill(size, hashValues)) + { + return -1; + } for(i = 0; i< (int) size; i++){ Uint32 hv = Hash(m_columns[i]->getName()) & 0xFFFE; Uint32 bucket = hv & m_columnHashMask; bucket = (bucket < size ? bucket : bucket - size); assert(bucket < size); - hashValues.push_back(hv); - chains[bucket].push_back(i); + if (hashValues.push_back(hv) || + chains[bucket].push_back(i)) + { + return -1; + } } m_columnHash.clear(); Uint32 tmp = 1; - m_columnHash.fill((unsigned)size-1, tmp); // Default no chaining + if (m_columnHash.fill((unsigned)size-1, tmp)) // Default no chaining + { + return -1; + } Uint32 pos = 0; // In overflow vector for(i = 0; i< (int) size; i++){ @@ -490,12 +514,18 @@ NdbTableImpl::buildColumnHash(){ for(size_t j = 0; j 0 ? m_columns[col]->getName() : "" , m_columnHash[i]); } #endif + return 0; } Uint32 @@ -563,9 +594,9 @@ NdbIndexImpl::~NdbIndexImpl(){ delete m_columns[i]; } -void NdbIndexImpl::setName(const char * name) +int NdbIndexImpl::setName(const char * name) { - m_externalName.assign(name); + return !m_externalName.assign(name); } const char * @@ -574,10 +605,10 @@ NdbIndexImpl::getName() const return m_externalName.c_str(); } -void +int NdbIndexImpl::setTable(const char * table) { - m_tableName.assign(table); + return !m_tableName.assign(table); } const char * @@ -657,14 +688,18 @@ Ndb_local_table_info * NdbDictionaryImpl::fetchGlobalTableImpl(const BaseString& internalTableName) { NdbTableImpl *impl; + int error= 0; m_globalHash->lock(); - impl = m_globalHash->get(internalTableName.c_str()); + impl = m_globalHash->get(internalTableName.c_str(), &error); m_globalHash->unlock(); if (impl == 0){ - impl = m_receiver.getTable(internalTableName, - m_ndb.usingFullyQualifiedNames()); + if (error == 0) + impl = m_receiver.getTable(internalTableName, + m_ndb.usingFullyQualifiedNames()); + else + m_error.code = 4000; m_globalHash->lock(); m_globalHash->put(internalTableName.c_str(), impl); m_globalHash->unlock(); @@ -998,12 +1033,20 @@ NdbDictInterface::getTable(const BaseString& name, bool fullyQualifiedNames) // Copy name to m_buffer to get a word sized buffer m_buffer.clear(); - m_buffer.grow(namelen_words*4+4); - m_buffer.append(name.c_str(), namelen); + if (m_buffer.grow(namelen_words*4+4) || + m_buffer.append(name.c_str(), namelen)) + { + m_error.code= 4000; + return NULL; + } #ifndef IGNORE_VALGRIND_WARNINGS Uint32 pad = 0; - m_buffer.append(&pad, 4); + if (m_buffer.append(&pad, 4)) + { + m_error.code= 4000; + return NULL; + } #endif LinearSectionPtr ptr[1]; @@ -1034,7 +1077,14 @@ NdbDictInterface::getTable(class NdbApiSignal * signal, (Uint32*)m_buffer.get_data(), m_buffer.length() / 4, fullyQualifiedNames); if (rt != 0) - rt->buildColumnHash(); + { + if (rt->buildColumnHash()) + { + m_error.code = 4000; + delete rt; + return NULL; + } + } return rt; } @@ -1043,18 +1093,25 @@ NdbDictInterface::execGET_TABINFO_CONF(NdbApiSignal * signal, LinearSectionPtr ptr[3]) { const GetTabInfoConf* conf = CAST_CONSTPTR(GetTabInfoConf, signal->getDataPtr()); + const Uint32 i = GetTabInfoConf::DICT_TAB_INFO; if(signal->isFirstFragment()){ m_fragmentId = signal->getFragmentId(); - m_buffer.grow(4 * conf->totalLen); + if (m_buffer.grow(4 * conf->totalLen)) + { + m_error.code= 4000; + goto end; + } } else { if(m_fragmentId != signal->getFragmentId()){ abort(); } } - const Uint32 i = GetTabInfoConf::DICT_TAB_INFO; - m_buffer.append(ptr[i].p, 4 * ptr[i].sz); - + if (m_buffer.append(ptr[i].p, 4 * ptr[i].sz)) + { + m_error.code= 4000; + } +end: if(!signal->isLastFragment()){ return; } @@ -1185,10 +1242,12 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, impl->m_tableId = tableDesc.TableId; impl->m_version = tableDesc.TableVersion; impl->m_status = NdbDictionary::Object::Retrieved; - impl->m_internalName.assign(internalName); - impl->m_externalName.assign(externalName); - - impl->m_frm.assign(tableDesc.FrmData, tableDesc.FrmLen); + if (!impl->m_internalName.assign(internalName) || + !impl->m_externalName.assign(externalName) || + impl->m_frm.assign(tableDesc.FrmData, tableDesc.FrmLen)) + { + DBUG_RETURN(4000); + } impl->m_fragmentType = (NdbDictionary::Object::FragmentType) getApiConstant(tableDesc.FragmentType, @@ -1216,7 +1275,10 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, } else { const char * externalPrimary = Ndb::externalizeTableName(tableDesc.PrimaryTable, fullyQualifiedNames); - impl->m_primaryTable.assign(externalPrimary); + if (!impl->m_primaryTable.assign(externalPrimary)) + { + DBUG_RETURN(4000); + } } Uint32 keyInfoPos = 0; @@ -1243,6 +1305,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, // check type and compute attribute size and array size if (! attrDesc.translateExtType()) { + delete col; delete impl; DBUG_RETURN(703); } @@ -1254,12 +1317,14 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, unsigned cs_number = (attrDesc.AttributeExtPrecision >> 16); // charset is defined exactly for char types if (col->getCharType() != (cs_number != 0)) { + delete col; delete impl; DBUG_RETURN(703); } if (col->getCharType()) { col->m_cs = get_charset(cs_number, MYF(0)); if (col->m_cs == NULL) { + delete col; delete impl; DBUG_RETURN(743); } @@ -1277,7 +1342,12 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, col->m_nullable = attrDesc.AttributeNullableFlag; col->m_autoIncrement = (attrDesc.AttributeAutoIncrement ? true : false); col->m_autoIncrementInitialValue = ~0; - col->m_defaultValue.assign(attrDesc.AttributeDefaultValue); + if (!col->m_defaultValue.assign(attrDesc.AttributeDefaultValue)) + { + delete col; + delete impl; + DBUG_RETURN(4000); + } if(attrDesc.AttributeKeyFlag){ col->m_keyInfoPos = keyInfoPos + 1; @@ -1317,7 +1387,11 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, for(i = 0; i<(fragCount*replicaCount); i++) { - impl->m_fragments.push_back(tableDesc.FragmentData[i+2]); + if (impl->m_fragments.push_back(tableDesc.FragmentData[i+2])) + { + delete impl; + DBUG_RETURN(4000); + } } Uint32 topBit = (1 << 31); @@ -1481,7 +1555,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, } if (!impl.m_newExternalName.empty()) { - impl.m_externalName.assign(impl.m_newExternalName); + if (!impl.m_externalName.assign(impl.m_newExternalName)) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } AlterTableReq::setNameFlag(impl.m_changeMask, true); } @@ -1490,7 +1568,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, const BaseString internalName( ndb.internalize_table_name(impl.m_externalName.c_str())); - impl.m_internalName.assign(internalName); + if (!impl.m_internalName.assign(internalName)) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } UtilBufferWriter w(m_buffer); DictTabInfo::Table tmpTab; tmpTab.init(); BaseString::snprintf(tmpTab.TableName, @@ -1967,13 +2049,19 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName, NdbIndexImpl* idx; if(NdbDictInterface::create_index_obj_from_table(&idx, tab, prim) == 0){ idx->m_table = tab; - idx->m_externalName.assign(externalName); - idx->m_internalName.assign(internalName); + if (!idx->m_externalName.assign(externalName) || + !idx->m_internalName.assign(internalName)) + { + delete idx; + m_error.code = 4000; + return 0; + } // TODO Assign idx to tab->m_index // Don't do it right now since assign can't asign a table with index // tab->m_index = idx; return idx; } + m_error.code = 4000; return 0; } @@ -1982,11 +2070,21 @@ NdbDictInterface::create_index_obj_from_table(NdbIndexImpl** dst, NdbTableImpl* tab, const NdbTableImpl* prim){ NdbIndexImpl *idx = new NdbIndexImpl(); + if (idx == NULL) + { + errno = ENOMEM; + return -1; + } idx->m_version = tab->m_version; idx->m_status = tab->m_status; idx->m_indexId = tab->m_tableId; - idx->m_externalName.assign(tab->getName()); - idx->m_tableName.assign(prim->m_externalName); + if (!idx->m_externalName.assign(tab->getName()) || + !idx->m_tableName.assign(prim->m_externalName)) + { + delete idx; + errno = ENOMEM; + return -1; + } NdbDictionary::Index::Type type = idx->m_type = tab->m_indexType; idx->m_logging = tab->m_logging; // skip last attribute (NDB$PK or NDB$TNODE) @@ -1999,9 +2097,20 @@ NdbDictInterface::create_index_obj_from_table(NdbIndexImpl** dst, NdbColumnImpl* org = tab->m_columns[i]; NdbColumnImpl* col = new NdbColumnImpl; + if (col == NULL) + { + errno = ENOMEM; + delete idx; + return -1; + } // Copy column definition *col = * org; - idx->m_columns.push_back(col); + if (idx->m_columns.push_back(col)) + { + delete col; + delete idx; + return -1; + } /** * reverse map @@ -2067,7 +2176,11 @@ NdbDictInterface::createIndex(Ndb & ndb, } const BaseString internalName( ndb.internalize_index_name(&table, impl.getName())); - impl.m_internalName.assign(internalName); + if (!impl.m_internalName.assign(internalName)) + { + m_error.code = 4000; + return -1; + } w.add(DictTabInfo::TableName, internalName.c_str()); w.add(DictTabInfo::TableLoggedFlag, impl.m_logging); @@ -2353,34 +2466,72 @@ NdbDictInterface::listObjects(NdbDictionary::Dictionary::List& list, BaseString databaseName; BaseString schemaName; BaseString objectName; + if (!databaseName || !schemaName || !objectName) + { + m_error.code= 4000; + return -1; + } if ((element.type == NdbDictionary::Object::UniqueHashIndex) || (element.type == NdbDictionary::Object::OrderedIndex)) { char * indexName = new char[n << 2]; + if (indexName == NULL) + { + m_error.code= 4000; + return -1; + } memcpy(indexName, &data[pos], n << 2); - databaseName = Ndb::getDatabaseFromInternalName(indexName); - schemaName = Ndb::getSchemaFromInternalName(indexName); + if (!(databaseName = Ndb::getDatabaseFromInternalName(indexName)) || + !(schemaName = Ndb::getSchemaFromInternalName(indexName))) + { + delete [] indexName; + m_error.code= 4000; + return -1; + } objectName = BaseString(Ndb::externalizeIndexName(indexName, fullyQualifiedNames)); delete [] indexName; } else if ((element.type == NdbDictionary::Object::SystemTable) || (element.type == NdbDictionary::Object::UserTable)) { char * tableName = new char[n << 2]; + if (tableName == NULL) + { + m_error.code= 4000; + return -1; + } memcpy(tableName, &data[pos], n << 2); - databaseName = Ndb::getDatabaseFromInternalName(tableName); - schemaName = Ndb::getSchemaFromInternalName(tableName); + if (!(databaseName = Ndb::getDatabaseFromInternalName(tableName)) || + !(schemaName = Ndb::getSchemaFromInternalName(tableName))) + { + delete [] tableName; + m_error.code= 4000; + return -1; + } objectName = BaseString(Ndb::externalizeTableName(tableName, fullyQualifiedNames)); delete [] tableName; } else { char * otherName = new char[n << 2]; + if (otherName == NULL) + { + m_error.code= 4000; + return -1; + } memcpy(otherName, &data[pos], n << 2); - objectName = BaseString(otherName); + if (!(objectName = BaseString(otherName))) + { + m_error.code= 4000; + return -1; + } delete [] otherName; } - element.database = new char[databaseName.length() + 1]; + if (!(element.database = new char[databaseName.length() + 1]) || + !(element.schema = new char[schemaName.length() + 1]) || + !(element.name = new char[objectName.length() + 1])) + { + m_error.code= 4000; + return -1; + } strcpy(element.database, databaseName.c_str()); - element.schema = new char[schemaName.length() + 1]; strcpy(element.schema, schemaName.c_str()); - element.name = new char[objectName.length() + 1]; strcpy(element.name, objectName.c_str()); pos += n; count++; @@ -2427,7 +2578,10 @@ NdbDictInterface::execLIST_TABLES_CONF(NdbApiSignal* signal, { const unsigned off = ListTablesConf::HeaderLength; const unsigned len = (signal->getLength() - off); - m_buffer.append(signal->getDataPtr() + off, len << 2); + if (m_buffer.append(signal->getDataPtr() + off, len << 2)) + { + m_error.code= 4000; + } if (signal->getLength() < ListTablesConf::SignalLength) { // last signal has less than full length m_waiter.signal(NO_WAIT); diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 6d58a703a3c..819de921235 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -103,7 +103,7 @@ public: ~NdbTableImpl(); void init(); - void setName(const char * name); + int setName(const char * name); const char * getName() const; Uint32 m_changeMask; @@ -120,7 +120,7 @@ public: Uint32 m_columnHashMask; Vector m_columnHash; Vector m_columns; - void buildColumnHash(); + int buildColumnHash(); /** * Fragment info @@ -166,7 +166,7 @@ public: * Equality/assign */ bool equal(const NdbTableImpl&) const; - void assign(const NdbTableImpl&); + int assign(const NdbTableImpl&); static NdbTableImpl & getImpl(NdbDictionary::Table & t); static NdbTableImpl & getImpl(const NdbDictionary::Table & t); @@ -185,9 +185,9 @@ public: ~NdbIndexImpl(); void init(); - void setName(const char * name); + int setName(const char * name); const char * getName() const; - void setTable(const char * table); + int setTable(const char * table); const char * getTable() const; const NdbTableImpl * getIndexTable() const; diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 90b81dabff6..ec386074692 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -37,7 +37,7 @@ struct Ndb_free_list_t Ndb_free_list_t(); ~Ndb_free_list_t(); - void fill(Ndb*, Uint32 cnt); + int fill(Ndb*, Uint32 cnt); T* seize(Ndb*); void release(T*); void clear(); @@ -79,10 +79,14 @@ public: BaseString m_prefix; // Buffer for preformatted internal name // - void update_prefix() + int update_prefix() { - m_prefix.assfmt("%s%c%s%c", m_dbname.c_str(), table_name_separator, - m_schemaname.c_str(), table_name_separator); + if (!m_prefix.assfmt("%s%c%s%c", m_dbname.c_str(), table_name_separator, + m_schemaname.c_str(), table_name_separator)) + { + return -1; + } + return 0; } /** @@ -194,7 +198,7 @@ Ndb_free_list_t::~Ndb_free_list_t() template inline -void +int Ndb_free_list_t::fill(Ndb* ndb, Uint32 cnt) { if (m_free_list == 0) @@ -202,18 +206,28 @@ Ndb_free_list_t::fill(Ndb* ndb, Uint32 cnt) m_free_cnt++; m_alloc_cnt++; m_free_list = new T(ndb); + if (m_free_list == 0) + { + ndb->theError.code = 4000; + assert(false); + return -1; + } } while(m_alloc_cnt < cnt) { T* obj= new T(ndb); if(obj == 0) - return; - + { + ndb->theError.code = 4000; + assert(false); + return -1; + } obj->next(m_free_list); m_free_cnt++; m_alloc_cnt++; m_free_list = obj; } + return 0; } template @@ -234,7 +248,11 @@ Ndb_free_list_t::seize(Ndb* ndb) { m_alloc_cnt++; } - + else + { + ndb->theError.code = 4000; + assert(false); + } return tmp; } diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index 3ab1b56a717..51b6a3f6dab 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -176,7 +176,11 @@ NdbOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection){ tcKeyReq->scanInfo = 0; theKEYINFOptr = &tcKeyReq->keyInfo[0]; theATTRINFOptr = &tcKeyReq->attrInfo[0]; - theReceiver.init(NdbReceiver::NDB_OPERATION, this); + if (theReceiver.init(NdbReceiver::NDB_OPERATION, this)) + { + // theReceiver sets the error code of its owner + return -1; + } return 0; } diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 90808a706d4..77578147d99 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -83,6 +83,7 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) theRef = tRef; return 0; } + errno = ENOMEM; return -1; } @@ -102,7 +103,11 @@ NdbRecAttr::copyout() NdbRecAttr * NdbRecAttr::clone() const { NdbRecAttr * ret = new NdbRecAttr(0); - + if (ret == NULL) + { + errno = ENOMEM; + return NULL; + } ret->theAttrId = theAttrId; ret->theNULLind = theNULLind; ret->theAttrSize = theAttrSize; @@ -116,6 +121,12 @@ NdbRecAttr::clone() const { ret->theValue = 0; } else { ret->theStorageX = new Uint64[((n + 7) >> 3)]; + if (ret->theStorageX == NULL) + { + delete ret; + errno = ENOMEM; + return NULL; + } ret->theRef = (char*)ret->theStorageX; ret->theValue = 0; } diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp index 9322f88a351..46ca59f2f42 100644 --- a/ndb/src/ndbapi/NdbReceiver.cpp +++ b/ndb/src/ndbapi/NdbReceiver.cpp @@ -32,7 +32,7 @@ NdbReceiver::NdbReceiver(Ndb *aNdb) : { theCurrentRecAttr = theFirstRecAttr = 0; m_defined_rows = 0; - m_rows = new NdbRecAttr*[0]; + m_rows = NULL; } NdbReceiver::~NdbReceiver() @@ -45,19 +45,26 @@ NdbReceiver::~NdbReceiver() DBUG_VOID_RETURN; } -void +int NdbReceiver::init(ReceiverType type, void* owner) { theMagicNumber = 0x11223344; m_type = type; m_owner = owner; - if (m_id == NdbObjectIdMap::InvalidId) { - if (m_ndb) - m_id = m_ndb->theImpl->theNdbObjectIdMap.map(this); - } - theFirstRecAttr = NULL; theCurrentRecAttr = NULL; + if (m_id == NdbObjectIdMap::InvalidId) { + if (m_ndb) + { + m_id = m_ndb->theImpl->theNdbObjectIdMap.map(this); + if (m_id == NdbObjectIdMap::InvalidId) + { + setErrorCode(4000); + return -1; + } + } + } + return 0; } void @@ -146,7 +153,7 @@ NdbReceiver::calculate_batch_size(Uint32 key_size, return; } -void +int NdbReceiver::do_get_value(NdbReceiver * org, Uint32 rows, Uint32 key_size, @@ -154,7 +161,11 @@ NdbReceiver::do_get_value(NdbReceiver * org, if(rows > m_defined_rows){ delete[] m_rows; m_defined_rows = rows; - m_rows = new NdbRecAttr*[rows + 1]; + if ((m_rows = new NdbRecAttr*[rows + 1]) == NULL) + { + setErrorCode(4000); + return -1; + } } m_rows[rows] = 0; @@ -174,7 +185,7 @@ NdbReceiver::do_get_value(NdbReceiver * org, // Put key-recAttr fir on each row if(key_size && !getValue(&key, (char*)0)){ abort(); - return ; // -1 + return -1; } if(range_no && @@ -193,7 +204,7 @@ NdbReceiver::do_get_value(NdbReceiver * org, if(tRecAttr){ abort(); - return ;// -1; + return -1; } // Store first recAttr for each row in m_rows[i] @@ -205,7 +216,7 @@ NdbReceiver::do_get_value(NdbReceiver * org, } prepareSend(); - return; + return 0; } NdbRecAttr* diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index eb0ef4ba391..fb47772fdea 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -78,7 +78,11 @@ NdbScanFilter::~NdbScanFilter(){ int NdbScanFilter::begin(Group group){ - m_impl.m_stack2.push_back(m_impl.m_negative); + if (m_impl.m_stack2.push_back(m_impl.m_negative)) + { + m_impl.m_operation->setErrorCodeAbort(4000); + return -1; + } switch(group){ case NdbScanFilter::AND: INT_DEBUG(("Begin(AND)")); @@ -127,7 +131,11 @@ NdbScanFilter::begin(Group group){ } NdbScanFilterImpl::State tmp = m_impl.m_current; - m_impl.m_stack.push_back(m_impl.m_current); + if (m_impl.m_stack.push_back(m_impl.m_current)) + { + m_impl.m_operation->setErrorCodeAbort(4000); + return -1; + } m_impl.m_current.m_group = group; m_impl.m_current.m_ownLabel = m_impl.m_label++; m_impl.m_current.m_popCount = 0; diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 8433b70f0b2..91c788b0088 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -797,9 +797,12 @@ int NdbScanOperation::prepareSendScan(Uint32 aTC_ConnectPtr, req->requestInfo = reqInfo; for(Uint32 i = 0; ido_get_value(&theReceiver, batch_size, - key_size, - m_read_range_no); + if (m_receivers[i]->do_get_value(&theReceiver, batch_size, + key_size, + m_read_range_no)) + { + return -1; + } } return 0; } diff --git a/ndb/src/ndbapi/NdbTransaction.cpp b/ndb/src/ndbapi/NdbTransaction.cpp index 2fe43b8cc21..258330b3967 100644 --- a/ndb/src/ndbapi/NdbTransaction.cpp +++ b/ndb/src/ndbapi/NdbTransaction.cpp @@ -81,6 +81,7 @@ NdbTransaction::NdbTransaction( Ndb* aNdb ) : { theListState = NotInList; theError.code = 0; + //theId = NdbObjectIdMap::InvalidId; theId = theNdb->theImpl->theNdbObjectIdMap.map(this); #define CHECK_SZ(mask, sz) assert((sizeof(mask)/sizeof(mask[0])) == sz) @@ -106,7 +107,7 @@ void init(); Remark: Initialise connection object for new transaction. *****************************************************************************/ -void +int NdbTransaction::init() { theListState = NotInList; @@ -147,6 +148,17 @@ NdbTransaction::init() // theBlobFlag = false; thePendingBlobOps = 0; + if (theId == NdbObjectIdMap::InvalidId) + { + theId = theNdb->theImpl->theNdbObjectIdMap.map(this); + if (theId == NdbObjectIdMap::InvalidId) + { + theError.code = 4000; + return -1; + } + } + return 0; + }//NdbTransaction::init() /***************************************************************************** diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index 75ec5df60cb..bcc0d9d997c 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -816,8 +816,9 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) InvalidSignal: #ifdef VM_TRACE ndbout_c("Ndbif: Error Ndb::handleReceivedSignal " - "(GSN=%d, theImpl->theWaiter.m_state=%d)" + "(tFirstDataPtr=%x, GSN=%d, theImpl->theWaiter.m_state=%d)" " sender = (Block: %d Node: %d)", + tFirstDataPtr, tSignalNumber, tWaitState, refToBlock(aSignal->theSendersBlockRef), diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index 812410e283f..443f9bb42fc 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -74,7 +74,10 @@ Ndb::checkFailedNode() int Ndb::createConIdleList(int aNrOfCon) { - theImpl->theConIdleList.fill(this, aNrOfCon); + if (theImpl->theConIdleList.fill(this, aNrOfCon)) + { + return -1; + } return aNrOfCon; } @@ -90,7 +93,10 @@ Ndb::createConIdleList(int aNrOfCon) int Ndb::createOpIdleList(int aNrOfOp) { - theImpl->theOpIdleList.fill(this, aNrOfOp); + if (theImpl->theOpIdleList.fill(this, aNrOfOp)) + { + return -1; + } return aNrOfOp; } diff --git a/ndb/src/ndbapi/ObjectMap.cpp b/ndb/src/ndbapi/ObjectMap.cpp new file mode 100644 index 00000000000..c87911a10d4 --- /dev/null +++ b/ndb/src/ndbapi/ObjectMap.cpp @@ -0,0 +1,62 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "ObjectMap.hpp" + +NdbObjectIdMap::NdbObjectIdMap(NdbMutex* mutex, Uint32 sz, Uint32 eSz) +{ + m_size = 0; + m_firstFree = InvalidId; + m_map = 0; + m_mutex = mutex; + m_expandSize = eSz; + expand(sz); +#ifdef DEBUG_OBJECTMAP + ndbout_c("NdbObjectIdMap:::NdbObjectIdMap(%u)", sz); +#endif +} + +NdbObjectIdMap::~NdbObjectIdMap() +{ + free(m_map); +} + +int NdbObjectIdMap::expand(Uint32 incSize) +{ + NdbMutex_Lock(m_mutex); + Uint32 newSize = m_size + incSize; + MapEntry * tmp = (MapEntry*)realloc(m_map, newSize * sizeof(MapEntry)); + + if (likely(tmp != 0)) + { + m_map = tmp; + + for(Uint32 i = m_size; i < newSize; i++){ + m_map[i].m_next = i + 1; + } + m_firstFree = m_size; + m_map[newSize-1].m_next = InvalidId; + m_size = newSize; + } + else + { + NdbMutex_Unlock(m_mutex); + g_eventLogger.error("NdbObjectIdMap::expand: realloc(%u*%u) failed", + newSize, sizeof(MapEntry)); + return -1; + } + NdbMutex_Unlock(m_mutex); + return 0; +} diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index 0e0c9668164..6a8dbcbeef5 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -20,6 +20,9 @@ //#include #include +#include +extern EventLogger g_eventLogger; + //#define DEBUG_OBJECTMAP /** @@ -49,24 +52,6 @@ private: int expand(Uint32 newSize); }; -inline -NdbObjectIdMap::NdbObjectIdMap(NdbMutex* mutex, Uint32 sz, Uint32 eSz) { - m_size = 0; - m_firstFree = InvalidId; - m_map = 0; - m_mutex = mutex; - m_expandSize = eSz; - expand(sz); -#ifdef DEBUG_OBJECTMAP - ndbout_c("NdbObjectIdMap:::NdbObjectIdMap(%u)", sz); -#endif -} - -inline -NdbObjectIdMap::~NdbObjectIdMap(){ - free(m_map); -} - inline Uint32 NdbObjectIdMap::map(void * object){ @@ -102,7 +87,8 @@ NdbObjectIdMap::unmap(Uint32 id, void *object){ m_map[i].m_next = m_firstFree; m_firstFree = i; } else { - ndbout_c("Error: NdbObjectIdMap::::unmap(%u, 0x%x) obj=0x%x", id, object, obj); + g_eventLogger.error("NdbObjectIdMap::unmap(%u, 0x%x) obj=0x%x", + id, object, obj); return 0; } @@ -128,31 +114,4 @@ NdbObjectIdMap::getObject(Uint32 id){ } return 0; } - -inline int -NdbObjectIdMap::expand(Uint32 incSize){ - NdbMutex_Lock(m_mutex); - Uint32 newSize = m_size + incSize; - MapEntry * tmp = (MapEntry*)realloc(m_map, newSize * sizeof(MapEntry)); - - if (likely(tmp != 0)) - { - m_map = tmp; - - for(Uint32 i = m_size; i= 0 && m_impl.m_all_nodes[i].group > m_impl.m_all_nodes[i+1].group; @@ -449,7 +452,7 @@ Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, do_test(); #endif - DBUG_VOID_RETURN; + DBUG_RETURN(0); } void @@ -532,7 +535,11 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, break; m_impl.m_transporter_facade->start_instance(nodeId, props); - m_impl.init_nodes_vector(nodeId, *props); + if (m_impl.init_nodes_vector(nodeId, *props)) + { + ndbout_c("Ndb_cluster_connection::connect: malloc failure"); + DBUG_RETURN(-1); + } for(unsigned i=0; iget_registry()->m_transporter_interface.size(); diff --git a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp index 5bb5f0a0fca..d3ff7610e18 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp +++ b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp @@ -68,7 +68,7 @@ private: }; Vector m_all_nodes; - void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); + int init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); void connect_thread(); void set_name(const char *name); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 93ca6b7f96d..16bdf4da132 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -203,6 +203,7 @@ static const err_code_mapping err_map[]= { 284, HA_ERR_TABLE_DEF_CHANGED, 0 }, + {4000, HA_ERR_OUT_OF_MEM, 1 }, {4009, HA_ERR_NO_CONNECTION, 1 }, { 0, 1, 0 }, @@ -372,7 +373,10 @@ int ha_ndbcluster::records_update() { Ndb *ndb= get_ndb(); struct Ndb_statistics stat; - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + return my_errno= HA_ERR_OUT_OF_MEM; + } result= ndb_get_table_statistics(this, true, ndb, m_tabname, &stat); if (result == 0) { @@ -841,7 +845,11 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob, DBUG_PRINT("value", ("allocate blobs buffer size %u", offset)); m_blobs_buffer= my_malloc(offset, MYF(MY_WME)); if (m_blobs_buffer == NULL) + { + sql_print_error("ha_ndbcluster::get_ndb_blobs_value: " + "my_malloc(%u) failed", offset); DBUG_RETURN(-1); + } m_blobs_buffer_size= offset; } } @@ -1026,6 +1034,12 @@ static int fix_unique_index_attr_order(NDB_INDEX_DATA &data, if (data.unique_index_attrid_map) my_free((char*)data.unique_index_attrid_map, MYF(0)); data.unique_index_attrid_map= (unsigned char*)my_malloc(sz,MYF(MY_WME)); + if (data.unique_index_attrid_map == 0) + { + sql_print_error("fix_unique_index_attr_order: my_malloc(%u) failure", + (unsigned int)sz); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } KEY_PART_INFO* key_part= key_info->key_part; KEY_PART_INFO* end= key_part+key_info->key_parts; @@ -3228,7 +3242,10 @@ int ha_ndbcluster::info(uint flag) DBUG_RETURN(my_errno); Ndb *ndb= get_ndb(); struct Ndb_statistics stat; - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM); + } if (current_thd->variables.ndb_use_exact_count && (result= ndb_get_table_statistics(this, true, ndb, m_tabname, &stat)) == 0) @@ -4038,7 +4055,10 @@ static int create_ndb_column(NDBCOL &col, HA_CREATE_INFO *info) { // Set name - col.setName(field->field_name); + if (col.setName(field->field_name)) + { + return (my_errno= errno); + } // Get char set CHARSET_INFO *cs= field->charset(); // Set type and sizes @@ -4410,7 +4430,10 @@ int ha_ndbcluster::create(const char *name, } DBUG_PRINT("table", ("name: %s", m_tabname)); - tab.setName(m_tabname); + if (tab.setName(m_tabname)) + { + DBUG_RETURN(my_errno= errno); + } tab.setLogging(!(create_info->options & HA_LEX_CREATE_TMP_TABLE)); // Save frm data for this table @@ -4435,7 +4458,10 @@ int ha_ndbcluster::create(const char *name, field->pack_length())); if ((my_errno= create_ndb_column(col, field, create_info))) DBUG_RETURN(my_errno); - tab.addColumn(col); + if (tab.addColumn(col)) + { + DBUG_RETURN(my_errno= errno); + } if (col.getPrimaryKey()) pk_length += (field->pack_length() + 3) / 4; } @@ -4444,13 +4470,19 @@ int ha_ndbcluster::create(const char *name, if (form->s->primary_key == MAX_KEY) { DBUG_PRINT("info", ("Generating shadow key")); - col.setName("$PK"); + if (col.setName("$PK")) + { + DBUG_RETURN(my_errno= errno); + } col.setType(NdbDictionary::Column::Bigunsigned); col.setLength(1); col.setNullable(FALSE); col.setPrimaryKey(TRUE); col.setAutoIncrement(TRUE); - tab.addColumn(col); + if (tab.addColumn(col)) + { + DBUG_RETURN(my_errno= errno); + } pk_length += 2; } @@ -4556,13 +4588,19 @@ int ha_ndbcluster::create_index(const char *name, // TODO Only temporary ordered indexes supported ndb_index.setLogging(FALSE); } - ndb_index.setTable(m_tabname); + if (ndb_index.setTable(m_tabname)) + { + DBUG_RETURN(my_errno= errno); + } for (; key_part != end; key_part++) { Field *field= key_part->field; DBUG_PRINT("info", ("attr: %s", field->field_name)); - ndb_index.addColumnName(field->field_name); + if (ndb_index.addColumnName(field->field_name)) + { + DBUG_RETURN(my_errno= errno); + } } if (dict->createIndex(ndb_index)) @@ -4617,7 +4655,10 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) m_table= (void *)orig_tab; // Change current database to that of target table set_dbname(to); - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } if (!(result= alter_table_name(new_tabname))) { // Rename .ndb file @@ -4636,10 +4677,16 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) for (unsigned i = 0; i < index_list.count; i++) { NDBDICT::List::Element& index_el = index_list.elements[i]; set_dbname(from); - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } const NDBINDEX * index= dict->getIndex(index_el.name, *new_tab); set_dbname(to); - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } DBUG_PRINT("info", ("Creating index %s/%s", m_dbname, index->getName())); dict->createIndex(*index); @@ -4647,7 +4694,10 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) m_dbname, index->getName())); set_dbname(from); - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } dict->dropIndex(*index); } } @@ -4668,7 +4718,10 @@ int ha_ndbcluster::alter_table_name(const char *to) DBUG_ENTER("alter_table_name_table"); NdbDictionary::Table new_tab= *orig_tab; - new_tab.setName(to); + if (new_tab.setName(to)) + { + DBUG_RETURN(my_errno= errno); + } if (dict->alterTable(new_tab) != 0) ERR_RETURN(dict->getNdbError()); @@ -4914,7 +4967,10 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked) if (!res) { Ndb *ndb= get_ndb(); - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } struct Ndb_statistics stat; res= ndb_get_table_statistics(NULL, false, ndb, m_tabname, &stat); records= stat.row_count; @@ -4946,6 +5002,11 @@ Thd_ndb* ha_ndbcluster::seize_thd_ndb() DBUG_ENTER("seize_thd_ndb"); thd_ndb= new Thd_ndb(); + if (thd_ndb == NULL) + { + my_errno= HA_ERR_OUT_OF_MEM; + return NULL; + } thd_ndb->ndb->getDictionary()->set_local_table_data_size( sizeof(Ndb_local_table_statistics) ); @@ -5001,7 +5062,10 @@ int ha_ndbcluster::check_ndb_connection(THD* thd) if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(HA_ERR_NO_CONNECTION); - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } DBUG_RETURN(0); } @@ -5035,8 +5099,10 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name, if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(HA_ERR_NO_CONNECTION); - ndb->setDatabaseName(db); - + if (ndb->setDatabaseName(db)) + { + ERR_RETURN(ndb->getNdbError()); + } NDBDICT* dict= ndb->getDictionary(); dict->set_local_table_data_size(sizeof(Ndb_local_table_statistics)); dict->invalidateTable(name); @@ -5082,8 +5148,10 @@ int ndbcluster_table_exists_in_engine(THD* thd, const char *db, const char *name if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(HA_ERR_NO_CONNECTION); - ndb->setDatabaseName(db); - + if (ndb->setDatabaseName(db)) + { + ERR_RETURN(ndb->getNdbError()); + } NDBDICT* dict= ndb->getDictionary(); dict->set_local_table_data_size(sizeof(Ndb_local_table_statistics)); dict->invalidateTable(name); @@ -5144,7 +5212,10 @@ int ndbcluster_drop_database(const char *path) drop_list.push_back(thd->strdup(t.name)); } // Drop any tables belonging to database - ndb->setDatabaseName(dbname); + if (ndb->setDatabaseName(dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } List_iterator_fast it(drop_list); while ((tabname=it++)) { @@ -5373,6 +5444,7 @@ bool ndbcluster_init() { DBUG_PRINT("error",("Ndb_cluster_connection(%s)", opt_ndbcluster_connectstring)); + my_errno= HA_ERR_OUT_OF_MEM; goto ndbcluster_init_error; } { @@ -5387,6 +5459,7 @@ bool ndbcluster_init() if ( (g_ndb= new Ndb(g_ndb_cluster_connection, "sys")) == 0 ) { DBUG_PRINT("error", ("failed to create global ndb object")); + my_errno= HA_ERR_OUT_OF_MEM; goto ndbcluster_init_error; } g_ndb->getDictionary()->set_local_table_data_size(sizeof(Ndb_local_table_statistics)); @@ -5742,7 +5815,10 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, Ndb *ndb; if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(1); - ndb->setDatabaseName(dbname); + if (ndb->setDatabaseName(dbname)) + { + ERR_RETURN(ndb->getNdbError()); + } uint lock= share->commit_count_lock; pthread_mutex_unlock(&share->mutex); @@ -5955,6 +6031,8 @@ static NDB_SHARE* get_share(const char *table_name) { DBUG_PRINT("error", ("Failed to alloc share")); pthread_mutex_unlock(&ndbcluster_mutex); + sql_print_error("get_share: my_malloc(%u) failed", + (unsigned int)(sizeof(*share)+length+1)); return 0; } } @@ -6015,16 +6093,22 @@ static int packfrm(const void *data, uint len, error= 1; org_len= len; if (my_compress((byte*)data, &org_len, &comp_len)) + { + sql_print_error("packfrm: my_compress(org_len: %u)", + (unsigned int)org_len); goto err; - + } + DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", org_len, comp_len)); DBUG_DUMP("compressed", (char*)data, org_len); error= 2; blob_len= sizeof(frm_blob_struct::frm_blob_header)+org_len; if (!(blob= (frm_blob_struct*) my_malloc(blob_len,MYF(MY_WME)))) + { + sql_print_error("packfrm: my_malloc(%u)", blob_len); goto err; - + } // Store compressed blob in machine independent format int4store((char*)(&blob->head.ver), 1); int4store((char*)(&blob->head.orglen), comp_len); @@ -6062,14 +6146,23 @@ static int unpackfrm(const void **unpack_data, uint *unpack_len, DBUG_DUMP("blob->data", (char*) blob->data, complen); if (ver != 1) + { + sql_print_error("unpackfrm: ver != 1"); DBUG_RETURN(1); + } if (!(data= my_malloc(max(orglen, complen), MYF(MY_WME)))) - DBUG_RETURN(2); + { + sql_print_error("unpackfrm: my_malloc(%u)", + (unsigned int)max(orglen, complen)); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } memcpy(data, blob->data, complen); if (my_uncompress(data, &complen, &orglen)) { my_free((char*)data, MYF(0)); + sql_print_error("unpackfrm: my_uncompress(complen: %u, orglen: %u)", + (unsigned int)complen, (unsigned int)orglen); DBUG_RETURN(3); } @@ -6663,7 +6756,10 @@ ha_ndbcluster::update_table_comment( return((char*)comment); } - ndb->setDatabaseName(m_dbname); + if (ndb->setDatabaseName(m_dbname)) + { + return((char*)comment); + } NDBDICT* dict= ndb->getDictionary(); const NDBTAB* tab; if (!(tab= dict->getTable(m_tabname))) @@ -6676,6 +6772,8 @@ ha_ndbcluster::update_table_comment( const unsigned fmt_len_plus_extra= length + strlen(fmt); if ((str= my_malloc(fmt_len_plus_extra, MYF(0))) == NULL) { + sql_print_error("ha_ndbcluster::update_table_comment: " + "my_malloc(%u) failed", (unsigned int)fmt_len_plus_extra); return (char*)comment; } @@ -6698,9 +6796,19 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) DBUG_PRINT("enter", ("ndb_cache_check_time: %lu", ndb_cache_check_time)); thd= new THD; /* note that contructor of THD uses DBUG_ */ + if (thd == NULL) + { + my_errno= HA_ERR_OUT_OF_MEM; + DBUG_RETURN(NULL); + } THD_CHECK_SENTRY(thd); ndb= new Ndb(g_ndb_cluster_connection, ""); - + if (ndb == NULL) + { + thd->cleanup(); + delete thd; + DBUG_RETURN(NULL); + } pthread_detach_this_thread(); ndb_util_thread= pthread_self(); @@ -6789,14 +6897,15 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) share->table_name)); /* Contact NDB to get commit count for table */ - ndb->setDatabaseName(db); struct Ndb_statistics stat; - uint lock; pthread_mutex_lock(&share->mutex); lock= share->commit_count_lock; pthread_mutex_unlock(&share->mutex); - + if (ndb->setDatabaseName(db)) + { + goto loop_next; + } if (ndb_get_table_statistics(NULL, false, ndb, tabname, &stat) == 0) { #ifndef DBUG_OFF @@ -6815,7 +6924,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) share->table_name)); stat.commit_count= 0; } - + loop_next: pthread_mutex_lock(&share->mutex); if (share->commit_count_lock == lock) share->commit_count= stat.commit_count; @@ -6884,6 +6993,11 @@ ha_ndbcluster::cond_push(const COND *cond) { DBUG_ENTER("cond_push"); Ndb_cond_stack *ndb_cond = new Ndb_cond_stack(); + if (ndb_cond == NULL) + { + my_errno= HA_ERR_OUT_OF_MEM; + DBUG_RETURN(NULL); + } DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname);); if (m_cond_stack) ndb_cond->next= m_cond_stack; From f8c9cef1cd2389677c4dced15d569f6845e1a3f7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 18:10:45 +0200 Subject: [PATCH 643/789] Bug#26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11 - try to catch as many malloc failures as possible and give error messages (more for 5.1) storage/ndb/src/ndbapi/ObjectMap.cpp: Rename: ndb/src/ndbapi/ObjectMap.cpp -> storage/ndb/src/ndbapi/ObjectMap.cpp --- storage/ndb/include/ndbapi/NdbDictionary.hpp | 20 +-- storage/ndb/include/util/Vector.hpp | 1 + storage/ndb/src/ndbapi/NdbDictionary.cpp | 40 ++--- storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 138 +++++++++++------- storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp | 31 ++-- {ndb => storage/ndb}/src/ndbapi/ObjectMap.cpp | 0 6 files changed, 136 insertions(+), 94 deletions(-) rename {ndb => storage/ndb}/src/ndbapi/ObjectMap.cpp (100%) diff --git a/storage/ndb/include/ndbapi/NdbDictionary.hpp b/storage/ndb/include/ndbapi/NdbDictionary.hpp index 0770a2164ce..626a82eaef4 100644 --- a/storage/ndb/include/ndbapi/NdbDictionary.hpp +++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp @@ -819,9 +819,9 @@ public: */ void setMaxLoadFactor(int); - void setTablespaceName(const char * name); + int setTablespaceName(const char * name); const char * getTablespaceName() const; - void setTablespace(const class Tablespace &); + int setTablespace(const class Tablespace &); bool getTablespace(Uint32 *id= 0, Uint32 *version= 0) const; /** @@ -862,12 +862,12 @@ public: * Node group identity * Fragment State */ - void setFragmentData(const void* data, Uint32 len); + int setFragmentData(const void* data, Uint32 len); /** * Set/Get tablespace names per fragment */ - void setTablespaceNames(const void* data, Uint32 len); + int setTablespaceNames(const void* data, Uint32 len); const void *getTablespaceNames(); Uint32 getTablespaceNamesLen() const; @@ -875,7 +875,7 @@ public: * Set tablespace information per fragment * Contains a tablespace id and a tablespace version */ - void setTablespaceData(const void* data, Uint32 len); + int setTablespaceData(const void* data, Uint32 len); /** * Set array of information mapping range values and list values @@ -884,7 +884,7 @@ public: * one pair per fragment. For list partitions it could be any number * of pairs, at least as many as there are fragments. */ - void setRangeListData(const void* data, Uint32 len); + int setRangeListData(const void* data, Uint32 len); /** * Set table object type @@ -1281,7 +1281,7 @@ public: /** * Set unique identifier for the event */ - void setName(const char *name); + int setName(const char *name); /** * Get unique identifier for the event */ @@ -1308,7 +1308,7 @@ public: * @note preferred way is using setTable(const NdbDictionary::Table&) * or constructor with table object parameter */ - void setTable(const char *tableName); + int setTable(const char *tableName); /** * Get table name for events * @@ -1534,8 +1534,8 @@ public: Uint64 getSize() const; Uint64 getFree() const; - void setTablespace(const char * name); - void setTablespace(const class Tablespace &); + int setTablespace(const char * name); + int setTablespace(const class Tablespace &); const char * getTablespace() const; void getTablespaceId(ObjectId * dst) const; diff --git a/storage/ndb/include/util/Vector.hpp b/storage/ndb/include/util/Vector.hpp index 7530bca3b38..7ae4228985d 100644 --- a/storage/ndb/include/util/Vector.hpp +++ b/storage/ndb/include/util/Vector.hpp @@ -116,6 +116,7 @@ Vector::push_back(const T & t){ } m_items[m_size] = t; m_size++; + return 0; } template diff --git a/storage/ndb/src/ndbapi/NdbDictionary.cpp b/storage/ndb/src/ndbapi/NdbDictionary.cpp index b268490db23..b3ee41358d9 100644 --- a/storage/ndb/src/ndbapi/NdbDictionary.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionary.cpp @@ -519,10 +519,10 @@ NdbDictionary::Table::setSingleUserMode(enum NdbDictionary::Table::SingleUserMod m_impl.m_single_user_mode = (Uint8)mode; } -void +int NdbDictionary::Table::setTablespaceNames(const void *data, Uint32 len) { - m_impl.setTablespaceNames(data, len); + return m_impl.setTablespaceNames(data, len); } const void* @@ -576,10 +576,10 @@ NdbDictionary::Table::getFragmentDataLen() const { return m_impl.getFragmentDataLen(); } -void +int NdbDictionary::Table::setFragmentData(const void* data, Uint32 len) { - m_impl.setFragmentData(data, len); + return m_impl.setFragmentData(data, len); } const void* @@ -592,10 +592,10 @@ NdbDictionary::Table::getTablespaceDataLen() const { return m_impl.getTablespaceDataLen(); } -void +int NdbDictionary::Table::setTablespaceData(const void* data, Uint32 len) { - m_impl.setTablespaceData(data, len); + return m_impl.setTablespaceData(data, len); } const void* @@ -608,10 +608,10 @@ NdbDictionary::Table::getRangeListDataLen() const { return m_impl.getRangeListDataLen(); } -void +int NdbDictionary::Table::setRangeListData(const void* data, Uint32 len) { - m_impl.setRangeListData(data, len); + return m_impl.setRangeListData(data, len); } NdbDictionary::Object::Status @@ -693,18 +693,18 @@ NdbDictionary::Table::getTablespaceName() const return m_impl.m_tablespace_name.c_str(); } -void +int NdbDictionary::Table::setTablespaceName(const char * name){ m_impl.m_tablespace_id = ~0; m_impl.m_tablespace_version = ~0; - m_impl.m_tablespace_name.assign(name); + return !m_impl.m_tablespace_name.assign(name); } -void +int NdbDictionary::Table::setTablespace(const NdbDictionary::Tablespace & ts){ m_impl.m_tablespace_id = NdbTablespaceImpl::getImpl(ts).m_id; m_impl.m_tablespace_version = ts.getObjectVersion(); - m_impl.m_tablespace_name.assign(ts.getName()); + return !m_impl.m_tablespace_name.assign(ts.getName()); } void @@ -936,10 +936,10 @@ NdbDictionary::Event::~Event() } } -void +int NdbDictionary::Event::setName(const char * name) { - m_impl.setName(name); + return m_impl.setName(name); } const char * @@ -960,10 +960,10 @@ NdbDictionary::Event::getTable() const return m_impl.getTable(); } -void +int NdbDictionary::Event::setTable(const char * table) { - m_impl.setTable(table); + return m_impl.setTable(table); } const char* @@ -1295,18 +1295,18 @@ NdbDictionary::Datafile::getFree() const { return m_impl.m_free; } -void +int NdbDictionary::Datafile::setTablespace(const char * tablespace){ m_impl.m_filegroup_id = ~0; m_impl.m_filegroup_version = ~0; - m_impl.m_filegroup_name.assign(tablespace); + return !m_impl.m_filegroup_name.assign(tablespace); } -void +int NdbDictionary::Datafile::setTablespace(const NdbDictionary::Tablespace & ts){ m_impl.m_filegroup_id = NdbTablespaceImpl::getImpl(ts).m_id; m_impl.m_filegroup_version = ts.getObjectVersion(); - m_impl.m_filegroup_name.assign(ts.getName()); + return !m_impl.m_filegroup_name.assign(ts.getName()); } const char * diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 9f1866729a0..6bd09e02297 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -881,9 +881,9 @@ NdbTableImpl::getTablespaceNamesLen() const return m_new_ts_name.length(); } -void NdbTableImpl::setTablespaceNames(const void *data, Uint32 len) +int NdbTableImpl::setTablespaceNames(const void *data, Uint32 len) { - m_new_ts_name.assign(data, len); + return !m_new_ts_name.assign(data, len); } void NdbTableImpl::setFragmentCount(Uint32 count) @@ -896,9 +896,9 @@ Uint32 NdbTableImpl::getFragmentCount() const return m_fragmentCount; } -void NdbTableImpl::setFrm(const void* data, Uint32 len) +int NdbTableImpl::setFrm(const void* data, Uint32 len) { - m_newFrm.assign(data, len); + return m_newFrm.assign(data, len); } const void * @@ -919,9 +919,9 @@ NdbTableImpl::getFrmLength() const return m_newFrm.length(); } -void NdbTableImpl::setFragmentData(const void* data, Uint32 len) +int NdbTableImpl::setFragmentData(const void* data, Uint32 len) { - m_new_fd.assign(data, len); + return m_new_fd.assign(data, len); } const void * @@ -942,9 +942,9 @@ NdbTableImpl::getFragmentDataLen() const return m_new_fd.length(); } -void NdbTableImpl::setTablespaceData(const void* data, Uint32 len) +int NdbTableImpl::setTablespaceData(const void* data, Uint32 len) { - m_new_ts.assign(data, len); + return !m_new_ts.assign(data, len); } const void * @@ -965,9 +965,9 @@ NdbTableImpl::getTablespaceDataLen() const return m_new_ts.length(); } -void NdbTableImpl::setRangeListData(const void* data, Uint32 len) +int NdbTableImpl::setRangeListData(const void* data, Uint32 len) { - m_new_range.assign(data, len); + return m_new_range.assign(data, len); } const void * @@ -988,16 +988,15 @@ NdbTableImpl::getRangeListDataLen() const return m_new_range.length(); } -void +int NdbTableImpl::updateMysqlName() { Vector v; if (m_internalName.split(v,"/") == 3) { - m_mysqlName.assfmt("%s/%s",v[0].c_str(),v[2].c_str()); - return; + return !m_mysqlName.assfmt("%s/%s",v[0].c_str(),v[2].c_str()); } - m_mysqlName.assign(""); + return !m_mysqlName.assign(""); } int @@ -1274,9 +1273,9 @@ NdbEventImpl::~NdbEventImpl() DBUG_VOID_RETURN; } -void NdbEventImpl::setName(const char * name) +int NdbEventImpl::setName(const char * name) { - m_name.assign(name); + !m_name.assign(name); } const char *NdbEventImpl::getName() const @@ -1284,11 +1283,11 @@ const char *NdbEventImpl::getName() const return m_name.c_str(); } -void +int NdbEventImpl::setTable(const NdbDictionary::Table& table) { setTable(&NdbTableImpl::getImpl(table)); - m_tableName.assign(m_tableImpl->getName()); + return !m_tableName.assign(m_tableImpl->getName()); } void @@ -1313,10 +1312,10 @@ NdbEventImpl::getTable() const return NULL; } -void +int NdbEventImpl::setTable(const char * table) { - m_tableName.assign(table); + return !m_tableName.assign(table); } const char * @@ -1467,10 +1466,11 @@ NdbDictionaryImpl::putTable(NdbTableImpl *impl) NdbTableImpl *old; int ret = getBlobTables(*impl); + int error = 0; assert(ret == 0); m_globalHash->lock(); - if ((old= m_globalHash->get(impl->m_internalName.c_str()))) + if ((old= m_globalHash->get(impl->m_internalName.c_str(), &error))) { m_globalHash->alter_table_rep(old->m_internalName.c_str(), impl->m_id, @@ -2334,8 +2334,13 @@ NdbDictionaryImpl::createTable(NdbTableImpl &t) // if the new name has not been set, use the copied name if (t.m_newExternalName.empty()) - t.m_newExternalName.assign(t.m_externalName); - + { + if (!t.m_newExternalName.assign(t.m_externalName)) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } + } // create table if (m_receiver.createTable(m_ndb, t) != 0) DBUG_RETURN(-1); @@ -2510,7 +2515,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, { AlterTableReq::setNameFlag(impl.m_changeMask, true); } - if (impl.m_externalName.assign(impl.m_newExternalName)) + if (!impl.m_externalName.assign(impl.m_newExternalName)) { m_error.code= 4000; DBUG_RETURN(-1); @@ -2524,7 +2529,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, { AlterTableReq::setFrmFlag(impl.m_changeMask, true); } - impl.m_frm.assign(impl.m_newFrm.get_data(), impl.m_newFrm.length()); + if (impl.m_frm.assign(impl.m_newFrm.get_data(), impl.m_newFrm.length())) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } impl.m_newFrm.clear(); } // Change FragmentData (fragment identity, state, tablespace id) @@ -2534,7 +2543,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, { AlterTableReq::setFragDataFlag(impl.m_changeMask, true); } - impl.m_fd.assign(impl.m_new_fd.get_data(), impl.m_new_fd.length()); + if (impl.m_fd.assign(impl.m_new_fd.get_data(), impl.m_new_fd.length())) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } impl.m_new_fd.clear(); } // Change Tablespace Name Data @@ -2544,8 +2557,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, { AlterTableReq::setTsNameFlag(impl.m_changeMask, true); } - impl.m_ts_name.assign(impl.m_new_ts_name.get_data(), - impl.m_new_ts_name.length()); + if (impl.m_ts_name.assign(impl.m_new_ts_name.get_data(), + impl.m_new_ts_name.length())) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } impl.m_new_ts_name.clear(); } // Change Range/List Data @@ -2555,8 +2572,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, { AlterTableReq::setRangeListFlag(impl.m_changeMask, true); } - impl.m_range.assign(impl.m_new_range.get_data(), - impl.m_new_range.length()); + if (impl.m_range.assign(impl.m_new_range.get_data(), + impl.m_new_range.length())) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } impl.m_new_range.clear(); } // Change Tablespace Data @@ -2566,8 +2587,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, { AlterTableReq::setTsFlag(impl.m_changeMask, true); } - impl.m_ts.assign(impl.m_new_ts.get_data(), - impl.m_new_ts.length()); + if (impl.m_ts.assign(impl.m_new_ts.get_data(), + impl.m_new_ts.length())) + { + m_error.code= 4000; + DBUG_RETURN(-1); + } impl.m_new_ts.clear(); } @@ -4473,7 +4498,7 @@ NdbTablespaceImpl::NdbTablespaceImpl(NdbDictionary::Tablespace & f) : NdbTablespaceImpl::~NdbTablespaceImpl(){ } -void +int NdbTablespaceImpl::assign(const NdbTablespaceImpl& org) { m_id = org.m_id; @@ -4481,14 +4506,17 @@ NdbTablespaceImpl::assign(const NdbTablespaceImpl& org) m_status = org.m_status; m_type = org.m_type; - m_name.assign(org.m_name); + if (!m_name.assign(org.m_name)) + return -1; m_grow_spec = org.m_grow_spec; m_extent_size = org.m_extent_size; m_undo_free_words = org.m_undo_free_words; m_logfile_group_id = org.m_logfile_group_id; m_logfile_group_version = org.m_logfile_group_version; - m_logfile_group_name.assign(org.m_logfile_group_name); + if (!m_logfile_group_name.assign(org.m_logfile_group_name)) + return -1; m_undo_free_words = org.m_undo_free_words; + return 0; } NdbLogfileGroupImpl::NdbLogfileGroupImpl() : @@ -4506,7 +4534,7 @@ NdbLogfileGroupImpl::NdbLogfileGroupImpl(NdbDictionary::LogfileGroup & f) : NdbLogfileGroupImpl::~NdbLogfileGroupImpl(){ } -void +int NdbLogfileGroupImpl::assign(const NdbLogfileGroupImpl& org) { m_id = org.m_id; @@ -4514,14 +4542,17 @@ NdbLogfileGroupImpl::assign(const NdbLogfileGroupImpl& org) m_status = org.m_status; m_type = org.m_type; - m_name.assign(org.m_name); + if (!m_name.assign(org.m_name)) + return -1; m_grow_spec = org.m_grow_spec; m_extent_size = org.m_extent_size; m_undo_free_words = org.m_undo_free_words; m_logfile_group_id = org.m_logfile_group_id; m_logfile_group_version = org.m_logfile_group_version; - m_logfile_group_name.assign(org.m_logfile_group_name); + if (!m_logfile_group_name.assign(org.m_logfile_group_name)) + return -1; m_undo_free_words = org.m_undo_free_words; + return 0; } NdbFileImpl::NdbFileImpl(NdbDictionary::Object::Type t) @@ -4548,7 +4579,7 @@ NdbDatafileImpl::NdbDatafileImpl(NdbDictionary::Datafile & f) : NdbDatafileImpl::~NdbDatafileImpl(){ } -void +int NdbDatafileImpl::assign(const NdbDatafileImpl& org) { m_id = org.m_id; @@ -4560,8 +4591,10 @@ NdbDatafileImpl::assign(const NdbDatafileImpl& org) m_free = org.m_free; m_filegroup_id = org.m_filegroup_id; m_filegroup_version = org.m_filegroup_version; - m_path.assign(org.m_path); - m_filegroup_name.assign(org.m_filegroup_name); + if (!m_path.assign(org.m_path) || + !m_filegroup_name.assign(org.m_filegroup_name)) + return -1; + return 0; } NdbUndofileImpl::NdbUndofileImpl() : @@ -4579,7 +4612,7 @@ NdbUndofileImpl::NdbUndofileImpl(NdbDictionary::Undofile & f) : NdbUndofileImpl::~NdbUndofileImpl(){ } -void +int NdbUndofileImpl::assign(const NdbUndofileImpl& org) { m_id = org.m_id; @@ -4591,8 +4624,10 @@ NdbUndofileImpl::assign(const NdbUndofileImpl& org) m_free = org.m_free; m_filegroup_id = org.m_filegroup_id; m_filegroup_version = org.m_filegroup_version; - m_path.assign(org.m_path); - m_filegroup_name.assign(org.m_filegroup_name); + if (!m_path.assign(org.m_path) || + !m_filegroup_name.assign(org.m_filegroup_name)) + return 4000; + return 0; } int @@ -5024,7 +5059,8 @@ NdbDictInterface::get_filegroup(NdbFilegroupImpl & dst, get_filegroup(NdbLogfileGroupImpl::getImpl(tmp), NdbDictionary::Object::LogfileGroup, dst.m_logfile_group_id); - dst.m_logfile_group_name.assign(tmp.getName()); + if (!dst.m_logfile_group_name.assign(tmp.getName())) + DBUG_RETURN(m_error.code = 4000); } if(dst.m_type == type) @@ -5058,7 +5094,8 @@ NdbDictInterface::parseFilegroupInfo(NdbFilegroupImpl &dst, dst.m_type = (NdbDictionary::Object::Type)fg.FilegroupType; dst.m_status = NdbDictionary::Object::Retrieved; - dst.m_name.assign(fg.FilegroupName); + if (!dst.m_name.assign(fg.FilegroupName)) + return 4000; dst.m_extent_size = fg.TS_ExtentSize; dst.m_undo_buffer_size = fg.LF_UndoBufferSize; dst.m_logfile_group_id = fg.TS_LogfileGroupId; @@ -5177,7 +5214,8 @@ NdbDictInterface::get_file(NdbFileImpl & dst, get_filegroup(NdbLogfileGroupImpl::getImpl(tmp), NdbDictionary::Object::LogfileGroup, dst.m_filegroup_id); - dst.m_filegroup_name.assign(tmp.getName()); + if (!dst.m_filegroup_name.assign(tmp.getName())) + DBUG_RETURN(m_error.code = 4000); } else if(dst.m_type == NdbDictionary::Object::Datafile) { @@ -5185,7 +5223,8 @@ NdbDictInterface::get_file(NdbFileImpl & dst, get_filegroup(NdbTablespaceImpl::getImpl(tmp), NdbDictionary::Object::Tablespace, dst.m_filegroup_id); - dst.m_filegroup_name.assign(tmp.getName()); + if (!dst.m_filegroup_name.assign(tmp.getName())) + DBUG_RETURN(m_error.code = 4000); dst.m_free *= tmp.getExtentSize(); } else @@ -5221,7 +5260,8 @@ NdbDictInterface::parseFileInfo(NdbFileImpl &dst, dst.m_version = f.FileVersion; dst.m_size= ((Uint64)f.FileSizeHi << 32) | (f.FileSizeLo); - dst.m_path.assign(f.FileName); + if (!dst.m_path.assign(f.FileName)) + return 4000; dst.m_filegroup_id= f.FilegroupId; dst.m_filegroup_version= f.FilegroupVersion; diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 72576bbd273..c904b9d65c3 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -135,24 +135,24 @@ public: const char * getName() const; void setFragmentCount(Uint32 count); Uint32 getFragmentCount() const; - void setFrm(const void* data, Uint32 len); + int setFrm(const void* data, Uint32 len); const void * getFrmData() const; Uint32 getFrmLength() const; - void setFragmentData(const void* data, Uint32 len); + int setFragmentData(const void* data, Uint32 len); const void * getFragmentData() const; Uint32 getFragmentDataLen() const; - void setTablespaceNames(const void* data, Uint32 len); + int setTablespaceNames(const void* data, Uint32 len); Uint32 getTablespaceNamesLen() const; const void * getTablespaceNames() const; - void setTablespaceData(const void* data, Uint32 len); + int setTablespaceData(const void* data, Uint32 len); const void * getTablespaceData() const; Uint32 getTablespaceDataLen() const; - void setRangeListData(const void* data, Uint32 len); + int setRangeListData(const void* data, Uint32 len); const void * getRangeListData() const; Uint32 getRangeListDataLen() const; const char * getMysqlName() const; - void updateMysqlName(); + int updateMysqlName(); int aggregate(NdbError& error); int validate(NdbError& error); @@ -296,11 +296,11 @@ public: ~NdbEventImpl(); void init(); - void setName(const char * name); + int setName(const char * name); const char * getName() const; - void setTable(const NdbDictionary::Table& table); + int setTable(const NdbDictionary::Table& table); const NdbDictionary::Table * getTable() const; - void setTable(const char * table); + int setTable(const char * table); const char * getTableName() const; void addTableEvent(const NdbDictionary::Event::TableEvent t); bool getTableEvent(const NdbDictionary::Event::TableEvent t) const; @@ -364,7 +364,7 @@ public: NdbTablespaceImpl(NdbDictionary::Tablespace &); ~NdbTablespaceImpl(); - void assign(const NdbTablespaceImpl&); + int assign(const NdbTablespaceImpl&); static NdbTablespaceImpl & getImpl(NdbDictionary::Tablespace & t); static const NdbTablespaceImpl & getImpl(const NdbDictionary::Tablespace &); @@ -378,7 +378,7 @@ public: NdbLogfileGroupImpl(NdbDictionary::LogfileGroup &); ~NdbLogfileGroupImpl(); - void assign(const NdbLogfileGroupImpl&); + int assign(const NdbLogfileGroupImpl&); static NdbLogfileGroupImpl & getImpl(NdbDictionary::LogfileGroup & t); static const NdbLogfileGroupImpl& getImpl(const @@ -403,7 +403,7 @@ public: NdbDatafileImpl(NdbDictionary::Datafile &); ~NdbDatafileImpl(); - void assign(const NdbDatafileImpl&); + int assign(const NdbDatafileImpl&); static NdbDatafileImpl & getImpl(NdbDictionary::Datafile & t); static const NdbDatafileImpl & getImpl(const NdbDictionary::Datafile & t); @@ -416,7 +416,7 @@ public: NdbUndofileImpl(NdbDictionary::Undofile &); ~NdbUndofileImpl(); - void assign(const NdbUndofileImpl&); + int assign(const NdbUndofileImpl&); static NdbUndofileImpl & getImpl(NdbDictionary::Undofile & t); static const NdbUndofileImpl & getImpl(const NdbDictionary::Undofile & t); @@ -994,8 +994,9 @@ public: if(NdbDictInterface::create_index_obj_from_table(&idx, &tab, &m_prim) == 0) { idx->m_table = &tab; - idx->m_externalName.assign(m_index_name); - idx->m_internalName.assign(m_name); + if (!idx->m_externalName.assign(m_index_name) || + !idx->m_internalName.assign(m_name)) + DBUG_RETURN(4000); tab.m_index = idx; DBUG_RETURN(0); } diff --git a/ndb/src/ndbapi/ObjectMap.cpp b/storage/ndb/src/ndbapi/ObjectMap.cpp similarity index 100% rename from ndb/src/ndbapi/ObjectMap.cpp rename to storage/ndb/src/ndbapi/ObjectMap.cpp From 48acb9de58d1a6162a24c53d86a6bd856afdb766 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 19:29:32 +0200 Subject: [PATCH 644/789] missing return --- ndb/src/ndbapi/Ndb.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 3e407c43ca1..449f287dc1d 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -1164,6 +1164,7 @@ int Ndb::setSchemaName(const char * a_schema_name) return -1; } } + return 0; } /* From 96d1ae8b4b3bbaf26928586a7946dcc6d809bd33 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 19:38:29 +0200 Subject: [PATCH 645/789] correct merge error --- sql/ha_ndbcluster.cc | 16 +++++----------- storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 385432c0732..5a0f27073d4 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -881,6 +881,7 @@ int get_ndb_blobs_value(TABLE* table, NdbValue* value_array, sql_print_error("ha_ndbcluster::get_ndb_blobs_value: " "my_malloc(%u) failed", offset); DBUG_RETURN(-1); + } buffer_size= offset; } } @@ -8739,12 +8740,6 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) DBUG_RETURN(NULL); } THD_CHECK_SENTRY(thd); - if (ndb == NULL) - { - thd->cleanup(); - delete thd; - DBUG_RETURN(NULL); - } pthread_detach_this_thread(); ndb_util_thread= pthread_self(); @@ -8917,14 +8912,13 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) pthread_mutex_lock(&share->mutex); lock= share->commit_count_lock; pthread_mutex_unlock(&share->mutex); - if (ndb->setDatabaseName(db)) - { - goto loop_next; - } { /* Contact NDB to get commit count for table */ Ndb* ndb= thd_ndb->ndb; - ndb->setDatabaseName(share->db); + if (ndb->setDatabaseName(share->db)) + { + goto loop_next; + } Ndb_table_guard ndbtab_g(ndb->getDictionary(), share->table_name); if (ndbtab_g.get_table() && ndb_get_table_statistics(NULL, FALSE, ndb, diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 6bd09e02297..0d9be372903 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1275,7 +1275,7 @@ NdbEventImpl::~NdbEventImpl() int NdbEventImpl::setName(const char * name) { - !m_name.assign(name); + return !m_name.assign(name); } const char *NdbEventImpl::getName() const From 2671ba02300bf94df7d987c1e594ca2e022e9a69 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 21:16:10 +0300 Subject: [PATCH 646/789] Fixed result. --- mysql-test/r/strict.result | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 74cd723e130..be5473f621e 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -206,6 +206,8 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y')); INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); +Warnings: +Note 1265 Data truncated for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); From 1810062ef13cde77f1dc23f1251b5b47b22e2194 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 20:22:31 +0200 Subject: [PATCH 647/789] remove warning --- ndb/src/ndbapi/Ndbif.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index bcc0d9d997c..d404436be59 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -816,7 +816,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) InvalidSignal: #ifdef VM_TRACE ndbout_c("Ndbif: Error Ndb::handleReceivedSignal " - "(tFirstDataPtr=%x, GSN=%d, theImpl->theWaiter.m_state=%d)" + "(tFirstDataPtr=%p, GSN=%d, theImpl->theWaiter.m_state=%d)" " sender = (Block: %d Node: %d)", tFirstDataPtr, tSignalNumber, From aa051961c9ac4629fd7dca9f236172e47660bbeb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 11:41:12 -0700 Subject: [PATCH 648/789] Fixed bug #27484: a crash when incompatible row expressions with nested rows are used as arguments of the IN predicate. Added a function to check compatibility of row expressions. Made sure that this function to be called for Item_func_in objects by fix_length_and_dec(). mysql-test/r/row.result: Added a test case for bug #27484. mysql-test/t/row.test: Added a test case for bug #27484. --- mysql-test/r/row.result | 18 ++++++++++++ mysql-test/t/row.test | 25 ++++++++++++++++ sql/item_cmpfunc.cc | 65 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 104 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 76d6fa13766..1c1c4809f36 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -170,3 +170,21 @@ ROW(2,10) <=> ROW(3,4) SELECT ROW(NULL,10) <=> ROW(3,NULL); ROW(NULL,10) <=> ROW(3,NULL) 0 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1)); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1),ROW(1,ROW(2,3))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,ROW(2,2,2))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3,4)) IN (ROW(1,ROW(2,3,4)),ROW(1,ROW(2,2))); +ERROR 21000: Operand should contain 3 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1)); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1),ROW(1,ROW(2,4))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(1,ROW(2,3)) IN ((SELECT 1,1),ROW(1,ROW(2,3))); +ERROR 21000: Operand should contain 2 column(s) +SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); +ERROR 21000: Operand should contain 1 column(s) +SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); +ERROR 21000: Operand should contain 1 column(s) diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index d8d9a244134..6c66d45b942 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -83,4 +83,29 @@ drop table t1; SELECT ROW(2,10) <=> ROW(3,4); SELECT ROW(NULL,10) <=> ROW(3,NULL); +# +# Bug #27484: nested row expressions in IN predicate +# + +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1)); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1),ROW(1,ROW(2,3))); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,ROW(2,2,2))); +--error 1241 +SELECT ROW(1,ROW(2,3,4)) IN (ROW(1,ROW(2,3,4)),ROW(1,ROW(2,2))); + +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1)); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1),ROW(1,ROW(2,4))); +--error 1241 +SELECT ROW(1,ROW(2,3)) IN ((SELECT 1,1),ROW(1,ROW(2,3))); + +--error 1241 +SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); +--error 1241 +SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); + # End of 4.1 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 4d54dfc2b39..ce3096da778 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -61,6 +61,42 @@ static void agg_result_type(Item_result *type, Item **items, uint nitems) } +/* + Compare row signature of two expressions + + SYNOPSIS: + cmp_row_type() + item1 the first expression + item2 the second expression + + DESCRIPTION + The function checks that two expressions have compatible row signatures + i.e. that the number of columns they return are the same and that if they + are both row expressions then each component from the first expression has + a row signature compatible with the signature of the corresponding component + of the second expression. + + RETURN VALUES + 1 type incompatibility has been detected + 0 otherwise +*/ + +static int cmp_row_type(Item* item1, Item* item2) +{ + uint n= item1->cols(); + if (item2->check_cols(n)) + return 1; + for (uint i=0; iel(i)->check_cols(item1->el(i)->cols()) || + (item1->el(i)->result_type() == ROW_RESULT && + cmp_row_type(item1->el(i), item2->el(i)))) + return 1; + } + return 0; +} + + /* Aggregates result types from the array of items. @@ -75,14 +111,32 @@ static void agg_result_type(Item_result *type, Item **items, uint nitems) This function aggregates result types from the array of items. Found type supposed to be used later for comparison of values of these items. Aggregation itself is performed by the item_cmp_type() function. + The function also checks compatibility of row signatures for the + submitted items (see the spec for the cmp_row_type function). + + RETURN VALUES + 1 type incompatibility has been detected + 0 otherwise */ -static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems) +static int agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems) { uint i; type[0]= items[0]->result_type(); for (i= 1 ; i < nitems ; i++) + { type[0]= item_cmp_type(type[0], items[i]->result_type()); + /* + When aggregating types of two row expressions we have to check + that they have the same cardinality and that each component + of the first row expression has a compatible row signature with + the signature of the corresponding component of the second row + expression. + */ + if (type[0] == ROW_RESULT && cmp_row_type(items[0], items[i])) + return 1; // error found: invalid usage of rows + } + return 0; } static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, @@ -984,7 +1038,8 @@ void Item_func_between::fix_length_and_dec() */ if (!args[0] || !args[1] || !args[2]) return; - agg_cmp_type(thd, &cmp_type, args, 3); + if ( agg_cmp_type(thd, &cmp_type, args, 3)) + return; if (cmp_type == STRING_RESULT && agg_arg_charsets(cmp_collation, args, 3, MY_COLL_CMP_CONV)) return; @@ -1532,7 +1587,8 @@ void Item_func_case::fix_length_and_dec() for (nagg= 0; nagg < ncases/2 ; nagg++) agg[nagg+1]= args[nagg*2]; nagg++; - agg_cmp_type(current_thd, &cmp_type, agg, nagg); + if (agg_cmp_type(current_thd, &cmp_type, agg, nagg)) + return; if ((cmp_type == STRING_RESULT) && agg_arg_charsets(cmp_collation, agg, nagg, MY_COLL_CMP_CONV)) return; @@ -2013,7 +2069,8 @@ void Item_func_in::fix_length_and_dec() uint const_itm= 1; THD *thd= current_thd; - agg_cmp_type(thd, &cmp_type, args, arg_count); + if (agg_cmp_type(thd, &cmp_type, args, arg_count)) + return; if (cmp_type == STRING_RESULT && agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV)) From d032b0e56c44538c57ae36145ebee2ef73071aaa Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 21:01:10 +0200 Subject: [PATCH 649/789] Add test for connect using different ssl ciphers mysql-test/r/openssl_1.result: Update result --- mysql-test/r/openssl_1.result | 7 +++++++ mysql-test/t/openssl_1.test | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 92900ac1a83..0552ca0e8bb 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -53,3 +53,10 @@ SSL error: Unable to get certificate from '' mysqltest: Could not open connection 'default': 2026 SSL connection error Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher AES128-SHA +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher AES128-SHA +mysqltest: Could not open connection 'default': 2026 SSL connection error diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 362443023e1..dbe8bdd8940 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -104,3 +104,24 @@ drop table t1; # and ca path to NULL # --exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1 + + +# +# Test to connect using a list of ciphers +# +--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER:AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 + + +# Test to connect using a specifi cipher +# +--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--exec $MYSQL_TEST --ssl-cipher=AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 + +# Test to connect using an unknown cipher +# +--exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--error 1 +--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 + + From d25a540dca1814d5a905544a88d93f936bc61137 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 21:38:43 +0200 Subject: [PATCH 650/789] Print warning to log when SSL setup fails --- sql/mysqld.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b0fc5a30ff5..33b400faca2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3046,6 +3046,7 @@ static void init_ssl() DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd)); if (!ssl_acceptor_fd) { + sql_print_warning("Failed to setup SSL"); opt_use_ssl = 0; have_ssl= SHOW_OPTION_DISABLED; } From 8d40fa58edab227caa66c3977a7efe3f0fc5876f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 12:45:27 -0700 Subject: [PATCH 651/789] Post-merge fix. --- mysql-test/r/row.result | 6 ++++++ sql/item_cmpfunc.cc | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 3a8ab6b8346..bb9e2109f0f 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -193,6 +193,12 @@ SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0)); ERROR 21000: Operand should contain 1 column(s) SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2)); ERROR 21000: Operand should contain 1 column(s) +SELECT ROW(1,1,1) = ROW(1,1,1) as `1`, ROW(1,1,1) = ROW(1,2,1) as `0`, ROW(1,NULL,1) = ROW(2,2,1) as `0`, ROW(1,NULL,1) = ROW(1,2,2) as `0`, ROW(1,NULL,1) = ROW(1,2,1) as `null` ; +1 0 0 0 null +1 0 0 0 NULL +select row(NULL,1)=(2,0); +row(NULL,1)=(2,0) +0 CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b)); INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (1,2), (3,2), (3,3); EXPLAIN SELECT * FROM t1 WHERE a=3 AND b=2; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 071762419fc..f9844f6d36e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -95,9 +95,9 @@ static int cmp_row_type(Item* item1, Item* item2) return 1; for (uint i=0; iel(i)->check_cols(item1->el(i)->cols()) || - (item1->el(i)->result_type() == ROW_RESULT && - cmp_row_type(item1->el(i), item2->el(i)))) + if (item2->element_index(i)->check_cols(item1->element_index(i)->cols()) || + (item1->element_index(i)->result_type() == ROW_RESULT && + cmp_row_type(item1->element_index(i), item2->element_index(i)))) return 1; } return 0; From c6b0cff186dc8a275da5775e0207edac5cb2b1f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 22:07:24 +0200 Subject: [PATCH 652/789] Bug#21765 Illegal Instruction crash on pre-pentium when using YASSL - Import patch with different method of detecting if machine has cpuid instruction extra/yassl/taocrypt/src/misc.cpp: Import patch yassl.diff --- extra/yassl/taocrypt/src/misc.cpp | 37 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index 726d9e630e6..402645c93fd 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -192,27 +192,32 @@ bool HaveCpuId() } return true; #else - typedef void (*SigHandler)(int); - - SigHandler oldHandler = signal(SIGILL, SigIllHandler); - if (oldHandler == SIG_ERR) - return false; - - bool result = true; - if (setjmp(s_env)) - result = false; - else + word32 eax, ebx; __asm__ __volatile ( - // save ebx in case -fPIC is being used - "push %%ebx; mov $0, %%eax; cpuid; pop %%ebx" - : + /* Put EFLAGS in eax and ebx */ + "pushf;" + "pushf;" + "pop %0;" + "movl %0,%1;" + + /* Flip the cpuid bit and store back in EFLAGS */ + "xorl $0x200000,%0;" + "push %0;" + "popf;" + + /* Read EFLAGS again */ + "pushf;" + "pop %0;" + "popf" + : "=r" (eax), "=r" (ebx) : - : "%eax", "%ecx", "%edx" + : "cc" ); - signal(SIGILL, oldHandler); - return result; + if (eax == ebx) + return false; + return true; #endif } From 35c10cca215934d48db267097f4567b0c03b4c65 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 23:42:53 +0200 Subject: [PATCH 653/789] Bug#27669 mysqldump: Got error: 2026: SSL connection error when trying to connect - Add testcase for SSL connection from mysqldump to mysqld mysql-test/r/openssl_1.result: Add test result mysql-test/t/openssl_1.test: Add test case for mysqldump with SSL connection to mysqld --- mysql-test/r/openssl_1.result | 98 +++++++++++++++++++++++++++++++++++ mysql-test/t/openssl_1.test | 19 +++++++ 2 files changed, 117 insertions(+) diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index d0a0253ba17..3f10eed7ad7 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -63,3 +63,101 @@ SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher AES128-SHA mysqltest: Could not open connection 'default': 2026 SSL connection error +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +); + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT INTO `t1` VALUES (1),(2); +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +); + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT INTO `t1` VALUES (1),(2); +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +); + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT INTO `t1` VALUES (1),(2); +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.pem' +mysqldump: Got error: 2026: SSL connection error when trying to connect +DROP TABLE t1; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 4d0e6a8d9d1..a752e990846 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -132,4 +132,23 @@ drop table t1; --error 1 --exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 +# +# Bug #27669 mysqldump: SSL connection error when trying to connect +# +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); + +# Run mysqldump +--exec $MYSQL_DUMP --skip-create --skip-comments --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test t1 + +--exec $MYSQL_DUMP --skip-create --skip-comments --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test + +--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test + +# With wrong parameters +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 2 +--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1 + +DROP TABLE t1; From 359594ccd2bc10b6d5ca6ab68997880987a26faa Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Apr 2007 16:13:09 -0700 Subject: [PATCH 654/789] Adding files to support building for debian. --- Removed reference to debian svn location of debian dir. Changed verbage of comment to appease Timothy. --- Removed added manpages that aren't appropriate for our build. --- Added debian dir to list of dist targets. Added list of files needed to be distributed in debian dir. --- Added semi-colons to fix syntax error. --- BUG#27769 MySQL should include debian packaing dir Added debian/Makefile to configure.in to support make dist. BitKeeper/deleted/.del-configure.in.rej: Delete: configure.in.rej Makefile.am: Added debian dir to list of dist targets. configure.in: Added debian/Makefile to configure.in to support make dist BitKeeper/deleted/.del-comp_err.1: Adding files to support building for debian. BitKeeper/deleted/.del-msql2mysql.1: Adding files to support building for debian. BitKeeper/deleted/.del-my_print_defaults.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisam_ftdump.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisamchk.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisamlog.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisampack.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_config.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_convert_table_format.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_explain_log.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_find_rows.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_fix_extensions.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_install_db.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_secure_installation.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_setpermission.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_tableinfo.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_waitpid.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlbinlog.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlbug.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlcheck.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqldumpslow.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlimport.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlmanager.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqltest.1: Adding files to support building for debian. BitKeeper/deleted/.del-pack_isam.1: Adding files to support building for debian. BitKeeper/deleted/.del-resolve_stack_dump.1: Adding files to support building for debian. BitKeeper/deleted/.del-resolveip.1: Adding files to support building for debian. debian/Makefile.am: Added list of files needed to be distributed in debian dir. debian/README.Maintainer: Adding files to support building for debian. --- Removed reference to debian svn location of debian dir. Changed verbage of comment to appease Timothy. debian/changelog: Adding files to support building for debian. debian/compat: Adding files to support building for debian. debian/control.in: Adding files to support building for debian. debian/copyright.more: Adding files to support building for debian. debian/copyright: Adding files to support building for debian. debian/defs.mk: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.README.Maintainer.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.dirs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.docs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.examples.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.files.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.links.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.README.Debian.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.dirs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.docs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.files.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.postinst.in: Adding files to support building for debian. debian/libndbclientNDBSOVER-dev.dirs.in: Adding files to support building for debian. debian/libndbclientNDBSOVER-dev.files.in: Adding files to support building for debian. debian/libndbclientNDBSOVER-dev.links.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.README.Debian.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.dirs.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.files.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.postinst.in: Adding files to support building for debian. debian/mysql-client-MYVER.NEWS.in: Adding files to support building for debian. debian/mysql-client-MYVER.README.Debian.in: Adding files to support building for debian. debian/mysql-client-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-client-MYVER.docs.in: Adding files to support building for debian. debian/mysql-client-MYVER.files.in: Adding files to support building for debian. debian/mysql-client-MYVER.lintian-overrides.in: Adding files to support building for debian. debian/mysql-common.README.Debian.in: Adding files to support building for debian. debian/mysql-common.dirs.in: Adding files to support building for debian. debian/mysql-common.files.in: Adding files to support building for debian. debian/mysql-common.postrm.in: Adding files to support building for debian. debian/mysql-common.preinst.in: Adding files to support building for debian. debian/mysql-extra-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-extra-MYVER.files.in: Adding files to support building for debian. debian/mysql-management-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-management-MYVER.files.in: Adding files to support building for debian. debian/mysql-management-MYVER.mysql-management.init.in: Adding files to support building for debian. debian/mysql-server-MYOLDVER.preinst.in: Adding files to support building for debian. debian/mysql-server-MYVER.NEWS.in: Adding files to support building for debian. debian/mysql-server-MYVER.README.Debian.in: Adding files to support building for debian. debian/mysql-server-MYVER.config.in: Adding files to support building for debian. debian/mysql-server-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-server-MYVER.docs.in: Adding files to support building for debian. debian/mysql-server-MYVER.files.in: Adding files to support building for debian. debian/mysql-server-MYVER.links.in: Adding files to support building for debian. debian/mysql-server-MYVER.lintian-overrides.in: Adding files to support building for debian. debian/mysql-server-MYVER.logcheck.ignore.paranoid.in: Adding files to support building for debian. debian/mysql-server-MYVER.logcheck.ignore.server.in: Adding files to support building for debian. debian/mysql-server-MYVER.logcheck.ignore.workstation.in: Adding files to support building for debian. debian/mysql-server-MYVER.mysql-server.logrotate.in: Adding files to support building for debian. debian/mysql-server-MYVER.postinst.in: Adding files to support building for debian. debian/mysql-server-MYVER.postrm.in: Adding files to support building for debian. debian/additions/my.cnf: Adding files to support building for debian. debian/additions/mysql-server.lintian-overrides: Adding files to support building for debian. debian/additions/ndb_mgmd.cnf: Adding files to support building for debian. debian/mysql-server-MYVER.preinst.in: Adding files to support building for debian. debian/mysql-server-MYVER.prerm.in: Adding files to support building for debian. debian/mysql-server-MYVER.templates.in: Adding files to support building for debian. debian/mysql-server.preinst.in: Adding files to support building for debian. debian/mysql-storage-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-storage-MYVER.files.in: Adding files to support building for debian. debian/mysql-storage-MYVER.mysql-storage.init.in: Adding files to support building for debian. debian/mysql-test-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-test-MYVER.files.in: Adding files to support building for debian. debian/mysql-tools-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-tools-MYVER.files.in: Adding files to support building for debian. debian/po/POTFILES.in.in: Adding files to support building for debian. debian/po/ca.po: Adding files to support building for debian. debian/po/cs.po: Adding files to support building for debian. debian/po/da.po: Adding files to support building for debian. debian/po/de.po: Adding files to support building for debian. debian/po/es.po: Adding files to support building for debian. debian/po/eu.po: Adding files to support building for debian. debian/po/fr.po: Adding files to support building for debian. debian/po/gl.po: Adding files to support building for debian. debian/po/it.po: Adding files to support building for debian. debian/po/ja.po: Adding files to support building for debian. debian/po/nb.po: Adding files to support building for debian. debian/po/nl.po: Adding files to support building for debian. debian/po/pt.po: Adding files to support building for debian. debian/po/pt_BR.po: Adding files to support building for debian. debian/po/ro.po: Adding files to support building for debian. debian/po/ru.po: Adding files to support building for debian. debian/po/sv.po: Adding files to support building for debian. debian/po/templates.pot: Adding files to support building for debian. debian/po/tr.po: Adding files to support building for debian. debian/rules: Adding files to support building for debian. --- Added semi-colons to fix syntax error. debian/source.lintian-overrides.in: Adding files to support building for debian. debian/watch: Adding files to support building for debian. --- Makefile.am | 3 +- configure.in | 1 + configure.in.rej | 299 -- debian/Makefile.am | 21 + debian/README.Maintainer | 99 + debian/additions/my.cnf | 134 + .../additions/mysql-server.lintian-overrides | 2 + debian/additions/ndb_mgmd.cnf | 35 + debian/changelog | 3269 +++++++++++++++++ debian/compat | 1 + debian/control.in | 355 ++ debian/copyright | 139 + debian/copyright.more | 60 + debian/defs.mk | 5 + ...ysqlclientMYSOVER-dev.README.Maintainer.in | 4 + debian/libmysqlclientMYSOVER-dev.dirs.in | 2 + debian/libmysqlclientMYSOVER-dev.docs.in | 1 + debian/libmysqlclientMYSOVER-dev.examples.in | 1 + debian/libmysqlclientMYSOVER-dev.files.in | 7 + debian/libmysqlclientMYSOVER-dev.links.in | 2 + debian/libmysqlclientMYSOVER.README.Debian.in | 30 + debian/libmysqlclientMYSOVER.dirs.in | 1 + debian/libmysqlclientMYSOVER.docs.in | 1 + debian/libmysqlclientMYSOVER.files.in | 1 + debian/libmysqlclientMYSOVER.postinst.in | 12 + debian/libndbclientNDBSOVER-dev.dirs.in | 3 + debian/libndbclientNDBSOVER-dev.files.in | 3 + debian/libndbclientNDBSOVER-dev.links.in | 1 + debian/libndbclientNDBSOVER.README.Debian.in | 30 + debian/libndbclientNDBSOVER.dirs.in | 1 + debian/libndbclientNDBSOVER.files.in | 1 + debian/libndbclientNDBSOVER.postinst.in | 12 + debian/mysql-client-MYVER.NEWS.in | 6 + debian/mysql-client-MYVER.README.Debian.in | 4 + debian/mysql-client-MYVER.dirs.in | 2 + debian/mysql-client-MYVER.docs.in | 2 + debian/mysql-client-MYVER.files.in | 18 + .../mysql-client-MYVER.lintian-overrides.in | 1 + debian/mysql-common.README.Debian.in | 20 + debian/mysql-common.dirs.in | 1 + debian/mysql-common.files.in | 2 + debian/mysql-common.postrm.in | 7 + debian/mysql-common.preinst.in | 215 ++ debian/mysql-extra-MYVER.dirs.in | 1 + debian/mysql-extra-MYVER.files.in | 3 + debian/mysql-management-MYVER.dirs.in | 1 + debian/mysql-management-MYVER.files.in | 1 + ...-management-MYVER.mysql-management.init.in | 86 + debian/mysql-server-MYOLDVER.preinst.in | 191 + debian/mysql-server-MYVER.NEWS.in | 10 + debian/mysql-server-MYVER.README.Debian.in | 125 + debian/mysql-server-MYVER.config.in | 39 + debian/mysql-server-MYVER.dirs.in | 13 + debian/mysql-server-MYVER.docs.in | 2 + debian/mysql-server-MYVER.files.in | 50 + debian/mysql-server-MYVER.links.in | 1 + .../mysql-server-MYVER.lintian-overrides.in | 4 + ...l-server-MYVER.logcheck.ignore.paranoid.in | 10 + ...sql-server-MYVER.logcheck.ignore.server.in | 31 + ...erver-MYVER.logcheck.ignore.workstation.in | 31 + ...sql-server-MYVER.mysql-server.logrotate.in | 28 + debian/mysql-server-MYVER.postinst.in | 276 ++ debian/mysql-server-MYVER.postrm.in | 92 + debian/mysql-server-MYVER.preinst.in | 167 + debian/mysql-server-MYVER.prerm.in | 8 + debian/mysql-server-MYVER.templates.in | 71 + debian/mysql-server.preinst.in | 191 + debian/mysql-storage-MYVER.dirs.in | 1 + debian/mysql-storage-MYVER.files.in | 1 + .../mysql-storage-MYVER.mysql-storage.init.in | 85 + debian/mysql-test-MYVER.dirs.in | 2 + debian/mysql-test-MYVER.files.in | 6 + debian/mysql-tools-MYVER.dirs.in | 2 + debian/mysql-tools-MYVER.files.in | 13 + debian/po/POTFILES.in.in | 1 + debian/po/ca.po | 290 ++ debian/po/cs.po | 259 ++ debian/po/da.po | 283 ++ debian/po/de.po | 195 + debian/po/es.po | 288 ++ debian/po/eu.po | 163 + debian/po/fr.po | 204 + debian/po/gl.po | 279 ++ debian/po/it.po | 184 + debian/po/ja.po | 278 ++ debian/po/nb.po | 179 + debian/po/nl.po | 187 + debian/po/pt.po | 198 + debian/po/pt_BR.po | 339 ++ debian/po/ro.po | 193 + debian/po/ru.po | 172 + debian/po/sv.po | 225 ++ debian/po/templates.pot | 155 + debian/po/tr.po | 290 ++ debian/rules | 400 ++ debian/source.lintian-overrides.in | 6 + debian/watch | 3 + 97 files changed, 10827 insertions(+), 300 deletions(-) delete mode 100644 configure.in.rej create mode 100755 debian/Makefile.am create mode 100644 debian/README.Maintainer create mode 100644 debian/additions/my.cnf create mode 100644 debian/additions/mysql-server.lintian-overrides create mode 100644 debian/additions/ndb_mgmd.cnf create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control.in create mode 100644 debian/copyright create mode 100644 debian/copyright.more create mode 100644 debian/defs.mk create mode 100644 debian/libmysqlclientMYSOVER-dev.README.Maintainer.in create mode 100644 debian/libmysqlclientMYSOVER-dev.dirs.in create mode 100644 debian/libmysqlclientMYSOVER-dev.docs.in create mode 100644 debian/libmysqlclientMYSOVER-dev.examples.in create mode 100644 debian/libmysqlclientMYSOVER-dev.files.in create mode 100644 debian/libmysqlclientMYSOVER-dev.links.in create mode 100644 debian/libmysqlclientMYSOVER.README.Debian.in create mode 100644 debian/libmysqlclientMYSOVER.dirs.in create mode 100644 debian/libmysqlclientMYSOVER.docs.in create mode 100644 debian/libmysqlclientMYSOVER.files.in create mode 100644 debian/libmysqlclientMYSOVER.postinst.in create mode 100644 debian/libndbclientNDBSOVER-dev.dirs.in create mode 100644 debian/libndbclientNDBSOVER-dev.files.in create mode 100644 debian/libndbclientNDBSOVER-dev.links.in create mode 100644 debian/libndbclientNDBSOVER.README.Debian.in create mode 100644 debian/libndbclientNDBSOVER.dirs.in create mode 100644 debian/libndbclientNDBSOVER.files.in create mode 100644 debian/libndbclientNDBSOVER.postinst.in create mode 100644 debian/mysql-client-MYVER.NEWS.in create mode 100644 debian/mysql-client-MYVER.README.Debian.in create mode 100644 debian/mysql-client-MYVER.dirs.in create mode 100644 debian/mysql-client-MYVER.docs.in create mode 100644 debian/mysql-client-MYVER.files.in create mode 100644 debian/mysql-client-MYVER.lintian-overrides.in create mode 100644 debian/mysql-common.README.Debian.in create mode 100644 debian/mysql-common.dirs.in create mode 100644 debian/mysql-common.files.in create mode 100644 debian/mysql-common.postrm.in create mode 100644 debian/mysql-common.preinst.in create mode 100644 debian/mysql-extra-MYVER.dirs.in create mode 100644 debian/mysql-extra-MYVER.files.in create mode 100644 debian/mysql-management-MYVER.dirs.in create mode 100644 debian/mysql-management-MYVER.files.in create mode 100644 debian/mysql-management-MYVER.mysql-management.init.in create mode 100644 debian/mysql-server-MYOLDVER.preinst.in create mode 100644 debian/mysql-server-MYVER.NEWS.in create mode 100644 debian/mysql-server-MYVER.README.Debian.in create mode 100644 debian/mysql-server-MYVER.config.in create mode 100644 debian/mysql-server-MYVER.dirs.in create mode 100644 debian/mysql-server-MYVER.docs.in create mode 100644 debian/mysql-server-MYVER.files.in create mode 100644 debian/mysql-server-MYVER.links.in create mode 100644 debian/mysql-server-MYVER.lintian-overrides.in create mode 100644 debian/mysql-server-MYVER.logcheck.ignore.paranoid.in create mode 100644 debian/mysql-server-MYVER.logcheck.ignore.server.in create mode 100644 debian/mysql-server-MYVER.logcheck.ignore.workstation.in create mode 100644 debian/mysql-server-MYVER.mysql-server.logrotate.in create mode 100644 debian/mysql-server-MYVER.postinst.in create mode 100644 debian/mysql-server-MYVER.postrm.in create mode 100644 debian/mysql-server-MYVER.preinst.in create mode 100644 debian/mysql-server-MYVER.prerm.in create mode 100644 debian/mysql-server-MYVER.templates.in create mode 100644 debian/mysql-server.preinst.in create mode 100644 debian/mysql-storage-MYVER.dirs.in create mode 100644 debian/mysql-storage-MYVER.files.in create mode 100644 debian/mysql-storage-MYVER.mysql-storage.init.in create mode 100644 debian/mysql-test-MYVER.dirs.in create mode 100644 debian/mysql-test-MYVER.files.in create mode 100644 debian/mysql-tools-MYVER.dirs.in create mode 100644 debian/mysql-tools-MYVER.files.in create mode 100644 debian/po/POTFILES.in.in create mode 100644 debian/po/ca.po create mode 100644 debian/po/cs.po create mode 100644 debian/po/da.po create mode 100644 debian/po/de.po create mode 100644 debian/po/es.po create mode 100644 debian/po/eu.po create mode 100644 debian/po/fr.po create mode 100644 debian/po/gl.po create mode 100644 debian/po/it.po create mode 100644 debian/po/ja.po create mode 100644 debian/po/nb.po create mode 100644 debian/po/nl.po create mode 100644 debian/po/pt.po create mode 100644 debian/po/pt_BR.po create mode 100644 debian/po/ro.po create mode 100644 debian/po/ru.po create mode 100644 debian/po/sv.po create mode 100644 debian/po/templates.pot create mode 100644 debian/po/tr.po create mode 100755 debian/rules create mode 100644 debian/source.lintian-overrides.in create mode 100644 debian/watch diff --git a/Makefile.am b/Makefile.am index ed54b630aea..28551d52da7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,7 +32,8 @@ DIST_SUBDIRS = . include @docs_dirs@ zlib \ @thread_dirs@ pstack \ @sql_union_dirs@ scripts @man_dirs@ tests SSL\ BUILD netware os2 @libmysqld_dirs@ \ - @bench_dirs@ support-files @tools_dirs@ win + @bench_dirs@ support-files @tools_dirs@ win \ + debian # Run these targets before any others, also make part of clean target, # to make sure we create new links after a clean. diff --git a/configure.in b/configure.in index 9b0505a594f..c508fdfc580 100644 --- a/configure.in +++ b/configure.in @@ -2896,6 +2896,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl cmd-line-utils/libedit/Makefile dnl win/Makefile dnl zlib/Makefile dnl + debian/Makefile dnl cmd-line-utils/readline/Makefile) AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h) AC_OUTPUT diff --git a/configure.in.rej b/configure.in.rej deleted file mode 100644 index 46fbf83b198..00000000000 --- a/configure.in.rej +++ /dev/null @@ -1,299 +0,0 @@ -*************** -*** 388,402 **** - if expr "$target_os" : "[[Ll]]inux.*" > /dev/null - then - MYSQLD_DEFAULT_SWITCHES="--skip-locking" -! IS_LINUX="true" - AC_MSG_RESULT("yes"); - else - MYSQLD_DEFAULT_SWITCHES="" -! IS_LINUX="false" - AC_MSG_RESULT("no"); - fi - AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -! AC_SUBST(IS_LINUX) - - dnl Find paths to some shell programs - AC_PATH_PROG(LN, ln, ln) ---- 388,403 ---- - if expr "$target_os" : "[[Ll]]inux.*" > /dev/null - then - MYSQLD_DEFAULT_SWITCHES="--skip-locking" -! TARGET_LINUX="true" - AC_MSG_RESULT("yes"); -+ AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux]) - else - MYSQLD_DEFAULT_SWITCHES="" -! TARGET_LINUX="false" - AC_MSG_RESULT("no"); - fi - AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -! AC_SUBST(TARGET_LINUX) - - dnl Find paths to some shell programs - AC_PATH_PROG(LN, ln, ln) -*************** -*** 576,582 **** - # (this is true on the MySQL build machines to avoid NSS problems) - # - -! if test "$IS_LINUX" = "true" -a "$static_nss" = "" - then - tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` - if test -n "$tmp" ---- 577,583 ---- - # (this is true on the MySQL build machines to avoid NSS problems) - # - -! if test "$TARGET_LINUX" = "true" -a "$static_nss" = "" - then - tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` - if test -n "$tmp" -*************** -*** 827,833 **** - ]) - AC_SUBST(WRAPLIBS) - -! if test "$IS_LINUX" = "true"; then - AC_MSG_CHECKING([for atomic operations]) - - AC_LANG_SAVE ---- 828,834 ---- - ]) - AC_SUBST(WRAPLIBS) - -! if test "$TARGET_LINUX" = "true"; then - AC_MSG_CHECKING([for atomic operations]) - - AC_LANG_SAVE -*************** -*** 870,876 **** - [ USE_PSTACK=no ]) - pstack_libs= - pstack_dirs= -! if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" - then - have_libiberty= have_libbfd= - my_save_LIBS="$LIBS" ---- 871,877 ---- - [ USE_PSTACK=no ]) - pstack_libs= - pstack_dirs= -! if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" - then - have_libiberty= have_libbfd= - my_save_LIBS="$LIBS" -*************** -*** 1239,1301 **** - # Hack for DEC-UNIX (OSF1) - if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - then -! # Look for LinuxThreads. -! AC_MSG_CHECKING("LinuxThreads") -! grepres=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep LINUXTHREADS | wc -l || echo 0` -! if test "$grepres" -gt 0 -o "$getconfres" -gt 0 - then -! AC_MSG_RESULT("Found") -! AC_DEFINE(HAVE_LINUXTHREADS) -! # Linux 2.0 sanity check -! AC_TRY_COMPILE([#include ], [int a = sched_get_priority_min(1);], , -! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) -! # RedHat 5.0 does not work with dynamic linking of this. -static also -! # gives a speed increase in linux so it does not hurt on other systems. -! with_named_thread="-lpthread" -! else -! AC_MSG_RESULT("Not found") -! # If this is a linux machine we should barf -! AC_MSG_CHECKING("NPTL") -! if test "$IS_LINUX" = "true" -! then -! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep NPTL | wc -l || echo 0` -! if test "$getconfres" -gt 0 - then -! AC_DEFINE(HAVE_LINUXTHREADS) dnl All this code predates NPTL, so "have linuxthreads" is a poor name. -! with_named_thread="-lpthread" - else -! AC_MSG_ERROR([This is a Linux system and neither Linuxthreads nor NPTL were -! found. Please install Linuxthreads or a new glibc and try -! again. See the Installation chapter in the Reference Manual for -! more information.]) - fi -! else -! AC_MSG_CHECKING("DEC threads") -! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthread -lmach -lexc" -! CFLAGS="$CFLAGS -D_REENTRANT" -! CXXFLAGS="$CXXFLAGS -D_REENTRANT" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! AC_MSG_CHECKING("DEC 3.2 threads") -! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthreads -lmach -lc_r" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_DEFINE(HAVE_DEC_3_2_THREADS) -! with_osf32_threads="yes" -! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority" -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! fi -! fi -! fi -! fi - fi - - ---- 1240,1337 ---- - # Hack for DEC-UNIX (OSF1) - if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - then -! AC_MSG_CHECKING("Linux threads") -! if test "$TARGET_LINUX" = "true" - then -! AC_MSG_RESULT("starting") -! # use getconf to check glibc contents -! AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION") -! case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in -! NPTL* ) -! AC_MSG_RESULT("NPTL") -! AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation]) -! with_named_thread="-lpthread" -! ;; -! LINUXTHREADS* ) -! AC_MSG_RESULT("Linuxthreads") -! AC_DEFINE([HAVE_LINUXTHREADS], [1], -! [Whether we are using Xavier Leroy's LinuxThreads]) -! with_named_thread="-lpthread" -! ;; -! * ) -! AC_MSG_RESULT("unknown") -! ;; -! esac -! if test "$with_named_thread" = "no" - then -! # old method, check headers -! # Look for LinuxThreads. -! AC_MSG_CHECKING("LinuxThreads in header file comment") -! res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` -! if test "$res" -gt 0 -! then -! AC_MSG_RESULT("Found") -! AC_DEFINE([HAVE_LINUXTHREADS], [1], -! [Whether we are using Xavier Leroy's LinuxThreads]) -! # Linux 2.0 sanity check -! AC_TRY_COMPILE([#include ], [int a = sched_get_priority_min(1);], , -! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) -! # RedHat 5.0 does not work with dynamic linking of this. -static also -! # gives a speed increase in linux so it does not hurt on other systems. -! with_named_thread="-lpthread" -! else -! AC_MSG_RESULT("Not found") -! # If this is a linux machine we should barf -! AC_MSG_ERROR([This is a Linux system without a working getconf, -! and Linuxthreads was not found. Please install it (or a new glibc) and try again. -! See the Installation chapter in the Reference Manual for more information.]) -! fi - else -! AC_MSG_RESULT("no need to check headers") - fi -! AC_MSG_CHECKING("for pthread_create in -lpthread"); -! ac_save_LIBS="$LIBS" -! LIBS="$LIBS -lpthread" -! AC_TRY_LINK( [#include ], -! [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], -! AC_MSG_RESULT("yes"), -! [ AC_MSG_RESULT("no") -! AC_MSG_ERROR([ -! This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed. -! Please install one of these (or a new glibc) and try again. -! See the Installation chapter in the Reference Manual for more information.]) ] -! ) -! LIBS="$ac_save_LIBS" -! else -! AC_MSG_RESULT("no") -! fi # "$TARGET_LINUX" -! fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -! -! if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -! then -! AC_MSG_CHECKING("DEC threads") -! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthread -lmach -lexc" -! CFLAGS="$CFLAGS -D_REENTRANT" -! CXXFLAGS="$CXXFLAGS -D_REENTRANT" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! AC_MSG_CHECKING("DEC 3.2 threads") -! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a -! then -! with_named_thread="-lpthreads -lmach -lc_r" -! AC_DEFINE(HAVE_DEC_THREADS) -! AC_DEFINE(HAVE_DEC_3_2_THREADS) -! with_osf32_threads="yes" -! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority" -! AC_MSG_RESULT("yes") -! else -! AC_MSG_RESULT("no") -! fi -! fi - fi - - -*************** -*** 1720,1726 **** - AC_SUBST(COMPILATION_COMMENT) - - AC_MSG_CHECKING("need of special linking flags") -! if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" - then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") ---- 1756,1762 ---- - AC_SUBST(COMPILATION_COMMENT) - - AC_MSG_CHECKING("need of special linking flags") -! if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" - then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") -*************** -*** 1873,1878 **** - tell atod memcpy memmove \ - setupterm strcasecmp sighold vidattr lrand48 localtime_r \ - sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ - pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ - pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ - pthread_attr_getstacksize pthread_key_delete \ ---- 1909,1915 ---- - tell atod memcpy memmove \ - setupterm strcasecmp sighold vidattr lrand48 localtime_r \ - sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ -+ sigaction sigemptyset sigaddset \ - pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ - pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ - pthread_attr_getstacksize pthread_key_delete \ -*************** -*** 1884,1890 **** - # Sanity check: We chould not have any fseeko symbol unless - # large_file_support=yes - AC_CHECK_FUNCS(fseeko, -! [if test "$large_file_support" = no -a "$IS_LINUX" = "true"; - then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); - fi] ---- 1921,1927 ---- - # Sanity check: We chould not have any fseeko symbol unless - # large_file_support=yes - AC_CHECK_FUNCS(fseeko, -! [if test "$large_file_support" = no -a "$TARGET_LINUX" = "true"; - then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); - fi] diff --git a/debian/Makefile.am b/debian/Makefile.am new file mode 100755 index 00000000000..03abbd09184 --- /dev/null +++ b/debian/Makefile.am @@ -0,0 +1,21 @@ +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +## Process this file with automake to create Makefile.in +EXTRA_DIST = mysql-test-MYVER.files.in libndbclientNDBSOVER-dev.files.in mysql-server-MYVER.config.in libndbclientNDBSOVER.README.Debian.in mysql-server-MYVER.postrm.in mysql-server-MYVER.NEWS.in libndbclientNDBSOVER.postinst.in mysql-server-MYVER.links.in libndbclientNDBSOVER.files.in source.lintian-overrides.in mysql-server-MYVER.docs.in libmysqlclientMYSOVER.files.in mysql-server-MYVER.files.in libndbclientNDBSOVER-dev.links.in libmysqlclientMYSOVER.postinst.in mysql-extra-MYVER.dirs.in libmysqlclientMYSOVER-dev.links.in mysql-server-MYVER.dirs.in libmysqlclientMYSOVER-dev.examples.in mysql-client-MYVER.lintian-overrides.in copyright.more libndbclientNDBSOVER-dev.dirs.in mysql-server-MYVER.README.Debian.in libmysqlclientMYSOVER.docs.in compat mysql-test-MYVER.dirs.in libmysqlclientMYSOVER-dev.files.in libmysqlclientMYSOVER.dirs.in mysql-server-MYVER.logcheck.ignore.server.in mysql-storage-MYVER.mysql-storage.init.in libmysqlclientMYSOVER.README.Debian.in mysql-client-MYVER.README.Debian.in Makefile.am mysql-server-MYVER.prerm.in mysql-common.dirs.in defs.mk mysql-server-MYVER.mysql-server.logrotate.in mysql-common.README.Debian.in copyright mysql-storage-MYVER.dirs.in mysql-common.preinst.in mysql-client-MYVER.files.in mysql-server-MYVER.templates.in mysql-tools-MYVER.dirs.in mysql-management-MYVER.mysql-management.init.in watch mysql-common.postrm.in mysql-server-MYVER.preinst.in README.Maintainer mysql-tools-MYVER.files.in mysql-client-MYVER.NEWS.in mysql-server-MYVER.lintian-overrides.in changelog mysql-server-MYVER.logcheck.ignore.paranoid.in mysql-common.files.in mysql-server-MYVER.logcheck.ignore.workstation.in mysql-extra-MYVER.files.in mysql-management-MYVER.files.in mysql-client-MYVER.docs.in libmysqlclientMYSOVER-dev.README.Maintainer.in mysql-storage-MYVER.files.in additions additions/ndb_mgmd.cnf additions/mysql-server.lintian-overrides additions/my.cnf mysql-server-MYVER.postinst.in libndbclientNDBSOVER.dirs.in po po/fr.po po/sv.po po/da.po po/es.po po/ja.po po/tr.po po/nb.po po/POTFILES.in.in po/cs.po po/pt.po po/gl.po po/pt_BR.po po/nl.po po/templates.pot po/de.po po/eu.po po/ro.po po/ru.po po/it.po po/ca.po mysql-client-MYVER.dirs.in control.in libmysqlclientMYSOVER-dev.dirs.in mysql-server-MYOLDVER.preinst.in mysql-server.preinst.in mysql-management-MYVER.dirs.in rules libmysqlclientMYSOVER-dev.docs.in + +# Don't update the files from bitkeeper +%::SCCS/s.% + diff --git a/debian/README.Maintainer b/debian/README.Maintainer new file mode 100644 index 00000000000..80b484d7a6c --- /dev/null +++ b/debian/README.Maintainer @@ -0,0 +1,99 @@ +########################################################################### +# Here are some information that are only of interest to the Debiani # +# maintainers of MySQL. # +########################################################################### + +# +# Remarks to dependencies +# +libwrap0-dev (>= 7.6-8.3) + According to bug report 114582 where where build problems on + IA-64/sid with at least two prior versions. +psmisc + /usr/bin/killall in the initscript + +zlib1g in libmysqlclient-dev: + "mysql_config --libs" adds "-lz" + +Build-Dep: + +debhelper (>=4.1.16): + See po-debconf(7). + +autoconf (>= 2.13-20), automake1.7 + Try to get rid of them. + +doxygen, tetex-bin, tetex-extra, gs + for ndb/docs/*tex + +mysql-server-5.0: Pre-Depends: mysql-common + This was necessary as mysql-server-5.0.preinst checks for unmodified + conffiles from mysql-server-4.1 and copies 5.0 ones over them to avoid + unnecessary dpkg questions. As mysql-server-5.0 is not unpacked at its + pre-inst stage, it had to copy those files from a package that is + definetly already unpacked which does not have to be the case with Depends. + +# +# Remarks to the start scripts +# + +## initscripts rely on mysqladmin from a different package +We have the problem that "/etc/init.d/mysql stop" relies on mysqladmin which +is in another package (mysql-client) and a passwordless access that's maybe +only available if the user configured his /root/.my.cnf. Can this be a problem? +* normal mode: not because the user is required to have it. Else: +* purge/remove: not, same as normal mode +* upgrade: not, same as normal mode +* first install: not, it depends on mysql-client which at least is unpacked + so mysqladmin is there (to ping). It is not yet configured + passwordles but if there's a server running then there's a + /root/.my.cnf. Anyways, we simply kill anything that's mysqld. + +## Passwordless access for the maintainer scripts +Another issue is that the scripts needs passwordless access. To ensure this +a debian-sys-maint user is configured which has process and shutdown privs. +The file with the randomly (that's important!) generated password must be +present as long as the databases remain installed because else a new install +would have no access. This file should be used like: + mysqladmin --defaults-file=/etc/mysql/debian.cnf restart +to avoid providing the password in plaintext on a commandline where it would +be visible to any user via the "ps" command. + +## When to start the daemon? +We aim to give the admin full control on when MySQL is running. +Issues to be faced here: +OLD: + 1. Debconf asks whether MySQL should be started on boot so update-rc.d is + only run if the answer has been yes. The admin is likely to forget + this decision but update-rc.d checks for an existing line in + /etc/runlevel.conf and leaves it intact. + 2. On initial install, if the answer is yes, the daemon has to be started. + 3. On upgrades it should only be started if it was already running, everything + else is confusing. Especiall relying on an debconf decision made month ago + is considered suboptimal. See bug #274264 + Implementation so far: + prerm (called on upgrade before stopping the server): + check for a running server and set flag if necessary + preinst (called on initial install and before unpacking when upgrading): + check for the debconf variable and set flag if necessary + postinst (called on initial install and after each upgrade after unpacking): + call update-rc.d if debconf says yes + call invoce-rc.d if the flag has been set + Problems remaining: + dpkg-reconfigure and setting mysql start on boot to yes did not start mysql + (ok "start on boot" literally does not mean "start now" so that might have been ok) +NEW: + 1. --- no debconf anymore for the sake of simplicity. We have runlevel.conf, + the admin should use it + 2. On initial install the server is started. + 3. On upgrades the server is started exactly if it was running before so the + runlevel configuration is irrelevant. It will be preserved by the mean of + update-rc.d's builtin check. + Implementation: + prerm (called on upgrade before stopping the server): + check for a running server and set flag if necessary + preinst (called on initial install and before unpacking when upgrading): + check for $1 beeing (initial) "install" and set flag + postinst (called on initial install and after each upgrade after unpacking): + call update-rc.d + call invoce-rc.d if the flag has been set diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf new file mode 100644 index 00000000000..a569c041401 --- /dev/null +++ b/debian/additions/my.cnf @@ -0,0 +1,134 @@ +# +# The MySQL database server configuration file. +# +# You can copy this to one of: +# - "/etc/mysql/my.cnf" to set global options, +# - "~/.my.cnf" to set user-specific options. +# +# One can use all long options that the program supports. +# Run program with --help to get a list of available options and with +# --print-defaults to see which it would actually understand and use. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +# This will be passed to all mysql clients +# It has been reported that passwords should be enclosed with ticks/quotes +# escpecially if they contain "#" chars... +# Remember to edit /etc/mysql/debian.cnf when changing the socket location. +[client] +port = 3306 +socket = /var/run/mysqld/mysqld.sock + +# Here is entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = /var/run/mysqld/mysqld.sock +nice = 0 + +[mysqld] +# +# * Basic Settings +# +user = mysql +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +port = 3306 +basedir = /usr +datadir = /var/lib/mysql +tmpdir = /tmp +language = /usr/share/mysql/english +skip-external-locking +# +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +bind-address = 127.0.0.1 +# +# * Fine Tuning +# +key_buffer = 16M +max_allowed_packet = 16M +thread_stack = 128K +thread_cache_size = 8 +# +# * Query Cache Configuration +# +query_cache_limit = 1048576 +query_cache_size = 16777216 +query_cache_type = 1 +# +# * Logging and Replication +# +# Both location gets rotated by the cronjob. +# Be aware that this log type is a performance killer. +#log = /var/log/mysql/mysql.log +# +# Error logging goes to syslog. This is a Debian improvement :) +# +# Here you can see queries with especially long duration +#log_slow_queries = /var/log/mysql/mysql-slow.log +# +# The following can be used as easy to replay backup logs or for replication. +#server-id = 1 +log_bin = /var/log/mysql/mysql-bin.log +# WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian! +expire_logs_days = 10 +max_binlog_size = 100M +#binlog_do_db = include_database_name +#binlog_ignore_db = include_database_name +# +# * BerkeleyDB +# +# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12. +skip-bdb +# +# * InnoDB +# +# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. +# Read the manual for more InnoDB related options. There are many! +# You might want to disable InnoDB to shrink the mysqld process by circa 100MB. +#skip-innodb +# +# * Security Features +# +# Read the manual, too, if you want chroot! +# chroot = /var/lib/mysql/ +# +# For generating SSL certificates I recommend the OpenSSL GUI "tinyca". +# +# ssl-ca=/etc/mysql/cacert.pem +# ssl-cert=/etc/mysql/server-cert.pem +# ssl-key=/etc/mysql/server-key.pem + + + +[mysqldump] +quick +quote-names +max_allowed_packet = 16M + +[mysql] +#no-auto-rehash # faster start of mysql but no tab completition + +[isamchk] +key_buffer = 16M + +# +# * NDB Cluster +# +# See /usr/share/doc/mysql-server-*/README.Debian for more information. +# +# The following configuration is read by the NDB Data Nodes (ndbd processes) +# not from the NDB Management Nodes (ndb_mgmd processes). +# +# [MYSQL_CLUSTER] +# ndb-connectstring=127.0.0.1 + + +# +# * IMPORTANT: Additional settings that can override those from this file! +# +!includedir /etc/mysql/conf.d/ + diff --git a/debian/additions/mysql-server.lintian-overrides b/debian/additions/mysql-server.lintian-overrides new file mode 100644 index 00000000000..9d741cf16e9 --- /dev/null +++ b/debian/additions/mysql-server.lintian-overrides @@ -0,0 +1,2 @@ +W: mysql-dfsg source: maintainer-script-lacks-debhelper-token debian/mysql-server.postinst +W: mysql-server: possible-bashism-in-maintainer-script postinst:68 'p{("a".."z","A".."Z",0..9)[int(rand(62))]}' diff --git a/debian/additions/ndb_mgmd.cnf b/debian/additions/ndb_mgmd.cnf new file mode 100644 index 00000000000..d94a28ff705 --- /dev/null +++ b/debian/additions/ndb_mgmd.cnf @@ -0,0 +1,35 @@ +[NDBD DEFAULT] +NoOfReplicas=2 +DataMemory=10MB +IndexMemory=25MB +MaxNoOfTables=256 +MaxNoOfOrderedIndexes=256 +MaxNoOfUniqueHashIndexes=128 + +[MYSQLD DEFAULT] + +[NDB_MGMD DEFAULT] + +[TCP DEFAULT] + +[NDB_MGMD] +Id=1 # the NDB Management Node (this one) +HostName=127.0.0.1 + +[NDBD] +Id=2 # the first NDB Data Node +HostName=127.0.0.1 +DataDir= /var/lib/mysql-cluster + +[NDBD] +Id=3 # the second NDB Data Node +HostName=127.0.0.1 +DataDir=/var/lib/mysql-cluster + +[MYSQLD] +Id=4 # the first SQL node +HostName=127.0.0.1 + +# [MYSQLD] +# Id=5 # the second SQL node +# HostName=127.0.0.10 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000000..75cb03f081d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,3269 @@ +mysql-5.0 (5.0.38) enterprise; urgency=low + + * Imported packaging work from Debian. + * Removed debian-start, mysqlreport and echo_stderr to align with official + packages. + + -- Monty Taylor Wed, 7 Mar 2007 07:52:55 +0800 + +mysql-dfsg-5.0 (5.0.32-3etch1) testing-proposed-updates; urgency=high + + * Backported upstream patch for a bug that crashed the server when using + certain join/group/limit combinations. + Users of the Joomla CMS seemed to be affected by this. Closes: #403721 + * The debian-start script that runs on every server start now first upgrades + the system tables (if neccessary) and then check them as it sometimes did + not work the other way around (e.g. for MediaWiki). The script now uses + mysql_update instead of mysql_update_script as recommended. Closes: 409780 + * The old_passwords setting that is set according to a Debconf question is + now written to /etc/mysql/conf.d/old_passwords.cnf instead directly to the + conffile /etc/mysql/my.cnf which would be fobidden by policy (thanks to + Robert Bihlmeyer). Closes: #409750 + * Added bison to build dependencies. + * Synced Debconf translations with 5.0.32-7. + + -- Christian Hammers Sun, 18 Feb 2007 22:33:05 +0100 + +mysql-dfsg-5.0 (5.0.32-3) unstable; urgency=high + + * mysql-server-5.0 pre-depends on adduser now and has --disabled-login + explicitly added to be on the safe side (thanks to the puiparts team). + Closes: #408362 + * Corrections the terminology regarding NDB in the comments of all config + files and init scripts (thanks to Geert Vanderkelen of MySQL). + * Updated Swedish Debconf translation (thanks to Andreas Henriksson). + Closes: #407859 + * Updated Czech Debconf translation (thanks to Miroslav Kure). + Closes: #407809 + + -- Christian Hammers Thu, 11 Jan 2007 11:18:47 +0100 + +mysql-dfsg-5.0 (5.0.32-2) unstable; urgency=high + + * The last upload suffered from a regression that made NDB totally + unusable and caused a dependency to libmysqlclient15-dev in the + mysql-server-5.0 package. The relevant 85_* patch was re-added again. + Closes: #406435 + * Added lintian-overrides for an error that does not affect our packages. + There are now only warnings and not errors left. + + -- Christian Hammers Tue, 9 Jan 2007 23:55:10 +0100 + +mysql-dfsg-5.0 (5.0.32-1) unstable; urgency=high + + * New upstream version. + * SECURITY: mysql_fix_privilege_tables.sql altered the + table_privs.table_priv column to contain too few privileges, causing + loss of the CREATE VIEW and SHOW VIEW privileges. (MySQL Bug#20589) + * SECURITY (DoS): ALTER TABLE statements that performed both RENAME TO + and {ENABLE|DISABLE} KEYS operations caused a server crash. (MySQL + Bug#24089) + * SECURITY (DoS): LAST_DAY('0000-00-00') could cause a server crash. + (MySQL Bug#23653) + * SECURITY (DoS): Using EXPLAIN caused a server crash for queries that + selected from INFORMATION_SCHEMA in a subquery in the FROM clause. + (MySQL Bug#22413) + * SECURITY (DoS): Invalidating the query cache (e.g. when using stored procedures) + caused a server crash for INSERT INTO ... SELECT statements that + selected from a view. (MySQL Bug#20045) + * Using mysql_upgrade with a password crashed the server. Closes: #406229 + * yaSSL crashed on pre-Pentium Intel and Cyrix CPUs. (MySQL Bug#21765) + Closes: #383759 + * Lots of small fixes to the NDB cluster storage engine. + * Updated Japanese Debconf template (thanks to Hideki Yamane). + Closes: #405793 + * Fixed comment regarding "mycheck" in debian-start (thanks to + Enrico Zini). Closes: #405787 + + -- Christian Hammers Sat, 6 Jan 2007 14:26:20 +0100 + +mysql-dfsg-5.0 (5.0.30-3) unstable; urgency=low + + * Updated Brazilian Debconf translation (thanks to Andre Luis Lopes). + Closes: #403821 + * Added Romanian Debconf translation (thanks to Stan Ioan-Eugen). + Closes: #403943 + * Updated Spanish Debconf translation (thanks to Javier Fernandez-Sanguino + Pena). Closes: #404084 + * Updated Galician Debconf translation (thanks to Jacobo Tarrio). + Closes: #404318 + * Updated Dutch Debconf translation (thanks to Vincent Zweije). + Closes: #404566 + * Updated Danish Debconf translation (thanks to Claus Hindsgaul). + Closes: #405018 + + -- Christian Hammers Thu, 21 Dec 2006 21:35:09 +0100 + +mysql-dfsg-5.0 (5.0.30-2) unstable; urgency=high + + * Fixed upstream regression in header files that lead to FTBFS for + mysql-admin, mysql-query-browser and probably other pacakges. + (thanks to Andreas Henriksson). Closes: #403081, #403082 + * Fixed some upstream scripts by replacing /etc by /etc/mysql (thanks to + Julien Antony). Closes: #401083 + * Updated French Debconf translation (thanks to Christian Perrier). + Closes: #401434 + * Added Spanish Debconf translation (thanks to Javier Fernandez-Sanguino + Pena). Closes: #401953 + * Marked a Debconf question that is just a dummy and only internally + used as not-needing-translation. Closes: #403163 + * Fixed mysqlslowdump patch to not remove the usage() function (thanks + to Monty Tailor). + + -- Christian Hammers Sun, 3 Dec 2006 19:20:10 +0100 + +mysql-dfsg-5.0 (5.0.30-1) unstable; urgency=low + + * New upstream version (switch to the MySQL Enterprise branch). + * Upstream bugfix for the Innodb performance bug: + "Very poor performance with multiple queries running + concurrently (Bug#15815)". + * Upstream bugfix for a possible server crash: + "Selecting from a MERGE table could result in a server crash if the + underlying tables had fewer indexes than the MERGE table itself + (Bug#22937)" + * Upstream bugfies for *lot* of NDB problems. + * Upstream bugfix for Innodb optimizer bug. Closes: #397597 + * Updated Italian Debconf translation (thanks to Luca Monducci). + Closes: #401305 + * Updated debian/watch file to MySQL Enterprise branch. + + -- Christian Hammers Sat, 2 Dec 2006 16:36:38 +0100 + +mysql-dfsg-5.0 (5.0.27-2) unstable; urgency=medium + + * Disabled YaSSL x86 assembler as it was reported to crash applications + like pam-mysql or proftpd-mysql which are linked against libmysqlclient + on i486 and Cyrix (i586) CPUs. Closes: #385147 + * Adjusted mysql-server-4.1 priority to extra and section to oldlibs + according to the ftp masters overrides. + * Updated German Debconf translation (thanks to Alwin Meschede). + Closes: #400809 + + -- Christian Hammers Wed, 22 Nov 2006 13:36:31 +0100 + +mysql-dfsg-5.0 (5.0.27-1) unstable; urgency=medium + + * New upstream version (but no codechange, the only difference to 5.0.26 + was a patch to the ABI change which Debian already included. + * When dist-upgrading from mysql-server-4.1/sarge dpkg does not longer + ask unnecessary "config file has changed" questions regarding + /etc/init.d/mysql, /etc/logrotate.d/mysql-server and + /etc/mysql/debian-start just because these files previously belonged + to mysql-server-4.1 and not to mysql-server-5.0. + To archive this mysql-server-5.0 now pre-depends on mysql-common which + provides current versions of those files. + * The automatic run mysql_upgrade now works with non-standard datadir + settings, too (thanks to Benjami Villoslada). Closes: #394607 + * Debconf now asks if the old_passwords option is really needed. + * Improved explanations of the old_passwords variable in my.cnf. + * Removed possibly leftover cron script from MySQL-4.1 (thanks to + Mario Oyorzabal Salgado). Closes: #390889 + * Postrm ignores failed "userdel mysql". + * Updated Danish Debconf translation (thanks to Claus Hindsgaul). + Closes: #398784 + * Added Euskarian Debconf translation (thanks to Piarres Beobide). + Closes: #399045 + * Updated Japanese Debconf translation (thanks to Hideki Yamane). + Closes: #399074 + * Updated German Debconf translation (thanks to Alwin Meschede). + Closes: #399087 + * New Portuguese debconf translations from Miguel Figueiredo. + Closes: #398186 + + -- Christian Hammers Tue, 7 Nov 2006 21:26:25 +0100 + +mysql-dfsg-5.0 (5.0.26-3) unstable; urgency=high + + [sean finney] + * Fix for the deadly ISAM trap. Now during upgrades we will do our + very best to convert pre-existing ISAM format tables using the + binaries from the previous package. Success is not guaranteed, but + this is probably as good as it gets. Note that this also necessitates + re-introducing an (empty transitional) mysql-server-4.1 package. + Closes: #354544, #354850 + * Remove a couple spurious and wrongly placed WARNING statements from + 45_warn-CLI-passwords.dpatch. thanks to Dan Jacobsen for pointing these + out. Closes: #394262 + + -- sean finney Fri, 03 Nov 2006 18:34:46 +0100 + +mysql-dfsg-5.0 (5.0.26-2) unstable; urgency=high + + * Fixed FTBFS for Alpha by applying an upstream patch (thanks to Falk + Hueffner). Closes: #395921 + + -- Christian Hammers Sat, 28 Oct 2006 20:13:46 +0200 + +mysql-dfsg-5.0 (5.0.26-1) unstable; urgency=high + + * SECURITY: + This combined release of 5.0.25 and 5.0.26 fixes lot of possible server + crashs so it should get into Etch. Quoting the changelog (bug numbers are + bugs.mysql.com ones): + - character_set_results can be NULL to signify no conversion, but some + code did not check for NULL, resulting in a server crash. (Bug#21913) + - Using cursors with READ COMMITTED isolation level could cause InnoDB to + crash. (Bug#19834) + - Some prepared statements caused a server crash when executed a second + time. (Bug#21166) + - When DROP DATABASE or SHOW OPEN TABLES was issued while concurrently + issuing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE or any other + statement that required a name lock) in another connection, the server + crashed. (Bug#21216) + - Use of zero-length variable names caused a server crash. (Bug#20908) + - For InnoDB tables, the server could crash when executing NOT IN () + subqueries. (Bug#21077) + - Repeated DROP TABLE statements in a stored procedure could sometimes + cause the server to crash. (Bug#19399) + - Performing an INSERT on a view that was defined using a SELECT that + specified a collation and a column alias caused the server to crash + (Bug#21086). + - A query of the form shown here caused the server to crash. (Bug#21007) + - NDB Cluster: Some queries involving joins on very large NDB tables could + crash the MySQL server. (Bug#21059) + - The character set was not being properly initialized for CAST() with a + type like CHAR(2) BINARY, which resulted in incorrect results or even a + server crash. (Bug#17903) + - For certain queries, the server incorrectly resolved a reference to an + aggregate function and crashed. (Bug#20868) + - The server crashed when using the range access method to execut a + subquery with a ORDER BY DESC clause. (Bug#20869) + - Triggers on tables in the mysql database caused a server crash. Triggers + for tables in this database now are disallowed. (Bug#18361) + - Using SELECT on a corrupt MyISAM table using the dynamic record format + could cause a server crash. (Bug#19835) + - Use of MIN() or MAX() with GROUP BY on a ucs2 column could cause a + server crash. (Bug#20076) + - Selecting from a MERGE table could result in a server crash if the + underlying tables had fewer indexes than the MERGE table itself. + (Bug#21617, Bug#22937) + + * New upstream release. + - This bug would cause trouble for Sarge->Etch upgrades, it was supposed to + have been fixed in 5.0.16 but that apparently did not fix the whole + problem: + Using tables from MySQL 4.x in MySQL 5.x, in particular those with VARCHAR + fields and using INSERT DELAYED to update data in the table would result in + either data corruption or a server crash. (Bug#16611, Bug#16218, Bug#17294) + Closes: #386337 + - Fixes data corruption as an automatic client reconnect used to set + the wrong character set. Closes: #365050 + - Fixes an undefined ulong type in an include file. Closes: #389102 + - Fixes wrong output format when using Unicode characters. Closes: #355302 + - Fixes mysql_upgrade when using a password. Closes: #371841 + + [Christian Hammers] + * Removed --sysconfdir from debian/rules as it puts /etc/mysql/ at the + end of the my.cnf search patch thus overriding $HOME/my.cnf + (thanks to Christoph Biedl). Closes: #394992 + * The provided patch from bug #385947 was wrong, the variable is called + BLOCKSIZE not BLOCK_SIZE according to "strings `which df`" (thanks to + Bruno Muller). Closes: #385947 + + [sean finney] + * new dutch debconf translations from Vincent Zweije (closes: #392809). + * new japanese debconf translations from Hideki Yamane (closes: #391625). + * new italian debconf translations from Luca Monducci (closes: #391741). + * new french debconf translations from Christian Perrier (closes: #393334). + * ran debconf-updatepo to merge the fuzzies into svn. + * massage the following patches so they continue to apply cleanly: + - 44_scripts__mysql_config__libs.dpatch to cleanly apply. + - 45_warn-CLI-passwords.dpatch + - 96_TEMP__libmysqlclient_ssl_symbols.dpatch (note, this patch might + no longer be needed, but is retained "just in case" after massaging it) + * the following patches have been incorporated upstream: + - 70_kfreebsd.dpatch + - 80_hurd_mach.dpatch + - 87_ps_Hurd.dpatch + - 90_TEMP__client__mysql_upgrade__O_EXEC.dpatch + - 91_TEMP__client__mysql_upgrade__password.dpatch + - 92_TEMP__client__mysql_upgrade__defaultgroups.dpatch + - 94_TEMP__CVE-2006-4227.dpatch + - 95_TEMP__CVE-2006-4226.dpatch + * the udf_example.cc has disappeared from the source code, but there's + a udf_example.c which seems to be a good example to use instead :) + * update documentation in the configuration to no longer reference + using my.cnf in the DATADIR, as it's never been the recommended + method for debian systems and hasn't worked since 5.0 was released + anyway (closes: #393868). + + -- Christian Hammers Wed, 25 Oct 2006 19:54:04 +0200 + +mysql-dfsg-5.0 (5.0.24a-9) unstable; urgency=medium + + * Having expire_logs_days enabled but log-bin not crashes the server. Using + both or none of those options is safe. To prevent this happening during the + nightly log rotation via /etc/logrotate.d/mysql the initscript checks for + malicious combination of options. See: #368547 + * The Sarge package "mysql-server" which used to include the mysqld daemon + may still be in unselected-configured state (i.e. after a remove but not + purge) in which case its now obsolete cronscript has to be moved away + (thanks to Charles Lepple). Closes: #385669 + * Updated Danish Debconf translation (thanks to Claus Hindsgaul). + Closes: #390315 + * Updated Frensh Debconf translation (thanks to Christian Perrier). + Closes: #390980 + + -- Christian Hammers Tue, 3 Oct 2006 14:55:31 +0200 + +mysql-dfsg-5.0 (5.0.24a-8) unstable; urgency=low + + * (broken upload) + + -- Christian Hammers Tue, 3 Oct 2006 14:55:31 +0200 + +mysql-dfsg-5.0 (5.0.24a-7) unstable; urgency=low + + * Stopped mysql_config from announcing unnecessary library dependencies + which until now cause "NEEDED" dependencies in the "readelf -d" output + of libraries who only depend on libmysqlclient.so (thanks to Michal + Cihar). Closes: #390692 + + -- Christian Hammers Sun, 1 Oct 2006 23:59:43 +0200 + +mysql-dfsg-5.0 (5.0.24a-6) unstable; urgency=low + + [sean finney] + * finally add support for setting a root password at install. + while this is not a random password as requested in one bug + report, we believe it is the best solution and provides a + means to set a random password via preseeding if it's really + desired (Closes: #316127, #298295). + + -- sean finney Sun, 01 Oct 2006 23:34:30 +0200 + +mysql-dfsg-5.0 (5.0.24a-5) unstable; urgency=low + + * Added ${shlibs:Depends} to debian/control section libmysqlclient-dev as it + contains the experimental /usr/lib/mysql/libndbclient.so.0.0.0. + * Bumped standards version to 3.7.2. + * Added LSB info section to init scripts. + * Rephrased Debconf templates as suggested by lintian. + * Added benchmark suite in /usr/share/mysql/sql-bench/. + * The mysql.timezone* tables are now filled by the postinst script (thanks + to Mark Sheppard). Closes: #388491 + * Moved Debconf install notes to README.Debian. Displaying them with + medium priority was a bug anyway. Closes: #388941 + * Replaced /usr/bin/mysql_upgrade by /usr/bin/mysql_upgrade_shell in + /etc/mysql/debian-start.sh as it works without errors (thanks to Javier + Kohen). Closes: #389443 + + -- Christian Hammers Wed, 20 Sep 2006 15:01:42 +0200 + +mysql-dfsg-5.0 (5.0.24a-4) unstable; urgency=high + + * libmysqlclient.so.15 from 5.0.24 accidentaly exports some symbols that are + historically exported by OpenSSL's libcrypto.so. This bug was supposed to + be fixed in 5.0.24a bug according to the mysql bug tracking system will + only be fixed in 5.0.25 so I backported the patch. People already reported + crashing apps due to this (thanks to Duncan Simpson). See also: #385348 + Closes: #388262 + * Fixed BLOCKSIZE to BLOCK_SIZE in initscript (thanks to Bruno Muller). + Closes: #385947 + * Added hint to "--extended-insert=0" to mysqldump manpage (thanks to Martin + Schulze). + * Documented the meaning of "NDB" in README.Debian (thanks to Dan Jacobson). + Closes: #386274 + * Added patch to build on hurd-i386 (thanks to Cyril Brulebois). Closes: #387369 + * Fixed debian-start script to work together with the recend LSB modifications in + the initscript (thanks to wens). Closes: #387481 + * Reverted tmpdir change in my.cnf back to /tmp to comply with FHS (thanks + to Alessandro Valente). Closes: #382778 + * Added logcheck filter rule (thanks to Paul Wise). Closes: #381043 + * I will definetly not disable InnoDB but added a note to the default my.cnf + that disabling it saves about 100MB virtual memory (thanks to Olivier + Berger). Closes: #384399 + * Added thread_cache_size=8 to default my.cnf as this variable seems to have + a negligible memory footprint but can improve performance when lots of + threads connect simultaneously as often seen on web servers. + + -- Christian Hammers Mon, 4 Sep 2006 00:21:50 +0200 + +mysql-dfsg-5.0 (5.0.24a-3) unstable; urgency=low + + * Fixed potential tempfile problem in the newly added mysqlreport script. + + -- Christian Hammers Sun, 3 Sep 2006 23:17:24 +0200 + +mysql-dfsg-5.0 (5.0.24a-2) unstable; urgency=low + + * Added "mysqlreport" (GPL'ed) from hackmysql.com. + * Temporarily disabled expire_days option as it causes the server + to crash. See #368547 + * Made output of init scripts LSB compliant (thanks to David Haerdeman). + Closes: #385874 + + -- Christian Hammers Sun, 3 Sep 2006 19:06:53 +0200 + +mysql-dfsg-5.0 (5.0.24a-1) unstable; urgency=high + + * New upstream version. + * The shared library in the 5.0.24 upstream release accidently exported + some symbols that are also exported by the OpenSSL libraries (notably + BN_bin2bn) causing unexpected behaviour in applications using these + functions (thanks to Peter Cernak). Closes: #385348 + * Added note about possible crash on certain i486 clone CPUs. + * Made recipient address of startup mysqlcheck output configurable + (thanks to Mattias Guns). Closes: #385119 + + -- Christian Hammers Mon, 28 Aug 2006 01:22:12 +0200 + +mysql-dfsg-5.0 (5.0.24-3) unstable; urgency=high + + * SECURITY: + CVE-2006-4226: + When run on case-sensitive filesystems, MySQL allows remote + authenticated users to create or access a database when the database + name differs only in case from a database for which they have + permissions. + CVE-2006-4227: + MySQL evaluates arguments of suid routines in the security context of + the routine's definer instead of the routine's caller, which allows + remote authenticated users to gain privileges through a routine that + has been made available using GRANT EXECUTE. + Thanks to Stefan Fritsch for reporting. Closes: #384798 + + -- Christian Hammers Sat, 26 Aug 2006 04:55:17 +0200 + +mysql-dfsg-5.0 (5.0.24-2) unstable; urgency=high + + * 5.0.24-1 introduced an ABI incompatibility, which this patch reverts. + Programs compiled against 5.0.24-1 are not compatible with any other + version and needs a rebuild. + This bug already caused a lot of segfaults and crashes in various + programs. Thanks to Chad MILLER from MySQL for quickly providing a patch. + The shlibdeps version has been increased to 5.0.24-2. + Closes: #384047, #384221, #383700 + + -- Christian Hammers Fri, 25 Aug 2006 21:47:35 +0200 + +mysql-dfsg-5.0 (5.0.24-1) unstable; urgency=high + + * SECURITY: Upstream fixes a security bug which allows a user to continue + accessing a table using a MERGE TABLE after the right to direct access to + the database has been revoked (CVE-2006-4031, MySQL bug #15195). + (Well they did not exactly fixed it, they documented the behaviour and + allow the admin to disable merge table alltogether...). Closes: #380271 + * SECURITY: Applied patch that fixes a possibly insecure filehandling + in the recently added mysql_upgrade binary file (MySQL bug #10320). + * New upstream version. + - Fixes nasty MySQL bug #19618 that leads to crashes when using + "SELECT ... WHERE ... not in (1, -1)" (e.g. vbulletin was affected). + - Fixes upstream bug #16803 so that linking ~/.mysql_history to /dev/null + now has the desired effect of having no history. + * Really fixed the runlevels. Closes: #377651 + * Added patch for broken upstream handling of "host=" to mysql_upgrade.c. + * Adjusted /etc/mysql/debian-start to new mysql_upgrade.c + + -- Christian Hammers Tue, 8 Aug 2006 00:44:13 +0200 + +mysql-dfsg-5.0 (5.0.22-5) unstable; urgency=low + + * Added further line to the logcheck ignore files (thanks to Paul Wise). + Closes: #381038 + + -- Christian Hammers Wed, 2 Aug 2006 00:28:50 +0200 + +mysql-dfsg-5.0 (5.0.22-4) unstable; urgency=low + + * Upstream fixes a bug in the (never released) version 5.0.23 which could + maybe used to crash the server if the mysqlmanager daemon is in use + which is not yet the default in Debian. (CVE-2006-3486 *DISPUTED*) + * Changed runlevel priority of mysqld from 20 to 19 so that it gets started + before apache and proftpd etc. which might depend on an already running + database server (thanks to Martin Gruner). Closes: #377651 + * Added patch which sets PATH_MAX in ndb (thanks to Cyril Brulebois). + Closes: #378949 + * Activated YaSSL as licence issues are settled according to: + http://bugs.mysql.com/?id=16755. This also closes the FTBFS bug + regarding OpenSSL as it is discouraged to use now. Closes: #368639 + * Removed SSL-MINI-HOWTO as the official documentation is good enough now. + * mysql_upgrade no longer gives --password on the commandline which would + be insecure (thanks to Dean Gaudet). Closes: #379199 + * Adjusted debian/patches/45* to make consecutive builds in the same source + tree possible (thanks to Bob Tanner). Closes: #368661 + * mysql-server-5.0 is now suggesting tinyca as yaSSL is enabled and tinyca + was found to be really cool :) + * Moved tempdir from /tmp to /var/tmp as it will more likely have enough + free space as /tmp is often on the root partition and /var or at least + /var/tmp is on a bigger one. + + -- Christian Hammers Mon, 10 Jul 2006 23:30:26 +0200 + +mysql-dfsg-5.0 (5.0.22-3) unstable; urgency=low + + * Added patch for MySQL bug #19618: "select x from x + where x not in(1,-1)" may crash the server" (thanks to + Ruben Puettmann). + + -- Christian Hammers Fri, 9 Jun 2006 01:41:44 +0200 + +mysql-dfsg-5.0 (5.0.22-2) unstable; urgency=high + + * Fixed debian-sys-maint related bug in postinst (thanks to + Jean-Christophe Dubacq). Closes: #369970 + * The last upload was a security patch (which I did not know as I + uploaded before the announcement came). I now added the CVE id for + reference and set urgency to high as the last entry did not. + + -- Christian Hammers Wed, 31 May 2006 01:04:11 +0200 + +mysql-dfsg-5.0 (5.0.22-1) unstable; urgency=low + + * SECURITY: This upstream release fixes an SQL-injection with multibyte + encoding problem. (CVE-2006-2753) + * New upstream release. + * Upstream fixes REPAIR TABLE problem. Closes: #354300 + * Upstream fixes problem that empty strings in varchar and text columns + are displayed as NULL. Closes: #368663 + + -- Christian Hammers Tue, 30 May 2006 23:43:24 +0200 + +mysql-dfsg-5.0 (5.0.21-4) unstable; urgency=low + + * Added "BLOCKSIZE=" to the diskfree check (thanks to Farzad FARID). + Closes: #367027, #367083 + * Further fixed mysql_upgrade upstream script (thanks to Andreas Pakulat) + Closes: #366155 + * Adjusted the /proc test in debian/rules from /proc/1 to /proc/self + to make building on grsec systems possible (thanks to K. Rosenegger). + Closes: #366824 + * Updated Russion Debconf translation (thanks to Yuriy Talakan). + Closes: #367141 + * Updated Czech Debconf translation (thanks to Kiroslav Kure). + Closes: #367160 + * Updated Galician Debconf translation (thanks to Jacobo Tarrio). + Closes: #367384 + * Updated Swedish Debconf translation (thanks to Daniel Nylander). + Closes: #368186 + + -- Christian Hammers Wed, 10 May 2006 08:45:42 +0200 + +mysql-dfsg-5.0 (5.0.21-3) unstable; urgency=low + + * Fixed FTBFS problem which was caused by a patch that modifies Makefile.am + as well as Makefile.in and was not deteced because my desktop was fast + enough to patch both files within the same second and so fooled automake. + (thanks to Blars Blarson for notifying me). Closes: #366534 + + -- Christian Hammers Sat, 6 May 2006 19:03:58 +0200 + +mysql-dfsg-5.0 (5.0.21-2) unstable; urgency=low + + * Fixed bug in postinst that did not correctly rewrite + /etc/mysql/debian.cnf (thanks to Daniel Leidert). + Closes: #365433, #366155 + + -- Christian Hammers Thu, 4 May 2006 02:37:03 +0200 + +mysql-dfsg-5.0 (5.0.21-1) unstable; urgency=high + + * SECURITY: New upstream release with some security relevant bugfixes: + * "Buffer over-read in check_connection with usernames lacking a + trailing null byte" (CVE-2006-1516) + * "Anonymous Login Handshake - Information Leakage" (CVE-2006-1517) + * "COM_TABLE_DUMP Information Leakage and Arbitrary command execution" + (CVE-2006-1518) + Closes: #365938, #365939 + * Added diskfree check to the init script (thanks to Tim Baverstock). + Closes: #365460 + * First amd64 upload! + + -- Christian Hammers Sat, 29 Apr 2006 04:31:27 +0200 + +mysql-dfsg-5.0 (5.0.20a-2) unstable; urgency=low + + * The new mysql-upgrade which is started from /etc/mysql/debian-start + does now use the debian-sys-maint user for authentication (thanks to + Philipp). Closes: #364991 + * Wrote patch debian/patches/43* which adds a password option to + mysql_update. See MySQL bug #19400. + * Added "Provides: libmysqlclient-dev" to libmysqlclient15-dev as I saw no + obvious reasons against it (problems should be documented in + debian/README.Maintainer!) (thanks to Olaf van der Spek). Closes: #364899 + * Updated Netherlands debconf translation (thanks to Vincent Zweije) + Closes: #364464 + * Updated French debconf translation (thanks to Christian Perrier) + Closes: #364401 + * Updated Danish debconf translation (thanks to Claus Hindsgaul) + Closes: #365135 + + -- Christian Hammers Wed, 26 Apr 2006 01:14:53 +0200 + +mysql-dfsg-5.0 (5.0.20a-1) unstable; urgency=low + + * New upstream release. + * Added the new mysql_upgrade script and added it to + /etc/mysql/debian-start (thanks to Alessandro Polverini). + The script is currently very noise that is a known bug and will be + fixed in the next release! + Closes: #363458 + * No longer creates the "test" database. This actuallay had been tried + to archive before (at least patches) exists but apparently was not the + case in the last versions (thanks to Olaf van der Spek). Closes: #362126 + * Reformatted libmysqlclient15off.NEWS.Debian to changelog format + (thanks to Peter Palfrader). Closes: #363062 + + -- Christian Hammers Sat, 15 Apr 2006 13:05:22 +0200 + +mysql-dfsg-5.0 (5.0.20-1) unstable; urgency=high + + * Upstream contains a fix for a nasty bug (MySQL#18153) that users + already experienced and that caused corrupted triggers after + REPAIR/OPTIMIZE/ALTER TABLE statements. + (thanks to Jerome Despatis for pointing out) + * Added patch for the "updates on multiple tables is buggy after + upgrading from 4.1 to 5.0" problem which MySQL has been committed + for the upcoming 5.0.21 release. Closes #352704 + * Added Netherlands debconf translation (thanks to Vincent Zweije). + Closes: #360443 + * Added Galician debconf translation (thanks to Jacobo Tarrio). + Closes: #361257 + + -- Christian Hammers Fri, 7 Apr 2006 00:00:43 +0200 + +mysql-dfsg-5.0 (5.0.19-3) unstable; urgency=high + + [ Christian Hammers ] + * Fixed libmysqlclient15.README.Debian regarding package name changes + (thanks to Leppo). + * Moved libheap.a etc. back to /usr/lib/mysql/ as their names are just + too generic. Closes: #353924 + [ Sean Finney ] + * updated danish debconf translation, thanks to Claus Hindsgaul + (closes: #357424). + [ Adam Conrad ] + * Send stderr from 'find' in preinst to /dev/null to tidy up chatter. + * Backport patch for CVE-2006-0903 from the upcoming release to resolve + a log bypass vulnerability when using non-binary logs (closes: #359701) + + -- Adam Conrad Tue, 4 Apr 2006 15:23:18 +1000 + +mysql-dfsg-5.0 (5.0.19-2) unstable; urgency=medium + + * New upstream release. + * Renamed package libmysqlclient15 to libmysqlclient15off due to + binary incompatible changes. + See /usr/share/doc/libmysqlclient15off/README.Debian + * Updated Czech debconf translation (thanks to Miroslav Kure). + Closes: #356503 + * Updated French debconf translation (thanks to Christian Perrier). + Closes: #356332 + * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702 + * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian + file is (thanks to Ross Boylan). Closes: #355978 + + -- Christian Hammers Fri, 17 Mar 2006 02:32:19 +0100 + +mysql-dfsg-5.0 (5.0.19-1) experimental; urgency=medium + + * New upstream release. + * SECURITY: CVE-2006-3081: A bug where str_to_date(1,NULL) lead to a + server crash has been fixed. + (this note has been added subsequently for reference) + * Renamed package libmysqlclient15 to libmysqlclient15off. + See /usr/share/doc/libmysqlclient15off/NEWS.Debian + * Updated Czech debconf translation (thanks to Miroslav Kure). + Closes: #356503 + * Updated French debconf translation (thanks to Christian Perrier). + Closes: #356332 + * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702 + * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian + file is (thanks to Ross Boylan). Closes: #355978 + + -- Christian Hammers Tue, 14 Mar 2006 22:56:13 +0100 + +mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=medium + + [ Christian Hammers ] + * When using apt-get the check for left-over ISAM tables can abort the + installation of mysql-server-5.0 but not prevent the mysql-server-4.1 + package from getting removed. The only thing I can do is reflect this + in the Debconf notice that is shown and suggest to reinstall + mysql-server-4.1 for converting. See: #354850 + * Suggests removing of /etc/cron.daily/mysql-server in last NEWS message + (thanks to Mourad De Clerck). Closes: #354111 + * Added versioned symbols for kfreebsd and Hurd, too (thanks to Aurelien + Jarno and Michael Bank). Closes: #353971 + * Added versioned symbols for kfreebsd, too (thanks to Aurelien Jarno). + Closes: #353971 + [ Adam Conrad ] + * Add 39_scripts__mysqld_safe.sh__port_dir.dpatch to ensure that the + permissions on /var/run/mysqld are always correct, even on a tmpfs. + + -- Christian Hammers Mon, 6 Mar 2006 21:42:13 +0100 + +mysql-dfsg-5.0 (5.0.18-8) unstable; urgency=low + + * The rotation of the binary logs is now configured via + expire-logs-days in /etc/mysql/my.cnf and handled completely + by the server and no longer in configured in debian-log-rotate.conf + and handled by a cron job. Thanks to David Johnson. + See /usr/share/doc/mysql-server-5.0/NEWS.Debian + * Ran aspell over some files in debian/ and learned a lot :) + * debian/rules: Added check if versioned symbols are really there. + * Updated SSL-MINI-HOWTO. + * Updated copyright (removed the parts regarding the now removed + BerkeleyDB table handler and mysql-doc package). + * Relocated a variable in preinst (thanks to Michael Heldebrant). + Closes: #349258, #352587, #351216 + * Updated Danish debconf translation (thanks to Claus Hindsgaul). + Closes: #349013 + * Updated Swedish debconf translation (thanks to Daniel Nylander). + Closes: #349522 + * Updated French debconf translation (thanks to Christian Perrier). + Closes: #349592 + * Fixed typo in README.Debian (thanks to Vincent Ricard). + * Prolonged waiting time for mysqld in the init script. Closes: #352070 + + -- Christian Hammers Mon, 23 Jan 2006 23:13:46 +0100 + +mysql-dfsg-5.0 (5.0.18-7) unstable; urgency=low + + * Made mailx in debian-start.inc.sh optional and changed the dependency on it + on it to a mere recommendation. Closes: #316297 + * the previous FTBFS patches for GNU/Hurd inadvertently led to configure + being regenerating, losing a couple trivial things like our versioned + symbols patch, causing many nasty problems (closes: #348854). + + -- sean finney Fri, 20 Jan 2006 20:59:27 +0100 + +mysql-dfsg-5.0 (5.0.18-6) unstable; urgency=low + + * Added version comment (thanks to Daniel van Eeden). + * Added two patches to build on GNU/Hurd (thanks to Michael Bank). + Closes: #348182 + * Abort upgrade if old and now unsupported ISAM tables are present + (thanks to David Coe). Closes: #345895 + + -- Christian Hammers Tue, 17 Jan 2006 19:25:59 +0100 + +mysql-dfsg-5.0 (5.0.18-5) unstable; urgency=low + + * Bump shlibdeps for libmysqlclient15 to (>= 5.0.15-1), which was + the first non-beta release from upstream, as well as being shortly + after we broke the ABI in Debian by introducing versioned symbols. + + -- Adam Conrad Fri, 13 Jan 2006 13:18:03 +1100 + +mysql-dfsg-5.0 (5.0.18-4) unstable; urgency=low + + * Munge our dependencies further to smooth upgrades even more, noting + that we really need 5.0 to conflict with 4.1, and stealing a page from + the book of mysql-common, it doesn't hurt to hint package managers in + the direction of "hey, this stuff is a complete replacement for 4.1" + * Change the description of mysql-server and mysql-client to remove the + references to it being "transition", and instead point out that it's + the way to get the "current best version" of each package installed. + + -- Adam Conrad Wed, 11 Jan 2006 11:39:45 +1100 + +mysql-dfsg-5.0 (5.0.18-3) unstable; urgency=low + + * Make the mysql-{client,server}-5.0 conflict against mysql-{client,server} + versioned, so they can be installed side-by-side and upgrade properly. + * Add myself to Uploaders; since I have access to the alioth repository. + + -- Adam Conrad Tue, 10 Jan 2006 19:15:48 +1100 + +mysql-dfsg-5.0 (5.0.18-2) unstable; urgency=low + + * Removed the transitional package that forced an upgrade from + mysql-server-4.1 to mysql-server-5.0 as I was convinced that + having a general "mysql-server" package with adjusted dependencies + is enough (thanks to Adam Conrad). + * Updated logcheck.ignore files (thanks to Jamie McCarthy). Closes: #340193 + + -- Christian Hammers Mon, 9 Jan 2006 21:54:53 +0100 + +mysql-dfsg-5.0 (5.0.18-1) unstable; urgency=low + + * New upstream version. + * Added empty transitional packages that force an upgrade from the + server and client packages that have been present in Sarge. + * Fixed SSL-MINI-HOWTO (thanks to Jonas Smedegaard). Closes: #340589 + + -- Christian Hammers Mon, 2 Jan 2006 21:17:51 +0100 + +mysql-dfsg-5.0 (5.0.17-1) unstable; urgency=low + + * Never released as Debian package. + + -- Christian Hammers Thu, 22 Dec 2005 07:49:52 +0100 + +mysql-dfsg-5.0 (5.0.16-1) unstable; urgency=low + + * New upstream version. + * Removed the error logs from the logrotate script as Debian does + not use them anymore. Closes: #339628 + + -- Christian Hammers Tue, 22 Nov 2005 01:19:11 +0100 + +mysql-dfsg-5.0 (5.0.15-2) unstable; urgency=medium + + * Added 14_configure__gcc-atomic.h.diff to fix FTBFS on m68k + (thanks to Stephen R Marenka). Closes: #337082 + * Removed dynamic linking against libstdc++ as it was not really + needed (thanks to Adam Conrad). Closes: #328613 + * Fixed the "/var/lib/mysql is a symlink" workaround that accidently + left a stalled symlink (thanks to Thomas Lamy). Closes: #336759 + * As the init script cannot distinguish between a broken startup and + one that just takes very long the "failed" message now says + "or took more than 6s" (thanks to Olaf van der Spek). Closes: #335547 + + -- Christian Hammers Thu, 3 Nov 2005 22:00:15 +0100 + +mysql-dfsg-5.0 (5.0.15-1) unstable; urgency=low + + * New upstream version. 5.0 has finally been declared STABLE! + * Added small patch to debian/rules that fixed sporadic build errors + where stdout and stderr were piped together, got mixed up and broke + * Added --with-big-tables to ./configure (thanks to tj.trevelyan). + Closes: #333090 + * Added capability to parse "-rc" to debian/watch. + * Fixed cronscript (thanks to Andrew Deason). Closes: #335244 + * Added Swedish debconf translation (thanks to Daniel Nylander). + Closes: #333670 + * Added comment to README.Debian regarding applications that manually + set new-style passwords... Closes: #334444 + * Sean Finney: + - Fix duplicate reference to [-e|--extended-insert]. Closes: #334957 + - Fix default behavior for mysqldumpslow. Closes: #334517 + - Reference documentation issue in mysql manpage. Closes: #335219 + + -- Christian Hammers Fri, 30 Sep 2005 00:10:39 +0200 + +mysql-dfsg-5.0 (5.0.13rc-1) unstable; urgency=low + + * New upstream release. Now "release-candidate"! + * Removed any dynamic link dependencies to libndbclient.so.0 which + is due to its version only distributed as a static library. + * Sean Finney: + - FTBFS fix related to stripping rpath in debian/rules + + -- Christian Hammers Mon, 26 Sep 2005 22:09:26 +0200 + +mysql-dfsg-5.0 (5.0.12beta-5) unstable; urgency=low + + * The recent FTBFS were probably result of a timing bug in the + debian/patches/75_*.dpatch file where Makefile.in got patched just + before the Makefile.shared which it depended on. For that reason + only some of the autobuilders failed. Closes: #330149 + * Fixed chrpath removal (option -k had to be added). + * Corrected debconf dependency as requested by Joey Hess. + + -- Christian Hammers Mon, 26 Sep 2005 18:37:07 +0200 + +mysql-dfsg-5.0 (5.0.12beta-4) unstable; urgency=low + + * Removed experimental shared library libndbclient.so.0.0.0 as it + is doomed to cause trouble as long as it is present in both MySQL 4.1 + and 5.0 without real soname and its own package. We still have + libndbclient.a for developers. (thanks to Adam Conrad and + mediaforest.net). Closes: #329772 + + -- Christian Hammers Fri, 23 Sep 2005 12:36:48 +0200 + +mysql-dfsg-5.0 (5.0.12beta-3) unstable; urgency=medium + + * Symbol versioning support! wooooohoooooo! + (thanks to Steve Langasek) Closes: #236288 + * Moved libndbcclient.so.0 to the -dev package as it is provided by + libmysqlclient14 and -15 which must be installable simultaneously. + * Removed mysql-*-doc suggestions. + + -- Christian Hammers Tue, 20 Sep 2005 00:07:03 +0200 + +mysql-dfsg-5.0 (5.0.12beta-2) unstable; urgency=low + + * Added patch to build on GNU/kFreeBSD (thanks to Aurelien Jarno). + Closes: #327702 + * Added patch that was already been present on the 4.1 branch which + makes the "status" command of the init script more sensible + (thanks to Stephen Gildea). Closes: #311836 + * Added Vietnamese Debconf translation (thanks to Clytie Siddal). + Closes: #313006 + * Updated German Debconf translation (thanks to Jens Seidel). + Closes: #313957 + * Corrected commends in example debian-log-rotate.conf. The default is + unlike the mysql-sever-4.1 package which needed to stay backwards + compatible now 2 to avoid filling up the disk endlessly. + * Fixed watch file to be "-beta" aware. + + -- Christian Hammers Thu, 15 Sep 2005 20:50:19 +0200 + +mysql-dfsg-5.0 (5.0.12beta-1) unstable; urgency=medium + + * Christian Hammers: + - New upstream release. + - Changed build-dep to libreadline5-dev as requested by Matthias Klose. + Closes: #326316 + - Applied fix for changed output format of SHOW MASTER LOGS for + binary log rotation (thanks to Martin Krueger). Closes: #326427, #326427 + - Removed explicit setting of $PATH as I saw no sense in it and + it introduced a bug (thanks to Quim Calpe). Closes: #326769 + - Removed PID file creation from /etc/init.d/mysql-ndb as it does + not work with this daemon (thanks to Quim Calpe). + - Updated French Debconf translation (thanks to Christian Perrier). + Closes: #324805 + - Moved conflicts line in debian/control from libmysqlclient15 to + libmysqlclient15-dev and removed some pre-sarge conflicts as + suggested by Adam Majer. Closes: #324623 + * Sean Finney: + - For posterity, CAN-2005-2558 has been fixed since 5.0.7beta. + + -- Christian Hammers Thu, 15 Sep 2005 19:58:22 +0200 + +mysql-dfsg-5.0 (5.0.11beta-3) unstable; urgency=low + + * Temporarily build only with -O2 to circumvent gcc internal errors + (thanks to Matthias Klose). Related to: #321165 + + -- Christian Hammers Thu, 18 Aug 2005 15:44:04 +0200 + +mysql-dfsg-5.0 (5.0.11beta-2) unstable; urgency=low + + * Fixed README.Debian regarding the status of mysql-doc. + * Added "set +e" around chgrp in mysql-server-5.0.preinst to + not fail on .journal files (thanks to Christophe Nowicki). + Closes: #318435 + + -- Christian Hammers Sun, 14 Aug 2005 18:02:08 +0200 + +mysql-dfsg-5.0 (5.0.11beta-1) unstable; urgency=low + + * New upstream version. + * Added Danish Debconf translations (thanks to Claus Hindsgaul). + Closes: #322384 + * Updated Czech Debconf translations (thanks to Miroslav Kure). + Closes: #321765 + + -- Christian Hammers Sat, 13 Aug 2005 11:56:15 +0000 + +mysql-dfsg-5.0 (5.0.10beta-1) unstable; urgency=low + + * New upstream release. + * Christian Hammers: + - Added check for mounted /proc to debian/rules. + * Sean Finney: + - fix for fix_mysql_privilege_tables/mysql_fix_privilege_tables typo + in mysql-server-5.0's README.Debian (see #319838). + + -- Christian Hammers Sun, 31 Jul 2005 00:30:45 +0200 + +mysql-dfsg-5.0 (5.0.7beta-1) unstable; urgency=low + + * Second try for new upstream release. + * Renamed mysql-common-5.0 to mysql-common as future libmysqlclient16 + from e.g. MySQL-5.1 would else introduce mysql-common-5.1 which makes + a simultanous installation of libmysqlclient14 impossible as that + depends on either mysql-common or mysql-common-5.0 but not on future + versions. Thus we decided to always let the newest MySQL version + provide mysql-common. + * Added ${misc:Depends} as suggested by debhelper manpage. + * Raised standard in control file to 3.6.2. + * Removed DH_COMPAT from rules in faviour of debian/compat. + * Checkes for presence of init script before executing it in preinst. + Referres: 315959 + * Added 60_includes_mysys.h__gcc40.dpatch for GCC-4.0 compatibility. + + -- Christian Hammers Wed, 29 Jun 2005 00:39:05 +0200 + +mysql-dfsg-5.0 (5.0.5beta-1) unstable; urgency=low + + * New major release! Still beta so be carefull... + * Added federated storage engine. + + -- Christian Hammers Wed, 8 Jun 2005 19:29:45 +0200 + +mysql-dfsg-4.1 (4.1.12-1) unstable; urgency=low + + * Christian Hammers: + - New upstream release. + - Disabled BerkeleyDB finally. It has been obsoleted by InnoDB. + * Sean Finney: + - Updated French translation from Christian Perrier (Closes: #310526). + - Updated Japanese translation from Hideki Yamane (Closes: #310263). + - Updated Russian translation from Yuriy Talakan (Closes: #310197). + + -- Christian Hammers Sat, 4 Jun 2005 05:49:11 +0200 + +mysql-dfsg-4.1 (4.1.11a-4) unstable; urgency=high + + * Fixed FTBFS problem which was caused due to the fact that last uploads + BerkeleyDB patch was tried to applied on all architectures and not only + on those where BerkeleyDB is actually beeing built. Closes: #310296 + + -- Christian Hammers Mon, 23 May 2005 00:54:51 +0200 + +mysql-dfsg-4.1 (4.1.11a-3) unstable; urgency=high + + * Added patch from Piotr Roszatycki to compile the bundled db3 library + that is needed for the BerkeleyDB support with versioned symbols so + that mysqld no longer crashes when it gets linked together with the + Debian db3 version which happens when e.g. using libnss-db. + Closes: #308966 + + -- Christian Hammers Thu, 19 May 2005 01:41:14 +0200 + +mysql-dfsg-4.1 (4.1.11a-2) unstable; urgency=high + + * Okay, the hackery with /var/lib/dpkg/info/mysql-server.list will not + stand and is removed from the preinst of mysql-server. + * New workaround for the symlink problem that does not involve mucking + with dpkg's file lists is storing the symlinks in a temporary location + across upgrades. + As this sometimes fails since apt-get does not always call new.preinst + before old.postrm, some remarks were added to README.Debian and the + Debconf installation notes to minimize the inconvinience this causes. + + -- sean finney Sun, 15 May 2005 10:25:31 -0400 + +mysql-dfsg-4.1 (4.1.11a-1) unstable; urgency=high + + * Added the "a" to the version number to be able to upload a new + .orig.tar.gz file which now has the non-free Docs/ directory removed + as this has been forgotten in the 4.1.11 release (thanks to Goeran + Weinholt). Closes: #308691 + * The Woody package listed /var/lib/mysql and /var/log/mysql in its + /var/lib/dpkg/info/mysql-server.list. These directories are often + replaced by symlinks to data partitions which triggers a dpkg bug + that causes these symlinks to be removed on upgrades. The new preinst + prevents this by removing the two lines from the .list file + (thanks to Andreas Barth and Jamin W. Collins). See dpkg bug #287978. + * Updated French Debconf translation (thanks to Christian Perrier). + Closes: #308353 + + -- Christian Hammers Thu, 12 May 2005 21:52:46 +0200 + +mysql-dfsg-4.1 (4.1.11-3) unstable; urgency=high + + * The "do you want to remove /var/lib/mysql when purging the package" flag + from old versions is removed once this package is beeing installed so + that purging an old Woody mysql-server package while having a + mysql-server-4.1 package installed can no longer lead to the removal of + all databases. Additionaly clarified the wording of this versions Debconf + template and added a check that skips this purge in the postrm script + if another mysql-server* package has /usr/sbin/mysqld installed. + (thanks to Adrian Bunk for spotting that problem) Closes: #307473 + * Cronfile was not beeing installed as the filename was not in the + correct format for "dh_installcron --name" (thanks to Tomislav + Gountchev). Closes: #302712 + + -- Christian Hammers Sat, 23 Apr 2005 22:55:15 +0200 + +mysql-dfsg-4.1 (4.1.11-2) unstable; urgency=low + + * Sean Finney: + - don't freak out if we can't remove /etc/mysql during purge. + - debian/rules clean works again. + * Christian Hammers: + - Fixed typo in README.Debian (thanks to Joerg Rieger). Closes: #304897 + - Completely removed the passwordless test user as it was not only + insecure but also lead to irritations as MySQL checks first the + permissions of this user and then those of a password having one. + See bug report from Hilko Bengen for details. Closes: #301741 + + -- Christian Hammers Sat, 16 Apr 2005 15:55:00 +0200 + +mysql-dfsg-4.1 (4.1.11-1) unstable; urgency=low + + * New upstream version. + * Upstream fix for charset/collation problem. Closes: #282256 + * Upstream fix for subselect crash. Closes: #297687 + * Corrected minor issue in Debconf template regarding skip-networking + (thanks to Isaac Clerencia). Closes: #303417 + * Made dependency to gawk unnecessary (thanks to Zoran Dzelajlija). + Closes: #302284 + * Removed obsolete 50_innodb_mixlen.dpatch. + * Removed obsolete 51_CAN-2004-0957_db_grant_underscore.dpatch. + + -- Christian Hammers Fri, 8 Apr 2005 00:23:53 +0200 + +mysql-dfsg-4.1 (4.1.10a-7) unstable; urgency=low + + * Sean Finney: + - fix for the mysteriously disappeared cronjob. thanks to + Peter Palfrader for pointing out this omission. + (closes: #302712). + + -- sean finney Sat, 02 Apr 2005 16:54:13 -0500 + +mysql-dfsg-4.1 (4.1.10a-6) unstable; urgency=high + + * Sean Finney: + - the previous upload did not completely address the issue. this one + should do so. d'oh. + + -- sean finney Thu, 31 Mar 2005 03:35:50 +0000 + +mysql-dfsg-4.1 (4.1.10a-5) unstable; urgency=high + + * Sean Finney: + - the following security issue is addressed in this upload: + CAN-2004-0957 (grant privilege escalation on tables with underscores) + thanks to sergei at mysql for all his help with this. + + -- sean finney Wed, 30 Mar 2005 21:19:26 -0500 + +mysql-dfsg-4.1 (4.1.10a-4) unstable; urgency=low + + * Sean Finney: + - FTBFS fix for amd64/gcc-4.0. Thanks to Andreas Jochens + for reporting this (closes: #301807). + - ANSI-compatible quoting fix in daily cron job. thanks to + Karl Hammar for pointing out the problem in + the 4.0 branch. + - Added myself as a co-maintainer in the control file (closes: #295312). + + -- sean finney Tue, 29 Mar 2005 18:54:42 -0500 + +mysql-dfsg-4.1 (4.1.10a-3) unstable; urgency=low + + * BerkeleyDB is now disabled by default as its use is discouraged by MySQL. + * Added embedded server libraries as they finally do compile. + They are currently in libmysqlclient-dev as they are still + experimental and only available as .a library (thanks to Keith Packard). + Closes: #297062 + * Fixed obsolete "tail" syntax (thanks to Sven Mueller). Closes: #301413 + * Added CAN numbers for the latest security bugfix upload. + * Updated manpage of mysqlmanager (thanks to Justin Pryzby). Closes: #299844 + * Added comments to default configuration. + + -- Christian Hammers Sun, 20 Mar 2005 17:40:18 +0100 + +mysql-dfsg-4.1 (4.1.10a-2) unstable; urgency=low + + * Disabled "--with-mysqld-ldflags=-all-static" as it causes sig11 crashes + if LDAP is used for groups in /etc/nsswitch.conf. Confirmed by Sean Finney + and Daniel Dehennin. Closes: #299382 + + -- Christian Hammers Mon, 14 Mar 2005 03:01:03 +0100 + +mysql-dfsg-4.1 (4.1.10a-1) unstable; urgency=high + + * SECURITY: + - The following security related updates are addressed: + CAN-2005-0711 (temporary file creation with "CREATE TEMPORARY TABLE") + CAN-2005-0709 (arbitrary library injection in udf_init()) + CAN-2005-0710 (arbitrary code execution via "CREATE FUNCTION") + Closes: #299029, #299031, #299065 + * New Upstream Release. + - Fixes some server crash conditions. + - Upstream includes fix for TMPDIR overriding my.cnf tmpdir setting + Closes: #294347 + - Fixes InnoDB error message. Closes: #298875 + - Fixes resouce limiting. Closes: #285044 + * Improved checking whether or not the server is alive in the init script + which should make it possible to run several mysqld instances in + different chroot environments. Closes: #297772 + * Fixed cron script name as dots are not allowed (thanks to Michel + v/d Ven). Closes: #298447 + * Added -O3 and --with-mysqld-ldflags=-all-static as MySQL recommends to + build the server binary statically in order to gain about 13% more + performance (thanks to Marcin Kowalski). + * Added patch to let mysqld_safe react to signals (thanks to Erich + Schubert). Closes: #208364 + * (Thanks to Sean Finney for doing a great share of work for this release!) + + -- Christian Hammers Thu, 3 Mar 2005 02:36:39 +0100 + +mysql-dfsg-4.1 (4.1.10-4) unstable; urgency=medium + + * Fixed bug that prevented MySQL from starting after upgrades. + Closes: #297198, #296403 + * Added comment about logging to syslog to the default my.cnf + and the logrotate script (thanks to Ryszard Lach). Closes: #295507 + + -- Christian Hammers Thu, 3 Mar 2005 00:28:02 +0100 + +mysql-dfsg-4.1 (4.1.10-3) unstable; urgency=low + + * Sean Finney: Cronjobs now exit silently when the server package + has been removed but not purged (thanks to Vineet Kumar). + Closes: #297404 + * Fixed comments of /etc/mysql/debian-log-rotate.conf (thanks to + Philip Ross). Closes: #297467 + * Made mysqld_safe reacting sane on signals (thanks to Erich Schubert). + Closes: #208364 + + -- Christian Hammers Tue, 1 Mar 2005 19:44:34 +0100 + +mysql-dfsg-4.1 (4.1.10-2) unstable; urgency=low + + * Converted to dpatch. + * debian/ is now maintained via Subversion on svn.debian.org. + + -- Christian Hammers Tue, 1 Mar 2005 02:16:36 +0100 + +mysql-dfsg-4.1 (4.1.10-1) unstable; urgency=low + + * New upstream version. + * Upstream fixed memleak bug. Closes: #205587 + * Added debian/copyright.more for personal reference. + * Lowered default query cache size as suggested by Arjen from MySQL. + * Switched from log to log-bin as suggested by Arjen from MySQL. + * Fixed typo in my.cnf (thanks to Sebastian Feltel). Closes: #295247 + * Replaced --defaults-extra-file by --defaults-file in Debian scripts + as former lets password/host etc be overwriteable by /root/.my.cnf. + Added socket to /etc/mysql/debian.cnf to let it work. (thanks to + SATOH Fumiyasu). Closes: #295170 + + -- Christian Hammers Tue, 15 Feb 2005 23:47:02 +0100 + +mysql-dfsg-4.1 (4.1.9-4) unstable; urgency=low + + * Improved the way mysqld is started and registered with update-rc.d + in cases where the admin modifies the runlevel configuration. + Most notably removed the debconf question whether or not mysql should + start on when booting. Closes: #274264 + * Renamed configuration option old-passwords to the more preferred + naming convention old_passwords. Same for some others (thanks to + Patrice Pawlak). Closes: #293983 + + -- Christian Hammers Tue, 8 Feb 2005 02:21:18 +0100 + +mysql-dfsg-4.1 (4.1.9-3) unstable; urgency=low + + * Renamed ca_ES.po to ca.po to reach a broader audience (thanks to + Christian Perrier). Closes: #293786 + * Expicitly disabled mysqlfs support as it has never been enabled by + configure during the autodetection but fails due to broken upstream + code when users try to build the package theirselves while having + liborbit-dev installed which triggers the mysqlfs autodetection + (thanks to Max Kellermann). Closes: #293431 + * Added dependencies to gawk as one script does not work with original-awk + (thanks to Petr Ferschmann). Closes: #291634 + + -- Christian Hammers Sun, 6 Feb 2005 23:33:11 +0100 + +mysql-dfsg-4.1 (4.1.9-2) unstable; urgency=high + + * SECURITY: + For historical reasons /usr/share/mysql/ was owned and writable by + the user "mysql". This is a security problem as some scripts that + are run by root are in this directory and could be modified and used + by a malicious user who already has mysql privileges to gain full root + rights (thanks to Matt Brubeck). Closes: #293345 + * Changed "skip-networking" to "bind-address 127.0.0.1" which is more + compatible and not less secure but maybe even more, as less people enable + networking for all interfaces (thanks to Arjen Lentz). + * Enabled InnoDB by default as recommended by Arjen Lentz from MySQL. + * Added remarks about hosts.allow to README.Debian (thanks to David + Chappell). Closes: #291300 + * mysql-server-4.1 now provides mysql-server (thanks to Paul van den Berg). + Closes: #287735 + + -- Christian Hammers Wed, 2 Feb 2005 23:31:55 +0100 + +mysql-dfsg-4.1 (4.1.9-1) unstable; urgency=low + + * New upstream version. + * mysql-client-4.1 now provides "mysql-client" so that packages depending + on mysql-client (ca. 40) can now be used with MySQL-4.1, too. + + -- Christian Hammers Sun, 23 Jan 2005 22:52:48 +0100 + +mysql-dfsg-4.1 (4.1.8a-6) unstable; urgency=high + + * SECURITY: + Javier Fernandez-Sanguino Pena from the Debian Security Audit Project + discovered a temporary file vulnerability in the mysqlaccess script of + MySQL that could allow an unprivileged user to let root overwrite + arbitrary files via a symlink attack and could also could unveil the + contents of a temporary file which might contain sensitive information. + (CAN-2005-0004, http://lists.mysql.com/internals/20600) Closes: #291122 + + -- Christian Hammers Tue, 18 Jan 2005 23:11:48 +0100 + +mysql-dfsg-4.1 (4.1.8a-5) unstable; urgency=medium + + * Fixed important upstream bug that causes from_unixtime(0) to return + NULL instead of "1970-01-01 00:00:00" which fails on NOT NULL columns. + Closes: #287792 + * Fixes upstream bug in mysql_list_fields() . Closes: #282486 + * Fixes bug that lead to double rotated logfiles when mysql-server 4.0 + was previously installed (thanks to Olaf van der Spek). Closes: #289851 + * Fixed typo in README.Debian (thanks to Mark Nipper). Closes: #289131 + * Changed max_allowed_packet in my.cnf to 16M as in 4.0.x (thanks to + Olaf van der Spek). Closes: #289840 + * Updated French debconf translation (thanks to Christian Perrier). + Closes: #287955 + + -- Christian Hammers Thu, 13 Jan 2005 01:29:05 +0100 + +mysql-dfsg-4.1 (4.1.8a-4) unstable; urgency=low + + * Broken patch again :-( + + -- Christian Hammers Sun, 9 Jan 2005 23:47:55 +0100 + +mysql-dfsg-4.1 (4.1.8a-3) unstable; urgency=low + + * The mutex patch was a bit too x86 centric. This broke the alpha build. + + -- Christian Hammers Sun, 9 Jan 2005 14:18:49 +0100 + +mysql-dfsg-4.1 (4.1.8a-2) unstable; urgency=medium + + * Some Makefiles that were patched by me got overwritten by the GNU + autotools, probably because I also patched ./configure. Fixed now, + the critical mutex patch is now back in again. Closes: #286961 + * Added patch to make MySQL compile on ARM (thanks to Adam Majer). + Closes: #285071 + + -- Christian Hammers Thu, 6 Jan 2005 09:30:13 +0100 + +mysql-dfsg-4.1 (4.1.8a-1) unstable; urgency=medium + + * Upstream 4.1.8 had some problems in their GNU Autotools files so they + released 4.1.8a. Debian's 4.1.8 was fixed by running autoreconf but this + again overwrote MySQL changes to ltmain.sh which are supposed to fix some + problems on uncommon architectures (maybe the FTBFS on alpha, arm, m68k + and sparc?). + * libmysqlclient_r.so.14 from 4.1.8-3 also missed a link dependency to + libz which lead to unresolved symbols visible with "ldd -r" (thanks + to Laurent Bonnaud). Closes: #287573 + + -- Christian Hammers Wed, 29 Dec 2004 14:26:33 +0100 + +mysql-dfsg-4.1 (4.1.8-3) unstable; urgency=low + + * Fixed checking for error messages by forcing english language + output by adding LC_ALL=C to debian-start (thanks to Rene + Konasz) Closes: #285709 + * Fixed bashisms in Debian scripts. Closes: #286863 + * Updated Japanese Debconf translation (thanks to Hideki Yamane). + Closes: #287003 + * Improved 4.0 to 4.1 upgrade if /var/lib/mysql is a symlink + (thanks to Thomas Lamy). Closes: #286560 + * Added patch for FTBFS problem where no LinuxThreads can be found. + I don't know if this still applies but it should not hurt. + The patch is debian/patches/configure__AMD64-LinuxThreads-vs-NPTL.diff + + -- Christian Hammers Sun, 26 Dec 2004 14:04:20 +0100 + +mysql-dfsg-4.1 (4.1.8-2) unstable; urgency=low + + * If /var/lib/mysql is a symlink then it is kept as such. + * Added the old-passwords option to the default my.cnf to stay + compatible to clients that are still compiled to libmysqlclient10 + and libmysqlclient12 for licence reasons. + * Adjusted tetex build-deps to ease backporting (thanks to Norbert + Tretkowski from backports.org). + + -- Christian Hammers Tue, 21 Dec 2004 01:00:27 +0100 + +mysql-dfsg-4.1 (4.1.8-1) unstable; urgency=medium + + * New upstream version. Closes: #286175 + * Added conflict to libmysqlclient-dev (thanks to Adam Majer). + Closes: #286538 + * Added debconf-updatepo to debian/rules:clean. + * Updated Japanese Debconf translation (thanks to Hideki Yamane). + Closes: #285107 + * Updated French Debconf translation (thanks to Christian Perrier). + Closes: #285977 + * Renamed cz.po to cs.po (thanks to Miroslav Kure). Closes: #285438 + * Aplied patch for changed server notice to debian-start (thanks to + Adam Majer). Closes: #286035 + * Changed nice value in default my.cnf as nohup changed its behaviour + (thanks to Dariush Pietrzak). Closes: #285446 + * Increased verbosity of preinst script in cases where it cannot stop + a running server (thanks to Jan Minar). Closes: #285982 + * Splitted the code parts of /etc/mysql/debian-start to + /usr/share/mysql/debian-start.inc.sh (thanks to Jan Minar). + Closes: #285988 + + -- Christian Hammers Mon, 20 Dec 2004 00:33:21 +0100 + +mysql-dfsg-4.1 (4.1.7-4) unstable; urgency=medium + + * Removed OpenSSL support. + After a short discussion with MySQL, I decided to drop OpenSSL support as + 1. MySQL started shipping their binaries without it, too and do not + seem to support it in favour of using a different library somewhen. + 2. MySQL did not adjust their licence to grant permission to link + against OpenSSL. + 3. Even if they did, third parties who use libmysqlclient.so often + do not realise licencing problems or even do not want OpenSSL. + (thanks to Jordi Mallach and the responders to MySQL bug #6924) + Closes: #283786 + * debian/control: Improved depends and conflicts to mysql-4.0. + + -- Christian Hammers Thu, 2 Dec 2004 22:02:28 +0100 + +mysql-dfsg-4.1 (4.1.7-3) unstable; urgency=low + + * Raised version to make it higher as the one in experimental. + + -- Christian Hammers Wed, 1 Dec 2004 21:09:20 +0100 + +mysql-dfsg-4.1 (4.1.7-2) unstable; urgency=low + + * Patched scripts/mysql_install_db so that it no longer creates a + passwordless test database during installation (thanks to Patrick + Schnorbus). Closes: #281158 + * Added Czech debconf translation (thanks to Miroslav Kure). + Closes: #283222 + + -- Christian Hammers Wed, 1 Dec 2004 01:29:31 +0100 + +mysql-dfsg-4.1 (4.1.7-1) unstable; urgency=low + + * New upstream branch! + * Adjusted debian/control to make this package suitable to get parallel + to version 4.0.x into unstable and sarge. The package names are + different so that "mysql-server" still defaults to the rock-stable + 4.0 instead to this announced-to-be-stable 4.1. + * Added --with-mutex=i86/gcc-assemler to the Berkeley-DB configure + to prevent the use of NPLT threads when compiling under kernel 2.6 + because the binaries are else not runable on kernel 2.4 hosts. + Closes: #278638, #274598 + + -- Christian Hammers Sun, 31 Oct 2004 20:15:03 +0100 + +mysql-dfsg (4.1.6-1) experimental; urgency=low + + * New upstream version. + * Fixed symlinks in libmysqlclient-dev package. Closes: #277028 + * This time I did not update the libtool files as they were pretty + up to date and I want to have a shorter diff file. + + -- Christian Hammers Wed, 20 Oct 2004 00:07:58 +0200 + +mysql-dfsg (4.1.5-3) experimental; urgency=low + + * debian/postinst: mysql_install_db changed parameter from --IN-RPM + to --rpm which caused problems during installs. Closes: #276320 + + -- Christian Hammers Sat, 16 Oct 2004 20:36:46 +0200 + +mysql-dfsg (4.1.5-2) experimental; urgency=low + + * Activated support for ndb clustering (thanks to Kevin M. Rosenberg). + Closes: #275109 + + -- Christian Hammers Wed, 6 Oct 2004 01:58:00 +0200 + +mysql-dfsg (4.1.5-1) experimental; urgency=low + + * WARNING: + The upstream branch 4.1 is still considered BETA. + The Debian packages for 4.1 were done without big testing. If you miss + a new functionality or binary, contact me and I check add the relevant + configure option or include the program. + * New MAJOR upstream version. + Thanks to the great demand here's now the first MySQL 4.1 experimental + release. FEEDBACK IS WELCOME. + * 4.0->4.1 notes: + - debian/patches/alpha.diff could not be applied, I fix that later + - debian/patches/scripts__mysql_install_db.sh.diff was obsolete + - debian/patches/scripts__Makefile.in was neccessary due to a dependency + to the removed non-free Docs/ directory. Upstream has been contacted. + - Build-Deps: += automake1.7 + - debian/rules: embedded servers examples did not compile, removed + + -- Christian Hammers Sun, 26 Sep 2004 19:46:47 +0200 + +mysql-dfsg (4.0.21-3) unstable; urgency=low + + * Upstream tried to fix a security bug in mysqlhotcopy and broke it :-) + Applied a patch (see debian/patches) from Martin Pitt. Closes: #271632 + * Between 4.0.20 and 4.0.21 the Debian specific changes in + /usr/bin/mysqld_safe that piped the error log to syslog got lost + and are now back again. + * Fixed capitalization in debconf headings. + * Changed wording of the initscript status message to make heartbeat + happier. Closes: #271591 + + -- Christian Hammers Fri, 17 Sep 2004 18:42:25 +0200 + +mysql-dfsg (4.0.21-2) unstable; urgency=medium + + * The dependencies between mysql-client and libmysqlclient12 were + too loose, when upgrading only the client this can lead to non working + binaries due to relocation errors (thanks to Dominic Cleal). + Closes: #271803 + * Fixed typo in mysqldump.1 manpage (thanks to Nicolas Francois). + Closes: #271334 + + -- Christian Hammers Wed, 15 Sep 2004 15:38:11 +0200 + +mysql-dfsg (4.0.21-1) unstable; urgency=high + + * SECURITY: + This upstream version fixes some security problems that might at least + allow a DoS attack on the server. + * Fixed an old bug in concurrent accesses to `MERGE' tables (even + one `MERGE' table and `MyISAM' tables), that could've resulted in + a crash or hang of the server. (Bug #2408) + * Fixed bug in privilege checking where, under some conditions, one + was able to grant privileges on the database, he has no privileges + on. (Bug #3933) + * Fixed crash in `MATCH ... AGAINST()' on a phrase search operator + with a missing closing double quote. (Bug #3870) + * Fixed potential memory overrun in `mysql_real_connect()' (which + required a compromised DNS server and certain operating systems). + (Bug #4017) + * New upstream version. + * Fixes bug that made x="foo" in WHERE sometimes the same as x="foo ". + Closes: #211618 + * Updated Japanese Debconf translation (thanks to Hideki Yamane). + Closes: #271097 + + -- Christian Hammers Sat, 11 Sep 2004 23:15:44 +0200 + +mysql-dfsg (4.0.20-14) unstable; urgency=low + + * Dave Rolsky spottet that -DBIG_JOINS was not properly enabled. + It allowes joining 64 instead of an 32 tables to join. + + -- Christian Hammers Thu, 9 Sep 2004 20:24:02 +0200 + +mysql-dfsg (4.0.20-13) unstable; urgency=medium + + * Fixed a bug in the initscript which caused the check for not properly + closed i.e. corrupt tables that is executed when the server starts + not to run in background as supposed. + Although the check does not repair anything on servers with several + thousand tables the script was reported to take some minutes which + is quite annoying. (Thanks to Jakob Goldbach). Closes: #270800 + + -- Christian Hammers Thu, 9 Sep 2004 17:11:05 +0200 + +mysql-dfsg (4.0.20-12) unstable; urgency=medium + + * Filter messages regarding table handles that do not support CHECK TABLE + in the script that checks for corrupted tables on every start which lead + to unnecessary mails (thanks to David Everly). Closes: #269811 + * Added a note to the corrupt-table-check mail which notes that a + false-positive is reported in the case that immediately after starting + the server a client starts using a table (thanks to Uwe Kappe). + Closes: #269985 + * Added "quote-names" as default to the [mysqldump] section in + /etc/mysql/my.cnf as too many users stumble over dump files that + could not be read in again due to the valid use of reserved words + as table names. This has also be done by upstream in 4.1.1 and has + no known drawbacks. Closes: #269865 + * Binary logs can now be rotated as well. Defaults to off, though, for + compatibilty reasons (thanks to Mark Ferlatte). Closes: #94230, #269110 + * The mysql user "debian-sys-maint" now gets all possible rights which + makes binary logging possible and helps other package maintainer who + wants to use it to create package specific databases and users. + * Added example how to change daemon nice level via /etc/mysql/my.cnf + * Updated French debconf translations (thanks to Christian Perrier). + Closes: #265811 + * Renamed options in the default config file that still had old names + (thanks to Yves Kreis). Closes: #266445 + * Fixed spelling in debconf note. + * Added -l and -L to dh_shlibdeps. + + -- Christian Hammers Fri, 3 Sep 2004 20:10:46 +0200 + +mysql-dfsg (4.0.20-11) unstable; urgency=high + + * SECURITY + This version fixes a security flaw in mysqlhotcopy which created + temporary files in /tmp which had predictable filenames and such + could be used for a tempfile run attack. + The issue has been recorded as CAN-2004-0457. + + -- Christian Hammers Sat, 14 Aug 2004 18:27:19 +0200 + +mysql-dfsg (4.0.20-10) unstable; urgency=low + + * MySQL finally updated their copyright page and installed v1.5 of + the "Free/Libre and Open Source Software License (FLOSS) - Exception" + which will hopefully end the license hell they created by putting the + client libraries under GPL instead of LGPL which conflicts with PHP and + other software that used to link against MySQL. + The license text is not yet in any release MySQL version but visible + on their web site and copied into the debian/copyright file. + Special thanks to Zak Greant and the debian-legal list + for helping to solve this release critical problem. + Closes: #242449 + * Updated Brazil debconf translation (thanks to Andre Luis Lopes). + Closes: #264233 + * Updated Japanese debconf translation (thanks to Hideki Yamane). + Closes: #264620 + * Fixed minor typo in debconf description (thanks to TROJETTE Mohammed + Adnene). Closes: #264840 + * Improved init and preinst script which now detects stalled servers which + do no longer communicate but are present in the process list (thanks to + Henrik Johansson). Closes: #263215 + + -- Christian Hammers Mon, 9 Aug 2004 19:44:28 +0200 + +mysql-dfsg (4.0.20-9) unstable; urgency=medium + + * Partly reverted the last patch which gave the mysql-user + "debian-sys-maint" more rights as there are old versions of MySQL which + have fewer privlige columns. Now only those are set (thanks to Alan Tam). + Closes: #263111 + + -- Christian Hammers Tue, 3 Aug 2004 13:03:02 +0200 + +mysql-dfsg (4.0.20-8) unstable; urgency=low + + * The mysqlcheck that is started from the initscript will now be + backgrounded because it might else prevent the boot process to continue. + It also now notifies root by mail and syslog if a table is corrupt. + * The "debian-sys-maint" MySQL user now has almost full rights so that other + packages might use this account to create databases and user (thanks to + Andreas Barth). Closes: #262541 + * Added paranoid rules for logcheck. + + -- Christian Hammers Sun, 1 Aug 2004 21:00:55 +0200 + +mysql-dfsg (4.0.20-8) unstable; urgency=low + + * Upload stalled. Not released. + + -- Christian Hammers Sun, 1 Aug 2004 20:27:55 +0200 + +mysql-dfsg (4.0.20-7) unstable; urgency=medium + + * Solved the upstream bug that error messages of the server are written + in a file that is then rotated away leaving mysqld logging effectively + to /dev/null. It now logs to a /usr/bin/logger process which puts the + messages into the syslog. + Modified files: /etc/init.d/mysql, /usr/bin/mysqld_safe and the + logchecker files. Closes: #254070 + * The initscript does no longer call mysqlcheck directly but via + /etc/mysql/debian-start which is a user customizable config script. + * Splitted the debconf "install and update notes" and only show them + when it is appropriate (thanks to Steve Langasek). Closes: #240515 + * Added NEWS.Debian. + * Added hint to -DBIG_ROWS, which is currently not used, to README.Debian. + * Corrected typo in myisampack manpage (thanks to Marc Lehmann). + Closes: #207090 + * Added Catalan debconf translation (thanks to Aleix Badia i Bosch). + Closes: #236651 + + -- Christian Hammers Wed, 28 Jul 2004 01:41:51 +0200 + +mysql-dfsg (4.0.20-6) unstable; urgency=low + + * The build arch detected by configure was "pc-linux-gnu (i686)" + instead of "pc-linux-gnu (i386)". Was no problem AFAIK but + Adam Majer asked me to explicitly change it to i386. Closes: #261382 + * Removed some unused shell scripts from /usr/share/mysql. + * Added lintian overrides. + * Removed rpath by using chrpath. + + -- Christian Hammers Mon, 26 Jul 2004 00:17:12 +0200 + +mysql-dfsg (4.0.20-5) unstable; urgency=medium + + * The mysqlcheck in the init script is only called when the server + is really alive. Also, the mysql-user 'debian-sys-maint' now has + global select rights (thanks to Nathan Poznick). Closes: #261130 + * Moved the debconf question whether to remove the databases or not + from mysql-server.config to mysql-server.postrm so that it shows + up on purge time and not months earlier (thanks to Wouter Verhelst). + Closes: #251838 + + -- Christian Hammers Fri, 23 Jul 2004 22:41:13 +0200 + +mysql-dfsg (4.0.20-4) unstable; urgency=low + + * Added a "mysqlcheck -A --fast" to the 'start' section of the + init script to help admins detect corrupt tables after a server crash. + Currently it exists with an error message but leaves the server + running. Feedback appreciated! + * Made postinst script more robust by calling db_stop earlier and + so prevent pipe-deadlocks. + * Fixed minor typos in initscript (thanks to "C.Y.M."). Closes: 259518 + * Added the undocumented "-DBIG_JOINS" that MySQL apparently uses in + their MAX binaries. It enables 62 instead of 30 tables in a "join". + (thanks to Dave Rolsky). Closes: #260843 + * Added a "df --portability /var/lib/mysql/." check to the preinst + script as users experienced hard to kill hanging mysqlds in such + a situation (thanks to Vaidas Pilkauskas). Closes: #260306 + + -- Christian Hammers Fri, 23 Jul 2004 00:51:32 +0200 + +mysql-dfsg (4.0.20-3) unstable; urgency=low + + * Improved tolerance if the init script has been deleted (thanks to + Leonid Shulov for spotting the problem). + * Minor wording changes to README.Debian generalizing /root/ by $HOME + (thanks to Santiago Vila). Closes: #257725 + * Added Japanese debconf translation (thanks to Hideki Yamane). + Closes: #256485 + * Fixed commend in my.cnf regarding logfile directory (thanks to Jayen + Ashar). Closes: #253434 + * Correted "ease to" by "ease of" in package description (thanks to + Johannes Berg). Closes: #253510 + + -- Christian Hammers Fri, 9 Jul 2004 00:57:42 +0200 + +mysql-dfsg (4.0.20-2) unstable; urgency=low + + * Removed RPM .spec file from the included documentation as it is pretty + useless (thanks to Loic Minier). + * Added turkish debconf translation (thanks to Recai Oktas). Closes: #252802 + + -- Christian Hammers Sun, 6 Jun 2004 14:48:26 +0200 + +mysql-dfsg (4.0.20-1) unstable; urgency=low + + * New upstream version. + + -- Christian Hammers Mon, 31 May 2004 23:36:39 +0200 + +mysql-dfsg (4.0.18-8) unstable; urgency=low + + * Updated french translation (thanks to Christian Perrier). Closes: #246789 + + -- Christian Hammers Tue, 4 May 2004 23:26:54 +0200 + +mysql-dfsg (4.0.18-7) unstable; urgency=low + + * Added CVE ids for the recent security fixes. + 4.0.18-4 is CAN-2004-0381 (mysqlbug) and + 4.0.18-6 is CAN-2004-0388 (mysql_multi) + + -- Christian Hammers Mon, 19 Apr 2004 18:32:03 +0200 + +mysql-dfsg (4.0.18-6) unstable; urgency=medium + + * SECURITY: + Fixed minor tempfile-run security problem in mysqld_multi. + Unprivileged users could create symlinks to files which were then + unknowingly overwritten by run when this script gets executed. + Upstream informed. Thanks to Martin Schulze for finding this. + + -- Christian Hammers Wed, 7 Apr 2004 01:28:22 +0200 + +mysql-dfsg (4.0.18-5) unstable; urgency=low + + * Little improvements in debian scripts for last upload. + * Added check to logrotate script for the case that a mysql + server is running but not be accessible with the username and + password from /etc/mysql/debian.conf (thanks to Jeffrey W. Baker). + Closes: 239421 + + -- Christian Hammers Sun, 4 Apr 2004 15:27:40 +0200 + +mysql-dfsg (4.0.18-4) unstable; urgency=medium + + * SECURITY: + Aplied fix for unprobable tempfile-symlink security problem in + mysqlbug reported by Shaun Colley on bugtraq on 2004-03-24. + * Updated french debconf translation (thanks to Christian Perrier). + Closes: #236878 + * Updated portugesian debconf translation (thanks to Nuno Senica). + Closes: #239168 + * Updated german debconf translation (thanks to Alwin Meschede). + Closes: #241749 + * Improved debconf template regarding fix_privileges_tables (thanks + to Matt Zimmermann for suggestions). Closes: #219400 + * Improved README.Debian regarding to password settings (thanks to + Yann Dirson). Closes: #241328 + + -- Christian Hammers Sat, 3 Apr 2004 19:52:15 +0200 + +mysql-dfsg (4.0.18-3) unstable; urgency=medium + + * Added Build-Depend to po-debconf to let it build everywhere. + + -- Christian Hammers Wed, 31 Mar 2004 23:43:33 +0200 + +mysql-dfsg (4.0.18-2) unstable; urgency=low + + * Added a "2>/dev/null" to a "which" command as there are two + "which" versions in Debian of which one needs it. Closes: #235363 + + -- Christian Hammers Tue, 2 Mar 2004 23:31:28 +0100 + +mysql-dfsg (4.0.18-1) unstable; urgency=low + + * New upstream version. + * Should now compile and run on ia64 (thanks to Thorsten Werner and + David Mosberger-Tang). Closes: #226863 #228834 + * Converted init scripts to invoce-rc.d (thanks to Erich Schubert). + Closes: 232118 + * Secondlast upload changed logfile location. Closes: #182655 + * Updated Brasilian translation (thanks to Andre Luis Lopes). Closes: + #219847 + + -- Christian Hammers Tue, 17 Feb 2004 23:44:58 +0100 + +mysql-dfsg (4.0.17-2) unstable; urgency=low + + * Improved manpage for mysqldumpslow.1 (thanks to Anthony DeRobertis). + Closes: #231039 + * Improved stopping of crashed daemons in init script (thanks to + Matthias Urlichs). Closes: #230327 + + -- Christian Hammers Mon, 9 Feb 2004 21:54:29 +0100 + +mysql-dfsg (4.0.17-1) unstable; urgency=low + + * Made logging into /var/log/mysql/ the default. Closes: #225206 + + * New upstream version. Closes: #225028 + * Turned on a 25MB query cache by default (thanks to Cyril Bouthors). + Closes: #226789 + * Updated russian translation (thanks to Ilgiz Kalmetev). Closes: #219263 + * Upstream fixes the problem that AND was not commutative (thanks for + Iain D Broadfoot for mentioning). Closes: #227927 + * Fixed minor typo in my.cnf comments (thanks to James Renken). + Closes: #221496 + * Better documents regex. Closes: #214952 + * Fixed minor germanism in debconf template (thanks to Marc Haber). + Closes: #224148 + * Added explaining comment to my.cnf regarding quoted passwords + (Thanks to Patrick von der Hagen). Closes: #224906 + * Changed "find -exec" to "find -print0 | xargs -0" in preinst to + speed it up. Thanks to Cyril Bouthors. Closes: #220229 + + -- Christian Hammers Sun, 18 Jan 2004 16:16:25 +0100 + +mysql-dfsg (4.0.16-2) unstable; urgency=low + + * Tried to repair undefined weak symbols by adding a little Makefile + patch. Closes: #215973 + + -- Christian Hammers Mon, 27 Oct 2003 22:52:10 +0100 + +mysql-dfsg (4.0.16-1) unstable; urgency=low + + * New upstream release. + (Mostly little memory problems and other bugfixes it seems) + * Replaced "." by ":" in chown calls to comply with the env setting + "_POSIX2_VERSION=2000112" (thanks to Robert Luberda). Closes: #217399 + * Adjusted syntax in my.cnf to 4.x standard (thanks to Guillaume Plessis). + Closes: #217273 + * Improved README.Debian password instructions (thanks to Levi Waldron). + Closes: #215046 + * Improved NIS warning debconf-template (thanks to Jeff Breidenbach). + Closes: #215791 + * Explicitly added libssl-dev to the libmysqlclient-dev package as it + is needed for mysql_config and the libmysqlclient package only depends + on libssl which has no unnumbered .so version (thanks to Simon Peter + and Davor Ocelic). Closes: #214436, #216162 + * Added "-lwrap" to "mysql_config --libmysqld-libs" and filed it as + upstream bug #1650 (thanks to Noah Levitt). Closes: #214636 + + -- Christian Hammers Sat, 25 Oct 2003 01:09:27 +0200 + +mysql-dfsg (4.0.15a-1) unstable; urgency=low + + * Same package as 4.0.15-2 but I could not convince the Debian + installer to move the packages out of incoming. + + -- Christian Hammers Tue, 7 Oct 2003 15:10:26 +0200 + +mysql-dfsg (4.0.15-2) unstable; urgency=low + + * Updated package description (thanks to Adrian Bunk). Closes: #210988 + * Fixed small typos in manpages (thanks to Nicolas Francois). + Closes: #211983 + * More updates to package description (thanks to Matthias Lutz/ddtp). + Closes: #213456 + * Updated standards to 3.6.1. + * Closes "new 4.0.15 available" bug. Closes: #213349 + * Updated README.Debian with notes regarding the MySQL manual section + "2.4 Post-installation Setup and Testing" (thanks to Daniel B.). + Closes: #210841 + + -- Christian Hammers Fri, 3 Oct 2003 15:59:39 +0200 + +mysql-dfsg (4.0.15-1) unstable; urgency=high + + * SECURITY: + Users who are able to use the "ALTER TABLE" command on the "mysql" + database may be able to exploit this vulnerability to gain a shell with + the privileges of the mysql server (usually running as the 'mysql' user). + Closes: #210403 + * Fixes small description typos (thanks to Oscar Jarkvik). + * Updated Brazilian Portuguese debconf translation. (thanks to Andre Luis + Lopes). Closes: 208030 + * Replaced depricated '.' by ':' in chown (thanks to Matt Zimmerman). + * Fixed manpage typo (thanks to Marc Lehmann). Closes: #207090 + + -- Christian Hammers Fri, 3 Oct 2003 15:59:35 +0200 + +mysql-dfsg (4.0.14-1) unstable; urgency=low + + * New upstream version. + + -- Christian Hammers Sun, 24 Aug 2003 16:40:36 +0200 + +mysql-dfsg (4.0.13-3) unstable; urgency=low + + * Now start mysqld as default unless you choose not when configurig + with debconf priority low. So packages depending on the server when + installing can access it. Thanks Matt Zimmermann (Closes: #200277) + * Made mysql-server de-installable if the config and database files were + removed by hand before. Thanks to Ard van Breemen (Closes: #200304) + + -- Christian Hammers Tue, 8 Jul 2003 22:30:40 +0200 + +mysql-dfsg (4.0.13-2) unstable; urgency=low + + * Added "nice" option for mysqld_safe to give mysqld a different priority. + Submitted to upstream as MySQL Bug #627. Closes: #192087 + * Fixed possible unbound variable in init script. Closes: #194621 + * Fixed french debconf translation (thx Christian Perrier) Closes: #194739 + * Get rid of automake1.5 (for Eric Dorland). + + -- Christian Hammers Wed, 11 Jun 2003 18:58:32 +0200 + +mysql-dfsg (4.0.13-1) unstable; urgency=medium + + * New upstream version. + !!! Fixes a very bad natural join bug which justifies the urgency=medium. + !!! http://bugs.mysql.com/bug.php?id=291 + * Fixed mysql_fix_privileges manpage (Frederic Briere) Closes: #191776 + * preinst: "which" is more chatty normal executable than as builtin. + (Thanks to David B Harris). Closes: #188659 + + -- Christian Hammers Tue, 6 May 2003 22:03:45 +0200 + +mysql-dfsg (4.0.12-3) unstable; urgency=medium + + * Reincluded new way of creating my debian-sys-maint user from + an old release from experimental. Now works again with old + and new privilege table format. (Thanks to Vincent Danjean + for spotting the problem) Closes: #188201 + * Reincluded hurd build dependency fix from 3.23 branch. + (Thanks to Robert Millan). Closes: #185929 + * Fixed soname in libmysqlclient-dev. Closes: #188160 + * Remove /var/log/mysql/ when purging the package. Closes: #188064 + * Removed /usr/share/doc/mysql/ from mysql-server. Closes: #188066 + * Let group "adm" be able to read logfiles. Closes: #188067 + * Do not call usermod on every upgrade. Closes: #188248 + (Thanks to Philippe Troin for the last three) + * Fixed mysql-server.preinst so that it works on shells where + which is a builtin, too. (Thanks to Erich Schubert) Closes: #181525 + + -- Christian Hammers Fri, 11 Apr 2003 11:32:45 +0200 + +mysql-dfsg (4.0.12-2) unstable; urgency=low + + * + * NEW MAJOR UPSTREAM RELEASE: + * + MySQL 4 has finally been declared as 'stable'. Hurray! Read changelogs. + Thanks to all testers, esp. Jose Luis Tallon, of the versions + that were in the "experimental" section before. + * Modified postinst script to run mysql_fix_privileges on every update. + IMPORTANT: Please report if this breaks anything, it is not supposed to. + * Wrote a SSL-MINI-HOWTO.txt! + * Added zlib1g-dev to libmysqlclient12-dev. Closes: 186656 + * Changed section of libmysqlclient12-dev to libdevel. + * Added even more selfwritten manpages. + * Fixed typos. + + -- Christian Hammers Sun, 6 Apr 2003 13:47:32 +0200 + +mysql-dfsg (4.0.10.gamma-1) experimental; urgency=low + + * New upstream version. + * They merged some of my patches from debian/patches. Whoa! + * This release should fix the error-logfile problem where mysqld + keeps the error.log open while logrotate removes it. + + -- Christian Hammers Wed, 12 Feb 2003 22:39:48 +0100 + +mysql-dfsg (4.0.9.gamma-1) experimental; urgency=low + + * New upstream version. + * Updated the GNU autoconf files to make building on MIPS work. + See bug #176829. + + -- Christian Hammers Wed, 29 Jan 2003 22:07:44 +0100 + +mysql-dfsg (4.0.8.gamma-1) experimental; urgency=low + + * New upstream release. + * Improved logging of init script. Closes: #174790 + * We have now libmysqlclient.so.12 instead of .11. + + -- Christian Hammers Thu, 9 Jan 2003 20:14:11 +0100 + +mysql-dfsg (4.0.7.gamma-1) experimental; urgency=high + + * SECURITY: This version fixes an upstream security release that is only + present in the 4.x branch which is currently only in the + experimental distribution and therefore will not get a DSA. + * New upstream release. + + -- Christian Hammers Sat, 28 Dec 2002 15:51:39 +0100 + +mysql-dfsg (4.0.6.gamma-2) experimental; urgency=low + + * Added --system to addgroup. Closes: #173866 + + -- Christian Hammers Sat, 21 Dec 2002 15:28:26 +0100 + +mysql-dfsg (4.0.6.gamma-1) experimental; urgency=low + + * New upstream version. Now Gamma! + * There are no longer changes to the .orig.tar.gz neccessary to make diff + happy. docs/ has still to be deleted, although, as it is non-free. + * Incorporated patches from unstable. + * Added mysqlmanager and a couple of other new scripts. + * Enabled libmysqld embedded server library. + * Enabled SSL and Virtual-IO support. + (CORBA based MySQL-FS seems to be not existing..) + + -- Christian Hammers Fri, 20 Dec 2002 22:30:51 +0100 + +mysql-dfsg (4.0.5a.beta-3) experimental; urgency=low + + * Modified postinst to work with old and new mysql.user table format + and fixed spelling typo in postinst. Thanks to Roger Aich. + * Updated config.{guess,sub} to make the mipsel porters happy. + Thanks to Ryan Murray. Closes: #173553 + + -- Christian Hammers Wed, 18 Dec 2002 15:56:34 +0100 + +mysql-dfsg (4.0.5a.beta-2) experimental; urgency=low + + * Upstream removed option "--skip-gemini". So did I. Closes: 173142 + + -- Christian Hammers Tue, 17 Dec 2002 10:35:49 +0100 + +mysql-dfsg (4.0.5a.beta-1) experimental; urgency=low + + * First 4.x experimental package due to continuous user requests :-) + Please test and report! + * upstream: safe_mysqld has been renamed to mysqld_safe + * upstream: new library soname version libmysqlclient.so.11 + * Renamed libmysqlclientXX-dev to libmysqlclient-dev as I don't plan to + support more than one development environment and this makes the + dependencies easier. + * FIXME: Skipped parts of the debian/patches/alpha patch as the global.h + is not existing. + * FIXME: How to get rid this? Old ltconfig patch already applied. + "lintian: binary-or-shlib-defines-rpath ./usr/bin/mysql /usr/lib/mysql" + + -- Christian Hammers Sun, 1 Dec 2002 18:32:32 +0100 + +mysql-dfsg (3.23.53-4) unstable; urgency=medium + + * Fixed errno.h problem. Closes: #168533, #168535 + + -- Christian Hammers Sun, 10 Nov 2002 18:32:08 +0100 + +mysql-dfsg (3.23.53-3) unstable; urgency=medium + + * Changed automake build-dep to unversioned automake1.4. Closes: #166391 + * Fixed description. Closes: #167270 + (Thanks to Soren Boll Overgaard) + + -- Christian Hammers Tue, 5 Nov 2002 01:25:01 +0100 + +mysql-dfsg (3.23.53-2) unstable; urgency=low + + * Reverted user creation in init scripts. Closes: #166432 + (Thanks to Birzan George Cristian) + + -- Christian Hammers Thu, 31 Oct 2002 15:36:25 +0100 + +mysql-dfsg (3.23.53-1) unstable; urgency=low + + * New upstream release. + + -- Christian Hammers Thu, 24 Oct 2002 23:04:16 +0200 + +mysql-dfsg (3.23.52-3) unstable; urgency=low + + * Substituted the first-install 'debian-sys-maint' user creation by + something ANSI SQL compliant. Closes: #163497 + (Thanks to Karl Hammar) + * Tightend dependency to debhelper (>= 4.0.12) to be sure that + debconf-utils gets installed, too, as I use dh_installdebconf. + * Fixed upstream manpage bug in mysqldump.1. Closes: #159779 + (Thanks to Colin Watson) + * Added comment about MIN_WORD_LEN to mysql-server.README.Debian + (Thanks to Philipp Dreimann) + * Added a dependency for zlib1g-dev to libmysqlclient10-dev. + (Thanks to Jordi Mallach) + + -- Christian Hammers Sun, 15 Sep 2002 17:14:44 +0200 + +mysql-dfsg (3.23.52-2) unstable; urgency=low + + * Fixed typo in preinst scripts. + * Removed bashism in init script. + * Fixed ambiguous debconf example. Closes: #158884 + + -- Christian Hammers Fri, 30 Aug 2002 00:51:29 +0200 + +mysql-dfsg (3.23.52-1) unstable; urgency=low + + * New upstream version. Closes: #157731 + * Clearified the meaning of the debian-sys-maint special user in the + README.Debian file. Closes: #153702 + * Wrote some words regarding the skip-networking in README.Debian. + Closes: #157038 + * Added dependency to passwd. + * Fixes typo and unnecessarily complication in is_mysql_alive(). + * Added check for /etc/mysql/my.cnf in init script. + + -- Christian Hammers Tue, 27 Aug 2002 01:53:32 +0200 + +mysql-dfsg (3.23.51-4) unstable; urgency=low + + * Added a compressed "nm mysqld" output to allow people to trace + core dumps with /usr/bin/resolve_stack_dump as suggested in the + INSTALL-SOURCE file. Thanks to atudor@labs.agilent.com for the hint. + + -- Christian Hammers Wed, 24 Jul 2002 20:44:55 +0200 + +mysql-dfsg (3.23.51-3) unstable; urgency=low + + * Corrected copyright file: the MySQL client library is licenced under + the LGPL-2 not the GPL. From version 4.x it actually will be GPL this + is why parts of http://www.mysql.com/ already say so. Closes: #153591 + * Corrected german translation. + Thanks to Roland Rosenfeld . Closes: #151903 + + -- Christian Hammers Thu, 11 Jul 2002 20:32:28 +0200 + +mysql-dfsg (3.23.51-2) unstable; urgency=low + + * Improved NIS tolerance in preinst script. + + -- Christian Hammers Sun, 7 Jul 2002 04:43:28 +0200 + +mysql-dfsg (3.23.51-1) unstable; urgency=medium + + * New upstream version. + * I applied a patch that fixes a binary imcompatibility in + the shared libary libmysqlclient.so.10 between 3.23.50 and + some versions earlier. Upstream has been contacted and asked + for clarification. Closes: #149952 + * Added support for NIS i.e. it shows a warning and fails if the + needed 'mysql' user does not exists but works if it does. + Closes: #143282, #147869 + * Substituted $0 in init scripts by something really weird so that + "./S20mysql restart" works now, too. (BTW: S20? install file-rc!!!) + Closes: #148658 + * Now postinst works even if /etc/init.d/mysql is removed. Closes: #151021 + * Decided to leave "set +x" in postinst but wrote comment. Closes: #151022 + + -- Christian Hammers Sun, 7 Jul 2002 04:43:25 +0200 + +mysql-dfsg (3.23.50-1) unstable; urgency=medium + + * New upstream version. + Fixes a very annoying and important bug that lets all mysql programs + including perl scripts etc. segfault when using the read_default_group() + function. 3.23.50 is currently a pre-release and expected to be released + next week. I plan to propose it for woody as soon as its stability has + been proven. The following bug reports are all regarding this issue. + Closes: #144960, #145322, #136798, #138143, + + -- Christian Hammers Sat, 18 May 2002 21:14:01 +0200 + +mysql-dfsg (3.23.49x-1) unstable; urgency=low + + * I had to split the package to seperate the manual as it is not GPL + like the rest of the software and docs but under a license that + e.g. forbids selling printed versions. + . + The upstream authors were contacted a while ago but did not like to + change the situation. + . + The names of the resulting packages have not changed as the manual + already was in a seperate mysql-doc package due to it's size. + The source packages are now splitted from one "mysql" to + "mysql-dfsg" in main and "mysql-nonfree" in non-free. + * No code change! + The "x" at the end of the version number ist just to be able to + upload a new source package. ("a" was already taken by upstream + for their binary upload correction) + + -- Christian Hammers Wed, 8 May 2002 02:01:41 +0200 + +mysql (3.23.49-8) unstable; urgency=low + + * Substituted $0 in init script to let e.g. "/etc# ./init.d/mysql restart" + works, too. Closes: #141555 + + -- Christian Hammers Sun, 7 Apr 2002 15:00:44 +0200 + +mysql (3.23.49-7) unstable; urgency=low + + * The Makefiles are totally broken for the --enable-local-infile + option. I now patched libmysql/libmysql.c#mysql_init() manually. + Closes: #138347 + + -- Christian Hammers Fri, 29 Mar 2002 23:55:15 +0100 + +mysql (3.23.49-6) unstable; urgency=low + + * Moved mysqlcheck from server to client package. Closes: #139799 + * Added manpage for mysqlhotcopy. Regarding: #87097 + * Added 'sharedscripts' directive to the logrotate script. + * Replaced grep by /usr/bin/getent to let the group/user checking work + on NIS/LDAP systems, too. Closes: #115677, #101529 + + -- Christian Hammers Fri, 22 Mar 2002 22:40:51 +0100 + +mysql (3.23.49-5) unstable; urgency=low + + * Added skip-innodb to default my.cnf. + * Enabled --enable-local-infile, it seems to be a new option that + defaults to disable a formerly enabled feaure. Closes: #137115 + + -- Christian Hammers Sat, 16 Mar 2002 00:29:10 +0100 + +mysql (3.23.49-4) unstable; urgency=medium + + * Recompiled against fixed libz. + + * Enabled --enable-local-infile, it seems to be a new option that + defaults to disable a formerly enabled feaure. Closes: #137115 + * Fixed README.compile_on_potato. Closes: #136529 + * Now a ext3 .jounal file in /var/lib/mysql does not prevent the + installation (happens when creating a jounal on an already mounted + partition). Closes: #137146 + + -- Christian Hammers Wed, 13 Mar 2002 13:34:24 +0100 + +mysql (3.23.49-3) unstable; urgency=low + + * Added Russian translation. Closes: #135846 + * Fixed installation of .info documents. Closes: #135030 + + -- Christian Hammers Wed, 27 Feb 2002 23:36:35 +0100 + +mysql (3.23.49-2) unstable; urgency=low + + * Updated french translation and split template files. Closes: #134754 + * Fixed a small debian.cnf related bug in mysql-server.postinst. + + -- Christian Hammers Tue, 19 Feb 2002 23:13:58 +0100 + +mysql (3.23.49-1) unstable; urgency=low + + * New upstream release. + (Mainly InnoDB related fixes) + * Exported a $HOME variable in the scripts so that /root/.my.cnf + is not read anymore. This will avoid problems when admins put + only passwords but no usernames in this file. Closes: #132048 + * New debian-sys-maint password algorithm (now ~96bit :-)) Closes: #133863 + * Recreating debian-sys-main pwd on every install to help people who + accidently delete user or password files... + * Added /var/log/mysql so that user can put the binary logs in there as + mysql cannot write the .001 etc files itself in /var/log which is + owned by root. + + -- Christian Hammers Thu, 14 Feb 2002 22:17:45 +0100 + +mysql (3.23.47-6) unstable; urgency=low + + * Dropped a sentence about the new debian-sys-maint user in the + debconf note and updated the README.Debian. Related: #132048 + * Added more french translation. Closes: #132390 + + -- Christian Hammers Wed, 6 Feb 2002 09:41:29 +0100 + +mysql (3.23.47-5) unstable; urgency=low + + * Fixed grammar error in template. Closes: #132238 + * Really fixed typo in logrotate script. Closes: #131711 + + -- Christian Hammers Tue, 5 Feb 2002 14:20:08 +0100 + +mysql (3.23.47-4) unstable; urgency=medium + + * Fixes typo in postinst that let init script fail. Closes: #131743 + * Fixed bashism bug that failed on ash. Closes: #131697 + * Fixed typo in logrotate script. Closes: #131711 + + -- Christian Hammers Thu, 31 Jan 2002 23:58:46 +0100 + +mysql (3.23.47-3) unstable; urgency=low + + * Added new Debian specific mysql user called 'debian-sys-maint' which + is used for pinging the server status, flushing the logs or shutting + down the server in maintenance scripts. The credentials of this user + are stored in the UID0-only readable file /etc/mysql/debian.cnf. + Closes: #129887, #130326, #99274 + * Fixed unintended server startup at boottime. Closes: #122676, #130105 + * New upstream fixes command line parsing bug: Closes: #128473 + * Fixed manpage headers to let apropos work: Closes: #119122 + * Added "status" options for /etc/init.d/mysql. Closes: #129020 + + -- Christian Hammers Sun, 27 Jan 2002 19:46:11 +0100 + +mysql (3.23.47-2) unstable; urgency=low + + * Enhanced init scripts by using mysqladmin instead of kill $pid. + Thanks to Aaron Brick. + + -- Christian Hammers Fri, 18 Jan 2002 01:42:23 +0100 + +mysql (3.23.47-1) unstable; urgency=low + + * New upstream release. + * Updated brazilian translation of debconf descriptions. Closes: #123332 + + -- Christian Hammers Sun, 6 Jan 2002 21:11:17 +0100 + +mysql (3.23.46-3) unstable; urgency=low + + * Fixed bug in postinst where a script was accidently called with + "bash -c